技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
setup-and-import【数据与研究】Install and verify MolecularNodes in a Blender 5.2 host, then choose safe local, cached, or database-backed structure import paths and recover setup failures.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this route when the task is to make MolecularNodes available in Blender, check its Python package/backend compatibility, import a structure or supported input file, or diagnose an installation, download, cache, or format error. This route assumes MolecularNodes 5.2.0 and a Blender/bpy 5.2 Python 3.13 host.
This skill owns:
bpy compatibility checks.MolecularNodes import panel/operator entry points.It does not own styling, selections, geometry-node editing, trajectory playback/analysis, annotations, density styling, or rendering. Route those parts to molecules-and-styles, trajectories-and-annotations, density-and-ensembles, and scene-and-rendering.
For the detailed installation contract, read references/installation.md. For download, format, and loader behavior read references/download-and-formats.md. For diagnosis and recovery read references/troubleshooting.md.
Use the smallest route that matches the input. Keep the parser check separate from the Blender presentation step.
| Request or input | Route | Next boundary |
|---|---|---|
| Install, update, or prove the runtime | Extensions panel plus check_install.py | references/installation.md |
One local .pdb, .cif, .bcif, .sdf, or .mol | Molecule.load(path) or the local import operator | This skill owns validation and dispatch |
| One RCSB/wwPDB or AlphaFold accession | Molecule.fetch(...) or mn.import_fetch | This skill owns cache/network diagnosis |
| MD topology plus coordinates, IMD, or oxDNA | Molecule.load(topology, coordinates) only for local MD; otherwise sibling route | trajectories-and-annotations |
| STAR, CellPack, density, or ensemble data | Ensemble/density loader, not Molecule.load | density-and-ensembles |
| Styling, selections, node editing, or rendering after import | Preserve the loaded object and hand off | molecules-and-styles or scene-and-rendering |
bpy.app.version must be 5.2.0 or newer; the package's Python bpy extra
is specifically bpy==5.2.*.bpy extra.
The runtime package also requires databpy, nodebpy, Biotite, MDAnalysis,
and the direct dependencies listed in
references/installation.md.bpy version without installing, fetching,
creating a cache, or importing this source checkout by default.bpy, biotite, and Python-version compatibility with the bundled script,
then follow references/troubleshooting.md.bpy.ops.mn.import_fetch; local multi-file import also uses
bpy.ops.mn.import_molecule.Use Molecule.load(path) or Molecule.from_file(path) for a local
.pdb, .cif, .bcif, .sdf, or .mol. The result is a Universe-backed
Molecule; successful parsing also records chain/entity/assembly metadata
where the file provides it. The dispatcher is suffix-based, so validate the
suffix rather than guessing from file contents. The public type annotation also
mentions io.BytesIO for BCIF, but the 5.2.0 PDBXReader still accesses
.suffix; use a cached .bcif Path when the in-memory route fails.
The UI equivalent is bpy.ops.mn.import_fetch(database="local", filepath=str(path), node_setup=...). Use an absolute or Blender-resolvable
path and confirm the file exists before invoking it.
Use Molecule.fetch(code, format=".bcif", cache=..., database="rcsb") for
RCSB/wwPDB downloads, or the lower-level
StructureDownloader(cache=...).download(code, format, database) when the
returned path/buffer must be inspected. Prefer cached BCIF for repeatable
work. A cache hit must be used without an HTTP request; a cache miss requires
network access.
Only cif, pdb, and bcif are downloader formats. New pdb_... accession
codes cannot be requested as PDB text; select CIF or BCIF. AlphaFold is a
separate Biotite-backed database route and is not the same as the RCSB URL
builder.
Use Molecule.load(topology, coordinates, ...) when coordinates is a local
MDAnalysis-readable trajectory. Keep topology and coordinates compatible and
preserve both paths. This route constructs an MDAnalysis Universe rather than
using the Biotite structure-file dispatcher. Streaming IMD and oxDNA have
separate loaders; route them through
trajectories-and-annotations.
A .star file is an ensemble input, not a Molecule structure. Use
entities.ensemble.StarFile.load(path, name=None, node_setup=True) for
RELION >=3.1 or cisTEM STAR files. CellPack .cif/.bcif models use
entities.ensemble.CellPack.load(path, name=None, node_setup=True); do not
mistake them for an ordinary atom structure if the file is a packing model.
Detailed ensemble behavior belongs to
density-and-ensembles.
read_structure(file_path: str | Path | io.BytesIO) -> ReaderBase: for a
supported path, returns PDBReader, PDBXReader, or SDFReader, and raises
Biotite InvalidFileError for an unsupported suffix. Although BytesIO is
accepted by the dispatcher annotation, the current BCIF reader can fail
while reading the buffer because it expects a path suffix.Molecule.from_file(file_path, name=None) -> Molecule: parses one structure,
converts the Biotite array to an MDAnalysis Universe, and stores source
metadata. Use a path for the reliable 5.2.0 path-backed route; do not claim
an in-memory BCIF load succeeded unless it was actually observed.Molecule.load(topology, coordinates=None, name=None, style=None, selection=None, create_object=True, **kwargs) -> Molecule: selects the
structure or MD route and optionally adds a style. create_object=False
affects the topology-plus-trajectory MD route; the single-file path goes
through from_file and creates its Blender object.Molecule.fetch(code, format=".bcif", cache=CACHE_DIR, database="rcsb") -> Molecule: downloads/caches, delegates to
from_file, and records props.code and props.database.StructureDownloader(cache=CACHE_DIR).download(code, format="cif", database="rcsb") -> Path | io.BytesIO | io.StringIO: returns a cached path
or an in-memory buffer when caching is disabled.Arguments are inputs; return values and recorded source paths are outputs.
Do not pass a .star file to Molecule.load, and do not pass a trajectory as
coordinates without a compatible topology.
After each setup/import attempt, check:
bpy.app.version, package metadata, and imports pass.code.format file; AlphaFold
cache naming is delegated to Biotite and must be observed rather than
assumed.Molecule.assemblies() first.On failure, classify it before retrying: host/package dependency, unsupported format/database, local path/content, cache state, or network/server. Use the specific recovery matrix in references/troubleshooting.md. Do not retry network calls indefinitely, add credentials to source files, or bypass an unsupported format by changing only a UI label.
bpy or biotite is an installation/backend block, not a data
problem. Repair the Blender extension or compatible Python environment.ValueError for a format or database is deterministic. Change
the input to a supported option or route to the appropriate sibling skill.The bundled checker is intentionally read-only and offline: see scripts/check_install.py. Known compatibility and format caveats are maintained in references/troubleshooting.md.