Questions tagged [maya-api]

This tag deals with [tag:maya] API questions, as opposed to Maya scripting interfaces.

is a subtag for Maya that deals with the API questions. C++ Application Programmer Interface provides better performance than MEL or Python. You can add new objects to Maya using the API, and code executes approximately ten times faster than when you perform the same task using MEL. Also, you are able to execute MEL commands from the API.

169 questions
1
vote
1 answer

Maya Python - add multiple strings to render setup layer collections

I am trying to add multiple strings to the Include list of my Render Setup Layer Collection. See Image Here Here i can add 'test1' using setPattern import maya.app.renderSetup.model.renderSetup as renderSetup """create render setup instance""" rs =…
mossy
  • 13
  • 4
1
vote
1 answer

Maya API C++: get material from poly

I am writing a plugin for Maya 2018 using Maya API C ++. I have already successfully obtained a mesh, and created an iterator to iterate through all the polygons: ... MFnMesh fnMesh(mdagPath, &stat); if (MS::kSuccess != stat) { // error get…
Range
  • 416
  • 7
  • 20
1
vote
1 answer

How can I import maya Python API?

I'm using ipython, and I copied maya Python API packages from my maya installation directory to the site-packages folder, but when I am trying to import maya.api.OpenMaya, I get a traceback like that: ImportError Traceback (most recent…
SDC1215
  • 21
  • 4
1
vote
0 answers

deleting Objects from MObjectArray in undo

As per below code first I am trying to append objects to MObjectArray , which I want to delete in undo functionality. Undo,Redo works fine .. But undo is deleting only first element of array/object not all of them. Would like to know what's going…
Atri Dave
  • 152
  • 2
  • 9
1
vote
1 answer

Autodesk Maya API Custom Node

I would like to find out if anyone has suggestions on how to create a script that can easily be edited to create a custom Maya node with just adding in some arbitrary values of any type. Basically, I would want to be able to specify an attribute…
Jascha
  • 11
  • 3
1
vote
0 answers

Maya UV per local polygon triangle

I was wondering if anyone has good way in Maya C++ Api to find a UV coordinate per local-relative triangle for polygon. Seems easy to find the per poly face UVs but how can I map them back to the poly triangles ? Thanks
1
vote
1 answer

Set highlighted range in Maya's Time Slider

It is easy to get the highligted range in the time slider using: import maya.cmds as cmds import maya.mel as mel aTimeSlider = mel.eval('$tmpVar=$gPlayBackSlider') timeRange = cmds.timeControl(aTimeSlider, q=True, rangeArray=True) Likewise the Qt…
Morten
  • 487
  • 2
  • 13
1
vote
1 answer

Trasnparent Window in Maya 2017

i found a script by SAFRONOV 3D (on youtube) that allows him to make the graph editor transparent inside Maya... The problem is that it works on Maya 2014 and i'm Trying to update it to 2017. I know very little of opne maya and all that, i´m a…
Mendel Reis
  • 55
  • 2
  • 14
1
vote
1 answer

is there a quicker way to fill an MSelectionList?

In maya, I want to make an OpenMaya MSelectionList (api version 2.0) with more than one item in it... I've only been able to fill it with the add method like so: import maya.api.OpenMaya as om selList =…
silent_sight
  • 492
  • 1
  • 8
  • 16
1
vote
1 answer

Maya Python mirroring issue

I want to mirror an object in maya "object1" and delete it's original version after the mirroring cmds.polyMirrorFace("object1",name="object1Mirror",cutMesh=0,axis=0,axisDirection=1, mergeMode=0, mergeThresholdType=0, mergeThreshold=0.001,…
goetzmoritz
  • 453
  • 1
  • 5
  • 23
1
vote
1 answer

How can I return the ws xyz position of the paint cursor in maya python?

I want to be able to focus the camera around the maya paint cursor while painting weights. I need to grab the XYZ position of the cursor for me to do this, does anyone know how i can get this?
Adam Sirrelle
  • 357
  • 8
  • 18
1
vote
3 answers

Maya python script for combine few curves to one

Hi I'm a newbee in python and scripting, read a lot of tutorials and try to create script for combine curveShapes to one curve with multishapes, it's works fine for me. But here i have one bug when i start script first time after launch Maya it…
1
vote
1 answer

maya api vs python commands: vertex normals

I'm trying to extract the vertex normal of a mesh object at a particular vertex. I've noticed that I get different results when using the python API instead of the maya python commands. Python commands (gives me the result i…
ejmoli
  • 145
  • 1
  • 9
1
vote
3 answers

How create Maya Particle Disc Cache (PDC) from Houdini Particles Data

I am trying to export Houdini15 particles data to Maya2015 particles. So the basic idea is Create a particles in Houdini Save particles data to disc Read particles data in Maya the particle data should include position, particleId, age, velocity…
Rajiv Sharma
  • 6,746
  • 1
  • 52
  • 54
1
vote
0 answers

Binding NURBS curve to Maya plugin and update CVs

I want to create a NURBS curve in Maya through a MEL script, bind it to my plugin and simply update the CVs in the plugin (and in the viewport). The problem is that I don't think it's possible to read and write to the same shape. Here is the MEL…
novalain
  • 2,181
  • 19
  • 36
1 2
3
11 12