diff --git a/layer3/MoleculeExporter.cpp b/layer3/MoleculeExporter.cpp index 08f2d07ab..2b77b45e6 100644 --- a/layer3/MoleculeExporter.cpp +++ b/layer3/MoleculeExporter.cpp @@ -1821,7 +1821,7 @@ struct MoleculeExporterChemPy : public MoleculeExporter { void writeAtom() override { PyObject *atom = CoordSetAtomToChemPyAtom(G, m_iter.getAtomInfo(), m_last_obj, m_coord, getRefPtr(), - m_iter.getAtm(), m_mat_full.ptr); + m_iter.getAtm(), m_iter.obj); if (atom) { PyList_Append(m_atom_list, atom); diff --git a/testing/tests/api/exporting.py b/testing/tests/api/exporting.py index aebd815ae..90711bd82 100644 --- a/testing/tests/api/exporting.py +++ b/testing/tests/api/exporting.py @@ -353,8 +353,11 @@ def testGetModelObjectName(self): cmd.load(self.datafile('1rna.cif')) m1 = cmd.get_model() + cnt = cmd.count_atoms('%1oky-frag') + self.assertEqual(m1.atom[0].model, '1oky-frag') self.assertEqual(m1.atom[-1].model, '1rna') + self.assertEqual(m1.atom[cnt].model, '1rna') @testing.requires_version('2.1')