Skip to content

Commit

Permalink
Remove references to custom_pose from the skeleton inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
lyuma committed Feb 22, 2021
1 parent de8192e commit 444766d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 38 deletions.
33 changes: 2 additions & 31 deletions editor/plugins/skeleton_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,7 @@ void BoneTransformEditor::_value_changed(const double p_value, const bool p_from
if (updating)
return;

if (property.get_slicec('/', 0) == "bones" && property.get_slicec('/', 2) == "custom_pose") {
const Transform tform = compute_transform(p_from_transform);

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()));
undo_redo->add_do_method(skeleton, "set_bone_custom_pose", property.get_slicec('/', 1).to_int(), tform);
undo_redo->commit_action();
} else if (property.get_slicec('/', 0) == "bones") {
if (property.get_slicec('/', 0) == "bones") {
const Transform tform = compute_transform(p_from_transform);

undo_redo->create_action(TTR("Set Bone Transform"), UndoRedo::MERGE_ENDS);
Expand Down Expand Up @@ -304,19 +297,6 @@ void BoneTransformEditor::_update_properties() {
_update_transform_properties(tform);
}

void BoneTransformEditor::_update_custom_pose_properties() {
if (updating)
return;

if (skeleton == nullptr)
return;

updating = true;

Transform tform = skeleton->get_bone_custom_pose(property.to_int());
_update_transform_properties(tform);
}

void BoneTransformEditor::_update_transform_properties(Transform tform) {

Quat rot = tform.get_basis();
Expand Down Expand Up @@ -604,11 +584,9 @@ void SkeletonEditor::_joint_tree_selection_changed() {

pose_editor->set_target(bone_path + "pose");
rest_editor->set_target(bone_path + "rest");
custom_pose_editor->set_target(bone_path + "custom_pose");

pose_editor->set_visible(true);
rest_editor->set_visible(true);
custom_pose_editor->set_visible(true);
}

_update_properties();
Expand All @@ -622,8 +600,6 @@ void SkeletonEditor::_update_properties() {
rest_editor->_update_properties();
if (pose_editor)
pose_editor->_update_properties();
if (custom_pose_editor)
custom_pose_editor->_update_custom_pose_properties();
}

void SkeletonEditor::update_joint_tree() {
Expand All @@ -638,7 +614,7 @@ void SkeletonEditor::update_joint_tree() {

items.insert(-1, root);

const Vector<int> &joint_porder = skeleton->get_bone_process_order();
const Vector<int> &joint_porder = skeleton->get_bone_process_orders();

Ref<Texture> bone_icon = get_icon("Skeleton", "EditorIcons");

Expand Down Expand Up @@ -713,11 +689,6 @@ void SkeletonEditor::create_editors() {
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 SkeletonEditor::_notification(int p_what) {
Expand Down
2 changes: 0 additions & 2 deletions editor/plugins/skeleton_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class BoneTransformEditor : public VBoxContainer {
void set_label(const String &p_label) { label = p_label; }

void _update_properties();
void _update_custom_pose_properties();
void _update_transform_properties(Transform p_transform);

// Can/cannot modify the spinner values for the Transform
Expand Down Expand Up @@ -147,7 +146,6 @@ class SkeletonEditor : public VBoxContainer {
Tree *joint_tree;
BoneTransformEditor *rest_editor;
BoneTransformEditor *pose_editor;
BoneTransformEditor *custom_pose_editor;

MenuButton *options;
EditorFileDialog *file_dialog;
Expand Down
5 changes: 0 additions & 5 deletions scene/3d/skeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,3 @@ Skeleton::~Skeleton() {
E->get()->skeleton_node = nullptr;
}
}

Vector<int> Skeleton::get_bone_process_order() {
_update_process_order();
return process_order;
}

0 comments on commit 444766d

Please sign in to comment.