Scene

Inheritance: java.lang.Object, com.aspose.threed.A3DObject, com.aspose.threed.SceneObject

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.

Constructors

ConstructorDescription
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, String name)Initializes a new instance of the Scene class as a sub-scene.
Scene(String fileName)Initializes a new instance of the Scene class and open the file immediately.

Fields

FieldDescription
VERSION

Methods

MethodDescription
clear()Clears the scene content and restores the default settings.
createAnimationClip(String name)A shorthand function to create and register the AnimationClip The first AnimationClip will be assigned to the getCurrentAnimationClip
equals(Object arg0)
findProperty(String propertyName)Finds the property.
fromFile(String fileName)Opens the scene from given path
fromFile(String fileName, Cancellation cancellationToken)Opens the scene from given path
fromFile(String fileName, FileFormat format)Opens the scene from given path using specified file format.
fromFile(String fileName, FileFormat format, Cancellation cancellationToken)Opens the scene from given path using specified file format.
fromFile(String fileName, LoadOptions options)Opens the scene from given path using specified file format.
fromFile(String fileName, LoadOptions options, Cancellation cancellationToken)Opens the scene from given path using specified file format.
fromStream(Stream stream)Opens the scene from given stream
fromStream(Stream stream, Cancellation cancellationToken)Opens the scene from given stream
fromStream(Stream stream, FileFormat format)Opens the scene from given stream using specified file format.
fromStream(Stream stream, FileFormat format, Cancellation cancellationToken)Opens the scene from given stream using specified file format.
fromStream(Stream stream, LoadOptions options)Opens the scene from given stream using specified IO config.
fromStream(Stream stream, LoadOptions options, Cancellation cancellationToken)Opens the scene from given stream using specified IO config.
getAnimationClip(String name)Gets a named AnimationClip
getAnimationClips()Gets all AnimationClip defined in the scene.
getAssetInfo()Gets the top-level asset information
getClass()
getCurrentAnimationClip()Gets the active AnimationClip
getLibrary()Objects that not directly used in scene hierarchy can be defined in Library.
getName()Gets the name.
getPoses()Gets all Pose used in this scene.
getProperties()Gets the collection of all properties.
getProperty(String property)Get the value of specified property
getRootNode()Gets the root node of the scene.
getScene()Gets the scene that this object belongs to
getSubScenes()Gets all sub-scenes
hashCode()
notify()
notifyAll()
open(Stream stream)Opens the scene from given stream
open(Stream stream, Cancellation cancellationToken)Opens the scene from given stream
open(Stream stream, FileFormat format)Opens the scene from given stream using specified file format.
open(Stream stream, FileFormat format, Cancellation cancellationToken)Opens the scene from given stream using specified file format.
open(Stream stream, LoadOptions options)Opens the scene from given stream using specified IO config.
open(Stream stream, LoadOptions options, Cancellation cancellationToken)Opens the scene from given stream using specified IO config.
open(String fileName)Opens the scene from given path
open(String fileName, Cancellation cancellationToken)Opens the scene from given path
open(String fileName, FileFormat format)Opens the scene from given path using specified file format.
open(String fileName, FileFormat format, Cancellation cancellationToken)Opens the scene from given path using specified file format.
open(String fileName, LoadOptions options)Opens the scene from given path using specified file format.
open(String fileName, LoadOptions options, Cancellation cancellationToken)Opens the scene from given path using specified file format.
removeProperty(Property property)Removes a dynamic property.
removeProperty(String property)Remove the specified property identified by name
render(Camera camera, BufferedImage bitmap)Render the scene into bitmap from given camera’s perspective.
render(Camera camera, BufferedImage bitmap, ImageRenderOptions options)Render the scene into bitmap from given camera’s perspective.
render(Camera camera, String fileName)Render the scene into external file from given camera’s perspective.
render(Camera camera, String fileName, Dimension size, String format)Render the scene into external file from given camera’s perspective.
render(Camera camera, String fileName, Dimension size, String format, ImageRenderOptions options)Render the scene into external file from given camera’s perspective.
save(Stream stream, FileFormat format)Saves the scene to stream using specified file format.
save(Stream stream, FileFormat format, Cancellation cancellationToken)Saves the scene to stream using specified file format.
save(Stream stream, SaveOptions options)Saves the scene to stream using specified file format.
save(Stream stream, SaveOptions options, Cancellation cancellationToken)Saves the scene to stream using specified file format.
save(String fileName)Saves the scene to specified path using specified file format.
save(String fileName, FileFormat format)Saves the scene to specified path using specified file format.
save(String fileName, FileFormat format, Cancellation cancellationToken)Saves the scene to specified path using specified file format.
save(String fileName, SaveOptions options)Saves the scene to specified path using specified file format.
save(String fileName, SaveOptions options, Cancellation cancellationToken)Saves the scene to specified path using specified file format.
setAssetInfo(AssetInfo value)Sets the top-level asset information
setCurrentAnimationClip(AnimationClip value)Sets the active AnimationClip
setName(String value)Sets the name.
setProperty(String property, Object value)Sets the value of specified property
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

