If one makes live duplicate of an object and its children (by selecting them all), a live duplicate is created for each object (which is fine), but the parent/child relation is lost: all the duplicate objects are at the same root level. I have to rearrange them in a tree structure manually, which can take some time. Is there a way to achieve that automatically?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Doing this would take some changes in core code, or a custom Duplicate handling script. I don't see why this could not be done, it would just be a matter of scanning the object list just like the core command does, and watching for Parent>Child relationships while doing so.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Idea for a new plugin? "Live duplicates with children".
The job sounds like:
- Find the objects in the selection that don't have parents.
- Use recursion to make new copies of the entire "child tree".
- Including copying and reconnecting all animation tracks ... Don't know how far you can go with that, though, as there are quite a few different types of animation tracks and they may be connected to many different things ... Might get a little messy.
Last edit: Pete 2015-03-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In LayoutWindow: getSelectedObjects() or getSelectedIndices() or getSelectionWithChildren(). The latter two produce only index numbers, so you'll have to get the Object(Info)s by getScene().getObject().
In ObjectInfo getParent() and getChildren().
Should get you started. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If one makes live duplicate of an object and its children (by selecting them all), a live duplicate is created for each object (which is fine), but the parent/child relation is lost: all the duplicate objects are at the same root level. I have to rearrange them in a tree structure manually, which can take some time. Is there a way to achieve that automatically?
Doing this would take some changes in core code, or a custom Duplicate handling script. I don't see why this could not be done, it would just be a matter of scanning the object list just like the core command does, and watching for Parent>Child relationships while doing so.
I was also thinking of making a script for that, if it can be done. I will look into the API.
Idea for a new plugin? "Live duplicates with children".
The job sounds like:
- Find the objects in the selection that don't have parents.
- Use recursion to make new copies of the entire "child tree".
- Including copying and reconnecting all animation tracks ... Don't know how far you can go with that, though, as there are quite a few different types of animation tracks and they may be connected to many different things ... Might get a little messy.
Last edit: Pete 2015-03-04
About API:
In LayoutWindow: getSelectedObjects() or getSelectedIndices() or getSelectionWithChildren(). The latter two produce only index numbers, so you'll have to get the Object(Info)s by getScene().getObject().
In ObjectInfo getParent() and getChildren().
Should get you started. :)
This sounds like a good change in any case. When possible, live
duplicates should preserve the relationship.
Peter
Ok, the changes are checked in. Give it a try.
Peter