Message 1 of 3
Group Bounding box shows in empty area
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I use maxscript to scale the whole scene by grouping the scene then moving its pivot to the bottom of the group and matching the size of the group with the reference box.
Problem: When I group the scene, I get an empty space in the bottom section of the group, which causes the group pivot to be positioned incorrectly, so when I scale the group using the script, it does not match its size with the reference box.
Please find attached screenshots of 3ds max which shows empty space that I am getting once I group the objects and current scaling that I am getting
Below is code that I use for scaling:
-- Move the scene group pivot to bottom of the group
obj = $sceneGroup
obj.pivot = obj.center ;
obj.pivot.z = obj.min.z ;
--set height of the scene
target = $referenceBox ;
ratios = (target.max - target.min) / (obj.max - obj.min);
the_scale = amin #(ratios.x, ratios.y, ratios.z);
scale $sceneGroup (the_scale * [1, 1, 1]);