Scene()

public Scene()

Initializes a new instance of the Scene class.

Scene(Entity entity)

public Scene(Entity entity)

Initializes a new instance of the Scene class with an entity attached to a new node.

Parameters:

ParameterTypeDescription
entityEntityThe initial entity that attached to the scene

Scene(Scene parentScene, String name)

public Scene(Scene parentScene, String name)

Initializes a new instance of the Scene class as a sub-scene.

Parameters:

ParameterTypeDescription
parentSceneSceneThe parent scene.
namejava.lang.StringScene’s name.

Scene(String fileName)

public Scene(String fileName)

Initializes a new instance of the Scene class and open the file immediately. This is an obsoleted constructor, please use Scene.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile’s name to open.

VERSION

public static final String VERSION

clear()

public void clear()

Clears the scene content and restores the default settings.

createAnimationClip(String name)

public AnimationClip createAnimationClip(String name)

A shorthand function to create and register the AnimationClip The first AnimationClip will be assigned to the getCurrentAnimationClip

Parameters:

ParameterTypeDescription
namejava.lang.StringAnimation clip’s name

Returns: AnimationClip

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

findProperty(String propertyName)

public Property findProperty(String propertyName)

Finds the property. It can be a dynamic property (Created by CreateDynamicProperty/SetProperty) or native property(Identified by its name)

Parameters:

ParameterTypeDescription
propertyNamejava.lang.StringProperty name.

Returns: Property - The property.

fromFile(String fileName)

public static Scene fromFile(String fileName)

Opens the scene from given path

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.

Returns: Scene

fromFile(String fileName, Cancellation cancellationToken)

public static Scene fromFile(String fileName, Cancellation cancellationToken)

Opens the scene from given path

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
cancellationTokenCancellationCancellation token to the load task

Returns: Scene

fromFile(String fileName, FileFormat format)

public static Scene fromFile(String fileName, FileFormat format)

Opens the scene from given path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
formatFileFormatFile format.

Returns: Scene

fromFile(String fileName, FileFormat format, Cancellation cancellationToken)

public static Scene fromFile(String fileName, FileFormat format, Cancellation cancellationToken)

Opens the scene from given path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
formatFileFormatFile format.
cancellationTokenCancellationCancellation token to the load task

Returns: Scene

fromFile(String fileName, LoadOptions options)

public static Scene fromFile(String fileName, LoadOptions options)

Opens the scene from given path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
optionsLoadOptionsMore detailed configuration to open the stream.

Returns: Scene

fromFile(String fileName, LoadOptions options, Cancellation cancellationToken)

public static Scene fromFile(String fileName, LoadOptions options, Cancellation cancellationToken)

Opens the scene from given path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
optionsLoadOptionsMore detailed configuration to open the stream.
cancellationTokenCancellationCancellation token to the load task

Returns: Scene

fromStream(Stream stream)

public static Scene fromStream(Stream stream)

Opens the scene from given stream

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.

Returns: Scene

fromStream(Stream stream, Cancellation cancellationToken)

public static Scene fromStream(Stream stream, Cancellation cancellationToken)

Opens the scene from given stream

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
cancellationTokenCancellationCancellation token to the load task

Returns: Scene

fromStream(Stream stream, FileFormat format)

public static Scene fromStream(Stream stream, FileFormat format)

Opens the scene from given stream using specified file format.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
formatFileFormatFile format.

Returns: Scene

fromStream(Stream stream, FileFormat format, Cancellation cancellationToken)

public static Scene fromStream(Stream stream, FileFormat format, Cancellation cancellationToken)

Opens the scene from given stream using specified file format.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
formatFileFormatFile format.
cancellationTokenCancellationCancellation token to the load task

Returns: Scene

fromStream(Stream stream, LoadOptions options)

public static Scene fromStream(Stream stream, LoadOptions options)

Opens the scene from given stream using specified IO config.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
optionsLoadOptionsMore detailed configuration to open the stream.

Returns: Scene

fromStream(Stream stream, LoadOptions options, Cancellation cancellationToken)

public static Scene fromStream(Stream stream, LoadOptions options, Cancellation cancellationToken)

Opens the scene from given stream using specified IO config.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
optionsLoadOptionsMore detailed configuration to open the stream.
cancellationTokenCancellationCancellation token to the load task

