com.aspose.threed

Interfaces

Classes

Enums

Exceptions

com.aspose.threed

Class Scene



  • public class Scene
    extends A3DObject
    A scene is a top-level object that contains the nodes, geometries, materials, textures, animation, poses, sub-scenes and etcs. Scene can have sub-scenes, acts as multiple-document support in files like collada/blender/fbx Node hierarchy can be accessed through getRootNode() getLibrary() is used to keep a reference of unattached objects during serialization(like meta data or custom objects) so it can be used as a library.
    • Constructor Detail

      • Scene

        public Scene()
        Initializes a new instance of the Scene class.
      • Scene

        public Scene(Scene parentScene,
                     String name)
        Initializes a new instance of the Scene class as a sub-scene.
        Parameters:
        parentScene - The parent scene.
        name - Scene's name.
      • Scene

        public Scene(String fileName)
              throws IOException
        Initializes a new instance of the Scene class and open the file immediately.
        Parameters:
        fileName - File's name to open.
        Throws:
        IOException
    • Method Detail

      • getSubScenes

        public List<Scene> getSubScenes()
        Gets all sub-scenes
      • getLibrary

        public List<A3DObject> getLibrary()
        Objects that not directly used in scene hierarchy can be defined in Library. This is useful when you're using sub-scenes and put reusable components under sub-scenes.
      • setCurrentAnimationClip

        public void setCurrentAnimationClip(AnimationClip value)
        Sets the active AnimationClip
        Parameters:
        value - New value
      • getAssetInfo

        public AssetInfo getAssetInfo()
        Gets the top-level asset information
      • setAssetInfo

        public void setAssetInfo(AssetInfo value)
        Sets the top-level asset information
        Parameters:
        value - New value
      • getRootNode

        public Node getRootNode()
        Gets the root node of the scene.
      • clear

        public void clear()
        Clears the scene content and restores the default settings.
      • open

        public void open(com.aspose.threed.Stream stream,
                         FileFormat format,
                         Cancellation cancellationToken)
                  throws ImportException
        Opens the scene from given stream using specified file format.
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        format - File format.
        cancellationToken - Cancellation token to the load task
        Throws:
        ImportException
      • open

        public void open(com.aspose.threed.Stream stream,
                         FileFormat format)
                  throws ImportException
        Opens the scene from given stream using specified file format.
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        format - File format.
        Throws:
        ImportException
      • open

        public void open(com.aspose.threed.Stream stream,
                         LoadOptions options,
                         Cancellation cancellationToken)
                  throws ImportException
        Opens the scene from given stream using specified IO config.
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        options - More detailed configuration to open the stream.
        cancellationToken - Cancellation token to the load task
        Throws:
        ImportException
      • open

        public void open(com.aspose.threed.Stream stream,
                         LoadOptions options)
                  throws ImportException
        Opens the scene from given stream using specified IO config.
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        options - More detailed configuration to open the stream.
        Throws:
        ImportException
      • open

        public void open(com.aspose.threed.Stream stream,
                         Cancellation cancellationToken)
                  throws IOException
        Opens the scene from given stream
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        cancellationToken - Cancellation token to the load task
        Throws:
        IOException
      • open

        public void open(com.aspose.threed.Stream stream)
                  throws IOException
        Opens the scene from given stream
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        Throws:
        IOException
      • open

        public void open(String fileName,
                         FileFormat format,
                         Cancellation cancellationToken)
                  throws IOException
        Opens the scene from given path using specified file format.
        Parameters:
        fileName - File name.
        format - File format.
        cancellationToken - Cancellation token to the load task
        Throws:
        IOException
      • open

        public void open(String fileName,
                         FileFormat format)
                  throws IOException
        Opens the scene from given path using specified file format.
        Parameters:
        fileName - File name.
        format - File format.
        Throws:
        IOException
      • open

        public void open(String fileName,
                         LoadOptions options,
                         Cancellation cancellationToken)
                  throws IOException
        Opens the scene from given path using specified file format.
        Parameters:
        fileName - File name.
        options - More detailed configuration to open the stream.
        cancellationToken - Cancellation token to the load task
        Throws:
        IOException
      • open

        public void open(String fileName,
                         LoadOptions options)
                  throws IOException
        Opens the scene from given path using specified file format.
        Parameters:
        fileName - File name.
        options - More detailed configuration to open the stream.
        Throws:
        IOException
      • open

        public void open(String fileName,
                         Cancellation cancellationToken)
                  throws IOException
        Opens the scene from given path
        Parameters:
        fileName - File name.
        cancellationToken - Cancellation token to the load task
        Throws:
        IOException
      • open

        public void open(String fileName)
                  throws IOException
        Opens the scene from given path
        Parameters:
        fileName - File name.
        Throws:
        IOException
      • save

        public void save(com.aspose.threed.Stream stream,
                         FileFormat format,
                         Cancellation cancellationToken)
                  throws ExportException
        Saves the scene to stream using specified file format.
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        format - Format.
        cancellationToken - Cancellation token to the save task
        Throws:
        ExportException
      • save

        public void save(com.aspose.threed.Stream stream,
                         FileFormat format)
                  throws ExportException
        Saves the scene to stream using specified file format.
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        format - Format.
        Throws:
        ExportException
      • save

        public void save(com.aspose.threed.Stream stream,
                         SaveOptions options,
                         Cancellation cancellationToken)
                  throws ExportException
        Saves the scene to stream using specified file format.
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        options - More detailed configuration to save the stream.
        cancellationToken - Cancellation token to the save task
        Throws:
        ExportException
      • save

        public void save(com.aspose.threed.Stream stream,
                         SaveOptions options)
                  throws ExportException
        Saves the scene to stream using specified file format.
        Parameters:
        stream - Input stream, user is responsible for closing the stream.
        options - More detailed configuration to save the stream.
        Throws:
        ExportException
      • save

        public void save(String fileName,
                         FileFormat format,
                         Cancellation cancellationToken)
                  throws IOException
        Saves the scene to specified path using specified file format.
        Parameters:
        fileName - File name.
        format - Format.
        cancellationToken - Cancellation token to the save task
        Throws:
        IOException
      • save

        public void save(String fileName,
                         FileFormat format)
                  throws IOException
        Saves the scene to specified path using specified file format.
        Parameters:
        fileName - File name.
        format - Format.
        Throws:
        IOException
      • save

        public void save(String fileName,
                         SaveOptions options,
                         Cancellation cancellationToken)
                  throws IOException
        Saves the scene to specified path using specified file format.
        Parameters:
        fileName - File name.
        options - More detailed configuration to save the stream.
        cancellationToken - Cancellation token to the save task
        Throws:
        IOException
      • save

        public void save(String fileName,
                         SaveOptions options)
                  throws IOException
        Saves the scene to specified path using specified file format.
        Parameters:
        fileName - File name.
        options - More detailed configuration to save the stream.
        Throws:
        IOException