void setModelIndex(int atomIndex) { if (currentMesh == null) return; currentMesh.visible = true; if (modelCount < 2) isFixed = true; if ((currentMesh.atomIndex = atomIndex) >= 0) currentMesh.modelIndex = (atomIndex < 0 ? -1 : viewer.getAtomModelIndex(atomIndex)); else if (isFixed) currentMesh.modelIndex = -1; else currentMesh.modelIndex = viewer.getCurrentModelIndex(); if (currentMesh.thisID == null) currentMesh.thisID = myType + (++nUnnamed); currentMesh.scriptCommand = script; }