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
0
votes
1 answer

Maya selection import

I'm trying to figure if it's possible to import a maya file into a Maya scene, but only certain things objects (such as locators named "xyz" and it's animation) but skip everything else. (I'm not looking to import a folder amount of files, but…
James Porter
  • 119
  • 2
  • 12
0
votes
0 answers

Maya MGlobal::select / unselect crashes maya

I wrote a Custom locator using MPxLocatorNode in C++. I have very special requirement for this locator. This is mainly targeted for using as rig controls as well as Character picker ui element. So, i provided an option to use it as button(like a…
vaishak
  • 63
  • 7
0
votes
2 answers

Driving Strings with if/else statements maya/python API

I should first let you know that im trying to re-create the aimconstraint UI from maya. this is the first time ive used python so im just doing a small project to wrap my head around it. the problem children are the maintain offset bool and the…
Calavid
  • 13
  • 2
0
votes
0 answers

Add geometry shader fragment to MShaderInstance

Render items in Maya (MRenderItem) get drawn by shaders (MShaderInstance), which contain fragments (gpu shader pieces) that are compiled to one big shader just before drawing. MShaderInstance allows you to add your own fragments, declaring them…
Emil Kirichev
  • 189
  • 10
0
votes
2 answers

How to get the arclen between two curve points in Maya?

In Maya 2015, I can get the arclen of a curve using this command: cmds.arclen('bezier1') But now I want to get the arclen of two points in my curve. Is there anyway to get this?
Noah Zuo
  • 98
  • 12
0
votes
1 answer

Maya C++ Creating Custom Material

How in maya C++ do I create custom shaders/materials? I also need to obviously also attach the shader code to this material. I know how to access Materials with the API just creating seems difficult.
0
votes
1 answer

Get ramp attribute in compute()

I am basically making a ramp shader and trying to find the proper way to get values from a ramp attribute in the compute() function for a node. I know it can be done with MObject oThis = thisMObject(); MRampAttribute rampAttribute(oThis,…
Pooks
  • 2,565
  • 3
  • 37
  • 40
0
votes
1 answer

Creating temporary curve in maya python plugin

I would like to get a world position of a specific parameter along a nurbs curve defined by a list of positions. Currently I'm creating a temporary curve in the plugin just to get an array of positions along this curve: # targetXforms = array of…
0
votes
0 answers

Disconnecting/connecting plugs gives internal failure in compute()

What's the right way to disconnect/connect plugs during MPxNode compute() method? I have a modified plugin that it's plugs are already connected to some other objects transform nodes, it always gives me the internal failure error when I want to…
Yasin
  • 609
  • 1
  • 10
  • 22
0
votes
1 answer

Create a pointer to a MFnMesh

I am trying to create function that receive a MFnMesh pointer and do things on it. The problem is that I cannot convert my MFnMesh to a pointer, I think the problem is not only on this class but on MFnBaseClass because I get this…
oktomus
  • 566
  • 7
  • 28
0
votes
1 answer

Maya API duplicate/delete compound array attribute

I am writing a deformer node which takes as inputs the worldMatrix and visibility of cylinders. The cylinders are organised into groups, and this structure is mirrored on my deformer. I have a 2D array, organised by groups with cylinders for…
jhod91
  • 3
  • 2
0
votes
1 answer

Get the corresponding icon for a type of node in Maya

I want to use the same icons the outliner shows for the nodes in Maya in my Qt tool inside Maya?. Is there any way to find the path of the icons or the icons in Qt of nodes I have depending on the type? Is there... any way to get those icons using…
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
0
votes
1 answer

Communication between 2 Maya plugins

I am developing 2 Maya plugins in C++ and would like to call a function in plugin #1 from plugin #2 and send parameters along with the function. The caller plugin is an MPxNode and the called plugin should be "general" functions whose role are to…
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
0
votes
0 answers

easy_install from Maya's python interpreter

I would like to download and install setup_tools, easy_install and tinydb all from within mayas python interpreter.. check out setup() in the code below. I'm pretty close, but it looks like the system command to run ez-setup.py is not downloading…
Pax
  • 237
  • 3
  • 11
0
votes
1 answer

How to change the weights of a deformer from a script in Maya?

How to change the weights of a deformer from a script in Maya? This question is ideally for Pymel in Maya 2013, but if it is not possible I would still be interested to know the answer in Python, MEL, or using the C++ Maya-API.
Vincent Cantin
  • 16,192
  • 2
  • 35
  • 57