maya

pydev remote debuging - code completion in interactive console?

♀尐吖头ヾ 提交于 2019-12-11 23:25:38
问题 I'm using a Pydev + Eclipse setup to develop a Python script for Autodesk Maya. In order to debug in Eclipse while the script is running in Maya, the standard setup is to use Pydev's remote debugging feature. This is all good and everything is working well but with one exception - from within the interactive console during a debugging session, the code completion does not seem to work. And not just for Maya specific stuff either - for example if I run : import sys<ENTER><ENTER> print sys. and

Joint Weight Interpolation Maya

霸气de小男生 提交于 2019-12-11 21:18:20
问题 How can you calculate the joint weight values of a point on a face in maya. Say we have a plane and we want to calculate what it's interpolated weight would be at an arbitrary point on the face. I know the copy skin weights tool in maya does a great job of this interpolation, but am not sure of the math behind it. import maya.cmds as cmds if __name__ == '__main__': # Build two planes. One with no subdivs and one with 2. plane = cmds.polyPlane(name="plane_GEO", subdivisionsX=1, subdivisionsY=1

Textfield query for prefix replacing

我只是一个虾纸丫 提交于 2019-12-11 19:49:01
问题 I'm busy creating a function in my rigging tool which allows mirroring of joints and replacing the prefix. The mirroring of joints (both behaviours and orientation) is working but I get an error when I search and replace what is in my two text fields. The prefix of joints in the scene is either R_ or L_ and I would like to replace them with this. The error is as follows: NameError: name searchFor is not defined. The odd part here is that I actually create a variable called searchFor and one

Changing polygons' colors in Maya via Python

喜夏-厌秋 提交于 2019-12-11 18:04:04
问题 The only way I know is to use a slider: import maya.cmds as cmds cmds.colorSliderGrp( 'polygonColour', label = "Colour", hsv = ( 1, 1, 1 ) ) Then taking the RGB value from that: rgb = cmds.colorSliderGrp( 'polygonColour', query = True, rgbValue = True ) And then assigning a material to the polygon and giving that material the color: myShader = cmds.shadingNode( 'lambert', asShader = True, name = "polygonMaterial" ) cmds.setAttr( 'polygon1' + ":blockMaterial.color", rgb[ 0 ], rgb[ 1 ], rgb[ 2

in Maya, how can I toggle the 'ignore hidden in outliner' flag using Python?

与世无争的帅哥 提交于 2019-12-11 16:18:07
问题 Using Maya 2018, how can I write a simple Python command that will toggle the outliner flag, 'ignore hidden in outliner' ? I am having trouble accessing that panel attribute using the outlinerPanel command and the outlinerEdit commands. Here is an example of the node, 'hid', having its attribute, 'Hidden in Outliner' checked on, but it is still visible in the outliner because the outliner option, 'ignore hiddenInOuliner' has been toggled on. 回答1: def setHiddenInOutliner(nodes=list, value=bool

How can I perform shader assignment to a geo efficiently and non-destructively?

雨燕双飞 提交于 2019-12-11 16:14:37
问题 My goal is to set a shader to each parts of a geo. The parts of the geo are typically a group of attached faces. I do this to bake an ID map and then use it in Substance Painter. So far, I separate the parts, then assign a shader to each and unite them back. I eventually delete the history to clean the outliner and the mesh itself. import maya.cmds as mc import random selection = mc.ls(sl=True)[0] parent = mc.listRelatives( selection, ap = True)[0] mc.polySeparate(selection) parts = mc.ls(sl

Maya python open another instance of the attribute editor

僤鯓⒐⒋嵵緔 提交于 2019-12-11 15:49:11
问题 In Maya 2018, using Python, how can you check if the attribute editor is open, and if it is not, open it. Also, can you open multiple instances of the attribute editor, preferably showing the attributes of different nodes? 回答1: I advise you to turn on "echo all command" if your looking to some code. Opening the Attribute Editor will give you in echo : attributeEditorVisibilityStateChange(`workspaceControl -q -visible AttributeEditor`, ""); In this command you can already guess that :

OpenGL GL_UNPACK_ALIGNMENT

南笙酒味 提交于 2019-12-11 11:44:18
问题 Before reading all this and getting lost my main question is how to unpack a single array of pixles and explaining how open gl is reading this data. (my background is not in c++ but mostly python) your help is greatly appreciated. im using maya(3d program) which has a class of MImage to get the pixel data of an image. the return result is a single array with every 4 items are RGBA this is what i need to unpack pixels = [255, 255, 0, 255, 255, 255, 0, 255] //two yellow pixels and it keeps

Maya Outliner in Pyqt doesn't charge

淺唱寂寞╮ 提交于 2019-12-11 11:25:25
问题 Well I'm trying to use a outliner in maya with Pyqt4 and python, My outliner is in a Qsplitter with other two panels, it seems the code is ok, but when I run the code sometimes the Outliner appears, sometimes doesn't appear this is the code where I create the Outliner: self.outliner = QWidget() self.outliner.setObjectName("outliner") self.outLayout = QGridLayout() self.outLayout.setContentsMargins(0, 0, 0, 0) self.outLayout.setObjectName("outLayout") self.outliner.setLayout(self.outLayout)

maya python iterating a big number of vertex

╄→гoц情女王★ 提交于 2019-12-11 11:20:19
问题 I am writing a script in python for maya to swap vertex position from one side to another. Since I want the flipping to be topology based I am using the topological symmetry selection tool to find the vertex correspondence. I managed to do that using filterExpand and xform. The problem is that it is quite slow on a large poly count mesh and I was wondering how this could be done using openMaya instead. import maya.cmds as cmds def flipMesh(): sel=cmds.ls(sl=1) axis={'x':0,'y':1,'z':2} reverse