com.aspose.threed

Interfaces

Classes

Enums

Exceptions

com.aspose.threed

Class Scene



  • public class Scene
    extends SceneObject
    A scene is a top-level object that contains the nodes, geometries, materials, textures, animation, poses, sub-scenes and etc. 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.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String VERSION 
    • Constructor Summary

      Constructors 
      Constructor and Description
      Scene()
      Initializes a new instance of the Scene class.
      Scene(Entity entity)
      Initializes a new instance of the Scene class with an entity attached to a new node.
      Scene(Scene parentScene, java.lang.String name)
      Initializes a new instance of the Scene class as a sub-scene.
      Scene(java.lang.String fileName)
      Initializes a new instance of the Scene class and open the file immediately.
    • Constructor Detail

      • Scene

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

        public Scene(Entity entity)
        Initializes a new instance of the Scene class with an entity attached to a new node.
        Parameters:
        entity - The initial entity that attached to the scene
      • Scene

        public Scene(Scene parentScene,
                     java.lang.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(java.lang.String fileName)
              throws java.io.IOException
        Initializes a new instance of the Scene class and open the file immediately.
        Parameters:
        fileName - File's name to open.
        Throws:
        java.io.IOException
    • Method Detail

      • getSubScenes

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

        public java.util.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
      • getAnimationClip

        public AnimationClip getAnimationClip(java.lang.String name)
        Gets a named AnimationClip
        Parameters:
        name - The AnimationClip's name to look up
        Returns:
        Returned AnimationClip
      • 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
      • getPoses

        public java.util.Collection<Pose> getPoses()
        Gets all Pose used in this scene.
      • getRootNode

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

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

        protected void reloadSceneAs(FileFormat fmt)
                              throws java.io.IOException
        Reload the scene in specified format
        Parameters:
        fmt -
        Throws:
        java.io.IOException
      • open

        public void open(com.aspose.threed.Stream stream,
                         FileFormat format,
                         Cancellation cancellationToken)
                  throws java.io.IOException
        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:
        java.io.IOException
      • open

        public void open(com.aspose.threed.Stream stream,
                         FileFormat format)
                  throws java.io.IOException
        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:
        java.io.IOException
      • open

        public void open(com.aspose.threed.Stream stream,
                         LoadOptions options,
                         Cancellation cancellationToken)
                  throws java.io.IOException
        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:
        java.io.IOException
      • open

        public void open(com.aspose.threed.Stream stream,
                         LoadOptions options)
                  throws java.io.IOException
        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:
        java.io.IOException
      • open

        public void open(com.aspose.threed.Stream stream,
                         Cancellation cancellationToken)
                  throws java.io.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:
        java.io.IOException
      • open

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

        public void open(java.lang.String fileName,
                         FileFormat format,
                         Cancellation cancellationToken)
                  throws java.io.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:
        java.io.IOException
      • open

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

        public void open(java.lang.String fileName,
                         LoadOptions options,
                         Cancellation cancellationToken)
                  throws java.io.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:
        java.io.IOException
      • open

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

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

        public void open(java.lang.String fileName)
                  throws java.io.IOException
        Opens the scene from given path
        Parameters:
        fileName - File name.
        Throws:
        java.io.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(java.lang.String fileName,
                         FileFormat format,
                         Cancellation cancellationToken)
                  throws java.io.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:
        java.io.IOException
      • save

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

        public void save(java.lang.String fileName,
                         SaveOptions options,
                         Cancellation cancellationToken)
                  throws java.io.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:
        java.io.IOException
      • save

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

        public void render(Camera camera,
                           java.lang.String fileName)
                    throws java.io.IOException
        Render the scene into external file from given camera's perspective. The default output size is 1024x768 and output format is png
        Parameters:
        camera - From which camera's perspective to render the scene
        fileName - The file name of output file
        Throws:
        java.io.IOException
      • render

        public void render(Camera camera,
                           java.lang.String fileName,
                           java.awt.Dimension size,
                           java.lang.String format)
                    throws java.io.IOException
        Render the scene into external file from given camera's perspective.
        Parameters:
        camera - From which camera's perspective to render the scene
        fileName - The file name of output file
        size - The size of final rendered image
        format - The image format of the output file
        Throws:
        java.io.IOException
      • render

        public void render(Camera camera,
                           java.lang.String fileName,
                           java.awt.Dimension size,
                           java.lang.String format,
                           ImageRenderOptions options)
                    throws java.io.IOException
        Render the scene into external file from given camera's perspective.
        Parameters:
        camera - From which camera's perspective to render the scene
        fileName - The file name of output file
        size - The size of final rendered image
        format - The image format of the output file
        options - The option to customize some internal settings.
        Throws:
        java.io.IOException
      • render

        public void render(Camera camera,
                           java.awt.image.BufferedImage bitmap)
                    throws java.io.IOException
        Render the scene into bitmap from given camera's perspective.
        Parameters:
        camera - From which camera's perspective to render the scene
        bitmap - Target of the rendered result
        Throws:
        java.io.IOException
      • render

        public void render(Camera camera,
                           java.awt.image.BufferedImage bitmap,
                           ImageRenderOptions options)
                    throws java.io.IOException
        Render the scene into bitmap from given camera's perspective.
        Parameters:
        camera - From which camera's perspective to render the scene
        bitmap - Target of the rendered result
        options - The option to customize some internal settings.
        Throws:
        java.io.IOException