Home Website Youtube GitHub

Question about mGear matrix constraint

Quick question does this node handle just 1 constraint or can it plug in as many as needed to handle a bunch of calculations rather then making multiple constraint nodes?

Hey @dew,

The new mGear matrixConstraint node was designed for a particular purpose, basically to reduce the number of nodes that were needed to connect/constrain a control to a joint. Right now, it is designed for a one-to-one relationship.

As an example, it had this kind of setup before:

And now reduced down to the single node:

One could make this node an array node and ultimately have one node for all these constraints, but not sure what the repercussions could come from it. Right now, that is not on the cards and would need to RnD what could come from it.

Hope that helps man!

1 Like

I think that having 1 single node for many matrix constraints will bottleneck in parallel evaluation.
Probably in some situations, a multi matrix constraint can be useful but as @JaschaW said we don’t contemplate adding this kind of node unless there is a clear need/advantage for it. :slight_smile:

Makes sense @Miquel @JaschaW ty for clearing that up!

2 Likes

this matrixConstrain node is not loading on windows?

How real is to get mgear matrix constraint in maya 2017? I did rigs with 3.7.0, just in case we need 2017 - and that case just came over :slight_smile: I opened the scene and sadly saw

Unrecognized node type 'mgear_matrixConstraint'; preserving node information during this session.

I do not have much time, so if that’s not easily possible I’ll try to get maya 2018+ for the other animator.

We have drop Maya 2017 support

This issue was solved that the mgear constraint was not loading. An older version of mgear was installed that would take priority over the newer version. Maybe the installer could check if a previous version was installed on another location?

1 Like

Hey @Miquel I have a question about the mGear_constraint node. I’m using it to build a new custom module but I’m not sure if I’m using it correctly or if it’s something with the way I’m placing my Ref Transform nodes in the hierarchy structure. I have a curve spline controlling a bunch of positions which will be the final joint chain at the end of the build. It works when it’s free floating but when I parent them under each other the rotations go haywire(most likely something im forgetting).

This is a prototype im building outside of shifter atm I will integrate it into an actual custom component once I have it building properly.

I’m not sure if it’s something i didn’t plug into these nodes to offset them correctly since I’m still learning how everything works under the hood.

It’s possible I need either constraints driving the ref nodes themselves or do they need to be in the proper hierarchy ect I’m not sure.

as a test i got rid of the mgear_matrixConstraint and just used an orient constraint it fixed the problem but that won’t help me when I need to have this working in shifter with the rest of the components. Any advice would be greatly appreciated!

I guess it is related to the rest pose. Probably @JaschaW can give you better answer :slight_smile:

1 Like

Hey @Dew, I think @Miquel has hit the nail on the head with his answer. I would lean towards that initial answer too. Question, when you setup the mgear_matrixConstraint manually, are you adding in any calculation into the driven rest matrix? If you are doing this manually, I am assuming that this might be the case? Correct me if I am wrong here :grinning:

In your example where the joints are going crazy, do they all have rotation values set?

Here I have tried to get a base example going:


Notice in the channel box that the rotation is set to zero, if you have values there, you might need to set the rest matrix values here.
image
Here is some code you can try and play around with to test, super hard coded, but should help you moving forwards here.
import maya.api.OpenMaya as om

# -- get the driver and driven matrices
matrix = om.MMatrix(cmds.getAttr("chain_C0_0_loc.worldMatrix[0]"))
matrix_inverse = om.MMatrix(cmds.getAttr("chain_C0_0_jnt.parentInverseMatrix[0]"))

# -- this will calculate the joint's orientation - we only care about rotation here
final_matrix = om.MMatrix(cmds.getAttr("mgear_matrixConstraint1.outputDriverOffsetMatrix")) * chain_0_jnt_matrix_inverse
cmds.setAttr("mgear_matrixConstraint1.drivenRestMatrix", final_matrix, type="matrix")

Hope that helps man! :grinning:

1 Like

Hey @JaschaW thank you for the input. I did try my best to implement what you told me to do with the rest matrix. But unfortunately I am not getting the behavior I need in the spline.

Hey @dew, at least it is not freaking out as much as the previous example that you sent :sweat_smile: The only thing from here is to ask if you could send the example scene? I will take a look and see what is going on there for you?

Hey @JaschaW it still does freak out when I put the joint chain in the proper hiarchy. I’ll have to mess around with this for a while and try and pin point what’s going on.

EDIT: I figured out what the issue was. I am idiot and forgot to have the joint chain properly have the correct orient. Things are working now. Thank you for helping out @JaschaW and @Miquel

2 Likes

Hey there @dew I am happy to you got it working! :grinning: Do not worry, I have far to many of those moments too! Part of the trade! :crazy_face: Happy component building man! Looking awesome!

1 Like

Thank you! Sorry for my late reply, got a new job so I’ve been unfortunately busy with that.

1 Like