maya

You need a shiboken-based type

妖精的绣舞 提交于 2020-06-27 03:59:17
问题 When i run the code i get the following error line 11: You need a shiboken-based type. Not sure what i am doing wrong here . When i run just the GetMayaWindow() its runs properly but when run it in init its gives me error import shiboken from PySide import QtGui import maya.OpenMayaUI as apiUI from cStringIO import StringIO import pysideuic import xml.etree.ElementTree as xml def GetMayaWindow(): ptr = apiUI.MQtUtil.mainWindow() if ptr is not None: return shiboken.wrapInstance(long(ptr),QtGui

You need a shiboken-based type

北城以北 提交于 2020-06-27 03:58:59
问题 When i run the code i get the following error line 11: You need a shiboken-based type. Not sure what i am doing wrong here . When i run just the GetMayaWindow() its runs properly but when run it in init its gives me error import shiboken from PySide import QtGui import maya.OpenMayaUI as apiUI from cStringIO import StringIO import pysideuic import xml.etree.ElementTree as xml def GetMayaWindow(): ptr = apiUI.MQtUtil.mainWindow() if ptr is not None: return shiboken.wrapInstance(long(ptr),QtGui

change shader on all assigned meshes, without using hyperShade()

一世执手 提交于 2020-05-16 02:34:27
问题 I get all shapes assigned to baseMaterial, select the shapes and then assign the occlusionShader. for materialClass in materialClassList: select(materialClass.baseMaterial) hyperShade(objects="") hyperShade(a=materialClass.occlusionShader) works just fine, but if I use it as a pre render script: Error: line 0: hyperShade command not supported in batch mode What can I change the two last lines of my function to to make this work? 回答1: Here is an example with cmds.sets() to assign a shader :

Unity 3D multiple UV sets

久未见 提交于 2020-05-10 03:37:42
问题 I have created an object that has the texture and an AO , they are on different UV sets in maya(with Layered Texture) and in maya the mash looks ok. How do i achive the same effect in Unity3D? I can not make unity use the 2nd UV set. 回答1: You'll need to write a shader that does this. Here's a very minimal example, but you'd probably need to have a more elaborate setup for things specular, etc. Shader "Custom/twotex" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _AoTex ("AO (RGB)",

Unity 3D multiple UV sets

余生颓废 提交于 2020-05-10 03:36:34
问题 I have created an object that has the texture and an AO , they are on different UV sets in maya(with Layered Texture) and in maya the mash looks ok. How do i achive the same effect in Unity3D? I can not make unity use the 2nd UV set. 回答1: You'll need to write a shader that does this. Here's a very minimal example, but you'd probably need to have a more elaborate setup for things specular, etc. Shader "Custom/twotex" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _AoTex ("AO (RGB)",

why i have some missing files when cmake generate build folder ? (Maya 2020 - CMake 3.16.4 - VS 2017)

两盒软妹~` 提交于 2020-03-25 18:38:58
问题 I exactly followed the instruction in API help to create visual studio project: The CMakeLists.txt File guide but I got this error: CMake Warning (dev) in CMakeLists.txt: No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as project(ProjectName) near the top of the file, but after cmake_minimum_required(). CMake is pretending there is a "project(Project)" command on the first line. This

Change(replace) file within reference

怎甘沉沦 提交于 2020-03-06 04:37:05
问题 I need to replace an OLD file with a NEW file within a reference. There is a referenceEdit command but no flags for replacing a file. so ideally I need sth like: cmds.referenceQuery( myReference, e=1, file=NEW ) 回答1: You should be able to replace references by using the file command. Assuming your reference node's name is known (otherwise you can retrieve it via referenceQuery ) and the name is myReferenceRN , you can do: from maya import cmds cmds.file("/path/to/new/reference/file.mb",

Dirtied plug still has the old value during setDependentsDirty()

帅比萌擦擦* 提交于 2020-02-08 02:34:11
问题 When I dirty an input plug for example mFileAttr , the setDependentsDirty() gets properly invoked, but the value of fileName plug is still the old value! I only see it getting updated once it goes through compute() . How can I access the new value in setDependentsDirty() function since it's indeed triggered by the plug value update? MStatus FNode::setDependentsDirty(const MPlug& plug, MPlugArray& plugArray) { if (plug == mFileAttr) { MPlug fileNamePlug(thisMObject(), plug); MString fileName =

Item 'layer 7' already exists in the treeview : in Maya

血红的双手。 提交于 2020-02-06 07:49:59
问题 I want to add two different items that have the same name to a TreeView but they have a different parent. But I get the error: Item 'layer 7' already exists in the TreeView What should I do to avoid this. My code: import maya.cmds as cmds import os window = cmds.window() layout = cmds.formLayout() control = cmds.treeView( parent = layout, numberOfButtons = 0, abr = False ) cmds.formLayout(layout,e=True, attachForm=(control,'top', 2)) cmds.formLayout(layout,e=True, attachForm=(control,'left',