def _collectLayer(l, parentName=None): for layer in l.layers: layerName = layer.name.encode('utf-8') if layerName.startswith('//'): continue isGroup = isinstance(layer, Group) if isGroup: #if namespace mo = re.match('\s*\[\s*([\w_-]+)\s*\]\s*', layerName) if mo: layerName = mo.group(1) fullName = parentName and (parentName + '/' + layerName) or layerName _collectLayer(layer, fullName) continue #common fullName = parentName and (parentName + '/' + layerName) or layerName partLayers = [] if isinstance(layer, Group): partLayers = extract_leaf_layers(layer) else: partLayers = [layer] tile = TileItem(fullName, partLayers) tileGroup.addTile(tile)
def processLayer( self, psdLayer, metaInfo ): project = self.project tags = metaInfo[ 'tags' ] partLayers = [] if isinstance( psdLayer, Group ): partLayers = extract_leaf_layers( psdLayer ) else: partLayers = [ psdLayer ] deck = MQuadDeckItem( psdLayer.name, partLayers ) project.addDeckItem( deck )
def processLayer(self, psdLayer, metaInfo): project = self.project tags = metaInfo['tags'] partLayers = [] if isinstance(psdLayer, Group): partLayers = extract_leaf_layers(psdLayer) else: partLayers = [psdLayer] name = metaInfo['name'] deck = MQuadDeckItem(name, partLayers) project.addDeckItem(deck)
def _collectLayer( l, parentName = None ): for layer in l.layers: layerName = layer.name.encode( 'utf-8' ) if layerName.startswith( '//' ): continue isGroup = isinstance( layer, Group ) if isGroup: #if namespace mo = re.match( '\s*\[\s*([\w_-]+)\s*\]\s*', layerName ) if mo: layerName = mo.group(1) fullName = parentName and (parentName + '/' + layerName) or layerName _collectLayer( layer, fullName ) continue #common fullName = parentName and (parentName + '/' + layerName) or layerName partLayers = [] if isinstance( layer, Group ): partLayers = extract_leaf_layers( layer ) else: partLayers = [ layer ] tile = TileItem( fullName, partLayers ) tileGroup.addTile( tile )