Skip to content

Commit babef24

Browse files
author
rdeioris
authored
Update ManagingAssets.md
1 parent 3fcafca commit babef24

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/ManagingAssets.md

+33
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,36 @@ Before reimporting you can check if an asset supports it:
153153
if asset002.asset_can_reimport():
154154
asset002.asset_reimport()
155155
```
156+
157+
Creating Assets
158+
-
159+
160+
You can create new asset manually or via a factory (if required):
161+
162+
```py
163+
from unreal_engine.classes import ParticleSystem, Material
164+
165+
particle_system = ParticleSystem()
166+
particle_system.set_name('ParticleSystemForDummies')
167+
168+
# special form of the constructor taking the object name
169+
material = Material('FunnyMaterial')
170+
171+
# this will save particle_system into /Game/Particles.ParticleSystemForDummies
172+
particle_system.save_package('/Game/Particles')
173+
174+
# this will save material into /Game/FunnyMaterials.FunnyMaterial
175+
material.save_package('/Game/FunnyMaterials')
176+
```
177+
178+
the previous approach is the blessed one where each asset is stored in a different package.
179+
180+
If you want to store multiple assets in the same package you can simply pass the same name in save_package
181+
182+
```py
183+
# this will save particle_system into /Game/Funny.ParticleSystemForDummies
184+
particle_system.save_package('/Game/Funny')
185+
186+
# this will save material into /Game/Funny.FunnyMaterial
187+
material.save_package('/Game/Funny')
188+
```

0 commit comments

Comments
 (0)