I am new to max and problem that i am facing is I have objects that are grouped togother there are 3 objects a box , a frame surrounding the box which has UV map and some rivets like objects on the frame. and name this group as storage
When I try to move the grouped object using max script all the objects inside the group moves move individually rather than moving as a whole like a whole.
Is there any other possible solution to do this or a method though which i can achieve the same.
max Script:
select $Storage maxOps.cloneNodes (selection as array) cloneType:#instance newNodes:&nnl #nodialog select nnl nnl.pos = [1,2,1];
You are now moving the group node and every object in the group, too. I avoid groups as they create and destroy 'invisible' nodes under the hood, anyway to answer your question, you have to get the group node and move just that. If the group you are cloning is not linked to anything nor a part of another group, it boils down to getting the top-level node, like this:
fn getTopNode obj = ( while obj.parent != undefined do obj = obj.parent obj ) maxOps.cloneNodes $Storage cloneType:#instance newNodes:&nnl #nodialog (getTopNode nnl[1]).pos = [1,2,1]
If it is, I'd redesign the pipeline, first and foremost.
The Object is Just moving as offset from its current postion and not moving to world corordinate
To move the objects having been grouped try these code:
If the group would been moved to [0,0,0]:
First select the group, then run the code twice (Note : must run it twice. I don't know why...)
in coordsys world $.pos = [0, 0, 0]