ShapeBlenderWrapper
- class xrfeitoria.actor.actor_blender.ShapeBlenderWrapper[source]
Wrapper class for shapes in Blender.
- classmethod spawn(type: Literal['plane', 'cube', 'sphere', 'ico_sphere', 'cylinder', 'cone'], name: str | None = None, location: Tuple[float, float, float] = (0, 0, 0), rotation: Tuple[float, float, float] = (0, 0, 0), scale: Tuple[float, float, float] = (1, 1, 1), stencil_value: int = 1, **kwargs) ActorBlender[source]
Spawn a shape(plane, cube, UV sphere, icosphere, cylinder or cone) in the scene.
- Parameters:
name (str) – Name of the new added shape.
mesh_type (enum in ['plane', 'cube', 'sphere', 'icosphere', 'cylinder', 'cone']) – Type of new spawn shape.
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.
**kwargs –
plane: size. Ref toShapeBlenderWrapper.spawn_planefor details.cube: size. Ref toShapeBlenderWrapper.spawn_cubefor details.sphere: radius, segments, ring_count. Ref toShapeBlenderWrapper.spawn_spherefor details.icosphere: radius, subdivisions. Ref toShapeBlenderWrapper.spawn_ico_spherefor details.cylinder: radius, depth, vertices. Ref toShapeBlenderWrapper.spawn_cylinderfor details.cone: radius1, radius2, depth, vertices. Ref toShapeBlenderWrapper.spawn_conefor details.
- Returns:
ActorBlender – New added shape.
- classmethod spawn_cone(name: str, radius1: float = 1.0, radius2: float = 0.0, depth: float = 2.0, vertices: int = 32, location: Tuple[float, float, float] = (0, 0, 0), rotation: Tuple[float, float, float] = (0, 0, 0), scale: Tuple[float, float, float] = (1, 1, 1), stencil_value: int = 1) ActorBlender[source]
Spawn a cone in the engine.
- Parameters:
name (str) – Name of the new added cone.
radius1 (float in [0, inf], optional) – Radius of the circular base of the cone. Defaults to 1.0. (unit: meter).
radius2 (float in [0, inf], optional) – Radius of the tip of the cone. Defaults to 0.0. (unit: meter).
depth (float in [0, inf], optional) – Height of the cone. Defaults to 2.0. (unit: meter)
vertices (int in [3, 10000000], optional) – Number of vertices on the circumference of the base of the cone. Defaults to 32.
location (Vector, optional) – Location of the cone. Defaults to (0, 0, 0).
rotation (Vector, optional) – Rotation of the cone. Defaults to (0, 0, 0).
scale (Vector, optional) – Scale of the cone. Defaults to (1, 1, 1).
stencil_value (int in [0, 255], optional) – Stencil value of the cone. Defaults to 1. Ref to What is stencil_value for details.
- Returns:
ActorBlender – New added cone.
- classmethod spawn_cube(name: str, size: float = 1.0, location: Tuple[float, float, float] = (0, 0, 0), rotation: Tuple[float, float, float] = (0, 0, 0), scale: Tuple[float, float, float] = (1, 1, 1), stencil_value: int = 1) ActorBlender[source]
Spawn a cube in the engine.
- Parameters:
name (str) – Name of the new added cube.
size (float in [0, inf], optional) – Size of the cube. Defaults to 1.0. (unit: meter)
location (Vector, optional) – Location of the cube. Defaults to (0, 0, 0).
rotation (Vector, optional) – Rotation of the cube. Defaults to (0, 0, 0).
scale (Vector, optional) – Scale of the cube. Defaults to (1, 1, 1).
stencil_value (int in [0, 255], optional) – Stencil value of the cube. Defaults to 1. Ref to What is stencil_value for details.
- Returns:
ActorBlender – New added cube.
- classmethod spawn_cylinder(name: str, radius: float = 1.0, depth: float = 2.0, vertices: int = 32, location: Tuple[float, float, float] = (0, 0, 0), rotation: Tuple[float, float, float] = (0, 0, 0), scale: Tuple[float, float, float] = (1, 1, 1), stencil_value: int = 1) ActorBlender[source]
Spawn a cylinder in the engine.
- Parameters:
name (str) – Name of the new added cylinder.
radius (float in [0, inf], optional) – Radius of the cylinder’s bases. Defaults to 1.0. (unit: meter)
depth (float in [0, inf], optional) – Height of the cylinder. Defaults to 2.0. (unit: meter)
vertices (int in [3, 10000000], optional) – Number of vertices on the circumference of the base of the cylinder. Defaults to 32.
location (Vector, optional) – Location of the cylinder. Defaults to (0, 0, 0).
rotation (Vector, optional) – Rotation of the cylinder. Defaults to (0, 0, 0).
scale (Vector, optional) – Scale of the cylinder. Defaults to (1, 1, 1).
stencil_value (int in [0, 255], optional) – Stencil value of the cylinder. Defaults to 1. Ref to What is stencil_value for details.
- Returns:
ActorBlender – New added cylinder.
- classmethod spawn_ico_sphere(name: str, radius: float = 1.0, subdivisions: int = 2, location: Tuple[float, float, float] = (0, 0, 0), rotation: Tuple[float, float, float] = (0, 0, 0), scale: Tuple[float, float, float] = (1, 1, 1), stencil_value: int = 1) ActorBlender[source]
Spawn an icosphere in the engine.
- Parameters:
name (str) – Name of the new added icosphere.
radius (float in [0, inf], optional) – Radius of the icosphere. Defaults to 1.0. (unit: meter)
subdivisions (int in [1, 10], optional) – Number of times of splitting each triangular face on the sphere into four triangles. Defaults to 2.
location (Vector, optional) – Location of the icosphere. Defaults to (0, 0, 0).
rotation (Vector, optional) – Rotation of the icosphere. Defaults to (0, 0, 0).
scale (Vector, optional) – Scale of the icosphere. Defaults to (1, 1, 1).
stencil_value (int in [0, 255], optional) – Stencil value of the icosphere. Defaults to 1. Ref to What is stencil_value for details.
- Returns:
ActorBlender – New added icosphere.
- classmethod spawn_plane(name: str, size: float = 1.0, location: Tuple[float, float, float] = (0, 0, 0), rotation: Tuple[float, float, float] = (0, 0, 0), scale: Tuple[float, float, float] = (1, 1, 1), stencil_value: int = 1) ActorBlender[source]
Spawn a plane in the engine.
- Parameters:
name (str) – Name of the new added plane.
size (float in [0, inf], optional) – Size of the plane. Defaults to 1.0. (unit: meter)
location (Vector, optional) – Location of the plane. Defaults to (0, 0, 0).
rotation (Vector, optional) – Rotation of the plane. Defaults to (0, 0, 0).
scale (Vector, optional) – Scale of the plane. Defaults to (1, 1, 1).
stencil_value (int in [0, 255], optional) – Stencil value of the plane. Defaults to 1. Ref to What is stencil_value for details.
- Returns:
ActorBlender – New added plane.
- classmethod spawn_sphere(name: str, radius: float = 1.0, segments: int = 32, ring_count: int = 16, location: Tuple[float, float, float] = (0, 0, 0), rotation: Tuple[float, float, float] = (0, 0, 0), scale: Tuple[float, float, float] = (1, 1, 1), stencil_value: int = 1) ActorBlender[source]
Spawn a UV sphere in the engine.
- Parameters:
name (str) – Name of the new added UV sphere.
radius (float in [0, inf], optional) – Radius of the UV sphere. Defaults to 1.0. (unit: meter)
segments (int in [3, 100000], optional) – Number of vertical segments on the sphere. Defaults to 32.
ring_count (int in [3, 100000], optional) – Number of horizontal segmentson the sphere. Defaults to 16.
location (Vector, optional) – Location of the UV sphere. Defaults to (0, 0, 0).
rotation (Vector, optional) – Rotation of the UV sphere. Defaults to (0, 0, 0).
scale (Vector, optional) – Scale of the UV sphere. Defaults to (1, 1, 1).
stencil_value (int in [0, 255], optional) – Stencil value of the UV sphere. Defaults to 1. Ref to What is stencil_value for details.
- Returns:
ActorBlender – New added UV sphere.