File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,40 @@ material_instance = ue.create_material_instance(new_material)
5858Creating a Material Instance Dynamic
5959------------------------------------
6060
61+ You can create a MID (Material Instance Dynamic) from a ,aterial instance:
62+
63+ ``` py
64+ mid = self .uobject.create_material_instance_dynamic(material_instance)
65+ ```
66+
6167
6268Listing, getting and chaning available material properties
6369----------------------------------------------------------
70+
71+ To modify a material's property you need to know its name.
72+
73+ You cannot access the property list from a material instance, you need to get it from the parent:
74+
75+ ``` py
76+ parent_material = material_instance.Parent
77+
78+ for expression in parent_material.Expressions:
79+ parameter_name = expression.ParameterName
80+ parameter_group = expression.Group
81+ ```
82+
83+
84+ Once you have the property name you can get/set parameters values
85+
86+ ``` py
87+ # retuns a float
88+ material_instance.get_material_scalar_parameter(' Parameter name' )
89+ # returns a FVector
90+ material_instance.get_material_vector_parameter(' Parameter name' )
91+ # returns a Texture
92+ material_instance.get_material_texture_parameter(' Parameter name' )
93+
94+ material_instance.set_material_scalar_parameter(' Parameter name' , float )
95+ material_instance.set_material_vector_parameter(' Parameter name' , FVector)
96+ material_instance.set_material_texture_parameter(' Parameter name' , Texture)
97+ ```
You can’t perform that action at this time.
0 commit comments