Download

Some question on making own unreal editor tools.

I want to make some tools for open world semi-procedural level design. Probably generating meshes and
assembling levels(placing on landscape one of and most important cases) from them and other components.
This time i decide to try unreal engine for it. Alot of useful, my current problem specific, features already
present in the engine such as level streaming and tiled import). I have deal with basic understanding of plugins
(.uplugin, folder structure), modules(build.cs, IModuleInterface), and slate a little. This allow me to make a plugin,
load editor module and extend editor ui in basic cases(tabs with simple custom ui, buttons, menu entrys).
I think i will soon be able to make and register custom editor mode (maybe component visualizer (use similiar functionality in Unity))
with help of wiki code section and plugins sources, but i have some questions without somehow
detailed solutions (i cannot find it searching).

**All question means that C++ used and i want things should be done from editor module
(maybe some other module type, but i’m shure this should be editor).
**
1.) How to interact with landscape(s) from C++ code? I need to find landscape area corresponds to given world
cordinates(can be on different levels in world(i think, they are different levels in terms of world composition)) and
change heightmap and material layers weight data (read-modyfy-write). Then regenerate colision and other stuff that
editor should do. The problem is that there is no documentation on it because there is no way to modify landscape in runtime, as i know,
and editor classes is not detailed ducumented. Saw LandscapeEditorUtils::SetHeightmapData, dont know how to use that, what it returns
and how to get heightmap to modify. Also don’t know how to deal with different levels, how they related to UWorld.
I’m trying to read landscape editor code, but it’s rather big for me and i’m don’t understand yet how it works (totaly smoke and mirrors with brushes for me),
hope i’ll found where and how it modify lanscape if noone responds.

2.) How to interact with assets. There i’m interested in making custom assets(saw some info on answer hub, think can deal with it, but unclear),
editor (with viewports) for it (read - modify - save). In addition i’d like to know more about members with custom types of Actor-derived classes
(which can spawned by editor to level) ind it’s components serialization (have problems with arrays and lists of objects in unity, solve it there with
“bicycles and rakes”(slang about weird solutions, not shure if it’s translatible)).

3.) Specify 2.) How to make static mesh. I know there is procedural mesh support(but without editing normals:(),
but i’m interesting in static mesh interaction. I need to generate mesh from verticies, triangles, normals,
UV and, if it will need, tangents, not shure about tangents will be correct, but i’ve done it with unity couple yeras ago
(there all mesh instances data accesible as arrays in runtime) and save it as asset from code (and do what editor
should do with SM, assign materials, maybe generate collision data if it is in SM asset), also need read-modify-save.

4.) Maybe someone can make more tutorials on extending the editor and custom tools making. As i know
“Extending the editor training stream” was the only one such video. There are also couple of articles on wiki
(i’m start undarstanding some things thank to it), but i can’t find how to make custom viewport with some scene,
how to make custom asset editor and at least “how it works” (understand only about modules and plugins at basic so far,
maby GEngine/GEditor, but it’s unclear for now, can use it, but “brrrrr”:eek: they do alot of things and everywhere is
warnings that one of them sould break at next release…).

I think, advanced specialized tools for your specific tasks is most important. It’s only one way to be one-man army.
The only way to get it - make it by yourself (the main problem is compatibility with technologies you use). At least i want to try.

Hope, someone can help me with above questions, even taking in account, that i’m not professional developer with UE.
Maybe i’m simply search not enough and all of my questions is basic and covered, maybe it can be simly explained by what should be done.
Exact places and functions names about how it’s done in sources will be very helpful.

I’m unsure with section of forum, but try here.
Sorry for my bad english and if i mistaken somewhere. Thanks in adwance.

Answer by myself partly on sect 1.). Think, that edit of landscape can be performed some sort of AlandscapeProxy* ->
GetLandscapeInfo() -> DataInterface* (or construct new FLandscapeDataInterface from info, maybe) -> “whatever you want,
there is useful set of functions”. All from docs(and sources of course), it seems docs not so unclear. Don’t know about how it will work and if it
will modify landscame persistantly, but already something. I think, editor use that way.

There is still problem for me how to transform world space coordinates to landscape data offsets in case of world composition
tiles. I think i should start from UWorld, already can get PIE one, but can’t see how to get tiles (levels with landscape
actors) corresponding to given world space coordinates.

Maybe someone knows.

And correct myself alittle… not DataInterface, but FLandscapeEditDataInterface, it can be constructed from *ULandscapeInfo and handles landscape editing.
Edit: SetHeightData(…) even updates collision. But still unable to understand how to transform coordinates.