maya

python + maya: Rotate Y axis to be along vector

一曲冷凌霜 提交于 2019-12-04 05:43:25
问题 How can I rotate the circle shape so it's y axis is along the supplied vector? The vector in this sample script is created using the two locators in the scene. The code is broken up into 3 sections. The first section just creates the test scene. The second part collects the vector. The third part is where I need help figuring out how to use the vector to adjust the rotation of the circle so it's Y axis is pointing along the collected vector. Thank you guys. import maya.cmds as cmds import

How to store and then retreive parent-child dependency data (Maya MEL/Python script)

拈花ヽ惹草 提交于 2019-12-04 02:00:35
问题 I have a hierarchy that I need to: break apart doSomething() put it back together the same way it was before. I know how to break things for sure, and have plan about what I need to do when they are flat in hierarchy. The problem is how do I parent them back? Details This is related to my previous question: Freeze scale transform on a parent object with animated child (MAYA MEL/Python script) I need to freeze scale transforms on all nodes in a hierarchy. Problem is that nodes have translate

Eclipse environment for Maya's python modules

流过昼夜 提交于 2019-12-03 16:16:52
I'm trying to set up the Eclipse IDE to recognize the maya.cmds module, an all modules associated with the maya module. The following code are tests run in Eclipse, and Maya's script editor. import maya print 'maya:\n', dir(maya) from maya import cmds print 'cmds:\n', len(dir(cmds)) # too many to print print 'sphere: ', cmds.sphere In Maya's script editor the code results in maya: ['OpenMaya', '_OpenMaya', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'app', 'cmds', 'mel', 'standalone', 'stringTable', 'utils'] cmds: 3190 sphere: <built-in method sphere of module

Maya Python Create and Use Zipped Package?

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Can anyone describe exactly how someone can create and execute a python zip package in Maya? A lot of tutorials and questions regarding this jump into the middle and assume certain knowledge. I need a simple example as a starting point. Folder/ scriptA.py scriptB.py scriptC.py ScriptA: Import ScriptB Import ScriptC Create zip of Folder In Maya Code to run Folder as if not zipped ScriptA.foo() In folder we have three scripts. ScriptA references the other two. I zip the folder with a program like winrar. In maya, I want to load from this zip

SceneKit - how to get animations for a .dae model?

我的梦境 提交于 2019-12-03 09:56:50
问题 Ok, I am working with ARKit and scene kit here and I am having trouble looking at the other questions dealing with just scene kit trying to have a model in .dae format and load in various animations to have that model run - now that we're in iOS11 seems that some solutions don't work. Here is how I get my model - from a base .dae scene where no animations are applied. I am importing these with Maya - var modelScene = SCNScene(named: "art.scnassets/ryderFinal3.dae")! if let d = modelScene

How to convert object to json file for three.js model loader

六眼飞鱼酱① 提交于 2019-12-03 08:56:08
问题 I am building a browser game with three.js and I want to load a model from Maya 2013 into my scene. I have exported the model as an obj file. Now I need to know how to convert it into an JS file for the three.js -loader. This is my loader so far: var jsonLoader = new THREE.JSONLoader(); jsonLoader.load( "models/model.js", addModelToScene ); Thanks in advance 回答1: If you don't want to use blender, mrdoob(made threejs) has a simple python script to convert obj to json. Just run --this script--

Running unit tests with Nose inside a Python environment such as Autodesk Maya?

 ̄綄美尐妖づ 提交于 2019-12-03 08:46:02
问题 I'd like to start creating unit tests for my Maya scripts. These scripts must be run inside the Maya environment and rely on the maya.cmds module namespace. How can I run Nose tests from inside a running environment such as Maya? 回答1: Use the mayapy executable included in your maya install instead of the standard python executable. In order for this work you'll need to run nose programmatically. Create a python file called runtests.py and put it next to your test files. In it, include the

Dockable window in Maya with PySide clean up

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I created a tool that is able to dock in Maya's main ui, but I can't figure out a way to clean it up once it closes. The problem is if I create multiple instances of the tool then drag it in place to dock it, they will ALL show up when I right-click on Maya's window. How do I properly clean these up when the tool closes? I already tried cmds.deleteUI , QObject.deleteLater() and at best I can only clear the tool's contents, but it will still exist in Maya. Here's an example of what I have so far: from shiboken import wrapInstance from PySide