class documentation
Represents a scene graph which contains a hierarchy of 3D objects.
Example usage:
import fiftyone as fo scene = fo.Scene() obj_mesh = fo.ObjMesh( "obj_mesh_name", "/path/to/mesh.obj", mtl_path="/path/to/mesh.mtl" ) gltf_mesh = fo.GltfMesh("gltf_mesh_name", "/path/to/mesh.gltf") pcd = fo.PointCloud("pcd_name", "/path/to/points.pcd") scene.add(obj_mesh) scene.add(gltf_mesh) scene.add(pcd) scene.write("/path/to/scene.fo3d") sample = fo.Sample("/path/to/scene.fo3d") dataset = fo.Dataset() dataset.add_sample(sample)
Parameters | |
camera | the default camera of the scene. If None, a default
fiftyone.core.threed.PerspectiveCamera is created with
reasonable defaults |
lights | a list of lights in the scene. If``None``, a default set of lights is used, which includes an ambient light and six directional lights placed at different angles around the scene |
background | the background for the scene. May be a color, image, or a skybox |
Static Method | from |
Loads a scene from an FO3D file. |
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | copy |
Returns a deep copy of the scene. |
Method | get |
Returns a list of all asset paths in the scene. |
Method | get |
Returns a summary of the scene. |
Method | traverse |
Traverse the scene graph. |
Method | update |
Update asset paths in this scene according to an input dict mapping. |
Method | write |
Export the scene to a .fo3d file. |
Instance Variable | background |
Undocumented |
Instance Variable | camera |
Undocumented |
Instance Variable | lights |
Undocumented |
Static Method | _from |
Undocumented |
Method | _resolve |
Undocumented |
Method | _resolve |
Undocumented |
Method | _to |
Returns the extra data to include in the dict representation. |
Inherited from Object3D
:
Method | __eq__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | add |
Add one or more objects as children of this one. |
Method | as |
Converts the object to a dict. |
Method | clear |
Remove all children from this object. |
Method | local |
Undocumented |
Method | position |
Undocumented |
Method | quaternion |
Undocumented |
Method | rotation |
Undocumented |
Method | scale |
Undocumented |
Instance Variable | children |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | visible |
Undocumented |
Property | local |
The local transform matrix of the object. |
Property | position |
The position of the object in object space. |
Property | quaternion |
The quaternion of the object in object space. |
Property | rotation |
The rotation of the object in object space. |
Property | scale |
The scale of the object in object space. |
Property | uuid |
The unique ID of the object. |
Static Method | _from |
Creates an Object3D (or its subclass) from a dict. |
Method | _get |
Get asset paths for this node |
Method | _update |
Undocumented |
Class Variable | _asset |
Undocumented |
Instance Variable | _local |
Undocumented |
Instance Variable | _position |
Undocumented |
Instance Variable | _quaternion |
Undocumented |
Instance Variable | _rotation |
Undocumented |
Instance Variable | _scale |
Undocumented |
Instance Variable | _uuid |
Undocumented |
def __init__(self, camera:
PerspectiveCamera | None
= None, lights: list[ Light] | None
= None, background: SceneBackground | None
= None):
(source)
¶
Undocumented
Returns a list of all asset paths in the scene.
Note that any relative asset paths are not resolved to absolute paths.
Returns | |
a list of asset paths |
Traverse the scene graph.
Parameters | |
include | whether to include the current node in the traversal |
Returns | |
a generator that yields Object3D instances |
Update asset paths in this scene according to an input dict mapping.
Asset path is unchanged if it does not exist in asset_rewrite_paths
Parameters | |
assetdict | dict mapping asset path to new asset path |
Returns | |
True if the scene was modified. |
Export the scene to a .fo3d file.
Parameters | |
fo3dstr | the path to write the scene to |
resolve | whether to resolve relative paths in the scene to absolute paths. If True, all asset paths in the scene are resolved to absolute paths. If False, asset paths are left as-is. Defaults to False. |
pprint | whether to pretty-print the JSON output. Defaults to False. |