# 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.

# Methods

Method Description
AddCustomField Adds a custom data field. To be able to add a field, it must have a name that does not conflict with the existing custom fields.
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.
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.
GetCustomField Adds/Removes/Gets a custom data field.
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. Include SceneMesh, SceneNode, SceneCamera and excludes ScenePoint, ScenePlane, SceneLodGroup. When using GetRadius in LOD transition calculations set global setting IgnoreCameraInExtentsCalculation to true. As processors use bounds of the geometry rather than the scene.
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.
IsNull Returns true if the Scene object is invalid.
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.
RemoveCustomField Removes a custom data field.
RemoveSceneNodes Removes all scene nodes.
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

Method Description
IsClassA Returns true if the class is a or is a descendant of the class named as the type parameter.
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.

# Methods details

# AddCustomField

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

    # 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.

        # 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.

                          # GetCustomField

                          Adds/Removes/Gets a custom data field.

                            # 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. Include SceneMesh, SceneNode, SceneCamera and excludes ScenePoint, ScenePlane, SceneLodGroup. When using GetRadius in LOD transition calculations set global setting IgnoreCameraInExtentsCalculation to true. As processors use bounds of the geometry rather than the scene.

                                            # 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.

                                                            # IsNull

                                                            Returns true if the Scene object is invalid.

                                                              # 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.

                                                                      # RemoveCustomField

                                                                      Removes a custom data field.

                                                                        # RemoveSceneNodes

                                                                        Removes all scene nodes.

                                                                          # 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.

                                                                                        # 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.