Is assign and reparent equivlaent to assing and connect - seems to be breaking rotation limits function

Hi guys,

is creating markers using the assign command and then independently reparenting them equivalent to assign and connect?

At the moment I’m using a script which does the former to create a marker heirarchy. It all works great except for one thing I’ve found. When trying to change the rotation limits from no limit to limited the marker flips out. Doing this manually has the same effect it seems.

thanks

Gang

Just about, the exception being what you are seeing.

When you Assign and Connect, Ragdoll is aware of both child and parent and can orient the limit to point in the direction of the child. When you assign each individually, it does not know this.

You can manually call this orientation function, it’s called Ragdoll → Utilities → Reset Constraint Frames.

image

It’s also in the Manipulator, here.

image

When you run it, it’ll spit out the Python command for it, which is:

from ragdoll import interactive as ri
ri.reset_marker_constraint_frames()

Brilliant. This has indeed fixed the issue.

Is there a function call I can use to set the rotation limits? (In particular, for each of the two manipulators seperately).

Thank you!

The rotation limits are regular Maya attributes, called:

  • limitRangeX
  • limitRangeY
  • limitRangeZ

You can set these like regular Maya attributes.

Asymmetrical edits is a little more tricky. For that, you need to adjust the range and then compensate by rotating the “parent frame” of the marker; you can find it under the Advanced section of the Marker Attribute Editor.

This is also an attribute, except it’s a matrix type attribute which makes it a little more tricky still.

Here’s an example of how to rotate the parent frame by 20 degrees.

from ragdoll.vendor import cmdx

marker = cmdx.encode("rMarker_joint120")
frameMtx = marker["parentFrame"].asMatrix()
frameTm = cmdx.Tm(frameMtx)
frameTm.rotateBy(cmdx.Quaternion(
    cmdx.radians(20),     # 20 degrees
    cmdx.Vector(0, 1, 0)  # Around Y
))

with cmdx.DagModifier() as mod:
    newFrame = frameTm.asMatrix()
    mod.setAttr(marker["parentFrame"], newFrame)
2 Likes

ok. yep. That make’s sense, but as you say it’s a little bit more involved. I will take a look, but for now we can do it manually using the manipulator which is great.

thanks!