Returns: Scene

getAnimationClip(String name)

public AnimationClip getAnimationClip(String name)

Gets a named AnimationClip

Parameters:

ParameterTypeDescription
namejava.lang.StringThe AnimationClip’s name to look up

Returns: AnimationClip - Returned AnimationClip

getAnimationClips()

public List<AnimationClip> getAnimationClips()

Gets all AnimationClip defined in the scene.

Returns: java.util.List<com.aspose.threed.AnimationClip>

getAssetInfo()

public AssetInfo getAssetInfo()

Gets the top-level asset information

Returns: AssetInfo

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCurrentAnimationClip()

public AnimationClip getCurrentAnimationClip()

Gets the active AnimationClip

Returns: AnimationClip

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.

Returns: java.util.List<com.aspose.threed.A3DObject>

getName()

public String getName()

Gets the name.

Returns: java.lang.String

getPoses()

public Collection<Pose> getPoses()

Gets all Pose used in this scene.

Returns: java.util.Collection<com.aspose.threed.Pose>

getProperties()

public PropertyCollection getProperties()

Gets the collection of all properties.

Returns: PropertyCollection

getProperty(String property)

public Object getProperty(String property)

Get the value of specified property

Parameters:

ParameterTypeDescription
propertyjava.lang.StringProperty name

Returns: java.lang.Object - The value of the found property

getRootNode()

public Node getRootNode()

Gets the root node of the scene.

Returns: Node

getScene()

public Scene getScene()

Gets the scene that this object belongs to

Returns: Scene

getSubScenes()

public List<Scene> getSubScenes()

Gets all sub-scenes

Returns: java.util.List<com.aspose.threed.Scene>

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

open(Stream stream)

public void open(Stream stream)

Opens the scene from given stream

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.

open(Stream stream, Cancellation cancellationToken)

public void open(Stream stream, Cancellation cancellationToken)

Opens the scene from given stream

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
cancellationTokenCancellationCancellation token to the load task

open(Stream stream, FileFormat format)

public void open(Stream stream, FileFormat format)

Opens the scene from given stream using specified file format.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
formatFileFormatFile format.

open(Stream stream, FileFormat format, Cancellation cancellationToken)

public void open(Stream stream, FileFormat format, Cancellation cancellationToken)

Opens the scene from given stream using specified file format.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
formatFileFormatFile format.
cancellationTokenCancellationCancellation token to the load task

open(Stream stream, LoadOptions options)

public void open(Stream stream, LoadOptions options)

Opens the scene from given stream using specified IO config.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
optionsLoadOptionsMore detailed configuration to open the stream.

open(Stream stream, LoadOptions options, Cancellation cancellationToken)

public void open(Stream stream, LoadOptions options, Cancellation cancellationToken)

Opens the scene from given stream using specified IO config.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
optionsLoadOptionsMore detailed configuration to open the stream.
cancellationTokenCancellationCancellation token to the load task

open(String fileName)

public void open(String fileName)

Opens the scene from given path

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.

open(String fileName, Cancellation cancellationToken)

public void open(String fileName, Cancellation cancellationToken)

Opens the scene from given path

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
cancellationTokenCancellationCancellation token to the load task

open(String fileName, FileFormat format)

public void open(String fileName, FileFormat format)

Opens the scene from given path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
formatFileFormatFile format.

open(String fileName, FileFormat format, Cancellation cancellationToken)

public void open(String fileName, FileFormat format, Cancellation cancellationToken)

Opens the scene from given path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
formatFileFormatFile format.
cancellationTokenCancellationCancellation token to the load task

open(String fileName, LoadOptions options)

public void open(String fileName, LoadOptions options)

Opens the scene from given path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
optionsLoadOptionsMore detailed configuration to open the stream.

open(String fileName, LoadOptions options, Cancellation cancellationToken)

public void open(String fileName, LoadOptions options, Cancellation cancellationToken)

Opens the scene from given path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
optionsLoadOptionsMore detailed configuration to open the stream.
cancellationTokenCancellationCancellation token to the load task

removeProperty(Property property)

public boolean removeProperty(Property property)

Removes a dynamic property.

Parameters:

ParameterTypeDescription
propertyPropertyWhich property to remove

Returns: boolean - true if the property is successfully removed

removeProperty(String property)

public boolean removeProperty(String property)

Remove the specified property identified by name

Parameters:

ParameterTypeDescription
propertyjava.lang.String

Returns: boolean

render(Camera camera, BufferedImage bitmap)

public void render(Camera camera, BufferedImage bitmap)

Render the scene into bitmap from given camera’s perspective.

Parameters:

