Hi,
I am attempting to set up an FK leg rig using the new offset parent matrix feature in Maya 2023. I used Anthony Ward's video to set it up on my left leg and it works fine. However, when I mirror, I am unable to properly place my controllers as every time I try to input the correct rotational values to the joint, it will change other rotation values in the matrix automatically. I didn't run into this problem on the left limb and I have found no documentation or even mentions of this at all. Screenshots below.
I assume it has something to do with the orientation of my joints, the rotation order of my controllers, or maybe the rotational values of my curve are hitting gimbal lock. No idea how to fix it or even go about diagnosing the issue. Seems like right now I'm just going to have to go back to the old way of using offset groups.
Solved! Go to Solution.
Hi,
I am attempting to set up an FK leg rig using the new offset parent matrix feature in Maya 2023. I used Anthony Ward's video to set it up on my left leg and it works fine. However, when I mirror, I am unable to properly place my controllers as every time I try to input the correct rotational values to the joint, it will change other rotation values in the matrix automatically. I didn't run into this problem on the left limb and I have found no documentation or even mentions of this at all. Screenshots below.
I assume it has something to do with the orientation of my joints, the rotation order of my controllers, or maybe the rotational values of my curve are hitting gimbal lock. No idea how to fix it or even go about diagnosing the issue. Seems like right now I'm just going to have to go back to the old way of using offset groups.
Solved! Go to Solution.
Solved by Kahylan. Go to Solution.
Same trouble, eulers are automatically updated. Maya 2022.4
I have attached a simple scene as an example. Just try copying the rotate values into an offset parent matrix.
Is this problem solvable?
Same trouble, eulers are automatically updated. Maya 2022.4
I have attached a simple scene as an example. Just try copying the rotate values into an offset parent matrix.
Is this problem solvable?
So far, the only solution that I've found is to plug in the rotational values before adding the translate values. It's a bit silly and wonky, but it works.
So far, the only solution that I've found is to plug in the rotational values before adding the translate values. It's a bit silly and wonky, but it works.
This was the first thing I tried, as was change the rotation order. Doesn't work for me 😞
This was the first thing I tried, as was change the rotation order. Doesn't work for me 😞
Ok, it looks like there is a solution: just set key to the rotation channel. Then copy values to OPM, break connection, remove double transforms, etc.
Of course, then need cleanup 3 unnecessary animation curves, but these are trifles, all the same, it is more convenient to use MEL for setup things like this.
Ok, it looks like there is a solution: just set key to the rotation channel. Then copy values to OPM, break connection, remove double transforms, etc.
Of course, then need cleanup 3 unnecessary animation curves, but these are trifles, all the same, it is more convenient to use MEL for setup things like this.
Interesting, I'll have to try this next time I'm working with the OPM. Hopefully we get a better solution from Autodesk soon.
Interesting, I'll have to try this next time I'm working with the OPM. Hopefully we get a better solution from Autodesk soon.
I wrote a little uh... "macro" that copies the transform values into the OPM. The idea is to pass the transformations to the OPM through holdMatrix node, which will avoid creating a looped graph. Surely better way to do this via xform, but I don't know how yet.
How to use: copy the contents of the file into the script editor as MEL, then drag it to the shelf as button. Select an object and click button.
Note: target object must have zero OPM values.
I wrote a little uh... "macro" that copies the transform values into the OPM. The idea is to pass the transformations to the OPM through holdMatrix node, which will avoid creating a looped graph. Surely better way to do this via xform, but I don't know how yet.
How to use: copy the contents of the file into the script editor as MEL, then drag it to the shelf as button. Select an object and click button.
Note: target object must have zero OPM values.
Hi!
As you mentioned, there has to be a better way using xform. And it looks like this:
import maya.cmds as mc
import numpy as np
sel = mc.ls(sl = True)
for s in sel:
lM = mc.xform(s,q= True, m= True, ws= False)
oM = mc.getAttr("{0}.offsetParentMatrix".format(s))
lM = (lM[0:4],lM[4:8],lM[8:12],lM[12:16])
oM = (oM[0:4],oM[4:8],oM[8:12],oM[12:16])
mM = np.matmul(lM,oM)
mM = [mM[0][0],mM[0][1],mM[0][2],mM[0][3],mM[1][0],mM[1][1],mM[1][2],mM[1][3],mM[2][0],mM[2][1],mM[2][2],mM[2][3],mM[3][0],mM[3][1],mM[3][2],mM[3][3]]
mc.xform(s, t= (0,0,0), ro = (0,0,0), s= (1,1,1), os = True)
mc.setAttr("{0}.offsetParentMatrix".format(s),*mM, type = "matrix")
Basically to find the values to put into your OPM, you just need to Multiply the local xform matrix of the object with it's current OPM.
This script will find those values and overwrite the OPM as well as zero out the transforms. It's a pythons script so it has to be run from a python tab.
I hope it helps!
Hi!
As you mentioned, there has to be a better way using xform. And it looks like this:
import maya.cmds as mc
import numpy as np
sel = mc.ls(sl = True)
for s in sel:
lM = mc.xform(s,q= True, m= True, ws= False)
oM = mc.getAttr("{0}.offsetParentMatrix".format(s))
lM = (lM[0:4],lM[4:8],lM[8:12],lM[12:16])
oM = (oM[0:4],oM[4:8],oM[8:12],oM[12:16])
mM = np.matmul(lM,oM)
mM = [mM[0][0],mM[0][1],mM[0][2],mM[0][3],mM[1][0],mM[1][1],mM[1][2],mM[1][3],mM[2][0],mM[2][1],mM[2][2],mM[2][3],mM[3][0],mM[3][1],mM[3][2],mM[3][3]]
mc.xform(s, t= (0,0,0), ro = (0,0,0), s= (1,1,1), os = True)
mc.setAttr("{0}.offsetParentMatrix".format(s),*mM, type = "matrix")
Basically to find the values to put into your OPM, you just need to Multiply the local xform matrix of the object with it's current OPM.
This script will find those values and overwrite the OPM as well as zero out the transforms. It's a pythons script so it has to be run from a python tab.
I hope it helps!
Can't find what you're looking for? Ask the community or share your knowledge.