We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.3 dev5 and earlier
Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)
Consider this code:
@tool extends EditorScript func _run() -> void: var eur := EditorPlugin.new().get_undo_redo() eur.create_action("a") eur.add_do_method(get_scene(), "set_modulat", 1) eur.add_do_method(get_scene(), "draw_texture", 1) eur.add_undo_method(get_scene(), "set_modulat") eur.commit_action()
Assuming get_scene() returns Node2D, the first "do" method does not exist, while the second has wrong number of arguments. The errors printed are:
get_scene()
C:\godot_source\core/object/undo_redo.cpp:367 - Error calling UndoRedo method operation 'set_modulat': 'Node2D::set_modulat': Instance is null C:\godot_source\core/object/undo_redo.cpp:367 - Error calling UndoRedo method operation 'draw_texture': 'Node2D::draw_texture': Method expected 3 arguments, but called with 0
The first error says "instance is null" (it's not) The second error says the method is called with 0 arguments (while it uses 1)
Doesn't seem like a bug strictly in EditorUndoRedoManager (or UndoRedo), I don't know what's causing it.
Run the code above.
N/A
The text was updated successfully, but these errors were encountered:
is_valid doesn't distinguish whether the instance is null or it doesn't have the method
is_valid
bool Callable::is_valid() const { if (is_custom()) { return get_custom()->is_valid(); } else { return get_object() && get_object()->has_method(get_method()); } }
Sorry, something went wrong.
No branches or pull requests
Tested versions
4.3 dev5 and earlier
System information
Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)
Issue description
Consider this code:
Assuming
get_scene()
returns Node2D, the first "do" method does not exist, while the second has wrong number of arguments. The errors printed are:The first error says "instance is null" (it's not)
The second error says the method is called with 0 arguments (while it uses 1)
Doesn't seem like a bug strictly in EditorUndoRedoManager (or UndoRedo), I don't know what's causing it.
Steps to reproduce
Run the code above.
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: