nodes.shader.vector

vector

Classes

Name Description
Bump Generate a perturbed normal from a height texture for bump mapping. Typically used for faking highly detailed surfaces
Displacement Displace the surface along the surface normal
Mapping Transform the input vector by applying translation, rotation, and scale
Normal Generate a normal vector and a dot product
NormalMap Generate a perturbed normal from an RGB normal map image. Typically used for faking highly detailed surfaces
VectorDisplacement Displace the surface along an arbitrary direction
VectorTransform Convert a vector, point, or normal between world, camera, and object coordinate space

Bump

Bump(
    strength=1.0,
    distance=0.001,
    filter_width=0.1,
    height=None,
    normal=None,
    *,
    invert=False,
)

Generate a perturbed normal from a height texture for bump mapping. Typically used for faking highly detailed surfaces

Parameters

Name Type Description Default
strength InputFloat Strength 1.0
distance InputFloat Distance 0.001
filter_width InputFloat Filter Width 0.1
height InputFloat Height None
normal InputVector Normal None

Attributes

Name Description
i
invert
name The name of the node being wrapped by this instance.
node
o
tree The TreeBuilder instance this node belongs to and is being built within.

Methods

Name Description
props Set the properties every node has and return the node, so it can
props
props(
    label=None,
    color=None,
    width=None,
    height=None,
    hide=None,
    show_options=None,
    hide_inputs=(),
    hide_outputs=(),
    mute=None,
    warning_propagation=None,
    pin_gizmo=None,
    pin_gizmo_inputs=(),
)

Set the properties every node has and return the node, so it can go at the end of a chain::

g.SetPosition(geometry=geo, offset=offset).props(
    label="Lift", color="#FFAA00", width=200
)

Properties left as None are unchanged.

Args: label: The node’s header label. color: A custom header colour, as a hex string ("#FFAA00") or an (r, g, b) tuple; turns on use_custom_color. width: The node’s width. height: The node’s height; only frames use it. hide: Collapse the node. show_options: Show the node’s options (dropdowns and toggles). hide_inputs: Input sockets to hide, by name; "Value#1" names the second visible Value. hide_outputs: Output sockets to hide, by name. mute: Mute (bypass) the node. warning_propagation: Which of the node’s warnings show on the group node it sits in. pin_gizmo: Keep the node’s gizmo visible when it isn’t selected: a gizmo node’s, or a value node’s (Value, Vector, …). pin_gizmo_inputs: Inputs whose gizmos stay visible when the node isn’t selected, by name; for group nodes passing a gizmo through.

Inputs

Attribute Type Description
i.strength FloatSocket Strength
i.distance FloatSocket Distance
i.filter_width FloatSocket Filter Width
i.height FloatSocket Height
i.normal VectorSocket Normal

Outputs

Attribute Type Description
o.normal VectorSocket Normal

Displacement

Displacement(
    height=0.0,
    midlevel=0.5,
    scale=0.01,
    normal=None,
    *,
    space='OBJECT',
)

Displace the surface along the surface normal

Parameters

Name Type Description Default
height InputFloat Height 0.0
midlevel InputFloat Midlevel 0.5
scale InputFloat Scale 0.01
normal InputVector Normal None

Attributes

Name Description
i
name The name of the node being wrapped by this instance.
node
o
space
tree The TreeBuilder instance this node belongs to and is being built within.

Methods

Name Description
props Set the properties every node has and return the node, so it can
props
props(
    label=None,
    color=None,
    width=None,
    height=None,
    hide=None,
    show_options=None,
    hide_inputs=(),
    hide_outputs=(),
    mute=None,
    warning_propagation=None,
    pin_gizmo=None,
    pin_gizmo_inputs=(),
)

Set the properties every node has and return the node, so it can go at the end of a chain::

g.SetPosition(geometry=geo, offset=offset).props(
    label="Lift", color="#FFAA00", width=200
)

Properties left as None are unchanged.

Args: label: The node’s header label. color: A custom header colour, as a hex string ("#FFAA00") or an (r, g, b) tuple; turns on use_custom_color. width: The node’s width. height: The node’s height; only frames use it. hide: Collapse the node. show_options: Show the node’s options (dropdowns and toggles). hide_inputs: Input sockets to hide, by name; "Value#1" names the second visible Value. hide_outputs: Output sockets to hide, by name. mute: Mute (bypass) the node. warning_propagation: Which of the node’s warnings show on the group node it sits in. pin_gizmo: Keep the node’s gizmo visible when it isn’t selected: a gizmo node’s, or a value node’s (Value, Vector, …). pin_gizmo_inputs: Inputs whose gizmos stay visible when the node isn’t selected, by name; for group nodes passing a gizmo through.

