blendify.renderables package¶
Submodules¶
blendify.renderables.base module¶
- class blendify.renderables.base.Renderable(material: Material | Sequence[Material], colors: Colors | Sequence[Colors], **kwargs)[source]¶
Bases:
Positionable
Base class for all renderable objects (Meshes, PointClouds, Primitives).
- class blendify.renderables.base.RenderableObject(**kwargs)[source]¶
Bases:
Renderable
Base class for renderable objects, that can be represented by a single bpy.types.Object (Meshes and Primitives).
- property emit_shadows: bool¶
blendify.renderables.collection module¶
- class blendify.renderables.collection.RenderablesCollection(*args, **kwargs)[source]¶
Bases:
object
- add_circle_mesh(radius: float, material: Material | Sequence[Material], colors: Colors | Sequence[Colors], faces_material: Sequence[Sequence[int]] = None, num_vertices: int = 32, fill_type: str = 'NGON', rotation_mode: str = 'quaternionWXYZ', rotation: ndarray | Tuple[float, float, float, float] | Tuple[float, float, float] | Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | Positionable | Tuple[ndarray | Tuple[float, float, float], float] | Tuple[Positionable, float] = None, translation: ndarray | Tuple[float, float, float] = (0, 0, 0), tag: str = None) CircleMesh [source]¶
Add primitives.CircleMesh object to the scene. The object supports only uniform coloring (UniformColors).
- Parameters:
radius (float) – radius of a primitive in [0, inf]
material (Union[Material, MaterialList]) – Material instance or list of Material instances
colors (Union[Colors, ColorsList]) – Colors instance or list of Colors instances
faces_material (Sequence[Sequence[int]], optional) – for each face, the material index assigned to it
num_vertices (int, optional) – number of vertices in primitive in [3, 10000000] (default: 32)
fill_type (str, optional) – fill type, one of [NOTHING, NGON, TRIFAN] (default: NGON)
rotation_mode (str) – type of rotation representation. Can be one of the following: - “quaternionWXYZ” - WXYZ quaternion - “quaternionXYZW” - XYZW quaternion - “rotvec” - axis-angle representation of rotation - “rotmat” - 3x3 rotation matrix - “euler<mode>” - Euler angles with the specified order of rotation, e.g. XYZ, xyz, ZXZ, etc. Refer to scipy.spatial.transform.Rotation.from_euler for details. - “look_at” - look at rotation, the rotation is defined by the point to look at and, optional, the rotation around the forward direction vector (a single float value in tuple or list)
rotation (RotationParams) – rotation parameters according to the rotation_mode - for “quaternionWXYZ” and “quaternionXYZW” - Vec4d - for “rotvec” - Vec3d - for “rotmat” - Mat3x3 - for “euler<mode>” - Vec3d - for “look_at” - Vec3d, Positionable or Tuple[Vec3d/Positionable, float], where float is the rotation around the forward direction vector in degrees
translation (Vector3d, optional) – translation applied to the Blender object (default: (0,0,0))
tag (str, optional) – name of the created object in Blender. If None is passed, the tag is automatically generated (default: None)
- Returns:
created and added to the scene object
- Return type:
- add_cube_mesh(size: float, material: Material | Sequence[Material], colors: Colors | Sequence[Colors], faces_material: Sequence[Sequence[int]] = None, rotation_mode: str = 'quaternionWXYZ', rotation: ndarray | Tuple[float, float, float, float] | Tuple[float, float, float] | Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | Positionable | Tuple[ndarray | Tuple[float, float, float], float] | Tuple[Positionable, float] = None, translation: ndarray | Tuple[float, float, float] = (0, 0, 0), tag: str = None) CubeMesh [source]¶
Add primitives.CircleMesh object to the scene. The object supports only uniform coloring (UniformColors).
- Parameters:
size (float) – size of a primitive in [0, inf]
material (Union[Material, MaterialList]) – Material instance or list of Material instances
colors (Union[Colors, ColorsList]) – Colors instance or list of Colors instances
faces_material (Sequence[Sequence[int]], optional) – for each face, the material index assigned to it
rotation_mode (str) – type of rotation representation. Can be one of the following: - “quaternionWXYZ” - WXYZ quaternion - “quaternionXYZW” - XYZW quaternion - “rotvec” - axis-angle representation of rotation - “rotmat” - 3x3 rotation matrix - “euler<mode>” - Euler angles with the specified order of rotation, e.g. XYZ, xyz, ZXZ, etc. Refer to scipy.spatial.transform.Rotation.from_euler for details. - “look_at” - look at rotation, the rotation is defined by the point to look at and, optional, the rotation around the forward direction vector (a single float value in tuple or list)
rotation (RotationParams) – rotation parameters according to the rotation_mode - for “quaternionWXYZ” and “quaternionXYZW” - Vec4d - for “rotvec” - Vec3d - for “rotmat” - Mat3x3 - for “euler<mode>” - Vec3d - for “look_at” - Vec3d, Positionable or Tuple[Vec3d/Positionable, float], where float is the rotation around the forward direction vector in degrees
translation (Vector3d, optional) – translation applied to the Blender object (default: (0,0,0))
tag (str, optional) – name of the created object in Blender. If None is passed, the tag is automatically generated (default: None)
- Returns:
created and added to the scene object
- Return type:
- add_curve_nurbs(keypoints: ndarray, radius: float, material: Material, colors: UniformColors, rotation_mode: str = 'quaternionWXYZ', rotation: ndarray | Tuple[float, float, float, float] | Tuple[float, float, float] | Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | Positionable | Tuple[ndarray | Tuple[float, float, float], float] | Tuple[Positionable, float] = None, translation: ndarray | Tuple[float, float, float] = (0, 0, 0), tag: str = None) CurveBezier [source]¶
Add primitives.CurveBezier object to the scene. Keypoints are intermediate points of the Bezier Curve. The object supports only uniform coloring (UniformColors).
- Parameters:
keypoints (np.ndarray) – keypoints for the curve
radius (float) – radius of a primitive in [0, inf]
material (Material) – Material instance
colors (UniformColors) – UniformColors instance
rotation_mode (str) – type of rotation representation. Can be one of the following: - “quaternionWXYZ” - WXYZ quaternion - “quaternionXYZW” - XYZW quaternion - “rotvec” - axis-angle representation of rotation - “rotmat” - 3x3 rotation matrix - “euler<mode>” - Euler angles with the specified order of rotation, e.g. XYZ, xyz, ZXZ, etc. Refer to scipy.spatial.transform.Rotation.from_euler for details. - “look_at” - look at rotation, the rotation is defined by the point to look at and, optional, the rotation around the forward direction vector (a single float value in tuple or list)
rotation (RotationParams) – rotation parameters according to the rotation_mode - for “quaternionWXYZ” and “quaternionXYZW” - Vec4d - for “rotvec” - Vec3d - for “rotmat” - Mat3x3 - for “euler<mode>” - Vec3d - for “look_at” - Vec3d, Positionable or Tuple[Vec3d/Positionable, float], where float is the rotation around the forward direction vector in degrees
translation (Vector3d, optional) – translation applied to the Blender object (default: (0,0,0))
tag (str, optional) – name of the created object in Blender. If None is passed, the tag is automatically generated (default: None)
- Returns:
created and added to the scene object
- Return type:
- add_cylinder_mesh(radius: float, height: float, material: Material | Sequence[Material], colors: Colors | Sequence[Colors], faces_material: Sequence[Sequence[int]] = None, num_vertices: int = 32, fill_type: str = 'NGON', rotation_mode: str = 'quaternionWXYZ', rotation: ndarray | Tuple[float, float, float, float] | Tuple[float, float, float] | Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | Positionable | Tuple[ndarray | Tuple[float, float, float], float] | Tuple[Positionable, float] = None, translation: ndarray | Tuple[float, float, float] = (0, 0, 0), tag: str = None) CylinderMesh [source]¶
Add primitives.CylinderMesh object to the scene. The object supports only uniform coloring (UniformColors).
- Parameters:
radius (float) – radius of a primitive in [0, inf]
height (float) – height of a primitive in [0, inf]
material (Union[Material, MaterialList]) – Material instance or list of Material instances
colors (Union[Colors, ColorsList]) – Colors instance or list of Colors instances
faces_material (Sequence[Sequence[int]], optional) – for each face, the material index assigned to it
num_vertices (int, optional) – number of vertices in primitive in [3, 10000000] (default: 32)
fill_type (str, optional) – fill type, one of [NOTHING, NGON, TRIFAN] (default: NGON)
rotation_mode (str) – type of rotation representation. Can be one of the following: - “quaternionWXYZ” - WXYZ quaternion - “quaternionXYZW” - XYZW quaternion - “rotvec” - axis-angle representation of rotation - “rotmat” - 3x3 rotation matrix - “euler<mode>” - Euler angles with the specified order of rotation, e.g. XYZ, xyz, ZXZ, etc. Refer to scipy.spatial.transform.Rotation.from_euler for details. - “look_at” - look at rotation, the rotation is defined by the point to look at and, optional, the rotation around the forward direction vector (a single float value in tuple or list)
rotation (RotationParams) – rotation parameters according to the rotation_mode - for “quaternionWXYZ” and “quaternionXYZW” - Vec4d - for “rotvec” - Vec3d - for “rotmat” - Mat3x3 - for “euler<mode>” - Vec3d - for “look_at” - Vec3d, Positionable or Tuple[Vec3d/Positionable, float], where float is the rotation around the forward direction vector in degrees
translation (Vector3d, optional) – translation applied to the Blender object (default: (0,0,0))
tag (str, optional) – name of the created object in Blender. If None is passed, the tag is automatically generated (default: None)
- Returns:
created and added to the scene object
- Return type:
- add_ellipsoid_nurbs(radius: ndarray | Tuple[float, float, float], material: Material, colors: UniformColors, rotation_mode: str = 'quaternionWXYZ', rotation: ndarray | Tuple[float, float, float, float] | Tuple[float, float, float] | Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | Positionable | Tuple[ndarray | Tuple[float, float, float], float] | Tuple[Positionable, float] = None, translation: ndarray | Tuple[float, float, float] = (0, 0, 0), tag: str = None) EllipsoidNURBS [source]¶
Add primitives.EllipsoidNURBS object to the scene. Implemented as NURBS Sphere that is rescaled along axes, supports only uniform coloring (UniformColors).
- Parameters:
radius (float) – radius of a primitive in [0, inf]
material (Material) – Material instance
colors (UniformColors) – UniformColors instance
rotation_mode (str) – type of rotation representation. Can be one of the following: - “quaternionWXYZ” - WXYZ quaternion - “quaternionXYZW” - XYZW quaternion - “rotvec” - axis-angle representation of rotation - “rotmat” - 3x3 rotation matrix - “euler<mode>” - Euler angles with the specified order of rotation, e.g. XYZ, xyz, ZXZ, etc. Refer to scipy.spatial.transform.Rotation.from_euler for details. - “look_at” - look at rotation, the rotation is defined by the point to look at and, optional, the rotation around the forward direction vector (a single float value in tuple or list)
rotation (RotationParams) – rotation parameters according to the rotation_mode - for “quaternionWXYZ” and “quaternionXYZW” - Vec4d - for “rotvec” - Vec3d - for “rotmat” - Mat3x3 - for “euler<mode>” - Vec3d - for “look_at” - Vec3d, Positionable or Tuple[Vec3d/Positionable, float], where float is the rotation around the forward direction vector in degrees
translation (Vector3d, optional) – translation applied to the Blender object (default: (0,0,0))
tag (str, optional) – name of the created object in Blender. If None is passed, the tag is automatically generated (default: None)
- Returns:
created and added to the scene object
- Return type:
- add_mesh(vertices: ndarray, faces: ndarray, material: Material | Sequence[Material], colors: Colors | Sequence[Colors], faces_material: Sequence[Sequence[int]] = None, rotation_mode: str = 'quaternionWXYZ', rotation: ndarray | Tuple[float, float, float, float] | Tuple[float, float, float] | Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | Positionable | Tuple[ndarray | Tuple[float, float, float], float] | Tuple[Positionable, float] = None, translation: ndarray | Tuple[float, float, float] = (0, 0, 0), tag: str = None) Mesh [source]¶
Add Mesh object to the scene. The object supports uniform (UniformColors), per-vertex (VertexColors), per-vertex uv (VertexUV), per-face uv (FacesUV) and texture (TextureColors and FileTextureColors) coloring.
- Parameters:
vertices (np.ndarray) – mesh vertices
faces (np.ndarray) – mesh faces
material (Union[Material, MaterialList]) – Material instance or list of Material instances
colors (Union[Colors, ColorsList]) – Colors instance or list of Colors instances
faces_material (Sequence[Sequence[int]], optional) – for each face, the material index assigned to it
rotation_mode (str) – type of rotation representation. Can be one of the following: - “quaternionWXYZ” - WXYZ quaternion - “quaternionXYZW” - XYZW quaternion - “rotvec” - axis-angle representation of rotation - “rotmat” - 3x3 rotation matrix - “euler<mode>” - Euler angles with the specified order of rotation, e.g. XYZ, xyz, ZXZ, etc. Refer to scipy.spatial.transform.Rotation.from_euler for details. - “look_at” - look at rotation, the rotation is defined by the point to look at and, optional, the rotation around the forward direction vector (a single float value in tuple or list)
rotation (RotationParams) – rotation parameters according to the rotation_mode - for “quaternionWXYZ” and “quaternionXYZW” - Vec4d - for “rotvec” - Vec3d - for “rotmat” - Mat3x3 - for “euler<mode>” - Vec3d - for “look_at” - Vec3d, Positionable or Tuple[Vec3d/Positionable, float], where float is the rotation around the forward direction vector in degrees
translation (Vector3d, optional) – translation applied to the Blender object (default: (0,0,0))
tag (str, optional) – name of the created object in Blender. If None is passed, the tag is automatically generated (default: None)
- Returns:
created and added to the scene object
- Return type:
- add_plane_mesh(size: float, material: Material | Sequence[Material], colors: Colors | Sequence[Colors], faces_material: Sequence[Sequence[int]] = None, shadow_catcher: bool = False, rotation_mode: str = 'quaternionWXYZ', rotation: ndarray | Tuple[float, float, float, float] | Tuple[float, float, float] | Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | Positionable | Tuple[ndarray | Tuple[float, float, float], float] | Tuple[Positionable, float] = None, translation: ndarray | Tuple[float, float, float] = (0, 0, 0), tag: str = None) PlaneMesh [source]¶
Add primitives.PlaneMesh object to the scene. The object supports only uniform coloring (UniformColors).
- Parameters:
size (float) – size of a plane in [0, inf]
material (Union[Material, MaterialList]) – Material instance or list of Material instances
colors (Union[Colors, ColorsList]) – Colors instance or list of Colors instances
faces_material (Sequence[Sequence[int]], optional) – for each face, the material index assigned to it
shadow_catcher (bool, optional) – if True, the plane will act as a shadow catcher (default: False)
rotation_mode (str) – type of rotation representation. Can be one of the following: - “quaternionWXYZ” - WXYZ quaternion - “quaternionXYZW” - XYZW quaternion - “rotvec” - axis-angle representation of rotation - “rotmat” - 3x3 rotation matrix - “euler<mode>” - Euler angles with the specified order of rotation, e.g. XYZ, xyz, ZXZ, etc. Refer to scipy.spatial.transform.Rotation.from_euler for details. - “look_at” - look at rotation, the rotation is defined by the point to look at and, optional, the rotation around the forward direction vector (a single float value in tuple or list)
rotation (RotationParams) – rotation parameters according to the rotation_mode - for “quaternionWXYZ” and “quaternionXYZW” - Vec4d - for “rotvec” - Vec3d - for “rotmat” - Mat3x3 - for “euler<mode>” - Vec3d - for “look_at” - Vec3d, Positionable or Tuple[Vec3d/Positionable, float], where float is the rotation around the forward direction vector in degrees
translation (Vector3d, optional) – translation applied to the Blender object (default: (0,0,0))
tag (str, optional) – name of the created object in Blender. If None is passed, the tag is automatically generated (default: None)
- Returns:
created and added to the scene object
- Return type:
- add_pointcloud(vertices: ndarray, material: Material, colors: Colors, point_size: float = 0.006, base_primitive: str = 'CUBE', particle_emission_strength: int = 1, rotation_mode: str = 'quaternionWXYZ', rotation: ndarray | Tuple[float, float, float, float] | Tuple[float, float, float] | Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | Positionable | Tuple[ndarray | Tuple[float, float, float], float] | Tuple[Positionable, float] = None, translation: ndarray | Tuple[float, float, float] = (0, 0, 0), tag: str = None) PointCloud [source]¶
Add PointCloud object to the scene. The object supports uniform (UniformColors) and per-vertex (VertexColors) coloring.
- Parameters:
vertices (np.ndarray) – point cloud vertices
material (Material) – Material instance
colors (Colors) – VertexColors or UniformColors instance
point_size (float, optional) – size of a primitive, representing each vertex (default: 0.006)
base_primitive (str, optional) – type of primitive for representing each point (possible values are PLANE, CUBE, SPHERE, default: CUBE)
particle_emission_strength (int, optional) – strength of the emission from each primitive. This is used to increase realism. Values <= 0 turn emission off, values > 0 set the power of emission (default: 1)
rotation_mode (str) – type of rotation representation. Can be one of the following: - “quaternionWXYZ” - WXYZ quaternion - “quaternionXYZW” - XYZW quaternion - “rotvec” - axis-angle representation of rotation - “rotmat” - 3x3 rotation matrix - “euler<mode>” - Euler angles with the specified order of rotation, e.g. XYZ, xyz, ZXZ, etc. Refer to scipy.spatial.transform.Rotation.from_euler for details. - “look_at” - look at rotation, the rotation is defined by the point to look at and, optional, the rotation around the forward direction vector (a single float value in tuple or list)
rotation (RotationParams) – rotation parameters according to the rotation_mode - for “quaternionWXYZ” and “quaternionXYZW” - Vec4d - for “rotvec” - Vec3d - for “rotmat” - Mat3x3 - for “euler<mode>” - Vec3d - for “look_at” - Vec3d, Positionable or Tuple[Vec3d/Positionable, float], where float is the rotation around the forward direction vector in degrees
translation (Vector3d, optional) – translation applied to the Blender object (default: (0,0,0))
tag (str, optional) – name of the created collection in Blender to represent the point cloud. If None is passed the tag is automatically generated (default: None)
- Returns:
created and added to the scene object
- Return type:
- add_sphere_nurbs(radius: float, material: Material, colors: UniformColors, rotation_mode: str = 'quaternionWXYZ', rotation: ndarray | Tuple[float, float, float, float] | Tuple[float, float, float] | Tuple[Tuple[float, float, float], Tuple[float, float, float], Tuple[float, float, float]] | Positionable | Tuple[ndarray | Tuple[float, float, float], float] | Tuple[Positionable, float] = None, translation: ndarray | Tuple[float, float, float] = (0, 0, 0), tag: str = None) SphereNURBS [source]¶
Add primitives.SphereNURBS object to the scene. The object supports only uniform coloring (UniformColors).
- Parameters:
radius (float) – radius of a primitive in [0, inf]
material (Material) – Material instance
colors (UniformColors) – UniformColors instance
rotation_mode (str) – type of rotation representation. Can be one of the following: - “quaternionWXYZ” - WXYZ quaternion - “quaternionXYZW” - XYZW quaternion - “rotvec” - axis-angle representation of rotation - “rotmat” - 3x3 rotation matrix - “euler<mode>” - Euler angles with the specified order of rotation, e.g. XYZ, xyz, ZXZ, etc. Refer to scipy.spatial.transform.Rotation.from_euler for details. - “look_at” - look at rotation, the rotation is defined by the point to look at and, optional, the rotation around the forward direction vector (a single float value in tuple or list)
rotation (RotationParams) – rotation parameters according to the rotation_mode - for “quaternionWXYZ” and “quaternionXYZW” - Vec4d - for “rotvec” - Vec3d - for “rotmat” - Mat3x3 - for “euler<mode>” - Vec3d - for “look_at” - Vec3d, Positionable or Tuple[Vec3d/Positionable, float], where float is the rotation around the forward direction vector in degrees
translation (Vector3d, optional) – translation applied to the Blender object (default: (0,0,0))
tag (str, optional) – name of the created object in Blender. If None is passed, the tag is automatically generated (default: None)
- Returns:
created and added to the scene object
- Return type:
- remove(obj_or_tag: Renderable | str)[source]¶
blendify.renderables.mesh module¶
- class blendify.renderables.mesh.Mesh(vertices: ndarray, faces: ndarray, tag: str, faces_material: Sequence[Sequence[int]] | None = None, **kwargs)[source]¶
Bases:
RenderableObject
Basic mesh, supports uniform (UniformColors), per-vertex (VertexColors) and texture (TextureColors and FileTextureColors) coloring with per-vertex uv (VertexUV) or per-face uv maps (FacesUV).
- Properties:
emit_shadow (bool, optional): control whether mesh will emit shadow from any light source in the scene
blendify.renderables.pointcloud module¶
MIT License
Copyright (c) 2018 Sebastian Bullinger Copyright (c) 2021 Vladimir Guzov and Ilia Petrov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- class blendify.renderables.pointcloud.ParticleMetadata(material_instance: MaterialInstance | None, extra_color_nodes: Tuple[ShaderNode], vertex_offset: int, num_particles: int, texture_image: Image | None)[source]¶
Bases:
object
Helper class that stores pointers to blender objects (colors, bsdf and material nodes), connected to each Particle System object
- extra_color_nodes: Tuple[ShaderNode]¶
- material_instance: MaterialInstance | None¶
- num_particles: int¶
- texture_image: Image | None¶
- vertex_offset: int¶
- class blendify.renderables.pointcloud.PointCloud(vertices: ndarray, tag: str, point_size: float = 0.006, base_primitive: str = 'CUBE', particle_emission_strength: int = 1, **kwargs)[source]¶
Bases:
Renderable
Basic point cloud consisting of vertices, supports uniform (UniformColors) and per-vertex (VertexColors) coloring. Uses Blender-Photogrammetry-Importer to handle point clouds as Blender particle systems objects
- Properties:
- emit_shadow (bool, optional): control whether particles representing the point cloud will emit shadow from
any light source in the scene. This property may be turned off if the particle_emission_strength is big enough to avoid artifacts.
- property emit_shadow¶
- update_colors(colors: Colors)[source]¶
Updates object color properties, sets Blender structures accordingly
- Parameters:
colors (Colors) – target colors information
blendify.renderables.primitives module¶
- class blendify.renderables.primitives.CircleMesh(radius: float, tag: str, num_vertices: int = 32, fill_type: str = 'NGON', **kwargs)[source]¶
Bases:
MeshPrimitive
Circle mesh primitive, supports only uniform coloring (UniformColors)
- Properties:
emit_shadow (bool, optional): control whether the object will emit shadow from any light source in the scene
- set_smooth(bool)¶
turns smooth shading on and off based on the bool argument.
- class blendify.renderables.primitives.CubeMesh(size: float, tag: str, **kwargs)[source]¶
Bases:
MeshPrimitive
Cube mesh primitive, supports only uniform coloring (UniformColors)
- Properties:
emit_shadow (bool, optional): control whether the object will emit shadow from any light source in the scene.
- set_smooth(bool)¶
turns smooth shading on and off based on the bool argument.
- class blendify.renderables.primitives.CurveBezier(keypoints: ndarray, radius: float, tag: str, **kwargs)[source]¶
Bases:
ParametricPrimitive
Bezier Curve, supports only uniform coloring (UniformColors)
- Properties:
emit_shadow (bool, optional): control whether the object will emit shadow from any light source in the scene
- class blendify.renderables.primitives.CylinderMesh(radius: float, height: float, tag: str, num_vertices: int = 32, fill_type: str = 'NGON', **kwargs)[source]¶
Bases:
MeshPrimitive
Cylinder mesh primitive, supports only uniform coloring (UniformColors)
- Properties:
emit_shadow (bool, optional): control whether the object will emit shadow from any light source in the scene.
- set_smooth(bool)¶
turns smooth shading on and off based on the bool argument.
- class blendify.renderables.primitives.EllipsoidNURBS(radius: ndarray | Tuple[float, float, float], tag: str, **kwargs)[source]¶
Bases:
ParametricPrimitive
- NURBS Ellipsoid, implemented as NURBS Sphere that is rescaled along axes,
supports only uniform coloring (UniformColors)
- Properties:
emit_shadow (bool, optional): control whether the object will emit shadow from any light source in the scene
- class blendify.renderables.primitives.MeshPrimitive(faces_material: Sequence[Sequence[int]] | None = None, **kwargs)[source]¶
Bases:
RenderableObject
Base class for mesh primitives. Used to throw Exceptions for non-implemented Colors subclasses (only UniformColors is supported) and add shared method for setting smooth shading.
- Properties:
emit_shadow (bool, optional): control whether the object will emit shadow from any light source in the scene.
- class blendify.renderables.primitives.ParametricPrimitive(**kwargs)[source]¶
Bases:
RenderableObject
Base class for parametric primitives. Used to throw Exceptions for non-implemented Colors subclasses (only UniformColors is supported) and non-implemented Materials (only one Material is supported).
- Properties:
emit_shadow (bool, optional): control whether the object will emit shadow from any light source in the scene.
- class blendify.renderables.primitives.PlaneMesh(size: float, tag: str, shadow_catcher: bool = False, **kwargs)[source]¶
Bases:
MeshPrimitive
Plane mesh primitive, supports only uniform coloring (UniformColors)
- Properties:
emit_shadow (bool, optional): control whether the object will emit shadow from any light source in the scene. shadow_catcher (bool, optional): control whether the object will act as a shadow catcher (i.e. object geometry is hidden from the render, only casted shadows are rendered).
- set_smooth(bool)¶
turns smooth shading on and off based on the bool argument.
- class blendify.renderables.primitives.SphereNURBS(radius: float, tag: str, **kwargs)[source]¶
Bases:
EllipsoidNURBS
NURBS Sphere, supports only uniform coloring (UniformColors)
- Properties:
emit_shadow (bool, optional): control whether the object will emit shadow from any light source in the scene