View Single Post
# 6 03-03-2015 , 06:41 PM
Registered User
Join Date: Feb 2015
Posts: 3
Hi i have also same error and my expressions are right .i added all the expressions step by step as you said and there is no error but, when i play for particles i again got same error .My plugin is also on.I would be thanks full to you for help.Thanks


// 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 >>;