Monday, 25 April 2022

Persistant Transform Nodes

Here's an age-old bug:

The Problem:

"My joint recieves a transform in the skeleton hierarchy, and I can't remove it!"

The Fix:

cmds.parent(problem_jnt, new_parent, relative=True)


Wednesday, 30 March 2022

Debug function call

I came across a useful python debugging library the other day that allows you to print where a function is being called from: 


from inspect import stack

def foo():
    print(stack()[1][1:4])

def bar():
    foo()
What this will do now is whenever foo() is called, it will also now spit out a message:
('name_of_file.py', line_number, function_calling_foo)
 
Or, as I call it in Maya's Script Editor:
('<maya console>', 6, 'bar') 

Brilliant for tracing nested funcs in a complex architecture!

Wednesday, 9 March 2022

Flowchart Website Tool

 Need a way to draft out a process/pipeline/tool?

This handy website lets you do so for free, and allows you to save/load to your device, google drive and other cloud platforms:

https://app.diagrams.net/

Pretty neat, thought I'd share! 



Tuesday, 18 January 2022

Get current frame from Maya node - time

 Today I forgot how to get the current frame from a node, something which I wanted to access in order to create a 'turbine' auto-rig component. I tried going into the node editor and created a new 'time' node, but the 'outTime' attribute didn't seem to update with the timeline when I scrubbed through it.

However, it seems that every Maya scene has a persistant 'time' node called time1.

This is the correct node to query when wanting to access the current frame from a node, and as it is persistant in every Maya scene, it's fine to hardcode this name.








Tuesday, 21 December 2021

Maya won't save as .mb

I had an issue today where I couldn't save my Maya file as a .mb, and faced the following error:

The Problem:

 "File contains unknown nodes or data. To preserve this information, the current file type cannot be changed. //"

This can be caused by having unknown nodes in the scene, usually from an external plugin that you no longer have.

The Fix:

unknown_nodes = cmds.ls(type="unknown")
# Before you delete, check you want to delete these unknown nodes!
cmds.delete(unknown_nodes)
After running this code, you should be able to save as .mb again!

Friday, 10 December 2021

Maya error- # Warning: 你的文件贼健康~我就说一声没有别的意思 #

My Maya got a virus after opening some dodgy file the other day and rather un-helpfully uninstalled some of my preferences - Yay!

The Problem:

Maya error- # Warning: 你的文件贼健康~我就说一声没有别的意思 #


The Fix:

  1. Install Maya Security tools from here: https://apps.autodesk.com/MAYA/en/Detail/Index?id=8637238041954239715
  2. Enable MayaScanner.py & MayaScannerCB.py (Windows>Settings/Preferences>Plug-in manager)

  3. Delete vaccine.py, vaccine.pyc from /Documents/maya/scripts
  4. Open userScript.py and remove the following lines:
import vaccine
cmds.evalDeferred('leukocyte = vaccine.phage()')
cmds.evalDeferred('leukocyte.occupation()')
And that's it - you should be cured!

Monday, 25 October 2021

Thursday, 10 June 2021

Maya 2022 - Deformer backwards compatibility issues

If any of you have ventured into Maya 2022 yet and have found yourself authoring rigs in there that has then needed to be opened in earlier versions of Maya, you've probably noticed deformers tend to break.

The Problem:
"If you have component tags enabled in 2022, deformers are created in a much simpler way than before.  They don't have any groupParts or groupId nodes and don't have deformer sets.  All of that is stuff that 2022 no longer requires thanks to the component tag work, whether or not you're actively using component tags.  This isn't backwards-compatible, since deformers in earlier versions of Maya require these nodes to function."

The Fix:
"If you want scenes to be backwards-compatible, you need to disable "Animation > Rigging > Use component tags for deformation component subsets" in settings, which will cause deformers to be created using the older method.  This needs to be changed before creating any deformers, since it only affects newly-created deformers."

 

 This useful information was brought to my attention by my good rigging buddy Lasse Rassmussen, which originally stemmed from this post in the Autodesk Forums.