feat: laid out "add primitive" buttons

This commit is contained in:
Sara Gerretsen 2025-12-07 22:52:51 +01:00
parent fab10c4feb
commit cf0086d128
13 changed files with 525 additions and 6 deletions

45
assets/icons/noise.svg Normal file
View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.933332mm"
height="16.933332mm"
viewBox="0 0 16.933332 16.933332"
version="1.1"
id="svg1"
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
sodipodi:docname="noise.svg"
inkscape:export-filename="../../project/assets/icons/plane.svg"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="11.046421"
inkscape:cx="27.067592"
inkscape:cy="40.827705"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:none;stroke:#5cb863;stroke-width:1;paint-order:fill markers stroke"
d="M 0.58053746,3.6723336 C 2.6995197,3.6045873 1.2867677,10.31206 3.2514116,10.379807 5.2160558,10.447553 4.7904403,4.4520006 6.077621,4.4181274 c 1.2871807,-0.033873 1.1988868,7.8340416 2.4860678,7.8340416 1.28718,0 1.8322632,-10.3026739 3.0516972,-10.3026739 1.219434,0 1.324167,10.1093549 2.509728,10.1771019 1.185561,0.06775 0.205938,-6.0895368 2.116574,-6.1795331"
id="path1"
sodipodi:nodetypes="csssssc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

44
assets/icons/plane.svg Normal file
View file

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.933332mm"
height="16.933332mm"
viewBox="0 0 16.933332 16.933332"
version="1.1"
id="svg1"
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
sodipodi:docname="plane.svg"
inkscape:export-filename="../../project/assets/icons/plane.svg"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="7.8109989"
inkscape:cx="21.636157"
inkscape:cy="36.74306"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:none;stroke:#5cb863;stroke-width:0.999997;paint-order:fill markers stroke"
d="M 1.2118472,11.43966 H 15.721485 L 13.155597,6.9954128 H 3.8836985 Z"
id="path1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

57
assets/icons/plus.svg Normal file
View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.933332mm"
height="16.933332mm"
viewBox="0 0 16.933332 16.933332"
version="1.1"
id="svg1"
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
sodipodi:docname="plus.svg"
inkscape:export-filename="../../project/assets/icons/plus.svg"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="11.046421"
inkscape:cx="33.766593"
inkscape:cy="34.852918"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="fill:#969696;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;paint-order:fill markers stroke"
id="rect1"
width="3.4427652"
height="12.431063"
x="6.7452841"
y="2.2511349"
ry="0.49476871" />
<rect
style="fill:#969696;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;paint-order:fill markers stroke"
id="rect2"
width="3.4427652"
height="12.431063"
x="6.7452841"
y="-14.682198"
ry="0.49476871"
transform="rotate(90)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

58
assets/icons/point.svg Normal file
View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.933332mm"
height="16.933332mm"
viewBox="0 0 16.933332 16.933332"
version="1.1"
id="svg1"
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
sodipodi:docname="point.svg"
inkscape:export-filename="../../project/assets/icons/point.svg"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#999999"
borderopacity="1"
inkscape:showpageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="11.046421"
inkscape:cx="35.486607"
inkscape:cy="38.836108"
inkscape:current-layer="layer1" />
<defs
id="defs1" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<ellipse
style="fill:#5cb863;stroke-width:5;stroke-linecap:round;paint-order:fill markers stroke"
id="path2"
cx="8.4666662"
cy="13.327331"
rx="7.1002803"
ry="1.6905428" />
<path
style="fill:none;stroke:#5cb863;stroke-width:1;stroke-linecap:butt;stroke-opacity:1;paint-order:fill markers stroke"
d="M 1.7611743,13.530197 8.4331835,3.0939113 15.150273,13.462575"
id="path3"
sodipodi:nodetypes="ccc" />
<circle
style="fill:#5cb863;stroke-width:4.99999;stroke-linecap:round;paint-order:fill markers stroke"
id="path1"
cx="8.4666662"
cy="3.1389923"
r="1.1270286" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.933332mm"
height="16.933332mm"
viewBox="0 0 16.933332 16.933332"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<g
id="layer1">
<path
style="fill:none;stroke:#5cb863;stroke-width:1;paint-order:fill markers stroke"
d="M 0.58053746,3.6723336 C 2.6995197,3.6045873 1.2867677,10.31206 3.2514116,10.379807 5.2160558,10.447553 4.7904403,4.4520006 6.077621,4.4181274 c 1.2871807,-0.033873 1.1988868,7.8340416 2.4860678,7.8340416 1.28718,0 1.8322632,-10.3026739 3.0516972,-10.3026739 1.219434,0 1.324167,10.1093549 2.509728,10.1771019 1.185561,0.06775 0.205938,-6.0895368 2.116574,-6.1795331"
id="path1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 874 B

