2021-02-09 01:40:13 +01:00
|
|
|
tool
|
|
|
|
extends EditorSpatialGizmoPlugin
|
|
|
|
|
|
|
|
const MDIGizmo = preload("res://addons/mesh_data_resource_editor/MIDGizmo.gd")
|
|
|
|
|
2021-02-28 00:18:38 +01:00
|
|
|
var plugin
|
|
|
|
|
2021-02-09 01:40:13 +01:00
|
|
|
func _init():
|
2022-01-18 21:11:37 +01:00
|
|
|
create_material("main", Color(0.7, 0.7, 0.7))
|
2022-01-18 22:22:32 +01:00
|
|
|
create_material("seam", Color(1, 0, 0), false, true)
|
2021-02-09 01:40:13 +01:00
|
|
|
create_handle_material("handles")
|
|
|
|
|
|
|
|
func get_name():
|
|
|
|
return "MDIGizmo"
|
|
|
|
|
|
|
|
func get_priority():
|
|
|
|
return 100
|
|
|
|
|
|
|
|
func create_gizmo(spatial):
|
|
|
|
if spatial is MeshDataInstance:
|
2021-02-28 00:18:38 +01:00
|
|
|
var gizmo = MDIGizmo.new()
|
|
|
|
|
2022-01-20 21:48:21 +01:00
|
|
|
gizmo.set_editor_plugin(plugin)
|
2021-12-29 21:21:23 +01:00
|
|
|
gizmo.set_spatial_node(spatial)
|
|
|
|
gizmo.setup()
|
2021-02-28 00:18:38 +01:00
|
|
|
plugin.register_gizmo(gizmo)
|
|
|
|
|
|
|
|
return gizmo
|
2021-02-09 01:40:13 +01:00
|
|
|
else:
|
|
|
|
return null
|
2021-02-28 00:18:38 +01:00
|
|
|
|
|
|
|
func is_handle_highlighted(gizmo, index):
|
|
|
|
pass
|