Quantcast
Channel: mel wiki
Browsing all 610 articles
Browse latest View live
↧

How can I paint component selection?

I always seem to forget this: To pain-select polygonal components, enter the component mode you wish to pain (vertex, edge, face), and: RMB on the mesh Paint -> Paint SelectThere are two...

View Article


Understanding MAYA_MODULE_PATH

Main Maya DocsAPI MFnPlugin docs, under 'modules'.Modules are a way to distribute custom plugins. They define paths to text files that specify directories where the plugins, and their dependencies...

View Article


How can I execute system commands and capture the results?

Via pure Python, you can use subprocess.Popen to do this. My Python Wiki has a subject covering this.In Maya though, PyMel makes this even easier via its pymel.util.shellOutput command (which appears...

View Article

How can I launch an external app, but not block Maya in the process?

This will open a Windows cmd shell from Maya, but not block Maya in the process:import subprocess subprocess.Popen("start cmd", shell=True)

View Article

Query Maya & Maya Python Executable Locations

Querying this in a Python script ran in Maya is pretty trivial: maya.exe and mayapy.exe (the Python executable) live in the same directory for Windows. You can also query where Python thinks its...

View Article


How I like my selection settings

These settings seem to change on me, so I need to get them all down in one place so I know how to set them back...

View Article

Maya failing on maya.standalone import

Maya 2016 : I have batch tools that run, that execute this at the top of the Python module:# myModule.py if __name__ == "__main__": import maya.standalone maya.standalone.initialize(name='python') #...

View Article

How can I specify 'all keys' when cutting or pasting in Python?

In mel, when copying or pasting all keframes, the syntax is pretty simple (replace ... with the rest of the command code):cutKey -time ":" ... ; And even the Python command docs say this:-time ":" is a...

View Article


How can I find all reference edits, and remove them?

PyMel:This will filter the edits by type, and by namespace:import pymel.core as pm def removeRefEditCmd(editCommand, namespace=None): """ Tool to remove reference edits. editCommand : string : Valid...

View Article


How can I query the red/highlighted range on the timeslider?

import pymel.core as pm tc = pm.language.melGlobals["gPlayBackSlider"] first,last = pm.timeControl(tc, rangeArray=True, query=True)

View Article

How can I query what the highlighted range of the time slider is?

# Python code import maya.cmds as mc import maya.mel as mm # cast mel variable to Python: gPlayBackSlider = mm.eval("$g = $gPlayBackSlider") # Is anything highlighted? rangeHighlighted =...

View Article

API: How can I author callbacks for Maya events?

The most common way to do this is via mel scriptJobs. But via the OpenMaya API, you can access many 'Message' classes that provide a lot more functionality to areas that scriptJob's don't provide.It...

View Article

API: How can I make a transform?

(Referenced from 'Complete Maya Programming') Waaaay exciting! It should be noted that any time you use API calls outside of a plugin to modify the DG, you can't undo the operation.# Python code import...

View Article


How can I convert from string to int?

Some languages give you the ability to Boolean test strings: You can convert a string to a Boolean, and if the string has any characters, the bool = True. If the string is empty, the bool = False. How...

View Article

How can I add images to my UI, without hardcoding their paths?

It's fun to add images to your UI's, but the biggest problem is when you give your UI to someone else, usually the hard-coded paths to the imagery break. PythonOne nice thing about authoring modules in...

View Article


How can I author an undo context manager?

Starting with Python 2.5, they introduced the new with statement, which is known as a 'context manager'. See official...

View Article

How can I author an undo decorator?

A common problem I run into when coding in Python in Maya, is the ability to undo: Sometimes, and often this happens when issuing button commands via a UI, when the user wants to undo the last...

View Article


How can I make the Outliner in the Graph Editor not expand connections to...

This... 'annoyance' was introduced around Maya 2008 (+- a version?): If you had objectB.tx connected to objectA.tx, and objectB.tx was keyframed, and you opened the Graph Editor for objectA, you'd see...

View Article

How can I get a list of all incoming connections to a node?

Update: This is a perfect example of overengineering ;) I did all the below work before I realized there is a listHistory node, which does all this for you. Check it out...Say you have a list of Maya...

View Article

Servo Tools

Ran across this recently, had to make a note:Servo Tools for Maya"Servo Tools For Maya is a Python Plugin that sends rotational values over USB to the Arduino Micro Controller. These values are then...

View Article
Browsing all 610 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>