Anim8or Community
May 21, 2013, 04:25:16 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The v0.97d Preview is now available!  See the "Anim8or v0.97 Preview" Forum for details.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Does print work in a controller script?  (Read 572 times)
AlecJames
Newbie
*
Posts: 9


View Profile
« on: September 23, 2011, 08:02:25 am »

This is my first script.  It's a controller script.

Code:
int $x;
file $console;
float $RampStep[5];
float $RampTime[5];
float $RampSpeed[5];
float $RampAccel[5];

$RampStep[0] = 0;   $RampTime[0] = 0;      $RampSpeed[0] = 0;    $RampAccel[0] = 0;
$RampStep[1] = 34;  $RampTime[1] = 0.0262; $RampSpeed[1] = 2597; $RampAccel[1] = 98182;
$RampStep[2] = 46;  $RampTime[2] = 0.0323; $RampSpeed[2] = 1300; $RampAccel[2] = -210600;
$RampStep[3] = 186; $RampTime[3] = 0.1227; $RampSpeed[3] = 1800; $RampAccel[3] = 5536;
$RampStep[4] = 200; $RampTime[4] = 0.1382; $RampSpeed[4] = 0;    $RampAccel[4] = -115714;

float $StartTime1;
float $StackingTime;
$StartTime1 = 0.76;

    $console.open("$console", "w");

    if (time > $StartTime1)
    {
        $StackingTime = time - $StartTime1;
        for $x=0 to 4 do
        {
            $console.print("x=%i\n", $x);
        }

        $orientation = (0.0, 0.0, 90.0, 1.0);
    }
    else
    {
        $orientation = (0.0, 0.0, 0.0, 1.0);
    }

    $console.close();
I'm stuck on this line "$console.print("x=%i\n", $x);".  I know it executes because I can see its line number in the debug output trace but I don't see x=0....
Am I looking in the right place?  Does the output appear in the Anim8or debug output window? Is there a mistake?

Thanks
A
Logged
AlecJames
Newbie
*
Posts: 9


View Profile
« Reply #1 on: September 25, 2011, 03:32:01 am »

In case anyone finds this post looking for the same question:

I found that print to console works in anim8or version 0.97d but not in 0.95.

I could not find how to show the debug window in 0.97d (in 0.95 it appears as soon as you start defining a script).  The only way I could get the window to appear was to select Options->Debug->Trace Script Execution (shows script line numbers as they are executed) and then select it again to switch that trace off.  The debug window remained on screen.  Is there a way to show / hide / keep on top / clear this window?

(My script went on to animate orientation.  This is done by setting $orientation before the script exits.  $orientation is assigned to a 'quaternion' type variable.  If the script calculates the orientation as RPY in degrees there is a method / vector function 'RPYtoQuaternion' that will do the conversion for you.  Took me ages to find that!)
A
Logged
kreator
Sr. Member
****
Posts: 620


BLENDER,Carrara and anim8or a Great Combination!


View Profile WWW
« Reply #2 on: September 25, 2011, 03:52:34 am »

0.97D File/Configure then check Script Console.
Logged

O
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!