コード例 #1
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
    def onRenderPresetChanged(self):
        #
        if DEBUG_MODE:
            print('>> MainWindow::onRenderPresetChanged preset = %s' %
                  self.RendererPreset.getCurrentPresetName())
        app_settings.setValue('defRenderer',
                              self.RendererPreset.getCurrentPresetName())

        app_global_vars[
            'RendererName'] = self.RendererPreset.currentPreset.RendererName
        app_global_vars[
            'RendererFlags'] = self.RendererPreset.currentPreset.RendererFlags
        app_global_vars[
            'ShaderCompiler'] = self.RendererPreset.currentPreset.ShaderCompiler
        app_global_vars[
            'ShaderDefines'] = self.RendererPreset.currentPreset.ShaderDefines
        app_global_vars[
            'ShaderInfo'] = self.RendererPreset.currentPreset.ShaderInfo
        app_global_vars['SLO'] = self.RendererPreset.currentPreset.ShaderExt
        app_global_vars[
            'TextureMake'] = self.RendererPreset.currentPreset.TextureMake
        app_global_vars[
            'TextureInfo'] = self.RendererPreset.currentPreset.TextureInfo
        app_global_vars[
            'TextureViewer'] = self.RendererPreset.currentPreset.TextureViewer
        app_global_vars['TEX'] = self.RendererPreset.currentPreset.TextureExt
        app_global_vars['RendererPreset'] = self.RendererPreset
        self.setupWindowTitle()
コード例 #2
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
 def addRecentProject(self, project):
     #
     print '>> addRecentProject ', project
     if project is not None:
         if usePyQt4:
             recent_projects_max = getDefaultValue(app_settings, '',
                                                   'recent_projects_max')
             if project not in self.recentProjects:
                 self.recentProjects.prepend(QtCore.QString(project))
             while self.recentProjects.count() > recent_projects_max:
                 self.recentProjects.takeLast()
             recentProjects = QtCore.QVariant(
                 self.recentProjects
             ) if self.recentProjects else QtCore.QVariant()
             app_settings.setValue('RecentProjects', recentProjects)
         else:
             recent_projects_max = getDefaultValue(app_settings, '',
                                                   'recent_projects_max')
             if project not in self.recentProjects:
                 self.recentProjects.insert(0, project)
                 while len(self.recentProjects) > recent_projects_max:
                     self.recentProjects.pop()
                 app_settings.setValue('RecentProjects',
                                       self.recentProjects)
                 print '* project added recentProjects =', self.recentProjects
         print '* recentProjects =', self.recentProjects
コード例 #3
0
ファイル: MainWindow.py プロジェクト: walternate/meShaderEd
 def onReverseFlow ( self, check ):
   #
   print ">> MainWindow: onReverseFlow = %d" % check   
   self.workArea.reverseFlow = bool( check ) 
   app_settings.beginGroup ( 'WorkArea' )
   app_settings.setValue ( 'reverse_flow', bool( check ) )
   app_settings.endGroup ()
コード例 #4
0
ファイル: MainWindow.py プロジェクト: walternate/meShaderEd
 def onSnapGrid ( self, check ):
   #
   print ">> MainWindow: onSnapGrid = %d" % check
   self.workArea.gridSnap = bool( check ) 
   app_settings.beginGroup ( 'WorkArea' )
   app_settings.setValue ( 'grid_snap', bool( check ) )
   app_settings.endGroup ()
コード例 #5
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
	def onOpenRecentProject ( self ) :
		#
		action = self.sender ()
		if isinstance ( action, QtModule.QAction ):
			if usePyQt4 :
				project = unicode ( action.data ().toString () )
			else :
				project = action.data () 
			if project is not None :
				print '>> onOpenRecentProject : %s' % project
				project_filename = getDefaultValue ( app_settings, '', 'project_filename' )
				if openDefaultProject ( app_settings, app_global_vars, project, project_filename ) :
					# very strange... app_settings doesn't update inside meCommon.openDefaultProject...
					# though app_global_vars does
					# have to duplicate this action here...
					app_settings.setValue ( 'project', app_global_vars [ 'ProjectPath' ] )
					app_settings.setValue ( 'project_shaders', app_global_vars [ 'ProjectShaders' ] )
					app_settings.setValue ( 'project_textures', app_global_vars [ 'ProjectTextures' ] )
					app_settings.setValue ( 'shader_networks', app_global_vars [ 'ProjectNetworks' ] )
					app_settings.setValue ( 'shader_sources', app_global_vars [ 'ProjectSources' ] )

					self.ui.project_ctl.setLibrary ( app_global_vars [ 'ProjectNetworks' ] )
					self.setupWindowTitle ()
				else :
					print "ERROR! project %s doesn't exist" %  project
					if usePyQt4 : 
						self.recentProjects.removeAll ( network )
					else :
						self.recentProjects.remove ( network )
コード例 #6
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
	def onShowGrid ( self, check ) :
		#
		self.workArea.drawGrid = bool ( check )
		app_settings.beginGroup ( 'WorkArea' )
		app_settings.setValue ( 'grid_enabled', bool ( check ) )
		app_settings.endGroup ()
		self.workArea.resetCachedContent ()
コード例 #7
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
 def onShowGrid(self, check):
     #
     self.workArea.drawGrid = bool(check)
     app_settings.beginGroup('WorkArea')
     app_settings.setValue('grid_enabled', bool(check))
     app_settings.endGroup()
     self.workArea.resetCachedContent()
コード例 #8
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
 def onStraightLinks(self, check):
     #
     self.workArea.straightLinks = bool(check)
     app_settings.beginGroup('WorkArea')
     app_settings.setValue('straight_links', bool(check))
     app_settings.endGroup()
     self.workArea.resetCachedContent()
     self.workArea.adjustLinks()
コード例 #9
0
ファイル: MainWindow.py プロジェクト: UIKit0/meShaderEd
 def onStraightLinks ( self, check ) :
   #
   self.workArea.straightLinks = bool ( check )
   app_settings.beginGroup ( 'WorkArea' )
   app_settings.setValue ( 'straight_links', bool ( check ) )
   app_settings.endGroup ()
   self.workArea.resetCachedContent ()
   self.workArea.adjustLinks ()
コード例 #10
0
ファイル: MainWindow.py プロジェクト: walternate/meShaderEd
 def onStraightLinks ( self, check ):
   #
   print ">> MainWindow: onStraightLinks = %d" % check 
   self.workArea.straightLinks = bool( check ) 
   app_settings.beginGroup ( 'WorkArea' )
   app_settings.setValue ( 'straight_links', bool( check ) )
   app_settings.endGroup ()
   self.workArea.resetCachedContent () 
コード例 #11
0
ファイル: MainWindow.py プロジェクト: walternate/meShaderEd
 def onRenderPresetChanged ( self ):
   #
   presetName = app_renderer.getCurrentPresetName()
   print ">> MainWindow: onRenderPresetChanged preset = %s" % presetName 
   self.setWindowTitle ( "meShaderEd (" + presetName + ")")
   app_settings.setValue ( 'defRenderer', presetName )
   
   app_global_vars[ 'Renderer' ] = app_renderer.getCurrentValue( 'renderer', 'name' )
   app_global_vars[ 'RendererFlags' ] = app_renderer.getCurrentValue( 'renderer', 'flags' ) 
   app_global_vars[ 'ShaderCompiler' ] = app_renderer.getCurrentValue( 'shader', 'compiler' ) 
   app_global_vars[ 'ShaderDefines' ] = app_renderer.getCurrentValue( 'shader', 'defines' ) 
   app_global_vars[ 'TEX' ] = app_renderer.getCurrentValue( 'texture', 'extension' )
   app_global_vars[ 'SLO' ] = app_renderer.getCurrentValue( 'shader', 'extension' )
コード例 #12
0
ファイル: MainWindow.py プロジェクト: UIKit0/meShaderEd
  def addRecentNetwork ( self, network ) :
    #
    if network is not None :
      recent_networks_max = getDefaultValue ( app_settings, '', 'recent_networks_max' )

      if not self.recentNetworks.contains ( network ) :
        self.recentNetworks.prepend ( QtCore.QString ( network ) )

      while self.recentNetworks.count () > recent_networks_max :
        self.recentNetworks.takeLast ()

      recentNetworks = QtCore.QVariant ( self.recentNetworks ) if self.recentNetworks else QtCore.QVariant ()
      app_settings.setValue ( 'RecentNetworks', recentNetworks )
コード例 #13
0
ファイル: MainWindow.py プロジェクト: UIKit0/meShaderEd
  def addRecentProject ( self, project ) :
    #
    if project is not None :
      recent_projects_max = getDefaultValue ( app_settings, '', 'recent_projects_max' )

      if not self.recentProjects.contains ( project ) :
        self.recentProjects.prepend ( QtCore.QString ( project ) )

      while self.recentProjects.count () > recent_projects_max :
        self.recentProjects.takeLast ()

      recentProjects = QtCore.QVariant ( self.recentProjects ) if self.recentProjects else QtCore.QVariant ()
      app_settings.setValue ( 'RecentProjects', recentProjects )
コード例 #14
0
ファイル: MainWindow.py プロジェクト: UIKit0/meShaderEd
  def onRenderPresetChanged ( self ) :
    #
    presetName = app_renderer.getCurrentPresetName ()
    if DEBUG_MODE : print '>> MainWindow.onRenderPresetChanged preset = %s' % presetName
    #self.setWindowTitle ( 'meShaderEd %s (%s) %s' % ( app_global_vars [ 'version' ], presetName, app_global_vars [ 'ProjectNetworks' ] ) )
    app_settings.setValue ( 'defRenderer', presetName )

    app_global_vars [ 'RendererPreset' ] = presetName
    app_global_vars [ 'Renderer' ]       = app_renderer.getCurrentValue ( 'renderer', 'name' )
    app_global_vars [ 'RendererFlags' ]  = app_renderer.getCurrentValue ( 'renderer', 'flags' )
    app_global_vars [ 'ShaderCompiler' ] = app_renderer.getCurrentValue ( 'shader', 'compiler' )
    app_global_vars [ 'ShaderDefines' ]  = app_renderer.getCurrentValue ( 'shader', 'defines' )
    app_global_vars [ 'ShaderInfo' ]     = app_renderer.getCurrentValue ( 'shader', 'sloinfo' )
    app_global_vars [ 'TEX' ]            = app_renderer.getCurrentValue ( 'texture', 'extension' )
    app_global_vars [ 'SLO' ]            = app_renderer.getCurrentValue ( 'shader', 'extension' )
    app_global_vars [ 'TexMake' ]        = app_renderer.getCurrentValue ( 'texture', 'texmake' )
    self.setupWindowTitle ()
コード例 #15
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
	def onRenderPresetChanged ( self ) :
		#
		if DEBUG_MODE : print ( '>> MainWindow::onRenderPresetChanged preset = %s' % self.RendererPreset.getCurrentPresetName () )
		app_settings.setValue ( 'defRenderer', self.RendererPreset.getCurrentPresetName () )
 
		app_global_vars [ 'RendererName' ]   = self.RendererPreset.currentPreset.RendererName
		app_global_vars [ 'RendererFlags' ]  = self.RendererPreset.currentPreset.RendererFlags
		app_global_vars [ 'ShaderCompiler' ] = self.RendererPreset.currentPreset.ShaderCompiler
		app_global_vars [ 'ShaderDefines' ]  = self.RendererPreset.currentPreset.ShaderDefines
		app_global_vars [ 'ShaderInfo' ]     = self.RendererPreset.currentPreset.ShaderInfo
		app_global_vars [ 'SLO' ]            = self.RendererPreset.currentPreset.ShaderExt
		app_global_vars [ 'TextureMake' ]    = self.RendererPreset.currentPreset.TextureMake
		app_global_vars [ 'TextureInfo' ]    = self.RendererPreset.currentPreset.TextureInfo
		app_global_vars [ 'TextureViewer' ]  = self.RendererPreset.currentPreset.TextureViewer
		app_global_vars [ 'TEX' ]            = self.RendererPreset.currentPreset.TextureExt
		app_global_vars [ 'RendererPreset' ] = self.RendererPreset
		self.setupWindowTitle ()
コード例 #16
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
	def addRecentNetwork ( self, network ) :
		#
		if network is not None :
			if usePyQt4 :
				recent_networks_max = getDefaultValue ( app_settings, '', 'recent_networks_max' )
				if network not in self.recentNetworks :
					self.recentNetworks.prepend ( QtCore.QString ( network ) )
				while self.recentNetworks.count () > recent_networks_max :
					self.recentNetworks.takeLast ()
				recentNetworks = QtCore.QVariant ( self.recentNetworks ) if self.recentNetworks else QtCore.QVariant ()
				app_settings.setValue ( 'RecentNetworks', recentNetworks )
			else :
				recent_networks_max = getDefaultValue ( app_settings, '', 'recent_networks_max' )
				if network not in self.recentNetworks :
					self.recentNetworks.insert ( 0, network )
				while len ( self.recentNetworks ) > recent_networks_max :
					self.recentNetworks.pop ()
				app_settings.setValue ( 'RecentNetworks', self.recentNetworks )
コード例 #17
0
ファイル: MainWindow.py プロジェクト: ymesh/meShaderEd
    def onRenderPresetChanged(self):
        #
        if DEBUG_MODE:
            print (">> MainWindow::onRenderPresetChanged preset = %s" % self.RendererPreset.getCurrentPresetName())
        app_settings.setValue("defRenderer", self.RendererPreset.getCurrentPresetName())

        app_global_vars["RendererName"] = self.RendererPreset.currentPreset.RendererName
        app_global_vars["RendererFlags"] = self.RendererPreset.currentPreset.RendererFlags
        app_global_vars["ShaderCompiler"] = self.RendererPreset.currentPreset.ShaderCompiler
        app_global_vars["ShaderDefines"] = self.RendererPreset.currentPreset.ShaderDefines
        app_global_vars["ShaderInfo"] = self.RendererPreset.currentPreset.ShaderInfo
        app_global_vars["SLO"] = self.RendererPreset.currentPreset.ShaderExt
        app_global_vars["TextureMake"] = self.RendererPreset.currentPreset.TextureMake
        app_global_vars["TextureInfo"] = self.RendererPreset.currentPreset.TextureInfo
        app_global_vars["TextureViewer"] = self.RendererPreset.currentPreset.TextureViewer
        app_global_vars["TEX"] = self.RendererPreset.currentPreset.TextureExt
        app_global_vars["RendererPreset"] = self.RendererPreset
        self.setupWindowTitle()
コード例 #18
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
	def addRecentProject ( self, project ) :
		#
		print '>> addRecentProject ', project
		if project is not None :
			if usePyQt4 :
				recent_projects_max = getDefaultValue ( app_settings, '', 'recent_projects_max' )
				if project not in self.recentProjects :
					self.recentProjects.prepend ( QtCore.QString ( project ) )
				while self.recentProjects.count () > recent_projects_max :
					self.recentProjects.takeLast ()
				recentProjects = QtCore.QVariant ( self.recentProjects ) if self.recentProjects else QtCore.QVariant ()
				app_settings.setValue ( 'RecentProjects', recentProjects )
			else :
				recent_projects_max = getDefaultValue ( app_settings, '', 'recent_projects_max' )
				if project not in self.recentProjects :
					self.recentProjects.insert ( 0, project )
					while len ( self.recentProjects ) > recent_projects_max :
						self.recentProjects.pop ()
					app_settings.setValue ( 'RecentProjects', self.recentProjects )
					print '* project added recentProjects =', self.recentProjects
			print '* recentProjects =', self.recentProjects
コード例 #19
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
 def addRecentNetwork(self, network):
     #
     if network is not None:
         if usePyQt4:
             recent_networks_max = getDefaultValue(app_settings, '',
                                                   'recent_networks_max')
             if network not in self.recentNetworks:
                 self.recentNetworks.prepend(QtCore.QString(network))
             while self.recentNetworks.count() > recent_networks_max:
                 self.recentNetworks.takeLast()
             recentNetworks = QtCore.QVariant(
                 self.recentNetworks
             ) if self.recentNetworks else QtCore.QVariant()
             app_settings.setValue('RecentNetworks', recentNetworks)
         else:
             recent_networks_max = getDefaultValue(app_settings, '',
                                                   'recent_networks_max')
             if network not in self.recentNetworks:
                 self.recentNetworks.insert(0, network)
             while len(self.recentNetworks) > recent_networks_max:
                 self.recentNetworks.pop()
             app_settings.setValue('RecentNetworks', self.recentNetworks)
コード例 #20
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
    def onOpenRecentProject(self):
        #
        action = self.sender()
        if isinstance(action, QtModule.QAction):
            if usePyQt4:
                project = unicode(action.data().toString())
            else:
                project = action.data()
            if project is not None:
                print '>> onOpenRecentProject : %s' % project
                project_filename = getDefaultValue(app_settings, '',
                                                   'project_filename')
                if openDefaultProject(app_settings, app_global_vars, project,
                                      project_filename):
                    # very strange... app_settings doesn't update inside meCommon.openDefaultProject...
                    # though app_global_vars does
                    # have to duplicate this action here...
                    app_settings.setValue('project',
                                          app_global_vars['ProjectPath'])
                    app_settings.setValue('project_shaders',
                                          app_global_vars['ProjectShaders'])
                    app_settings.setValue('project_textures',
                                          app_global_vars['ProjectTextures'])
                    app_settings.setValue('shader_networks',
                                          app_global_vars['ProjectNetworks'])
                    app_settings.setValue('shader_sources',
                                          app_global_vars['ProjectSources'])

                    self.ui.project_ctl.setLibrary(
                        app_global_vars['ProjectNetworks'])
                    self.setupWindowTitle()
                else:
                    print "ERROR! project %s doesn't exist" % project
                    if usePyQt4:
                        self.recentProjects.removeAll(network)
                    else:
                        self.recentProjects.remove(network)
コード例 #21
0
ファイル: MainWindow.py プロジェクト: UIKit0/meShaderEd
 def onSnapGrid ( self, check ) :
   #
   self.workArea.gridSnap = bool ( check )
   app_settings.beginGroup ( 'WorkArea' )
   app_settings.setValue ( 'grid_snap', bool ( check ) )
   app_settings.endGroup ()
コード例 #22
0
ファイル: MainWindow.py プロジェクト: UIKit0/meShaderEd
 def onReverseFlow ( self, check ) :
   #
   self.workArea.reverseFlow = bool ( check )
   app_settings.beginGroup ( 'WorkArea' )
   app_settings.setValue ( 'reverse_flow', bool ( check ) )
   app_settings.endGroup ()
コード例 #23
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
 def onReverseFlow(self, check):
     #
     self.workArea.reverseFlow = bool(check)
     app_settings.beginGroup('WorkArea')
     app_settings.setValue('reverse_flow', bool(check))
     app_settings.endGroup()
コード例 #24
0
ファイル: MainWindow.py プロジェクト: theomission/meShaderEd
 def onSnapGrid(self, check):
     #
     self.workArea.gridSnap = bool(check)
     app_settings.beginGroup('WorkArea')
     app_settings.setValue('grid_snap', bool(check))
     app_settings.endGroup()