View Full Version : geo instance along follicle array

02 February 2011, 05:58 AM

I wrote a script which essentially steals the knowledge of gifted programmers from this forum and elsewhere, and harnesses it to do the thing the thread title says it does:

- It takes the object in the scene called "spkOrig" and creates an instance of it at every selected follicle, then parent constrains it to that follicle.

string $fol[] = `ls -sl -type transform "*Follicle*"` ;
$numFols = size($fol);
for ($i=00 ; $i<$numFols ; $i++){
select -r "spkOrig" ;
string $copySpike[] = `instance -n ("spike"+$i)`;
select -r $fol[$i];
select -tgl $copySpike[0];
delete `parentConstraint`;
parentConstraint -mo -weight 1;
select -cl ;
select -tgl "spike*" ;
group -n "Spikes";

Why am I posting this here? Well, as a noob programmer, I'm sure I've made hundreds of errors even in these short lines, even IF it appears to work just fine for the moment. Also, maybe someone can offer advice about how to make it more useful. :) Things I'd potentially like to investigate:

- Creation and count of the hair follicles at the start
- Integrating a rand size value in the instancing for greater variation
- Dynamic weighting of the instances - maybe something like nCloth
- Combining said dynamism with jiggle deformer or equivalent for more fluid movement.
- Collision?
- Investigation of movement with other nonlinear deformers.

CGTalk Moderation
02 February 2011, 05:58 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.