This repository was archived by the owner on Mar 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
Preparing the great migration 🐧 #1
Copy link
Copy link
Open
12 / 1212 of 12 issues completedLabels
enhancementNew feature or requestNew feature or request
Description
Suggested by Dr Sybren, in preparation to merging my addon into unlooped
A few things, all of them are quite easy to handle:
- In my new code I never use
os.path, and usepathlib.Pathinstead.- Type annotations
get_playback_modes()doesn't retain a reference to the returned list, which can cause memory corruption (see the warning in Property Definitions (bpy.props) - Blender Python API)loop_methods_playback_handler()doesn't deal with the scene preview range yet. My add-on also doesn't do this -- this is why code review is so good, it makes you realize things you overlooked while writing the code 😹- The code should follow PEP8, so for example
bpy.types.Scene.Loop_Methods_Settingsshould be namedbpy.types.Scene.loop_methods_settings- Instead of manually calling
bpy.utils.register_classfor each class, I'd usebpy.utils.register_classes_factory()instead.- Since
yourour :) add-on targets Blender 4.3+, you can remove thebl_info; that's only necessary when targeting Blender versions before 4.2. Or we can test with older versions of Blender and still support 3.6-LTS.- Instead of
from bpy.utils import previewsI wouldimport bpy.utils, and then usebpy.utils.previews.…in the code. That way it's easier to locally see in the code that this is calling into Blender code. Otherwise I'd feel thatpreviewsis such a generic term that it could come from anything.- The
global icon_collectionsstatement can be removed, as the way it's used in that function doesn't need it. Having said that, I'd probably not even use a dictionary there, name it the singularicon_collection, keep theglobalstatement, and just directly useicon_collection = pcoll. The way your code is structured, there is no need to use a dictionary here.draw_playback_mode_dropdownaccessesbpy.context, even though it gets acontextfrom the caller. It should just use that context, and not the global one.- My add-on draws the icon in all Dopesheet headers, which includes the timeline. I think that's a better approach than limiting it to the Dopesheet mode of the Dopesheet editor, as it might just as well be useful in the Action editor (and all its other modes), or the Timeline editor.
Reactions are currently unavailable
Sub-issues
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
