Home Website Youtube GitHub

Issue with shifter.mocap_tools import/characterize

Hi,
I would like to automate importing the mocap skeleton biped and characterizing it. But I have been running into an issue that I was able to reproduce on the shifter biped template with mGear 3.4.0 in Maya 2018 on a Windows 10 PC.

Basically I import the shifter biped template, scale the “guide” group up by 10 (because my character is quite large) and build the rig.

Then I run the following lines inside maya’s script editor:

from mgear.shifter import mocap_tools

mocap_tools.importSkeletonBiped() 
mocap_tools.characterizeBiped()

It seems that the characterizeBiped function does not wait for the importSkeletenBiped function to finish, because the mocap_template does not get scaled and fitted correctly. Instead the mGear rig shrinks down to the template and destroys the rig.

When I run the above lines separately, everything works as expected.
So first run:
mocap_tools.importSkeletonBiped()

And afterwards run:
mocap_tools.characterizeBiped()

I also tried the above script on a standard size biped template rig and there was also some strange behavior with ctrls jumping around. But that also went away when I executed the two lines separately.

Hello @raumkapsel

Try adding cmds.refresh() between both lines.

The result is the same as before, though I can now see that the mocap_template gets scaled up at first, but then everything shrinks down again.

Okay then try this please…

from mgear.shifter import mocap_tools

mocap_tools.importSkeletonBiped()
cmds.evalDeferred("mocap_tools.characterizeBiped()")
2 Likes

Uhh, this is handy, thank you!! Had to look up what it does:
“This command [evalDeferred] takes the string it is given and evaluates it during the next available idle time.”

Now it works!! :star_struck: Thanks so much Jerome!

3 Likes