"LW Scene Info 2"
Availability: LightWave 6.0
Component: Layout
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.
Global Call
LWSceneInfo *sceneinfo;
sceneinfo = global( "LW Scene Info", 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;
} 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_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.
- 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.
-
Example
This code fragment calculates the running time and frame aspect.
#include <lwserver.h>
#include <lwrender.h>
LWSceneInfo *lwsi;
double duration, frameAspect;
lwsi = global( "LW Scene Info", GFUSE_TRANSIENT );
if ( lwsi ) {
duration = ( lwsi->frameEnd - lwsi->frameStart + 1 )
/ lwsi->framesPerSecond;
frameAspect = lwsi->pixelAspect * lwsi->frameWidth
/ lwsi->frameHeight;
}
|