Page 1 of 1

Bone To Move Only On X or Y

Posted: Sat Mar 23, 2024 8:29 pm
by BrianLucas
Hi Guys,
I was wondering if there's a way to have a pin bone that can move only on X, but not on Y and vice versa.
Any light on this will be appreciated.
Thanks

Re: Bone To Move Only On X or Y

Posted: Sat Mar 23, 2024 10:09 pm
by Greenlaw
Do you mean to constrain it in one direction for animation?

Normally, you would just press and hold Shift to constrain the movement, but I'm guessing you want to set up a control for this as part of a rig.

If you don't mind using two bones, you can use a Constraint for that.

1. Create two Pin bones. Name the constrained bone BoneA and the control bone BoneB

2. Select BoneA and then set the Position Constraint to BoneB, and set the value in the first scale box to 0%.

3. Close the Constraints panel.

Now when you move BoneB, it will move BoneA but only along the Y axis.

To make BoneA move only along the X axis, set the first scale box to 100% and the second box to 0%.

Extra points: You can set two Pin bones to be constrained by the same control bone and set one Pin bone to be constrained to X and the other to Y.

Another way is the set up a Smart Bone action that drives the moving bone along one axis. You'll probably want to Shy the moving bone so it doesn't get accidentally keyframed by the animator. (If this motion were something I needed to repeat, I'd probably go for this method.)

Re: Bone To Move Only On X or Y

Posted: Sat Mar 23, 2024 10:24 pm
by Greenlaw
Another tip: If you want the bone to slide in a direction other than X or Y, parent it to another bone and rotate that bone to the angle you want, then Shy it. Now the child bone will use the Shy bone's direction as its X axis. If you want it to slide along Y, just figure that into your Constraint setup or Smart Bone animation.

Re: Bone To Move Only On X or Y

Posted: Sat Mar 23, 2024 11:23 pm
by BrianLucas
Thank you, Greenlaw

Re: Bone To Move Only On X or Y

Posted: Sun Mar 24, 2024 1:52 pm
by hayasidist
BrianLucas wrote: Sat Mar 23, 2024 8:29 pm ... I was wondering if there's a way to have a pin bone that can move only on X, but not on Y and vice versa.
And ...

If you don't otherwise make a lot of use of "muted channels": In motion graph: select the bone's translation channel, separate dimensions; mute the axis you want constrained (i.e. mute Y if you want it to move only on X). Remember to clear the "Render muted channels" checkbox in export animation.

There are also many solutions that involve scripting which, if you have loads of bones to constrain, might be a better option.

Re: Bone To Move Only On X or Y

Posted: Sun Mar 24, 2024 11:14 pm
by Greenlaw
Ooo! That's a good one, Paul! It never occurred to me to use Graph Editor that way.

Thanks for sharing. :)