On 15/11/2017 at 07:20, xxxxxxxx wrote:
I have an objectplugin with 2 children.
In GetVirtualObjects(), the children are placed under a Boolean and converted to a mesh using MCOMMAND_CURRENTSTATETOOBJECT.
That is all ok, but when I place a texture behind the generator and a second texture on one of the children, the texture on the generator is not displayed. The texture on the child is displayed.
Example:
- generator + texture
- child 1
- child 2 + texture
I am obviously forgetting a flag, but which one?
Here the code:
def GetVirtualObjects(self, op, hierarchyhelp) :
doc = op.GetDocument()
if op.GetDown() is None or op.GetDown().GetNext() is None:
return c4d.BaseObject(c4d.Onull)
res = op.GetAndCheckHierarchyClone(hierarchyhelp, op.GetDown(), c4d.HIERARCHYCLONEFLAGS_0, True)
if res['dirty'] == False:
return res['clone']
objA = res['clone'].GetDown()
objB = objA.GetNext()
boolObj = c4d.BaseObject(c4d.Oboole)
boolObj[c4d.BOOLEOBJECT_HIGHQUALITY] = True
boolObj[c4d.BOOLEOBJECT_SINGLE_OBJECT] = True
boolObj[c4d.BOOLEOBJECT_SEL_CUT_EDGES] = True
boolObj[c4d.BOOLEOBJECT_HIDE_NEW_EDGES] = True
boolObj[c4d.BOOLEOBJECT_BREAK_CUT_EDGES] = True
boolObj[c4d.BOOLEOBJECT_TYPE] = 1
objB.InsertUnder(boolObj)
objA.InsertUnder(boolObj)
objList = c4d.utils.SendModelingCommand(
command = c4d.MCOMMAND_CURRENTSTATETOOBJECT,
list = [boolObj],
mode = c4d.MODELINGCOMMANDMODE_ALL,
doc = doc)
if objList == False:
#print "Error Current State to object Bool!"
return None
return objList[0]