PDA

View Full Version : Duplicate along curve


chaoticreality
08-08-2008, 06:54 AM
I am currently looking for a melscript that allows creating leather stitches. One would need to duplicate geometry along curve I guess. I want to get results such as this

http://cms.ticket01.com/uploads/gallery/Lenkrad.jpg

http://cms.ticket01.com/uploads/gallery/Chair27.jpg
http://cms.ticket01.com/uploads/gallery/Chair83.jpg

Is there a script for it out there. I have checked some out and encounter object orientation and manipulation problems.

digitalandrew
08-10-2008, 12:29 AM
Hello. I made you one. Select the object you want to run along the curve then the curve itself and run this...


string $ambSelected[1] = ` ls -sl`, // obj = [0], curve = [1]
$ambLocator[] = ` spaceLocator -n "curvePosTemp_LOC"`,
$ambMotionPath, $ambDup[];

int $ambNumberOfCopies = 36,
$ambIndex = 1;

float $ambArcDivStep = (1.0 / $ambNumberOfCopies),
$ambStep = 0;

group -em -n ($ambSelected[0] + "_dup_GRP");

// connect locator to curve and disconnect uValue...
$ambMotionPath = ` pathAnimation -n "tempMotionPath" -fm 1 -follow 1 -fa x -upAxis y -wut "vector" -stu 1 -etu 2 $ambLocator[0] $ambSelected[1]`;
delete ($ambMotionPath + "_uValue");

for ($ambStep ; $ambStep <= 1.0; $ambStep = $ambStep + $ambArcDivStep) {
setAttr tempMotionPath.uValue $ambStep;
$ambDup= ` duplicate -rr -n ($ambSelected[0] + "_" + $ambIndex) $ambSelected[0]`;
delete ` parentConstraint curvePosTemp_LOC $ambDup[0]`;

parent $ambDup[0] ($ambSelected[0] + "_dup_GRP");
}

delete $ambLocator $ambMotionPath;
clear $ambSelected $ambLocator $ambDup;



Change the $ambNumberOfCopies variable from 36 to the number you actually want.... unless you want 36...

Hope that gives you the result you're after. :cool:

- Of course, there is always the "Create Animation Snapshot" option :D

cheers,
-a

CGTalk Moderation
08-10-2008, 12:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.