General Category > ASL Scripts

Yeaaah..

<< < (2/2)

VBSmiles:
Sweet! got it to work!


--- Code: ---/*************************************************/
/*** Script in progress made to flatten points ***/
/*** Created by: VBSmiles                              ***/
/*************************************************/
/*** declaration ***/
#command("object"); /*1*//* To start as menu item ? */
point3 $c_point;     /*2*//* current point */
float $dist;    /*6*//* Distance between points and ... */
shape $model;
int $test, $i, $NP;
file $file;
string $Output;

/*** Initialization ***/
$model = project.curObject.LookupShape("mesh01");
/*** Get the number of points in model ***/
if ($model != NULL)
{
$model.Open();

$NP = $model.GetNumPoints();

for $i = 0 to $NP do
 {
   $Output = PrintToString("%d", $NP);
   $file.open("$console", "w");
   $file.print("\n\n Value of $NP: " +$Output+ "\n\n");
   $Output = PrintToString("%d", $i);
   $file.print("\n\n Value of $i: " +$Output+ "\n\n");
   $file.close;

   /* Get the selected point */
   $test = $model.GetPointSelected($i);
   
   /*** if selected then store it's values ***/
   if ($test == 1)
      {
      $c_point = $model.GetPoint ($i);
      /*** reset it's x componenet to 0 ***/
      $c_point.y = 0;
      /*** move the point ***/
      $model.SetPoint ($i, $c_point);

      }
   }
$model.Close();
refresh();
} else
{
   $file.open("$console", "w");
   $file.print("\n\n where the hell is the model? \n\n");
$file.close;
}
--- End code ---

Now I just have to figure out a better way  and add a way to choose axis  ;D

Navigation

[0] Message Index

[*] Previous page

Go to full version