Inputs

Attribute Type Description
i.height FloatSocket Height
i.midlevel FloatSocket Midlevel
i.scale FloatSocket Scale
i.normal VectorSocket Normal

Outputs

Attribute Type Description
o.displacement VectorSocket Displacement

Mapping

Mapping(
    vector=(0.0, 0.0, 0.0),
    location=(0.0, 0.0, 0.0),
    rotation=(0.0, 0.0, 0.0),
    scale=(1.0, 1.0, 1.0),
    *,
    vector_type='POINT',
)

Transform the input vector by applying translation, rotation, and scale

Parameters

Name Type Description Default
vector InputVector Vector (0.0, 0.0, 0.0)
location InputVector Location (0.0, 0.0, 0.0)
rotation InputVector Rotation (0.0, 0.0, 0.0)
scale InputVector Scale (1.0, 1.0, 1.0)

Attributes

Name Description
i
name The name of the node being wrapped by this instance.
node
o
tree The TreeBuilder instance this node belongs to and is being built within.
vector_type

Methods

Name Description
normal Create Mapping with operation ‘Normal’. Transform a unit normal vector (Location is ignored)
point Create Mapping with operation ‘Point’. Transform a point
props Set the properties every node has and return the node, so it can
texture Create Mapping with operation ‘Texture’. Transform a texture by inverse mapping the texture coordinate
vector Create Mapping with operation ‘Vector’. Transform a direction vector (Location is ignored)
normal
normal(vector=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0), scale=(1.0, 1.0, 1.0))

Create Mapping with operation ‘Normal’. Transform a unit normal vector (Location is ignored)

point
point(
    vector=(0.0, 0.0, 0.0),
    location=(0.0, 0.0, 0.0),
    rotation=(0.0, 0.0, 0.0),
    scale=(1.0, 1.0, 1.0),
)

Create Mapping with operation ‘Point’. Transform a point

props
props(
    label=None,
    color=None,
    width=None,
    height=None,
    hide=None,
    show_options=None,
    hide_inputs=(),
    hide_outputs=(),
    mute=None,
    warning_propagation=None,
    pin_gizmo=None,
    pin_gizmo_inputs=(),
)

Set the properties every node has and return the node, so it can go at the end of a chain::

g.SetPosition(geometry=geo, offset=offset).props(
    label="Lift", color="#FFAA00", width=200
)

Properties left as None are unchanged.

Args: label: The node’s header label. color: A custom header colour, as a hex string ("#FFAA00") or an (r, g, b) tuple; turns on use_custom_color. width: The node’s width. height: The node’s height; only frames use it. hide: Collapse the node. show_options: Show the node’s options (dropdowns and toggles). hide_inputs: Input sockets to hide, by name; "Value#1" names the second visible Value. hide_outputs: Output sockets to hide, by name. mute: Mute (bypass) the node. warning_propagation: Which of the node’s warnings show on the group node it sits in. pin_gizmo: Keep the node’s gizmo visible when it isn’t selected: a gizmo node’s, or a value node’s (Value, Vector, …). pin_gizmo_inputs: Inputs whose gizmos stay visible when the node isn’t selected, by name; for group nodes passing a gizmo through.

texture
texture(
    vector=(0.0, 0.0, 0.0),
    location=(0.0, 0.0, 0.0),
    rotation=(0.0, 0.0, 0.0),
    scale=(1.0, 1.0, 1.0),
)

Create Mapping with operation ‘Texture’. Transform a texture by inverse mapping the texture coordinate

vector
vector(vector=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0), scale=(1.0, 1.0, 1.0))

Create Mapping with operation ‘Vector’. Transform a direction vector (Location is ignored)

Inputs

Attribute Type Description
i.vector VectorSocket Vector
i.location VectorSocket Location
i.rotation VectorSocket Rotation
i.scale VectorSocket Scale

Outputs

Attribute Type Description
o.vector VectorSocket Vector

Normal

Normal(normal=(0.0, 0.0, 1.0))

Generate a normal vector and a dot product

Parameters

Name Type Description Default
normal InputVector Normal (0.0, 0.0, 1.0)

Attributes

Name Description
i
name The name of the node being wrapped by this instance.
node
o
tree The TreeBuilder instance this node belongs to and is being built within.

Methods

Name Description
props Set the properties every node has and return the node, so it can
props
props(
    label=None,
    color=None,
    width=None,
    height=None,
    hide=None,
    show_options=None,
    hide_inputs=(),
    hide_outputs=(),
    mute=None,
    warning_propagation=None,
    pin_gizmo=None,
    pin_gizmo_inputs=(),
)

Set the properties every node has and return the node, so it can go at the end of a chain::

g.SetPosition(geometry=geo, offset=offset).props(
    label="Lift", color="#FFAA00", width=200
)

Properties left as None are unchanged.

Args: label: The node’s header label. color: A custom header colour, as a hex string ("#FFAA00") or an (r, g, b) tuple; turns on use_custom_color. width: The node’s width. height: The node’s height; only frames use it. hide: Collapse the node. show_options: Show the node’s options (dropdowns and toggles). hide_inputs: Input sockets to hide, by name; "Value#1" names the second visible Value. hide_outputs: Output sockets to hide, by name. mute: Mute (bypass) the node. warning_propagation: Which of the node’s warnings show on the group node it sits in. pin_gizmo: Keep the node’s gizmo visible when it isn’t selected: a gizmo node’s, or a value node’s (Value, Vector, …). pin_gizmo_inputs: Inputs whose gizmos stay visible when the node isn’t selected, by name; for group nodes passing a gizmo through.

Inputs

Attribute Type Description
i.normal VectorSocket Normal

Outputs

Attribute Type Description
o.normal VectorSocket Normal
o.dot FloatSocket Dot

NormalMap

NormalMap(
    strength=1.0,
    color=(0.5, 0.5, 1.0, 1.0),
    *,
    space='TANGENT',
    uv_map='',
    convention='OPENGL',
    base='DISPLACED',
)

Generate a perturbed normal from an RGB normal map image. Typically used for faking highly detailed surfaces

Parameters

Name Type Description Default
strength InputFloat Strength 1.0
color InputColor Color (0.5, 0.5, 1.0, 1.0)

Attributes

Name Description
base
convention
i
name The name of the node being wrapped by this instance.
node
o
space
tree The TreeBuilder instance this node belongs to and is being built within.
uv_map

Methods

Name Description
props Set the properties every node has and return the node, so it can
props
props(
    label=None,
    color=None,
    width=None,
    height=None,
    hide=None,
    show_options=None,
    hide_inputs=(),
    hide_outputs=(),
    mute=None,
    warning_propagation=None,
    pin_gizmo=None,
    pin_gizmo_inputs=(),
)

Set the properties every node has and return the node, so it can go at the end of a chain::

g.SetPosition(geometry=geo, offset=offset).props(
    label="Lift", color="#FFAA00", width=200
)

Properties left as None are unchanged.

Args: label: The node’s header label. color: A custom header colour, as a hex string ("#FFAA00") or an (r, g, b) tuple; turns on use_custom_color. width: The node’s width. height: The node’s height; only frames use it. hide: Collapse the node. show_options: Show the node’s options (dropdowns and toggles). hide_inputs: Input sockets to hide, by name; "Value#1" names the second visible Value. hide_outputs: Output sockets to hide, by name. mute: Mute (bypass) the node. warning_propagation: Which of the node’s warnings show on the group node it sits in. pin_gizmo: Keep the node’s gizmo visible when it isn’t selected: a gizmo node’s, or a value node’s (Value, Vector, …). pin_gizmo_inputs: Inputs whose gizmos stay visible when the node isn’t selected, by name; for group nodes passing a gizmo through.

Inputs

Attribute Type Description
i.strength FloatSocket Strength
i.color ColorSocket Color

Outputs

Attribute Type Description
o.normal VectorSocket Normal

VectorDisplacement

VectorDisplacement(vector=None, midlevel=0.0, scale=0.01, *, space='TANGENT')

Displace the surface along an arbitrary direction

Parameters

Name Type Description Default
vector InputColor Vector None
midlevel InputFloat Midlevel 0.0
scale InputFloat Scale 0.01

Attributes

Name Description
i
name The name of the node being wrapped by this instance.
node
o
space
tree The TreeBuilder instance this node belongs to and is being built within.

Methods

Name Description
props Set the properties every node has and return the node, so it can
props
props(
    label=None,
    color=None,
    width=None,
    height=None,
    hide=None,
    show_options=None,
    hide_inputs=(),
    hide_outputs=(),
    mute=None,
    warning_propagation=None,
    pin_gizmo=None,
    pin_gizmo_inputs=(),
)

Set the properties every node has and return the node, so it can go at the end of a chain::

g.SetPosition(geometry=geo, offset=offset).props(
    label="Lift", color="#FFAA00", width=200
)

Properties left as None are unchanged.

Args: label: The node’s header label. color: A custom header colour, as a hex string ("#FFAA00") or an (r, g, b) tuple; turns on use_custom_color. width: The node’s width. height: The node’s height; only frames use it. hide: Collapse the node. show_options: Show the node’s options (dropdowns and toggles). hide_inputs: Input sockets to hide, by name; "Value#1" names the second visible Value. hide_outputs: Output sockets to hide, by name. mute: Mute (bypass) the node. warning_propagation: Which of the node’s warnings show on the group node it sits in. pin_gizmo: Keep the node’s gizmo visible when it isn’t selected: a gizmo node’s, or a value node’s (Value, Vector, …). pin_gizmo_inputs: Inputs whose gizmos stay visible when the node isn’t selected, by name; for group nodes passing a gizmo through.

Inputs

Attribute Type Description
i.vector ColorSocket Vector
i.midlevel FloatSocket Midlevel
i.scale FloatSocket Scale

Outputs

Attribute Type Description
o.displacement VectorSocket Displacement

VectorTransform

VectorTransform(
    vector=(0.5, 0.5, 0.5),
    *,
    vector_type='VECTOR',
    convert_from='WORLD',
    convert_to='OBJECT',
)

Convert a vector, point, or normal between world, camera, and object coordinate space

Parameters

Name Type Description Default
vector InputVector Vector (0.5, 0.5, 0.5)

Attributes

Name Description
convert_from
convert_to
i
name The name of the node being wrapped by this instance.
node
o
tree The TreeBuilder instance this node belongs to and is being built within.
vector_type

Methods

Name Description
normal Create Vector Transform with operation ‘Normal’. Transform a normal vector with unit length
point Create Vector Transform with operation ‘Point’. Transform a point
props Set the properties every node has and return the node, so it can
vector Create Vector Transform with operation ‘Vector’. Transform a direction vector
normal
normal(vector=(0.5, 0.5, 0.5), *, convert_from='WORLD', convert_to='OBJECT')

Create Vector Transform with operation ‘Normal’. Transform a normal vector with unit length

point
point(vector=(0.5, 0.5, 0.5), *, convert_from='WORLD', convert_to='OBJECT')

Create Vector Transform with operation ‘Point’. Transform a point

props
props(
    label=None,
    color=None,
    width=None,
    height=None,
    hide=None,
    show_options=None,
    hide_inputs=(),
    hide_outputs=(),
    mute=None,
    warning_propagation=None,
    pin_gizmo=None,
    pin_gizmo_inputs=(),
)

Set the properties every node has and return the node, so it can go at the end of a chain::

g.SetPosition(geometry=geo, offset=offset).props(
    label="Lift", color="#FFAA00", width=200
)

Properties left as None are unchanged.

Args: label: The node’s header label. color: A custom header colour, as a hex string ("#FFAA00") or an (r, g, b) tuple; turns on use_custom_color. width: The node’s width. height: The node’s height; only frames use it. hide: Collapse the node. show_options: Show the node’s options (dropdowns and toggles). hide_inputs: Input sockets to hide, by name; "Value#1" names the second visible Value. hide_outputs: Output sockets to hide, by name. mute: Mute (bypass) the node. warning_propagation: Which of the node’s warnings show on the group node it sits in. pin_gizmo: Keep the node’s gizmo visible when it isn’t selected: a gizmo node’s, or a value node’s (Value, Vector, …). pin_gizmo_inputs: Inputs whose gizmos stay visible when the node isn’t selected, by name; for group nodes passing a gizmo through.

vector
vector(vector=(0.5, 0.5, 0.5), *, convert_from='WORLD', convert_to='OBJECT')

Create Vector Transform with operation ‘Vector’. Transform a direction vector

Inputs

Attribute Type Description
i.vector VectorSocket Vector

Outputs

Attribute Type Description
o.vector VectorSocket Vector