If Cube and Sphere

PHOTO EMBED

Tue Jul 02 2024 00:40:26 GMT+0000 (Coordinated Universal Time)

Saved by @nouhad #mel

global proc ifCubeAndSphere()
{
	string $cube[] = `polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1`;
	string $sphere[] = `polySphere -r 1 -sx 20 -sy 20 -ax 0 1 0 -cuv 2 -ch 1`;
	xform -t 5 0 0 $sphere[0];
	expression -s ($cube[0]+".translateY = noise(time*3)*10;")  -o $cube[0] -ae 1 -uc all ;
	expression -s ("if ("+$cube[0]+".translateY <0)\n{\n\t"
						 +$sphere[0]+".translateZ = sin(time*4)*5;\n\t"
						 +$sphere[0]+".translateY = 0;\n\n}\nelse\n{\n\t"
						 +$sphere[0]+".translateY = sin(time*4)*5;\n\t"
						 +$sphere[0]+".translateZ = 0;\n\n}")  -o $sphere[0] -ae 1 -uc all  ;

}
content_copyCOPY