Home Website Youtube GitHub

I have a question about weights

Yeah, as long as I delete the joint namespace it’s fine but it’s a little tricky because every time I do it I have to delete the namespace and then add the namespace so I was wondering if I could just add the namespace to the exported skin.jskin file

I did what Jignb said

  • Below line 484 (objName = data[“objName”]), add myNameSpace = data[“nameSpace”]
  • Change line 524 (joints = list(data[‘weights’].keys())) to joints = list([myNameSpace + jnt_name for jnt_name in data[‘weights’].keys()])
  • You could also change line 533 (for j in data[‘weights’].keys()) to for j in [myNameSpace + jnt_name for jnt_name in data[‘weights’].keys()]: to have a better error message if something goes wrong.
    Made these changes

Ok, but your error message makes me think the changes you made have not loaded properly.

Can you please run this Python, and make sure it says the same file as the skin.py that you edited?

There is a chance it didn’t load, or perhaps you are running a different version of mGear than you are editing.

import mgear
mgear.core.skin.__file__

I just made similar changes on those 3 lines, and it works for me.

After modifying skin.py, I re-opened Maya and ran the script with an error

Error: AttributeError: file line 2: ‘module’ object has no attribute ‘skin’


What should I do?

What version of mGear? Please run this:

import mgear
print(mgear.__file__)
print(mgear.VERSION)

My computer had two versions of Maya Maya 2019.2 that were used with MGear3.6.0 then I modified the script to use

import mgear

mgear.core.skin.file

Nothing is displayed after that


The exported skin.jskin skeleton has no namespace
Then I use maya2022.4 This error occurs

Error: AttributeError: file line 2: module ‘mgear.core’ has no attribute ‘skin’

Use of mgear4.0.3

If you print the result, and then you’ll see it.

import mgear
print(mgear.__file__)
print(mgear.VERSION)
print(mgear.core.skin.__file__)

For Maya 2022.4, mGear 4.0.3, I have no idea why you’re getting that error. It works for me. Anyone else know why?? Maybe Maya 2022 is still running an older version of mGear, that wasn’t uninstalled from some other folder.

My result in 2022:

/production/mGear/tools/mgear_4.0.3/release/scripts/mgear/__init__.py
[4, 0, 3]
/production/mGear/tools/mgear_4.0.3/release/scripts/mgear/core/skin.py
1 Like

Ok, I’ll try and thank you for that

I’m sorry it’s just the joint has a namespace and the mesh doesn’t have a namespace so how do I change this script