Work on the mesh data resource editor plugin. Also updated the mesh data resource module to the latest.

This commit is contained in:
Relintai 2021-09-13 18:47:56 +02:00
parent 74b35246c8
commit 8e0e86ef39
4 changed files with 47 additions and 3 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": {"3.2": "94a0fc47f7b4e90f8973f9adbfd3312579ed2825", "master": "8c73e813134001e575b6f59e3b0100471c007410", "3.x": "95162ca393e48d73a2a3d14147f6fb85779696ec"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "cc9dc30b8377552df79ee4d53e1ed6d51cb87408"}, "ui_extensions": {"master": "f82273f54cb1ab87d458c91af9554acec5c10831"}, "voxelman": {"master": "9253cc53c6fbbd78b5e4268eb498ef55b4dd0181"}, "texture_packer": {"master": "a0786956813a85b5a82093a081b90c2f8a000e6c"}, "fastnoise": {"master": "d447fd5364e9ab5a6b14184483eab23cd3fe820b"}, "mesh_data_resource": {"master": "4830687056297c432bfbfd1a2c1572546daf8e7d"}, "procedural_animations": {"master": "f8aae42bf06b3936cc6bd24cb18e1c3ec9f78f4f"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "2afd6eff45f9a921bdf4090ff3029def86df5cb5"}, "mesh_utils": {"master": "92b6066d026ba8bfec62282063c372f5ec76dea4"}, "broken_seals_module": {"master": "2afea56eba66beeb543934edf5a38a8aa63fc79b"}, "thread_pool": {"master": "b2e8c815392052947e7386f722913a12eea543a4"}, "terraman": {"master": "86de26c2c7a15185658680ae79c39a0c8bb159ce"}} {"engine": {"3.2": "94a0fc47f7b4e90f8973f9adbfd3312579ed2825", "master": "8c73e813134001e575b6f59e3b0100471c007410", "3.x": "95162ca393e48d73a2a3d14147f6fb85779696ec"}, "world_generator": {"master": "260c430f11b0b591eaf4714516419aa327d2842c"}, "entity_spell_system": {"master": "cc9dc30b8377552df79ee4d53e1ed6d51cb87408"}, "ui_extensions": {"master": "f82273f54cb1ab87d458c91af9554acec5c10831"}, "voxelman": {"master": "9253cc53c6fbbd78b5e4268eb498ef55b4dd0181"}, "texture_packer": {"master": "a0786956813a85b5a82093a081b90c2f8a000e6c"}, "fastnoise": {"master": "d447fd5364e9ab5a6b14184483eab23cd3fe820b"}, "mesh_data_resource": {"master": "e031ed36b5a1d12d2c4d2fdcd794dcd19dce4257"}, "procedural_animations": {"master": "f8aae42bf06b3936cc6bd24cb18e1c3ec9f78f4f"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "props": {"master": "2afd6eff45f9a921bdf4090ff3029def86df5cb5"}, "mesh_utils": {"master": "92b6066d026ba8bfec62282063c372f5ec76dea4"}, "broken_seals_module": {"master": "2afea56eba66beeb543934edf5a38a8aa63fc79b"}, "thread_pool": {"master": "b2e8c815392052947e7386f722913a12eea543a4"}, "terraman": {"master": "86de26c2c7a15185658680ae79c39a0c8bb159ce"}}

View File

@ -40,3 +40,13 @@ func _unhandled_key_input(event : InputEventKey) -> void:
elif event.scancode == KEY_Z: elif event.scancode == KEY_Z:
if plugin: if plugin:
plugin.set_axis_z(event.pressed) plugin.set_axis_z(event.pressed)
func _on_Extrude_pressed():
pass # Replace with function body.
func _on_AddBox_pressed():
pass # Replace with function body.
func _on_UnwrapButton_pressed():
plugin.uv_unwrap()

View File

@ -121,9 +121,31 @@ margin_right = 78.0
margin_bottom = 20.0 margin_bottom = 20.0
text = "F" text = "F"
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer"]
margin_top = 72.0 margin_top = 72.0
margin_right = 1010.0 margin_right = 1010.0
margin_bottom = 140.0
[node name="Extrude" type="Button" parent="VBoxContainer/VBoxContainer"]
margin_right = 1010.0
margin_bottom = 20.0
text = "Extrude"
[node name="AddBox" type="Button" parent="VBoxContainer/VBoxContainer"]
margin_top = 24.0
margin_right = 1010.0
margin_bottom = 44.0
text = "Add Box"
[node name="UnwrapButton" type="Button" parent="VBoxContainer/VBoxContainer"]
margin_top = 48.0
margin_right = 1010.0
margin_bottom = 68.0
text = "UV Unwrap"
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
margin_top = 144.0
margin_right = 1010.0
margin_bottom = 586.0 margin_bottom = 586.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
@ -136,3 +158,7 @@ margin_right = 100.0
margin_bottom = 100.0 margin_bottom = 100.0
rect_min_size = Vector2( 100, 100 ) rect_min_size = Vector2( 100, 100 )
script = ExtResource( 3 ) script = ExtResource( 3 )
[connection signal="pressed" from="VBoxContainer/VBoxContainer/Extrude" to="." method="_on_Extrude_pressed"]
[connection signal="pressed" from="VBoxContainer/VBoxContainer/AddBox" to="." method="_on_AddBox_pressed"]
[connection signal="pressed" from="VBoxContainer/VBoxContainer/UnwrapButton" to="." method="_on_UnwrapButton_pressed"]

View File

@ -9,6 +9,8 @@ var mdi_ed_gui : Control
var active_gizmos : Array var active_gizmos : Array
var current_mesh_data_instance : MeshDataInstance = null
func _enter_tree(): func _enter_tree():
#print("_enter_tree") #print("_enter_tree")
@ -55,6 +57,8 @@ func handles(object):
func edit(object): func edit(object):
var mdi : MeshDataInstance = object as MeshDataInstance var mdi : MeshDataInstance = object as MeshDataInstance
current_mesh_data_instance = mdi
if mdi: if mdi:
mdi_ed_gui.set_mesh_data_resource(mdi.mesh_data) mdi_ed_gui.set_mesh_data_resource(mdi.mesh_data)
@ -107,7 +111,11 @@ func set_axis_y(on : bool) -> void:
func set_axis_z(on : bool) -> void: func set_axis_z(on : bool) -> void:
for g in active_gizmos: for g in active_gizmos:
g.set_axis_z(on) g.set_axis_z(on)
func uv_unwrap() -> void:
if current_mesh_data_instance && current_mesh_data_instance.mesh_data:
current_mesh_data_instance.mesh_data.uv_unwrap()
func forward_spatial_gui_input(camera, event): func forward_spatial_gui_input(camera, event):
for g in active_gizmos: for g in active_gizmos:
if g.forward_spatial_gui_input(0, camera, event): if g.forward_spatial_gui_input(0, camera, event):