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
UIList
has a way to both filter (using bit fields) and re-order items using thefilter_items
method. There are also some helper methods that Blender provides inbpy.types.UI_UL_list
that helps both. The management of active index of the selected item in theUIList
becomes tricky in case of filtering - Any object can be used as a
owner
for Blender’smsgbus
subscriptions 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 Context
during an extension’sregister()
andunregister()
methods that limits what is available during those methods. For example, thescene
entity does not exist inbpy.context
in these cases - An object’s
hide_viewport
property is not animatable. To support visibility changes that are animatable, a custom property (withget
andset
callbacks) that controls both the viewport and rendering visibility works better window_manager.invoke_confirm
in an operator’sinvoke
is used for confirmation dialogswindow_manager.invoke_props_dialog
in an operator’sinvoke
is used to show a dialog with the operator properties. An explicitdraw
method can be used to customize the layout of what is shown- The
execute
method of operators can be directly invoked (bypassinginvoke
etc) 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.