Total Articles 442
지금 첨부되어 있는 스크립은
로케이터를 선택하고 실행하게 되면
파티클 알갱이(컴퍼넌트??) 하나하나 마다
로케이터가 붙어서 방출되는 스크립입니다.
공개스크립인데요..
지금 현 상태는
로케이터를 선택해서 지정한 갯수만큼 파티클이 분출이 되는데..거기에 로케이터가 각각 붙어서요.
제가 원하는 것은
선택된 로케이터가 아니라 이미 생성된 파티클에게 적용하고 싶습니다.
그렇게 수정 가능하다면 부탁드립니다.
예를 들어서 지금 폴리곤 객체에 각각의 페이스 하나하나 마다
알갱이가 위치해서 파티클이 생성되어 있는 상태 입니다.
이렇게 생성되어 있는 파티클에게 각각의 로케이터가 붙어다니게 해주는
이스크립을 적용하고 싶습니다.
부탁드립니다.
2010.06.01 00:20:20 (*.237.239.62)
컴퍼넌트 모드에서 파티클들을 선택하시고,
아래 스크립트를 실행시키세요.
global proc jgd_particleLights()
{
waitCursor -st 1; // Enable wait cursor while script is running
string $particles[] = `filterExpand -sm 47`;
string $group = `group -em -w -n "particleLightsRig1"`;
string $rigNum[];
tokenize $group "g" $rigNum; // $rigNum[2] will be the rig number
// Loop through the duplication of lights and locators
string $exprString1 = "";
int $i = 0;
for ($particle in $particles)
{
string $locShape = `createNode locator`;
string $locName = ("particleLight" + $i);
rename `listRelatives -p $locShape` $locName;
parent -r $locName $group;
$exprString1 += "float $partPos[] = `getParticleAttr -at worldPosition " + $particle + "`;\r\n" +
$locName + ".tx = $partPos[0];\r\n" +
$locName + ".ty = $partPos[1];\r\n" +
$locName + ".tz = $partPos[2];\r\n\r\n";
$i = $i + 1;
}
expression -s $exprString1 -o "" -ae 1 -uc all -n ("particleLightPos" + $rigNum[2] + "Expr");
waitCursor -st 0; // Disable wait cursor when script is complete
}
jgd_particleLights();
