Skip to content

Two-way synchronization between Python-level objects and changes made directly through the Blender GUI #1

@yuxuanzhuang

Description

@yuxuanzhuang

Currently, changes made directly in the Blender GUI do not automatically propagate back to the Python objects created and managed by GGMolVis. This leads to inconsistencies where the internal Python representation of molecular visualization parameters (e.g., positions, colors, materials) diverges from what is edited within Blender's interface.

Expected Behavior

When a user modifies a parameter—such as changing a material color—via the Blender GUI, the corresponding Python object's state should reflect this change, ensuring the Python-level "source of truth" remains accurate.

Current Behavior

Attributes stored in Python will override any edits made in the Blender GUI, such as changes to a molecule’s location, whenever a frame_change event is triggered.

Potential Solutions:

  • Use Blender Handlers e.g. bpy.app.handlers.depsgraph_update_post to update Python objects.
  • Consider making Blender the main source of truth, and let Python objects pull data on-demand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions