File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -38,3 +38,24 @@ You can get a reference to the AInstancedFoliageActor of a world using:
3838``` python
3939foliage_actor = world.get_instanced_foliage_actor_for_current_level()
4040```
41+
42+ ## Iterating instances
43+
44+ You can get a FFoliageInstance struct for each instance (grouped by UFoliageType):
45+
46+ ``` python
47+ import unreal_engine as ue
48+
49+ foliage_actor = ue.get_editor_world().get_instanced_foliage_actor_for_current_level()
50+
51+ for foliage_type in foliage_actor.get_foliage_types():
52+ print (' Foliage Type: {0} ' .format(foliage_type.get_name()))
53+ for foliage_instance in foliage_actor.get_foliage_instances(foliage_type):
54+ print (foliage_instance.location)
55+ print (foliage_instance.draw_scale3d)
56+ print (foliage_instance.pre_align_rotation)
57+ print (foliage_instance.rotation)
58+ print (foliage_instance.flags)
59+ print (foliage_instance.zoffset)
60+ print (' *' * 20 )
61+ ```
You can’t perform that action at this time.
0 commit comments