mohsenph69 / Godot-MTerrain-plugin

A GDExtension plugin which give godot the ability to produce highly optimized Terrain for Open world games
MIT License
448 stars 24 forks source link

Proposal for new Editor UI for MTerrain #46

Open rossunger opened 2 months ago

rossunger commented 2 months ago

I have some ideas for a new UI for mterrain editor

I have made 2 mockups.

1) New MTools panel: image

Benefits:

How to try: https://github.com/rossunger/Godot-MTerrain-plugin/blob/master/ROSS%20MTools%20mockup.tscn%20%20

Download this tscn file and put it in addons/m_terrain/ and you should be able to run it as a scene to play with the UI. Most of UI is functional, and it would be easy to connect to existing mterrain signals for 100% functionality.

I imagine this would attach to the bottom of the main 3d view, or alternatively as a popup window, similar to how https://github.com/imjp94/UIDesignTool did it.

I would still like to redesign the icons, and change the colors

2) MGrass settings editor (layout only) image

Benefits:

Screenshot generated from this tscn file: https://github.com/rossunger/Godot-MTerrain-plugin/blob/master/ROSS%20mgrass%20editor%20mockup.tscn

If you like this as a concept I can flesh it out with a functional UI. I would also like to adjust the theming, more/less spacing in place, colors, maybe a different font (although probably not), and possibly icons

mohsenph69 commented 2 months ago

Hi there rossunger This is a very good idea!

Yeah we can remove paint panel! and I think that is not a bad Idea! But I Think if we can make an icon for each paint brush that would be better!

By the way we can not fit everything in in that panel down there! Each brush has some property which can be different these properties are generated base on that brush type each time you click on that! maybe we can make an inspector plugin for MTerrain so they will appear there!

So these are the path for gui stuff: MTool : res://addons/m_terrain/gui/mtools.tscn PaintPanel: res://addons/m_terrain/gui/paint_panel.tscn

You can fork the MTerrain repo and make the changes so I can see that!

Also these are icons: res://addons/m_terrain/icons/

if you have better icons for each element you can replace your icon there!

Also we need some new icon for the list bellow:

If you can design any icon for any of these you can add them inside the icon folder and send me a pull request! These icon format is better to be in SVG format, for some of them node like (MPath, MCurve) there is a similar node in Godot which you can just modify the original icon!

Also some icons in icon folder are in png format and it would better if we change them into svg format

rossunger commented 2 months ago

Amazing. Ok, I will connect all the signal and make this work with the plugin

I will make icons for each brush, with a tooltip that appear when you hover display the brush name/description. This is for raise/to-height, hole, etc

For the special brush properties, can you tell me more about this? I think we can make it work with this toolbar, I have ideas, I just need to understand what properties should go here. I think it's very helpful to have all properties in one place, no inspector

I will make SVG icons for all the current icons, and for mpath, MCurve, MCurveMesh, MItersection and Mmeshlod

On Tue, Jul 30, 2024, 9:24 a.m. mohsenph69 @.***> wrote:

Hi there rossunger https://github.com/rossunger This is a very good idea!

Yeah we can remove paint panel! and I think that is not a bad Idea! But I Think if we can make an icon for each paint brush that would be better!

By the way we can not fit everything in in that panel down there! Each brush has some property which can be different these properties are generated base on that brush type each time you click on that! maybe we can make an inspector plugin for MTerrain so they will appear there!

So these are the path for gui stuff: MTool : res://addons/m_terrain/gui/mtools.tscn PaintPanel: res://addons/m_terrain/gui/paint_panel.tscn

You can fork the MTerrain repo and make the changes so I can see that!

Also these are icons: res://addons/m_terrain/icons/

if you have better icons for each element you can replace your icon there!

Also we need some new icon for the list bellow:

  • MPath Node
  • MCurve resource
  • MCurveMesh Node
  • MMeshLOD resource
  • MIntersection resource

If you can design any icon for any of these you can add them inside the icon folder and send me a pull request! These icon format is better to be in SVG format, for some of them node like (MPath, MCurve) there is a similar node in Godot which you can just modify the original icon!

Also some icons in icon folder are in png format and it would better if we change them into svg format

— Reply to this email directly, view it on GitHub https://github.com/mohsenph69/Godot-MTerrain-plugin/issues/46#issuecomment-2258483937, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGZ2R2JO4OQW6WO4TSCPXLZO6OYPAVCNFSM6AAAAABLV5UVKOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJYGQ4DGOJTG4 . You are receiving this because you authored the thread.Message ID: @.***>

JekSun97 commented 2 months ago

@mohsenph69 please work on the icons, they look terrible

rossunger commented 2 months ago

@mohsenph69 please work on the icons, they look terrible

@JekSun97 I'm working on it. Please be kind.

mohsenph69 commented 2 months ago

Each time you change the brush type, a new set of property for that type of brush will be created! For example To_Heigh brush has this properties: weight, hardness, offset and mode!

These properties are defined in c++ code, and you can grab them by this function: brush_manager.get_height_brush_property(brush_id)

In above code brush_manager is a class which is responsible to registering and handling different brushes! Brush_id is the integer number associated with the the brush! And above will return an array of dictionary containing that property!

All of this editor functionality is inside res://addons/m_terrain/gui/paint_panel.gd

As an example in gdscript above each time you change the brush type this function will be called and the property associated with that brush is generated!

func _on_brush_list_item_selected(index):
    clear_property_element()
    if index < -1: return
    brush_id = index
    var brush_props:Array
    if is_color_brush:
        pass
    else:
        brush_props = brush_manager.get_height_brush_property(brush_id)
    for p in brush_props:
        create_props(p)

Read this gdscript file res://addons/m_terrain/gui/paint_panel.gd you can use the gdscript code inside that! to create a new brush gui! And if you have any other question let me know!

rossunger commented 2 months ago

For anyone interested in trying the new UI, it's pretty close to ready for release, you can try it here: https://github.com/rossunger/Godot-MTerrain-plugin