/* * Author: Paolo Pasteris *If you wont to upgrade the code please contact me * paolo_pasteris@hotmail.it */ global proc UIInterface() { if(`window -exists Interfaccia`){ deleteUI Interfaccia; } window -t "Modelling Interface" Interfaccia; window -e -w 230 -h 200 Interfaccia; string $form = `formLayout`; string $tabs = `tabLayout -innerMarginWidth 10 -innerMarginHeight 10`; formLayout -edit -attachForm $tabs "top" 0 -attachForm $tabs "left" 0 -attachForm $tabs "bottom" 0 -attachForm $tabs "right" 0 $form; string $child0 = `columnLayout`; frameLayout -label "Front" -collapsable true; columnLayout; button -l ("Inserisci Immagine") -c "InserisciImmagineFront()"; floatSliderGrp -label "X" -minValue -15 -maxValue 15 -value 0 -cc "MFront()" -dc "MFront()" -f true sliderFrontX; floatSliderGrp -label "Y" -minValue -15 -maxValue 15 -value 0 -cc "MFront()" -dc "MFront()" -f true sliderFrontY; floatSliderGrp -label "Z" -minValue -15 -maxValue 15 -value 0 -cc "MFront()" -dc "MFront()" -f true sliderFrontZ; setParent..; setParent..; frameLayout -label "Side" -collapsable true; columnLayout; button -l ("Inserisci Immagine") -c "InserisciImmagineSide()"; floatSliderGrp -label "X" -minValue -15 -maxValue 15 -value 0 -cc "MSide()" -dc "MSide()" -f true sliderSideX; floatSliderGrp -label "Y" -minValue -15 -maxValue 15 -value 0 -cc "MSide()" -dc "MSide()" -f true sliderSideY; floatSliderGrp -label "Z" -minValue -15 -maxValue 15 -value 0 -cc "MSide()" -dc "MSide()" -f true sliderSideZ; setParent..; setParent..; setParent ..; string $child1 = `gridLayout -numberOfColumns 3 -cellWidthHeight 35 35`; iconTextButton -style "iconOnly" -image1 "polyCreateFacet.xpm" -ann "Polygons -> Create Polygon Tool" -c("CreatePolygonTool; repeatLast -ac CreatePolygonTool -acl CreatePolygonTool; "); iconTextButton -style "iconOnly" -image1 "polyAppendFacet.xpm" -ann "Polygons -> Append Polygon Tool" -c("AppendToPolygonTool; repeatLast -ac AppendToPolygonTool -acl AppendToPolygonTool;"); iconTextButton -style "iconOnly" -image1 "polySplitFacet.xpm" -ann "Edit Polygons -> Split Polygon Tool" -c("SplitPolygonTool; repeatLast -ac SplitPolygonTool -acl SplitPolygonTool;") -dcc("SplitPolygonToolOptions;"); iconTextButton -style "iconOnly" -image1 "polyExtrudeEdge.xpm" -ann "Edit Polygons -> Extrude Edge" -c("ExtrudeEdge; repeatLast -ac ExtrudeEdge -acl ExtrudeEdge;"); iconTextButton -style "iconOnly" -image1 "polyExtrudeFacet.xpm" -ann "Edit Polygons ->Extrude Face" -c("ExtrudeFace; repeatLast -ac ExtrudeFace -acl ExtrudeFace;"); iconTextButton -style "iconOnly" -image1 "polyUnite.xpm" -ann "Polygons -> Combine" -c("CombinePolygons; repeatLast -ac CombinePolygons -acl CombinePolygons;"); iconTextButton -style "iconOnly" -image1 "polyMergeVertex.xpm" -ann "Edit Polygons -> Merge Vertices" -c("MergeVertices; repeatLast -ac MergeVertices -acl MergeVertices;"); iconTextButton -style "iconOnly" -image1 "polySmooth.xpm" -ann "Polygons -> Smoot Polygon" -c("SmoothPolygon"); iconTextButton -style "textOnly" -l "Duplicate" -ann "Edit -> Duplicate Option Box" -c("DuplicateOptions"); iconTextButton -style "iconOnly" -image1 "polyNormal.xpm" -ann "Display -> Polygon Components -> Normals" -c("ToggleFaceNormals"); iconTextButton -style "textOnly" -l "Reverse Normal" -ann "Edit Polygons->Normals->Reverse" -c("ReversePolygonNormals; repeatLast -ac ReversePolygonNormals -acl ReversePolygonNormals;"); setParent ..; string $child2 = `gridLayout -numberOfColumns 3 -cellWidthHeight 35 35`; iconTextButton -style "iconOnly" -image1 "curveEp.xpm" -ann "Create -> EP Curve Tool" -c("EPCurveTool; repeatLast -ac EPCurveTool -acl EPCurveTool;"); iconTextButton -style "iconOnly" -image1 "insertKnot.xpm" -ann "Edit Curves -> Insert Knot" -c("InsertKnot; repeatLast -ac InsertKnot -acl InsertKnot;"); iconTextButton -style "iconOnly" -image1 "insert.xpm" -ann "Edit NURBS -> Insert Isoparms" -c("InsertIsoparms; repeatLast -ac InsertIsoparms -acl InsertIsoparms;"); iconTextButton -style "iconOnly" -image1 "cutCurves.xpm" -ann "Edit Curves -> Cut Curve" -c("CutCurve; repeatLast -ac CutCurve -acl CutCurve;"); iconTextButton -style "iconOnly" -image1 "rebuildCurve.xpm" -ann "Edit Curves -> Rebuilde Curve" -c("RebuildCurveOptions"); setParent ..; tabLayout -edit -tabLabel $child0 "Reference" -tabLabel $child1 "Polygons" -tabLabel $child2 "Nurbs" $tabs; showWindow Interfaccia; } global proc MFront() { float $muovix; float $muoviy; float $muoviz; $muovix=`floatSliderGrp -q -v sliderFrontX`; setAttr ("imagePlane1.centerX",$muovix); $muoviy=`floatSliderGrp -q -v sliderFrontY`; setAttr ("imagePlane1.centerY",$muoviy); $muoviz=`floatSliderGrp -q -v sliderFrontZ`; setAttr ("imagePlane1.centerZ",$muoviz); } global proc MSide() { float $muovix; float $muoviy; float $muoviz; $muovix=`floatSliderGrp -q -v sliderSideX`; setAttr ("imagePlane2.centerX",$muovix); $muoviy=`floatSliderGrp -q -v sliderSideY`; setAttr ("imagePlane2.centerY",$muoviy); $muoviz=`floatSliderGrp -q -v sliderSideZ`; setAttr ("imagePlane2.centerZ",$muoviz); } global proc InserisciImmagineFront() { select -r front ; fileBrowserDialog -m 0 -fc "importImageF" -ft "image" -an "Import_Image" -om "Import"; } global proc importImageF( string $filename, string $fileType ) { setFocus modelPanel3; buildImagePlaneMenu modelPanel3imagePlaneSubMenu modelPanel3; createImportedImagePlane modelPanel3 $filename "image"; } global proc InserisciImmagineSide() { select -r front ; fileBrowserDialog -m 0 -fc "importImageS" -ft "image" -an "Import_Image" -om "Import"; } global proc importImageS( string $filename, string $fileType ) { setFocus modelPanel2; buildImagePlaneMenu modelPanel2imagePlaneSubMenu modelPanel2; createImportedImagePlane modelPanel2 $filename "image"; } UIInterface();