View Single Post
# 7 03-03-2015 , 06:54 PM
Registered User
Join Date: Feb 2015
Posts: 3
I have also same error .I added all the expressions step by step as you said and didn't get any error, fortunately my expression are right .But when i play for particles i again got error. // Error: An execution error occurred in the creation expression for particleShape1.
My plugin is also On. below is expression which i am using.

// sets the orient axis for the instace
particleShape1.aimUp = <<0,1,0>>;

//random rotation for Y axis
particleShape1.randomRotationY = rand(360);

// get surface normal at particle position
vector $p = particleShape1.position;
vector $normal = `nearestpointonMesh -ip ($p.x) ($p.y) ($p.z) -normal -q pPlane1`;

// orient the instance
particleShape1.aimDir = $normal;

// solve each angle, convert to degrees
float $rotX = rad_to_deg( atan2( ($normal.z), ($normal.y) ) );
float $rotz = rad_to_deg( atan2( ($normal.x) ) );

// assign random rotation in Y
particleShape1.rotationPP = << $rotX, particleShape1.randomRotationY, $rotz >>;