SequenceBase
- class xrfeitoria.sequence.sequence_base.SequenceBase[source]
Base sequence class.
- classmethod add_to_renderer(output_path: str | Path, resolution: Tuple[int, int], render_passes: List[RenderPass], **kwargs)[source]
Add a rendering job with specific settings.
- Parameters:
output_path (PathLike) – Output path of the rendered images.
resolution (Tuple[int, int]) – Resolution of the rendered images.
render_passes (List[RenderPass]) – Render passes.
kwargs – Other engine specific arguments.
- classmethod import_actor(file_path: str | Path, actor_name: str | None = None, location: Tuple[float, float, float] | None = None, rotation: Tuple[float, float, float] | None = None, scale: Tuple[float, float, float] | None = None, stencil_value: int = 1) ActorBase [source]
Imports an actor from a file and adds it to the sequence.
- Parameters:
file_path (PathLike) – The path to the file containing the actor to import.
actor_name (Optional[str], optional) – The name to give the imported actor. If not provided, a name will be generated automatically. Defaults to None.
location (Vector, optional) – The initial location of the actor. Defaults to None.
rotation (Vector, optional) – The initial rotation of the actor. Defaults to None.
scale (Vector, optional) – The initial scale of the actor. Defaults to None.
stencil_value (int, optional) – The stencil value to use for the actor. Defaults to 1.
- Returns:
ActorBase – The imported actor.
- classmethod spawn_camera(location: Tuple[float, float, float] | None = None, rotation: Tuple[float, float, float] | None = None, fov: float = 90.0, aspect_ratio: float = 1.7777777777777777, camera_name: str | None = None) CameraBase [source]
Spawn a new camera in the sequence.
- Parameters:
location (Vector) – Location of the camera.
rotation (Vector) – Rotation of the camera.
fov (float in (0.0, 180.0), optional) – Field of view of the camera len. Defaults to 90.0. (unit: degrees)
aspect_ratio (float, optional) – Aspect ratio of the camera. Defaults to 16.0 / 9.0.
camera_name (str, optional) – Name of the camera. Defaults to None.
- classmethod spawn_camera_with_keys(transform_keys: List[SequenceTransformKey] | SequenceTransformKey, fov: float = 90.0, aspect_ratio: float = 1.7777777777777777, camera_name: str | None = None) CameraBase [source]
Spawn a new camera with keyframes in the sequence.
- Parameters:
transform_keys (TransformKeys) – Keyframes of transform (location, rotation, and scale).
fov (float in (0.0, 180.0), optional) – Field of view of the camera len. Defaults to 90.0. (unit: degrees)
aspect_ratio (float, optional) – Aspect ratio of the camera. Defaults to 16.0 / 9.0.
camera_name (str, optional) – Name of the camera. Defaults to ‘Camera’.
- classmethod spawn_shape(type: Literal['plane', 'cube', 'sphere', 'cylinder', 'cone'], shape_name: str | None = None, location: Tuple[float, float, float] | None = None, rotation: Tuple[float, float, float] | None = None, scale: Tuple[float, float, float] | None = None, stencil_value: int = 1, **kwargs) ActorBase [source]
Spawn a shape in the sequence.
- Parameters:
type (str) – Type of new spawn shape. One of [“plane”, “cube”, “sphere”, “cylinder”, “cone”]
shape_name (str) – Name of the new added shape. Defaults to None.
location (Vector, optional) – Location of the shape. Defaults to (0, 0, 0).
rotation (Vector, optional) – Rotation of the shape. Defaults to (0, 0, 0).
scale (Vector, optional) – Scale of the shape. Defaults to (1, 1, 1).
stencil_value (int in [0, 255], optional) – Stencil value of the shape. Defaults to 1. Ref to What is stencil_value for details.
- Returns:
ShapeBlender or ShapeUnreal – New added shape.
- classmethod spawn_shape_with_keys(transform_keys: List[SequenceTransformKey] | SequenceTransformKey, type: Literal['plane', 'cube', 'sphere', 'cylinder', 'cone'], shape_name: str | None = None, stencil_value: int = 1, **kwargs) ActorBase [source]
Spawn a shape with keyframes in the sequence.
- Parameters:
shape_name (str) – Name of the new added shape.
type (str) – Type of new spawn shape. One of [“plane”, “cube”, “sphere”, “cylinder”, “cone”]
transform_keys (TransformKeys) – Keyframes of transform (location, rotation, and scale).
stencil_value (int in [0, 255], optional) – Stencil value of the cone. Defaults to 1. Ref to What is stencil_value for details.
- Returns:
ShapeBlender or ShapeUnreal – New added shape.
- classmethod use_actor(actor: ActorBase, location: Tuple[float, float, float] | None = None, rotation: Tuple[float, float, float] | None = None, scale: Tuple[float, float, float] | None = None, stencil_value: int | None = None, anim_asset_path: str | None = None) None [source]
Use the specified level actor in the sequence. The location, rotation, scale, stencil_value and anim_asset set in this method are only used in the sequence. These peoperties of the actor in the level will be restored after the sequence is closed.
- Parameters:
actor (ActorUnreal or ActorBlender) – The actor to add to the sequence.
location (Optional[Vector]) – The initial location of the actor. If None, the actor’s current location is used. unit: meter.
rotation (Optional[Vector]) – The initial rotation of the actor. If None, the actor’s current rotation is used. unit: degree.
scale (Optional[Vector]) – The initial scale of the actor. If None, the actor’s current scale is used.
stencil_value (int in [0, 255], optional) – The stencil value to use for the spawned actor. Defaults to None. Ref to What is stencil_value for details.
anim_asset_path (Optional[str]) – For blender, this argument is the name of an action(bpy.types.Action).
Engine (For Unreal) –
actor. (this argument is the engine path to the animation asset to use for the) –
None (Default to None. If) –
used (the actor's current animation is) –
used. (else the specified animation is) –
- classmethod use_actor_with_keys(actor: ActorBase, transform_keys: List[SequenceTransformKey] | SequenceTransformKey, stencil_value: int | None = None, anim_asset_path: str | None = None) None [source]
Use the specified level actor in the sequence. The transform_keys, stencil_value and anim_asset set in this method are only used in the sequence. These peoperties of the actor in the level will be restored after the sequence is closed.
- Parameters:
actor (ActorUnreal or ActorBlender) – The actor to use in the sequence.
transform_keys (Union[TransformKeys, List[TransformKeys]]) – The transform keys to use with the actor.
stencil_value (int in [0, 255], optional) – The stencil value to use for the spawned actor. Defaults to None. Ref to What is stencil_value for details.
anim_asset_path (Optional[str]) – For blender, this argument is the name of an action(bpy.types.Action).
Engine (For Unreal) –
actor. (this argument is the engine path to the animation asset to use for the) –
None (Default to None. If) –
used (the actor's current animation is) –
used. (else the specified animation is) –
- classmethod use_camera(camera: CameraBase, location: Tuple[float, float, float] | None = None, rotation: Tuple[float, float, float] | None = None, fov: float | None = None, aspect_ratio: float = 1.7777777777777777) None [source]
Use the specified level camera in the sequence. The location, rotation and fov set in this method are only used in the sequence. The location, rotation and fov of the camera in the level will be restored after the sequence is closed.
- Parameters:
camera (CameraUnreal or CameraBlender) – The camera to use in the sequence.
location (Optional[Vector], optional) – The location of the camera. Defaults to None. unit: meter.
rotation (Optional[Vector], optional) – The rotation of the camera. Defaults to None. unit: degree.
fov (float, optional) – The field of view of the camera. Defaults to None. unit: degree.
aspect_ratio (float, optional) – The aspect ratio of the camera. Defaults to None.
- classmethod use_camera_with_keys(camera: CameraBase, transform_keys: List[SequenceTransformKey] | SequenceTransformKey, fov: float | None = None, aspect_ratio: float = 1.7777777777777777) None [source]
Use the specified level camera in the sequence. The transform_keys and fov set in this method are only used in the sequence. The location, rotation and fov of the camera in the level will be restored after the sequence is closed.
- Parameters:
camera (CameraUnreal or CameraBlender) – The camera to use.
transform_keys (TransformKeys) – The transform keys to use.
fov (float, optional) – The field of view to use. Defaults to None. unit: degree.
aspect_ratio (float, optional) – The aspect ratio of the camera. Defaults to None.