scene
¶
Module Contents¶
Classes¶
Camera |
|
Create a collection of name/value pairs. |
|
Light |
|
A single mesh instance in a scene |
|
A 3D scene |
|
Mesh and material index of a node |
|
Simple scene container for instanced meshes |
|
Texture |
|
Functions¶
|
Compute the global transform associated with a node. |
|
Converts a single mesh into a simple scene with a single identity instance of the input mesh. |
|
Converts a list of meshes into a simple scene with a single identity instance of each input mesh. |
|
Converts a scene into a concatenated mesh with all the transforms applied. |
- class scene.Animation¶
- property extensions: Extensions¶
- Return type:
- property name: str¶
- Return type:
str
- __repr__()¶
Return repr(self).
- Return type:
str
- class scene.AnimationList¶
- class scene.AnimationList(arg)
- class scene.AnimationList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __getitem__(arg: int, /) Animation ¶
- __getitem__(arg: slice, /) AnimationList
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0: int, arg1: Animation, /) None ¶
- __setitem__(arg0: slice, arg1: AnimationList, /) None
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (AnimationList)
- Return type:
None
- class scene.BufferList¶
- class scene.BufferList(arg)
- class scene.BufferList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __contains__(arg: int, /) bool ¶
- __contains__(arg: object, /) bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __eq__(arg, /)¶
Return self==value.
- Parameters:
arg (object)
- Return type:
bool
- __getitem__(arg: int, /) int ¶
- __getitem__(arg: slice, /) BufferList
- __iter__()¶
- Return type:
collections.abc.Iterator[int]
- __len__()¶
- Return type:
int
- __ne__(arg, /)¶
Return self!=value.
- Parameters:
arg (object)
- Return type:
bool
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0: int, arg1: int, /) None ¶
- __setitem__(arg0: slice, arg1: BufferList, /) None
- append(arg, /)¶
Append arg to the end of the list.
- Parameters:
arg (int)
- Return type:
None
- clear()¶
Remove all items from list.
- Return type:
None
- count(arg, /)¶
Return number of occurrences of arg.
- Parameters:
arg (int)
- Return type:
int
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (BufferList)
- Return type:
None
- insert(arg0, arg1, /)¶
Insert object arg1 before index arg0.
- Parameters:
arg0 (int)
arg1 (int)
- Return type:
None
- pop(index=-1)¶
Remove and return item at index (default last).
- Parameters:
index (int)
- Return type:
int
- remove(arg, /)¶
Remove first occurrence of arg.
- Parameters:
arg (int)
- Return type:
None
- class scene.Camera¶
Camera
- class Type(*args, **kwds)¶
Bases:
enum.Enum
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- Orthographic = 1¶
- Perspective = 0¶
- property aspect_ratio: float¶
- Return type:
float
- property extensions: Extensions¶
- Return type:
- property far_plane: float¶
- Return type:
float
- property get_vertical_fov: float¶
- Return type:
float
- property horizontal_fov: float¶
- Return type:
float
- property look_at: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- property name: str¶
- Return type:
str
- property near_plane: float¶
- Return type:
float
- property orthographic_width: float¶
- Return type:
float
- property position: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- property set_horizontal_fov_from_vertical_fov: None¶
- Parameters:
arg (float)
- Return type:
None
- property up: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- __repr__()¶
Return repr(self).
- Return type:
str
- class scene.CameraList¶
- class scene.CameraList(arg)
- class scene.CameraList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __getitem__(arg: int, /) Camera ¶
- __getitem__(arg: slice, /) CameraList
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0: int, arg1: Camera, /) None ¶
- __setitem__(arg0: slice, arg1: CameraList, /) None
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (CameraList)
- Return type:
None
- class scene.ElementIdList¶
- class scene.ElementIdList(arg)
- class scene.ElementIdList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __contains__(arg: int, /) bool ¶
- __contains__(arg: object, /) bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __eq__(arg, /)¶
Return self==value.
- Parameters:
arg (object)
- Return type:
bool
- __getitem__(arg: int, /) int ¶
- __getitem__(arg: slice, /) ElementIdList
- __iter__()¶
- Return type:
collections.abc.Iterator[int]
- __len__()¶
- Return type:
int
- __ne__(arg, /)¶
Return self!=value.
- Parameters:
arg (object)
- Return type:
bool
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0: int, arg1: int, /) None ¶
- __setitem__(arg0: slice, arg1: ElementIdList, /) None
- append(arg, /)¶
Append arg to the end of the list.
- Parameters:
arg (int)
- Return type:
None
- clear()¶
Remove all items from list.
- Return type:
None
- count(arg, /)¶
Return number of occurrences of arg.
- Parameters:
arg (int)
- Return type:
int
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (ElementIdList)
- Return type:
None
- insert(arg0, arg1, /)¶
Insert object arg1 before index arg0.
- Parameters:
arg0 (int)
arg1 (int)
- Return type:
None
- pop(index=-1)¶
Remove and return item at index (default last).
- Parameters:
index (int)
- Return type:
int
- remove(arg, /)¶
Remove first occurrence of arg.
- Parameters:
arg (int)
- Return type:
None
- class scene.Extensions¶
- property data: ValueUnorderedMap¶
- Return type:
- property empty: bool¶
- Return type:
bool
- property size: int¶
- Return type:
int
- class scene.FacetAllocationStrategy(*args, **kwds)¶
Bases:
enum.Enum
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- EvenSplit = 0¶
- RelativeToMeshArea = 1¶
- RelativeToNumFacets = 2¶
- Synchronized = 3¶
- class scene.Image¶
- property extensions: Extensions¶
Additional data associated with the image
- Return type:
- property image: ImageBuffer¶
Image buffer
- Return type:
- property name: str¶
Name of the image object
- Return type:
str
- property uri: pathlib.Path¶
URI of the image file
- Return type:
pathlib.Path
- __repr__()¶
Return repr(self).
- Return type:
str
- class scene.ImageBuffer¶
- property data: object¶
Raw image data.
- Return type:
object
- property dtype: type | None¶
The element data type of the image buffer.
- Return type:
type | None
- property height: int¶
Image height
- Return type:
int
- property num_channels: int¶
Number of channels in each pixel
- Return type:
int
- property width: int¶
Image width
- Return type:
int
- class scene.ImageList¶
- class scene.ImageList(arg)
- class scene.ImageList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (ImageList)
- Return type:
None
- class scene.Light¶
Light
- class Type(*args, **kwds)¶
Bases:
enum.Enum
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- Ambient = 4¶
- Area = 5¶
- Directional = 1¶
- Point = 2¶
- Spot = 3¶
- Undefined = 0¶
- property angle_inner_cone: float¶
- Return type:
float
- property angle_outer_cone: float¶
- Return type:
float
- property attenuation_constant: float¶
- Return type:
float
- property attenuation_cubic: float¶
- Return type:
float
- property attenuation_linear: float¶
- Return type:
float
- property attenuation_quadratic: float¶
- Return type:
float
- property color_ambient: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- property color_diffuse: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- property color_specular: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- property direction: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- property extensions: Extensions¶
- Return type:
- property intensity: float¶
- Return type:
float
- property name: str¶
- Return type:
str
- property position: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- property range: float¶
- Return type:
float
- property size: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=2, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=2, order=’C’)]
- property up: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- __repr__()¶
Return repr(self).
- Return type:
str
- class scene.LightList¶
- class scene.LightList(arg)
- class scene.LightList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (LightList)
- Return type:
None
- class scene.Material¶
- class AlphaMode(*args, **kwds)¶
Bases:
enum.Enum
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- Blend = 2¶
- Mask = 1¶
- Opaque = 0¶
- property alpha_cutoff: float¶
- Return type:
float
- property base_color_texture: TextureInfo¶
- Return type:
- property base_color_value: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=4, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=4, order=’C’)]
- property double_sided: bool¶
- Return type:
bool
- property emissive_texture: TextureInfo¶
- Return type:
- property emissive_value: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]
- property extensions: Extensions¶
- Return type:
- property metallic_roughness_texture: TextureInfo¶
- Return type:
- property metallic_value: float¶
- Return type:
float
- property name: str¶
- Return type:
str
- property normal_scale: float¶
- Return type:
float
- property normal_texture: TextureInfo¶
- Return type:
- property occlusion_strength: float¶
- Return type:
float
- property occlusion_texture: TextureInfo¶
- Return type:
- property roughness_value: float¶
- Return type:
float
- __repr__()¶
Return repr(self).
- Return type:
str
- class scene.MaterialList¶
- class scene.MaterialList(arg)
- class scene.MaterialList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __getitem__(arg: int, /) Material ¶
- __getitem__(arg: slice, /) MaterialList
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0: int, arg1: Material, /) None ¶
- __setitem__(arg0: slice, arg1: MaterialList, /) None
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (MaterialList)
- Return type:
None
- class scene.MeshInstance3D¶
A single mesh instance in a scene
- property mesh_index: int¶
- Return type:
int
- property transform: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', order='C', device='cpu')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float64’, order=’C’, device=’cpu’)]
- class scene.Node¶
- property cameras: ElementIdList¶
- Return type:
- property children: ElementIdList¶
- Return type:
- property extensions: Extensions¶
- Return type:
- property lights: ElementIdList¶
- Return type:
- property meshes: SceneMeshInstanceList¶
- Return type:
- property name: str¶
- Return type:
str
- property parent: int¶
- Return type:
int
- property transform: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=4, 4, order='F')]¶
The affine transform associated with this node
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=(4, 4), order=’F’)]
- __repr__()¶
Return repr(self).
- Return type:
str
- class scene.NodeList¶
- class scene.NodeList(arg)
- class scene.NodeList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (NodeList)
- Return type:
None
- class scene.RemeshingOptions¶
- property facet_allocation_strategy: FacetAllocationStrategy¶
- Return type:
- property min_facets: int¶
- Return type:
int
- class scene.Scene¶
A 3D scene
- property animations: AnimationList¶
- Return type:
- property cameras: CameraList¶
- Return type:
- property extensions: Extensions¶
- Return type:
- property materials: MaterialList¶
- Return type:
- property meshes: SurfaceMeshList¶
- Return type:
- property name: str¶
- Return type:
str
- property root_nodes: ElementIdList¶
- Return type:
- property skeletons: SkeletonList¶
- Return type:
- property textures: TextureList¶
- Return type:
- __repr__()¶
Return repr(self).
- Return type:
str
- add(element)¶
Add an element to the scene.
- add_child(parent_id, child_id)¶
Add a child node to a parent node.
- Parameters:
parent_id (int) – The parent node id.
child_id (int) – The child node id.
- Returns:
The id of the added child node.
- Return type:
None
- class scene.SceneMeshInstance¶
Mesh and material index of a node
- property materials: ElementIdList¶
- Return type:
- property mesh: int¶
- Return type:
int
- class scene.SceneMeshInstanceList¶
- class scene.SceneMeshInstanceList(arg)
- class scene.SceneMeshInstanceList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __getitem__(arg: int, /) SceneMeshInstance ¶
- __getitem__(arg: slice, /) SceneMeshInstanceList
- __iter__()¶
- Return type:
collections.abc.Iterator[SceneMeshInstance]
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0: int, arg1: SceneMeshInstance, /) None ¶
- __setitem__(arg0: slice, arg1: SceneMeshInstanceList, /) None
- append(arg, /)¶
Append arg to the end of the list.
- Parameters:
arg (SceneMeshInstance)
- Return type:
None
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (SceneMeshInstanceList)
- Return type:
None
- insert(arg0, arg1, /)¶
Insert object arg1 before index arg0.
- Parameters:
arg0 (int)
arg1 (SceneMeshInstance)
- Return type:
None
- pop(index=-1)¶
Remove and return item at index (default last).
- Parameters:
index (int)
- Return type:
- class scene.SimpleScene3D¶
Simple scene container for instanced meshes
- property num_meshes: int¶
Number of meshes in the scene
- Return type:
int
- property total_num_instances: int¶
Total number of instances for all meshes in the scene
- Return type:
int
- add_instance(instance)¶
- Parameters:
instance (MeshInstance3D)
- Return type:
int
- add_mesh(mesh)¶
- Parameters:
mesh (lagrange.core.SurfaceMesh)
- Return type:
int
- get_instance(mesh_index, instance_index)¶
- Parameters:
mesh_index (int)
instance_index (int)
- Return type:
- get_mesh(mesh_index)¶
- Parameters:
mesh_index (int)
- Return type:
lagrange.core.SurfaceMesh
- num_instances(mesh_index)¶
- Parameters:
mesh_index (int)
- Return type:
int
- ref_mesh(mesh_index)¶
- Parameters:
mesh_index (int)
- Return type:
lagrange.core.SurfaceMesh
- reserve_instances(mesh_index, num_instances)¶
- Parameters:
mesh_index (int)
num_instances (int)
- Return type:
None
- reserve_meshes(num_meshes)¶
- Parameters:
num_meshes (int)
- Return type:
None
- class scene.Skeleton¶
- property extensions: Extensions¶
- Return type:
- property meshes: ElementIdList¶
- Return type:
- class scene.SkeletonList¶
- class scene.SkeletonList(arg)
- class scene.SkeletonList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __getitem__(arg: int, /) Skeleton ¶
- __getitem__(arg: slice, /) SkeletonList
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0: int, arg1: Skeleton, /) None ¶
- __setitem__(arg0: slice, arg1: SkeletonList, /) None
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (SkeletonList)
- Return type:
None
- class scene.SurfaceMeshList¶
- class scene.SurfaceMeshList(arg)
- class scene.SurfaceMeshList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __getitem__(arg: int, /) lagrange.core.SurfaceMesh ¶
- __getitem__(arg: slice, /) SurfaceMeshList
- __iter__()¶
- Return type:
collections.abc.Iterator[lagrange.core.SurfaceMesh]
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0: int, arg1: lagrange.core.SurfaceMesh, /) None ¶
- __setitem__(arg0: slice, arg1: SurfaceMeshList, /) None
- append(arg, /)¶
Append arg to the end of the list.
- Parameters:
arg (lagrange.core.SurfaceMesh)
- Return type:
None
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (SurfaceMeshList)
- Return type:
None
- insert(arg0, arg1, /)¶
Insert object arg1 before index arg0.
- Parameters:
arg0 (int)
arg1 (lagrange.core.SurfaceMesh)
- Return type:
None
- pop(index=-1)¶
Remove and return item at index (default last).
- Parameters:
index (int)
- Return type:
lagrange.core.SurfaceMesh
- class scene.Texture¶
Texture
- class TextureFilter(*args, **kwds)¶
Bases:
enum.Enum
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- Linear = 9729¶
- LinearMipmapLinear = 9987¶
- LinearMipmapNearest = 9985¶
- Nearest = 9728¶
- NearestMimpapNearest = 9984¶
- NearestMipmapLinear = 9986¶
- Undefined = 0¶
- class WrapMode(*args, **kwds)¶
Bases:
enum.Enum
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- Clamp = 1¶
- Decal = 2¶
- Mirror = 3¶
- Wrap = 0¶
- property extensions: Extensions¶
- Return type:
- property image: int¶
- Return type:
int
- property name: str¶
- Return type:
str
- property offset: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=2, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=2, order=’C’)]
- property rotation: float¶
- Return type:
float
- property scale: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=2, order='C')]¶
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=2, order=’C’)]
- __repr__()¶
Return repr(self).
- Return type:
str
- class scene.TextureInfo¶
- property index: int¶
- Return type:
int
- property texcoord: int¶
- Return type:
int
- class scene.TextureList¶
- class scene.TextureList(arg)
- class scene.TextureList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __getitem__(arg: int, /) Texture ¶
- __getitem__(arg: slice, /) TextureList
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0: int, arg1: Texture, /) None ¶
- __setitem__(arg0: slice, arg1: TextureList, /) None
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (TextureList)
- Return type:
None
- class scene.ValueList¶
- class scene.ValueList(arg)
- class scene.ValueList(arg, /)
- __bool__()¶
Check whether the vector is nonempty
- Return type:
bool
- __delitem__(arg: int, /) None ¶
- __delitem__(arg: slice, /) None
- __iter__()¶
- Return type:
collections.abc.Iterator[Value]
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- append(arg, /)¶
Append arg to the end of the list.
- Parameters:
arg (Value)
- Return type:
None
- clear()¶
Remove all items from list.
- Return type:
None
- extend(arg, /)¶
Extend self by appending elements from arg.
- Parameters:
arg (ValueList)
- Return type:
None
- insert(arg0, arg1, /)¶
Insert object arg1 before index arg0.
- Parameters:
arg0 (int)
arg1 (Value)
- Return type:
None
- pop(index=-1)¶
Remove and return item at index (default last).
- Parameters:
index (int)
- Return type:
Value
- class scene.ValueMap¶
- class scene.ValueMap(arg)
- class scene.ValueMap(arg, /)
- class ItemView¶
- __iter__()¶
- Return type:
collections.abc.Iterator[tuple[str, Value]]
- __len__()¶
- Return type:
int
- class KeyView¶
- __contains__(arg: str, /) bool ¶
- __contains__(arg: object, /) bool
- __iter__()¶
- Return type:
collections.abc.Iterator[str]
- __len__()¶
- Return type:
int
- class ValueView¶
- __iter__()¶
- Return type:
collections.abc.Iterator[Value]
- __len__()¶
- Return type:
int
- __bool__()¶
Check whether the map is nonempty
- Return type:
bool
- __contains__(arg: str, /) bool ¶
- __contains__(arg: object, /) bool
- __delitem__(arg, /)¶
- Parameters:
arg (str)
- Return type:
None
- __getitem__(arg, /)¶
- Parameters:
arg (str)
- Return type:
Value
- __iter__()¶
- Return type:
collections.abc.Iterator[str]
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0, arg1, /)¶
- Parameters:
arg0 (str)
arg1 (Value)
- Return type:
None
- clear()¶
Remove all items
- Return type:
None
- class scene.ValueUnorderedMap¶
- class scene.ValueUnorderedMap(arg)
- class scene.ValueUnorderedMap(arg, /)
- class ItemView¶
- __iter__()¶
- Return type:
collections.abc.Iterator[tuple[str, Value]]
- __len__()¶
- Return type:
int
- class KeyView¶
- __contains__(arg: str, /) bool ¶
- __contains__(arg: object, /) bool
- __iter__()¶
- Return type:
collections.abc.Iterator[str]
- __len__()¶
- Return type:
int
- class ValueView¶
- __iter__()¶
- Return type:
collections.abc.Iterator[Value]
- __len__()¶
- Return type:
int
- __bool__()¶
Check whether the map is nonempty
- Return type:
bool
- __contains__(arg: str, /) bool ¶
- __contains__(arg: object, /) bool
- __delitem__(arg, /)¶
- Parameters:
arg (str)
- Return type:
None
- __getitem__(arg, /)¶
- Parameters:
arg (str)
- Return type:
Value
- __iter__()¶
- Return type:
collections.abc.Iterator[str]
- __len__()¶
- Return type:
int
- __repr__()¶
Return repr(self).
- Return type:
str
- __setitem__(arg0, arg1, /)¶
- Parameters:
arg0 (str)
arg1 (Value)
- Return type:
None
- clear()¶
Remove all items
- Return type:
None
- items()¶
Returns an iterable view of the map’s items.
- Return type:
- keys()¶
Returns an iterable view of the map’s keys.
- Return type:
- update(arg, /)¶
Update the map with element from arg
- Parameters:
arg (ValueUnorderedMap)
- Return type:
None
- values()¶
Returns an iterable view of the map’s values.
- Return type:
- scene.compute_global_node_transform(scene, node_idx)¶
Compute the global transform associated with a node.
- Parameters:
scene (Scene) – The input node.
node_idx (int) – The index of the taget node.
- Returns:
The global transform of the target node, which is the combination of transforms from this node all the way to the root.
- Return type:
Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=(4, 4), order=’F’)]
- scene.mesh_to_simple_scene(mesh)¶
Converts a single mesh into a simple scene with a single identity instance of the input mesh.
- Parameters:
mesh (lagrange.core.SurfaceMesh) – Input mesh to convert.
- Returns:
Simple scene containing the input mesh.
- Return type:
- scene.meshes_to_simple_scene(meshes)¶
Converts a list of meshes into a simple scene with a single identity instance of each input mesh.
- Parameters:
meshes (SurfaceMeshList) – Input meshes to convert.
- Returns:
Simple scene containing the input meshes.
- Return type:
- scene.simple_scene_to_mesh(scene, normalize_normals=True, normalize_tangents_bitangents=True, preserve_attributes=True)¶
Converts a scene into a concatenated mesh with all the transforms applied.
- Parameters:
scene (SimpleScene3D) – Scene to convert.
normalize_normals (bool) – If enabled, normals are normalized after transformation.
normalize_tangents_bitangents (bool) – If enabled, tangents and bitangents are normalized after transformation.
preserve_attributes (bool) – Preserve shared attributes and map them to the output mesh.
- Returns:
Concatenated mesh.
- Return type:
lagrange.core.SurfaceMesh