Hi, is there any example about BaseObject.SetModelingAxis(self, m)? I just wanna move and rotate the model's axis via script, and here is my script in python tag
The Tool settings must set the Axis to Free (under Modeling Axis), so the change of the modeling axis has any visible effect.
If you do that, you will see that the tag affects the modeling axis... go to Polygon Mode, Axis Mode, move the modeling axis, and it snaps back to the origin.
The more interesting question would be why you'd want to change the tool setting in a tag? What's the purpose?
(Also, please include the full scene, not just a screenshot, so the Maxon people don't have to re-type everything...)
as @Cairyn said the function SetModelingAxis purpose is to change the modeling axis for some modeling tools only. (Move, Rotate, Scale...?) To see the effect of that function, you must define the axis to free first.
But, maybe you were expecting this function to move the axis of the object itself. There is no function to do so. You can only move the object axis itself. That will also move the points of the object. Then, you need to move all the points of the object to the original place.
In this thread, you will find @ferdinand explaining how this works and how to move back the points at their original position.
I would also point to our matrix manual to understand how they are used.
If you just want to move the object, you can use SetMg, SetRelPos, SetAbsPos, SetFrozenPos. There are also functions to define Relative, Absolute or Frozen rotation. SetRelRot..etc
# Define an object's position using matrices.
def main() -> None:
m = c4d.Matrix()
m.off = c4d.Vector(120, 0, 0)