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
0 answers

Mayan EDMS API - Cannot add a document to a cabinet

Using Mayan EDMS, I am unable to add a document to a cabinet. I am using PHP to send, create and upload a document, which works well. Thereafter, trying to add the document to the cabinet results in the following error {"detail":"Not found."} I am…
crafter
  • 6,246
  • 1
  • 34
  • 46
1
vote
0 answers

Maya Python: Get the Widget containing the renderd image from Mayas Render View

I am trying to make an experimental tool that modifies the existing Maya Render View and swaps out the current rendered Image. I want to get the widget that contains the rendered image and change it. I got the Render View Dialog through MQtUtil with…
Sweck
  • 31
  • 7
1
vote
1 answer

Maya Python - How to set input mesh on MASH programmatically?

I'm trying to create a MASH in Maya and set the input mesh using the Python API. This is incredibly simple in the GUI but I've spent hours and can't figure out how to make it work in the API. Here's my code so far: from maya import cmds import…
user419164
  • 91
  • 3
1
vote
0 answers

How to hide the lines behind the surface in Mayavi in Python?

I am trying to create a sphere with lines and dots on it. But since I am plotting the sphere, the lines and the points separately in the code, I don't think Mayavi recognized it as a whole figure. So the lines and points on the rear face of the…
user536618
  • 11
  • 1
1
vote
0 answers

Adding a polygon to mesh in cpp (using maya api interface)

I'm trying to add a polygon to a mesh in cpp, where only one edge of the polygon is exist in the mesh (only 2 points of the polygon are already exist in the mesh). I tried to use the "addPolygon" function, but it didn't worked because the mesh…
Danny
  • 23
  • 2
1
vote
1 answer

How to trigger a callback on referencing a file into the scene

In maya, I want to run a certain callback after anytime a new file gets referenced. I want to do this in python. According to the docs this should be possible:…
Nambread
  • 43
  • 6
1
vote
2 answers

How to run OpenMaya.MCommandMessage without crashing Maya

I'm trying to get Maya's log(What it prints in script editor's output window) and add it to my custom PySide Qwidget. Why this crashes Maya QtWidgets, QtCore, QtGui imoprt QtDesiner_UI import maya.OpenMayaUI as OmUi from shiboken2 import…
IKA
  • 151
  • 1
  • 3
  • 11
1
vote
1 answer

getting defaultArnoldRenderOptions attributes

I'm trying to write plugin for Maya using pymel. There is a little problem with using default attributes of Arnold renderer (outputfile format). Code: import maya.cmds as cmds cmds.getAttr('defaultRenderGlobals.imageFormat') #return id of used…
AnnaS
  • 15
  • 6
1
vote
2 answers

why i have some missing files when cmake generate build folder ? (Maya 2020 - CMake 3.16.4 - VS 2017)

I exactly followed the instruction in API help to create visual studio project: The CMakeLists.txt File guide but I got this error: CMake Warning (dev) in CMakeLists.txt: No project() command is present. The top-level CMakeLists.txt file must …
Amin Khormaei
  • 379
  • 3
  • 8
  • 23
1
vote
1 answer

get list of external files with maya

I am looking for a way to list every external file existing in my scene(already open) without the use of a reader. I've invastigate the pymel doc and could'nt find what i was looking for. I want the list to be complete, to list even files that…
Aurele Collinet
  • 138
  • 1
  • 16
1
vote
1 answer

How to fix 'TypeError: in method 'MFnMesh_anyIntersection', argument 4 of type 'MIntArray const *' error in Python in Maya

I wanted to try out some raycasting with Python in Maya using OpenMaya.MFnMesh.anyIntersection(). I just want to cast a ray from on object downwards and hit a plane, not go any further so I get only one raycasthit and get the translation values from…
Lala_Ghost
  • 211
  • 1
  • 12
1
vote
0 answers

Insert UI elements into existing layouts

I want to insert a button into the main status line in Maya, it is the line where the functions like, save scene, vertex snap, open render view and stuff like this is(screenshot). I already can add a button to the line, but it gets appended all the…
Lala_Ghost
  • 211
  • 1
  • 12
1
vote
1 answer

Trying to deform any mesh into a sphere. How to translate the vertex position to lie on a sphere?

I am trying to write a deformer script for maya, using the maya API which deforms any mesh into a sphere by translating it's vertices. What i already have is a deformer which translates every vertex of mesh in the direction of it's normal with the…
1
vote
1 answer

Material change callback (C++)

I'm currently working on a custom viewport in Maya 2018 and 2019. At the moment, I'm implementing my material parser to parse Maya material to my own framework's materials. However, I'm quite struggling with creating callbacks. I already managed to…
M Zeinstra
  • 1,931
  • 4
  • 17
  • 46
1
vote
0 answers

Maya API to get/read expression of Node attribute

I'm writing custom maya export plugin and I need to read expression of Node's attribute. But when I tried to use Maya api "MFnExpression" to read expression I get always (kInvalidParameter): Object is incompatible with this method Below is code: …
CKS
  • 31
  • 1
  • 3
1
2
3
11 12