THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/11/2010 at 17:25, xxxxxxxx wrote:
I need to create an algorithm that goes through a hierarchy of objects and rebuilds the list in a way that is would be able to rebuild the same hierarchy, later. Lets say:
Cube1
-Platonic1
--SweepNURBS1
---Spline1
---Spline2
--Cube2
---Platonic2
----Sphere1
The order of creation is (I believe) :
Cube1
Platonic1 (insert_under Cube1)
Cube2 ( (insert_under Platonic1)
Platonic2 ( (insert_under Cube2)
Sphere1 (insert_under Platonic2)
SweepNURBS (insert_under Platonic1)
Spline2 (insert_under SweepNURBS)
Spline1 (insert_under SweepNURBS)
This is because each time I InsertUnder, the inserted object ends up being the first child of its parent.
Is there any algorithm that goes through a hierarchy and returns a list of objects in the correct order so that a new scene could be reconstructed?
I already tried a few times to code such a thing but I'm having no luck :(
Anyone? Please...
Rui Batsita