You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Add per-scene UndoRedo
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_properties.h"
|
||||
#include "editor/editor_scale.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/plugins/animation_player_editor_plugin.h"
|
||||
#include "node_3d_editor_plugin.h"
|
||||
#include "scene/3d/collision_shape_3d.h"
|
||||
@@ -267,7 +268,7 @@ void Skeleton3DEditor::reset_pose(const bool p_all_bones) {
|
||||
return;
|
||||
}
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Set Bone Transform"), UndoRedo::MERGE_ENDS);
|
||||
if (p_all_bones) {
|
||||
for (int i = 0; i < bone_len; i++) {
|
||||
@@ -334,7 +335,7 @@ void Skeleton3DEditor::pose_to_rest(const bool p_all_bones) {
|
||||
return;
|
||||
}
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Set Bone Rest"), UndoRedo::MERGE_ENDS);
|
||||
if (p_all_bones) {
|
||||
for (int i = 0; i < bone_len; i++) {
|
||||
@@ -354,7 +355,7 @@ void Skeleton3DEditor::pose_to_rest(const bool p_all_bones) {
|
||||
}
|
||||
|
||||
void Skeleton3DEditor::create_physical_skeleton() {
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo();
|
||||
ERR_FAIL_COND(!get_tree());
|
||||
Node *owner = get_tree()->get_edited_scene_root();
|
||||
|
||||
@@ -587,7 +588,7 @@ void Skeleton3DEditor::move_skeleton_bone(NodePath p_skeleton_path, int32_t p_se
|
||||
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();
|
||||
Ref<EditorUndoRedoManager> &ur = EditorNode::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)) {
|
||||
@@ -1309,7 +1310,7 @@ void Skeleton3DGizmoPlugin::commit_subgizmos(const EditorNode3DGizmo *p_gizmo, c
|
||||
Skeleton3DEditor *se = Skeleton3DEditor::get_singleton();
|
||||
Node3DEditor *ne = Node3DEditor::get_singleton();
|
||||
|
||||
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
|
||||
Ref<EditorUndoRedoManager> &ur = EditorNode::get_undo_redo();
|
||||
ur->create_action(TTR("Set Bone Transform"));
|
||||
if (ne->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || ne->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE) {
|
||||
for (int i = 0; i < p_ids.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user