Posts

Change Attribute of selection

#ChngAttrofSel.py import maya.cmds as cmds import functools def createUI(pWindowTitle, pApplyCallback):          windowID = 'myWindowID'          if cmds.window( windowID, exists=True ):         cmds.deleteUI(windowID)              cmds.window(windowID, title=pWindowTitle, sizeable=True, resizeToFitChildren=True)          cmds.rowColumnLayout(numberOfRows = 2)                    cmds.text(label = 'Type the Arrtibute to change for the selection and its value')              cmds.rowColumnLayout(numberOfColumns = 3, columnWidth = [(1,125),(2,100),(3,80)], columnOffset=[(1,'right',3)])                        cmds.text(label = 'Attribute:')          targetAttributeField = cmds.textField(...

polysmooth_all_Geometry

 import maya.cmds as mc smoothNode= mc.ls( 'polySmoothFace*') print smoothNode for i in smoothNode:     mc.setAttr(i+'.divisions', 0)     print i

Enable poly overide for selected objects in a group

 import maya.cmds as cmds selectobjs = cmds.ls( dag=True, ap=True, sl=True ) print selectobjs noObjs = len(selectobjs) print noObjs for i in range (0 , noObjs):     print selectobjs[i] + ".overrideEnabled "     setname = selectobjs[i] + ".overrideEnabled "     print setname      cmds.setAttr(setname, 1)

Plot Curves From an Animated Object

''' PlotCurves v1.26 Christian Hart. Hartwork Studio www.hartwork.com.au Draws a curve from the position of any group, object or vertex selected as it travels along it's animation. Allows multiple selection. Good for modeling unique things like springs or wires by using animation to design the shape. Or good when needing a motion trail that can have things attached to the path. Installation: Put the script in your scripts directory and create a python shelf button with the following two lines. from hart_plotCurve import * plotCurve() ''' import maya.cmds as mc import random from functools import partial # def plotWithCurve(startFrame, endFrame, step, *args): # startFrame = mc.floatField(startFrame, query=True, value=True) endFrame = mc.floatField(endFrame, query=True, value=True) step = mc.floatField(step, query=True, value=True) # selected = mc.ls(sl=True, flatten=True) if not selected: mc.error(" Nothi...

Alternate Render

Alternate Render """ Created on Thu May 31 09:40:02 2012 @author: anoop augustine @email: anoop3d@yahoo.com """ import maya.cmds as mc import maya.mel as mel def alt_render():     rend_win= 'rend_win'     if mc.window (rend_win, exists =1): mc.deleteUI (rend_win)     if mc.windowPref (rend_win, exists = 1): mc.windowPref (rend_win, remove = 1)     mc.window (rend_win,wh =(370,190),t ='Alternate Render App V-2.0',s=1)     main_col = mc.columnLayout(adjustableColumn=True)     mc.separator( height=30, style='out')     mainform0 = mc.rowColumnLayout( numberOfColumns=4,columnWidth=[(1,70),(2,80),(3,60),(4,80),(5,80)],cs=[(1,30),(3,20)])     mc.text( label='Start Frame :',align ='left')     mc.intField('startFrame',value=mc.playbackOptions(q=1,min=1))     mc.text( label='End Frame :',align ='left')     mc.intField('endFrame',value=mc.playbackOptions(q=1,max=1))...