executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
molecules-and-stylesLoad static MolecularNodes structures, compose geometry-node styles and selections, and control named attributes, colors, materials, and converter-backed molecule imports in a Blender 5.2 host.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill for the static-structure path of MolecularNodes: create a
Universe-backed Molecule, load a local PDB/mmCIF/BCIF/SDF/MOL file or fetch a
structure, then build one or more visible style branches with selections,
attributes, colors, and materials. The runtime is Blender 5.2 (or a compatible
bpy 5.2 host); pure Python helpers do not replace that host for object, mesh,
Geometry Nodes, or material work.
Molecule(universe, ...), Molecule.from_file(...), Molecule.load(...), and
Molecule.fetch(...) for static structures and file-backed multi-model input.add_style() with spheres, sticks, ball_and_stick, cartoon, ribbon,
or surface, including style keyword arguments and material assignment.AtomGroup selections, existing boolean named
attributes, and managed selection recovery.with mol.tree: composition, tree.reset() clean-slate composition, reusable
atoms/join sockets, SetColor, named attributes, and style-node inspection.Canvas, cameras, render engines, snapshots, compositor, and render output:
route to scene-and-rendering.Molecule.load(path); use fetch(code, cache=...)
only when the cache or network is intentionally available.Molecule(universe) when an MDAnalysis Universe
already exists, from_file(path_or_supported_BytesIO) for one structure file,
load(topology, coordinates=None) for a convenient file/MD split, and
fetch(code, format='.bcif', cache=..., database='rcsb') for a database source.
See molecule API.Molecular Nodes modifier unless object creation
was explicitly disabled on the topology-plus-coordinates route. Inspect
mol.universe, mol.object, mol.modifier_node_tree, and
mol.list_attributes(drop_hidden=False) before adding branches.mol.add_style(style, selection=..., material=..., **kwargs) for an append-only style. Use with mol.tree.reset() as (atoms, join):
only when intentionally discarding the current tree. Use with mol.tree as tree:
to preserve branches and reuse the existing geometry input and final join.AtomGroup
becomes a managed named selection. Validate selection strings before relying on a
branch; an invalid add_style string warns and creates an unmasked branch.SetColor to modify the Color field before a style, or let a style consume the
stored field. Pass a preset instance, its .material, a Blender material, an
asset material name, or None according to the style contract. See the material
and color reference.Named Attribute, material
sockets point to the intended datablock, and evaluated geometry contains the
expected attributes. Run the local fixture cases in the verification section of
troubleshooting.import molecularnodes as mn
mol = mn.Molecule.load("1BNA.cif")
mol.add_style("cartoon", selection="protein", material="MN Ambient Occlusion")
mol.add_style(
"surface",
selection="resid 1:20",
material=mn.material.TransparentOutline(alpha=0.45),
quality=2,
)
Each call appends a branch to the same tree. Do not call tree.reset() between
these calls unless the first branch is meant to be removed.
from molecularnodes.nodes import geometry as g
mat = mn.material.AmbientOcclusion(distance=0.5)
with mol.tree.reset() as (atoms, join):
atoms >> g.SetColor(color=g.ColorElement()) >> g.StyleCartoon(
quality=3, material=mat.material
) >> join
reset() returns the input and join sockets that belong to the new tree. Use
with mol.tree instead for incremental edits.
sel = mol.selections.from_string("resid 1:10", name="focus")
mol.add_style("spheres", selection=sel.name)
sel.string = "not a valid selection" # message is set; last good mask remains
sel.string = "resid 1:5" # message clears; attribute is updated
If add_style(selection="bad syntax") has already warned, leave existing style
branches intact, create a valid managed selection, and append a corrected branch.
Inspect or remove the bad branch explicitly rather than resetting the whole tree.
When a workflow crosses a boundary, preserve the Molecule object and named
attribute names in the handoff so the sibling skill can continue without rebuilding
the structure or destroying its style tree.