unreal.MaterialInstanceDynamic

class unreal.MaterialInstanceDynamic(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: MaterialInstance

Material Instance Dynamic

C++ Source:

  • Module: Engine

  • File: MaterialInstanceDynamic.h

Editor Properties: (see get_editor_property/set_editor_property)

  • asset_import_data (AssetImportData): [Read-Write] Asset Import Data: Importing data and options used for this material

  • asset_user_data (Array[AssetUserData]): [Read-Write] Asset User Data: Array of user data stored with the asset

  • base_property_overrides (MaterialInstanceBasePropertyOverrides): [Read-Write] Base Property Overrides

  • double_vector_parameter_values (Array[DoubleVectorParameterValue]): [Read-Write] Double Vector Parameter Values: DoubleVector parameters.

  • font_parameter_values (Array[FontParameterValue]): [Read-Write] Font Parameter Values: Font parameters.

  • lightmass_settings (LightmassMaterialInterfaceSettings): [Read-Write] Lightmass Settings: The Lightmass settings for this object.

  • nanite_override_material (MaterialOverrideNanite): [Read-Write] Nanite Override Material: An override material which will be used instead of this one when rendering with nanite.

  • override_subsurface_profile (bool): [Read-Write] Override Subsurface Profile: Defines if SubsurfaceProfile from this instance is used or it uses the parent one.

  • parent (MaterialInterface): [Read-Write] Parent: Parent material.

  • phys_material (PhysicalMaterial): [Read-Write] Phys Material: Physical material to use for this graphics material. Used for sounds, effects etc.

  • physical_material_map (PhysicalMaterial): [Read-Write] Physical Material Map: Physical material map used with physical material mask, when it exists.

  • preview_mesh (SoftObjectPath): [Read-Write] Preview Mesh: The mesh used by the material editor to preview the material.

  • runtime_virtual_texture_parameter_values (Array[RuntimeVirtualTextureParameterValue]): [Read-Write] Runtime Virtual Texture Parameter Values: RuntimeVirtualTexture parameters.

  • scalar_parameter_values (Array[ScalarParameterValue]): [Read-Write] Scalar Parameter Values: Scalar parameters.

  • subsurface_profile (SubsurfaceProfile): [Read-Write] Subsurface Profile: SubsurfaceProfile, for Screen Space Subsurface Scattering

  • texture_parameter_values (Array[TextureParameterValue]): [Read-Write] Texture Parameter Values: Texture parameters.

  • thumbnail_info (ThumbnailInfo): [Read-Only] Thumbnail Info: Information for thumbnail rendering

  • vector_parameter_values (Array[VectorParameterValue]): [Read-Write] Vector Parameter Values: Vector parameters.

copy_material_instance_parameters(source, quick_parameters_only=False) None

Copies over parameters given a material interface (copy each instance following the hierarchy) Very slow implementation, avoid using at runtime. Hopefully we can replace it later with something like CopyInterpParameters() The output is the object itself (this). Copying ‘quick parameters only’ will result in a much faster copy process but will only copy dynamic scalar, vector and texture parameters on clients.

Parameters:
  • source (MaterialInterface) –

  • quick_parameters_only (bool) – Copy scalar, vector and texture parameters only. Much faster but may not include required data

copy_parameter_overrides(material_instance) None

Copy parameter values from another material instance. This will copy only parameters explicitly overridden in that material instance!!

Parameters:

material_instance (MaterialInstance) –

get_scalar_parameter_value(parameter_name) float

Get the current scalar (float) parameter value from an MID

Parameters:

parameter_name (Name) –

Return type:

float

get_scalar_parameter_value_by_info(parameter_info) float

Get the current scalar (float) parameter value from an MID, using MPI (to allow access to layer parameters)

Parameters:

parameter_info (MaterialParameterInfo) –

Return type:

float

get_texture_parameter_value(parameter_name) Texture

Get the current MID texture parameter value

Parameters:

parameter_name (Name) –

Return type:

Texture

get_texture_parameter_value_by_info(parameter_info) Texture

Get the current MID texture parameter value, using MPI (to allow access to layer parameters)

Parameters:

parameter_info (MaterialParameterInfo) –

Return type:

Texture

get_vector_parameter_value(parameter_name) LinearColor

Get the current MID vector parameter value

Parameters:

parameter_name (Name) –

Return type:

LinearColor

get_vector_parameter_value_by_info(parameter_info) LinearColor

Get the current MID vector parameter value, using MPI (to allow access to layer parameters)

Parameters:

parameter_info (MaterialParameterInfo) –

Return type:

LinearColor

initialize_scalar_parameter_and_get_index(parameter_name, value) int32 or None

Use this function to set an initial value and fetch the index for use in SetScalarParameterByIndex. This function should only be called once for a particular name, and then use SetScalarParameterByIndex for subsequent calls. However, beware using this except in cases where optimization is critical, which is generally only if you’re using an unusually high number of parameters in a material and setting a large number of parameters in the same frame. Also, if the material is changed in any way that can change the parameter list, the index can be invalidated.

Parameters:
  • parameter_name (Name) –

  • value (float) –

Returns:

out_parameter_index (int32):

Return type:

int32 or None

interpolate_material_instance_parameters(source_a, source_b, alpha) None

Interpolates the scalar and vector parameters of this material instance based on two other material instances, and an alpha blending factor The output is the object itself (this). Supports the case SourceA==this || SourceB==this Both material have to be from the same base material

Parameters:
  • source_a (MaterialInstance) – value that is used for Alpha=0, silently ignores the case if 0

  • source_b (MaterialInstance) – value that is used for Alpha=1, silently ignores the case if 0

  • alpha (float) – usually in the range 0..1, values outside the range extrapolate

set_double_vector_parameter_value(parameter_name, value) None

Set an MID vector parameter value

Parameters:
set_runtime_virtual_texture_parameter_value(parameter_name, value) None

Set an MID texture parameter value

Parameters:
set_runtime_virtual_texture_parameter_value_by_info(parameter_info, value) None

Set an MID texture parameter value using MPI (to allow access to layer parameters)

Parameters:
set_scalar_parameter_by_index(parameter_index, value) bool

Use the cached value of OutParameterIndex from InitializeScalarParameterAndGetIndex to set the scalar parameter ONLY on the exact same MID. Do NOT presume the index can be used from one instance on another. Only use this pair of functions when optimization is critical; otherwise use either SetScalarParameterValueByInfo or SetScalarParameterValue.

Parameters:
  • parameter_index (int32) –

  • value (float) –

Return type:

bool

set_scalar_parameter_value(parameter_name, value) None

Set a MID scalar (float) parameter value

Parameters:
  • parameter_name (Name) –

  • value (float) –

set_scalar_parameter_value_by_info(parameter_info, value) None

Set a MID scalar (float) parameter value using MPI (to allow access to layer parameters)

Parameters:
set_texture_parameter_value(parameter_name, value) None

Set an MID texture parameter value

Parameters:
set_texture_parameter_value_by_info(parameter_info, value) None

Set an MID texture parameter value using MPI (to allow access to layer parameters)

Parameters:
set_vector_parameter_value(parameter_name, value) None

Set an MID vector parameter value

Parameters:
set_vector_parameter_value_by_info(parameter_info, value) None

Set an MID vector parameter value, using MPI (to allow access to layer parameters)

Parameters: