예제 #1
0
 def onListSelectionChanged(self):
     self.updatingSelection = True
     selection = self.getItemSelection()
     if self.isMain():
         getAssetSelectionManager().changeSelection(selection)
     self.updatingSelection = False
     self.updateStatusBar()
예제 #2
0
파일: AssetBrowser.py 프로젝트: tommo/gii
	def onListSelectionChanged( self ):
		self.updatingSelection = True
		selection = self.getItemSelection()
		if self.isMain():
			getAssetSelectionManager().changeSelection( selection )
		self.updatingSelection = False
		self.updateStatusBar()
예제 #3
0
    def onMenu(self, menuNode):
        name = menuNode.name

        if name in ('deploy_set', 'deploy_disallow', 'deploy_unset'):
            if name == 'deploy_set': newstate = True
            elif name == 'deploy_disallow': newstate = False
            elif name == 'deploy_unset': newstate = None
            s = getAssetSelectionManager().getSelection()
            for n in s:
                if isinstance(n, AssetNode):
                    n.setDeployState(newstate)

        elif name == 'reimport':
            targetNode = self.currentContextTargetNode
            if targetNode:
                targets = [targetNode]
            else:
                targets = getAssetSelectionManager().getSelection()
            for targetNode in targets:
                if isinstance(targetNode, AssetNode):
                    targetNode.markModified()
            app.getAssetLibrary().importModifiedAssets()

        elif name == 'clone':
            pass

        elif name == 'remove':
            pass

        elif name == 'show_in_browser':
            n = self.currentContextTargetNode
            if isinstance(n, AssetNode):
                n.showInBrowser()

        elif name == 'open_in_system':
            for n in getAssetSelectionManager().getSelection():
                if isinstance(n, AssetNode):
                    n.openInSystem()
                    break

        elif name == 'copy_node_path':
            text = ''
            for n in getAssetSelectionManager().getSelection():
                if text: text += '\n'
                text += n.getNodePath()
            setClipboardText(text)

        elif name == 'create_asset':
            requestSearchView(info='select asset type to create',
                              context='asset_creator',
                              type='scene',
                              on_selection=self.createAsset)

        elif name == 'create_folder':
            self.createAsset('folder')

        elif name == 'find_asset':
            requestSearchView(info='search for asset',
                              context='asset',
                              on_test=self.selectAsset,
                              on_selection=self.selectAsset)

        elif name == 'find_asset_folder':
            requestSearchView(info='search for asset',
                              context='asset_folder',
                              on_test=self.selectAsset,
                              on_selection=self.selectAsset)

        elif name == 'open_asset':
            requestSearchView(info='open asset',
                              context='asset',
                              on_test=self.selectAsset,
                              on_selection=self.openAsset)

        elif name == 'new_asset_search':
            self.createAssetSearch()
예제 #4
0
파일: AssetBrowser.py 프로젝트: pixpil/gii
	def onMenu(self, menuNode):
		name = menuNode.name

		if name in ('deploy_set', 'deploy_disallow', 'deploy_unset'):
			if name   == 'deploy_set':      newstate = True
			elif name == 'deploy_disallow': newstate = False
			elif name == 'deploy_unset':    newstate = None
			s = getAssetSelectionManager().getSelection()
			for n in s:
				if isinstance(n,AssetNode):
					n.setDeployState(newstate)
					
		elif name == 'reimport':
			targetNode = self.currentContextTargetNode
			if targetNode:
				targets = [ targetNode ]	
			else:
				targets = getAssetSelectionManager().getSelection()
			for targetNode in targets:
				if isinstance( targetNode, AssetNode ):
					targetNode.markModified()
			app.getAssetLibrary().importModifiedAssets()

		elif name == 'clone':
			pass

		elif name == 'remove':
			pass

		elif name == 'show_in_browser':
			n = self.currentContextTargetNode
			if isinstance( n, AssetNode ):
				n.showInBrowser()

		elif name == 'open_in_system':
			for n in getAssetSelectionManager().getSelection():
				if isinstance( n, AssetNode ):
					n.openInSystem()
					break

		elif name == 'copy_node_path':
			text = ''
			for n in getAssetSelectionManager().getSelection():
				if text: text += '\n'
				text += n.getNodePath()
			setClipboardText( text )

		elif name == 'create_asset':
			requestSearchView( 
				info    = 'select asset type to create',
				context = 'asset_creator',
				type    = 'scene',
				on_selection = self.createAsset
			)

		elif name == 'create_folder':
			self.createAsset( 'folder' )

		elif name == 'find_asset':
			requestSearchView( 
				info    = 'search for asset',
				context = 'asset',
				on_test      = self.selectAsset,
				on_selection = self.selectAsset
				)

		elif name == 'find_asset_folder':
			requestSearchView( 
				info    = 'search for asset',
				context = 'asset_folder',
				on_test      = self.selectAsset,
				on_selection = self.selectAsset
				)

		elif name == 'open_asset':
			requestSearchView( 
				info    = 'open asset',
				context = 'asset',
				on_test      = self.selectAsset,
				on_selection = self.openAsset
				)

		elif name == 'new_asset_search':
			self.createAssetSearch()