ParameterTypeDescription
cameraCameraFrom which camera’s perspective to render the scene
bitmapjava.awt.image.BufferedImageTarget of the rendered result

render(Camera camera, BufferedImage bitmap, ImageRenderOptions options)

public void render(Camera camera, BufferedImage bitmap, ImageRenderOptions options)

Render the scene into bitmap from given camera’s perspective.

Parameters:

ParameterTypeDescription
cameraCameraFrom which camera’s perspective to render the scene
bitmapjava.awt.image.BufferedImageTarget of the rendered result
optionsImageRenderOptionsThe option to customize some internal settings.

render(Camera camera, String fileName)

public void render(Camera camera, String fileName)

Render the scene into external file from given camera’s perspective. The default output size is 1024x768 and output format is png

Parameters:

ParameterTypeDescription
cameraCameraFrom which camera’s perspective to render the scene
fileNamejava.lang.StringThe file name of output file

render(Camera camera, String fileName, Dimension size, String format)

public void render(Camera camera, String fileName, Dimension size, String format)

Render the scene into external file from given camera’s perspective.

Parameters:

ParameterTypeDescription
cameraCameraFrom which camera’s perspective to render the scene
fileNamejava.lang.StringThe file name of output file
sizejava.awt.DimensionThe size of final rendered image
formatjava.lang.StringThe image format of the output file

render(Camera camera, String fileName, Dimension size, String format, ImageRenderOptions options)

public void render(Camera camera, String fileName, Dimension size, String format, ImageRenderOptions options)

Render the scene into external file from given camera’s perspective.

Parameters:

ParameterTypeDescription
cameraCameraFrom which camera’s perspective to render the scene
fileNamejava.lang.StringThe file name of output file
sizejava.awt.DimensionThe size of final rendered image
formatjava.lang.StringThe image format of the output file
optionsImageRenderOptionsThe option to customize some internal settings.

save(Stream stream, FileFormat format)

public void save(Stream stream, FileFormat format)

Saves the scene to stream using specified file format.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
formatFileFormatFormat.

save(Stream stream, FileFormat format, Cancellation cancellationToken)

public void save(Stream stream, FileFormat format, Cancellation cancellationToken)

Saves the scene to stream using specified file format.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
formatFileFormatFormat.
cancellationTokenCancellationCancellation token to the save task

save(Stream stream, SaveOptions options)

public void save(Stream stream, SaveOptions options)

Saves the scene to stream using specified file format.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
optionsSaveOptionsMore detailed configuration to save the stream.

save(Stream stream, SaveOptions options, Cancellation cancellationToken)

public void save(Stream stream, SaveOptions options, Cancellation cancellationToken)

Saves the scene to stream using specified file format.

Parameters:

ParameterTypeDescription
streamcom.aspose.csporter.helpers.StreamInput stream, user is responsible for closing the stream.
optionsSaveOptionsMore detailed configuration to save the stream.
cancellationTokenCancellationCancellation token to the save task

save(String fileName)

public void save(String fileName)

Saves the scene to specified path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.

save(String fileName, FileFormat format)

public void save(String fileName, FileFormat format)

Saves the scene to specified path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
formatFileFormatFormat.

save(String fileName, FileFormat format, Cancellation cancellationToken)

public void save(String fileName, FileFormat format, Cancellation cancellationToken)

Saves the scene to specified path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
formatFileFormatFormat.
cancellationTokenCancellationCancellation token to the save task

save(String fileName, SaveOptions options)

public void save(String fileName, SaveOptions options)

Saves the scene to specified path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
optionsSaveOptionsMore detailed configuration to save the stream.

save(String fileName, SaveOptions options, Cancellation cancellationToken)

public void save(String fileName, SaveOptions options, Cancellation cancellationToken)

Saves the scene to specified path using specified file format.

Parameters:

ParameterTypeDescription
fileNamejava.lang.StringFile name.
optionsSaveOptionsMore detailed configuration to save the stream.
cancellationTokenCancellationCancellation token to the save task

setAssetInfo(AssetInfo value)

public void setAssetInfo(AssetInfo value)

Sets the top-level asset information

Parameters:

ParameterTypeDescription
valueAssetInfoNew value

setCurrentAnimationClip(AnimationClip value)

public void setCurrentAnimationClip(AnimationClip value)

Sets the active AnimationClip

Parameters:

ParameterTypeDescription
valueAnimationClipNew value

setName(String value)

public void setName(String value)

Sets the name.

Parameters:

ParameterTypeDescription
valuejava.lang.StringNew value

setProperty(String property, Object value)

public void setProperty(String property, Object value)

Sets the value of specified property

Parameters:

ParameterTypeDescription
propertyjava.lang.StringProperty name
valuejava.lang.ObjectThe value of the property

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int