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()
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
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 ()
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 ()
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 )
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 ()
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()
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()
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 ()
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 ()
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' )
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 )
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 )
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 ()
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 ()
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 )
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()
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
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)
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)
def onSnapGrid ( self, check ) : # self.workArea.gridSnap = bool ( check ) app_settings.beginGroup ( 'WorkArea' ) app_settings.setValue ( 'grid_snap', bool ( check ) ) app_settings.endGroup ()
def onReverseFlow ( self, check ) : # self.workArea.reverseFlow = bool ( check ) app_settings.beginGroup ( 'WorkArea' ) app_settings.setValue ( 'reverse_flow', bool ( check ) ) app_settings.endGroup ()
def onReverseFlow(self, check): # self.workArea.reverseFlow = bool(check) app_settings.beginGroup('WorkArea') app_settings.setValue('reverse_flow', bool(check)) app_settings.endGroup()
def onSnapGrid(self, check): # self.workArea.gridSnap = bool(check) app_settings.beginGroup('WorkArea') app_settings.setValue('grid_snap', bool(check)) app_settings.endGroup()