On 05/12/2014 at 05:44, xxxxxxxx wrote:
I'm a little confused how I should change the axis of an object.
Like shown in the SDK, you can enable/disable the modeling axis with c4d.CallCommand(c4d.ID_MODELING_AXIS).
But when I call it, move my object, and call it again, nothing happens.
When I looked on google, I only saw workarounds (saving the points, moving the object, set the points position again). But for my case it gives me tons of extra work, which I don't want.
Does somebody know another way how to do this?
Doing it without code isn't an option, because its a reaction on a condition.
On 05/12/2014 at 08:19, xxxxxxxx wrote:
technically the only way to "edit the axis" is to transform the geometry one way in object space and the object itself the other way in world space. When "Enable Axis" is enabled this tells the tools that they should do this. The same is true for the "Center Axis to" command. Just try to edit the axis of a million polygon mesh to see what happens.
On 05/12/2014 at 11:04, xxxxxxxx wrote:
So, if I understand you correctly, it should all work fine the way I did it?
Because, if I enable the Axis and move the axis/object, Cinema 4D should transform the geometry one way in object space and the object itself the other way in world space. So I should only give one transformation (the movement of the axis).
Guess I went wrong somewhere, but can't find out where...
On 08/12/2014 at 02:31, xxxxxxxx wrote:
as I said "Enable Axis" tells the current tool (or command) to behave differently (if this tool supports this). How do you "move" the object?
On 09/12/2014 at 08:08, xxxxxxxx wrote:
I move the object with: L_Foot_Control.SetAbsPos(c4d.Vector(L_Foot_Control_Position.x, L_Foot_Control_Position.y, L_Foot_Control_Position.Z + 1.2))
Doesn't the "Enable Axis" work with absolute position setting?
On 10/12/2014 at 04:10, xxxxxxxx wrote:
"Enable Axis" is a hint for tools what to do. SetAbsPos() is not a tool; it will directly edit the object's position.
A tool will move the object (using SetAbsPos()) and then compensate this movement by moving the point object's points in the other direction. It seems that there is no tool available via the API so you have to rebuild this process.
On 10/12/2014 at 05:54, xxxxxxxx wrote:
if I get you right, than there is no option in sendmodelling command for a simple translation/rotation?
We are forced to calculate every new point position by ourselves?
Additionally, if the axis of the object were moved and rotated in the first place and we want to reset them to e.g. the orientation and origin of world space we have to do those calculations twice ?
If not, do you have an example to optimize this procedure?
Thanks in advance !
On 10/12/2014 at 07:22, xxxxxxxx wrote:
there seem to be no tools or commands available to handle this specific task.
The "axis" is not a "thing". There is only a point object's (world space) matrix and the position of it's points in object space. So technically you cannot move the axis as the axis does not exist. You have to move the object and then it's points (or vice versa). If you have a complex transformation you may be able to describe this transformation in a final matrix and then you have only to apply this matrix.
On 19/12/2014 at 09:35, xxxxxxxx wrote:
was your question answered?