View file

@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d1te42w7wpkrx"
path="res://.godot/imported/noise.svg-9d5c97a404080be8eefda3e4fb7ca376.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/icons/noise.svg"
dest_files=["res://.godot/imported/noise.svg-9d5c97a404080be8eefda3e4fb7ca376.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.933332mm"
height="16.933332mm"
viewBox="0 0 16.933332 16.933332"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<g
id="layer1">
<path
style="fill:none;stroke:#5cb863;stroke-width:0.999997;paint-order:fill markers stroke"
d="M 1.2118472,11.43966 H 15.721485 L 13.155597,6.9954128 H 3.8836985 Z"
id="path1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 583 B

View file

@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bl3gn6qruuy8w"
path="res://.godot/imported/plane.svg-408b84b2b3f5a78a3f7e786990573f38.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/icons/plane.svg"
dest_files=["res://.godot/imported/plane.svg-408b84b2b3f5a78a3f7e786990573f38.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.933332mm"
height="16.933332mm"
viewBox="0 0 16.933332 16.933332"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<g
id="layer1">
<rect
style="fill:#969696;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;paint-order:fill markers stroke"
id="rect1"
width="3.4427652"
height="12.431063"
x="6.7452841"
y="2.2511349"
ry="0.49476871" />
<rect
style="fill:#969696;fill-opacity:1;stroke:none;stroke-width:5;stroke-linecap:round;paint-order:fill markers stroke"
id="rect2"
width="3.4427652"
height="12.431063"
x="6.7452841"
y="-14.682198"
ry="0.49476871"
transform="rotate(90)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 949 B

View file

@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bb0mnjwx58nt3"
path="res://.godot/imported/plus.svg-7395cd59506febf409a5c6656903f8e9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/icons/plus.svg"
dest_files=["res://.godot/imported/plus.svg-7395cd59506febf409a5c6656903f8e9.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="16.933332mm"
height="16.933332mm"
viewBox="0 0 16.933332 16.933332"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<g
id="layer1">
<ellipse
style="fill:#5cb863;stroke-width:5;stroke-linecap:round;paint-order:fill markers stroke"
id="path2"
cx="8.4666662"
cy="13.327331"
rx="7.1002803"
ry="1.6905428" />
<path
style="fill:none;stroke:#5cb863;stroke-width:1;stroke-linecap:butt;stroke-opacity:1;paint-order:fill markers stroke"
d="M 1.7611743,13.530197 8.4331835,3.0939113 15.150273,13.462575"
id="path3" />
<circle
style="fill:#5cb863;stroke-width:4.99999;stroke-linecap:round;paint-order:fill markers stroke"
id="path1"
cx="8.4666662"
cy="3.1389923"
r="1.1270286" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,43 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b8hetdn3d3ysr"
path="res://.godot/imported/point.svg-e68fd7c1e788d2c48d769cc58eba6e98.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/icons/point.svg"
dest_files=["res://.godot/imported/point.svg-e68fd7c1e788d2c48d769cc58eba6e98.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -3,6 +3,9 @@
[ext_resource type="PackedScene" uid="uid://cnux2fqne284i" path="res://objects/primitive_nodes/point_primitive_node.tscn" id="1_b1cmn"] [ext_resource type="PackedScene" uid="uid://cnux2fqne284i" path="res://objects/primitive_nodes/point_primitive_node.tscn" id="1_b1cmn"]
[ext_resource type="PackedScene" uid="uid://wkqhvjnxs2mx" path="res://objects/terrain_chunk.tscn" id="1_pxqd5"] [ext_resource type="PackedScene" uid="uid://wkqhvjnxs2mx" path="res://objects/terrain_chunk.tscn" id="1_pxqd5"]
[ext_resource type="Theme" uid="uid://dh5hqcu3vyhrh" path="res://editor_theme.tres" id="3_ba0ut"] [ext_resource type="Theme" uid="uid://dh5hqcu3vyhrh" path="res://editor_theme.tres" id="3_ba0ut"]
[ext_resource type="Texture2D" uid="uid://bb0mnjwx58nt3" path="res://assets/icons/plus.svg" id="4_q68jb"]
[ext_resource type="Texture2D" uid="uid://bl3gn6qruuy8w" path="res://assets/icons/plane.svg" id="4_xg7d5"]
[ext_resource type="Texture2D" uid="uid://d1te42w7wpkrx" path="res://assets/icons/noise.svg" id="5_eqbpn"]
[sub_resource type="PointPrimitive" id="PointPrimitive_pxqd5"] [sub_resource type="PointPrimitive" id="PointPrimitive_pxqd5"]
slope = -0.7 slope = -0.7
@ -120,6 +123,9 @@ func _unhandled_input(event: InputEvent) -> void:
global_position = (global_position - pivot).normalized() * distance + pivot global_position = (global_position - pivot).normalized() * distance + pivot
" "
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_xg7d5"]
load_path = "res://.godot/imported/point.svg-e68fd7c1e788d2c48d769cc58eba6e98.ctex"
[node name="Editor" type="Node3D" unique_id=1027707839] [node name="Editor" type="Node3D" unique_id=1027707839]
[node name="TerrainMeshEditor" type="TerrainMeshEditor" parent="." unique_id=1382595562] [node name="TerrainMeshEditor" type="TerrainMeshEditor" parent="." unique_id=1382595562]
@ -161,17 +167,44 @@ grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
current_tab = 0 current_tab = 0
[node name="MarginContainer" type="MarginContainer" parent="LeftPanel/TabContainer" unique_id=1533578826] [node name="Layers" type="VBoxContainer" parent="LeftPanel/TabContainer" unique_id=138865385]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
metadata/_tab_index = 0 metadata/_tab_index = 0
[node name="Tree" type="PrimitiveLayerList" parent="LeftPanel/TabContainer/MarginContainer" unique_id=797700186 node_paths=PackedStringArray("terrain")] [node name="Tree" type="PrimitiveLayerList" parent="LeftPanel/TabContainer/Layers" unique_id=797700186 node_paths=PackedStringArray("terrain")]
layout_mode = 2 layout_mode = 2
size_flags_vertical = 3
columns = 4 columns = 4
drop_mode_flags = 2
select_mode = 1
terrain = NodePath("../../../../TerrainMeshEditor") terrain = NodePath("../../../../TerrainMeshEditor")
[node name="HBoxContainer" type="HBoxContainer" parent="LeftPanel/TabContainer/Layers" unique_id=702489990]
layout_mode = 2
size_flags_vertical = 8
alignment = 1
[node name="TextureRect" type="TextureRect" parent="LeftPanel/TabContainer/Layers/HBoxContainer" unique_id=1669840346]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
texture = ExtResource("4_q68jb")
expand_mode = 2
stretch_mode = 4
[node name="AddPointPrimitive" type="Button" parent="LeftPanel/TabContainer/Layers/HBoxContainer" unique_id=535482641]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
icon = SubResource("CompressedTexture2D_xg7d5")
expand_icon = true
[node name="AddPlanePrimitive" type="Button" parent="LeftPanel/TabContainer/Layers/HBoxContainer" unique_id=287076599]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
icon = ExtResource("4_xg7d5")
expand_icon = true
[node name="AddNoisePrimitive" type="Button" parent="LeftPanel/TabContainer/Layers/HBoxContainer" unique_id=769590598]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
icon = ExtResource("5_eqbpn")
expand_icon = true
[connection signal="primitives_changed" from="TerrainMeshEditor" to="TerrainMeshEditor" method="_on_primitives_changed"] [connection signal="primitives_changed" from="TerrainMeshEditor" to="TerrainMeshEditor" method="_on_primitives_changed"]