File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -104,3 +104,29 @@ Note that you need to carefully choose the size of the terrain as well as the he
104104https://docs.unrealengine.com/latest/INT/Engine/Landscape/TechnicalGuide/index.html#calculatingheightmapdimensions
105105
106106
107+ ## Getting/Creating ULandscapeInfo
108+
109+ Informations about a Landscape/Terrain are stored in a special uobject called ULandscapeInfo.
110+
111+ To retrieve it (or eventually create a new one), you have the following two functions:
112+
113+ ``` python
114+ landscape_info = landscape.get_landscape_info()
115+
116+ # create a new ULandscapeInfo, required if you do not import an heightmap in a manually spawned landscape
117+ landscape_info = landscape.create_landscape_info()
118+ ```
119+
120+ ## Retrieving ULandscapeComponent's textures
121+
122+ If you want to get access to the height values of a terrain, you need to retrieve them from each component:
123+
124+ ``` python
125+ import unreal_engine as ue
126+
127+ for component in landscape.LandscapeComponents:
128+ heightmap_texture = component.HeightmapTexture
129+ print (' {0} x{1} -> {2} ' .format(heightmap_texture.texture_get_width(), heightmap_texture.texture_get_height(), len (heightmap_texture.texture_get_source_data())))
130+ ```
131+
132+ this will print the texture width, height and data size of each landscape component.
You can’t perform that action at this time.
0 commit comments