maya

Getting a Maya Model into the iPhone

流过昼夜 提交于 2019-12-09 01:12:06
问题 What is the best way to do this? Googling has shown me a bunch of ways, but what is the current best? I'd be happy enough to just get the model exported from Maya and rendered on the iPhone screen, but I'd be stoked if there was a way to render it, then support pinch to zoom, etc. Thanks a lot, just finished my first 3D modeling class today and I'm stoked! 回答1: I just finished writing a full featured model viewer and manipulator for iPhone and iPad. Basically, I just wrote my own file parser

Maya - Querying previous render information

喜夏-厌秋 提交于 2019-12-08 18:58:41
Does anyone know whether its possible to query the render time of the last render in maya via python or mel? Render time is stored in the render viewer window in the form of a string at the bottom of the image, I would like to access this time and retrieve for later use - is this possible? Thanks I know of no way to query it directly, but this solution works: Put the following in your Pre Render MEL (from the Render Settings): python "global last_render_time;import time;last_render_time=time.time()" Expanded for readability: global last_render_time # not needed when in module import time last

Maya Python Create and Use Zipped Package?

一曲冷凌霜 提交于 2019-12-08 15:23:27
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 as if the files inside were any other module sitting

Conditional module importing in Python

风格不统一 提交于 2019-12-08 13:56:18
问题 I'm just trying out Maya 2017 and seen that they've gone over to PySide2 , which is great but all of my tools have import PySide or from PySide import ... in them. The obvious solution would be to find/replace import PySide to import PySide2 and hope everything still works after that, but I'd still like to be able to support older versions of Maya. My idea was to have a single line solution to find/replace like: import (PySide2 if "PySide2" in sys.modules else PySide) But this returns: Error:

How to convert three dimensional vector to an Euler rotation in software like Maya using python

一笑奈何 提交于 2019-12-08 13:35:51
问题 There is a given three-dimensional vector. I want to convert this vector to a rotation which could make one of local axis (like X axis) of that cube to match the vector's direction. I prepared two pictures. But I can't paste them because of my reputation. I am a freshman. I tried so many times but still can't get it to work. I think this may involve the rotation order of the cube when I rotate the cube. 回答1: You can probably get what you want using an aim constraint. If you want to do it as a

maya python + Pass variable on button press

好久不见. 提交于 2019-12-08 12:31:06
问题 I have a script i wrote in python for maya and there are 3 buttons labeled X Y Z. Depending on which button is pressed I want a variable to pass a specific value to the function. How can I do this?? I've written in the comments for the button in regards to what I'm trying to pass. It seems to just print 'false' im not sure why. import maya.cmds as cmds class createMyLayoutCls(object): def __init__(self): pass def show(self): self.createMyLayout() def createMyLayout(self): #check to see if our

Calling UI objects from a file into another

那年仲夏 提交于 2019-12-08 12:03:51
问题 I am currently writing a UI script for Maya in Python. So, I have UI that has different tabs at the top and I do not want to put every single piece of code in the MainClass because that would be too messy and long. For every tab, I want to write its script in a different .py file. I want to create the connections under the __init__ function, at the same time, load functions from another script into this MainClass to be used. Question is, how should I go about calling objectName from the UI in

Importing OBJ file to maya scene (MEL/Python)

陌路散爱 提交于 2019-12-08 11:29:49
问题 I am working on a script in which I need to import an external OBJ file. I have been reading and I think that should be done using the file command. I go to the maya documentation and find no clear examples about using it. What arguments should I pass in order to do that? I have seen an example in MEL which is in this thread: http://forums.cgsociety.org/showthread.php?t=144296 file -import -type "OBJ" -options "mo=1" -pr $sourceFiles[$x]; Furthermore there should be a useful path for maya to

Is there any way to install nose in Maya?

喜夏-厌秋 提交于 2019-12-08 10:42:54
问题 I'm using Autodesk Maya 2008 on Linux at home, and Maya 2012 on Windows 7 at work. Most of my efforts so far have been focused on the former. I found this thread, and managed to get the setup there working at home. The gist of it is that you install nose for whatever Python you have installed on your system, then create a py script that adds that nose egg to sys.path, and loads in the maya.standalone module, then imports nose and runs it. Then you run that py script through Maya's version of

Getting rotation with the distanceDimension in maya with Python

和自甴很熟 提交于 2019-12-08 09:29:00
问题 I am making a script where I can place 2 locators and between the 2 locators I am making a light. At this moment I can make 2 locators when I click in the viewport , and it makes a light with the same distance and position. (For getting the distance between the two locators, I use the DistanceDimension command) But I also need the same rotation. So I need to rotate my light as well when loc1 is higher than loc2, but I don't know how to do this. Can someone help me please? Here is a screenshot