

- #MAYA PYTHON PRINT SELECTION HOW TO#
- #MAYA PYTHON PRINT SELECTION CODE#
- #MAYA PYTHON PRINT SELECTION WINDOWS#
#MAYA PYTHON PRINT SELECTION CODE#
The sample code above adds keyframe animation to a channel (in other words, a plug).

TimeArray.append(om.MTime(times, om.MTime.uiUnit())) # Copy the times into an MTimeArray and the values into an MDoubleArray. You can use this Python example script to create an animated curve and set its key frames:ĭef addkeys(plugName, times, values, changeCache):ĪnimCurve = animfn.create(plug, ) Mel.createMelWrapper(setThisContainerCurrent)Īssets > Advanced Assets > Create and add Mel.createMelWrapper(rmbM圜ontainerScript,retType='string') This will create the MEL wrapper scripts needed:

Execute the following from a Python tab in the."Set This Container Current", "setThisContainerCurrent") Return ("Execute Container Notes", "exCoNotes", ObjCont = ntainer(q=True, findContainer=node) Scripts directory of your preferences folder:
#MAYA PYTHON PRINT SELECTION HOW TO#
The following is an example of how to use theĬreateMelWrapper function to register a Python function as a MEL procedure in order to use the For example, in theĪsset (formerly container) node, the Rmb Command attribute under theĬontext Properties section only accepts MEL procedures.

\Python\lib\site-packages\maya\mel folder of your Maya installation directory. Then, when the MEL procedure is invoked, it calls the Python function, passing any arguments it receives and returning the function's result.įor more information regarding this function, refer to the Registering a Python function as a MEL procedureĬreateMelWrapper function to register a Python function as a MEL procedure. Press F5 or the green play button to return control to Maya.
#MAYA PYTHON PRINT SELECTION WINDOWS#
Windows may pop up another authorization dialog box asking for authorization. Set a breakpoint using F9 or by clicking in the leftmost margin. Start Maya, and ensure your Python script can be imported successfully and run.Windows may pop up a dialog box asking for authorization to open a communication port. Ensure that Enable Passive Listen is checked in Wing IDE > Edit > Preferences > Debugger to allow connection from external processes.For example, copyĬ:\Program Files (x86)\Wing IDE 3.1\wingdbstub.py to Wingdbstub.py from the Wing IDE installation directory into the Maya Python script path. To start a debugging session of a Maya Python script with Wing IDE 3.1 in Windows, do as follows:
