Home Website Youtube GitHub

Facial rigger isn't python 3 compatible


this just happened when I tried to open the facial rigger on maya 2022

1 Like

was fixed here https://github.com/mgear-dev/mgear4/pull/67
Not yet released :sweat_smile:

2 Likes

Is it the same error?

I have issue with mGear that I cannot open Facial rigger at all. Everything works but not this. :frowning:

Hi @pkarbosski yes it seems like it is the same error. If you can’t wait for the fix to be released, you can grab the code from the link Miquel listed.

Or if you are comfortable scripting, you can search the file for the word “print”.

If you see

print SOMETHING

replace it with

print(SOMETHING)

And it should fix that error.

I think the only file that needs fixing is:

mgear_4.0.3/release/scripts/mgear/rigbits/facial_rigger/lips_rigger.py

3 Likes

Thank you for VERY quick respond! I’ll try to repair it tomorrow.

I copied whole init.py and lips_rigger.py from Miquel’s link and it works.
I tried to add brackets but I could do SOMETHING :slight_smile: wrong and it did not fix the issue in the end.

Once again, thanks guys for your hard work!

Heya!

I thought that I solved the problem with FacialRigger. I managed to open it but I still can’t build a blink eye. Such an error pops up when I wanna create an eye.

I took bi-ped from template and tried to add blink to the already egxistning setup. Nothing fancy.

Any ideas how to solve the issue?

You might have to also take the eye_rigger file, or the entire facial_rigger or rigbits directory from the development repository. But please understand, if you take some files from the dev repository, you might cause some compatibility issues with other files, and cause different bugs.

Are you comfortable with scripting/programming? If not, it might be safer to wait for an official release with the fixes. (For me, I have 4.0.3 installed for testing, but I still use 3.7.11 in production, and I was using 3.6 up until last week, for compatibility until I finished a project.)

2 Likes

Hi guys

I have the same error as above:

AttributeError: ‘dict’ object has no attribute ‘iteritems’

I just downloaded the latest build that was put out yesterday, 4.0.7
I’m getting the error trying to build a lip rig using the facial rigger.

Any idea what’s happening? Everything else seems to work perfectly, so guessing it’s not a python3 issue?

I’m thoroughly enjoying mgear btw. You guys managed to make rigging fun!

Hope to see a fix soon.
Best
/Chris

Sorry, I have a PR to fix the issue, but didn’t had time to check and merge
I will do it ASAP :sweat_smile:

I am also getting this same error in the facial rigger (eyes):

// Error: root : Uncaught exception
Traceback (most recent call last):
  File "C:\Users\User\Documents\maya\modules\scripts\mgear\rigbits\facial_rigger\eye_rigger.py", line 1291, in build_rig
    rig(**lib.get_settings_from_widget(self))
  File "C:\Users\User\Documents\maya\modules\scripts\mgear\rigbits\facial_rigger\lib.py", line 57, in get_settings_from_widget
    for attr, obj in widget.__dict__.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems' // 

An update on this would be greatly appriciated
Cheers
Michiel

If that’s the only error you’re getting you can fix it by replacing .iteritems() for .items() on line 57 of lib.py (check the full path in the error message). Iteritems is how you used to iterate over a dictionary in python 2 but now it’s just items in python 3.

I’m sure it’s going to get fixed in the next release anyway, but as a quick fix that should do it.

1 Like

Thank you, @jignb, i’ll try that this afternoon!

Thanks! It works now :slight_smile: Really appreciate the fast response

Is all this backwards compatible with Maya 2020 or do I have to update to 2022 to use mGear 4.0 and beyond since it’s using python3?

Should work back to 2018. You can look in the /release/platforms folder to check which versions are supported. https://github.com/mgear-dev/mgear4/tree/master/release/platforms

And if there are any problems, please report a bug.

1 Like

I finaly managed to try to hack the .py-files (by replacing .iteritems() for .items()). Initially it seems to do it, but when getting the lips rigger to work, I encounter the following, new error

// Error: root : Uncaught exception
Traceback (most recent call last):
  File "C:\Users\User\Documents\maya\modules\scripts\mgear\rigbits\facial_rigger\lips_rigger.py", line 1106, in build_rig
    rig(**lib.get_settings_from_widget(self))
  File "C:\Users\User\Documents\maya\modules\scripts\mgear\rigbits\facial_rigger\lips_rigger.py", line 167, in rig
    outPos)
  File "C:\Users\User\Documents\maya\modules\scripts\mgear\core\meshNavigation.py", line 207, in edgeRangeInLoopFromMid
    loopRange = set(midEdges + extremeEdges)
TypeError: unhashable type: 'MeshEdge' // 

Thing’s broken or am I overlooking stuff?

1 Like

Looks like it’s a new Maya bug in 2022. :pensive:

In Maya 2018 and 2020, a MeshEdge is hashable, so you can run set(list()) on a list of edges. In Maya 2022 this fails. So line 207 of /mgear/core/meshNavigation is going to have to filter out duplicate edges in some new way, I guess.

There might not be any need to cast it as a set. Because at a quick test, it looks like the code already checks if the edge is in the lists, extremeEdges and midEdges, before appending them.

A simple test. Make a polySphere named pSphere1, and run this script:

import pymel.core as pm

sphere = pm.PyNode('pSphere1')

edges1 = [sphere.e[3]]
edges2 = [sphere.e[5], sphere.e[6], sphere.e[3], sphere.e[9]]

print(edges1 + edges2)
print(type(edges1 + edges2))
print(set(edges1 + edges2))

RESULT:

[MeshEdge('pSphereShape1.e[3]'), MeshEdge('pSphereShape1.e[5]'), MeshEdge('pSphereShape1.e[6]'), MeshEdge('pSphereShape1.e[3]'), MeshEdge('pSphereShape1.e[9]')]
<class 'list'>
# Error: TypeError: file <maya console> line 13: unhashable type: 'MeshEdge' # 
2 Likes

Hi!
I had the same issue, and I believe I’ve solved it - here’s a pull request that’s already merged I think:

So If you want to do it manually, follow these changes:
https://github.com/mgear-dev/mgear4/pull/89/commits/877be730352b9ccbc7c5093e8b6e56061624bc37

5 Likes

worked for me! ty!!!

1 Like