Skip to content
On this page

class Scene

Scene is the main keeper of a scene and scene graph in simplygon. The scene is self-contained, with materials, textures, etc. to describe a full scene.

Properties

PropertyDescription
NameThe name of the Scene object. (Inherited from Object)

Methods

MethodDescription
AddCustomFieldAdds a custom data array field. To be able to add a field, it must have a name that does not conflict with the existing custom fields.
AddObserverAdds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
AppendAppends another scene to this scene. All materials, textures etc.
CalculateExtentsCalculates the axis-aligned bounding box of the whole scene. If the node tree contains no geometric data, or all data is hidden, the bounding box is not calculated, and the method returns false.
CalculateExtentsOfSelectionSetCalculate extents of all nodes in a specified selection set.
CalculateExtentsOfSelectionSetIdCalculate extents of all nodes in a specified selection set. The selection set must reside in the selection set table, at the specified id.
CalculateExtentsOfSelectionSetNameCalculate extents of all nodes in a specified selection set. The selection set must reside in the selection set table, named the specific name.
ClearClears the whole scene and releases all items in the graph.
CompactWill remove mesh nodes that consist of empty geometry. The node transformation will be added to all child transformations. If the root node is a sceneMesh with empty geometry, it will be replaced with a generic sceneNode having the same transformation.
CreateAABBReturns a scene containing the axis aligned bounding boxes of either the entire scene or per mesh in the scene.
DeepCopyDeep copies the source scene, and all things assigned to it, including all nodes, geometry data, materials and tables.
EvaluateDefaultGlobalTransformationEvaluates the global transformation of the specified node at a specific time. EvaluateDefaultGlobalTransformation is used to evaluate the default transformation, regardless of node animation.
GetBoneTableThe bone table of the scene.
GetCascadedSceneCountGet the number of cascaded child scenes.
GetCascadedSceneForIndexGet the scene for the given cascaded child scene index, which must be less than the number of cascaded child scenes.
GetClassGet the name of the Scene class. (Inherited from Object)
GetCustomFieldAdds/Removes/Gets a custom data field.
GetCustomFieldMaxDeviationGets the custom data field 'MaxDeviation'. This is a RealArray with size 1 that is populated automatically after running the scene in a processor object, and contains the max geometric deviation produced by the reduction or remeshing. This can be used to calculate LOD switch distances.
GetCustomFieldProcessedMeshesExtentsGets the custom data field 'ProcessedMeshesExtents'. This Extents object is populated automatically after running the scene in a processor object, and contains size information about the geometry data that was processed. This should be used to calculate LOD switch distances rather than Scene::GetRadius, since using Scene::GetRadius will also include other components like cameras that should not be taken into account.
GetInfThe inferior (minimum) extent of the scene.
GetMappingImageThe MappingImage object for the scene.
GetMaterialChannelsGet all unique material channel names for all materials used in scene.
GetMaterialChannelsWithTextureInputsGet all unique material channel names having texture inputs for all materials used in scene.
GetMaterialTableThe material table of the scene.
GetNodeByGUIDGets a node defined by an id.
GetNodeFromPathGets a node defined by a path. Please note that the path must contain names for each level to be able to find the specified node.
GetRadiusThe scene radius.
GetRootNodeThe root node of the scene.
GetSelectionSetTableThe selection set table of the scene.
GetSubNodeByGUIDGets a node defined by an id from the specified node tree.
GetSupThe superior (maximum) extent of the scene.
GetTextureTableThe texture table of the scene.
GetTriangleCountTraverses the scene meshes in the scene and returns the total triangle count.
HasCustomFieldChecks if a custom field is present in the scene.
IsAReturns true if Scene is a or is a descendant of the class named as the type parameter. (Inherited from Object)
IsNullReturns true if the Scene object is invalid. (Inherited from Object)
IsSameObjectAsReturns true if the Scene object is valid. (Inherited from Object)
LoadFromFileLoads a scene from file.
NewCombinedGeometryCombines all the geometries from the scene and returns a copy.
NewCombinedGeometryFromSelectionSetCombines all the geometries from the selection set and returns a copy. If the selection set ID is -1, then all the geometries will be copied.
NewCopyCreates a new deep copy of the scene, and all things assigned to it, including all nodes, geometry data, materials and tables.
NonNullReturns true if the Scene object is valid. (Inherited from Object)
PrintInfoPrints the content/info of the Scene object to the log. (Inherited from Object)
RemoveCustomFieldRemoves a custom data field.
RemoveObserverRemoves a previously added observer object. (Inherited from Object)
RemoveSceneNodesRemoves all scene nodes and clear all tables where nodes are referenced (e.g BoneTable, SelectionSetTable)
RemoveSceneNodesInSelectionSetRemoves all scene nodes listed in a selection set.
RemoveSceneNodesOfTypeRemoves all scene nodes of a specific type.
RemoveUnlinkedBonesRemoves all bones in the scene that are not linked by any SceneMesh geometry data. Note that the removal only removes leaf nodes in the scene.
SaveToFileSaves a scene to file.
SelectNodesSelects all nodes of the type specified in the parameter and returns the selection set ID. If no types were found, it returns -1.
StandardizeMaterialsClears all previous data in both the material and texture tables and creates new, empty materials for every material id referenced by the MaterialIds field in the scenes geometrydata objects. Useful for cleaning up scenes containing invalid material references and making them exportable when you are primarily interested in the geometry and not the materials.

Static methods

MethodDescription
IsClassAReturns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
SafeCastSafeCast makes sure the input object is of a class that can be cast into spScene, and if this is the case, returns the object cast into spScene. (Inherited from Object)

