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_child_instances(parent)

Gets all direct child mat instances

Parameters

parent (MaterialInterface) –

Returns

child_instances (Array(AssetData)):

Return type

Array(AssetData)

classmethod get_inputs_for_material_expression(material, material_expression)

Get the set of nodes acting as inputs to a node from an active material editor

Parameters
Returns

Return type

Array(MaterialExpression)

classmethod get_material_default_scalar_parameter_value(material, parameter_name)float

Get the default scalar (float) parameter value from a Material

Parameters
Returns

Return type

float

classmethod get_material_default_static_switch_parameter_value(material, parameter_name)bool

Get the default static switch parameter value from a Material

Parameters
Returns

Return type

bool

classmethod get_material_default_texture_parameter_value(material, parameter_name)Texture

Get the default texture parameter value from a Material

Parameters
Returns

Return type

Texture

classmethod get_material_default_vector_parameter_value(material, parameter_name)LinearColor

Get the default vector parameter value from a Material

Parameters
Returns

Return type

LinearColor

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_static_switch_parameter_value(instance, parameter_name)bool

Get the current static switch parameter value from a Material Instance

Parameters
Returns

Return type

bool

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_material_property_input_node(material, property_)MaterialExpression

Get the node providing the output for a given material property from an active material editor

Parameters
Returns

Return type

MaterialExpression

classmethod get_material_selected_nodes(material)

Get the set of selected nodes from an active material editor

Parameters

material (Material) –

Returns

Return type

Set(Object)

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 get_scalar_parameter_names(material)

Gets all scalar parameter names

Parameters

material (MaterialInterface) –

Returns

parameter_names (Array(Name)):

Return type

Array(Name)

classmethod get_scalar_parameter_source(material, parameter_name)SoftObjectPath or None

Returns the path of the asset where the parameter originated, as well as true/false if it was found

Parameters
  • material (MaterialInterface) – The material or material instance you want to look up a parameter from

  • parameter_name (Name) – The parameter name

Returns

Whether or not the parameter was found in this material

parameter_source (SoftObjectPath): The soft object path of the asset the parameter originates in

Return type

SoftObjectPath or None

classmethod get_static_switch_parameter_names(material)

Gets all static switch parameter names

Parameters

material (MaterialInterface) –

Returns

parameter_names (Array(Name)):

Return type

Array(Name)

classmethod get_static_switch_parameter_source(material, parameter_name)SoftObjectPath or None

Returns the path of the asset where the parameter originated, as well as true/false if it was found

Parameters
  • material (MaterialInterface) – The material or material instance you want to look up a parameter from

  • parameter_name (Name) – The parameter name

Returns

Whether or not the parameter was found in this material

parameter_source (SoftObjectPath): The soft object path of the asset the parameter originates in

Return type

SoftObjectPath or None

classmethod get_statistics(material)MaterialStatistics

Returns statistics about the given material

Parameters

material (MaterialInterface) –

Returns

Return type

MaterialStatistics

classmethod get_texture_parameter_names(material)

Gets all texture parameter names

Parameters

material (MaterialInterface) –

Returns

parameter_names (Array(Name)):

Return type

Array(Name)

classmethod get_texture_parameter_source(material, parameter_name)SoftObjectPath or None

Returns the path of the asset where the parameter originated, as well as true/false if it was found

Parameters
  • material (MaterialInterface) – The material or material instance you want to look up a parameter from

  • parameter_name (Name) – The parameter name

Returns

Whether or not the parameter was found in this material

parameter_source (SoftObjectPath): The soft object path of the asset the parameter originates in

Return type

SoftObjectPath or None

classmethod get_used_textures(material)

Get the list of textures used by a material

Parameters

material (Material) –

Returns

Return type

Array(Texture)

classmethod get_vector_parameter_names(material)

Gets all vector parameter names

Parameters

material (MaterialInterface) –

Returns

parameter_names (Array(Name)):

Return type

Array(Name)

classmethod get_vector_parameter_source(material, parameter_name)SoftObjectPath or None

Returns the path of the asset where the parameter originated, as well as true/false if it was found

Parameters
  • material (MaterialInterface) – The material or material instance you want to look up a parameter from

  • parameter_name (Name) – The parameter name

Returns

Whether or not the parameter was found in this material

parameter_source (SoftObjectPath): The soft object path of the asset the parameter originates in

Return type

SoftObjectPath or None

classmethod has_material_usage(material, usage)bool

Check if a particular usage is enabled for the supplied material (e.g. SkeletalMesh, ParticleSprite etc)

Parameters
  • material (Material) – Material to check usage for

  • usage (MaterialUsage) – Usage type to check for this material

Returns

Return type

bool

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) –