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

maya arnold does not load the simple plugin example

I try to load the simpleShader.dll into maya arnold. I have a folder with the shader .dll, .mtd and .py. and I use a userSetup.mel to define the paths, but it doesn't work. any idea? ` //* EDDY3REE USER SETUP…
Eddy Khemiri
  • 111
  • 3
0
votes
0 answers

Maya C++ plugin needing to frame object with viewport from quarter camera perspective

After countless hours of attempting to solve and research this issue on my own I've come up empty coming ever so close to a perfect fit in the Maya viewport to no avail. I've had attempts get extremely close and others leave me on the floor. At this…
BananaPix
  • 1
  • 1
0
votes
0 answers

Maya python API: How to make float array attribute editable in the channel box/attribute editor?

I'm writing a custom node and I need an array of floats. I noticed that if I create an array attribute with om.MFnNumericData.k3Float type, then I can add new elements and edit the values in the attribute editor: But if I change the type to…
EEQ
  • 125
  • 1
  • 5
0
votes
0 answers

Group ID Deformers inaccurate in Maya 2019 and 2022 API

So I have written a custom reader and writer for wrap and cv wraps to have the ability to save and rebuild these deformers easily. Example test on wrap In Maya 2019, geom_plug = self.getAttrAsMPlug("input[0].inputGeometry") group_id_plug =…
0
votes
2 answers

Get the corresponding controlPoint from a component

The following commands will convert a given controlPoint index to the corresponding object's component type: import maya.cmds as mc print (mc.ls('pCube1.controlPoints[3]')) # ['pCube1.vtx[3]'] print (mc.ls('nurbsSphere1.controlPoints[3]')) #…
Fnord
  • 5,365
  • 4
  • 31
  • 48
0
votes
0 answers

new mesh to old mesh blendshape

I've wrote this script to blendshape meshes on different position and be able to attach a new mesh automatically. I feel like this script is really noob as Im still learning and would love is somebody could help me make it more effecient. The way…
Czar
  • 1
  • 1
0
votes
0 answers

Issues using Protocol Buffers in a C++ Maya API Plugin

Long story short, I would like to create a Protocol Buffer object inside the initializePlugin(), defined in pluginMain.cpp as shown below: // pluginMain.cpp #include "hello.pb.h" MStatus initializePlugin( MObject obj ) { MGlobal::displayInfo(…
Constantinos Glynos
  • 2,952
  • 2
  • 14
  • 32
0
votes
0 answers

How can I avoid getting my shaders and shading engine named as MAT1 and MATSG1 and so on?

So basically this is the code I have written which is getting the required paired meshes of character in maya and I need to assign similar shader to Leg, Arm and Hand respectively. And I was able to get meshes with different shaders and I assign the…
0
votes
1 answer

Maya Python exporting selected objects as separate files and generating a Maya thumbnail for use with the content browser

Thank you for any help/guidance that you can provide, I'm really hoping someone can help me with this problem. The script is supposed to go through a selection of objects and export each one into a separate file in the prompted location, it should…
0
votes
1 answer

Maya 2022 crashes while i run a python script

I am trying to create a menu, a submenu and an optionBox which lets the submenu item to create and remove itself from main menu. when I continuously try to add and remove the item from the main menu maya crashes with the message Fatal Error.…
aNup
  • 281
  • 1
  • 3
  • 14
0
votes
1 answer

How can you get a vertex's attribute through Open Maya

I want an Open Maya getter and setter for locking a vertex's pnt attribute. I am currently using Maya's standard cmds, but it is too slow. This is my getter: mesh = cmds.ls(sl=1)[0] vertices = cmds.ls(cmds.polyListComponentConversion(mesh,…
Adam Sirrelle
  • 357
  • 8
  • 18
0
votes
1 answer

How can I change the textScrollList depending upon the options I have selected in optionMenu in Maya?

` This is the function that i wrote the operation, where om = optionMenu def selection(*args): selected = cmds.optionMenu(om,sl=True, q=True) cmds.textScrollList(tsl, e=True, removeAll=True) for item in…
0
votes
0 answers

Change color management preferences in maya standalone

I have encountered a problem when changing color managmenet preferences in maya standalone. Is there a way to change these setting since opening a viewport is impossible in standalone mode? I'm also looking for a way to change the lighting settings…
Hamed
  • 11
  • 2
0
votes
2 answers

use OpenMaya to give particles specific translate and rotate values

I'm struggling with OpenMaya here. I want to be able to take transform information from a list of locators and plug these values to particles shapes. The goal is to use this over 25000 locators, so I can't create a particle system for each instance.…
0
votes
0 answers

How are the world space coordinates of objects calculated in maya?

Now I have two objects, "A" and "B", and "A" is copy from "B" use "A = pm.duplicate(B)[0]", then I did connect attribute like: pm.connectAttr(someBSNode.outputGeometry[0], A.getShape().inMesh) and "A" somehow moved a little bit in my view ( I…