I also used the following command to duplicate the object, getting the same results.
obj6 = pm.duplicate("object_1", name = "object_6");
My question is the following:
Can i duplicate an object in an object-oriented way and at the same time duplicate the shape node, instead of only the transform node?
My question is the following:
Can i duplicate an object in an object-oriented way and at the same time duplicate the shape node, instead of only the transform node?[/QUOTE]
"""
Try this, duplicates a transform and shape.
A bit naive, but if you're in a sitch where you can make assumptions, it's not horrible.
Note that not all PyNodes implement duplicate, so it's probably not a good general use case
"""
obj1_xf, obj1_shape = pm.polySphere()
obj6 = obj1_xf.duplicate()
I also used the following command to duplicate the object, getting the same results.
obj6 = pm.duplicate("object_1", name = "object_6");
My question is the following:
Can i duplicate an object in an object-oriented way and at the same time duplicate the shape node, instead of only the transform node?[/QUOTE]
The pymel duplicate function will duplicate all children of the selected object by default. The Shape node is the child of the transform node. When you duplicate the transform in this case the shape will also get duplicated. But the returning list from the duplicate function will only contain the transform. So you have to access the children of the transform to get the shape. Hope this code clarifies.