diff --git a/js/lattice/CompositeEditorLattice.js b/js/lattice/CompositeEditorLattice.js index f63612ea62c60c59bb875191e5e4f8dcf3bf0bd1..618f89ca44a9dcd6dcfa4d1da5568e72b2533ae4 100644 --- a/js/lattice/CompositeEditorLattice.js +++ b/js/lattice/CompositeEditorLattice.js @@ -79,11 +79,24 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre sparseCells: JSON.parse(JSON.stringify(this.sparseCells)), cellsMin: cellsMin, cellsMax: cellsMax, + elementaryChildren: this._getChildCellTypes(true), + compositeChildren: this._getChildCellTypes(false), dimensions: _dimensions }; return data; }, + _getChildCellTypes: function(elementaryTypes){ + var children = []; + this._loopCells(this.sparseCells, function(cell){ + if (!cell) return; + var isComposite = cell.materialName.substr(0,5) == "super"; + if ((elementaryTypes && !isComposite) || (!elementaryTypes && isComposite)) children.push(cell.materialName); + }); + if (children.length == 0) return null; + return _.uniq(children);//remove duplicates + }, +