Do you remember when Autodesk Maya went from the old grey color picker to the new Qt one in Maya 2011?
So much rage… that tiny window disappearing all the time was kinda frustrating on comparison to the old one.
Well, everybody may already know this but… but if you do a double-click on a color picker button instead of a single-click, it will bring this fantastic and usable window. Enjoy!
More over, if you drag and drop a color picker button, it will open the floating window where you dropped your click.
One last tip for the road, in Maya 2010 you could pick a color outside of Maya very easily, but now the pipette just don’t work outside Maya… in fact it works with a workaround: use the pipette on the Maya UI but don’t release your mouse, then unclick wherever you want outside of Maya and voila!
There is a new bug in Maya 2015, if you try to create an itemFilterAttr with some filters like hidden, writable, readable, keyable, etc. in conjunction of the -byScript flag.
It crashes regardless of the programming language used. MEL, maya.cmds and pymel even with the example given in the its documentation.
Just a little reminder to get all the different ways of passing arguments from a native Maya UI.
Just type anything and see the result in the text field at the bottom. You can see that when you use a class, the basics methods offered by Maya do not work.
Some methods are obviously better than others, personally I totally recommend the use functools.partial, it gives only advantages over the others. Pymel is great, but I personally don’t use it any more as some studios don’t support it—as well as Autodesk—and because I had some crash problems with it in batch mode in the past, and don’t forget the 2 seconds freeze from its first import.
The Qt (cute) framework is easily available since Maya 2011 switching to PySide in Maya 2014 but I will not cover those cases for now.
Turtle is a lighting and baking renderer originally developed by Illuminate Labs, available as a beta in June 2003 and released as 1.0 version the 31 June 2004. Predominantly used for fast baking textures in the game industry in conjunction with Beast, it is owned by Autodesk since July 2010 when they acquired the company Illuminate Labs.
It was first bundled with the 2011 Autodesk Maya Entertainment Creation Suite Premium, and then for everyone in Maya 2014 even though it seems to fall into abeyance… strange thing coming from Autodesk.
It can be very useful for ambient occlusion, it is much more faster and cleaner than mental ray… and clunky, especially when using the MEL commands. The documentation is incomplete and nearly non-existent.
One problem I stumbled across was those crazy artefacts you get sometimes when baking Ambient Occlusion. From what I have seen, those come when you try to bake several meshes with the same shaders or with separate UV shells AND if you try to bake in more than 2K.
Taken from this sadly very alone post.
Others can be found here and here (which the user have found the solution, but does not say it, great) and here.
Sometimes the proxy managers in a scene will break and all the proxies will be spread out instead of being linked to a single reference.
Usually it’s better to go back to the last version of the scene since there is not a lot of changes between versions, but for this one, the last clean version was older than a week…
Yes, one week.
The scene was broken for more than a week, but the animator couldn’t see it because he never reopened its scene during that time. The status of Maya/the scene was unstable while the artist was working on it, and each time he saved, it was saved in that unstable state… thus why we couldn’t recover any version less than a week old.
So here I am with no proxy managers, no animation and a week of work vanished.
As a TD, you are often asked to trace a bug or a crash, and it is way more easy when you have all the actions and logs done by the user/software.
To do so, you usually have to modify the userSetup.mel of the user when you can and begin the logging… Then remove it when you are done.
The Maya command cmdFileOutput is quite handy for that.
What a hassle to do that for every single user each time you want to trace and debug something. It can be very cumbersome especially if you have a lot of users to manage. So what about a global and automatic solution that activate only for specific users at a time?
All you need to do is to put the script in the global startup of Maya, and activate it only if the username is in a specific file that you can access and modify very easily.
Sometimes the colors of the animation curves in the graph editor are not in RGB anymore, either it was changed by a tool or by another human, it’s hard for you to work with those weird colors. Here is the little quick tip.
To restore the original color of a curve, select a node curve by right clicking on a red field in the Attribute Editor and uncheck ‘Use Curve Color’ in the ‘Anim Curve Attributes’ section, or use this script to do it for every animation curve in a scene:
objList = cmds.ls(type="animCurve")
for objName in objList:
cmds.setAttr(objName + ".useCurveColor", 0)
string$objList[] = `ls -type "animCurve"`;
string$objName;
for ($objName in $objList) {
setAttr ($objName + ".useCurveColor") 0;
}
In my last article you may have noticed the Context commands were not actually waiting for the user input. All the commands following them would be executed even though the user didn’t complete the Context tool.
The trick (without using the API) is to use a scriptJob that got executed only once, and that is immediately destroyed after its execution.
You call your context tool and create the scriptJob, then that scriptJob will execute the command when the condition you want is met.
If you are drawing a curve for example, the selection will change as soon as the user release its mouse button, you can then process whatever you want to process.
You still have to do some verifications in case the user didn’t cancel the tool.
You can do so by checking if the new selection is what you were expecting, or/and if new nodes were created. Keep in mind that neither of those checks are full proof in this situation.
The final code:
You can even do that for each curve the user draw without exiting the current Context Tool. Do not set the scriptJob with runOnce, and destroy it once the conditions are not checked in the executed_after_action(). That’s it!
Lately I was doing a script involving the Paint effects tool. The command is not available in the documentation so I just used, as usual, the script editor in conjunction of ‘Echo all command’ to get the mysterious MEL command: PaintEffectsTool. Everything’s good, my script is going well but one thing annoys me… I want to pause my script while the user is painting and then do something with his input. The problem is, all the following commands of my script get executed immediately after calling the Paint Effect Tool. It never waits for the user input. I continued my investigation on how to do this… and finally stepped upon the scriptCtx command:
This command allows a user to create their own tools based on the selection tool. A number of selection lists can be collected, the behaviour of the selection and the selection masks are fully customizable, etc.
It kinda worked but not quite well, and I was not satisfied with the result. I then noticed in the command reference of Maya a lot of commands with the suffix Ctx and especially the currentCtx command:
This command returns the currently selected tool context.