Maya skinning issue

I’ve never run into this… anyone know what I did?

I’m writing a modular rigging tool in Maya 2008 with python. I create the joints through script. For whatever reason when I try to bind geometry to these joints, I get this error:
// Error: line 0: Connection not made: ‘Root.lockInfluenceWeights’ -> ‘skinCluster1.lockWeights[0]’. Data types of source and destination are not compatible. //
// Error: line 0: Problems occurred with dependency graph setup. //

I can still bind to other joints I create with the joint tool without this problem, but not the joints created through script.

I’m digging into this now, but I thought I’d post here in case somebody had already run into this.

Enum attrs have been causing so much trouble for me. I ran into a problem awhile ago in which getting/setting an enum attr as a string would break undo, and in another case, fatal error. Now it’s the cause of this problem as well.

Is it just Python in Maya?
Is it that I’m using PyMel?
Is it that my company has no money to upgrade from Maya 2008?
Is it something I said?

Anyone have any insight?

[QUOTE=SuppleTeet;8018]Enum attrs have been causing so much trouble for me. I ran into a problem awhile ago in which getting/setting an enum attr as a string would break undo, and in another case, fatal error. Now it’s the cause of this problem as well.
[/QUOTE]

Can you post some sample code? I can test it against a few different cases/versions for you if you like.

Another thing I would is create a joint using the joint tool, and see what options Maya is using to make the joint, then check your script to see what options you’re using to create the joint. Maya might be turning a flag on or off that you might have over looked. That’s where I begin when I get issues like this. I start seeing what Maya is doing compared to what I’m doing, and usually it’s cause I missed a flag.

Thanks Seth. I’m still narrowing down exactly what the problem is, and hopefully it’ll be clear enough to write some repro code.

Daniel, yeah that was the first thing I tried. heh.

Good GOD I finally found it. That was a nasty one. Had nothing to do with Enums.

In case anyone is interested, here’s what happened:

I was doing a fair amount of passing data back and forth through string attributes which I would add/set/get on joints. When you bind geometry to a joint in maya it adds the “lockInfluenceWeights” attribute to the joint. I was finding the attributes I wanted to work with by using listAttr(userDefined=1), which returned the “lockInfluenceWeights” since it was added after the joint was created. So I was saving off this newly created “lockInfluenceWeights” attribute into my xml file. When I read the file back in my scripts were creating the lockInfluenceWeights attribute as a ‘string’ attribute (it’s supposed to be a bool) and when I tried to bind to the joints again, maya freaked out because the attribute was the wrong type… and actually reading the error again it makes more sense now. Heh.

God damn.

I’m also pretty sure my undo woes are caused by using try/except statements… anyone have problems with try/except statements? I knew they were too helpful to be true!

Tried playing with undoInfo?
Something like this:


try:
    maya.cmds.undoInfo( openChunk=True )
    do_stuff()
except:
    whatever()
finally:
    maya.cmds.undoInfo( closeChunk=True )

Oh, no I’ve never seen that. I’ll give it a go, thanks!

Edit:
The reason I haven’t seen that is because it doesn’t exist in Maya2008. It starts in 2009… sigh… some day we’ll upgrade.

Ah thats a shame

[QUOTE=SuppleTeet;8040]Oh, no I’ve never seen that. I’ll give it a go, thanks!

Edit:
The reason I haven’t seen that is because it doesn’t exist in Maya2008. It starts in 2009… sigh… some day we’ll upgrade.[/QUOTE]

I feel your pain. I’m in 7.0 atm… hopefully back in 2011 after new years.