Register Latest Topics
 
 
 


Reply
  Author   Comment  
JeremyR

Moderator
Registered:
Posts: 1,053
Reply with quote  #1 
Trying to create custom expression inside the point position of the point node but getting error.
// Error: line 1: Cannot find procedure "position_POINT"

What do I need to do to make this work?

Code:

// POINT POSITION

float $dist = 3.0;
vector $myPoints[];
int $i=0;
for ($g = 1; $g < $PCOUNT; $g++) {
  $dist = $g*3;
  for ($r = 0; $r < 360; $r+=10) {
    float $rr = deg_to_rad($r);
    $myPoints[$i] = <<cos($rr)*$dist+gauss(0.2), 0.0, sin($rr)*$dist+gauss(0.2)>>;
    $X = $myPoints[$i].x;
    $Y = $myPoints[$i].y;
    $Z = $myPoints[$i].z;
    $i++;
  }
}

0
pshipkov

SOuP Jedi
Registered:
Posts: 4,732
Reply with quote  #2 
where you define $PCOUNT ?
0
JeremyR

Moderator
Registered:
Posts: 1,053
Reply with quote  #3 
I thought that was a pre-defined variable in the point node which returns the input mesh point count?
0
pshipkov

SOuP Jedi
Registered:
Posts: 4,732
Reply with quote  #4 
I am not sure what you are trying to achieve with this expression. here is something i *think* you may want to do.

float
 $dist = 3.0;
vector $myPoints;
  $dist = $g*3;
  for ($r = 0; $r < 360; $r+=10) {
    float $rr = deg_to_rad($r);
    $myPoints = <<cos($rr)*$dist+gauss(0.2), 0.0, sin($rr)*$dist+gauss(0.2)>>;
    $X += $myPoints.x;
    $Y += $myPoints.y;
    $Z += $myPoints.z;
}
0
JeremyR

Moderator
Registered:
Posts: 1,053
Reply with quote  #5 
I found the code online, this guy was creating point patterns like spirals as in the code I supplied. I made some alterations but I think I mucked it up. Copying and pasting your code in the Point nodes point position part throws the same error up too.
Im not sure if the point node has access to mel commands like deg_to_rad though.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.