Maxunderground news unavailable
|Script help - bug when using $.pos = [0,0,0] with groups|
The bug is that the $.pos = [0,0,0] command doesn't work when the object selected is a group. The only work around I could find was to first open the group, then select the group without selecting the geometry within the group.
Anyone have any ideas on how to get $.pos = [0,0,0] for a grouped object without having to open the group?
read 430 times
4/28/2008 10:45:53 AM (last edit: 4/28/2008 10:45:53 AM)
This should work. I wasn't sure how you were going to be making selections of things so what it does is check if there is something selected first, if there is then check to see if multiple items are selected or not. If multiple items are selected then it checks to see if they are part of a group or not, if so it handles it as a group, if not then as a selection of multiple nodes that aren't grouped. If only one time is selected then it works as before.
"[$.pos.x,$.pos.y,0.0]" and "[groupHead.pos.x,groupHead.pos.y,0.0]" can be changed to to "[0,0,0]" to zero all the values out.
if ($!=undefined and $selection.count>1) then (
if (isGroupMember $) then (--selection of Grouped objects
groupHead=undefined-- will hold head object of Group
for obj in $ while groupHead==undefined do (--Search for/Get Group head object
if (isGrouphead obj) then (groupHead=obj)
--Move Group pivot point to local minimum z value of Group bounding box
--Move Group to 0.0 Z position in world while keeping X/Y values the same
) else (--selection of non-grouped objects
for obj in $ do (
--Move selected object(s) pivot to local minimum z value of it's bounding box
--Move selected object(s) to 0.0 Z position in world while keeping X/Y values the same
) else (--selection of a single obj
--Move selected obj pivot to local minimum z value of it's bounding box
--Move selected obj to 0.0 Z position in world while keeping X/Y values the same
read 401 times
4/28/2008 1:42:44 PM (last edit: 4/28/2008 1:44:20 PM)