一、Maya Python API概述 Maya提供了两种主要的Python接口:maya.cmds和maya.api.OpenMaya。maya.cmds模块是一个命令级别的接口,它类似于MEL(Maya Embedded Language),易于上手;maya.api.OpenMaya是一个更底层的API,提供了对Maya内部数据结构和功能的细粒度控制。 1.1、maya.cmds模块 maya.cmds模块是最常用的接口,它...
classCustomPanel(pm.ui.FormLayout):def__init__(self,parent):super(CustomPanel,self).__init__(parent)self.create_widgets()self.create_layout()defcreate_widgets(self):# 创建属性面板的小部件self.attribute_label=pm.ui.Text(label="属性:")self.attribute_field=pm.ui.TextField()self.value_label...
属性和插槽的获取和设置值:插槽可用set函数设置值,用as函数获取值 # height = om.MFnUnitAttribute(fnDepNode.attribute("height"))heightPlug:om.MPlug=fnDepNode.findPlug(fnDepNode.attribute("height"),False)print(heightPlug.attribute()==fnDepNode.attribute("height"))heightPlug.setFloat(100.0)print(he...
cmds.addAttr(sphere_xform, attributeType='float', shortName='mass', longName='Mass', defaultValue=5.9742e24) print(cmds.getAttr(sphere_xform+'.mass')) cmds.addAttr(sphere_xform, dataType='string', shortName='alt', longName='alternateName') cmds.setAttr('%s.alternateName'%sphere_xform,...
本文通过分析akasaki1211的开源插件boneDynamicsNode源码(github.com/akasaki1211/)来熟悉maya C++插件的开发,后使用Python脚本开发界面提高该插件可用性。该插件是Node类型的插件,用于对场景中的骨骼直接应用动力学模拟。该文章用于个人学习记录 boneDynamicsNode节点基本的连接方式如下(此处隐藏了部分属性): 前置知识 1....
在“属性”(Attribute)字段中键入属性的名称,然后单击“添加”(Add)。 在“通道盒”(Channel Box)中选择属性,然后单击“来自通道盒”(From Channel Box)。 添加的属性会显示在“属性”(Attribute)下的表中。 属性前缀(Attribute Prefix) 指定前缀以过滤出要写入到 Alembic 文件中的属性名称。在“属性前缀”...
摘要:#跟着教程学# 3、Python基础 //Maya select和ls命令返回值问题 脚本编程 execfile('c:/*py') #括号里填要指定的py文件路径就可以执行了。 脚本中有中文,需要在开头加上 # coding=utf-8 表达式与操作符 专业术语,例如2+2,‘2’称为值,'+'为 阅读全文 posted @ 2019-10-16 12:15 3lina! 阅读...
maya python脚本调用其他模块 mayapython开关,attrColorSliderGrp颜色滑块创建一个颜色滑块组,包括标签,彩色画布,滑块和按钮。单击画布将显示颜色编辑器。如果按钮可见,则允许您将纹理映射到属性。可以使用-cw/columnWidth,-co/columnOffset,-cat/columnAttach,-cal
若要将上述 Python 模块中定义的自定义滑块控件添加至“白炽度蓝色”(Incandescence Blue)属性,请执行如下操作: <attribute name='incandescenceB' type='maya.float'> Incandescence Blue <description language="cb">py.AEaddFloatSlider.AEaddFloatSliderModule</description> </attribute> 在“...
importmaya.cmdsasmc#This moudle provides most of the MEL commands to PythondefVisibilityKey(object,startTime,endTime):mc.setKeyframe(object,time=startTime,attribute='visibility',value=1)mc.setKeyframe(object,time=endTime,attribute='visibility',value=0)#The first argument is the name of the obj...