maya

Maya - How to create python scripts with more than one file?

删除回忆录丶 提交于 2019-12-24 03:37:18
问题 It's my first post here, please understand that I'm a beginner and that I'm learning "on-the-job". Can someone explain how can I import files from a different module in a Maya python script? I'm getting the following error: Error: ImportError: file E:/.../bin/mainScript.py line 17: No module named tools Here are my directories and codes: Main_folder\ |-- install.mel |-- ReadMeFirst.txt `-- bin\ |-- __init__.py |-- mainScript.py |-- tools.py `-- presets\ |-- bipedPreset.txt |-- quadrupedPreset

How do I use Def Function strings in maya

早过忘川 提交于 2019-12-23 21:57:58
问题 I've been transposing from mel and was wondering if anyone could point me in the right direction with this. I'm not too sure how to run a Function with a specific arg in mind. def testFUNCTION(field): if field == 'option1': print 'You have selected option 1' else: print 'You have selected option 2' mc.window( w=150 ) mc.textFieldButtonGrp (l='option 1', bl='Set', ad3=2, bc=('testFUNCTION, option1')) mc.textFieldButtonGrp (l='option 2', bl='Set', ad3=2, bc=('testFUNCTION, option2')) mc

Using Sliders for shapes in Maya with Python

北城余情 提交于 2019-12-23 05:42:19
问题 I'm new to Python and I have the following code, I am trying to use the following sliders for the Colour , Translate , Rotate and Scale for the shapes I have in this code. Is there a way I can control all the shapes with these sliders? I can't seem to figure it out I've tried everything that I could. Any help would be appreciated, thank you. #Importing all Maya commands to Python import maya.cmds as cmds from functools import partial class CreateUI(): def __init__(self): windowID =

Maya Local Direction

非 Y 不嫁゛ 提交于 2019-12-23 05:01:44
问题 What I'm trying to achieve is basically local translation in Maya attached to wheels for example: Moving a car forward in it's LOCAL Z direction and the wheel would spin the same speed no matter what rotation is applied, I've got close, this is what I've done! Connected the parentInverseMatrix and the worldInverseMatrix of the driver into a multMatrix node. Connected the output of the multMatrix node into a decompose matrix node. Connected the outputTranslateZ from the decompose Matrix node

How to find all upstream DG nodes with maya python api?

三世轮回 提交于 2019-12-23 04:23:28
问题 I can use hypershade -listUpstreamNodes to get them, but this command is not available in maya batch mode. i guess i should use MItDependencyGraph ? can someone give me a short example ? thanks ! ps: i want to find all anim curves on anim controls( they may be in anim layers). another place i can use this is find all shading nodes associated with a given mesh. i don't want to use listConnections or connectionInfo multiple times and write a long function to do it. 回答1: in vanilla maya python

How to change one texture image of a 3d model(maya ) in three.js at runtime

匆匆过客 提交于 2019-12-22 00:55:21
问题 This site is loading a maya model using three.js. This model has Below texture pictures Here is the JS var SCREEN_WIDTH = window.innerWidth; var SCREEN_HEIGHT = window.innerHeight; var container; var camera, scene; var canvasRenderer, webglRenderer; var mesh, zmesh, geometry, materials; var windowHalfX = window.innerWidth / 2; var windowHalfY = window.innerHeight / 2; var meshes = []; function init() { container = document.createElement('div'); document.body.appendChild(container); camera =

Python - Re-Implementing __setattr__ with super

╄→гoц情女王★ 提交于 2019-12-20 02:45:12
问题 I know this one has been covered before, and perhaps isn't the most pythonic way of constructing a class, but I have a lot of different maya node classes with a lot @properties for retrieving/setting node data, and I want to see if procedurally building the attributes cuts down on overhead/mantinence. I need to re-implement __setattr__ so that the standard behavior is maintained, but for certain special attributes, the value is get/set to an outside object. I have seen examples of re

How to get from Maya event of a change highlight objects in the scene?

拜拜、爱过 提交于 2019-12-19 12:01:44
问题 I'm using: Maya2014 + pyqt4.8 + python2.7 I'm doing an application which allows you to speed up and simplify the selection of items in Maya. Is a selector which the user can attach to how the objects in the scene. Selection of objects in the window leads to the separation of objects in the scene. but on the contrary I can not find how to do. How to catch an event that occurs when changing the selection of objects in the scene and process it further its program? 回答1: I really recommend if you

How to use python (maya) multithreading

早过忘川 提交于 2019-12-19 04:22:56
问题 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]

How to use python (maya) multithreading

江枫思渺然 提交于 2019-12-19 04:22:14
问题 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]