Bone To Move Only On X or Y

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
BrianLucas
Posts: 37
Joined: Sat May 08, 2021 6:55 pm

Bone To Move Only On X or Y

Post 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
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Bone To Move Only On X or Y

Post 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.)
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Bone To Move Only On X or Y

Post 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.
User avatar
BrianLucas
Posts: 37
Joined: Sat May 08, 2021 6:55 pm

Re: Bone To Move Only On X or Y

Post by BrianLucas »

Thank you, Greenlaw
User avatar
hayasidist
Posts: 3525
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Bone To Move Only On X or Y

Post 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.
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Bone To Move Only On X or Y

Post by Greenlaw »

Ooo! That's a good one, Paul! It never occurred to me to use Graph Editor that way.

Thanks for sharing. :)
Post Reply