Plugin doesn't work if child has tag(tex,dynamics,
- 
On 17/12/2017 at 15:25, xxxxxxxx wrote:
I have a test plugin that simply extrudes all polygons from its child object.
It's working without any problems when the child object has a phong tag or most of the other tags, but seems like certain tags can't be used with it. For example, if I attempt to assign dynamics tag, texture tag, Compositing tag ... it stops working.
I can't see any error messages in the console.Which part of this code should I change in order to bypass this issue?
Thanks.

- def GetVirtualObjects(self, op, hh) :
 - #Check child Object
 - child = op.GetDown()
 - if not child: return None
 - #Create clone
 - cloneGenerator = op.GetAndCheckHierarchyClone(hh, child, c4d.HIERARCHYCLONEFLAGS_ASPOLY, False)
 - dirty = cloneGenerator["dirty"]
 - clone = cloneGenerator["clone"]
 - children = clone.GetChildren()
 - if not dirty:
 - return clone
 - #Crete Connect Generator
 - connect = c4d.BaseObject(1011010)
 - connect[c4d.CONNECTOBJECT_WELD] = False
 - clone.InsertUnder(connect)
 - #Make Editable
 - res1 = c4d.utils.SendModelingCommand(command = c4d.MCOMMAND_CURRENTSTATETOOBJECT,
 - list = [connect],
 - doc = child.GetDocument())[0]
 - #Extrude all polygons
 - settings = c4d.BaseContainer()
 - settings[c4d.MDATA_EXTRUDE_OFFSET] = op[10000]
 - res = c4d.utils.SendModelingCommand (command = c4d.ID_MODELING_EXTRUDE_TOOL,
 - list = [res1],
 - mode = c4d.MODELINGCOMMANDMODE_POLYGONSELECTION,
 - bc = settings,
 - doc = child.GetDocument())
 - #Return Result
 - return res1
 
 - 
On 19/12/2017 at 08:17, xxxxxxxx wrote:
I had similar issues running the CURRENTSTATETOOBJECT-command.
If I remember correctly, depending on the tags it returns a null-object with the converted object underneath. So you'll need to check if res1 is a null-object and if so if "res1.GetDown()" returns a polygonal object.Phil
 - 
On 19/12/2017 at 09:13, xxxxxxxx wrote:
Hi,
I confirm the behavior outlined by Phil.
Current State to Object command keeps objects with hierarchical tags and inserts these under a null object that is returned, instead of just a polygon object.