![]() Первая функция выполняет геометрические манипуляции сетки, а вторая – пользовательский интерфейс для пользовательских входов: import maya.cmds as cmds def superExtrude(extrScale, extrDist): """Loops through a list of selected meshes and extrudes all of the mesh faces to produce a polygon frame, based on existing mesh tesselations""" myObjectLt = cmds.ls(selection=True) for i in range(len(myObjectLt)): numFaces = cmds.polyEvaluate(face=True) item = myObjectLt + ".f" lect(clear=True) lect(item, replace=True) #extrude by scale cmds.polyExtrudeFacet(constructionHistory=True, keepFacesTogether=False, localScaleX=extrScale, localScaleY=extrScale, localScaleZ=extrScale) selFaces = cmds.ls(selection=True) lete(selFaces) #extrude by height lect(item, replace=True) cmds.polyExtrudeFacet(constructionHistory=True, keepFacesTogether=True, localTranslateZ=extrDist) def extrWindow(): """Creates the user interface UI for the user input of the extrusion scale and height""" windowID = "superExtrWindow" if cmds.window(windowID, exists=True): leteUI(windowID) cmds.window(windowID, title="SuperExtrude", sizeable=False, resizeToFitChildren=True) cmds.rowColumnLayout(numberOfColumns=2, columnWidth=, columnOffset=) cmds.text(label="Extrusion Scale:") extrScaleVal = cmds.floatField(text=0.9) cmds.text(label="Extrusion Height:") extrDistVal = cmds.floatField(text=-0.3) parator(height=10, style="none") parator(height=10, style="none") parator(height=10, style="none") cmds.button(label="Apply", command=superExtrude(extrScaleVal, extrDistVal)) cmds.showWindow() extrWindow() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |