THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/03/2011 at 10:01, xxxxxxxx wrote:
I'll post this here again, because it's only about Python now.
I want to join the hierarchy of the selected Object to one.
But The next objects are added, too, even they are NOT in the list ?!
from c4d import utils
def GetHNext(op, start = None) :
if not op: return
if op.GetDown() :
while (not op.GetNext()) and (op.GetUp()) :
op = op.GetUp()
if start == op:
def GetHierarchyInList(op) :
lst = list()
sop = op
op = GetHNext(op,sop)
def main() :
lst = GetHierarchyInList(op) ## Get the Hierarchy of op
if not lst: return
for i in lst: ## print all Objects in the list
obj = utils.SendModelingCommand(## Use modeling command
command = c4d.MCOMMAND_JOIN,
doc = doc,
list = lst )
doc.InsertObject(obj) ## Insert new Object
obj[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(130/255.0,255/255.0,100/255.0)
I have the following Hierarchy:
I select the Cube and in the list obtained by GetHierarchyInList(op) there is only the Cube and the Sphere, as wanted.
But at the end, all objects are collapsed by MCOMMAND_JOIN.
Any Idea ?
Here an example scene, so you don't have to set up your own.
On 13/03/2011 at 05:06, xxxxxxxx wrote:
On 14/03/2011 at 08:37, xxxxxxxx wrote:
Unfortunately I can't give you an answer on this right now. I have to check whats going on here.
On 14/03/2011 at 10:00, xxxxxxxx wrote:
There seems to be some SendModelingCommand options that are broken.
On 16/03/2011 at 08:46, xxxxxxxx wrote:
Thanks, i hope you can figure the problem out.
Unfortunately I can't use the CallCommand in my Plugin.