Creating a Master Controller?

Creating a Master Controller?

Anonymous
Not applicable
792 Views
1 Reply
Message 1 of 2

Creating a Master Controller?

Anonymous
Not applicable

Hey!
I've been working on a script today and I've run into a problem.

I've been able to create a locator and set up attributes. However, when trying to connect to a PP expression under creation, I can't seem to figure out the correct syntax. Here's an excerpt from the script:
// Add Expressions and Connect
$creation = ("goalV = rand(0.01);\ngoalU = rand(1);\nrandOffset = rand(0.5);\ngoalOffset = randOffset*goalWorldNormal0PP;\nlifespanPP = rand(1,2);");
dynExpression -s $creation -c $surfPartShape[0];

What I want to have goalV be controlled by $loc[0]'s birthHeight attribute. If it were a simple connect it would be

"$loc[0] + .birthHeight");

How do I stick that into the creation expression?

Thanks!
Colby

 

P.S. Here's the script right now:

script

0 Likes
793 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Hi Colby

 

I don't fully know what you are trying to do with your script as I can't get it to compile due to the missing function (addPerParticleGoalPointAttr) and so I can't really see what its meant to do, or where the attribute goalWorldNormal0PP is coming from. However, per-particle attributes can be set in the same way as any other attributes in an expression, for example:

 

particleShape1.lifespanPP = rand(1, 3);

 

will set the particles' lifespans to random values between 1 and 3. So apart from this part:

 

goalOffset = randOffset*goalWorldNormal0PP

 

which is failing due to the missing attribute, the expression should be ok I think...?

0 Likes