global proc turtle2021() { string $shell[] = `polySphere -r 3 -sx 8 -sy 8 -ax 0 1 0 -cuv 2 -ch 1`; select -r ($shell[0]+".vtx[0:31]") ($shell[0]+".vtx[56]") ; scale -r -ocp 1 1e-05 1 ; string $head[] = `polyCube -w 1.5 -h 1.5 -d 1.5 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1`; xform -t 0 0.5 3.375 $head[0]; string $feet[]; for ($f=0;$f<4;$f++) { string $foot[] = `polyPyramid -w 3 -ns 4 -sh 1 -sc 0 -ax 0 1 0 -cuv 3 -ch 1`; xform -t -2.63 0 2.63 -ro 45 0 90 -s 0.188 1 0.25 $foot[0]; xform -ws -piv 0 0 0 $foot[0]; makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1; xform -ro 0 ($f*90) 0 $foot[0]; $feet[$f] = $foot[0]; } select -r $feet $head[0] $shell[0]; string $turtGrp = `group`; string $mat = `shadingNode -asShader blinn`; string $matSG = `sets -renderable true -noSurfaceShader true -empty -name ($mat+"SG")`; connectAttr -f ($mat+".outColor") ($matSG+".surfaceShader"); select -r $turtGrp ; sets -e -forceElement $matSG; setAttr ($mat+".color") -type double3 0 0.178 0.0273853 ; string $ground[] = `polyPlane -w 100 -h 100 -sx 10 -sy 10 -ax 0 1 0 -cuv 2 -ch 1`; string $loc[] = `spaceLocator -p 0 1.5 0`; select -r $shell[0] $loc[0]; parentConstraint -mo -weight 1; xform -t 0 54 0 -ro 32 5 -25 $turtGrp; select -r $turtGrp; rigidBody -active -m 1 -dp 0 -sf 0.2 -df 0.2 -b 0.6 -l 0 -tf 200 -iv 0 0 0 -iav 0 0 0 -c 0 -pc 0 -i 0 0 0 -imp 0 0 0 -si 0 0 0 -sio none ; select -r $ground[0] ; rigidBody -passive -m 1 -dp 0 -sf 0.2 -df 0.2 -b 0.6 -l 0 -tf 200 -iv 0 0 0 -iav 0 0 0 -c 0 -pc 0 -i 0 0 0 -imp 0 0 0 -si 0 0 0 -sio none ; string $grav[] = `gravity -pos 0 0 0 -m 9.8 -att 0 -dx 0 -dy -1 -dz 0 -mxd -1 -vsh none -vex 0 -vof 0 0 0 -vsw 360 -tsr 0.5 `; connectDynamic -f $grav[0] $turtGrp; expression -s ("if ("+$loc[0]+".translateY < 4)\n{\nsetAttr \""+$mat+".color\" -type double3 1 0 0 ;\n}\nelse\n{\nsetAttr \""+$mat+".color\" -type double3 0 0.178 0.0273853 ;\n}") -o $mat -ae 1 -uc all ; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter