GSoC 2025 - Week 3
I made some decent progress this week:
- Created PR #882 to add basic trajectory API as described in this discussion comment - merged
- Created PR #887 to add UI in the 3D viewport to manage entities as outlined in this discussion comment - merged
- Created PR #888 to add Trajectory styles API as described in this discussion comment. A common styles UI for both Trajectory and Molecule entities is added - in review
Here is a short video that shows the progress made so far (only GUI, not API shown here):
Here are some learnings from this week:
- Blender’s
UIListhas a way to both filter (using bit fields) and re-order items using thefilter_itemsmethod. There are also some helper methods that Blender provides inbpy.types.UI_UL_listthat helps both. The management of active index of the selected item in theUIListbecomes tricky in case of filtering - Any object can be used as a
ownerfor Blender’smsgbussubscriptions usingbpy.msgbus.subscribe_rna. Using a owner allows to clear all subscriptions by the owner usingbpy.msgbus.clear_by_owner - Blender has a concept of
Restricted Contextduring an extension’sregister()andunregister()methods that limits what is available during those methods. For example, thesceneentity does not exist inbpy.contextin these cases - An object’s
hide_viewportproperty is not animatable. To support visibility changes that are animatable, a custom property (withgetandsetcallbacks) that controls both the viewport and rendering visibility works better window_manager.invoke_confirmin an operator’sinvokeis used for confirmation dialogswindow_manager.invoke_props_dialogin an operator’sinvokeis used to show a dialog with the operator properties. An explicitdrawmethod can be used to customize the layout of what is shown- The
executemethod of operators can be directly invoked (bypassinginvokeetc) using the first param asEXEC_DEFAULT- this is very useful in tests to test operators
Next week, I will address any remaining issues with style management APIs and get started on outlining the next steps for adding annotation support.
This post is licensed under CC BY 4.0 by the author.
