Esempio n. 1
0
	def importAsset(self, node, reload = False ):
		if node.isVirtual(): return
		node.assetType = 'named_tileset_pack'
		#atlas
		atlasFile = node.getCacheFile( 'atlas' )
		node.setObjectFile( 'atlas', atlasFile )
		#define
		defFile = node.getCacheFile( 'def' )
		node.setObjectFile( 'def', defFile )
		
		proj = TilesetProject()
		proj.loadPSD( node.getAbsFilePath() )
		absAtlas, absDef = node.getAbsObjectFile( 'atlas' ), node.getAbsObjectFile( 'def' )
		proj.save( absAtlas, absDef )
		#TODO: let texture library handle atlas
		pack = jsonHelper.tryLoadJSON( absDef )
		for item in pack[ 'themes' ]:
			node.affirmChildNode( item[ 'name' ], 'named_tileset', manager = self )
		return True
Esempio n. 2
0
    def importAsset(self, node, reload=False):
        if node.isVirtual(): return
        node.assetType = 'named_tileset_pack'
        #atlas
        atlasFile = node.getCacheFile('atlas')
        node.setObjectFile('atlas', atlasFile)
        #define
        defFile = node.getCacheFile('def')
        node.setObjectFile('def', defFile)

        proj = TilesetProject()
        proj.loadPSD(node.getAbsFilePath())
        absAtlas, absDef = node.getAbsObjectFile(
            'atlas'), node.getAbsObjectFile('def')
        proj.save(absAtlas, absDef)
        #TODO: let texture library handle atlas
        pack = jsonHelper.tryLoadJSON(absDef)
        for item in pack['themes']:
            node.affirmChildNode(item['name'], 'named_tileset', manager=self)
        return True
Esempio n. 3
0
    def importAsset(self, node, reload=False):
        if node.isVirtual(): return
        node.assetType = 'deck_pack'
        node.groupType = 'package'

        output = node.getCacheFile('export', is_dir=True)
        node.setObjectFile('export', output)

        proj = PSDDeckPackProject()
        proj.setDefaultProcessor('mquad')

        proj.loadPSD(node.getAbsFilePath())
        proj.save(output + '/', 'decks', (2048, 2048))

        #import
        jsonPath = output + '/decks.json'
        pack = jsonHelper.tryLoadJSON(jsonPath)
        for item in pack['decks']:
            name = item['name']
            deckType = item['type']
            node.affirmChildNode(item['name'], deckType, manager=self)

        return True
Esempio n. 4
0
    def importAsset(self, node, reload=False):
        if node.isVirtual():
            return
        node.assetType = "deck_pack"
        node.groupType = "package"

        output = node.getCacheFile("export", is_dir=True)
        node.setObjectFile("export", output)

        proj = PSDDeckPackProject()
        proj.setDefaultProcessor("mquad")

        proj.loadPSD(node.getAbsFilePath())
        proj.save(output + "/", "decks", (2048, 2048))

        # import
        jsonPath = output + "/decks.json"
        pack = jsonHelper.tryLoadJSON(jsonPath)
        for item in pack["decks"]:
            name = item["name"]
            deckType = item["type"]
            node.affirmChildNode(item["name"], deckType, manager=self)

        return True