Uranium
Application Framework
UM.Scene.Scene.Scene Class Reference

Container object for the scene graph. More...

Public Member Functions

None __init__ (self)
 
None setIgnoreSceneChanges (self, bool ignore_scene_changes)
 
None acquireLock (self)
 Acquire the global scene lock. More...
 
None releaseLock (self)
 Release the global scene lock. More...
 
threading.Lock getSceneLock (self)
 Gets the global scene lock. More...
 
"SceneNode" getRoot (self)
 Get the root node of the scene. More...
 
None setRoot (self, "SceneNode" node)
 Change the root node of the scene.
 
Optional[CameragetActiveCamera (self)
 Get the camera that should be used for rendering. More...
 
List[CameragetAllCameras (self)
 
None setActiveCamera (self, str name)
 Set the camera that should be used for rendering. More...
 
Optional["SceneNode"] findObject (self, int object_id)
 Find an object by id. More...
 
Optional[CamerafindCamera (self, str name)
 
None addWatchedFile (self, str file_path)
 Add a file to be watched for changes. More...
 
None removeWatchedFile (self, str file_path)
 Remove a file so that it will no longer be watched for changes. More...
 

Static Public Attributes

 rootChanged = Signal()
 
 sceneChanged = Signal()
 Signal that is emitted whenever something in the scene changes. More...
 

Detailed Description

Container object for the scene graph.

The main purpose of this class is to provide the root SceneNode.

Member Function Documentation

◆ acquireLock()

None UM.Scene.Scene.Scene.acquireLock (   self)

Acquire the global scene lock.

This will prevent any read or write actions on the scene from other threads, assuming those threads also properly acquire the lock. Most notably, this prevents the rendering thread from rendering the scene while it is changing. Deprecated, use getSceneLock() instead.

◆ addWatchedFile()

None UM.Scene.Scene.Scene.addWatchedFile (   self,
str  file_path 
)

Add a file to be watched for changes.

Parameters
file_pathThe path to the file that must be watched.

◆ findObject()

Optional["SceneNode"] UM.Scene.Scene.Scene.findObject (   self,
int  object_id 
)

Find an object by id.

Parameters
object_idThe id of the object to search for, as returned by the python id() method.
Returns
The object if found, or None if not.

◆ getActiveCamera()

Optional[Camera] UM.Scene.Scene.Scene.getActiveCamera (   self)

Get the camera that should be used for rendering.

◆ getRoot()

"SceneNode" UM.Scene.Scene.Scene.getRoot (   self)

Get the root node of the scene.

◆ getSceneLock()

threading.Lock UM.Scene.Scene.Scene.getSceneLock (   self)

Gets the global scene lock.

Use this lock to prevent any read or write actions on the scene from other threads, assuming those threads also properly acquire the lock. Most notably, this prevents the rendering thread from rendering the scene while it is changing.

◆ releaseLock()

None UM.Scene.Scene.Scene.releaseLock (   self)

Release the global scene lock.

Deprecated, use getSceneLock() instead.

◆ removeWatchedFile()

None UM.Scene.Scene.Scene.removeWatchedFile (   self,
str  file_path 
)

Remove a file so that it will no longer be watched for changes.

Parameters
file_pathThe path to the file that must no longer be watched.

◆ setActiveCamera()

None UM.Scene.Scene.Scene.setActiveCamera (   self,
str  name 
)

Set the camera that should be used for rendering.

Parameters
nameThe name of the camera to use.

Member Data Documentation

◆ sceneChanged

UM.Scene.Scene.Scene.sceneChanged = Signal()
static

Signal that is emitted whenever something in the scene changes.

Parameters
objectThe object that triggered the change.

The documentation for this class was generated from the following file: