unreal.MaterialEditingLibrary

class unreal.MaterialEditingLibrary(outer=None, name='None')

Bases: unreal.BlueprintFunctionLibrary

Blueprint library for creating/editing Materials

C++ Source:

  • Module: MaterialEditor
  • File: MaterialEditingLibrary.h
classmethod clear_all_material_instance_parameters(instance) → None

Clears all material parameters set by this Material Instance

Parameters:instance (MaterialInstanceConstant) –
classmethod connect_material_expressions(from_expression, from_output_name, to_expression, to_input_name) → bool

Create connection between two material expressions

Parameters:
  • from_expression (MaterialExpression) – Expression to make connection from
  • from_output_name (str) – Name of output of FromExpression to make connection from. Leave empty to use first output.
  • to_expression (MaterialExpression) – Expression to make connection to
  • to_input_name (str) – Name of input of ToExpression to make connection to. Leave empty to use first input.
Returns:

Return type:

bool

classmethod connect_material_property(from_expression, from_output_name, property_) → bool

Connect a material expression output to one of the material property inputs (e.g. diffuse color, opacity etc)

Parameters:
  • from_expression (MaterialExpression) – Expression to make connection from
  • from_output_name (str) – Name of output of FromExpression to make connection from
  • property (MaterialProperty) – Property input on material to make connection to
Returns:

Return type:

bool

classmethod create_material_expression(material, expression_class, node_pos_x=0, node_pos_y=0) → MaterialExpression

Create a new material expression node within the supplied material

Parameters:
  • material (Material) – Material asset to add an expression to
  • expression_class (type(Class)) – Class of expression to add
  • node_pos_x (int32) – X position of new expression node
  • node_pos_y (int32) – Y position of new expression node
Returns:

Return type:

MaterialExpression

classmethod create_material_expression_in_function(material_function, expression_class, node_pos_x=0, node_pos_y=0) → MaterialExpression

Create a new material expression node within the supplied material function

Parameters:
  • material_function (MaterialFunction) – Material function asset to add an expression to
  • expression_class (type(Class)) – Class of expression to add
  • node_pos_x (int32) – X position of new expression node
  • node_pos_y (int32) – Y position of new expression node
Returns:

Return type:

MaterialExpression

classmethod delete_all_material_expressions(material) → None

Delete all material expressions in the supplied material

Parameters:material (Material) –
classmethod delete_all_material_expressions_in_function(material_function) → None

Delete all material expressions in the supplied material function

Parameters:material_function (MaterialFunction) –
classmethod delete_material_expression(material, expression) → None

Delete a specific expression from a material. Will disconnect from other expressions.

Parameters:
classmethod delete_material_expression_in_function(material_function, expression) → None

Delete a specific expression from a material function. Will disconnect from other expressions.

Parameters:
classmethod get_material_instance_scalar_parameter_value(instance, parameter_name) → float

Get the current scalar (float) parameter value from a Material Instance

Parameters:
Returns:

Return type:

float

classmethod get_material_instance_texture_parameter_value(instance, parameter_name) → Texture

Get the current texture parameter value from a Material Instance

Parameters:
Returns:

Return type:

Texture

classmethod get_material_instance_vector_parameter_value(instance, parameter_name) → LinearColor

Get the current vector parameter value from a Material Instance

Parameters:
Returns:

Return type:

LinearColor

classmethod get_num_material_expressions(material) → int32

Returns number of material expressions in the supplied material

Parameters:material (Material) –
Returns:
Return type:int32
classmethod get_num_material_expressions_in_function(material_function) → int32

Returns number of material expressions in the supplied material

Parameters:material_function (MaterialFunction) –
Returns:
Return type:int32
classmethod layout_material_expressions(material) → None

Layouts the expressions in a grid pattern

Parameters:material (Material) –
classmethod layout_material_function_expressions(material_function) → None

Layouts the expressions in a grid pattern

Parameters:material_function (MaterialFunction) –
classmethod recompile_material(material) → None

Trigger a recompile of a material. Must be performed after making changes to the graph to have changes reflected.

Parameters:material (Material) –
classmethod set_material_instance_parent(instance, new_parent) → None

Set the parent Material or Material Instance to use for this Material Instance

Parameters:
classmethod set_material_instance_scalar_parameter_value(instance, parameter_name, value) → bool

Set the scalar (float) parameter value for a Material Instance

Parameters:
Returns:

Return type:

bool

classmethod set_material_instance_texture_parameter_value(instance, parameter_name, value) → bool

Set the texture parameter value for a Material Instance

Parameters:
Returns:

Return type:

bool

classmethod set_material_instance_vector_parameter_value(instance, parameter_name, value) → bool

Set the vector parameter value for a Material Instance

Parameters:
Returns:

Return type:

bool

classmethod set_material_usage(material, usage) → bool or None

Enable a particular usage for the supplied material (e.g. SkeletalMesh, ParticleSprite etc)

Parameters:
  • material (Material) – Material to change usage for
  • usage (MaterialUsage) – New usage type to enable for this material
Returns:

needs_recompile (bool): Returned to indicate if material needs recompiling after this change

Return type:

bool or None

classmethod update_material_function(material_function, preview_material=None) → None

Update a Material Function after edits have been made. Will recompile any Materials that use the supplied Material Function.

Parameters:
classmethod update_material_instance(instance) → None

Called after making modifications to a Material Instance to recompile shaders etc.

Parameters:instance (MaterialInstanceConstant) –