1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Movie Question

Posted by alx on Jul 10, 2007

Hiya,

very simple question: Is it possible to have a variable increment smoothly for every frame of an exported movie, so that you could render evolving patterns etc.

Cheers


 
Posted by anonymous on Jul 12, 2007

Look at any animation example in your NodeBox folder. They all have a global variable, cnt, that increments by 0.1 at the end of the draw function. Note that if you simply add the line

cnt += 0.1
Python will raise an error because cnt is not yet defined. You need to make it a global variable by adding the line
global cnt
to the begining of the draw and setup functions, and then add the line
cnt = 0
somewhere inside setup.
Of course, you can change the default value, the name of the increasing variable, or the amount it increments each frame, but you will need to do a bit of math to figure out how many frames to export.



Posted by Tom De Smedt on Jul 13, 2007

There's also the FRAME global variable that keeps track of the current frame number, but apparently that was nowhere documented (I've added it to the Variables doc now).