Disable inheritance via Maxscript

Disable inheritance via Maxscript

GeoffKornfeld
Advocate Advocate
2,207 Views
4 Replies
Message 1 of 5

Disable inheritance via Maxscript

GeoffKornfeld
Advocate
Advocate

I have a couple hundred objects attached to another object. I want to scale the object they're attached to down without affecting the scale of its children. How can I un-check Inherit Scale from all those objects at once?

 

Thanks.

0 Likes
Accepted solutions (1)
2,208 Views
4 Replies
Replies (4)
Message 2 of 5

10DSpace
Advisor
Advisor

@GeoffKornfeld 

 

If you do not want the child objects to move when you scale the parent then you should also uncheck the Inherit Move options also.  Also, to be really sure that the child objects do not Move, I would also set the transform locks on them until you are done scaling the parent object.    The lines of maxscript (along with comments) to do this for your several hundred objects are:

 


--sets the inheritance flags (move, transform & scale) to be unchecked for all objects in the selection
for o in selection do setInheritanceFlags o #none


--sets the transform lock on all objects in the selection
for o in selection do setTransformLockFlags o #all

 

 

Then when you are done with scaling your Parent object, you can reset everything the way it was with the following:


--sets the inheritance flags (move, transform & scale) to be checked for all objects in the selection
for o in selection do setInheritanceFlags o #all 

 

--sets the transform to be unlocked on all objects in the selection
for o in selection do setTransformLockFlags o #none

 

I think this is what you want, but it is also possible to just uncheck the Inherit scale boxes only.  However as explained above, the child objects will actually move when you scale the parent.  Verify this for yourself on a test hierarchy to see what I mean. Hope this helps.

0 Likes
Message 3 of 5

GeoffKornfeld
Advocate
Advocate

I just want the XYZ scale flags on the children to become unchecked, so that the objects remain locked on the surface of the parent as it scales.

0 Likes
Message 4 of 5

10DSpace
Advisor
Advisor
Accepted solution

@GeoffKornfeld 

 

OK. Here is the line of maxscript to uncheck only the inherit scale x,y & z boxes. 

 

for o in selection do setInheritanceFlags o #{1,2,3,4,5,6}

 

FYI, the ineritance flags are a bit array in the following order:

{POS_X,POS_Y,POS_Z,ROT_X,ROT_Y,ROT_Z,SCALE_X,SCALE_Y,SCALE_Z } and whatever is included in the call to

setInheritanceFlags will be checked and whatever is not called (in this case the last 3 for scale) will be unchecked.

Message 5 of 5

GeoffKornfeld
Advocate
Advocate

Perfect. Thank you!!

0 Likes