stealthrest.blogg.se

Maya python print selection
Maya python print selection









maya python print selection
  1. #MAYA PYTHON PRINT SELECTION HOW TO#
  2. #MAYA PYTHON PRINT SELECTION CODE#
  3. #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).

maya python print selection

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:

maya python print selection

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.

  • Some attributes in Maya only accept MEL procedures.
  • Using this wrapper function allows Maya to source on the fly and not have to have every script available loaded at all times. By comparison, if you are using Python, you must import the script explicitly before you can access the functions or classes it contains.
  • By registering your Python function as a MEL procedure, you do not need to source the MEL script if the procedure and the script share the same name.
  • Or, execute the following in the Script Editor:

    maya python print selection

    \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.

  • Now you can use all the debugging features of Wing IDE to examine the state of your program.
  • A red line highlights the next line of code to be executed. When that breakpoint is reached, the status indicator turns yellow to indicate that Maya has been paused.
  • In Maya, call the Python function that contains your breakpoint.
  • This indicates that the remote debugging connection has been established, and that Maya is running.
  • Check back in Wing IDE the status indicator in the lower left of the main Wing IDE window should be green.
  • #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:











    Maya python print selection