예제 #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)
예제 #2
0
파일: PSDDeckMQuad.py 프로젝트: pixpil/gii
	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 )
예제 #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)
예제 #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 )