File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,13 +24,28 @@ component.set_material(index, material);
2424Creating a Material (editor only)
2525---------------------------------
2626
27+ This is the 'raw' way for creating a Material
28+
2729``` python
2830from unreal_engine.classes import Material
2931new_material = Material()
3032new_material.set_name(' New Funny Material' )
3133new_material.save_package(' /Game/Materials/NewFunnyMaterial' )
3234```
3335
36+ Even better, you can use the MaterialFactoryNew class
37+
38+ ``` python
39+ from unreal_engine.classes import MaterialFactoryNew
40+ import unreal_engine as ue
41+
42+ factory = MaterialFactoryNew()
43+ new_material = factory.factory_create_new(' /Game/Materials/NewFunnyMaterial' )
44+
45+ # destroy the asset
46+ ue.delete_asset(new_material.get_path_name())
47+ ```
48+
3449Creating a Material Instance (editor only)
3550------------------------------------------
3651
You can’t perform that action at this time.
0 commit comments