Globals: Scene Info

LightWave

 
Raster Services Scene Objects Globals Table of Contents

Scene Info

Availability  LightWave 6.0 Component  Layout
Header  lwrender.h

The scene info global returns information about the current scene. This information is read-only and reflects the state of the scene at the time the global function is called. You can set these parameters using commands.

Global Call

   LWSceneInfo *sceneinfo;
   sceneinfo = global( LWSCENEINFO_GLOBAL, GFUSE_TRANSIENT );
The global function returns a pointer to an LWSceneInfo.
   typedef struct st_LWSceneInfo {
      const char *name;
      const char *filename;
      int         numPoints;
      int         numPolygons;
      int         renderType;
      int         renderOpts;
      LWFrame     frameStart;
      LWFrame     frameEnd;
      LWFrame     frameStep;
      double      framesPerSecond;
      int         frameWidth;
      int         frameHeight;
      double      pixelAspect;
      int         minSamplesPerPixel;
      int         maxSamplesPerPixel;
      int         limitedRegion[4];
      int         recursionDepth;
      LWItemID   (*renderCamera) (LWTime);
      int         numThreads;
      const char *animFilename;
      const char *RGBPrefix;
      const char *alphaPrefix;
   } LWSceneInfo;
name
User's name for the scene. 

filename
Filename of the scene file. 

numPoints, numPolygons
Total number of points and polygons for all the objects in the scene.

renderType
The render type, which can be one of the following. 
LWRTYPE_WIRE
LWRTYPE_QUICK
LWRTYPE_REALISTIC
renderOpts
This is a combination of bits for different rendering options. The bit flags are 
LWROPT_SHADOWTRACE
LWROPT_REFLECTTRACE
LWROPT_REFRACTTRACE
LWROPT_FIELDS
LWROPT_EVENFIELDS
LWROPT_MOTIONBLUR
LWROPT_DEPTHOFFIELD
LWROPT_LIMITEDREGION
LWROPT_PARTICLEBLUR
LWROPT_ENHANCEDAA
LWROPT_SAVEANIM
LWROPT_SAVERGB
LWROPT_SAVEALPHA
LWROPT_EVENFIELDS is set only if field rendering is on and the first line of the output image is from the field that comes first in time. 
frameStart, frameEnd
The numbers of the first and last frame defined for the scene. These are the rendering limits, not to be confused with the limits set by the user for previews (which you can get from the interface info global).

frameStep
The step size, in frames, during rendering (the user setting for the Frame Step).

framesPerSecond
Number of frames per playback second. This will ordinarily be 24 for film, 30 for NTSC video and 25 for PAL video. Note that this is the number of frames, not fields.

frameWidth, frameHeight
Rendered image size in pixels. 

pixelAspect
The aspect ratio of the pixels in the image, expressed as width/height. Values greater than 1.0 mean short wide pixels and values less than 1.0 mean tall thin pixels. 

minSamplesPerPixel, maxSamplesPerPixel
Limits on the number of samples per pixel in the final image. Because of different rendering techniques and adaptive sampling it is impossible to compute a precise number of antialiasing samples at any pixel, but this gives a range for the current rendering options. 

limitedRegion
The extents of the limited region area, in pixels. The extents are given in the order x0, y0, x1, y1.

recursionDepth
The maximum recursion depth for raytracing.

camID = renderCamera( time )
Returns the item ID of the camera that will render the frame at the specified time.
 
numThreads
The number of threads of execution that will be used during rendering.

animFilename
The name of the current animation file.
RGBPrefix 
The current RGB file saving  prefix

AlphaPrefix
The current RGB file saving  prefix
Example

This code fragment calculates the running time and frame aspect.

   #include <lwserver.h>
   #include <lwrender.h>

   LWSceneInfo *lwsi;
   double duration, frameAspect;

   lwsi = global( LWSCENEINFO_GLOBAL, GFUSE_TRANSIENT );

   if ( lwsi ) {
      duration = ( lwsi->frameEnd - lwsi->frameStart + 1 )
         / lwsi->framesPerSecond;
      frameAspect = lwsi->pixelAspect * lwsi->frameWidth
         / lwsi->frameHeight;
   }