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

How to add edge in mesh using Maya Python API 2.0

I use maya.api.OpenMaya.MFnMesh.subdivideEdges() function. Edges are split by vertex, but corresponding new edges does not comming. How can I add edge across the split edges ? or how can I create the edges from one vertex to another. Using Maya…
Subin Gopi
  • 541
  • 2
  • 12
5
votes
1 answer

Customize Maya's addCheckCallback pop up message

When the user saves a file I want a check to happen prior to saving. If the check fails then it doesn't save. I got this working with mSceneMessage and kBeforeSaveCheck, but I don't know how to customize the pop-up message when it fails. Is this…
Green Cell
  • 4,677
  • 2
  • 18
  • 49
4
votes
3 answers

Same python code works differently on differently Maya (2012 - 2015)

this simple code import maya.cmds as cmd circle1 = cmd.circle(nr=(0, 0, 1), c=(0, -1.1, 0), ch=1) circle2 = cmd.duplicate(circle1[0], ic=1) circle3 = cmd.duplicate(circle1[0], ic=1) cmd.setAttr(circle2[0] + '.rotateZ', 120) cmd.setAttr(circle3[0] +…
Ale_32
  • 648
  • 1
  • 6
  • 16
3
votes
2 answers

Testing if an object is dependent to another object

Is there a way to check if an object is dependent via parenting, constraints, or connections to another object? I would like to do this check prior to parenting an object to see if it would cause dependency cycles or not. I remember 3DsMax had a…
Green Cell
  • 4,677
  • 2
  • 18
  • 49
2
votes
1 answer

MFnMesh allIntersections returning wrong results

I'm trying to use Maya's api to test if a point is inside a certain mesh by shooting a ray and seeing how many faces it hits. I'm doing this with MFnMesh.allIntersections. The issue I'm coming up with is that sometimes the method returns results…
Green Cell
  • 4,677
  • 2
  • 18
  • 49
2
votes
2 answers

Maya Error - ModuleNotFoundError: No module named 'maya.cmds'

I am using ubuntu 18.04, python 3.6. I installed maya using : pip install maya then tried to run this : import maya.cmds then i got the module not found error. Then i installed : pip install maya-cmds-help But again same error is showing. How can…
SRJ577
  • 31
  • 2
  • 9
2
votes
1 answer

Rename bazel output (extension) after build

I see there's a thread where this has been discussed already, but a bit vaguely: Can I instruct bazel to emit a ".elf" suffix to executables? Unfortunately that doesn't help in my case. I am trying to compile plugins for Autodesk Maya on windows…
mdilena
  • 55
  • 1
  • 6
2
votes
2 answers

How to abort the loading of a file in Maya started via cmds.file in python

I have code that runs a batch operation on files in Maya. The actual implementation isn't important, just know that it gets fed a list of filepaths, maya opens the files, then an operation is performed on each file in turn. In cases where a…
Nambread
  • 43
  • 6
2
votes
1 answer

Get list of reference nodes In Maya using Python API

I just want to list all the reference nodes on the current Autodesk Maya scene file using python API (only), there is this class called MFileIO in C++ API but that to returns the referenced file name not the reference node but there is no such class…
2
votes
1 answer

What is the proper way to work with ramp nodes using the Maya 2016 SP6 Python 2.0 API?

I am new to programming using the Python 2.0 API (have used the Python Maya.cmds a fair bit). As I understand it, I should be able to manipulate a ramp node referenced via an MObject using the corresponding ramp node function set. Unfortunately, I…
2
votes
1 answer

How to set the Clutser Deformer weights using Maya Python API 2.0?

This is the incomplete code, my inputs are mention in this codes (cluster, geometry and its values). Which class i can use for set the cluster weights?. Is it possible to use maya.api.OpenMayaAnim.MFnSkincluster to set cluster weights. import…
Subin Gopi
  • 541
  • 2
  • 12
2
votes
2 answers

Connect two maya on local network

How to connect two maya in local area network. For example. 2 users open maya software in different computers in local area network and connect there maya session by python commandPort. The final goal is both user can edit a same model at same…
user6417907
2
votes
4 answers

Generate random points on any 3 dimensional surface

I was wondering, how would you, mathematically speaking, generate x points at random positions on a 3D surface, knowing the number of triangle polygons composing the surface (their dimensions, positions, normals, etc.)? In how many steps would you…
UKDP
  • 226
  • 5
  • 21
2
votes
2 answers

getClosestPoint from the mouse-cursor position to first object that hits of the raycast (maya mel script)

researching for getting a worldpoint from the mouse-cursor position to first object that hits of the raycast. maybe an api func getClosestPoint or rayIntersect can do that job ?if so how? (thank you)
Zen Of Kursat
  • 2,672
  • 1
  • 31
  • 47
2
votes
1 answer

Separate polygon shells into separate meshes in Maya API

Is there a way to separate two polygon shells in Maya API (OpenMaya)? Just like the cmds.polySeparate function (which i cannot use because it returns the separate nodes in random order, so I cannot know which one to delete and which one to keep in…
Jiloc
  • 3,338
  • 3
  • 24
  • 38
1
2 3
11 12