Post

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 the filter_items method. There are also some helper methods that Blender provides in bpy.types.UI_UL_list that helps both. The management of active index of the selected item in the UIList becomes tricky in case of filtering
  • Any object can be used as a owner for Blender’s msgbus subscriptions using bpy.msgbus.subscribe_rna. Using a owner allows to clear all subscriptions by the owner using bpy.msgbus.clear_by_owner
  • Blender has a concept of Restricted Context during an extension’s register() and unregister() methods that limits what is available during those methods. For example, the scene entity does not exist in bpy.context in these cases
  • An object’s hide_viewport property is not animatable. To support visibility changes that are animatable, a custom property (with get and set callbacks) that controls both the viewport and rendering visibility works better
  • window_manager.invoke_confirm in an operator’s invoke is used for confirmation dialogs
  • window_manager.invoke_props_dialog in an operator’s invoke is used to show a dialog with the operator properties. An explicit draw method can be used to customize the layout of what is shown
  • The execute method of operators can be directly invoked (bypassing invoke etc) using the first param as EXEC_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.