SceneManager (version 1.64)

index
d:\cruisecontrol\game-client-system\game\common\scripts\scenemanager.py

This module behaves as a singleton allowing calls to the game graphics system. 
It will attempt to clean upp all the created objects before shutdown calling all
subsequent lighs, organics, entities, etc .. created to be deleted.

 
Modules

      

 

gameGraphics

 

 

 

 

 
Classes

      

 

Animation

AnimationTrack

Camera

KeyFrame

MovableObject

Entity

Light

Particles

Organic

TextureBlitter

exceptions.Exception(exceptions.BaseException)

SceneError

AnimationError

CameraError

EntityError

LightError

MovableObjectError

OrganicError

ParticleError

TextureBlitterError

 
class Animation

   

Animation class is a placeholder for animating movable objects. Many movable objects can be 
animated by the animation class by adding them using Animation.addTrack (...) and supplying 
the class of the object extended by MovableObject class.
 

 

Methods defined here:

__init__(self, name, length)

This class should not be instanced directly use SceneManager.addAnimation

(...)

addTrack(self, movableObject)

Creates a new AnimationTrack automatically associated with a object extending MovableObject 'movableObject'.
This method creates a standard AnimationTrack, but also associates it with a target MovableObject which will receive all keyframe effects. 

Returns the instance of the create AnimationTrack class that knows its index. Where the index is a positive numeric value from 0 to n.

pause(self)

Pauses the animation.

play(self, bLoop=True)

Plays the animation. If bLoop equals true then we loop the animation

setInterpolationMode(self, bUsingInterpolation=True)

Creating animation class we use interpolation by default. This is changed if bUsingInterpolation is False,
then we will use Spline to interpolate the animation frames.

setWeight(self, w)

Sets the weight (influence) of this animation.

stop(self)

Stops the animation.

Data and other attributes defined here:

name = None

 

 

 
class AnimationTrack

   

AnimationTrack is the class that holds a many KeyFrames. The animation track handles the animation
for the supplied movable object.

Use Animation class to create animation tracks. Animation can have zero to many AnimationTracks.

To remove animation track call SceneManager.delAnimation(...).

 

 

Methods defined here:

__init__(self, index, attrib, movableObject)

This class should not be instanced directly use SceneManager.addAnimation(...) and then Animation.addTrack(...)

addKeyFrame(self, timePos)

Creates a key frame for animation of the movable object. Where tiemPos must be a positive integer value representing the given time index.
It is better to create KeyFrames in time order. Creating them out of order can result in expensive reordering processing. 

Note that a KeyFrame at time index 0.0 is always created for you, so you don't need to create this one.

Note that the timePos must also be lower than the total time of animation (animation lenght).

KeyFrame is used to define the actual scale, translation and rotation in an animation.

Returns instance of KeyFrame on success but raises AnimationError on failure.

Data and other attributes defined here:

index = None

 

 
class Camera

   

Request for refactoring. Currenlty we handle the camera creation and cleanup. Ogre should do it instead.
 

 

Methods defined here:

__init__(self)

Is meant to give access to the one default camera

attach(self, entityName=None)

This will attach the camera to an entity having name entityName, the entity must exist. If no
entity is defined then the camera is detached and "free".

When attached you can still control the camera but in the entitys local space. You will be able to 

set lookAt and lookAtEntity where the camera will follow the attached entity and look at the targets.

Calling followEntity will detach the camera from the object (restoring it).

