Esempio n. 1
0
        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)
Esempio n. 2
0
	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 )
Esempio n. 3
0
 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)
Esempio n. 4
0
		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 )