Copy Translate / Rotate / Scale values from one object to another?

Started by sethcshort, May 08, 2017, 01:16:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sethcshort

Hi!

I'm looking for an easy way to move an object to the same position/rotation/scale as another object.

Right now I'm copy-pasting each value from the Position tab of one object to the next. This is becoming quite tedious.

It seems like this particular task would be ideal to be scripted... but I'm running into some trouble coming up with such a script.

One of the issues is trying to select the objects to be affected (source object, target object). I'd like to be able ask the user to select  objects in the scene, or in the Models list. Is this possible to do?
--- Alternatively, is there a way to detect which object is currently selected, and then I can assume that is my source, and ask the user to choose a target from a list derived from the scene?

The other issue is how do I copy and paste the transformation values? Can I just apply one object's transformation Matrix to another? What functions and formatting would I need to do this? Or do I have to go through a process of copying the Translate, Rotate and Scale vectors individually?

I've been trying to work this out myself, but the scripting documentation is so sparse that I, being a relative newbie, can't wrap my head around these seemingly basic instructions. I'm able to do these kinds of tasks with ease in other packages, like Unity. It feels like there's something I'm missing here.

Thanks in advance for any help!
Seth

DMerz III

I cannot help you with the scripting part, but I have asked a similar question before and someone informed me that, there's a 50% solution. When you select an object and go to the move tool, you can select a 'pivot' point. This is usually default to 'self', but if you click 'Pick' you can choose another model from your tree. From there, you click 'Snap to Pivot' and the x,y,z translation of the origin of Model B now matches the position of model A. However, this is only half of the solution, as it does not read the 'rotation' values.

It also only works if you have the origin points of both models as the same in your modeling/cad software.

Sorry it isn't a full solution, I hope we get one soon!

sethcshort

Right now, I'm down to one problem: I just want to know how to pull out position, rotation, and scale values (matrix, vector, or just the individual values) from a SceneNode.

This seems like a basic function, but isn't documented anywhere and doesn't appear in any of the sample code.

LayC42

Another post to the same topic previews this function in KeyShot 7.