Post

GSoC 2025 - Week 10

This week, I completed the density component related changes.

I made the following progress:

  • PR #918 (open)
    • Added two density annotations - one to show the density grid info and the other to show the axes of a 3D grid
    • Added custom font support for annotations - this works for both the text displayed in the 3D viewport as well as the final renders
    • Added a molecule info annotation to display basic molecule details (mostly to complete the annotation support across other MN entities)
    • Separated annotation types per entity to avoid any name collisions between different entities
    • Added configurable vertical spacing support for annotation text
    • Added tests for the new annotations
  • PR #920 (open)
    • Added a new style called Density ISO Surface for density grids
    • Support for separate colors for positive and negative ISO values
    • Support for displaying surface contours as a line mesh in 3D viewport
    • Support for slicing the grid along all the three axes in all directions (left, right, front, back, top, bottom)
    • This new style is completely generated from code and not part of MN data file

Here are some learning from this week:

  • There is no separate font styling support in Blender (like Bold, Italic etc) - the corresponding font file has to be loaded if that is needed (using blf.load)
  • Fonts loaded using blf.load have to be unloaded using blf.unload with the same font file as the param and not the returned font id from the load
  • There is no way to specify a filter for specific files when using Blender’s StringProperty with subtype FILE_PATH directly - users can filter from Blender’s file selection GUI
  • Grid objects of GridDataFormats too have an option for custom metadata (similar to vdb files) - we use this to keep track of the grid filepath and the import options
  • There doesn’t seem to be an easy way to link a Geometry Node input to a specific material setting (like say the use_backface_culling)
  • Using Ctrl when placing nodes in the Geometry Nodes editor will ensure snapping to the grid and avoid node locations having floating point values
  • Node To Python extension allows exporting Geometry Node trees as Python code

Next week, I will initiate discussions on the last item about rendering support for the newly added stuff and get started on them. I will also start a discussion on the panel locations in the 3D viewport n-panel vs the Object Properties.

This post is licensed under CC BY 4.0 by the author.