// create the file node and shader select -all; delete; // __________ IMAGE MAPPING _________________________________ string $filenode = `createNode file`; string $shader = `createNode lambert`; string $path = "H:/vsfx705/mel/cropcircle/cropmap.jpg"; // connect the nodes connectAttr ($filenode + ".outColor") ($shader + ".color"); // insert the image path in the file node string $cropmap = $path; setAttr -type "string" ($filenode + ".fileTextureName") $cropmap; // assign the shader to an object string $object[] = `nurbsPlane -ax 0 1 0 -name "nurbsPlane1"`; // _________________________________________f_________________ //select -r $object[0]; //hyperShade -assign $shader; //DisplayShadedAndTextured; int $u, $v, $nu = 20, $nv = 20; // steps in u and v float $minU = 0, $minV = 0, // u/v - start and ending $maxU = 1, $maxV = 1; // the surface - slightly less than 0 to 1 // Grab all our texture map samples float $rgb[] = `colorAtPoint -o RGB -su $nu -sv $nv -mu $minU -mv $minV -xu $maxU -xv $maxV $filenode`; float $deltaU = ($maxU - $minU)/($nu - 1); // step size in u float $deltaV = ($maxV - $minV)/($nv - 1); // step size in v float $currU, $currV; int $index = 0; $currU = $minU; //sphere -r 0.05 -n sph; for($n = 0; $n < $nu; $n++) { $currU += $deltaU; $currV = $minV; for($i = 0; $i < $nv; $i++) { float $r = $rgb[$index]; float $g = $rgb[$index + 1]; float $b = $rgb[$index + 2]; print($r + " " + $g + " " + $b + "\n"); if( ($r + $g + $b) < 0.3) { float $p[] = `pointOnSurface -u $currU -v $currV $object[0]`; vector $v1 = rand(-0.01, 0.01); vector $v2 = rand(-0.01, 0.01); vector $v3 = rand(-0.01, 0.01); //sphere -r 0.02; //move $p[0] $p[1] $p[2]; /* straight lines */ /* curve -d 1 -p $p[0] $p[1] $p[2] -p $p[0] ($p[1] + 0.1) $p[2] -p $p[0] ($p[1] + 0.2) $p[2] -p $p[0] ($p[1] + 0.3) $p[2]; */ curve -d 3 -p $p[0] $p[1] $p[2] -p ($p[0] + $v1.x) ($p[1] + 0.02) ($p[2] + $v1.z) -p ($p[0] + $v2.x) ($p[1] + 0.04) ($p[2] + $v2.z) //-p ($p[0] + $v3.x) ($p[1] + 0.08) ($p[2] + $v3.z) -p ($p[0] + $v3.x) ($p[1] + 0.1) ($p[2] + $v3.z); } $index += 3; $currV += $deltaV; } } defaultDirectionalLight(1, 1,1,1, "0", 0,0,0); //select "curve*"; //displaySmoothness -pw 3;