Check operators for potentially missing "UNDO" in bl_options #82899
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#82899
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description:
Python operators that modify ID data without setting
"UNDO"
in theirbl_options
can result in a crash when the user undoes changes. Since #82763 showed that not all Blender add-ons have been tested and update to comply with the changes made to the undo system and there are several operators using justbl_options = {"REGISTER"}
orbl_options = {'REGISTER'}
, it would be a good idea to check that the remaining operators do not make the same mistake.Work plan
The following is a list of all operators that use
bl_options
withREGISTER
but withoutUNDO
. Not all of them modify ID data, hence some will not requireUNDO
to be included. However, all of the need to be checked whether or not that is the case.Blender Add-ons
chooseDoodad
(mesh_discombobulator.py )PropertyGroup
. This doesn't seem to fall under the category of ID data that would require"UNDO"
as far as I can currently tell.unchooseDoodad
(mesh_discombobulator.py )PropertyGroup
. This doesn't seem to fall under the category of ID data that would require"UNDO"
as far as I can currently tell.POWER_SEQUENCER_OT_jump_time_offset
(jump_time_offset.py )POWER_SEQUENCER_OT_playback_speed_set
(playback_speed_set.py )POWER_SEQUENCER_OT_render_apply_preset
(render_apply_preset.py )PIE_OT_FileIncrementalSave
(pie_save_open_menu.py )KillBgProcess
(bg_blender.py )MUV_OT_UVSculpt
(uv_sculpt.py )!!"UNDO"
.AutoMirror
(mesh_auto_mirror.py )SnapUtilitiesLine
(op_line.py )!!bpy.ops.ed.undo()
the operator should likely be modified to use"UNDO"
. Additionally, the reference keeping on object, edges and vertices should be double checked. At first glance this looks like it may keep invalid references when the modal operator is cancelled as this wouldn't call_exit
that clears to variables, but this would have to verified. Storing references to this data is definitely against best practice though, as documented on the Gotcha page for the Python API docs.TCCallBackCCEN
(CCEN.py ) !!FloatProperty
inPropertyGroup
, should probably use"UNDO"
.WriteGimpPalette
(paint_palette.py )ColorPickerPopup
(brush_menu.py )CurvePopup
(curve_menu.py )DeleteVar
(init.py )ToggleDisplay
(init.py )ToggleLock
(init.py )ToggleMatrixBBoxDisplay
(init.py )!!utils
that doesn't existCleanupConsole
(init.py )ToggleApplyModifiersView
(space_view3d_modifier_tools.py )ToggleAllShowExpanded
(space_view3d_modifier_tools.py )PIE_OT_SetAreaType
(pie_editor_switch_menu.py )PIE_OT_Timeline
(pie_editor_switch_menu.py )PIE_OT_SetObjectModePie
(pie_modes_menu.py )VIEW3D_OT_SetObjectMode
(object_menus.py )Blender Add-ons Contrib
CreaPrim
(object_creaprim.py )!!ValueError: register_class(...): expected a class argument, not 'str'
)bpy.data.texts
OBJECT_OT_load_img
(init.py )RenderBackground
(space_view3d_render_settings.py )Blender Startup Scripts
CLIP_OT_delete_proxy
(clip.py )CLIP_OT_set_viewport_background
(clip.py )WM_OT_previews_batch_generate
(file.py )WM_OT_previews_batch_clear
(file.py )WM_OT_blend_strings_utf8_validate
(file.py )EditExternally
(image.py )ProjectEdit
(image.py )ProjectApply
(image.py )PlayRenderedAnim
(screen_play_rendered_anim.py )Added subscriber: @rjg
Changed status from 'Needs Triage' to: 'Confirmed'
ToDo: Check operators for potentially missing "UNDO" in bl_optionsto Check operators for potentially missing "UNDO" in bl_optionsAdded subscriber: @Imaginer
ColorPickerPopup and CurvePopup are both UI popups (
context.window_manager.invoke_popup
) and shouldn't have "UNDO".