2017-10-03 16:49:32 +00:00
|
|
|
/*************************************************************************/
|
2020-03-27 07:44:44 +00:00
|
|
|
/* skeleton_3d_editor_plugin.cpp */
|
2017-10-03 16:49:32 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
|
|
|
/* https://godotengine.org */
|
|
|
|
/*************************************************************************/
|
2021-01-01 19:13:46 +00:00
|
|
|
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
2017-10-03 16:49:32 +00:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
2020-03-27 07:44:44 +00:00
|
|
|
#include "skeleton_3d_editor_plugin.h"
|
2018-09-27 11:11:41 +00:00
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
#include "core/io/resource_saver.h"
|
|
|
|
#include "editor/editor_file_dialog.h"
|
|
|
|
#include "editor/editor_properties.h"
|
|
|
|
#include "editor/editor_scale.h"
|
|
|
|
#include "editor/plugins/animation_player_editor_plugin.h"
|
2020-03-27 07:44:44 +00:00
|
|
|
#include "node_3d_editor_plugin.h"
|
2020-03-26 21:49:16 +00:00
|
|
|
#include "scene/3d/collision_shape_3d.h"
|
2020-02-19 19:48:20 +00:00
|
|
|
#include "scene/3d/mesh_instance_3d.h"
|
2020-03-26 21:49:16 +00:00
|
|
|
#include "scene/3d/physics_body_3d.h"
|
|
|
|
#include "scene/3d/physics_joint_3d.h"
|
|
|
|
#include "scene/resources/capsule_shape_3d.h"
|
|
|
|
#include "scene/resources/sphere_shape_3d.h"
|
2017-10-03 16:49:32 +00:00
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
void BoneTransformEditor::create_editors() {
|
|
|
|
const Color section_color = get_theme_color("prop_subsection", "Editor");
|
|
|
|
|
|
|
|
section = memnew(EditorInspectorSection);
|
|
|
|
section->setup("trf_properties", label, this, section_color, true);
|
|
|
|
add_child(section);
|
|
|
|
|
|
|
|
key_button = memnew(Button);
|
|
|
|
key_button->set_text(TTR("Key Transform"));
|
|
|
|
key_button->set_visible(keyable);
|
|
|
|
key_button->set_icon(get_theme_icon("Key", "EditorIcons"));
|
|
|
|
key_button->set_flat(true);
|
|
|
|
section->get_vbox()->add_child(key_button);
|
|
|
|
|
|
|
|
enabled_checkbox = memnew(CheckBox(TTR("Pose Enabled")));
|
|
|
|
enabled_checkbox->set_flat(true);
|
|
|
|
enabled_checkbox->set_visible(toggle_enabled);
|
|
|
|
section->get_vbox()->add_child(enabled_checkbox);
|
|
|
|
|
2020-05-26 18:17:11 +00:00
|
|
|
// Translation property
|
|
|
|
translation_property = memnew(EditorPropertyVector3());
|
|
|
|
translation_property->setup(-10000, 10000, 0.001f, true);
|
|
|
|
translation_property->set_label("Translation");
|
|
|
|
translation_property->set_use_folding(true);
|
|
|
|
translation_property->set_read_only(false);
|
|
|
|
translation_property->connect("property_changed", callable_mp(this, &BoneTransformEditor::_value_changed_vector3));
|
|
|
|
section->get_vbox()->add_child(translation_property);
|
|
|
|
|
|
|
|
// Rotation property
|
|
|
|
rotation_property = memnew(EditorPropertyVector3());
|
|
|
|
rotation_property->setup(-10000, 10000, 0.001f, true);
|
|
|
|
rotation_property->set_label("Rotation Degrees");
|
|
|
|
rotation_property->set_use_folding(true);
|
|
|
|
rotation_property->set_read_only(false);
|
|
|
|
rotation_property->connect("property_changed", callable_mp(this, &BoneTransformEditor::_value_changed_vector3));
|
|
|
|
section->get_vbox()->add_child(rotation_property);
|
|
|
|
|
|
|
|
// Scale property
|
|
|
|
scale_property = memnew(EditorPropertyVector3());
|
|
|
|
scale_property->setup(-10000, 10000, 0.001f, true);
|
|
|
|
scale_property->set_label("Scale");
|
|
|
|
scale_property->set_use_folding(true);
|
|
|
|
scale_property->set_read_only(false);
|
|
|
|
scale_property->connect("property_changed", callable_mp(this, &BoneTransformEditor::_value_changed_vector3));
|
|
|
|
section->get_vbox()->add_child(scale_property);
|
|
|
|
|
|
|
|
// Transform/Matrix section
|
|
|
|
transform_section = memnew(EditorInspectorSection);
|
|
|
|
transform_section->setup("trf_properties_transform", "Matrix", this, section_color, true);
|
|
|
|
section->get_vbox()->add_child(transform_section);
|
|
|
|
|
|
|
|
// Transform/Matrix property
|
2021-06-04 01:58:26 +00:00
|
|
|
transform_property = memnew(EditorPropertyTransform3D());
|
2020-05-26 18:17:11 +00:00
|
|
|
transform_property->setup(-10000, 10000, 0.001f, true);
|
|
|
|
transform_property->set_label("Transform");
|
|
|
|
transform_property->set_use_folding(true);
|
|
|
|
transform_property->set_read_only(false);
|
|
|
|
transform_property->connect("property_changed", callable_mp(this, &BoneTransformEditor::_value_changed_transform));
|
|
|
|
transform_section->get_vbox()->add_child(transform_property);
|
2020-02-19 19:48:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::_notification(int p_what) {
|
|
|
|
switch (p_what) {
|
|
|
|
case NOTIFICATION_ENTER_TREE: {
|
|
|
|
create_editors();
|
2020-05-26 18:17:11 +00:00
|
|
|
key_button->connect("pressed", callable_mp(this, &BoneTransformEditor::_key_button_pressed));
|
|
|
|
enabled_checkbox->connect("toggled", callable_mp(this, &BoneTransformEditor::_checkbox_toggled));
|
2020-02-19 19:48:20 +00:00
|
|
|
[[fallthrough]];
|
|
|
|
}
|
|
|
|
case NOTIFICATION_SORT_CHILDREN: {
|
|
|
|
const Ref<Font> font = get_theme_font("font", "Tree");
|
2020-09-03 11:22:16 +00:00
|
|
|
int font_size = get_theme_font_size("font_size", "Tree");
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
Point2 buffer;
|
|
|
|
buffer.x += get_theme_constant("inspector_margin", "Editor");
|
2020-09-03 11:22:16 +00:00
|
|
|
buffer.y += font->get_height(font_size);
|
2020-02-19 19:48:20 +00:00
|
|
|
buffer.y += get_theme_constant("vseparation", "Tree");
|
|
|
|
|
2020-05-26 18:17:11 +00:00
|
|
|
const float vector_height = translation_property->get_size().y;
|
|
|
|
const float transform_height = transform_property->get_size().y;
|
2020-02-19 19:48:20 +00:00
|
|
|
const float button_height = key_button->get_size().y;
|
|
|
|
|
|
|
|
const float width = get_size().x - get_theme_constant("inspector_margin", "Editor");
|
|
|
|
Vector<Rect2> input_rects;
|
|
|
|
if (keyable && section->get_vbox()->is_visible()) {
|
|
|
|
input_rects.push_back(Rect2(key_button->get_position() + buffer, Size2(width, button_height)));
|
|
|
|
} else {
|
|
|
|
input_rects.push_back(Rect2(0, 0, 0, 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (section->get_vbox()->is_visible()) {
|
2020-05-26 18:17:11 +00:00
|
|
|
input_rects.push_back(Rect2(translation_property->get_position() + buffer, Size2(width, vector_height)));
|
|
|
|
input_rects.push_back(Rect2(rotation_property->get_position() + buffer, Size2(width, vector_height)));
|
|
|
|
input_rects.push_back(Rect2(scale_property->get_position() + buffer, Size2(width, vector_height)));
|
|
|
|
input_rects.push_back(Rect2(transform_property->get_position() + buffer, Size2(width, transform_height)));
|
2020-02-19 19:48:20 +00:00
|
|
|
} else {
|
|
|
|
const int32_t start = input_rects.size();
|
|
|
|
const int32_t empty_input_rect_elements = 4;
|
|
|
|
const int32_t end = start + empty_input_rect_elements;
|
|
|
|
for (int i = start; i < end; ++i) {
|
|
|
|
input_rects.push_back(Rect2(0, 0, 0, 0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int32_t i = 0; i < input_rects.size(); i++) {
|
|
|
|
background_rects[i] = input_rects[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
update();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case NOTIFICATION_DRAW: {
|
|
|
|
const Color dark_color = get_theme_color("dark_color_2", "Editor");
|
|
|
|
|
|
|
|
for (int i = 0; i < 5; ++i) {
|
|
|
|
draw_rect(background_rects[i], dark_color);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-26 18:17:11 +00:00
|
|
|
void BoneTransformEditor::_value_changed(const double p_value) {
|
2021-04-05 12:09:59 +00:00
|
|
|
if (updating) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
Transform3D tform = compute_transform_from_vector3s();
|
2020-05-26 18:17:11 +00:00
|
|
|
_change_transform(tform);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::_value_changed_vector3(const String p_property_name, const Vector3 p_vector, const StringName p_edited_property_name, const bool p_boolean) {
|
2021-04-05 12:09:59 +00:00
|
|
|
if (updating) {
|
2020-05-26 18:17:11 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-10-17 05:08:21 +00:00
|
|
|
Transform3D tform = compute_transform_from_vector3s();
|
2020-05-26 18:17:11 +00:00
|
|
|
_change_transform(tform);
|
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
Transform3D BoneTransformEditor::compute_transform_from_vector3s() const {
|
2020-05-26 18:17:11 +00:00
|
|
|
// Convert rotation from degrees to radians.
|
|
|
|
Vector3 prop_rotation = rotation_property->get_vector();
|
|
|
|
prop_rotation.x = Math::deg2rad(prop_rotation.x);
|
|
|
|
prop_rotation.y = Math::deg2rad(prop_rotation.y);
|
|
|
|
prop_rotation.z = Math::deg2rad(prop_rotation.z);
|
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
return Transform3D(
|
2020-05-26 18:17:11 +00:00
|
|
|
Basis(prop_rotation, scale_property->get_vector()),
|
|
|
|
translation_property->get_vector());
|
|
|
|
}
|
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
void BoneTransformEditor::_value_changed_transform(const String p_property_name, const Transform3D p_transform, const StringName p_edited_property_name, const bool p_boolean) {
|
2021-04-05 12:09:59 +00:00
|
|
|
if (updating) {
|
2020-05-26 18:17:11 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-05-26 18:17:11 +00:00
|
|
|
_change_transform(p_transform);
|
|
|
|
}
|
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
void BoneTransformEditor::_change_transform(Transform3D p_new_transform) {
|
2020-05-26 18:17:11 +00:00
|
|
|
if (property.get_slicec('/', 0) == "bones" && property.get_slicec('/', 2) == "custom_pose") {
|
2020-02-19 19:48:20 +00:00
|
|
|
undo_redo->create_action(TTR("Set Custom Bone Pose Transform"), UndoRedo::MERGE_ENDS);
|
|
|
|
undo_redo->add_undo_method(skeleton, "set_bone_custom_pose", property.get_slicec('/', 1).to_int(), skeleton->get_bone_custom_pose(property.get_slicec('/', 1).to_int()));
|
2020-05-26 18:17:11 +00:00
|
|
|
undo_redo->add_do_method(skeleton, "set_bone_custom_pose", property.get_slicec('/', 1).to_int(), p_new_transform);
|
2020-02-19 19:48:20 +00:00
|
|
|
undo_redo->commit_action();
|
|
|
|
} else if (property.get_slicec('/', 0) == "bones") {
|
|
|
|
undo_redo->create_action(TTR("Set Bone Transform"), UndoRedo::MERGE_ENDS);
|
|
|
|
undo_redo->add_undo_property(skeleton, property, skeleton->get(property));
|
2020-05-26 18:17:11 +00:00
|
|
|
undo_redo->add_do_property(skeleton, property, p_new_transform);
|
2020-02-19 19:48:20 +00:00
|
|
|
undo_redo->commit_action();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::update_enabled_checkbox() {
|
|
|
|
if (enabled_checkbox) {
|
|
|
|
const String path = "bones/" + property.get_slicec('/', 1) + "/enabled";
|
|
|
|
const bool is_enabled = skeleton->get(path);
|
|
|
|
enabled_checkbox->set_pressed(is_enabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::_update_properties() {
|
2021-04-05 12:09:59 +00:00
|
|
|
if (updating) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
2021-04-05 12:09:59 +00:00
|
|
|
if (skeleton == nullptr) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
updating = true;
|
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
Transform3D tform = skeleton->get(property);
|
2020-02-19 19:48:20 +00:00
|
|
|
_update_transform_properties(tform);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::_update_custom_pose_properties() {
|
2021-04-05 12:09:59 +00:00
|
|
|
if (updating) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
2021-04-05 12:09:59 +00:00
|
|
|
if (skeleton == nullptr) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
updating = true;
|
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
Transform3D tform = skeleton->get_bone_custom_pose(property.to_int());
|
2020-02-19 19:48:20 +00:00
|
|
|
_update_transform_properties(tform);
|
|
|
|
}
|
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
void BoneTransformEditor::_update_transform_properties(Transform3D tform) {
|
2020-05-26 18:17:11 +00:00
|
|
|
Basis rotation_basis = tform.get_basis();
|
|
|
|
Vector3 rotation_radians = rotation_basis.get_rotation_euler();
|
|
|
|
Vector3 rotation_degrees = Vector3(Math::rad2deg(rotation_radians.x), Math::rad2deg(rotation_radians.y), Math::rad2deg(rotation_radians.z));
|
|
|
|
Vector3 translation = tform.get_origin();
|
2020-02-19 19:48:20 +00:00
|
|
|
Vector3 scale = tform.basis.get_scale();
|
|
|
|
|
2020-05-26 18:17:11 +00:00
|
|
|
translation_property->update_using_vector(translation);
|
|
|
|
rotation_property->update_using_vector(rotation_degrees);
|
|
|
|
scale_property->update_using_vector(scale);
|
|
|
|
transform_property->update_using_transform(tform);
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
update_enabled_checkbox();
|
|
|
|
updating = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
BoneTransformEditor::BoneTransformEditor(Skeleton3D *p_skeleton) :
|
2020-11-24 09:12:55 +00:00
|
|
|
skeleton(p_skeleton) {
|
2020-02-19 19:48:20 +00:00
|
|
|
undo_redo = EditorNode::get_undo_redo();
|
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::set_target(const String &p_prop) {
|
|
|
|
property = p_prop;
|
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::set_keyable(const bool p_keyable) {
|
|
|
|
keyable = p_keyable;
|
|
|
|
if (key_button) {
|
|
|
|
key_button->set_visible(p_keyable);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::set_toggle_enabled(const bool p_enabled) {
|
|
|
|
toggle_enabled = p_enabled;
|
|
|
|
if (enabled_checkbox) {
|
|
|
|
enabled_checkbox->set_visible(p_enabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::_key_button_pressed() {
|
2021-04-05 12:09:59 +00:00
|
|
|
if (skeleton == nullptr) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
const BoneId bone_id = property.get_slicec('/', 1).to_int();
|
|
|
|
const String name = skeleton->get_bone_name(bone_id);
|
|
|
|
|
2021-04-05 12:09:59 +00:00
|
|
|
if (name.is_empty()) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
// Need to normalize the basis before you key it
|
2020-10-17 05:08:21 +00:00
|
|
|
Transform3D tform = compute_transform_from_vector3s();
|
2020-02-19 19:48:20 +00:00
|
|
|
tform.orthonormalize();
|
|
|
|
AnimationPlayerEditor::singleton->get_track_editor()->insert_transform_key(skeleton, name, tform);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BoneTransformEditor::_checkbox_toggled(const bool p_toggled) {
|
|
|
|
if (enabled_checkbox) {
|
|
|
|
const String path = "bones/" + property.get_slicec('/', 1) + "/enabled";
|
|
|
|
skeleton->set(path, p_toggled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-27 07:44:44 +00:00
|
|
|
void Skeleton3DEditor::_on_click_option(int p_option) {
|
2017-10-03 16:49:32 +00:00
|
|
|
if (!skeleton) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (p_option) {
|
|
|
|
case MENU_OPTION_CREATE_PHYSICAL_SKELETON: {
|
|
|
|
create_physical_skeleton();
|
2020-02-19 19:48:20 +00:00
|
|
|
break;
|
|
|
|
}
|
2017-10-03 16:49:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-27 07:44:44 +00:00
|
|
|
void Skeleton3DEditor::create_physical_skeleton() {
|
2017-10-03 16:49:32 +00:00
|
|
|
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
2020-02-19 19:48:20 +00:00
|
|
|
ERR_FAIL_COND(!get_tree());
|
2017-10-03 16:49:32 +00:00
|
|
|
Node *owner = skeleton == get_tree()->get_edited_scene_root() ? skeleton : skeleton->get_owner();
|
|
|
|
|
|
|
|
const int bc = skeleton->get_bone_count();
|
|
|
|
|
|
|
|
if (!bc) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Vector<BoneInfo> bones_infos;
|
|
|
|
bones_infos.resize(bc);
|
|
|
|
|
|
|
|
for (int bone_id = 0; bc > bone_id; ++bone_id) {
|
|
|
|
const int parent = skeleton->get_bone_parent(bone_id);
|
|
|
|
|
|
|
|
if (parent < 0) {
|
2018-07-25 01:11:03 +00:00
|
|
|
bones_infos.write[bone_id].relative_rest = skeleton->get_bone_rest(bone_id);
|
2017-10-03 16:49:32 +00:00
|
|
|
|
|
|
|
} else {
|
2019-11-30 19:27:12 +00:00
|
|
|
const int parent_parent = skeleton->get_bone_parent(parent);
|
|
|
|
|
2018-07-25 01:11:03 +00:00
|
|
|
bones_infos.write[bone_id].relative_rest = bones_infos[parent].relative_rest * skeleton->get_bone_rest(bone_id);
|
2017-10-03 16:49:32 +00:00
|
|
|
|
|
|
|
/// create physical bone on parent
|
|
|
|
if (!bones_infos[parent].physical_bone) {
|
2018-07-25 01:11:03 +00:00
|
|
|
bones_infos.write[parent].physical_bone = create_physical_bone(parent, bone_id, bones_infos);
|
2017-10-03 16:49:32 +00:00
|
|
|
|
|
|
|
ur->create_action(TTR("Create physical bones"));
|
|
|
|
ur->add_do_method(skeleton, "add_child", bones_infos[parent].physical_bone);
|
|
|
|
ur->add_do_reference(bones_infos[parent].physical_bone);
|
|
|
|
ur->add_undo_method(skeleton, "remove_child", bones_infos[parent].physical_bone);
|
|
|
|
ur->commit_action();
|
|
|
|
|
|
|
|
bones_infos[parent].physical_bone->set_bone_name(skeleton->get_bone_name(parent));
|
|
|
|
bones_infos[parent].physical_bone->set_owner(owner);
|
|
|
|
bones_infos[parent].physical_bone->get_child(0)->set_owner(owner); // set shape owner
|
|
|
|
|
|
|
|
/// Create joint between parent of parent
|
|
|
|
if (-1 != parent_parent) {
|
2020-03-26 21:49:16 +00:00
|
|
|
bones_infos[parent].physical_bone->set_joint_type(PhysicalBone3D::JOINT_TYPE_PIN);
|
2017-10-03 16:49:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-27 07:44:44 +00:00
|
|
|
PhysicalBone3D *Skeleton3DEditor::create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos) {
|
2020-10-17 05:08:21 +00:00
|
|
|
const Transform3D child_rest = skeleton->get_bone_rest(bone_child_id);
|
2020-02-09 08:41:18 +00:00
|
|
|
|
|
|
|
const real_t half_height(child_rest.origin.length() * 0.5);
|
|
|
|
const real_t radius(half_height * 0.2);
|
2017-10-03 16:49:32 +00:00
|
|
|
|
2020-03-26 21:49:16 +00:00
|
|
|
CapsuleShape3D *bone_shape_capsule = memnew(CapsuleShape3D);
|
2017-10-03 16:49:32 +00:00
|
|
|
bone_shape_capsule->set_height((half_height - radius) * 2);
|
|
|
|
bone_shape_capsule->set_radius(radius);
|
|
|
|
|
2020-03-26 21:49:16 +00:00
|
|
|
CollisionShape3D *bone_shape = memnew(CollisionShape3D);
|
2017-10-03 16:49:32 +00:00
|
|
|
bone_shape->set_shape(bone_shape_capsule);
|
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
Transform3D capsule_transform;
|
2020-11-26 00:35:27 +00:00
|
|
|
capsule_transform.basis = Basis(Vector3(1, 0, 0), Vector3(0, 0, 1), Vector3(0, -1, 0));
|
|
|
|
bone_shape->set_transform(capsule_transform);
|
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
Transform3D body_transform;
|
2021-01-30 09:22:20 +00:00
|
|
|
body_transform.set_look_at(Vector3(0, 0, 0), child_rest.origin);
|
2020-02-09 08:41:18 +00:00
|
|
|
body_transform.origin = body_transform.basis.xform(Vector3(0, 0, -half_height));
|
2017-10-03 16:49:32 +00:00
|
|
|
|
2020-10-17 05:08:21 +00:00
|
|
|
Transform3D joint_transform;
|
2017-10-03 16:49:32 +00:00
|
|
|
joint_transform.origin = Vector3(0, 0, half_height);
|
|
|
|
|
2020-03-26 21:49:16 +00:00
|
|
|
PhysicalBone3D *physical_bone = memnew(PhysicalBone3D);
|
2017-10-03 16:49:32 +00:00
|
|
|
physical_bone->add_child(bone_shape);
|
|
|
|
physical_bone->set_name("Physical Bone " + skeleton->get_bone_name(bone_id));
|
|
|
|
physical_bone->set_body_offset(body_transform);
|
|
|
|
physical_bone->set_joint_offset(joint_transform);
|
|
|
|
return physical_bone;
|
|
|
|
}
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
Variant Skeleton3DEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
|
|
|
|
TreeItem *selected = joint_tree->get_selected();
|
|
|
|
|
2021-04-05 12:09:59 +00:00
|
|
|
if (!selected) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return Variant();
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
Ref<Texture> icon = selected->get_icon(0);
|
|
|
|
|
|
|
|
VBoxContainer *vb = memnew(VBoxContainer);
|
|
|
|
HBoxContainer *hb = memnew(HBoxContainer);
|
|
|
|
TextureRect *tf = memnew(TextureRect);
|
|
|
|
tf->set_texture(icon);
|
|
|
|
tf->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED);
|
|
|
|
hb->add_child(tf);
|
|
|
|
Label *label = memnew(Label(selected->get_text(0)));
|
|
|
|
hb->add_child(label);
|
|
|
|
vb->add_child(hb);
|
|
|
|
hb->set_modulate(Color(1, 1, 1, 1));
|
|
|
|
|
|
|
|
set_drag_preview(vb);
|
|
|
|
Dictionary drag_data;
|
|
|
|
drag_data["type"] = "nodes";
|
|
|
|
drag_data["node"] = selected;
|
|
|
|
|
|
|
|
return drag_data;
|
2018-08-24 11:28:53 +00:00
|
|
|
}
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
bool Skeleton3DEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
|
|
|
|
TreeItem *target = joint_tree->get_item_at_position(p_point);
|
2021-04-05 12:09:59 +00:00
|
|
|
if (!target) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return false;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
const String path = target->get_metadata(0);
|
2021-04-05 12:09:59 +00:00
|
|
|
if (!path.begins_with("bones/")) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return false;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
TreeItem *selected = Object::cast_to<TreeItem>(Dictionary(p_data)["node"]);
|
2021-04-05 12:09:59 +00:00
|
|
|
if (target == selected) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return false;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
const String path2 = target->get_metadata(0);
|
2021-04-05 12:09:59 +00:00
|
|
|
if (!path2.begins_with("bones/")) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return false;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Skeleton3DEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
2021-04-05 12:09:59 +00:00
|
|
|
if (!can_drop_data_fw(p_point, p_data, p_from)) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
TreeItem *target = joint_tree->get_item_at_position(p_point);
|
|
|
|
TreeItem *selected = Object::cast_to<TreeItem>(Dictionary(p_data)["node"]);
|
|
|
|
|
|
|
|
const BoneId target_boneidx = String(target->get_metadata(0)).get_slicec('/', 1).to_int();
|
|
|
|
const BoneId selected_boneidx = String(selected->get_metadata(0)).get_slicec('/', 1).to_int();
|
|
|
|
|
|
|
|
move_skeleton_bone(skeleton->get_path(), selected_boneidx, target_boneidx);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Skeleton3DEditor::move_skeleton_bone(NodePath p_skeleton_path, int32_t p_selected_boneidx, int32_t p_target_boneidx) {
|
|
|
|
Node *node = get_node_or_null(p_skeleton_path);
|
|
|
|
Skeleton3D *skeleton = Object::cast_to<Skeleton3D>(node);
|
|
|
|
ERR_FAIL_NULL(skeleton);
|
|
|
|
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
|
|
|
ur->create_action(TTR("Set Bone Parentage"));
|
|
|
|
// If the target is a child of ourselves, we move only *us* and not our children
|
|
|
|
if (skeleton->is_bone_parent_of(p_target_boneidx, p_selected_boneidx)) {
|
|
|
|
const BoneId parent_idx = skeleton->get_bone_parent(p_selected_boneidx);
|
|
|
|
const int bone_count = skeleton->get_bone_count();
|
|
|
|
for (BoneId i = 0; i < bone_count; ++i) {
|
|
|
|
if (skeleton->get_bone_parent(i) == p_selected_boneidx) {
|
|
|
|
ur->add_undo_method(skeleton, "set_bone_parent", i, skeleton->get_bone_parent(i));
|
|
|
|
ur->add_do_method(skeleton, "set_bone_parent", i, parent_idx);
|
|
|
|
skeleton->set_bone_parent(i, parent_idx);
|
|
|
|
}
|
|
|
|
}
|
2018-08-24 11:28:53 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
ur->add_undo_method(skeleton, "set_bone_parent", p_selected_boneidx, skeleton->get_bone_parent(p_selected_boneidx));
|
|
|
|
ur->add_do_method(skeleton, "set_bone_parent", p_selected_boneidx, p_target_boneidx);
|
|
|
|
skeleton->set_bone_parent(p_selected_boneidx, p_target_boneidx);
|
|
|
|
|
|
|
|
update_joint_tree();
|
|
|
|
ur->commit_action();
|
2017-10-03 16:49:32 +00:00
|
|
|
}
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
void Skeleton3DEditor::_joint_tree_selection_changed() {
|
|
|
|
TreeItem *selected = joint_tree->get_selected();
|
|
|
|
const String path = selected->get_metadata(0);
|
|
|
|
|
|
|
|
if (path.begins_with("bones/")) {
|
|
|
|
const int b_idx = path.get_slicec('/', 1).to_int();
|
|
|
|
const String bone_path = "bones/" + itos(b_idx) + "/";
|
|
|
|
|
|
|
|
pose_editor->set_target(bone_path + "pose");
|
|
|
|
rest_editor->set_target(bone_path + "rest");
|
|
|
|
custom_pose_editor->set_target(bone_path + "custom_pose");
|
|
|
|
|
2021-03-31 16:19:01 +00:00
|
|
|
_update_properties();
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
pose_editor->set_visible(true);
|
|
|
|
rest_editor->set_visible(true);
|
|
|
|
custom_pose_editor->set_visible(true);
|
2017-10-03 16:49:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
void Skeleton3DEditor::_joint_tree_rmb_select(const Vector2 &p_pos) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void Skeleton3DEditor::_update_properties() {
|
2021-04-05 12:09:59 +00:00
|
|
|
if (rest_editor) {
|
2020-02-19 19:48:20 +00:00
|
|
|
rest_editor->_update_properties();
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
|
|
|
if (pose_editor) {
|
2020-02-19 19:48:20 +00:00
|
|
|
pose_editor->_update_properties();
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
|
|
|
if (custom_pose_editor) {
|
2020-02-19 19:48:20 +00:00
|
|
|
custom_pose_editor->_update_custom_pose_properties();
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Skeleton3DEditor::update_joint_tree() {
|
|
|
|
joint_tree->clear();
|
|
|
|
|
2021-04-05 12:09:59 +00:00
|
|
|
if (skeleton == nullptr) {
|
2020-02-19 19:48:20 +00:00
|
|
|
return;
|
2021-04-05 12:09:59 +00:00
|
|
|
}
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
TreeItem *root = joint_tree->create_item();
|
|
|
|
|
|
|
|
Map<int, TreeItem *> items;
|
|
|
|
|
|
|
|
items.insert(-1, root);
|
|
|
|
|
|
|
|
const Vector<int> &joint_porder = skeleton->get_bone_process_orders();
|
2020-05-26 18:17:11 +00:00
|
|
|
Ref<Texture> bone_icon = get_theme_icon("BoneAttachment3D", "EditorIcons");
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
for (int i = 0; i < joint_porder.size(); ++i) {
|
|
|
|
const int b_idx = joint_porder[i];
|
|
|
|
|
|
|
|
const int p_idx = skeleton->get_bone_parent(b_idx);
|
|
|
|
TreeItem *p_item = items.find(p_idx)->get();
|
|
|
|
|
|
|
|
TreeItem *joint_item = joint_tree->create_item(p_item);
|
|
|
|
items.insert(b_idx, joint_item);
|
|
|
|
|
|
|
|
joint_item->set_text(0, skeleton->get_bone_name(b_idx));
|
|
|
|
joint_item->set_icon(0, bone_icon);
|
|
|
|
joint_item->set_selectable(0, true);
|
|
|
|
joint_item->set_metadata(0, "bones/" + itos(b_idx));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Skeleton3DEditor::update_editors() {
|
2017-10-03 16:49:32 +00:00
|
|
|
}
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
void Skeleton3DEditor::create_editors() {
|
|
|
|
set_h_size_flags(SIZE_EXPAND_FILL);
|
|
|
|
add_theme_constant_override("separation", 0);
|
|
|
|
|
|
|
|
set_focus_mode(FOCUS_ALL);
|
|
|
|
|
|
|
|
// Create Top Menu Bar
|
2017-10-03 16:49:32 +00:00
|
|
|
options = memnew(MenuButton);
|
2020-03-26 21:49:16 +00:00
|
|
|
Node3DEditor::get_singleton()->add_control_to_menu_panel(options);
|
2017-10-03 16:49:32 +00:00
|
|
|
|
2020-03-27 07:44:44 +00:00
|
|
|
options->set_text(TTR("Skeleton3D"));
|
2020-03-26 21:49:16 +00:00
|
|
|
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Skeleton3D", "EditorIcons"));
|
2017-10-03 16:49:32 +00:00
|
|
|
|
|
|
|
options->get_popup()->add_item(TTR("Create physical skeleton"), MENU_OPTION_CREATE_PHYSICAL_SKELETON);
|
|
|
|
|
2020-03-27 07:44:44 +00:00
|
|
|
options->get_popup()->connect("id_pressed", callable_mp(this, &Skeleton3DEditor::_on_click_option));
|
2020-02-19 19:48:20 +00:00
|
|
|
|
|
|
|
const Color section_color = get_theme_color("prop_subsection", "Editor");
|
|
|
|
|
|
|
|
EditorInspectorSection *bones_section = memnew(EditorInspectorSection);
|
|
|
|
bones_section->setup("bones", "Bones", skeleton, section_color, true);
|
|
|
|
add_child(bones_section);
|
|
|
|
bones_section->unfold();
|
|
|
|
|
|
|
|
ScrollContainer *s_con = memnew(ScrollContainer);
|
|
|
|
s_con->set_h_size_flags(SIZE_EXPAND_FILL);
|
|
|
|
s_con->set_custom_minimum_size(Size2(1, 350) * EDSCALE);
|
|
|
|
bones_section->get_vbox()->add_child(s_con);
|
|
|
|
|
|
|
|
joint_tree = memnew(Tree);
|
|
|
|
joint_tree->set_columns(1);
|
|
|
|
joint_tree->set_focus_mode(Control::FocusMode::FOCUS_NONE);
|
|
|
|
joint_tree->set_select_mode(Tree::SELECT_SINGLE);
|
|
|
|
joint_tree->set_hide_root(true);
|
|
|
|
joint_tree->set_v_size_flags(SIZE_EXPAND_FILL);
|
|
|
|
joint_tree->set_h_size_flags(SIZE_EXPAND_FILL);
|
|
|
|
joint_tree->set_allow_rmb_select(true);
|
|
|
|
joint_tree->set_drag_forwarding(this);
|
|
|
|
s_con->add_child(joint_tree);
|
|
|
|
|
|
|
|
pose_editor = memnew(BoneTransformEditor(skeleton));
|
|
|
|
pose_editor->set_label(TTR("Bone Pose"));
|
|
|
|
pose_editor->set_keyable(AnimationPlayerEditor::singleton->get_track_editor()->has_keying());
|
|
|
|
pose_editor->set_toggle_enabled(true);
|
|
|
|
pose_editor->set_visible(false);
|
|
|
|
add_child(pose_editor);
|
|
|
|
|
|
|
|
rest_editor = memnew(BoneTransformEditor(skeleton));
|
|
|
|
rest_editor->set_label(TTR("Bone Rest"));
|
|
|
|
rest_editor->set_visible(false);
|
|
|
|
add_child(rest_editor);
|
|
|
|
|
|
|
|
custom_pose_editor = memnew(BoneTransformEditor(skeleton));
|
|
|
|
custom_pose_editor->set_label(TTR("Bone Custom Pose"));
|
|
|
|
custom_pose_editor->set_visible(false);
|
|
|
|
add_child(custom_pose_editor);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Skeleton3DEditor::_notification(int p_what) {
|
|
|
|
switch (p_what) {
|
|
|
|
case NOTIFICATION_ENTER_TREE: {
|
|
|
|
create_editors();
|
|
|
|
update_joint_tree();
|
|
|
|
update_editors();
|
|
|
|
|
2020-05-26 18:17:11 +00:00
|
|
|
get_tree()->connect("node_removed", callable_mp(this, &Skeleton3DEditor::_node_removed), Vector<Variant>(), Object::CONNECT_ONESHOT);
|
|
|
|
joint_tree->connect("item_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_selection_changed));
|
|
|
|
joint_tree->connect("item_rmb_selected", callable_mp(this, &Skeleton3DEditor::_joint_tree_rmb_select));
|
2020-02-19 19:48:20 +00:00
|
|
|
#ifdef TOOLS_ENABLED
|
2020-05-26 18:17:11 +00:00
|
|
|
skeleton->connect("pose_updated", callable_mp(this, &Skeleton3DEditor::_update_properties));
|
2020-02-19 19:48:20 +00:00
|
|
|
#endif // TOOLS_ENABLED
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-10-03 16:49:32 +00:00
|
|
|
}
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
void Skeleton3DEditor::_node_removed(Node *p_node) {
|
|
|
|
if (skeleton && p_node == skeleton) {
|
|
|
|
skeleton = nullptr;
|
|
|
|
options->hide();
|
|
|
|
}
|
2017-10-03 16:49:32 +00:00
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
_update_properties();
|
2017-10-03 16:49:32 +00:00
|
|
|
}
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
void Skeleton3DEditor::_bind_methods() {
|
|
|
|
ClassDB::bind_method(D_METHOD("_node_removed"), &Skeleton3DEditor::_node_removed);
|
|
|
|
ClassDB::bind_method(D_METHOD("_joint_tree_selection_changed"), &Skeleton3DEditor::_joint_tree_selection_changed);
|
|
|
|
ClassDB::bind_method(D_METHOD("_joint_tree_rmb_select"), &Skeleton3DEditor::_joint_tree_rmb_select);
|
|
|
|
ClassDB::bind_method(D_METHOD("_update_properties"), &Skeleton3DEditor::_update_properties);
|
|
|
|
ClassDB::bind_method(D_METHOD("_on_click_option"), &Skeleton3DEditor::_on_click_option);
|
|
|
|
|
2021-05-15 21:48:59 +00:00
|
|
|
ClassDB::bind_method(D_METHOD("_get_drag_data_fw"), &Skeleton3DEditor::get_drag_data_fw);
|
|
|
|
ClassDB::bind_method(D_METHOD("_can_drop_data_fw"), &Skeleton3DEditor::can_drop_data_fw);
|
|
|
|
ClassDB::bind_method(D_METHOD("_drop_data_fw"), &Skeleton3DEditor::drop_data_fw);
|
2020-02-19 19:48:20 +00:00
|
|
|
ClassDB::bind_method(D_METHOD("move_skeleton_bone"), &Skeleton3DEditor::move_skeleton_bone);
|
|
|
|
}
|
|
|
|
|
|
|
|
Skeleton3DEditor::Skeleton3DEditor(EditorInspectorPluginSkeleton *e_plugin, EditorNode *p_editor, Skeleton3D *p_skeleton) :
|
|
|
|
editor(p_editor),
|
|
|
|
editor_plugin(e_plugin),
|
|
|
|
skeleton(p_skeleton) {
|
2017-10-03 16:49:32 +00:00
|
|
|
}
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
Skeleton3DEditor::~Skeleton3DEditor() {
|
|
|
|
if (options) {
|
|
|
|
Node3DEditor::get_singleton()->remove_control_from_menu_panel(options);
|
2017-10-03 16:49:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
bool EditorInspectorPluginSkeleton::can_handle(Object *p_object) {
|
|
|
|
return Object::cast_to<Skeleton3D>(p_object) != nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EditorInspectorPluginSkeleton::parse_begin(Object *p_object) {
|
|
|
|
Skeleton3D *skeleton = Object::cast_to<Skeleton3D>(p_object);
|
|
|
|
ERR_FAIL_COND(!skeleton);
|
|
|
|
|
|
|
|
Skeleton3DEditor *skel_editor = memnew(Skeleton3DEditor(this, editor, skeleton));
|
|
|
|
add_custom_control(skel_editor);
|
|
|
|
}
|
|
|
|
|
2020-03-27 07:44:44 +00:00
|
|
|
Skeleton3DEditorPlugin::Skeleton3DEditorPlugin(EditorNode *p_node) {
|
2017-10-03 16:49:32 +00:00
|
|
|
editor = p_node;
|
|
|
|
|
2020-02-19 19:48:20 +00:00
|
|
|
Ref<EditorInspectorPluginSkeleton> skeleton_plugin;
|
|
|
|
skeleton_plugin.instance();
|
|
|
|
skeleton_plugin->editor = editor;
|
|
|
|
|
|
|
|
EditorInspector::add_inspector_plugin(skeleton_plugin);
|
|
|
|
}
|