Deleting an entity havning a camera attached will delete the default camera :(.

disable(self)

Will remove any behavoirs on camera.

followEntity(self, name='')

Where name is null or a loaded movable object. Critical: pass null value (disabling) before unloading the
entity. So we are not following at the deleted entity (will cause crash).

lookAtDirection(self, x, y, z)

Turns the camera to the specified direction

lookAtEntity(self, name='')

Where name is null or a loaded movable object. Critical: pass null value (disabling) before unloading the
entity. So we are not looking at the deleted entity (will cause crash).

setFOV(self, fov=0.80000000000000004)

Sets field of view, 0.8 is a good value

setFlyFreeControl(self, moveScale=None, rotationScale=None)

Will enable fly free camera control for camera. If moveScale and rotationScale is provided
these values will be used in transition per unit.

setFlyFreeControlKeys(self, MoveLeft, MoveRight, MoveForward, MoveBackward, MoveUp, MoveDown, RotateLeft, RotateRight)

Sets what keys are used when we control the camera in free fly mode.

setFollowProperties(self, followFactor, followRotationFactor, height, distance, lookAhead=100)

Applies the follow scene node factors. How the scene node is followed.

setOrientation(self, w, x, y, z)

Rotates the camera

setPosition(self, x, y, z)

Positions the camera

setTargetEntity(self, name='')

Where name is null or a loaded movable object. Critical: pass null value (disabling) before unloading the
entity. So we are not looking at the deleted entity (will cause crash).

useCamera(self, cameraName=None)

This will change the camera from the current to the specified 'cameraName'. The camera named 'cameraName'
must exist in the system (you can create through loading external scenes, like through call loadScene(...)).

Critical: pass null value (disabling) before unloading the scene that created the camera.

Passing None (or '') will select the default camera.

If the camera does not exist we raise an SceneError.

 

 

 
class Entity(MovableObject)

   

Handles a mesh, use SceneManager addEntity instead of calling this directly
 

 

Methods defined here:

__init__(self, name, file=None)

This class should not be instanced directly use SceneManager.addEntity(...)

__str__(self)

Formated string describing name, file, animation names and position of the Entity

getAllAnimationNames(self)

Returns a list of all the animations supported by this entity.

playAnimation(self, name, loop=False, enabled=True)

Plays entity animation and returns None on success. Else raises an EntityError.

setMaterial(self, MaterialName)

Sets this entites material. Replaces the material currently in use.

stopAnimation(self, name)

Plays entity animation and returns None on success. Else raises an EntityError.

Data and other attributes defined here:

file = ''

Methods inherited from MovableObject:

attach(self, movableobject, position=[])

Attaches the 'movableobjectname' to this movable object. The object must exists and be loaded into ogre.
When attaching an object it will detach the objects parent scene node from its parent. Then it will

be attached to this objects parent scene node (inheriting its translations + applying its current transitions).

Cameras are not supported.

getChildren(self)

getDistanceTo(self, toObject)

Returns the distance to the object 'toObject'

getOrientation(self, world=False)

Returs the movable objects orientation in the form of list having four values being [w, x, y, z]. 
If world is true then we will get the orientation after all applied orientation to parents. 

If world is false then we get the orientation in relation to parent.

getPitch(self)

Returns movable objects 'degree' around x axis

getPosition(self, world=False)

Returns movable objects position in the form of a list having three float values [x, y, z] 
If world is true then we will get the final position after all applied translation to parents. 

If world is false then we get the translation in relation to parent.

getRoll(self)

Returns movable objects 'degree' around z axis

getScale(self)

Returns movable objects scale in the form of a list having three float values [x, y, z]

getSize(self)

Returns movable objects size in the form of a list having three float values [x, y, z] after scale
(the bounding box size).

getYaw(self)

Returns movable objects 'degree' around y axis

rotate(self, w, x, y, z, time=None, args=None)

Rotates an object. Behaves exactly as setOrientation

scale(self, x, y, z)

Scales relative to current scale

setOrientation(self, w, x, y, z, time=None, args=None)

Sets the orientation of our object. If time is set then we interpolate linearly from current orientation to the desired (w, x, y, z) orientation 
during time 'time'. Where time is in milli seconds. 

If arg is set then we interpolate using the  arg values as input to a cubic (Ogre::Quaternion::Squad) function. The spline function takes two list 

values each having four values that will be used to calculate the interpolation. The arg format is as follows [[w,x,y,z],[w,x,y,z]].

Method raises MovableObjectError on failure and None on success.

setPitch(self, degree)

Rotates object 'degree' around x axis

setPosition(self, x, y, z, type='Absolute', time=None, args=None)

Sets the position of our object, where type is either 'Absolute' or 'Relative'. Where 'Relative' uses the objects position as reference
and sets the position relative to that. Absolute moves the object in worlds space. If time is set then we interpolate linearly from current 

location to the desired (x, y, z) position during time 'time'. Where time is in milli seconds. 

If arg is set then we interpolate using the  arg values as input to a spline (Ogre::SimpleSpline) function. The spline function takes two 

list values each having three values that will be used to calculate the interpolation. The arg format is as follows [[x,y,z],[x,y,z]].

Method raises MovableObjectError on failure and None on success.

setRoll(self, degree)

Rotates object 'degree' around z axis

setScale(self, x, y, z, relative=False)

Scales relative to current scale

setVisible(self, b=True, cascade=True)

if b is True then we set this object visable and all its children

setYaw(self, degree)

Rotates object 'degree' around y axis

showBoundingbox(self, b=True)

if b is true then we display this object bounding box

translate(self, x, y, z, time=None, args=None)

Moves movable object relative to its parent

Data and other attributes inherited from MovableObject:

name = None

 

 

 
class KeyFrame

   

KeyFrame is the class that positions an animated movable object by setting the subsiquent transition, rotation or scale at
specified time position.

Use AnimationTrack class to create key frames. AnimationTrack can have zero to many key frames.

To remove animation track call SceneManager.delAnimation(...).

 

 

Methods defined here:

__init__(self, id, attrib, timePos)

This class should not be instanced directly use SceneManager.addAnimation(...) and then Animation.addTrack(...) 
and lastly AnimationTrack.addKeyFrame(...)

setRotation(self, q, x, y, z)

Sets the rotation applied by this keyframe.  Returns None on success but raises AnimationError on failure

setScale(self, x, y, z)

Sets the scaling factor applied by this keyframe to the animable object at it's time index.  Returns None on success 
but raises AnimationError on failure

setTranslate(self, x, y, z)

Sets the translation associated with this keyframe. Returns None on success but raises AnimationError on failure

Data and other attributes defined here:

id = 0

 

 
class Light(MovableObject)

   

##############################################
#    Light

#        Representation of a dynamic light source in the scene

##############################################

 

 

Methods defined here:

__init__(self, name)

This class should not be instanced directly use SceneManager.addLight(...)

__str__(self)

Formated string describing name, file, animation names and position of the Light

setDiffuseColor(self, r, g, b)

setDirection(self, x, y, z)

Sets the light to directional light mode and direction in which a light points.

setFalloffRange(self, innerAngle, outerAngle, falloff)

Sets the light to spotlight mode.
Sets the falloff between the inner and outer cones of the spotlight.

Where:

    innerAngle is the angle in degrees covered by the bright inner cone The inner cone applicable only to Direct3D, it'll always treat as zero in OpenGL.

    outerAngle is the angle in degrees covered by the outer cone

    falloff is the rate of falloff between the inner and outer cones. 1.0 means a linear falloff, less means slower falloff, higher means faster falloff.

Methods inherited from MovableObject:

attach(self, movableobject, position=[])

Attaches the 'movableobjectname' to this movable object. The object must exists and be loaded into ogre.
When attaching an object it will detach the objects parent scene node from its parent. Then it will

be attached to this objects parent scene node (inheriting its translations + applying its current transitions).

Cameras are not supported.

getChildren(self)

getDistanceTo(self, toObject)

Returns the distance to the object 'toObject'

getOrientation(self, world=False)

Returs the movable objects orientation in the form of list having four values being [w, x, y, z]. 
If world is true then we will get the orientation after all applied orientation to parents. 

If world is false then we get the orientation in relation to parent.

getPitch(self)

Returns movable objects 'degree' around x axis

getPosition(self, world=False)

Returns movable objects position in the form of a list having three float values [x, y, z] 
If world is true then we will get the final position after all applied translation to parents. 

If world is false then we get the translation in relation to parent.

getRoll(self)

Returns movable objects 'degree' around z axis

getScale(self)

Returns movable objects scale in the form of a list having three float values [x, y, z]

getSize(self)

Returns movable objects size in the form of a list having three float values [x, y, z] after scale
(the bounding box size).

getYaw(self)

Returns movable objects 'degree' around y axis

rotate(self, w, x, y, z, time=None, args=None)

Rotates an object. Behaves exactly as setOrientation

scale(self, x, y, z)

Scales relative to current scale

setOrientation(self, w, x, y, z, time=None, args=None)

Sets the orientation of our object. If time is set then we interpolate linearly from current orientation to the desired (w, x, y, z) orientation 
during time 'time'. Where time is in milli seconds. 

If arg is set then we interpolate using the  arg values as input to a cubic (Ogre::Quaternion::Squad) function. The spline function takes two list 

values each having four values that will be used to calculate the interpolation. The arg format is as follows [[w,x,y,z],[w,x,y,z]].

Method raises MovableObjectError on failure and None on success.

setPitch(self, degree)

Rotates object 'degree' around x axis

setPosition(self, x, y, z, type='Absolute', time=None, args=None)

Sets the position of our object, where type is either 'Absolute' or 'Relative'. Where 'Relative' uses the objects position as reference
and sets the position relative to that. Absolute moves the object in worlds space. If time is set then we interpolate linearly from current 

location to the desired (x, y, z) position during time 'time'. Where time is in milli seconds. 

If arg is set then we interpolate using the  arg values as input to a spline (Ogre::SimpleSpline) function. The spline function takes two 

list values each having three values that will be used to calculate the interpolation. The arg format is as follows [[x,y,z],[x,y,z]].

Method raises MovableObjectError on failure and None on success.

setRoll(self, degree)

Rotates object 'degree' around z axis

setScale(self, x, y, z, relative=False)

Scales relative to current scale

setVisible(self, b=True, cascade=True)

if b is True then we set this object visable and all its children

setYaw(self, degree)

Rotates object 'degree' around y axis

showBoundingbox(self, b=True)

if b is true then we display this object bounding box

translate(self, x, y, z, time=None, args=None)

Moves movable object relative to its parent

Data and other attributes inherited from MovableObject:

name = None

 

 

 
class MovableObject

   

Class representing a primitive object in the scene graph, is never used through direct initalization
 

 

Methods defined here:

__init__(self)

Abstract class initalization call that raises an error when called directly

__str__(self)

Formated string describing name and position of the object

attach(self, movableobject, position=[])

Attaches the 'movableobjectname' to this movable object. The object must exists and be loaded into ogre.
When attaching an object it will detach the objects parent scene node from its parent. Then it will

be attached to this objects parent scene node (inheriting its translations + applying its current transitions).

Cameras are not supported.

getChildren(self)

getDistanceTo(self, toObject)

Returns the distance to the object 'toObject'

getOrientation(self, world=False)

Returs the movable objects orientation in the form of list having four values being [w, x, y, z]. 
If world is true then we will get the orientation after all applied orientation to parents. 

If world is false then we get the orientation in relation to parent.

getPitch(self)

Returns movable objects 'degree' around x axis

getPosition(self, world=False)

Returns movable objects position in the form of a list having three float values [x, y, z] 
If world is true then we will get the final position after all applied translation to parents. 

If world is false then we get the translation in relation to parent.

getRoll(self)

Returns movable objects 'degree' around z axis

getScale(self)

Returns movable objects scale in the form of a list having three float values [x, y, z]

getSize(self)

Returns movable objects size in the form of a list having three float values [x, y, z] after scale
(the bounding box size).

getYaw(self)

Returns movable objects 'degree' around y axis

rotate(self, w, x, y, z, time=None, args=None)

Rotates an object. Behaves exactly as setOrientation

scale(self, x, y, z)

Scales relative to current scale

setOrientation(self, w, x, y, z, time=None, args=None)

Sets the orientation of our object. If time is set then we interpolate linearly from current orientation to the desired (w, x, y, z) orientation 
during time 'time'. Where time is in milli seconds. 

If arg is set then we interpolate using the  arg values as input to a cubic (Ogre::Quaternion::Squad) function. The spline function takes two list 

values each having four values that will be used to calculate the interpolation. The arg format is as follows [[w,x,y,z],[w,x,y,z]].

Method raises MovableObjectError on failure and None on success.

setPitch(self, degree)

Rotates object 'degree' around x axis

setPosition(self, x, y, z, type='Absolute', time=None, args=None)

Sets the position of our object, where type is either 'Absolute' or 'Relative'. Where 'Relative' uses the objects position as reference
and sets the position relative to that. Absolute moves the object in worlds space. If time is set then we interpolate linearly from current 

location to the desired (x, y, z) position during time 'time'. Where time is in milli seconds. 

If arg is set then we interpolate using the  arg values as input to a spline (Ogre::SimpleSpline) function. The spline function takes two 

list values each having three values that will be used to calculate the interpolation. The arg format is as follows [[x,y,z],[x,y,z]].

Method raises MovableObjectError on failure and None on success.

setRoll(self, degree)

Rotates object 'degree' around z axis

setScale(self, x, y, z, relative=False)

Scales relative to current scale

setVisible(self, b=True, cascade=True)

if b is True then we set this object visable and all its children

setYaw(self, degree)

Rotates object 'degree' around y axis

showBoundingbox(self, b=True)

if b is true then we display this object bounding box

translate(self, x, y, z, time=None, args=None)

Moves movable object relative to its parent

Data and other attributes defined here:

name = None

 

 

 
class Organic

   

##############################################
#    Organic

#        A object that interacts with its enviroment

##############################################

 

 

Methods defined here:

__init__(self, name, type, dic)

This class should not be instanced directly use SceneManager.addOrganic(...)

__str__(self)

getPropertyKeys(self, type)

Returns all the keys needed to be set by the specified type to be a successfull call to the system.

getType(self)

Returns the Organic type. The supported types are Grass and WoblyMesh

 

 

 

 
class Particles(MovableObject)

   

Class defining particle system based special effects
 

 

Methods defined here:

__init__(self, name, effectName)

This class should not be instanced directly use SceneManager.addParticles(...)

Methods inherited from MovableObject:

__str__(self)

Formated string describing name and position of the object

attach(self, movableobject, position=[])

Attaches the 'movableobjectname' to this movable object. The object must exists and be loaded into ogre.
When attaching an object it will detach the objects parent scene node from its parent. Then it will

be attached to this objects parent scene node (inheriting its translations + applying its current transitions).

Cameras are not supported.

getChildren(self)

getDistanceTo(self, toObject)

Returns the distance to the object 'toObject'

getOrientation(self, world=False)

Returs the movable objects orientation in the form of list having four values being [w, x, y, z]. 
If world is true then we will get the orientation after all applied orientation to parents. 

If world is false then we get the orientation in relation to parent.

getPitch(self)

Returns movable objects 'degree' around x axis

getPosition(self, world=False)

Returns movable objects position in the form of a list having three float values [x, y, z] 
If world is true then we will get the final position after all applied translation to parents. 

If world is false then we get the translation in relation to parent.

getRoll(self)

Returns movable objects 'degree' around z axis

getScale(self)

Returns movable objects scale in the form of a list having three float values [x, y, z]

getSize(self)

Returns movable objects size in the form of a list having three float values [x, y, z] after scale
(the bounding box size).

getYaw(self)

Returns movable objects 'degree' around y axis

rotate(self, w, x, y, z, time=None, args=None)

Rotates an object. Behaves exactly as setOrientation

scale(self, x, y, z)

Scales relative to current scale

setOrientation(self, w, x, y, z, time=None, args=None)

Sets the orientation of our object. If time is set then we interpolate linearly from current orientation to the desired (w, x, y, z) orientation 
during time 'time'. Where time is in milli seconds. 

If arg is set then we interpolate using the  arg values as input to a cubic (Ogre::Quaternion::Squad) function. The spline function takes two list 

values each having four values that will be used to calculate the interpolation. The arg format is as follows [[w,x,y,z],[w,x,y,z]].

Method raises MovableObjectError on failure and None on success.

setPitch(self, degree)

Rotates object 'degree' around x axis

setPosition(self, x, y, z, type='Absolute', time=None, args=None)

Sets the position of our object, where type is either 'Absolute' or 'Relative'. Where 'Relative' uses the objects position as reference
and sets the position relative to that. Absolute moves the object in worlds space. If time is set then we interpolate linearly from current 

location to the desired (x, y, z) position during time 'time'. Where time is in milli seconds. 

If arg is set then we interpolate using the  arg values as input to a spline (Ogre::SimpleSpline) function. The spline function takes two 

list values each having three values that will be used to calculate the interpolation. The arg format is as follows [[x,y,z],[x,y,z]].

Method raises MovableObjectError on failure and None on success.

setRoll(self, degree)

Rotates object 'degree' around z axis

setScale(self, x, y, z, relative=False)

Scales relative to current scale

setVisible(self, b=True, cascade=True)

if b is True then we set this object visable and all its children

setYaw(self, degree)

Rotates object 'degree' around y axis

showBoundingbox(self, b=True)

if b is true then we display this object bounding box

translate(self, x, y, z, time=None, args=None)

Moves movable object relative to its parent

Data and other attributes inherited from MovableObject:

name = None

 

 

 
class TextureBlitter

   

 

Methods defined here:

__del__(self)

Destroys the texture blitter.

__init__(self, textureName, fileName, resourceGroup, width, height)

Creates the instance and texture file. The textureName will be the name refered by material scripts and
file name is the name of the file which we start from (this can be an empty image (64x64). The fileName must

be accessable from the resource group 'resourceGroup'. The width and height must be larger than 0 and represents

the final images size.

This instance must be destroyed before exiting the application. Otherwise it causes a crash during unload.

__str__(self)

addSource(self, name, x, y, w, h, texture, resourceGroup='General', flipX=False, flipY=False)

Adds a sticker source definition to the collection and sets its dimensions.
Where texture is the name of the texture file and x, y, w, h is the location within the

texture where we take the image.

If flipX is true then it will load this image and flip it in the x axis. 

If flipY is true then it will load this image and flip it in the y axis.

addTarget(self, name, x, y, w, h)

Adds a sticker location to the collection and sets its dimensions.
Where targetName is the name to identify this location. x and y is the relative

location on the bitmap (a number between 0 and 1) and w and h is the relative

width and height of the target image.

paint(self, sourceName, targetName)

Will set the sticker onto target location.

Data and other attributes defined here:

height = None

id = None

name = None

resourceGroup = None

width = None

 

 

 

 
Functions

      

 

addAnimation(name, length=None)

Creates an animation which can be used to animate movable objects. Passing length=None tells the system to use an already defined animation.
Remarks:

An animation is a collection of 'tracks' which over time change the position / orientation of Node objects. In this case, the animation will 

likely have tracks to modify the position / orientation of SceneNode objects, e.g. to make objects move along a path. 

You don't need to use an Animation object to move objects around - you can do it yourself using the methods of the Node in your FrameListener class. 

However, when you need relatively complex scripted animation, this is the class to use since it will interpolate between keyframes for you and 

generally make the whole process easier to manage. 

A single animation can affect multiple Node objects (each AnimationTrack affects a single Node). In addition, through animation blending a single Node 

can be affected by multiple animations, athough this is more useful when performing skeletal animation (see Skeleton::createAnimation). 

Note that whilst it uses the same classes, the animations created here are kept separate from the skeletal animations of meshes (each Skeleton owns those animations). 

Parameters:

name is the name of the animation, should be unique within it's parent (e.g. Skeleton)

length is the length of the animation in seconds. Passing None tels the system that we are going to use an already defined animation (we just want the handle)

Returns instance of the created Animation class on success but raises SceneError on failure.

addBlitterTexture(textureName, fileName, resourceGroup, width, height)

Creates an blitter texture and adds it to our blitter texture collection

addEntity(name, file)

Adds a entity with name 'name' using mesh resource file 'file'.
The entity can only be removed by calling SceneManager.delEntity(<name>).

Returns a instance on success or raises an SceneError if it already exists or anything else went wrong.

addGrass()

addLight(name, type=0)

Adds a light with name 'name'. The light is returned on success else SceneError is raised. 
The light can only be removed by calling SceneManager.delLight(<name>).

Returns a instance on success or raises an SceneError if it already exists or anything else went wrong.

Different types of light include the following

* Point light sources give off light equally in all directions, so require only position not direction.

* Directional lights simulate parallel light beams from a distant source, hence have direction but no position.

* Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff.

By default adding a light is a point light. Setting a direction by calling setDirection converts it to a directional light. 

If setting a fall off using the method setFalloffRange (...) then converts it to a spot light.

addOrganics(name, type, dic)

Adds a organic with name 'name' having type 'type'. Where type is either 'Grass' or 'WoblyMesh'. 
The organic using the following attributes passed as a dictionary:

Grass     => "GrassWidth", "GrassHeight", "Material", "Radius", "EdgeDistribution", "PositionX", "PositionZ"

WoblyMesh => "MeshName","px","py","pz","sz","sy","sz","ow","ox","oy","oz","Displacement","Density","TimeDensity"

The entity is returned on success else SceneError is raised. The entity can only be removed by calling SceneManager.delOrganics(<name>).

Returns a instance on success or raises an SceneError if it already exists or anything else went wrong

addParticles(name, file)

Adds a particle system named 'name' base on file 'file' where the file is of type .particle and is available in Ogre resource library. 
Returns a instance on success or raises an SceneError if it already exists or anything else went wrong.

addTrees()

delAnimation(name)

Destroys an animation with name 'name'. The entire tracks and keyframes will be removed from the system. Any movable object will not be effected though.
Returns None on success but raises SceneError on failure.

delBlitterTexture(name)

Will remove and destroy the blitter from our collection

delEntity(name)

Removes a entity with name 'name' from the system. Must have been created using call addEntity (...).
Returns None on success or raises an SceneError if it does not exist

delLight(name)

Removes a light with name 'name' from the system. Must have been created using call addLight (...)
Returns None on success or raises an SceneError if it does not exist

delOrganics(name)

Removes a organics with name 'name' from the system. Must have been created using call addOrganics (...). 
Returns None on success or raises an SceneError if it does not exist or system failed to remove it

delParticles(name)

Removes a particles with name 'name' from the system. Must have been created using call addParticles (...)
Returns None on success or raises an SceneError if it does not exist

getAnimation(name)

Returns an animation having name 'name'. Raises SceneError if the animation does not exist.

getAnimationNames()

Returns a list of all lights currently loaded in the system

getBlitterTextureNames()

Return all the names of our created blitter textures

getCamera()

Returns the default camera created by the system.

getContentQuery(filter=None)

Returns a dictionary on the scene manager content. Current supported filters are:
None : returns everything

The returned dictionary has keys 'Light', 'Camera', 'Animation', 'Entity'

getEntity(name)

Returns the instance of entity having name 'name'. Returns a instance or raises an SceneError if it does not exist

getEntityNames()

Returns a list of all entities currently loaded in the system. Returns a list.

getLight(name)

Returns the instance of entity having name 'name'

getLightNames()

Returns a list of all lights currently loaded in the system

getOrganicNames()

Returns a list of all organics currently loaded in the system. Returns a list

getOrganics(name)

Returns the instance of organic having name 'name'. Returns a instance or raises an SceneError if it does not exist

getParticleNames()

Returns a list of all particles currently loaded in the system. Returns a list

getParticles(name)

Returns the instance of particles having name 'name'. Returns a instance or raises an SceneError if it does not exist

hasAnimation(name)

Returns true if the animation with name 'name' exists

hasEntity(name)

Returns a true if entity with name 'name' exists.

hasLight(name)

Returns a true if light with name 'name' exists

hasOrganics(name)

Returns a true if organics with name 'name' exists

hasParticles(name)

Returns true if the particles with name 'name' exists

loadScene(fileName=None)

Loads a scene of supported formats. The files must be accessable to the Ogre resource loader.
Supported types are .osm (oFusion files created through the oFusion max plugin for Ogre3d). 

Passing None or '' will unload the prevously loaded scene. Only one scene can be loaded at a time.

Raises SceneError on failure.

setAmbientLight(r, g, b)

Sets the scenes ambient light where r,g,b are values between 1 and 0. Returns None

setCompostionEffect(effect)

Sets the composition effect (last processing of the image) to effect where effect names can be one of defined effects in file .compositor (Bloom, B&W ....)

setFog(r, g, b, density=0.001, fogmode=3)

Sets fog in the scene where fogmodes are (None=0,exp=1,exp2=2,linear=3)

setShadowDistance(far, fadestart=0, fadeend=0)

Sets the shadow distance where

setSkyBox(strMaterialName=None, bEnable=True, scale=50)

Sets the scenes skybox. strMaterialName is a loaded resource material defined as a cube texture. Returns None
If strMaterialName is set to an valid material and bEnable is true then we will texture the sky.

If strMaterialName is set to None and bEnable is true then we will do a procedural sky.

If strMaterialName is set to None and bEnable is false then we will make the sky black.

 

 
Data

      

 

BTN_0 = '0'
BTN_1 = '1'
BTN_2 = '2'
BTN_3 = '3'
BTN_4 = '4'
BTN_5 = '5'
BTN_6 = '6'
BTN_7 = '7'
BTN_8 = '8'
BTN_9 = '9'
BTN_A = 'A'
BTN_ABNT_C1 = 'ABNT_C1'
BTN_ABNT_C2 = 'ABNT_C2'
BTN_ADD = 'ADD'
BTN_APOSTROPHE = 'APOSTROPHE'
BTN_APPS = 'APPS'
BTN_AT = 'AT'
BTN_AX = 'AX'
BTN_B = 'B'
BTN_BACK = 'BACK'
BTN_BACKSLASH = 'BACKSLASH'
BTN_C = 'C'
BTN_CALCULATOR = 'CALCULATOR'
BTN_CAPITAL = 'CAPITAL'
BTN_COLON = 'COLON'
BTN_COMMA = 'COMMA'
BTN_CONVERT = 'CONVERT'
BTN_D = 'D'
BTN_DECIMAL = 'DECIMAL'
BTN_DELETE = 'DELETE'
BTN_DIVIDE = 'DIVIDE'
BTN_DOWN = 'DOWN'
BTN_E = 'E'
BTN_END = 'END'
BTN_EQUALS = 'EQUALS'
BTN_ESCAPE = 'ESCAPE'
BTN_F = 'F'
BTN_F1 = 'F1'
BTN_F10 = 'F10'
BTN_F11 = 'F11'
BTN_F12 = 'F12'
BTN_F13 = 'F13'
BTN_F14 = 'F14'
BTN_F15 = 'F15'
BTN_F2 = 'F2'
BTN_F3 = 'F3'
BTN_F4 = 'F4'
BTN_F5 = 'F5'
BTN_F6 = 'F6'
BTN_F7 = 'F7'
BTN_F8 = 'F8'
BTN_F9 = 'F9'
BTN_G = 'G'
BTN_GRAVE = 'GRAVE'
BTN_H = 'H'
BTN_HOME = 'HOME'
BTN_I = 'I'
BTN_INSERT = 'INSERT'
BTN_J = 'J'
BTN_K = 'K'
BTN_KANA = 'KANA'
BTN_KANJI = 'KANJI'
BTN_L = 'L'
BTN_LBRACKET = 'LBRACKET'
BTN_LCONTROL = 'LCONTROL'
BTN_LEFT = 'LEFT'
BTN_LMENU = 'LMENU'
BTN_LSHIFT = 'LSHIFT'
BTN_LWIN = 'LWIN'
BTN_M = 'M'
BTN_MAIL = 'MAIL'
BTN_MEDIASELECT = 'MEDIASELECT'
BTN_MEDIASTOP = 'MEDIASTOP'
BTN_MINUS = 'MINUS'
BTN_MULTIPLY = 'MULTIPLY'
BTN_MUTE = 'MUTE'
BTN_MYCOMPUTER = 'MYCOMPUTER'
BTN_N = 'N'
BTN_NEXTTRACK = 'NEXTTRACK'
BTN_NOCONVERT = 'NOCONVERT'
BTN_NUMLOCK = 'NUMLOCK'
BTN_NUMPAD0 = 'NUMPAD0'
BTN_NUMPAD1 = 'NUMPAD1'
BTN_NUMPAD2 = 'NUMPAD2'
BTN_NUMPAD3 = 'NUMPAD3'
BTN_NUMPAD4 = 'NUMPAD4'
BTN_NUMPAD5 = 'NUMPAD5'
BTN_NUMPAD6 = 'NUMPAD6'
BTN_NUMPAD7 = 'NUMPAD7'
BTN_NUMPAD8 = 'NUMPAD8'
BTN_NUMPAD9 = 'NUMPAD9'
BTN_NUMPADCOMMA = 'NUMPADCOMMA'
BTN_NUMPADENTER = 'NUMPADENTER'
BTN_NUMPADEQUALS = 'NUMPADEQUALS'
BTN_O = 'O'
BTN_OEM_102 = 'OEM_102'
BTN_P = 'P'
BTN_PAUSE = 'PAUSE'
BTN_PERIOD = 'PERIOD'
BTN_PGDOWN = 'PGDOWN'
BTN_PGUP = 'PGUP'
BTN_PLAYPAUSE = 'PLAYPAUSE'
BTN_POWER = 'POWER'
BTN_PREVTRACK = 'PREVTRACK'
BTN_Q = 'Q'
BTN_R = 'R'
BTN_RBRACKET = 'RBRACKET'
BTN_RCONTROL = 'RCONTROL'
BTN_RETURN = 'RETURN'
BTN_RIGHT = 'RIGHT'
BTN_RMENU = 'RMENU'
BTN_RSHIFT = 'RSHIFT'
BTN_RWIN = 'RWIN'
BTN_S = 'S'
BTN_SCROLL = 'SCROLL'
BTN_SEMICOLON = 'SEMICOLON'
BTN_SLASH = 'SLASH'
BTN_SLEEP = 'SLEEP'
BTN_SPACE = 'SPACE'
BTN_STOP = 'STOP'
BTN_SUBTRACT = 'SUBTRACT'
BTN_SYSRQ = 'SYSRQ'
BTN_T = 'T'
BTN_TAB = 'TAB'
BTN_U = 'U'
BTN_UNDERLINE = 'UNDERLINE'
BTN_UNLABELED = 'UNLABELED'
BTN_UP = 'UP'
BTN_V = 'V'
BTN_VOLUMEDOWN = 'VOLUMEDOWN'
BTN_VOLUMEUP = 'VOLUMEUP'
BTN_W = 'W'
BTN_WAKE = 'WAKE'
BTN_WEBBACK = 'WEBBACK'
BTN_WEBFAVORITES = 'WEBFAVORITES'
BTN_WEBFORWARD = 'WEBFORWARD'
BTN_WEBHOME = 'WEBHOME'
BTN_WEBREFRESH = 'WEBREFRESH'
BTN_WEBSEARCH = 'WEBSEARCH'
BTN_WEBSTOP = 'WEBSTOP'
BTN_X = 'X'
BTN_Y = 'Y'
BTN_YEN = 'YEN'
BTN_Z = 'Z'
PATH_LOG = ''
REG_CALLBACK_INTERSECTION = 100
REG_CALLBACK_NETWORK = 105
REG_CALLBACK_REGISTERED = 106
REG_CALLBACK_SYSTEM = 104
REG_CALLBACK_TIMER = 101
REG_SYSTEM_SETUP = 200
SYSTEMEVENT_LOAD = 10
SYSTEMEVENT_UNLOAD = 11
__author__ = 'Kjartan A Jonsson'
__copyright__ = 'Copyright (c) 2007 aGameCompany'
__license__ = 'aGameCompany'
__source__ = '$Source: /cvsroot/game-client-system/scripts/SceneManager.py,v $'
__version__ = '$Revision: 1.64 $'
false = 0
true = 1

 

 
Author

      

 

Kjartan A Jonsson