diff --git a/README.md b/README.md index e55828d..d043e5a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,24 @@ -# BoneEditor +# BoneGizmo + Plugin for Godot Engine Simple Gizmo so you can edit bone transforms easily. -# How to use: -Append the node "BoneGizmo" to your scene -Select the node and change the exposed variables "Skeleton Path" as a string path to the Skeleton Node. -Change the exposed variable "Edit Bone" as a string name of the bone you want to edit. (Listed in the Skeleton node) +## How to use: + +1. Enable plugin. +2. Add a BoneGizmo node to your scene. +3. Select BoneGizmo in scene tree and ensure it's properties points to a valid + Skeleton node and an optional AnimationPlayer node. +4. When you select a BoneGizmo node + - The BoneGizmo dock enables and loads up the selected BoneGizmo. + - You can then search for a bone. A highlighted bone is a selected bone. + - Bone filters are persisted via metadata for you to continue your work at + another time. +5. Hit *Run Gizmo* in the BoneGizmo dock. +6. Translate, rotate, and scale your selected bone. + +## Caveats + +You should disable *Run Gizmo* when an animation is playing. + +BoneGizmo nodes will remain in your scene tree. diff --git a/addons/bone_gizmo.gd b/addons/bone_gizmo.gd deleted file mode 100644 index 5318843..0000000 --- a/addons/bone_gizmo.gd +++ /dev/null @@ -1,8 +0,0 @@ -tool -extends EditorPlugin - -func _enter_tree(): - add_custom_type("BoneGizmo", "Spatial", preload("bone_gizmo_node.gd"), preload("bone_gizmo.png")) - -func _exit_tree(): - remove_custom_type("BoneGizmo") diff --git a/addons/bone_gizmo/bone_finder.gd b/addons/bone_gizmo/bone_finder.gd new file mode 100644 index 0000000..abae82a --- /dev/null +++ b/addons/bone_gizmo/bone_finder.gd @@ -0,0 +1,43 @@ +tool +extends VBoxContainer + +signal bone_selected(this, name, id) + +onready var _bone_list: ItemList = $bone_list as ItemList +onready var _filter_edit: LineEdit = find_node('filter') as LineEdit + +var _skel: Skeleton + +var filter := '' setget set_filter,get_filter +func get_filter() -> String: return filter +func set_filter(new_val: String): + filter = new_val + _filter_edit.text = filter + refresh_bone_list() + +func set_skeleton(skeleton: Skeleton): + if skeleton == null: + _bone_list.clear() + _skel = null + return + if _skel != skeleton: + _skel = skeleton + refresh_bone_list() + +func refresh_bone_list(): + if _skel == null: + return + _bone_list.clear() + for id in _skel.get_bone_count(): + var name = _skel.get_bone_name(id) + if filter == "" or name.findn(filter) > -1: + _bone_list.add_item(name) + _bone_list.set_item_metadata(_bone_list.get_item_count() - 1, {name = name, id = id}) + +func _on_filter_text_changed(new_text: String) -> void: + filter = new_text + refresh_bone_list() + +func _on_bone_list_item_selected(index: int) -> void: + var meta = _bone_list.get_item_metadata(index) + emit_signal("bone_selected", self, meta.name, meta.id) diff --git a/addons/bone_gizmo/bone_finder.tscn b/addons/bone_gizmo/bone_finder.tscn new file mode 100644 index 0000000..708a92f --- /dev/null +++ b/addons/bone_gizmo/bone_finder.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/bone_gizmo/bone_finder.gd" type="Script" id=1] + +[node name="bone_finder" type="VBoxContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +script = ExtResource( 1 ) + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +margin_right = 1024.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 + +[node name="Label" type="Label" parent="HBoxContainer"] +margin_top = 5.0 +margin_right = 37.0 +margin_bottom = 19.0 +text = "Filter:" + +[node name="filter" type="LineEdit" parent="HBoxContainer"] +margin_left = 41.0 +margin_right = 1024.0 +margin_bottom = 24.0 +size_flags_horizontal = 3 +caret_blink = true + +[node name="bone_list" type="ItemList" parent="."] +margin_top = 28.0 +margin_right = 1024.0 +margin_bottom = 600.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +[connection signal="text_changed" from="HBoxContainer/filter" to="." method="_on_filter_text_changed"] +[connection signal="item_selected" from="bone_list" to="." method="_on_bone_list_item_selected"] diff --git a/addons/bone_gizmo/bone_gizmo.gd b/addons/bone_gizmo/bone_gizmo.gd new file mode 100644 index 0000000..5eab8ad --- /dev/null +++ b/addons/bone_gizmo/bone_gizmo.gd @@ -0,0 +1,86 @@ +tool +extends Spatial + +signal path_changed(what) + +# All paths are must be relative to the node (BoneGizmo) +export(NodePath) var skeleton_path = @"../Skeleton" setget set_skeleton_path +func set_skeleton_path(new_val): + if new_val == skeleton_path: + return + skeleton_path = new_val + emit_signal("path_changed", "skeleton") + +export(NodePath) var animation_path = @"../AnimationPlayer" setget set_animation_path +func set_animation_path(new_val): + if new_val == animation_path: + return + animation_path = new_val + emit_signal("path_changed", "animation") + +var running: bool setget set_running,get_running +func get_running() -> bool: return running +func set_running(new_val: bool) -> void: + if new_val and not running: + global_transform = get_skeleton().get_bone_global_pose(get_edit_bone_index()) + set_process(true) + elif not new_val: + set_process(false) + running = new_val + +var edit_bone_filter setget set_edit_bone_filter,get_edit_bone_filter +func get_edit_bone_filter(): + return get_meta("edit_bone_filter") if has_meta("edit_bone_filter") else "" +func set_edit_bone_filter(new_val): + set_meta("edit_bone_filter", new_val) + +var edit_bone = "" +var allowed_to_run = false + +func _ready(): + set_running(false) + +func _process(delta): + var skeleton = get_skeleton() + var bone_index = get_edit_bone_index() + skeleton.set_bone_global_pose(bone_index, global_transform) + +func reset() -> void: + transform = Transform() + +func can_run() -> bool: + return allowed_to_run and (get_skeleton() != null) and (get_edit_bone_index() != -1) + +func get_animation_player() -> AnimationPlayer: + return get_node(animation_path) as AnimationPlayer + +func get_skeleton() -> Skeleton: + return get_node(skeleton_path) as Skeleton + +func get_edit_bone_index() -> int: + return get_skeleton().find_bone(edit_bone) + +func create_tracks(): + var skel = get_skeleton() + var anim_player = get_animation_player() + var anim = anim_player.get_animation(anim_player.assigned_animation) + for i in skel.get_bone_count(): + anim.add_track(Animation.TYPE_TRANSFORM,i) + anim.track_set_path(i,skeleton_path + ":" + skel.get_bone_name(i)) + +# This will override all the bone poses in the track with the current ones +func insert_key(): + var skel = get_skeleton() + var anim_player = get_animation_player() + var anim = anim_player.get_animation(anim_player.assigned_animation) + for i in skel.get_bone_count(): + var bone_name = skel.get_bone_name(i) + var bone_pose = skel.get_bone_pose(i) + var bone_track = anim.find_track(NodePath(skel.name + ':' + bone_name)) + anim.transform_track_insert_key( + bone_track, + anim_player.current_animation_position, + bone_pose.origin, + Quat(bone_pose.basis), + bone_pose.basis.get_scale() + ) \ No newline at end of file diff --git a/addons/bone_gizmo.png b/addons/bone_gizmo/bone_gizmo.png similarity index 100% rename from addons/bone_gizmo.png rename to addons/bone_gizmo/bone_gizmo.png diff --git a/addons/bone_gizmo/dock.gd b/addons/bone_gizmo/dock.gd new file mode 100644 index 0000000..64d7a71 --- /dev/null +++ b/addons/bone_gizmo/dock.gd @@ -0,0 +1,64 @@ +tool +extends Control + +onready var bone_finder = find_node('bone_finder') +onready var run_gizmo_button = find_node('RunGizmo') + +var gizmo setget set_gizmo,get_gizmo +func get_gizmo(): return gizmo +func set_gizmo(new_val): + if is_instance_valid(gizmo): + gizmo.running = false + gizmo.disconnect("path_changed", self, "_on_gizmo_path_changed") + + gizmo = new_val + if gizmo == null: + $Disabled.visible = true + run_gizmo_button.pressed = false + bone_finder.set_skeleton(null) + bone_finder.set_filter('') + else: + $Disabled.visible = false + bone_finder.set_skeleton(gizmo.get_skeleton()) + bone_finder.set_filter(gizmo.edit_bone_filter) + run_gizmo_button.pressed = gizmo.can_run() + gizmo.running = gizmo.can_run() + gizmo.connect("path_changed", self, "_on_gizmo_path_changed") + +func _on_gizmo_path_changed(what): + if what == "skeleton": + bone_finder.set_skeleton(gizmo.get_skeleton()) + gizmo.running = gizmo.can_run() + +func _on_ResetGizmo_pressed(): + gizmo.reset() + print("BoneGizmo reset transform") + +func _on_RunGizmo_toggled(button_pressed): + gizmo.allowed_to_run = button_pressed + gizmo.running = gizmo.can_run() + print("BoneGizmo running: ", gizmo.running) + +func _on_CreateTracks_pressed(): + if check_anim_track_operation(): + gizmo.create_tracks() + +func _on_InsertKey_pressed(): + if check_anim_track_operation(): + gizmo.insert_key() + +func check_anim_track_operation() -> bool: + var passed = true + if gizmo.get_skeleton() == null: + print("BoneGizmo Invalid skeleton path") + passed = false + if gizmo.get_animation_player() == null: + print("BoneGizmo Invalid animation path") + passed = false + return passed + +func _on_bone_finder_bone_selected(this, name, id) -> void: + gizmo.running = false + gizmo.edit_bone = name + gizmo.edit_bone_filter = this.filter + gizmo.running = gizmo.can_run() diff --git a/addons/bone_gizmo/dock.tscn b/addons/bone_gizmo/dock.tscn new file mode 100644 index 0000000..e298442 --- /dev/null +++ b/addons/bone_gizmo/dock.tscn @@ -0,0 +1,130 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://addons/bone_gizmo/dock.gd" type="Script" id=1] +[ext_resource path="res://addons/bone_gizmo/icon.png" type="Texture" id=2] +[ext_resource path="res://addons/bone_gizmo/bone_finder.tscn" type="PackedScene" id=3] + +[node name="BoneGizmo" type="Control"] +anchor_bottom = 1.0 +margin_right = 206.0 +mouse_filter = 1 +script = ExtResource( 1 ) + +[node name="VBox" type="VBoxContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +custom_constants/separation = 10 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBox"] +margin_right = 206.0 +margin_bottom = 16.0 +size_flags_horizontal = 3 +size_flags_vertical = 0 +alignment = 1 + +[node name="Info" type="Label" parent="VBox/HBoxContainer"] +margin_left = 30.0 +margin_top = 1.0 +margin_right = 155.0 +margin_bottom = 15.0 +text = "@thimenesup V 0.1" + +[node name="Icon" type="TextureRect" parent="VBox/HBoxContainer"] +margin_left = 159.0 +margin_right = 175.0 +margin_bottom = 16.0 +texture = ExtResource( 2 ) + +[node name="FindGizmo" type="Button" parent="VBox"] +visible = false +margin_top = 26.0 +margin_right = 206.0 +margin_bottom = 46.0 +text = "Find Gizmo" + +[node name="ResetGizmo" type="Button" parent="VBox"] +visible = false +margin_top = 26.0 +margin_right = 206.0 +margin_bottom = 46.0 +text = "Reset Gizmo Matrix" + +[node name="RunGizmo" type="CheckButton" parent="VBox"] +margin_top = 26.0 +margin_right = 206.0 +margin_bottom = 66.0 +text = "Run Gizmo" + +[node name="SkeletonPath" type="LineEdit" parent="VBox"] +visible = false +margin_top = 136.0 +margin_right = 206.0 +margin_bottom = 160.0 +placeholder_text = "Skeleton Path" +placeholder_alpha = 0.3 +caret_blink = true + +[node name="Bone" type="LineEdit" parent="VBox"] +visible = false +margin_top = 170.0 +margin_right = 206.0 +margin_bottom = 194.0 +placeholder_text = "Skeleton Bone" +placeholder_alpha = 0.3 +caret_blink = true + +[node name="AnimationPath" type="LineEdit" parent="VBox"] +visible = false +margin_top = 136.0 +margin_right = 206.0 +margin_bottom = 160.0 +placeholder_text = "AnimPlayer Path" +placeholder_alpha = 0.3 +caret_blink = true + +[node name="CreateTracks" type="Button" parent="VBox"] +margin_top = 76.0 +margin_right = 206.0 +margin_bottom = 96.0 +text = "Create Tracks" + +[node name="InsertKey" type="Button" parent="VBox"] +margin_top = 106.0 +margin_right = 206.0 +margin_bottom = 126.0 +text = "Insert Key" + +[node name="FindBone" type="Label" parent="VBox"] +margin_top = 136.0 +margin_right = 206.0 +margin_bottom = 150.0 +text = "Find Bone:" + +[node name="bone_finder" parent="VBox" instance=ExtResource( 3 )] +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 160.0 +margin_right = 206.0 +margin_bottom = 600.0 + +[node name="Disabled" type="Panel" parent="."] +self_modulate = Color( 0.290196, 0.290196, 0.290196, 0.564706 ) +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="Label" type="Label" parent="Disabled"] +anchor_right = 1.0 +anchor_bottom = 1.0 +text = "Select a BoneGizmo node" +align = 1 +valign = 1 +autowrap = true +[connection signal="pressed" from="VBox/FindGizmo" to="." method="_on_FindGizmo_pressed"] +[connection signal="pressed" from="VBox/ResetGizmo" to="." method="_on_ResetGizmo_pressed"] +[connection signal="toggled" from="VBox/RunGizmo" to="." method="_on_RunGizmo_toggled"] +[connection signal="text_entered" from="VBox/SkeletonPath" to="." method="_on_SkeletonPath_text_entered"] +[connection signal="text_entered" from="VBox/Bone" to="." method="_on_Bone_text_entered"] +[connection signal="text_entered" from="VBox/AnimationPath" to="." method="_on_AnimationPath_text_entered"] +[connection signal="pressed" from="VBox/CreateTracks" to="." method="_on_CreateTracks_pressed"] +[connection signal="pressed" from="VBox/InsertKey" to="." method="_on_InsertKey_pressed"] +[connection signal="bone_selected" from="VBox/bone_finder" to="." method="_on_bone_finder_bone_selected"] diff --git a/addons/icon.png b/addons/bone_gizmo/icon.png similarity index 100% rename from addons/icon.png rename to addons/bone_gizmo/icon.png diff --git a/addons/icon.png.import b/addons/bone_gizmo/icon.png.import similarity index 86% rename from addons/icon.png.import rename to addons/bone_gizmo/icon.png.import index dcabc97..9a7b3bb 100644 --- a/addons/icon.png.import +++ b/addons/bone_gizmo/icon.png.import @@ -3,20 +3,21 @@ importer="texture" type="StreamTexture" path="res://.import/icon.png-2a5a7f799fe1a3f1156b96d53d16544c.stex" +metadata={ +"vram_texture": false +} [deps] source_file="res://addons/bone_gizmo/icon.png" -source_md5="bd3fb020e2be509090f4517ccc956938" - dest_files=[ "res://.import/icon.png-2a5a7f799fe1a3f1156b96d53d16544c.stex" ] -dest_md5="6eca8843e06a1dde23ea895bea3f938b" [params] compress/mode=0 compress/lossy_quality=0.7 compress/hdr_mode=0 +compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 flags/filter=true @@ -26,6 +27,7 @@ flags/srgb=2 process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false +process/invert_color=false stream=false size_limit=0 detect_3d=true diff --git a/addons/plugin.cfg b/addons/bone_gizmo/plugin.cfg similarity index 100% rename from addons/plugin.cfg rename to addons/bone_gizmo/plugin.cfg diff --git a/addons/bone_gizmo/plugin.gd b/addons/bone_gizmo/plugin.gd new file mode 100644 index 0000000..b1dbfcc --- /dev/null +++ b/addons/bone_gizmo/plugin.gd @@ -0,0 +1,51 @@ +# New Workflow Idea +# ----------------- +# Only enable bone gizmo dock when +# - bone has been chosen +# - BoneGizmo node is selected +# - BoneGizmo AnimationPlayer is not playing/stop when selected +# Auto "Run Gizmo" when dock is enabled +# Use edit_bone associated with BoneGizmo node. +# - You can have multiple BoneGizmos +# - Selecting a BoneGizmo activates it. +tool +extends EditorPlugin + +var dock +var bone_gizmo + +func _enter_tree(): + + # Load resources only when entering tree. + # Has the additional effect of being reloadable after script changes. + # You do not not need to restart editor. + var base_dir = get_script().get_path().get_base_dir() + var dock_scene = load(base_dir.plus_file("dock.tscn")) + var icon = load(base_dir.plus_file("icon.png")) + + bone_gizmo = load(base_dir.plus_file("bone_gizmo.gd")) + dock = dock_scene.instance() + + add_control_to_dock( DOCK_SLOT_LEFT_UL, dock) + add_custom_type("BoneGizmo", "Spatial", bone_gizmo, icon) + + connect("scene_changed", self, "_on_scene_changed") + +func _exit_tree(): + disconnect("scene_changed", self, "_on_scene_changed") + remove_custom_type("BoneGizmo") + remove_control_from_docks( dock ) # Remove the dock + dock.free() # Erase the control from the memory + bone_gizmo = null + +func _on_scene_changed(scene): + if scene == null: + dock.gizmo = null + +func handles(object: Object) -> bool: + if object is bone_gizmo: + dock.gizmo = object + return true + else: + dock.gizmo = null + return false \ No newline at end of file diff --git a/addons/bone_gizmo_node.gd b/addons/bone_gizmo_node.gd deleted file mode 100644 index 2617a62..0000000 --- a/addons/bone_gizmo_node.gd +++ /dev/null @@ -1,40 +0,0 @@ -tool -extends Spatial - -var run = false - -#All paths are must be relative to the node (BoneGizmo) -export(String) var skeleton_path = "../Armature" -export(String) var edit_bone = "" -export(String) var animation_path = "../AnimationPlayer" - -var skeleton -var bone_index - -func _process(delta): - if run: - if not edit_bone == "" and not skeleton_path == "": - skeleton = get_node(skeleton_path) - bone_index = skeleton.find_bone(edit_bone) - skeleton.set_bone_pose(bone_index,transform) - - - -func create_tracks(): - var skeleton_node = get_node(skeleton_path) - var animation_node = get_node(animation_path) - var animation = animation_node.get_animation(animation_node.assigned_animation) - print(animation_node.current_animation) - for i in range(skeleton_node.get_bone_count()): - animation.add_track(Animation.TYPE_TRANSFORM,i) - animation.track_set_path(i,skeleton_path + ":" + skeleton_node.get_bone_name(i)) - - -func insert_key(): #This will override all the bone poses in the track with the current ones - var skeleton_node = get_node(skeleton_path) - var animation_node = get_node(animation_path) - var animation = animation_node.get_animation(animation_node.assigned_animation) - for i in range(skeleton_node.get_bone_count()): - var bone_tr = skeleton_node.get_bone_pose(i) - var rot = Quat(bone_tr.basis) - animation.transform_track_insert_key(i,animation_node.current_animation_position,bone_tr.origin,rot,bone_tr.basis.get_scale()) \ No newline at end of file diff --git a/addons/dock.gd b/addons/dock.gd deleted file mode 100644 index 02f6ef7..0000000 --- a/addons/dock.gd +++ /dev/null @@ -1,74 +0,0 @@ -tool -extends Control - -var gizmo_node = null - - -func _on_FindGizmo_pressed(): - if not get_tree().get_edited_scene_root().find_node("BoneGizmo",true,false): - $"Output".set_text("BoneGizmo node not found!") - gizmo_node = null - else: - $"Output".set_text("BoneGizmo node found!") - gizmo_node = get_tree().get_edited_scene_root().find_node("BoneGizmo",true,false) - -func _on_ResetGizmo_pressed(): - if not gizmo_node == null: - gizmo_node.translation = Vector3(0,0,0) - gizmo_node.rotation = Vector3(0,0,0) - gizmo_node.scale = Vector3(1,1,1) - $"Output".set_text("BoneGizmo reset transform") - - -func _on_RunGizmo_toggled(button_pressed): - if not gizmo_node == null: - gizmo_node.run = button_pressed - -func _on_SkeletonPath_text_entered(new_text): - if not gizmo_node == null: - gizmo_node.skeleton_path = new_text - if not gizmo_node.has_node(gizmo_node.skeleton_path): - $"Output".set_text("Invalid skeleton path") - return - $"Output".set_text("Set skeleton path") - -func _on_Bone_text_entered(new_text): - if not gizmo_node == null: - gizmo_node.edit_bone = new_text - if gizmo_node.has_node(gizmo_node.skeleton_path): - if gizmo_node.get_node(gizmo_node.skeleton_path).find_bone(new_text) == -1: - $"Output".set_text("Invalid bone") - return - $"Output".set_text("Set bone") - - - -func _on_AnimationPath_text_entered(new_text): - if not gizmo_node == null: - gizmo_node.animation_path = new_text - if not gizmo_node.has_node(gizmo_node.animation_path): - $"Output".set_text("Invalid animation path") - return - $"Output".set_text("Set animation player path") - - -func _on_CreateTracks_pressed(): - if not gizmo_node == null: - if not gizmo_node.has_node(gizmo_node.skeleton_path): - $"Output".set_text("Invalid skeleton path") - return - if not gizmo_node.has_node(gizmo_node.animation_path): - $"Output".set_text("Invalid animation path") - return - gizmo_node.create_tracks() - - -func _on_InsertKey_pressed(): - if not gizmo_node == null: - if not gizmo_node.has_node(gizmo_node.skeleton_path): - $"Output".set_text("Invalid skeleton path") - return - if not gizmo_node.has_node(gizmo_node.animation_path): - $"Output".set_text("Invalid animation path") - return - gizmo_node.insert_key() diff --git a/addons/dock.tscn b/addons/dock.tscn deleted file mode 100644 index 2e9d3a8..0000000 --- a/addons/dock.tscn +++ /dev/null @@ -1,311 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://addons/bone_gizmo/dock.gd" type="Script" id=1] -[ext_resource path="res://addons/bone_gizmo/icon.png" type="Texture" id=2] - -[node name="BoneGizmo" type="Control" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 64.0 -margin_bottom = 64.0 -rect_pivot_offset = Vector2( 0, 0 ) -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -script = ExtResource( 1 ) -_sections_unfolded = [ "Rect" ] - -[node name="VBox" type="VBoxContainer" parent="." index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 20.0 -margin_top = 40.0 -margin_right = 174.0 -margin_bottom = 230.0 -rect_pivot_offset = Vector2( 0, 0 ) -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -custom_constants/separation = 10 -alignment = 0 -_sections_unfolded = [ "Rect", "custom_constants" ] - -[node name="FindGizmo" type="Button" parent="VBox" index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 154.0 -margin_bottom = 20.0 -rect_pivot_offset = Vector2( 0, 0 ) -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -text = "Find Gizmo" -flat = false -align = 1 - -[node name="ResetGizmo" type="Button" parent="VBox" index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 30.0 -margin_right = 154.0 -margin_bottom = 50.0 -rect_pivot_offset = Vector2( 0, 0 ) -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -text = "Reset Gizmo Matrix" -flat = false -align = 1 - -[node name="RunGizmo" type="CheckButton" parent="VBox" index="2"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 60.0 -margin_right = 154.0 -margin_bottom = 100.0 -rect_pivot_offset = Vector2( 0, 0 ) -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = true -enabled_focus_mode = 2 -shortcut = null -group = null -text = "Run Gizmo" -flat = false -align = 0 - -[node name="SkeletonPath" type="LineEdit" parent="VBox" index="3"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 110.0 -margin_right = 154.0 -margin_bottom = 134.0 -rect_pivot_offset = Vector2( 0, 0 ) -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 -size_flags_horizontal = 1 -size_flags_vertical = 1 -focus_mode = 2 -context_menu_enabled = true -placeholder_text = "Skeleton Path" -placeholder_alpha = 0.3 -caret_blink = true -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Placeholder" ] - -[node name="Bone" type="LineEdit" parent="VBox" index="4"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 144.0 -margin_right = 154.0 -margin_bottom = 168.0 -rect_pivot_offset = Vector2( 0, 0 ) -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 -size_flags_horizontal = 1 -size_flags_vertical = 1 -focus_mode = 2 -context_menu_enabled = true -placeholder_text = "Skeleton Bone" -placeholder_alpha = 0.3 -caret_blink = true -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Placeholder" ] - -[node name="AnimationPath" type="LineEdit" parent="VBox" index="5"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 178.0 -margin_right = 154.0 -margin_bottom = 202.0 -rect_pivot_offset = Vector2( 0, 0 ) -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 -size_flags_horizontal = 1 -size_flags_vertical = 1 -focus_mode = 2 -context_menu_enabled = true -placeholder_text = "AnimPlayer Path" -placeholder_alpha = 0.3 -caret_blink = true -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Placeholder" ] - -[node name="CreateTracks" type="Button" parent="VBox" index="6"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 212.0 -margin_right = 154.0 -margin_bottom = 232.0 -rect_pivot_offset = Vector2( 0, 0 ) -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -text = "Create Tracks" -flat = false -align = 1 - -[node name="InsertKey" type="Button" parent="VBox" index="7"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 242.0 -margin_right = 154.0 -margin_bottom = 262.0 -rect_pivot_offset = Vector2( 0, 0 ) -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -toggle_mode = false -enabled_focus_mode = 2 -shortcut = null -group = null -text = "Insert Key" -flat = false -align = 1 - -[node name="Info" type="Label" parent="." index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 23.0 -margin_top = 3.0 -margin_right = 148.0 -margin_bottom = 17.0 -rect_pivot_offset = Vector2( 0, 0 ) -mouse_filter = 2 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 4 -text = "@thimenesup V 0.1" -percent_visible = 1.0 -lines_skipped = 0 -max_lines_visible = -1 - -[node name="Icon" type="TextureRect" parent="." index="2"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 158.0 -margin_top = 8.0 -margin_right = 174.0 -margin_bottom = 24.0 -rect_pivot_offset = Vector2( 0, 0 ) -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -texture = ExtResource( 2 ) -stretch_mode = 0 -_sections_unfolded = [ "Rect" ] - -[node name="Output" type="RichTextLabel" parent="." index="3"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 6.0 -margin_top = 500.0 -margin_right = 211.0 -margin_bottom = 703.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = true -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -bbcode_enabled = true -bbcode_text = "Output" -visible_characters = -1 -percent_visible = 1.0 -meta_underlined = true -tab_size = 4 -text = "Output" -scroll_active = true -scroll_following = false -selection_enabled = false -override_selected_font_color = false -_sections_unfolded = [ "BBCode", "Rect" ] - -[connection signal="pressed" from="VBox/FindGizmo" to="." method="_on_FindGizmo_pressed"] - -[connection signal="pressed" from="VBox/ResetGizmo" to="." method="_on_ResetGizmo_pressed"] - -[connection signal="toggled" from="VBox/RunGizmo" to="." method="_on_RunGizmo_toggled"] - -[connection signal="text_entered" from="VBox/SkeletonPath" to="." method="_on_SkeletonPath_text_entered"] - -[connection signal="text_entered" from="VBox/Bone" to="." method="_on_Bone_text_entered"] - -[connection signal="text_entered" from="VBox/AnimationPath" to="." method="_on_AnimationPath_text_entered"] - -[connection signal="pressed" from="VBox/CreateTracks" to="." method="_on_CreateTracks_pressed"] - -[connection signal="pressed" from="VBox/InsertKey" to="." method="_on_InsertKey_pressed"] - - diff --git a/addons/plugin.gd b/addons/plugin.gd deleted file mode 100644 index 8980c77..0000000 --- a/addons/plugin.gd +++ /dev/null @@ -1,14 +0,0 @@ -tool -extends EditorPlugin - -var dock - -func _enter_tree(): - add_custom_type("BoneGizmo", "Spatial", preload("bone_gizmo_node.gd"), preload("icon.png")) - dock = preload("res://addons/bone_gizmo/dock.tscn").instance() - add_control_to_dock( DOCK_SLOT_LEFT_UL, dock) - -func _exit_tree(): - remove_custom_type("BoneGizmo") - remove_control_from_docks( dock ) # Remove the dock - dock.free() # Erase the control from the memory \ No newline at end of file