Notifications
Clear all

[Closed] storing the hiearachy

Hi,
I’m writing an exporter script that needs to rotate all the scene, and then export each object. I ‘m doing the rotation by linking al the objects to a dummy in [0,0,0], and then rotating the dummy. At the end I rotate back and delete the dummy.

My problem is that the script destroys all the hierarchy. How can I store and recall that hierarchy ?

I could do

max hold
  -- ....
  max fetch #no prompt
  

but that’s not very clean. Doing this the exporter plug-in won’t remember its settings… That’s almost what I want to achieve but I need to do it another way.

2 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

A relatively easy way to do it is to link only the “children of the world” to the dummy, not all objects. Those with parents will move with them anyway


theParentlessArray = for o in objects where o.parent == undefined collect o
theDummy = Dummy()
theParentlessArray.parent = theDummy
theDummy.rotation = quat 90 [1,0,0]
--export the scene
theDummy.rotation = quat 0 [1,0,0]
delete theDummy --this makes the parent of all objects in theParentlessArray undefined again.

thanks a lot ! The answer is quite simple, shame on me I didn’t find it myself…