Prechádzať zdrojové kódy

skip Coarse models in export extension

dsehnal 3 rokov pred
rodič
commit
f8aae8cbd1
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      src/extensions/model-export/export.ts

+ 5 - 1
src/extensions/model-export/export.ts

@@ -5,7 +5,7 @@
  */
 
 import { utf8ByteCount, utf8Write } from '../../mol-io/common/utf8';
-import { to_mmCIF } from '../../mol-model/structure';
+import { to_mmCIF, Unit } from '../../mol-model/structure';
 import { PluginContext } from '../../mol-plugin/context';
 import { Task } from '../../mol-task';
 import { getFormattedTime } from '../../mol-util/date';
@@ -38,6 +38,10 @@ function _exportHierarchy(plugin: PluginContext, options?: { format?: 'cif' | 'b
                 plugin.log.warn(`[Export] Skipping ${_s.cell.obj?.label}: Multimodel exports not supported.`);
                 continue;
             }
+            if (s.units.some(u => !Unit.isAtomic(u))) {
+                plugin.log.warn(`[Export] Skipping ${_s.cell.obj?.label}: Non-atomic model exports not supported.`);
+                continue;
+            }
 
             const name = entryMap.has(s.model.entryId)
                 ? `${s.model.entryId}_${entryMap.get(s.model.entryId)! + 1}.${format}`