How can I move an object in its local object space?
Evelyn Mccall
Posts: 13
Hi.
How can I move an Object that has no parent forward in facing direction?
When I try to use setLocalPos(x, y, z+1) it moves in global space, but not in the direction it is facing to. When my object is a child of a node, then it works just fine.
Post edited by Evelyn Mccall on
Comments
You can change the axis system in Tool Settings, but how much that will gain you does depend on how the mdoel itself is oriented at zero. You can use the Joint Editor to edit the centrepoint parameters.
if it is a prop another way I use lately is under edit tab
convert prop to figure
move the hip bone to get it to the point you want the pivot to be (usually the centre of the grid)
click the little bowtie shaped rigging tool (or select it in tool settings)
rightclick in scene with hip still selected and pick edit bake joint rotations
then under edit tab convert figure to prop
sounds complicated but it's actually very easy
Thanks guys. I am trying to get this working in my plugin.
@Richard Haseltine That is exacly what I want to do in code. Changing the axis system.
I'm afraid I have to use Matrices to translate the position along an axis. I was hoping for an easier solution.
But right now I have no idea how to calulate this.
The problem sounds so easy: Just move an object like 1cm in the direction it is facing.
Acually, it was pretty easy.
I just had to add an offset vector like this: