diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2022-08-22 22:37:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-22 22:37:33 +0200 |
| commit | b8a64313f0675a7e781e21b530a43d824651f44d (patch) | |
| tree | aaa24e4d70cbc2135edade0780650c8c666fc196 /editor/plugins/material_editor_plugin.cpp | |
| parent | 9c567a0604f1cedcce3dfa1a707d3671c51a0155 (diff) | |
| parent | ece3df39386af85b069cbb67ae1893b4365f1bd3 (diff) | |
| download | redot-engine-b8a64313f0675a7e781e21b530a43d824651f44d.tar.gz | |
Merge pull request #59564 from KoBeWi/FINALLY,_ULTIMATE_UNDO_REDO
Diffstat (limited to 'editor/plugins/material_editor_plugin.cpp')
| -rw-r--r-- | editor/plugins/material_editor_plugin.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 1b4d98fc3f..5d59f62f05 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -33,6 +33,7 @@ #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/editor_undo_redo_manager.h" #include "scene/gui/subviewport_container.h" #include "scene/resources/fog_material.h" #include "scene/resources/particles_material.h" @@ -261,10 +262,8 @@ void EditorInspectorPluginMaterial::parse_begin(Object *p_object) { } void EditorInspectorPluginMaterial::_undo_redo_inspector_callback(Object *p_undo_redo, Object *p_edited, String p_property, Variant p_new_value) { - UndoRedo *undo_redo = Object::cast_to<UndoRedo>(p_undo_redo); - if (!undo_redo) { - return; - } + Ref<EditorUndoRedoManager> undo_redo = Object::cast_to<EditorUndoRedoManager>(p_undo_redo); + ERR_FAIL_COND(!undo_redo.is_valid()); // For BaseMaterial3D, if a roughness or metallic textures is being assigned to an empty slot, // set the respective metallic or roughness factor to 1.0 as a convenience feature |
