Fix #115166: Batch Rename Action Clips error #115185
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#115185
Loading…
Reference in New Issue
No description provided.
Delete Branch "lichtwerk/blender:115166"
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?
Code from
cd7ec0dac6
was assuming the selected IDs in the Outlinerwere always objects, however actions can also be selected directly (in
Blender File view).
The original code was already unnecessarily complex and hard to read. IMO before any more complexity is added, it should be refactored. I don't want to block a bugfix, but I also can't approve of the change, so I'll step down as reviewer.
@dr.sybren how are you suggesting to refactor the code. I would extract the logic out of the
data = (.....
tuple. But I'd like to have your opinion on that before I start doing things.Also if I do a refactor, should that include all the areas in that function that generate
data
?A few things that come to mind while reading the code of the
WM_OT_batch_rename
operator:if space_type == 'SEQUENCE_EDITOR':
/elif
/else
chain should be replaced with some registry/strategy pattern, where each space type can be added by simply implementing some class/interface and adding it to the registry._data_from_context
into two functions, forcheck_context=False
andcheck_context=True
. This might be considerably easier given the above step.data
as a cheap class instance is super hard to follow.But that's only when reading basically the
_data_from_context
function. So maybe these changes would be too limited. Long functions, deep nesting, mixing many different abstraction levels within the same function, all of these I would feel could use attention.Things like
assert 0
is of course unacceptable, as that should be at the bare minimum an exception with a clear explanation.There are many more
if
/elif
/else
chains that can be converted to a strategy pattern, or at least be reduced to a dictionary lookup of some sort. For example, there are mulitple of such chains that all useaction.type
, which indicates that their code could be implemented as various functions on the same class, with one such class per action type.Those are just some thoughts I get when browsing through the code.
Since this fix works, I think it'd be best to apply this for 4.1 and handle refactoring separately.
Closing in favor of
d4610e70db
Pull request closed