WARNING: if you scale the object, the setter will not work properly. I don't know how to fix that without applying the scale first or using Object Info
by manually selection the current object (see last part of the answer, that, unfortunately can't work when the scale is negative).
As far as I know there is no way to get the info of the current object (which is a bit sad, let me know if there is a way to do that). But I found a workaround to get/set the absolute position of an object: add a dummy object to the scene (you can use any object, even if it's location is not at (0,0,0)
) and then exploits the Relative/Absolute
option of object info
: if you know where a given object is located, and how you are related to this object, then it's quite easy to get the current position of the object. Then, you can just translate the object to reinitialize its position to (0,0,0)
, and translate it again to set its position absolutely:
Demo:
WARNING: if you scale the object, the setter will not work properly. More precisely, the transformation will automatically move towards the dummy object when the scale goes to 0. This is because blender will multiply the position of the points by the scale, so I guess one would need to scale the transformation by the inverse of the scale to balance this effect… unfortunately I know no way to avoid that without manually choosing the current object. And even in that case, this does not work when the scale is negative (even with an abs
node) as the scale
output of Object info
seems to lose the sign of the scale.