Properties details

Name

The name of the Scene object. (Inherited from Object)

Methods details

AddCustomField

Adds a custom data array field. To be able to add a field, it must have a name that does not conflict with the existing custom fields.

AddObserver

Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)

Append

Appends another scene to this scene. All materials, textures etc.

CalculateExtents

Calculates the axis-aligned bounding box of the whole scene. If the node tree contains no geometric data, or all data is hidden, the bounding box is not calculated, and the method returns false.

CalculateExtentsOfSelectionSet

Calculate extents of all nodes in a specified selection set.

CalculateExtentsOfSelectionSetId

Calculate extents of all nodes in a specified selection set. The selection set must reside in the selection set table, at the specified id.

CalculateExtentsOfSelectionSetName

Calculate extents of all nodes in a specified selection set. The selection set must reside in the selection set table, named the specific name.

Clear

Clears the whole scene and releases all items in the graph.

Compact

Will remove mesh nodes that consist of empty geometry. The node transformation will be added to all child transformations. If the root node is a sceneMesh with empty geometry, it will be replaced with a generic sceneNode having the same transformation.

CreateAABB

Returns a scene containing the axis aligned bounding boxes of either the entire scene or per mesh in the scene.

DeepCopy

Deep copies the source scene, and all things assigned to it, including all nodes, geometry data, materials and tables.

EvaluateDefaultGlobalTransformation

Evaluates the global transformation of the specified node at a specific time. EvaluateDefaultGlobalTransformation is used to evaluate the default transformation, regardless of node animation.

GetBoneTable

The bone table of the scene.

GetCascadedSceneCount

Get the number of cascaded child scenes.

GetCascadedSceneForIndex

Get the scene for the given cascaded child scene index, which must be less than the number of cascaded child scenes.

GetClass

Get the name of the Scene class. (Inherited from Object)

GetCustomField

Adds/Removes/Gets a custom data field.

GetCustomFieldMaxDeviation

Gets the custom data field 'MaxDeviation'. This is a RealArray with size 1 that is populated automatically after running the scene in a processor object, and contains the max geometric deviation produced by the reduction or remeshing. This can be used to calculate LOD switch distances.

GetCustomFieldProcessedMeshesExtents

Gets the custom data field 'ProcessedMeshesExtents'. This Extents object is populated automatically after running the scene in a processor object, and contains size information about the geometry data that was processed. This should be used to calculate LOD switch distances rather than Scene::GetRadius, since using Scene::GetRadius will also include other components like cameras that should not be taken into account.

GetInf

The inferior (minimum) extent of the scene.

GetMappingImage

The MappingImage object for the scene.

GetMaterialChannels

Get all unique material channel names for all materials used in scene.

GetMaterialChannelsWithTextureInputs

Get all unique material channel names having texture inputs for all materials used in scene.

GetMaterialTable

The material table of the scene.

GetNodeByGUID

Gets a node defined by an id.

GetNodeFromPath

Gets a node defined by a path. Please note that the path must contain names for each level to be able to find the specified node.

GetRadius

The scene radius.

GetRootNode

The root node of the scene.

GetSelectionSetTable

The selection set table of the scene.

GetSubNodeByGUID

Gets a node defined by an id from the specified node tree.

GetSup

The superior (maximum) extent of the scene.

GetTextureTable

The texture table of the scene.

GetTriangleCount

Traverses the scene meshes in the scene and returns the total triangle count.

HasCustomField

Checks if a custom field is present in the scene.

IsA

Returns true if Scene is a or is a descendant of the class named as the type parameter. (Inherited from Object)

IsNull

Returns true if the Scene object is invalid. (Inherited from Object)

IsSameObjectAs

Returns true if the Scene object is valid. (Inherited from Object)

LoadFromFile

Loads a scene from file.

NewCombinedGeometry

Combines all the geometries from the scene and returns a copy.

NewCombinedGeometryFromSelectionSet

Combines all the geometries from the selection set and returns a copy. If the selection set ID is -1, then all the geometries will be copied.

NewCopy

Creates a new deep copy of the scene, and all things assigned to it, including all nodes, geometry data, materials and tables.

NonNull

Returns true if the Scene object is valid. (Inherited from Object)

PrintInfo

Prints the content/info of the Scene object to the log. (Inherited from Object)

RemoveCustomField

Removes a custom data field.

RemoveObserver

Removes a previously added observer object. (Inherited from Object)

RemoveSceneNodes

Removes all scene nodes and clear all tables where nodes are referenced (e.g BoneTable, SelectionSetTable)

RemoveSceneNodesInSelectionSet

Removes all scene nodes listed in a selection set.

RemoveSceneNodesOfType

Removes all scene nodes of a specific type.

RemoveUnlinkedBones

Removes all bones in the scene that are not linked by any SceneMesh geometry data. Note that the removal only removes leaf nodes in the scene.

SaveToFile

Saves a scene to file.

SelectNodes

Selects all nodes of the type specified in the parameter and returns the selection set ID. If no types were found, it returns -1.

StandardizeMaterials

Clears all previous data in both the material and texture tables and creates new, empty materials for every material id referenced by the MaterialIds field in the scenes geometrydata objects. Useful for cleaning up scenes containing invalid material references and making them exportable when you are primarily interested in the geometry and not the materials.

Static methods details

IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)

SafeCast

SafeCast makes sure the input object is of a class that can be cast into spScene, and if this is the case, returns the object cast into spScene. (Inherited from Object)