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 icon for custom plugin

I created a custom node for which I would like to add a custom icon. I read it is enough to make an image and place it inside one of the path contained in the variable XBMLANGPATH. However if I give the mll to someone, this person will have to…
dd95
  • 239
  • 2
  • 16
0
votes
1 answer

MItSurfaceCV, how to get Indices?

I'm trying to get the SurfaceCV indices from a NurbsSurface. When I use the MItSurfaceCV class I get too few indices. My Code till now, with a NurbsSphere selected: sel = om.MSelectionList() om.MGlobal.getActiveSelectionList(sel, 0) dg =…
FzudemAA
  • 3
  • 4
0
votes
1 answer

Can I create a custom Maya node with an image attribute?

I'm trying to write a custom Maya node in Python. Some of the inputs to my node algorithm are images (like height maps). Is there a way to create an image node attribute (whether input or output)? Right now I'm just using the filenames of the images…
0
votes
1 answer

Maya API - Get mesh from material

I'm currently working on a custom viewport plugin for Maya. At the moment, I'm trying to parse materials from Maya to my own custom framework materials. I've created a callback that is called when a lambert shader is added (see code snippet below).…
M Zeinstra
  • 1,931
  • 4
  • 17
  • 46
0
votes
1 answer

Maya Python How to access polyCube

I couldn't find any answer so I fought I ask here. I'm working on a poly generator tool in which I want to set Values of the height and width of a cube. My problem is that I don't know how to get the name of the construction history e.g.…
FzudemAA
  • 3
  • 4
0
votes
1 answer

Render Setup Bug when trying to delete RenderSetupLayer nodes through Node editor

My first post on StackOverflow! I am currently trying to script a simple Render Setup tool to quickly allow the deletion of RenderSetup layers. However, I've noticed that when I select the RenderSetupLayer nodes by name , it causes the "deleted"…
CKane
  • 13
  • 6
0
votes
1 answer

select nonlinear deformers input node and set keyframe in maya using python?

I want to select and set a key frame in a nonlinear deformers in maya using python script. What I had tried and failed obviously is based on the knowledge i had on these command. cmds.setKeyframe('some object name', time='a specific frame',…
Daniel Yu
  • 23
  • 4
0
votes
1 answer

How to connect nodes to get and set info on them at the same time?

I need to get the position of a transform node. Do some calculations using other inputs. And set it again on the same transform node. That creates a cycle that Maya doesn't like. What should I do if I want to query and set information in the same…
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
0
votes
1 answer

Maya MPxNode multiple outputs

I'm trying to create an MPxNode with multiple outputs, but I can only get one to work properly. The other output doesn't set properly after connecting the node and during undos. Is it possible to set both outputs at the same time in compute like how…
Green Cell
  • 4,677
  • 2
  • 18
  • 49
0
votes
2 answers

projecting points onto a parallel grid at a depth from camera (maya)

I am attempting to create a grid of locators that serve as projected points onto a parallel finite plane from a camera in maya at a specified depth. The grid should line up with a specified resolution so as to match rendered output. At the moment my…
monsterAdurm
  • 63
  • 1
  • 7
0
votes
0 answers

Creating a straight line motion path using the Maya API

I'm working on a project and for it I need to be able to create a straight line motion path and attach a camera to it. Once the camera moves along that path completely, I also need to render it from the camera's view, all with the Maya API. Could…
0
votes
1 answer

How to add an material to the maya scene?

Hi everyone I am trying to write some script to automate my work in Maya. Right now I am looking for the way to add materials to the hypershade. I can't see anything on console (Script editor) so I can't se what python api I should use. I know…
0
votes
1 answer

Maya c++ API, animating an object in a thread

I am trying to wrap my head around moving an object using the c++ Maya API. I create a joint, using: MFnIkJoint* rootJoint = new MFnIkJoint(); MObject rootTransform = rootJoint->create(MObject::kNullObj, &status); Then I launch a thread that moves…
anti
  • 3,011
  • 7
  • 36
  • 86
0
votes
1 answer

Maya c++ API, parenting one object to another?

I am learning the maya c++ API, and am stuck on the simplest task. i have an object (a locator): MObject locatorObj = dagModifier.createNode("transform"); MObject locShapeObj = dagModifier.createNode("locator",…
anti
  • 3,011
  • 7
  • 36
  • 86
0
votes
1 answer

Maya Python - How to create shaderOverride?

Using python in Maya 2017, I'm able to reproduce the structure of my render_setup (layers, collections and overrides) except for shaderOverride. For a classic override, I use the instance function :…
Kevin Lemaire
  • 949
  • 2
  • 12
  • 36