// Creating Wheel Measuring Device v0.90// string $dummywmd[] = `polyCylinder -n WheelMeasuringDevice1 -ch on -o on -r 9inch -h 235mm -sa 90 -sh 2 -sc 1 -cuv 3` ; string $wmd[] = `polyCylinder -n WheelMeasuringDevice1 -ch on -o on -r 9inch -h 235mm -sa 90 -sh 2 -sc 1 -cuv 3` ; delete $dummywmd; // Extruding Side Wall // hilite $wmd ; setAttr ($wmd[0] + ".rotateZ") 90; select -r ($wmd[0] + ".f[0:179]") ; string $sw[] = `polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 1 -divisions 1 -twist 0 -taper 1 -off 0 -smoothingAngle 30`; setAttr ($sw[0] + ".localTranslateZ") 15; GrowPolygonSelectionRegion; ConvertSelectionToFaces; string $outerFaces[] = `ls -sl`; InvertSelection; string $innerFaces[] = `ls -sl`; string $rim[] = `polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 1 -twist 0 -taper 1 -off 0 -smoothingAngle 30`; setAttr ($rim[0] + ".localTranslateZ") -2.5; // Selecting Pieces // select $outerFaces; select -add $innerFaces; InvertSelection; string $innerEdgeFaces[] = `ls -sl`; GrowPolygonSelectionRegion; InvertSelection; select -add $innerFaces; select -add $innerEdgeFaces; InvertSelection; string $sideWallFaces[] = `ls -sl`; // Buldging Sidewall string $polySub[] = `polySubdivideFacet -duv 1 -dvv 2 -sbm 1 -ch 1`; ConvertSelectionToEdges; ShrinkPolygonSelectionRegion; string $sideWallEdgeLoop[] = `ls -sl`; string $SWBuldge[] = `polyMoveEdge -constructionHistory 1 -random 0 -localCenter 0`; setAttr ($SWBuldge[0] + ".localTranslate") -type double3 0 0 2; string $SWBBevel[] = `polyBevel -offset 0.5 -offsetAsFraction 1 -autoFit 1 -segments 2 -worldSpace 0 -uvAssignment 0 -fillNgons 1 -mergeVertices 1 -mergeVertexTolerance 0.0001 -smoothingAngle 30 -miteringAngle 180 -angleTolerance 180 -ch 1`; // setting up Procedures // global proc remScale (string $object) { setAttr -k off ($object + ".scaleX"); setAttr -k off ($object + ".scaleY"); setAttr -k off ($object + ".scaleZ"); } global proc leaveRHeight (string $CylInput) { setAttr -cb off ($CylInput + ".roundCap"); setAttr -cb off ($CylInput + ".createUVs"); setAttr -k off ($CylInput + ".subdivisionsAxis"); setAttr -k off ($CylInput + ".subdivisionsHeight"); setAttr -k off ($CylInput + ".subdivisionsCaps"); } global proc leaveDivV (string $leaveDivV) { setAttr -k off ($leaveDivV + ".divisions"); setAttr -k off ($leaveDivV + ".divisionsU"); setAttr -k off ($leaveDivV + ".mode"); setAttr -k off ($leaveDivV + ".subdMethod"); } global proc leaveLTZExt (string $leaveLTZ) { setAttr -k off ($leaveLTZ + ".offset"); setAttr -k off ($leaveLTZ + ".taper"); setAttr -k off ($leaveLTZ + ".taperCurve[0].taperCurve_FloatValue"); setAttr -k off ($leaveLTZ + ".taperCurve[0].taperCurve_Interp"); setAttr -k off ($leaveLTZ + ".taperCurve[0].taperCurve_Position"); setAttr -k off ($leaveLTZ + ".twist"); setAttr -cb off ($leaveLTZ + ".smoothingAngle"); setAttr -k off ($leaveLTZ + ".divisions"); setAttr -k off ($leaveLTZ + ".keepFacesTogether"); } global proc leaveLTZ (string $leaveLTZ) { setAttr -k off ($leaveLTZ + ".localDirectionX"); setAttr -k off ($leaveLTZ + ".localDirectionY"); setAttr -k off ($leaveLTZ + ".localDirectionZ"); setAttr -k off ($leaveLTZ + ".localRotateX"); setAttr -k off ($leaveLTZ + ".localRotateY"); setAttr -k off ($leaveLTZ + ".localRotateZ"); setAttr -k off ($leaveLTZ + ".localScaleX"); setAttr -k off ($leaveLTZ + ".localScaleY"); setAttr -k off ($leaveLTZ + ".localScaleZ"); setAttr -k off ($leaveLTZ + ".localTranslateX"); setAttr -k off ($leaveLTZ + ".localTranslateY"); setAttr -k off ($leaveLTZ + ".pivotX"); setAttr -k off ($leaveLTZ + ".pivotY"); setAttr -k off ($leaveLTZ + ".pivotZ"); setAttr -k off ($leaveLTZ + ".random"); setAttr -k off ($leaveLTZ + ".rotateX"); setAttr -k off ($leaveLTZ + ".rotateY"); setAttr -k off ($leaveLTZ + ".rotateZ"); setAttr -k off ($leaveLTZ + ".scaleX"); setAttr -k off ($leaveLTZ + ".scaleY"); setAttr -k off ($leaveLTZ + ".scaleZ"); setAttr -k off ($leaveLTZ + ".translateX"); setAttr -k off ($leaveLTZ + ".translateY"); setAttr -k off ($leaveLTZ + ".translateZ"); setAttr -k off ($leaveLTZ + ".localCenter"); } //Removing unwanted Cylinder Attributes // leaveLTZExt($sw[0]); leaveLTZ($sw[0]); leaveLTZExt($rim[0]); leaveLTZ($rim[0]); leaveLTZ($SWBuldge[0]); leaveDivV($polySub[0]); remScale($wmd[0]); leaveRHeight($wmd[1]); // Adding Tire Attributes // select -r $wmd[0] ; addAttr -ln "SideWallHeight" -at double -min 0 -max 100 -dv 65 ; addAttr -ln "SideWallBuldge" -at double -min 0 -max 500 -dv 260 ; addAttr -ln "TireWidth" -at double -min 0 -max 500 -dv 235 ; addAttr -ln "WheelDiameter" -at double -min 0 -max 100 -dv 18 ; addAttr -ln "WheelPassThrough" -at double -min 0 -max 1000 -dv 0 ; addAttr -ln "OuterCircumference" -at double -min 0 -max 10000 -dv 0 ; // Making Tire Attributes Keyable // setAttr -e -keyable true ($wmd[0] + ".WheelDiameter") ; setAttr -e -keyable true ($wmd[0] + ".SideWallBuldge") ; setAttr -e -keyable true ($wmd[0] + ".TireWidth") ; setAttr -e -keyable true ($wmd[0] + ".SideWallHeight") ; setAttr -e -keyable true ($wmd[0] + ".OuterCircumference") ; // Making Circumference Dimension // select -r $wmd[0] ; string $WMDGroup = `group -n "WheelMeasuringDeviceGroup"`; xform -os -piv 0 0 0; string $CircumDimension = "CircumferenceDimension1"; string $DummyLoc1[] = `spaceLocator -p 50 50 50 -n DistanceLocator1`; string $DummyLoc2[] = `spaceLocator -p 50 50 51 -n DistanceLocator1`; distanceDimension -sp 50 50 50 -ep 50 50 51; string $DummyDimen[] = `ls -sl`; string $DummyCircumDimension = `rename $DummyDimen[1] $CircumDimension`; string $DistLoc1[] = `spaceLocator -p 0 1 0 -n DistanceLocator1`; string $DistLoc2[] = `spaceLocator -p 0 1000mm 0 -n DistanceLocator1`; distanceDimension -sp 0 1 0 -ep 0 1000mm 0; string $DistDimen[] = `ls -sl`; select -r $DistLoc1; xform -cp; move -r 0 -1 0; select -r $DistLoc2; xform -cp; move -r 0 -1000mm 0; FreezeTransformations; string $CircumDimension = `rename $DistDimen[1] $CircumDimension`; delete $DummyCircumDimension; delete $DummyLoc1; delete $DummyLoc2; string $DummySphere[] = `sphere`; select $DummySphere; string $DummyCDG = `group -n "CircumferenceDimensionGroup1"`; select -r $DistLoc1 $DistLoc2 $CircumDimension; string $CDGroup = `group -n "CircumferenceDimensionGroup1"`; delete $DummyCDG; parent $CDGroup $WMDGroup; // Making Annotation // select -r $DistLoc2[0]; xform -cp; string $CircAnnotateShape = `annotate -tx "Circumference" -p 300mm 2500mm 300mm`; select -r $CircAnnotateShape; string $CircAnnotate[] = `pickWalk -d up`; parent $CircAnnotate $CDGroup; // Connecting Attributes // select -r $wmd[0]; string $swBuldgeStr = $SWBuldge[0] + ".localTranslateZ = (" + $wmd[0] + ".SideWallBuldge - " + $wmd[0] + ".TireWidth) * .1"; expression -s $swBuldgeStr -o $wmd[1] -n "SideWallBuldgeExpression" -ae 1 -uc all ; string $swhExpStr = $sw[0] + ".localTranslateZ = " + $wmd[0] + ".SideWallHeight * 0.01 * " + $wmd[1] + ".height"; expression -s $swhExpStr -o $wmd[1] -n "SideWallHeightExpression" -ae 1 -uc all ; string $wdExpStr = $wmd[0] + ".WheelPassThrough = " + $wmd[0] + ".WheelDiameter * 2.54 * .5"; expression -s $wdExpStr -o $wmd[0] -n "WheelDiameterExpression" -ae 1 -uc all ; string $cirExpStr = $wmd[0] + ".OuterCircumference = ((" + $wmd[1] + ".radius * 2) + (" + $sw[0] + ".localTranslateZ * 2)) * 3.1415926535"; expression -s $cirExpStr -o $wmd[0] -n "WheelCircumferenceExpression" -ae 1 -uc all ; string $tireWidthStr = $wmd[1] + ".height = " + $wmd[0] + ".TireWidth * .1"; expression -s $tireWidthStr -o $wmd[1] -n "TireWidthExpression" -ae 1 -uc all ; /*TireWidth Passthrough */ connectAttr -f ($wmd[0] + ".WheelPassThrough") ($wmd[1] + ".radius"); connectAttr -f ($wmd[0] + ".OuterCircumference") ($DistLoc2[0] + ".translateY");