Overview
Project: rv
Package for describing rv scenes.
- Preview a scene with
rv preview <scene.py>. - Render a dataset with
rv render <scene.py>.
Modules
Module: domain
File: domain.py
Classes
class Domain
Scatter domain descriptor used by scene scattering methods.
Methods
kind
Signature
@property
def kind(self) -> strArguments
Returns: str
data
Signature
@property
def data(self) -> dictArguments
Returns: dict
dimension
Signature
@property
def dimension(self) -> intArguments
Returns: int
inset
Signature
def inset(self, margin: float) -> 'Domain'Arguments
margin:float
Returns: 'Domain'
rect
Signature
@staticmethod
def rect(center: Float2=(0.0, 0.0), size: Float2=(10.0, 10.0), z: float=0.0) -> 'Domain'Arguments
center:Float2size:Float2z:float
Returns: 'Domain'
custom
Signature
@staticmethod
def custom(*, dimension: int, contains_point: Callable[[mathutils.Vector, float], bool], aabb: Callable[[float], AABB], sample_point: Union[Callable[[random.Random, float], mathutils.Vector], None]=None, kind: str='custom', data: Union[dict, None]=None) -> 'Domain'Arguments
dimension:intcontains_point:Callable[[mathutils.Vector, float], bool]aabb:Callable[[float], AABB]sample_point:Union[Callable[[random.Random, float], mathutils.Vector], None]kind:strdata:Union[dict, None]
Returns: 'Domain'
ellipse
Signature
@staticmethod
def ellipse(center: Float2=(0.0, 0.0), radii: Float2=(5.0, 3.0), z: float=0.0) -> 'Domain'Arguments
center:Float2radii:Float2z:float
Returns: 'Domain'
polygon
Signature
@staticmethod
def polygon(points, z: float=0.0) -> 'Domain'Arguments
pointsz:float
Returns: 'Domain'
convex_polygon
Signature
@staticmethod
def convex_polygon(points, z: float=0.0) -> 'Domain'Arguments
pointsz:float
Returns: 'Domain'
box
Signature
@staticmethod
def box(center: Float3=(0.0, 0.0, 0.0), size: Float3=(10.0, 10.0, 10.0)) -> 'Domain'Arguments
center:Float3size:Float3
Returns: 'Domain'
cylinder
Signature
@staticmethod
def cylinder(center: Float3=(0.0, 0.0, 0.0), radius: float=5.0, height: float=10.0, axis: str='Z') -> 'Domain'Arguments
center:Float3radius:floatheight:floataxis:str
Returns: 'Domain'
ellipsoid
Signature
@staticmethod
def ellipsoid(center: Float3=(0.0, 0.0, 0.0), radii: Float3=(5.0, 3.0, 2.0)) -> 'Domain'Arguments
center:Float3radii:Float3
Returns: 'Domain'
convex_hull_2d
Signature
@staticmethod
def convex_hull_2d(rv_obj: Object) -> 'Domain'Arguments
rv_obj:Object
Returns: 'Domain'
convex_hull_3d
Signature
@staticmethod
def convex_hull_3d(rv_obj: Object) -> 'Domain'Arguments
rv_obj:Object
Returns: 'Domain'
convex_hull
Signature
@staticmethod
def convex_hull(rv_obj: Object, project_2d: bool=False) -> 'Domain'Arguments
rv_obj:Objectproject_2d:bool
Returns: 'Domain'
sample_point
Signature
def sample_point(self, rng: random.Random) -> mathutils.VectorArguments
rng:random.Random
Returns: mathutils.Vector
contains_point
Signature
def contains_point(self, point: mathutils.Vector, margin: float=0.0) -> boolArguments
point:mathutils.Vectormargin:float
Returns: bool
contains_object
Signature
def contains_object(self, obj: Object, margin: float=0.0, mode: Literal['aabb', 'mesh']='mesh') -> boolArguments
obj:Objectmargin:floatmode:Literal['aabb', 'mesh']
Returns: bool
aabb
Signature
def aabb(self) -> AABBArguments
Returns: AABB
Module: generators
File: generators.py
Classes
class GeneratorHandle
Methods
generate
Signature
def generate(self, **params) -> AnyArguments
**params
Returns: Any
generate_path
Signature
def generate_path(self, **params) -> strArguments
**params
Returns: str
generate_str
Signature
def generate_str(self, **params) -> strArguments
**params
Returns: Self
generate_num
Signature
def generate_num(self, **params) -> floatArguments
**params
Returns: float
class GeneratorFactory
Methods
init
Signature
def init(self, command: str) -> GeneratorHandleArguments
command:str
Returns: GeneratorHandle
Module: material
File: material.py
Classes
class Material
Inherits from: ABC, _Serializable
Base class for material descriptors.
A material descriptor is converted to a real Blender material when assigned to an object.
Attributes
| Name | Type | Description |
|---|---|---|
name | Union[str, None] | |
index | Union[int, None] |
Methods
set_params
Signature
@abstractmethod
def set_params(self, **kwargs) -> SelfArguments
**kwargs
Returns: Self
class BasicMaterial
Inherits from: Material
Material descriptor backed by Blender's Principled BSDF shader.
Attributes
| Name | Type | Description |
|---|---|---|
base_color | Union[ColorRGBA, None] | |
roughness | Union[float, None] | |
metallic | Union[float, None] | |
specular | Union[float, None] | |
emission_color | Union[ColorRGBA, None] | |
emission_strength | Union[float, None] | |
alpha | Union[float, None] | |
transmission | Union[float, None] | |
ior | Union[float, None] | |
properties | dict |
Methods
set_params
Signature
def set_params(self, base_color: OptionalColor=None, roughness: Union[float, None]=None, metallic: Union[float, None]=None, specular: Union[float, None]=None, emission_color: OptionalColor=None, emission_strength: Union[float, None]=None, alpha: Union[float, None]=None, transmission: Union[float, None]=None, ior: Union[float, None]=None) -> SelfArguments
base_color:OptionalColorroughness:Union[float, None]metallic:Union[float, None]specular:Union[float, None]emission_color:OptionalColoremission_strength:Union[float, None]alpha:Union[float, None]transmission:Union[float, None]ior:Union[float, None]
Returns: Self
set_property
Signature
def set_property(self, key: str, value: Any)Arguments
key:strvalue:Any
Returns: Self
class ImportedMaterial
Inherits from: Material
Material descriptor that imports a material from another .blend file.
Attributes
| Name | Type | Description |
|---|---|---|
filepath | str | |
material_name | Union[str, None] | |
params | dict |
Methods
set_params
Signature
def set_params(self, **kwargs: Any)Arguments
**kwargs:Any
Returns: Self
Module: object
File: object.py
Classes
class ObjectStats
Geometric inspection snapshot for an object or loader instance.
Attributes
| Name | Type | Description |
|---|---|---|
name | str | |
type | str | |
dimensions_world | Float3 | |
dimensions_local | Float3 | |
bounds_world | dict[str, Float3] | |
bounds_local | dict[str, Float3] | |
scale | Float3 |
Methods
to_dict
Convert to JSON-compatible dictionary for metadata serialization.
Signature
def to_dict(self) -> dict[str, JSONSerializable]Arguments
Returns: dict[str, JSONSerializable]
class ObjectLoader
Helper for creating object instances from a loaded Blender object source.
Methods
set_source
Rebind this loader to use an existing object as its instancing prototype.
Signature
def set_source(self, source: 'Object') -> 'ObjectLoader'Arguments
source:'Object'
Returns: Self
create_instance
Create a single object instance from a loader.
Signature
def create_instance(self, name: Union[str, None]=None, register_object: bool=True, linked_data: bool=True) -> 'Object'Arguments
name:Union[str, None]register_object:boollinked_data:bool
Returns: Self
class Object
Inherits from: _Serializable
Wrapper around a Blender object with chainable transformation and metadata helpers.
Attributes
| Name | Type | Description |
|---|---|---|
obj | bpy.types.Object | |
scene | 'Scene' | |
tags | TagSet | |
properties | dict | |
modifier_parameters | list[dict[str, JSONSerializable]] | |
index | Union[int, None] |
Methods
as_loader
Create an ObjectLoader that instances this object.
Signature
def as_loader(self) -> ObjectLoaderArguments
Returns: ObjectLoader
copy
Duplicate this object.
If linked_data is False, mesh/light/camera data is copied as well.
Signature
def copy(self, name: Union[str, None]=None, linked_data: bool=True, register_object: bool=True) -> 'Object'Arguments
name:Union[str, None]linked_data:boolregister_object:bool
Returns: Self
set_location
Set the location of the object in 3D space.
Signature
def set_location(self, location: Union[mathutils.Vector, Sequence[float]])Arguments
location:Union[mathutils.Vector, Sequence[float]]
Returns: Self
get_location
Get the object location as an (x, y, z) tuple.
Signature
def get_location(self) -> Float3Arguments
Returns: Float3
move
Translate the object by the given offsets.
Signature
def move(self, dx: float=0.0, dy: float=0.0, dz: float=0.0) -> 'Object'Arguments
dx:floatdy:floatdz:float
Returns: Self
set_rotation
Set the rotation of the object.
Signature
def set_rotation(self, rotation: Union[mathutils.Euler, mathutils.Quaternion])Arguments
rotation:Union[mathutils.Euler, mathutils.Quaternion]
Returns: Self
set_scale
Set the scale of the object.
If scale is a single numeric value, all axes are set to that value. If scale is a sequence or Vector of length 3, each axis is set individually.
Signature
def set_scale(self, scale: Union[mathutils.Vector, Sequence[float], float, int])Arguments
scale:Union[mathutils.Vector, Sequence[float], float, int]
Returns: Self
set_property
Set a property of the object. Properties can be used inside object's material nodes.
Signature
def set_property(self, key: str, value: Any)Arguments
key:strvalue:Any
Returns: Self
set_modifier_input
Set an exposed Geometry Nodes modifier input.
If modifier_name is omitted, rv searches for a unique Geometry Nodes modifier that exposes the requested input.
Signature
def set_modifier_input(self, input_name: str, value: Any, modifier_name: Union[str, None]=None)Arguments
input_name:strvalue:Anymodifier_name:Union[str, None]
Returns: Self
set_material
Set object material in the given slot.
Signature
def set_material(self, material: 'Material', slot: int=0)Arguments
material:'Material'slot:int
Returns: Self
add_material
Append material to object's material slots.
Signature
def add_material(self, material: 'Material')Arguments
material:'Material'
Returns: Self
clear_materials
Remove all materials from object.
Signature
def clear_materials(self)Arguments
Returns: Self
set_tags
Set object's tags.
Tags are used to represent object class for training a computer vision model. Object can have more then one tag.
Signature
def set_tags(self, *tags: Union[str, list[str]])Arguments
*tags:Union[str, list[str]]
Returns: Self
add_tags
Add tags to the object.
Tags are used to represent object class for training a computer vision model. Object can have more then one tag.
Signature
def add_tags(self, *tags: Union[str, list[str]])Arguments
*tags:Union[str, list[str]]
Returns: Self
point_at
Orients the current object to point at another object, with an optional rotation around the direction vector.
Signature
def point_at(self, rv_obj: 'Object', angle: float=0.0)Arguments
rv_obj:'Object'angle:float
Returns: Self
rotate_around_axis
Rotate object around an axis.
Signature
def rotate_around_axis(self, axis: mathutils.Vector, angle: float)Arguments
axis:mathutils.Vectorangle:float
Returns: Self
set_shading
Set shading to flat, smooth, or auto.
Signature
def set_shading(self, shading: Literal['flat', 'smooth', 'auto'])Arguments
shading:Literal['flat', 'smooth', 'auto']
Returns: Self
show_debug_axes
Show debug axes that can be seen in the preview mode.
Signature
def show_debug_axes(self, show=True)Arguments
show
Returns: Self
show_debug_name
Show object's name that can be seen in the preview mode.
Signature
def show_debug_name(self, show)Arguments
show
Returns: Self
hide
Hide object from render output while controlling preview visibility.
Signature
def hide(self, view: Literal['wireframe', 'none']='wireframe')Arguments
view:Literal['wireframe', 'none']
Returns: Self
get_dimensions
Get object dimensions (axis-aligned extents) in world or local space.
Signature
def get_dimensions(self, space: Literal['world', 'local']='world') -> Float3Arguments
space:Literal['world', 'local']
Returns: Float3
inspect
Inspect geometric stats for this object.
Signature
def inspect(self, applied_scale: bool=True) -> ObjectStatsArguments
applied_scale:bool
Returns: ObjectStats
get_bounds
Get axis-aligned bounds in world or local space.
Signature
def get_bounds(self, space: Literal['world', 'local']='world') -> dict[str, Float3]Arguments
space:Literal['world', 'local']
Returns: dict[str, Float3]
add_rigidbody
Add or update rigid-body settings for this object.
Signature
def add_rigidbody(self, mode: Literal['box', 'sphere', 'hull', 'mesh', 'capsule', 'cylinder', 'cone']='hull', mesh_source: Literal['BASE', 'DEFORM', 'FINAL']='FINAL', body_type: Literal['ACTIVE', 'PASSIVE']='ACTIVE', mass: float=1.0, friction: float=0.5, restitution: float=0.0, linear_damping: float=0.04, angular_damping: float=0.1, use_margin: bool=True, collision_margin: Union[float, None]=None, use_deactivation: Union[bool, None]=None, deactivate_linear_velocity: Union[float, None]=None, deactivate_angular_velocity: Union[float, None]=None, start_deactivated: Union[bool, None]=None) -> 'Object'Arguments
mode:Literal['box', 'sphere', 'hull', 'mesh', 'capsule', 'cylinder', 'cone']mesh_source:Literal['BASE', 'DEFORM', 'FINAL']body_type:Literal['ACTIVE', 'PASSIVE']mass:floatfriction:floatrestitution:floatlinear_damping:floatangular_damping:floatuse_margin:boolcollision_margin:Union[float, None]use_deactivation:Union[bool, None]deactivate_linear_velocity:Union[float, None]deactivate_angular_velocity:Union[float, None]start_deactivated:Union[bool, None]
Returns: Self
remove_rigidbody
Remove rigid body from this object if present.
Signature
def remove_rigidbody(self, keep_transform: bool=True) -> 'Object'Arguments
keep_transform:bool
Returns: Self
class Camera
Inherits from: Object
Object specialization with camera-specific controls.
Methods
set_fov
Sets the field of view (FOV) for the object's camera in degrees.
Signature
def set_fov(self, angle: float)Arguments
angle:float
Returns: Self
class Light
Inherits from: Object
Base object wrapper for Blender lights with chainable parameter setters.
Methods
light_data
Return the underlying Blender light datablock.
Signature
@property
def light_data(self) -> bpy.types.LightArguments
Returns: bpy.types.Light
set_color
Set light RGB color. Alpha (if provided) is ignored.
Signature
def set_color(self, color: Color) -> SelfArguments
color:Color
Returns: Self
set_power
Set light power in Blender energy units.
Signature
def set_power(self, power: float) -> SelfArguments
power:float
Returns: Self
set_cast_shadow
Enable or disable shadow casting.
Signature
def set_cast_shadow(self, enabled: bool=True) -> SelfArguments
enabled:bool
Returns: Self
set_specular_factor
Set the light contribution to specular highlights.
Signature
def set_specular_factor(self, factor: float) -> SelfArguments
factor:float
Returns: Self
set_softness
Set softness parameter mapped to the current light type.
Signature
def set_softness(self, value: float) -> SelfArguments
value:float
Returns: Self
set_params
Set known light-data attributes or custom properties.
Signature
def set_params(self, **kwargs) -> SelfArguments
**kwargs
Returns: Self
class PointLight
Inherits from: Light
Point light with radius control.
Methods
set_radius
Set point light radius.
Signature
def set_radius(self, radius: float) -> 'PointLight'Arguments
radius:float
Returns: Self
class SunLight
Inherits from: Light
Directional sun light with angular size control.
Methods
set_angle
Set sun angular size in degrees.
Signature
def set_angle(self, angle: float) -> 'SunLight'Arguments
angle:float
Returns: Self
class AreaLight
Inherits from: Light
Area light with shape and size controls.
Methods
set_shape
Set area light shape.
Signature
def set_shape(self, shape: Literal['SQUARE', 'RECTANGLE', 'DISK', 'ELLIPSE']) -> 'AreaLight'Arguments
shape:Literal['SQUARE', 'RECTANGLE', 'DISK', 'ELLIPSE']
Returns: Self
set_size
Set primary area light size.
Signature
def set_size(self, size: float) -> 'AreaLight'Arguments
size:float
Returns: Self
set_size_xy
Set area light X and Y sizes.
Signature
def set_size_xy(self, size_x: float, size_y: float) -> 'AreaLight'Arguments
size_x:floatsize_y:float
Returns: Self
class SpotLight
Inherits from: Light
Spot light with cone and blend controls.
Methods
set_spot_size
Set spotlight cone angle in degrees.
Signature
def set_spot_size(self, angle: float) -> 'SpotLight'Arguments
angle:float
Returns: Self
set_blend
Set spotlight edge softness in the [0, 1] range.
Signature
def set_blend(self, blend: float) -> 'SpotLight'Arguments
blend:float
Returns: Self
set_show_cone
Show or hide the spotlight cone in viewport.
Signature
def set_show_cone(self, show: bool=True) -> 'SpotLight'Arguments
show:bool
Returns: Self
Module: passes
File: passes.py
Enums
RenderPass
Enum representing the supported render passes available for export. To enable them, use Scene.set_passes method.
For full documentation view blender docs
Variants
| Name | Description |
|---|---|
Z | |
VECTOR | |
MIST | |
POSITION | |
NORMAL | |
UV | |
OBJECT_INDEX | |
MATERIAL_INDEX | |
SHADOW | |
AO | |
EMISSION | |
ENVIRONMENT | |
SHADOW_CATCHER | |
DIFFUSE_COLOR | |
DIFFUSE_DIRECT | |
DIFFUSE_INDIRECT | |
GLOSSY_COLOR | |
GLOSSY_DIRECT | |
GLOSSY_INDIRECT | |
TRANSMISSION_COLOR | |
TRANSMISSION_DIRECT | |
TRANSMISSION_INDIRECT | |
CRYPTO_OBJECT | |
CRYPTO_MATERIAL | |
CRYPTO_ASSET |
Module: physics
File: physics.py
Functions
simulate_physics
Simulate current Blender rigid-body world for a fixed number of frames.
Details
Signature
def simulate_physics(frames: int=20, substeps: int=10, time_scale: float=1.0, solver_iterations: Union[int, None]=None, use_split_impulse: Union[bool, None]=None, split_impulse_penetration_threshold: Union[float, None]=None) -> NoneArguments
frames:intsubsteps:inttime_scale:floatsolver_iterations:Union[int, None]use_split_impulse:Union[bool, None]split_impulse_penetration_threshold:Union[float, None]
Returns: None
Module: scene
File: scene.py
Classes
class ObjectFactory
Methods
empty
Signature
def empty(self, name: str='Empty') -> 'Object'Arguments
name:str
Returns: 'Object'
sphere
Signature
def sphere(self, name: str='Sphere', radius: float=1.0, segments: int=32, ring_count: int=16) -> 'Object'Arguments
name:strradius:floatsegments:intring_count:int
Returns: 'Object'
cube
Signature
def cube(self, name: str='Cube', size: float=2.0) -> 'Object'Arguments
name:strsize:float
Returns: 'Object'
plane
Signature
def plane(self, name: str='Plane', size: float=2.0) -> 'Object'Arguments
name:strsize:float
Returns: 'Object'
class LightFactory
Methods
point
Signature
def point(self, name: str='Point', power: float=1000.0) -> 'PointLight'Arguments
name:strpower:float
Returns: Self
sun
Signature
def sun(self, name: str='Sun', power: float=1.0) -> 'SunLight'Arguments
name:strpower:float
Returns: Self
area
Signature
def area(self, name: str='Area', power: float=100.0) -> 'AreaLight'Arguments
name:strpower:float
Returns: Self
spot
Signature
def spot(self, name: str='Spot', power: float=1000.0) -> 'SpotLight'Arguments
name:strpower:float
Returns: Self
class MaterialFactory
Methods
basic
Signature
def basic(self, name: str='Material') -> 'BasicMaterial'Arguments
name:str
Returns: 'BasicMaterial'
imported
Signature
def imported(self, blendfile: str, material_name: Union[str, None]=None) -> 'ImportedMaterial'Arguments
blendfile:strmaterial_name:Union[str, None]
Returns: 'ImportedMaterial'
class AssetFactory
Methods
object
Signature
def object(self, blendfile: str, import_name: Union[str, None]=None) -> 'ObjectLoader'Arguments
blendfile:strimport_name:Union[str, None]
Returns: 'ObjectLoader'
objects
Signature
def objects(self, blendfile: str, import_names: Union[list[str], None]=None) -> list['ObjectLoader']Arguments
blendfile:strimport_names:Union[list[str], None]
Returns: Self
class Scene
Inherits from: ABC, _Serializable
Attributes
| Name | Type | Description |
|---|---|---|
resolution | Resolution | |
time_limit | float | |
passes | RenderPassSet | |
output_dir | Optional[str] | |
subdir | Union[str, None] | |
camera | 'Camera' | |
world | 'World' | |
tags | TagSet | |
objects | ObjectFactory | |
materials | MaterialFactory | |
lights | LightFactory | |
assets | AssetFactory | |
generators | GeneratorFactory | |
semantic_channels | SemanticChannelSet | |
semantic_mask_threshold | float | |
seed | Union[int, None] | |
seed_mode | Union[str, None] | |
object_index_counter | int | |
material_index_counter | int | |
light_index_counter | int |
Methods
generate
Signature
@abstractmethod
def generate(self, seed: Union[int, None]=None) -> NoneArguments
seed:Union[int, None]
Returns: None
set_rendering_time_limit
Signature
def set_rendering_time_limit(self, time_limit: float=3.0)Arguments
time_limit:float
Returns: Self
generated_objects
Signature
@property
def generated_objects(self) -> tuple['Object', ...]Arguments
Returns: tuple['Object', ...]
generated_materials
Signature
@property
def generated_materials(self) -> tuple['Material', ...]Arguments
Returns: tuple['Material', ...]
generated_lights
Signature
@property
def generated_lights(self) -> tuple['Light', ...]Arguments
Returns: tuple['Light', ...]
set_passes
Signature
def set_passes(self, *passes: tuple[Union[RenderPass, list[RenderPass]], ...])Arguments
*passes:tuple[Union[RenderPass, list[RenderPass]], ...]
Returns: Self
enable_semantic_channels
Signature
def enable_semantic_channels(self, *channels: tuple[Union[str, list[str]], ...]) -> 'Scene'Arguments
*channels:tuple[Union[str, list[str]], ...]
Returns: Self
set_semantic_mask_threshold
Signature
def set_semantic_mask_threshold(self, threshold: float) -> 'Scene'Arguments
threshold:float
Returns: Self
set_tags
Signature
def set_tags(self, *tags) -> 'Scene'Arguments
*tags
Returns: Self
add_tags
Signature
def add_tags(self, *tags) -> 'Scene'Arguments
*tags
Returns: Self
inspect_object
Signature
def inspect_object(self, loader_or_obj: Union['ObjectLoader', 'Object'], applied_scale: bool=True) -> ObjectStatsArguments
loader_or_obj:Union['ObjectLoader', 'Object']applied_scale:bool
Returns: Self
scatter
Signature
def scatter(self, source: ScatterSource, count: int, domain: 'Domain', *, method: Literal['auto', 'fast', 'exact']='auto', gap: float=0.0, scale: Union[float, Float2]=1.0, rotation: Literal['yaw', 'free']='yaw', yaw: Float2=(0.0, 360.0), margin: float=0.0, seed: Union[int, None]=None, unique_data: bool=False, on_create=None, max_attempts_per_object: int=100) -> list['Object']Arguments
source:ScatterSourcecount:intdomain:'Domain'method:Literal['auto', 'fast', 'exact']gap:floatscale:Union[float, Float2]rotation:Literal['yaw', 'free']yaw:Float2margin:floatseed:Union[int, None]unique_data:boolon_createmax_attempts_per_object:int
Returns: Self
Module: shader
File: shader.py
Classes
class Expr
Attributes
| Name | Type | Description |
|---|---|---|
value_type | str |
Methods
compile
Signature
def compile(self, compiler: '_ShaderGraphCompiler') -> bpy.types.NodeSocketArguments
compiler:'_ShaderGraphCompiler'
Returns: bpy.types.NodeSocket
node_height
Signature
def node_height(self) -> intArguments
Returns: int
to_meta
Signature
def to_meta(self) -> dict[str, Any]Arguments
Returns: Self
x_depth
Signature
@cached_property
def x_depth(self) -> intArguments
Returns: int
class FloatExpr
Inherits from: Expr
class ColorExpr
Inherits from: Expr
class VectorExpr
Inherits from: Expr
class NormalExpr
Inherits from: VectorExpr
class ShaderExpr
Inherits from: Expr
class Value
Inherits from: FloatExpr
Attributes
| Name | Type | Description |
|---|---|---|
value | float |
Methods
compile
Signature
def compile(self, compiler: '_ShaderGraphCompiler') -> bpy.types.NodeSocketArguments
compiler:'_ShaderGraphCompiler'
Returns: bpy.types.NodeSocket
node_height
Signature
def node_height(self) -> intArguments
Returns: int
class ColorValue
Inherits from: ColorExpr
Attributes
| Name | Type | Description |
|---|---|---|
value | tuple[float, ...] |
Methods
compile
Signature
def compile(self, compiler: '_ShaderGraphCompiler') -> bpy.types.NodeSocketArguments
compiler:'_ShaderGraphCompiler'
Returns: bpy.types.NodeSocket
node_height
Signature
def node_height(self) -> intArguments
Returns: int
class VectorValue
Inherits from: VectorExpr
Attributes
| Name | Type | Description |
|---|---|---|
value | tuple[float, ...] |
Methods
compile
Signature
def compile(self, compiler: '_ShaderGraphCompiler') -> bpy.types.NodeSocketArguments
compiler:'_ShaderGraphCompiler'
Returns: bpy.types.NodeSocket
node_height
Signature
def node_height(self) -> intArguments
Returns: int
class BinaryMath
Inherits from: Expr
Attributes
| Name | Type | Description |
|---|---|---|
operation | str | |
left | Expr | |
right | Expr |
Methods
compile
Signature
def compile(self, compiler: '_ShaderGraphCompiler') -> bpy.types.NodeSocketArguments
compiler:'_ShaderGraphCompiler'
Returns: bpy.types.NodeSocket
node_height
Signature
def node_height(self) -> intArguments
Returns: int
class TextureImage
Inherits from: ColorExpr
Attributes
| Name | Type | Description |
|---|---|---|
path | str | |
colorspace | str | |
interpolation | str | |
projection | str |
Methods
compile
Signature
def compile(self, compiler: '_ShaderGraphCompiler') -> bpy.types.NodeSocketArguments
compiler:'_ShaderGraphCompiler'
Returns: bpy.types.NodeSocket
node_height
Signature
def node_height(self) -> intArguments
Returns: int
class NormalMap
Inherits from: NormalExpr
Attributes
| Name | Type | Description |
|---|---|---|
color | ShaderValueLike | |
strength | ShaderValueLike | |
space | str |
Methods
compile
Signature
def compile(self, compiler: '_ShaderGraphCompiler') -> bpy.types.NodeSocketArguments
compiler:'_ShaderGraphCompiler'
Returns: bpy.types.NodeSocket
node_height
Signature
def node_height(self) -> intArguments
Returns: int
class PrincipledBSDF
Inherits from: ShaderExpr
Attributes
| Name | Type | Description |
|---|---|---|
base_color | Union[ShaderValueLike, None] | |
metallic | Union[ShaderValueLike, None] | |
roughness | Union[ShaderValueLike, None] | |
specular | Union[ShaderValueLike, None] | |
normal | Union[ShaderValueLike, None] | |
emission_color | Union[ShaderValueLike, None] | |
emission_strength | Union[ShaderValueLike, None] | |
alpha | Union[ShaderValueLike, None] | |
transmission | Union[ShaderValueLike, None] | |
ior | Union[ShaderValueLike, None] |
Methods
compile
Signature
def compile(self, compiler: '_ShaderGraphCompiler') -> bpy.types.NodeSocketArguments
compiler:'_ShaderGraphCompiler'
Returns: bpy.types.NodeSocket
node_height
Signature
def node_height(self) -> intArguments
Returns: int
class ShaderMaterial
Inherits from: Material
Attributes
| Name | Type | Description |
|---|---|---|
shader | ShaderExpr | |
properties | dict[str, Any] |
Methods
set_params
Signature
def set_params(self, shader: Union[ShaderExpr, None]=None) -> SelfArguments
shader:Union[ShaderExpr, None]— type: ignore[override]
Returns: Self
set_property
Signature
def set_property(self, key: str, value: Any)Arguments
key:strvalue:Any
Returns: Self
Module: world
File: world.py
Classes
class World
Inherits from: ABC
Base class representing world (environment ligthing).
Methods
set_params
Update world-specific lighting parameters.
Signature
@abstractmethod
def set_params(self) -> SelfArguments
Returns: Self
class BasicWorld
Inherits from: World
World class representing a single color environmental lighting.
Attributes
| Name | Type | Description |
|---|---|---|
color | Union[ColorRGBA, None] | |
strength | Union[float, None] |
Methods
set_params
Signature
def set_params(self, color: Union[ColorRGBA, None]=None, strength: Union[float, None]=None)Arguments
color:Union[ColorRGBA, None]strength:Union[float, None]
Returns: Self
class SkyWorld
Inherits from: World
World class representing a procedural sky environement.
For more information, view official blender docs.
Attributes
| Name | Type | Description |
|---|---|---|
strength | Union[float, None] | |
sun_size | Union[float, None] | |
sun_intensity | Union[float, None] | |
sun_elevation | Union[float, None] | |
rotation_z | Union[float, None] | |
altitude | Union[float, None] | |
air | float | |
aerosol_density | float | |
ozone | float |
Methods
set_params
Signature
def set_params(self, strength: Union[float, None]=None, sun_size: Union[float, None]=None, sun_intensity: Union[float, None]=None, sun_elevation: Union[float, None]=None, rotation_z: Union[float, None]=None, air: Union[float, None]=None, aerosol_density: Union[float, None]=None, ozone: Union[float, None]=None)Arguments
strength:Union[float, None]sun_size:Union[float, None]sun_intensity:Union[float, None]sun_elevation:Union[float, None]rotation_z:Union[float, None]air:Union[float, None]aerosol_density:Union[float, None]ozone:Union[float, None]
Returns: Self
class HDRIWorld
Inherits from: World
World class for importing lighting from an hdri .exr file.
Attributes
| Name | Type | Description |
|---|---|---|
hdri_path | str | |
strength | Union[float, None] | |
rotation_z | Union[float, None] |
Methods
set_params
Signature
def set_params(self, hdri_path: Union[str, None]=None, strength: Union[float, None]=None, rotation_z: Union[float, None]=None)Arguments
hdri_path:Union[str, None]strength:Union[float, None]rotation_z:Union[float, None]
Returns: Self
class ImportedWorld
Inherits from: World
World class for importing environment lighting from a .blend file.
Attributes
| Name | Type | Description |
|---|---|---|
filepath | str | |
world_name | Union[str, None] | |
params | dict |