maya

#跟着教程学# 2、Maya Developer Kit下载,及 PyCharm关联Maya

耗尽温柔 提交于 2019-12-01 08:14:42
Maya Developer Kit 下载地址:https://apps.exchange.autodesk.com/MAYA/en/Home/Index 安装和设置:http://www.autodesk.com/maya-help-2018-enu/?contextId=BUILD_ENVIRONMENT Maya Developer Kit下载、解压后 拷贝文件夹devkitBase内的文件 到 C:\Program Files\Autodesk\maya2018。 最终文件夹结构如下: C:\Program Files\Autodesk\maya2018\devkit C:\Program Files\Autodesk\maya2018\include C:\Program Files\Autodesk\maya2018\mkspecs C:\Program Files\Autodesk\maya2018\bin Developer Kit在 devkitBase\devkit\plug-ins有一些示例插件 。在 devkitBase\devkit\applications, 包含多个Maya API应用程序。 NOTE: 要编译自定义插件,可以在Maya安装的以下文件夹中找到C ++ API头文件和库。 Header files: ..\include\maya

How to make a nested dictionary and dynamically append data

假装没事ソ 提交于 2019-12-01 05:25:40
I have a loop giving me three variables matteGroup matteName object I would like to make a nested dicionary holding all the data like: dictionary{matteGroup: {matteName: obj1, obj2, ob3} } I am checking the objects one by one so I would like to create the matteGroup if it doesn't exist, create the matteName if it doesn't exixst and then create or append the name of the object. I tryed a lot of solution like normal dictionaries, defaultdict and some custom classes I found on the net, but I haven't been able to do it properly. I have a nice nesting I am not able to append, or vice versa. This is

super function doesn't work inside a maya python module

走远了吗. 提交于 2019-12-01 05:10:48
问题 Somehow, this works fine in the Maya/Python script editor, but fails when it's inside of my module code. Anyone have any ideas? class ControlShape(object): def __init__(self, *args, **kwargs): print 'Inside ControlShape...' class Cross(ControlShape): def __init__(self, *args, **kwargs): print 'Entering Cross...' super(Cross, self).__init__(*args, **kwargs) print 'Leaving Cross...' x = Cross() This gives me a TypeError: super(type, obj): obj must be an instance or subtype of type. 回答1: It has

How to make a nested dictionary and dynamically append data

做~自己de王妃 提交于 2019-12-01 03:52:56
问题 I have a loop giving me three variables matteGroup matteName object I would like to make a nested dicionary holding all the data like: dictionary{matteGroup: {matteName: obj1, obj2, ob3} } I am checking the objects one by one so I would like to create the matteGroup if it doesn't exist, create the matteName if it doesn't exixst and then create or append the name of the object. I tryed a lot of solution like normal dictionaries, defaultdict and some custom classes I found on the net, but I

maya python 定时器多线程问题

给你一囗甜甜゛ 提交于 2019-12-01 03:27:57
在maya实现一下python定时器线程控制 不过简单的可行,建立物体等操作会有崩溃问题发生 并报出 r6025 pure virtual function call或者 'Cannot convert data of type string[] to type string 然后就崩溃了 但是平常的移动之类没什么问题 可以用来刷新一些东西 另外这种方法不会阻塞maya的主线程,也就是说你可以一边操作一边看 以下代码操作注意有可能会导致maya崩溃 import threading as thd import time import maya.cmds as cmds global aaa aaa = 1 def fn(): global aaa aaa += 1 cmds.polySphere(n='mySphere'+str(aaa),sx=1, sy=1, r=1) cmds.select( clear=True ) thd.Timer(1,fn).start() fn() 上面的就会崩溃 下面的就不会,估计是创建的问题(需要新建一个叫sphere的物体) import threading as thd import time import maya.cmds as cmds global aaa aaa = 1 def fn(): global aaa aaa += 1

How to reference maya commands in PyCharm?

早过忘川 提交于 2019-12-01 01:16:53
I am trying to get pycharm (latest community edition) working with maya 2015. And the very first thing I need is to be able to reference maya commands module, but I don't seem to be able to find how. import maya.cmds as cmds fails with ImportError: No module named maya.cmds What do I need to do to get it to work? Morten Andersen I'm on Mac, but the steps should be the same on Windows, only some paths will differ. Setup the Maya Python interpreter in Pycharm In Pycharm, open your preferences and find Project Interpreter . Next to the drop-down list, click the little [...] icon, and choose Add

How to use python (maya) multithreading

梦想的初衷 提交于 2019-12-01 01:05:49
I've been looking at examples from other people but I can't seem to get it to work properly. It'll either use a single core, or basically freeze up maya if given too much to process, but I never seem to get more than one core working at once. So for example, this is kind of what I'd like it to do, on a very basic level. Mainly just let each loop run simultaneously on a different processor with the different values (in this case, the two values would use two processors) mylist = [50, 100, 23] newvalue = [50,51] for j in range(0, len(newvalue)): exists = False for i in range(0, len(mylist)):

How to reference maya commands in PyCharm?

南楼画角 提交于 2019-11-30 21:32:28
问题 I am trying to get pycharm (latest community edition) working with maya 2015. And the very first thing I need is to be able to reference maya commands module, but I don't seem to be able to find how. import maya.cmds as cmds fails with ImportError: No module named maya.cmds What do I need to do to get it to work? 回答1: I'm on Mac, but the steps should be the same on Windows, only some paths will differ. Setup the Maya Python interpreter in Pycharm In Pycharm, open your preferences and find

run maya from python shell

烈酒焚心 提交于 2019-11-30 16:00:55
So I have hundreds of maya files that have to be run with one script. So I was thinking why do I even have to bother opening maya, I should be able to do it from python shell (not the python shell in maya, python shell in windows) So the idea is: fileList = ["....my huge list of files...."] for f in fileList: openMaya runMyAwesomeScript I found this: C:\Program Files\Autodesk\Maya201x\bin\mayapy.exe maya.standalone.initialize() And it looks like it loads sth, because I can see my scripts loading from custom paths. However it does not make the maya.exe run. Any help is welcome since I never did

How do I change the python version in Maya 2013?

瘦欲@ 提交于 2019-11-30 10:23:09
I am aiming to write a python script in Maya 2013 that uses a SWIG wrapped pyd library which is compiled using Python 2.7. I cannot rebuild the pyd in Python 2.6.4 which is the version that Maya is bound to. Maya of course then gives this error Module use of python27.dll conflicts with this version of Python. # How can I change it so that Maya uses Python 2.7? I have already tried to tinker with the usual (PYTHON_PATH, PYTHONHOME, etc) environment variables to no success. Maya doesn't use your installed Python but rather its own 2.6 version of python which is included with the software.