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 materialasset_user_data
(Array[AssetUserData]): [Read-Write] Asset User Data: Array of user data stored with the assetbase_property_overrides
(MaterialInstanceBasePropertyOverrides): [Read-Write] Base Property Overridesdouble_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 Scatteringtexture_parameter_values
(Array[TextureParameterValue]): [Read-Write] Texture Parameter Values: Texture parameters.thumbnail_info
(ThumbnailInfo): [Read-Only] Thumbnail Info: Information for thumbnail renderingvector_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
- 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:
- 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:
- get_vector_parameter_value(parameter_name) LinearColor ¶
Get the current MID vector parameter value
- Parameters:
parameter_name (Name) –
- Return type:
- 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:
- 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.
- 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_runtime_virtual_texture_parameter_value(parameter_name, value) None ¶
Set an MID texture parameter value
- Parameters:
parameter_name (Name) –
value (RuntimeVirtualTexture) –
- 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:
parameter_info (MaterialParameterInfo) –
value (RuntimeVirtualTexture) –
- 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.
- 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:
parameter_info (MaterialParameterInfo) –
value (float) –
- 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:
parameter_info (MaterialParameterInfo) –
value (Texture) –
- set_vector_parameter_value(parameter_name, value) None ¶
Set an MID vector parameter value
- Parameters:
parameter_name (Name) –
value (LinearColor) –
- 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:
parameter_info (MaterialParameterInfo) –
value (LinearColor) –