<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I delete with python some object in the node Mash/Repro ? in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/how-can-i-delete-with-python-some-object-in-the-node-mash-repro/m-p/8327257#M9019</link>
    <description>&lt;P&gt;Below is the solution. Besides I have no idea how can I access some individual mesh inside the mash network, and give them different objectives.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import maya.OpenMayaUI as mui
from shiboken2 import wrapInstance 

usingPyside2 = False
try:
    import PySide2
    usingPyside2 = True
except:
    pass
from flux.imports import *
from flux.core import pix
import flux.core as fx

import mash_repro_aetemplate
import mash_repro_utils
from mash_repro_icons import MASH_REPRO_ICONS

from functools import partial
import MASH.undo as undo

def get_maya_window():
    ptr = mui.MQtUtil.mainWindow()
    if ptr is not None:
        return wrapInstance(long(ptr), qt.QMainWindow)

def refresh_all_aetemplates(force=False):
    """ Refresh all the repro aetemplates"""
    widgets = get_maya_window().findChildren(AEMASH_ReproTemplate) or []
    for widget in widgets:
        global SCENE_OPENED
        SCENE_OPENED = True
        widget.update_data(widget.node, force=force)
        SCENE_OPENED = False

widgets = get_maya_window().findChildren(qt.QWidget, 'AEMASH_ReproTemplate') or []

myRepro = widgets[0]

items_count = myRepro.objs_widget.topLevelItemCount()
for id in sorted(range(items_count), reverse=True):
    mash_repro_utils.remove_mesh_group(myRepro.objs_widget.node, id)
    myRepro.objs_widget.obj_dropped.emit(None)	&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Oct 2018 11:13:03 GMT</pubDate>
    <dc:creator>moiamy</dc:creator>
    <dc:date>2018-10-11T11:13:03Z</dc:date>
    <item>
      <title>How can I delete with python some object in the node Mash/Repro ?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/how-can-i-delete-with-python-some-object-in-the-node-mash-repro/m-p/8317166#M9018</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have 56 objects in my node repromesh.&lt;/P&gt;&lt;P&gt;I have listed all the attributes of this node, but can't figure how to delete one (or all) the object in order to replace them with another.&lt;/P&gt;&lt;P&gt;There are some attribute like : instancedGroup.instancedMesh but no value/type I can find.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="repro.jpg" style="width: 794px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/554598i8AFF930B832B471E/image-size/large?v=v2&amp;amp;px=999" role="button" title="repro.jpg" alt="repro.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Oct 2018 12:17:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/how-can-i-delete-with-python-some-object-in-the-node-mash-repro/m-p/8317166#M9018</guid>
      <dc:creator>moiamy</dc:creator>
      <dc:date>2018-10-06T12:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete with python some object in the node Mash/Repro ?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/how-can-i-delete-with-python-some-object-in-the-node-mash-repro/m-p/8327257#M9019</link>
      <description>&lt;P&gt;Below is the solution. Besides I have no idea how can I access some individual mesh inside the mash network, and give them different objectives.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import maya.OpenMayaUI as mui
from shiboken2 import wrapInstance 

usingPyside2 = False
try:
    import PySide2
    usingPyside2 = True
except:
    pass
from flux.imports import *
from flux.core import pix
import flux.core as fx

import mash_repro_aetemplate
import mash_repro_utils
from mash_repro_icons import MASH_REPRO_ICONS

from functools import partial
import MASH.undo as undo

def get_maya_window():
    ptr = mui.MQtUtil.mainWindow()
    if ptr is not None:
        return wrapInstance(long(ptr), qt.QMainWindow)

def refresh_all_aetemplates(force=False):
    """ Refresh all the repro aetemplates"""
    widgets = get_maya_window().findChildren(AEMASH_ReproTemplate) or []
    for widget in widgets:
        global SCENE_OPENED
        SCENE_OPENED = True
        widget.update_data(widget.node, force=force)
        SCENE_OPENED = False

widgets = get_maya_window().findChildren(qt.QWidget, 'AEMASH_ReproTemplate') or []

myRepro = widgets[0]

items_count = myRepro.objs_widget.topLevelItemCount()
for id in sorted(range(items_count), reverse=True):
    mash_repro_utils.remove_mesh_group(myRepro.objs_widget.node, id)
    myRepro.objs_widget.obj_dropped.emit(None)	&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 11:13:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/how-can-i-delete-with-python-some-object-in-the-node-mash-repro/m-p/8327257#M9019</guid>
      <dc:creator>moiamy</dc:creator>
      <dc:date>2018-10-11T11:13:03Z</dc:date>
    </item>
  </channel>
</rss>

