rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
self.w.connect(self.w.depositAtomDashboard.bond3RB, | change_connect(self.w.depositAtomDashboard.bond3RB, | def init_gui(self): """called once each time the mode is entered; should be called only by code in modes.py """ self.dont_update_gui = True # redundant with Enter, I think; changed below # (the possible orders of calling all these mode entering/exiting # methods is badly in need of documentation, if not cleanup... # ... |
self.w.connect(self.w.depositAtomDashboard.bondaRB, | change_connect(self.w.depositAtomDashboard.bondaRB, | def init_gui(self): """called once each time the mode is entered; should be called only by code in modes.py """ self.dont_update_gui = True # redundant with Enter, I think; changed below # (the possible orders of calling all these mode entering/exiting # methods is badly in need of documentation, if not cleanup... # ... |
self.w.depositAtomDashboard.show() self.w.zoomToolAction.setEnabled(0) self.w.panToolAction.setEnabled(0) self.w.rotateToolAction.setEnabled(0) self.dont_update_gui = False return | return def update_bond_buttons(self): "make the dashboard one-click-bond-changer state buttons match whatever is stored in self.bondclick_v6" self.w.depositAtomDashboard.bond1RB.setOn( self.bondclick_v6 == V_SINGLE) self.w.depositAtomDashboard.bond2RB.setOn( self.bondclick_v6 == V_DOUBLE) self.w.depositAtomDashboard.b... | def init_gui(self): """called once each time the mode is entered; should be called only by code in modes.py """ self.dont_update_gui = True # redundant with Enter, I think; changed below # (the possible orders of calling all these mode entering/exiting # methods is badly in need of documentation, if not cleanup... # ... |
if not elts: res = Spacer(0,0) else: res = SimpleColumn(*elts) | res = SimpleColumn(*elts) | def _C__value(self): # we need this since we don't yet have a way of including " * map(func,expr)" in a toplevel expr. kids = self.kids assert type(kids) == type([]) elts = map(MT_viewer_for_object, kids) if not elts: # THIS BUGFIX MIGHT BE UNTESTED where i am 061205 519p #####@@@@@ res = Spacer(0,0) #k # work around l... |
self.esp_window.color = self.esp_window.normalcolor = (color.red()/255.0, color.green()/255.0, color.blue()/255.0) | self.esp_window.color = self.esp_window.normcolor = (color.red()/255.0, color.green()/255.0, color.blue()/255.0) | def change_fill_color(self): '''Slot method to change fill color.''' color = QColorDialog.getColor(self.fill_color, self, "ColorDialog") |
copyable_attrs = Motor.copyable_attrs + ('torque', 'initial_speed', 'speed', 'length', 'radius', 'sradius', 'center', 'axis', 'enable_minimize') | _initial_posns = None _initial_quats = None copyable_attrs = Motor.copyable_attrs + ('torque', 'initial_speed', 'speed', 'enable_minimize', \ 'length', 'radius', 'sradius', \ 'center', 'axis', \ '_initial_posns', '_initial_quats' ) | def rematom(self, *args, **opts): #bruce 050518 self._initial_posns = None #bruce 050518; needed in RotaryMotor, harmless in others super = Jig return super.rematom(self, *args, **opts) |
if platform.atom_debug: print "atom_debug: had mainpart in setAssy" | if 0 and platform.atom_debug: print "atom_debug: had mainpart in setAssy" | def setAssy(self, assy): """[bruce comment 040922] This is called from self.__init__, and from MWSemantics.__clear when user asks to open a new file, etc. Apparently, it is supposed to forget whatever is happening now, and reinitialize the entire GLPane. However, it does nothing to cleanly leave the current mode, if ... |
print "will execute (from %s): %s" % (source, command) | msg = "will execute (from %s): %s" % (source, command) | def debug_run_command(command, source = "user debug input"): #bruce 040913-16 in GLPane.py; modified 040928 """Execute a python command, supplied by the user via some sort of debugging interface (named by source), in debug.py's globals. Return 1 for ok (incl empty command), 0 for any error. Caller should not print exce... |
print "will execute (from %s; %d lines):\n%s" % (source, nlines, command) | msg = "will execute (from %s; %d lines):\n%s" % (source, nlines, command) print msg try: import env from HistoryWidget import _graymsg, quote_html env.history.message( _graymsg( quote_html( msg))) except: print_compact_traceback("exception in printing that to history: ") | def debug_run_command(command, source = "user debug input"): #bruce 040913-16 in GLPane.py; modified 040928 """Execute a python command, supplied by the user via some sort of debugging interface (named by source), in debug.py's globals. Return 1 for ok (incl empty command), 0 for any error. Caller should not print exce... |
print "basemol quat %r, unit ii=%d quat %r, after setting it, wanted %r" % \ (self.basemol.quat, ii, self.molcopies[ii].quat, q) | def update_from_controls(self): """make the number and position of the copies of basemol what they should be, based on current control values. Never modify the control values! (That would infloop.) This should be called in Enter and whenever relevant controls might change. It's also called during a mousedrag event if t... | |
return self.__div__(other) | return Expr(other)/self | def __rdiv__(self, other): return self.__div__(other) |
self.data = _g.symbol(name) | if isinstance(name, str): self.data = _g.symbol(name) elif isinstance(name, _g.symbol): self.data = name else: raise ValueError, "Can not construct a Symbol from a %s" % type(name) | def __init__(self, name = 'x'): self.data = _g.symbol(name) self.spatial_symbs = [self.data] self.time = None |
m = Matrix(self.i, self.j, self.spatial_symbs, self.time) | m = Matrix(self.i, other.j, self.spatial_symbs, self.time) | def __mul__(self, other): if isinstance(other, Matrix): m = Matrix(self.i, self.j, self.spatial_symbs, self.time) for i in range(self.i): for j in range(self.j): m[i, j] = Expr() for k in range(self.i): m[i, j] += self[i, k]*other[k, j] return m elif isinstance(other, Vector): v = Vector(self.symbs) for j in range(self... |
for j in range(self.j): | for j in range(other.j): | def __mul__(self, other): if isinstance(other, Matrix): m = Matrix(self.i, self.j, self.spatial_symbs, self.time) for i in range(self.i): for j in range(self.j): m[i, j] = Expr() for k in range(self.i): m[i, j] += self[i, k]*other[k, j] return m elif isinstance(other, Vector): v = Vector(self.symbs) for j in range(self... |
def xtest_exam_subs_algebraic(self): | def test_exam_subs_algebraic(self): | def xtest_exam_subs_algebraic(self): """ >>> exam_subs_algebraic() 0 >>> """ result = 0 |
self.assertEqual(e.get_free_indices(),[mu, rho]) | self.failUnless(e.get_free_indices()==[mu,rho] or e.get_free_indices()==[rho,mu]) | def testdummy(self): i=g.idx(g.symbol("i"),3) j=g.idx(g.symbol("j"),3) k=g.idx(g.symbol("k"),3) l=g.idx(g.symbol("l"),3) A=g.symbol("A") B=g.symbol("B") C=g.symbol("C") |
- noref: True if there was no reference image | - noref: True if there was no reference image (set in outputResult()) | def renderJobs(self, htmldir): """Render all jobs. |
job.noref = (maxdiff==None) | def renderJobs(self, htmldir): """Render all jobs. | |
if refimg==None: res.job.noref = True | def outputResult(self, res, htmldir, htmlbasename): """Creates result page and returns maxdiff.""" | |
self.editor = ui.Panel(10, screen[1] - 225, 600, 400, "GlobalSettings", "Global BtoR Settings:", None, False) | self.editor = ui.Panel(10, screen[1] - 225, 400, 300, "GlobalSettings", "Global BtoR Settings:", None, False) | def __init__(self): sdict = globals() |
self.useShadowMaps = ui.CheckBox(300, 65, "Use Shadow Maps?", "Use Shadow Maps?", True, self.editor, True) offset = 125 self.editor.addElement(ui.Label(5, offset, "Search Paths:", "Search Paths:", self.editor, False)) self.editor.addElement(ui.Label(25, offset + 25, "Binaries:", "Binaries:", self.editor, False)) ... | self.useShadowMaps = ui.CheckBox(5, 115, "Use Shadow Maps?", "Use Shadow Maps?", True, self.editor, True) | def __init__(self): sdict = globals() |
self.editor.addElement(ui.Label(25, offset + 50, "Shaders:", "Shaders:", self.editor, False)) self.shaderpaths = ui.TextField(width, offset + 50, self.editor.width - (45 + width), 20, "ShaderPathText", self.shaderPathList, self.editor, True) self.shaderBrowse = ui.Button(self.binarypath.x + self.binarypath.width + 2, o... | self.editor.addElement(ui.Label(5, 140, "Shaders:", "Shader Search Paths:", self.editor, False)) self.shaderpaths = ui.TextField(5,165, self.editor.width - 45 , 20, "ShaderPathText", self.shaderPathList, self.editor, True) self.shaderBrowse = ui.Button(self.shaderpaths.x + self.shaderpaths.width + 2, 165, 30, 20, "Shad... | def __init__(self): sdict = globals() |
self.editor.addElement(ui.Label(25, offset + 75, "Textures:", "Textures:", self.editor, False)) self.texturepaths = ui.TextField(width, offset + 75, self.editor.width - (45 + width), 20, "TexturePathText", self.texturePathList, self.editor, True) self.textureBrowse = ui.Button(self.binarypath.x + self.binarypath.width ... | def __init__(self): sdict = globals() | |
self.editor.addElement(ui.Label(25, offset + 200, "Output Path:", "Output Path:", self.editor, False)) self.outputpath = ui.TextField(width, offset + 200, self.editor.width - (45 + width), 20, "OutputPathText", self.outputPath, self.editor, True) self.outputBrowse = ui.Button(self.outputpath.x + self.outputpath.width +... | self.editor.addElement(ui.Label(5, 190, "Output Path:", "Output Path:", self.editor, False)) self.outputpath = ui.TextField(5, 215, self.editor.width - 45, 20, "OutputPathText", self.outputPath, self.editor, True) self.outputBrowse = ui.Button(self.outputpath.x + self.outputpath.width + 2, 215, 30, 20, "OutputBrowse", ... | def __init__(self): sdict = globals() |
self.binaryPath = settings["Binaries"] | def getSettings(self, button): # let's try the Registry! try: settings = Blender.Registry.GetKey("BtoR", True) # check everywhere for BtoR settings. except: settings = False if settings: # settings were found, btor was setup previously, let's get the information self.haveSetup = True # I've got the information self.re... | |
self.texturePathList = settings["Textures"] self.displayPathList = settings["Displays"] self.archivePathList = settings["Archives"] self.proceduralPathList = settings["Procedurals"] | def getSettings(self, button): # let's try the Registry! try: settings = Blender.Registry.GetKey("BtoR", True) # check everywhere for BtoR settings. except: settings = False if settings: # settings were found, btor was setup previously, let's get the information self.haveSetup = True # I've got the information self.re... | |
self.binaryPath = r'C:\Program Files\Aqsis\\bin' | def getSettings(self, button): # let's try the Registry! try: settings = Blender.Registry.GetKey("BtoR", True) # check everywhere for BtoR settings. except: settings = False if settings: # settings were found, btor was setup previously, let's get the information self.haveSetup = True # I've got the information self.re... | |
self.texturePathList = r"C:\Program Files\Aqsis\Textures" self.displayPathList = r"C:\Program Files\Aqsis\Displays" self.archivePathList = r"C:\Program Files\Aqsis\Archives" self.proceduralPathList = r"C:\Program Files\Aqsis\Procedurals" | def getSettings(self, button): # let's try the Registry! try: settings = Blender.Registry.GetKey("BtoR", True) # check everywhere for BtoR settings. except: settings = False if settings: # settings were found, btor was setup previously, let's get the information self.haveSetup = True # I've got the information self.re... | |
self.binaryPath = r"/usr/aqsis/bin" | def getSettings(self, button): # let's try the Registry! try: settings = Blender.Registry.GetKey("BtoR", True) # check everywhere for BtoR settings. except: settings = False if settings: # settings were found, btor was setup previously, let's get the information self.haveSetup = True # I've got the information self.re... | |
self.texturePathList = r"/usr/aqsis/textures" self.displayPathList = r"/usr/aqsis/displays" self.archivePathList = r"/usr/aqsis/archives" self.proceduralPathList = r"/usr/aqsis/procedurals" | def getSettings(self, button): # let's try the Registry! try: settings = Blender.Registry.GetKey("BtoR", True) # check everywhere for BtoR settings. except: settings = False if settings: # settings were found, btor was setup previously, let's get the information self.haveSetup = True # I've got the information self.re... | |
"Binaries" : self.binarypath.getValue(), | def saveSettings(self, button): # save the settings to the registry here. Mostly it's simple stuff, will probably expand, # but for a first release, this should work OK #print self.rendererMenu.getValue() settings = { "renderer" : self.rendererMenu.getValue(), "Binaries" : self.binarypath.getValue(), "Shaders" : self.s... | |
"Archives" : self.archivepaths.getValue(), "Textures" : self.texturepaths.getValue(), "Procedurals" : self.proceduralpaths.getValue(), "Displays" : self.displaypaths.getValue(), | def saveSettings(self, button): # save the settings to the registry here. Mostly it's simple stuff, will probably expand, # but for a first release, this should work OK #print self.rendererMenu.getValue() settings = { "renderer" : self.rendererMenu.getValue(), "Binaries" : self.binarypath.getValue(), "Shaders" : self.s... | |
self.binarypath.setValue(self.binaryPath) | def update(self, obj): self.rendererMenu.setValue(self.rendererMenu.menu.index(self.renderer)) self.useSlParams.setValue(self.use_slparams) self.binarypath.setValue(self.binaryPath) self.shaderpaths.setValue(self.shaderPathList) self.texturepaths.setValue(self.texturePathList) self.displaypaths.setValue(self.displayPat... | |
self.texturepaths.setValue(self.texturePathList) self.displaypaths.setValue(self.displayPathList) self.proceduralpaths.setValue(self.proceduralPathList) self.archivepaths.setValue(self.archivePathList) | def update(self, obj): self.rendererMenu.setValue(self.rendererMenu.menu.index(self.renderer)) self.useSlParams.setValue(self.use_slparams) self.binarypath.setValue(self.binaryPath) self.shaderpaths.setValue(self.shaderPathList) self.texturepaths.setValue(self.texturePathList) self.displaypaths.setValue(self.displayPat... | |
if self.activeButton == self.binaryBrowse: self.binaryPath = path elif self.activeButton == self.shaderBrowse: | if self.activeButton == self.shaderBrowse: | def select(self, file): path = os.path.dirname(file) if self.activeButton == self.binaryBrowse: self.binaryPath = path elif self.activeButton == self.shaderBrowse: self.shaderPathList = path elif self.activeButton == self.textureBrowse: self.texturePathList = path elif self.activeButton == self.displayBrowse: self.disp... |
elif self.activeButton == self.textureBrowse: self.texturePathList = path elif self.activeButton == self.displayBrowse: self.displayPathList = path elif self.activeButton == self.proceduralBrowse: self.proceduralPathList = path elif self.activeButton == self.archiveBrowse: self.archivePathList = path | def select(self, file): path = os.path.dirname(file) if self.activeButton == self.binaryBrowse: self.binaryPath = path elif self.activeButton == self.shaderBrowse: self.shaderPathList = path elif self.activeButton == self.textureBrowse: self.texturePathList = path elif self.activeButton == self.displayBrowse: self.disp... | |
ri.RiDisplay("+" + variable.passName.getValue() + "_cam_" + cam + "_frame_" + frame + ".tif", "file", variable.passMode.getValue(), params) | ri.RiDisplay("+" + variable.passName.getValue() + "_cam_%d" % cam + "_frame_%d" % frame + ".tif", "file", variable.passMode.getValue(), params) | def renderScene(self): """ export/render the whole scene """ paths = self.settings.shaderpaths.getValue().split(";") self.lighting = globals()["instBtoRLightManager"] outputPath = self.exportPath.getValue() # get the value from *here*, THIS object if not os.path.exists(outputPath): os.mkdir(outputPath) if not os.path.... |
height = 20 pass class PathProperty(Property): protocols.advise(instancesProvide=[IProperty], asAdapterForTypes=[BtoRPath]) | def getValue(self): return self.editor.value.getValue() | |
paths = self.shaderpaths.getValue().split(";") | self.paths = self.shaderpaths.getValue().split(";") | def __init__(self): self.options = {"Renderer":["Renderer:", { "Aqsis":"aqsis", "BMRT":"bmrt", "Pixie":"Pixie", "3Delight":"renderdl", "RenderDotC":"wrendrdc" }], "UseSlParams":["Use CGKIT Slparams?", True], "RenderMatsStartup":["Render Mats on Startup?", True]} sdict = globals() |
print "iterating shaders!" | def getShaderSourceList(self, shaderPath): # maybe add some iterative thing here that pops up a progress bar # reset the shader lists path = shaderPath.strip() # test for a valid path, and bail if not valid if os.path.exists(path): | |
if len(self.shadersSurface) > 0: print "Surface Shaders:" print self.shadersSurface if len(self.shadersImager) > 0: print "Imager Shaders:" print self.shadersImager if len(self.shadersDisplacement) > 0: print "Displacement Shaders:" print self.shadersDisplacement if len(self.shadersLight) > 0: print "Light Shaders:" pr... | def getShaderSourceList(self, shaderPath): # maybe add some iterative thing here that pops up a progress bar # reset the shader lists path = shaderPath.strip() # test for a valid path, and bail if not valid if os.path.exists(path): | |
self.editorPanel.removeElement(self.objectEditorPanel) | self.editorPanel.removeElement(self.objEditorPanel) | def noPanel(self): self.editorPanel.removeElement(self.objectEditorPanel) |
self.objectName.setValue("None Selected") self.objectType.setValue("No Type") | self.objectName.setValue("None Selected") | def getSelected(self): if self.editorPanel in self.evt_manager.elements: #only if this instance is up and running. if self.selectionChanged(): try: objects = Blender.Object.GetSelected() # got nothing # get the first object if len(objects) < 1: self.objectName.isVisible = True self.objectMenu.isVisible = False |
self.objectMenu.isVisible = False self.objectType.setValue("No Type") | self.objectMenu.isVisible = False | def getSelected(self): if self.editorPanel in self.evt_manager.elements: #only if this instance is up and running. if self.selectionChanged(): try: objects = Blender.Object.GetSelected() # got nothing # get the first object if len(objects) < 1: self.objectName.isVisible = True self.objectMenu.isVisible = False |
if not found: self.evt_manager.showConfirmDialog("No " + self.s_type + " shaders found!", "There were no " + self.s_type + "shaders found on the selected shader path!", None, False) | if not found: self.evt_manager.showConfirmDialog("No " + self.stype + " shaders found!", "There were no " + self.s_type + "shaders found on the selected shader path!", None, False) | def makeShaderMenu(self): # get the current shader path path = self.searchPaths.getValue() self.shadersMenu = [] self.shadersMenu.append("None Selected") if self.stype == "surface": if not self.settings.shadersSurface.has_key(path): found = False elif len(self.settings.shadersSurface[path]) < 1: found = False else: sel... |
print panel | def update(self, obj): self.rendererMenu.setValue(self.rendererMenu.menu.index(self.renderer)) self.useSlParams.setValue(self.use_slparams) self.outputpath.setValue(self.outputPath) self.paths = [] self.pathsScroller.clearElements() for path in self.paths: panel = self.addPath(None, False) print panel panel.pathName.se... | |
ri.RiOption("limits" "integer eyesplits", eyeSplits) | ri.RiOption("limits", "integer eyesplits", eyeSplits) | def renderShadowMap(self, light, direction, shadowRIB, shadowName, shadowFile): print "Rendering shadowmap for ", light.objData["name"], "direction ", direction self.lightDebug = False if self.toFile: ri.RiBegin(shadowRIB) elif self.toRender: ri.RiBegin(self.settings.renderers[self.settings.renderer][0]) elif self.toC... |
shaderPath = self.settings.getShaderSearchPath()[0] | shaderPath = self.settings.getShaderSearchPaths()[0] | def initObjectData(self): self.objData = {} self.objData["name"] = self.object.getName() self.objData["type"] = self.object.getType() self.shader_type = "light" # figure out the type of lamp, and accordingly use the basic types available via BML shaderParms = {} lamp = self.object.getData() x = self.object.matrix[3][... |
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) | cmd_string = subprocess.list2cmdline(cmd) p = subprocess.Popen(cmd_string, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) | def execute(cmd): """Execute a command and return its output. cmd is a sequence of strings containing the executable name followed by it's arguments. The return value is a tuple (retval,stdout,stderr) where retval is an integer with the return value of the command and stdout, stderr are both lists containing the outp... |
retval,out,err = execute( (self.renderer, ribname) ) | retval,out,err = execute( self.renderer + [ribname] ) | def render(self, job): """Render a RIB file and return a RenderResult object.""" |
retval,out,err = execute( (self.shadercompiler, shname) ) | retval,out,err = execute( self.shadercompiler + [shname] ) | def compileShader(self, shader): """Compile a shader and return the stdout/stderr buffers. """ |
retval,out,err = execute( (self.shadercompiler, self.scversionopt) ) | retval,out,err = execute( self.shadercompiler + [self.scversionopt] ) | def shaderCompilerVersion(self): """Return the version string of the shading language compiler.""" if self.scversionopt==None: return "<unknown>" retval,out,err = execute( (self.shadercompiler, self.scversionopt) ) return string.join(out,"") |
retval,out,err = execute( (self.renderer, self.rversionopt) ) | retval,out,err = execute( self.renderer + [self.rversionopt] ) | def rendererVersion(self): """Return the version string of the renderer.""" |
setattr(self.shader.shader, "sfpx", params["px"]["shadowName"]) | self.shader.setParamValue("sfpx", params["px"]["shadowName"]) | def setShadowParms(self, params): shadername = self.shader.shader.shadername if shadername == "shadowpoint": setattr(self.shader.shader, "sfpx", params["px"]["shadowName"]) #print "Shadowmap: ", getattr(self.shader.shader, "sfpx") setattr(self.shader.shader, "sfpy", params["py"]["shadowName"]) #print "Shadowmap: ", get... |
setattr(self.shader.shader, "sfpy", params["py"]["shadowName"]) | self.shader.setParamValue("sfpy", params["py"]["shadowName"]) | def setShadowParms(self, params): shadername = self.shader.shader.shadername if shadername == "shadowpoint": setattr(self.shader.shader, "sfpx", params["px"]["shadowName"]) #print "Shadowmap: ", getattr(self.shader.shader, "sfpx") setattr(self.shader.shader, "sfpy", params["py"]["shadowName"]) #print "Shadowmap: ", get... |
setattr(self.shader.shader, "sfpz", params["pz"]["shadowName"]) | self.shader.setParamValue("sfpz", params["pz"]["shadowName"]) | def setShadowParms(self, params): shadername = self.shader.shader.shadername if shadername == "shadowpoint": setattr(self.shader.shader, "sfpx", params["px"]["shadowName"]) #print "Shadowmap: ", getattr(self.shader.shader, "sfpx") setattr(self.shader.shader, "sfpy", params["py"]["shadowName"]) #print "Shadowmap: ", get... |
setattr(self.shader.shader, "sfnx", params["nx"]["shadowName"]) | self.shader.setParamValue("sfnx", params["nx"]["shadowName"]) | def setShadowParms(self, params): shadername = self.shader.shader.shadername if shadername == "shadowpoint": setattr(self.shader.shader, "sfpx", params["px"]["shadowName"]) #print "Shadowmap: ", getattr(self.shader.shader, "sfpx") setattr(self.shader.shader, "sfpy", params["py"]["shadowName"]) #print "Shadowmap: ", get... |
setattr(self.shader.shader, "sfny", params["ny"]["shadowName"]) | self.shader.setParamValue("sfny", params["ny"]["shadowName"]) | def setShadowParms(self, params): shadername = self.shader.shader.shadername if shadername == "shadowpoint": setattr(self.shader.shader, "sfpx", params["px"]["shadowName"]) #print "Shadowmap: ", getattr(self.shader.shader, "sfpx") setattr(self.shader.shader, "sfpy", params["py"]["shadowName"]) #print "Shadowmap: ", get... |
setattr(self.shader.shader, "sfnz", params["nz"]["shadowName"]) | self.shader.setParamValue("sfnz", params["nz"]["shadowName"]) | def setShadowParms(self, params): shadername = self.shader.shader.shadername if shadername == "shadowpoint": setattr(self.shader.shader, "sfpx", params["px"]["shadowName"]) #print "Shadowmap: ", getattr(self.shader.shader, "sfpx") setattr(self.shader.shader, "sfpy", params["py"]["shadowName"]) #print "Shadowmap: ", get... |
setattr(self.shader.shader, "shadowname", params["shadow"]["shadowName"]) | self.shader.setParamValue("shadowname", params["shadow"]["shadowName"]) | def setShadowParms(self, params): shadername = self.shader.shader.shadername if shadername == "shadowpoint": setattr(self.shader.shader, "sfpx", params["px"]["shadowName"]) #print "Shadowmap: ", getattr(self.shader.shader, "sfpx") setattr(self.shader.shader, "sfpy", params["py"]["shadowName"]) #print "Shadowmap: ", get... |
def hasValue(self, value): if value in self.menu: return self.menu.index(value) | def __init__(self, x, y, width, height, name, menu, parent, auto_register, enableArrowButton = True, enableMenuHeader = True, noSelect = False, baseButtonTitle = None, outlined = True, shadowed = True, fontsize = 'normal', custom = False, customPrompt = "None", customFunc = None, noButton = False): self.expanded = Fals... | |
def getValueIndex(self, value): if value in self.menu: return self.menu.index(value) else: return -1 | def registerCallbackForElementIndex(self, idx, signal, callback): self.panel.elements[idx].registerCallback(signal, callback) | |
self.image = image | if image != None: self.image = image self.bindCode = self.image.getBindCode() self.unbound = False else: self.image = None self.bindCode = 0 self.unbound = True def bindImage(self): self.bindCode = self.image.getBindCode() | def __init__(self, x, y, width, height, image, parent, auto_register): UIElement.__init__(self, x, y, width, height, "Image", "image", parent, auto_register) self.image = image |
size = self.image.getSize() if size[0] <> self.width or size[1] <> self.height: x_scale = float(self.width) / float(size[0]) y_scale = float(self.height) / float(size[1]) if x_scale > y_scale: zoom = x_scale | if self.useOpenGLTextures: self.validate() if self.unbound: self.bindCode = self.image.getBindCode() if self.bindCode == 0: self.unbound = True if not self.unbound: gl.glBindTexture(gl.GL_TEXTURE_2D, self.bindCode) gl.glTexEnvf(gl.GL_TEXTURE_ENV, gl.GL_TEXTURE_ENV_MODE, gl.GL_DECAL) gl.glEnable(gl.GL_TEXTURE_2D) gl.... | def draw(self): self.validate() size = self.image.getSize() if size[0] <> self.width or size[1] <> self.height: # I need to zoom the image # figure out the correct zoom ratio x_scale = float(self.width) / float(size[0]) y_scale = float(self.height) / float(size[1]) if x_scale > y_scale: zoom = x_scale else: zoom = y_sc... |
zoom = y_scale Blender.Draw.Image(self.image, self.absX, self.absY, zoom, zoom) else: Blender.Draw.Image(self.image, self.absX, self.absY) | Blender.Draw.Image(self.image, self.absX, self.absY) | def draw(self): self.validate() size = self.image.getSize() if size[0] <> self.width or size[1] <> self.height: # I need to zoom the image # figure out the correct zoom ratio x_scale = float(self.width) / float(size[0]) y_scale = float(self.height) / float(size[1]) if x_scale > y_scale: zoom = x_scale else: zoom = y_sc... |
if self.parent == None: self.absX = self.x self.absY = self.y - self.height | if self.useOpenGLTextures: if self.parent == None: self.absX = self.x self.absY = self.y else: self.absX = self.parent.absX + self.x self.absY = self.parent.absY - self.y | def validate(self): # apply transforms to the x,y values of this object using the parent's absolute locations if self.invalid: # cascade invalidations down the chain of contained elements for element in self.elements: element.invalid = True # image elements are different. images draw UP rather than down, so y indicates... |
self.absX = self.parent.absX + self.x self.absY = self.parent.absY - (self.y + self.height) | if self.parent == None: self.absX = self.x self.absY = self.y - self.height else: self.absX = self.parent.absX + self.x self.absY = self.parent.absY - (self.y + self.height) | def validate(self): # apply transforms to the x,y values of this object using the parent's absolute locations if self.invalid: # cascade invalidations down the chain of contained elements for element in self.elements: element.invalid = True # image elements are different. images draw UP rather than down, so y indicates... |
ri.RiBegin(self.settings.renderer) | ri.RiBegin(self.settings.renderers[self.settings.renderer][0]) | def renderEnvMap(self, obj, direction, envRIB, envName, envFile): if self.toFile: ri.RiBegin(envRIB) elif self.toRender: ri.RiBegin(self.settings.renderer) elif self.toCustom: ri.RiBegin(self.exportTarget.getValue()) else: ri.RiBegin() # for pipeline command later paths = self.settings.shaderpaths.getValue().split(";"... |
ri.RiBegin(self.settings.renderer) | ri.RiBegin(self.settings.renderers[self.settings.renderer][0]) | def renderShadowMap(self, light, direction, shadowRIB, shadowName, shadowFile): print "Rendering shadowmap for ", light.objData["name"], "direction ", direction self.lightDebug = False if self.toFile: ri.RiBegin(shadowRIB) elif self.toRender: ri.RiBegin(self.settings.renderer) elif self.toCustom: ri.RiBegin(self.export... |
self.evt_manager.showConfirmDialog("No " + self.stype + " shaders found!", "There were no " + self.s_type + "shaders found on the selected shader path!", None, False) | self.evt_manager.showConfirmDialog("No " + self.stype + " shaders found!", "There were no " + self.stype + "shaders found on the selected shader path!", None, False) | def makeShaderMenu(self): # get the current shader path print "Fetching shader data for ", self.stype, " shaders on path ", self.searchPaths.getValue() path = self.searchPaths.getValue() |
if self.s_type == "light": | if self.stype == "light": | def makeShaderMenu(self): self.shadersMenu = [] path = self.searchPaths.getValue() self.shadersMenu.append("None Selected") found = False if self.s_type == "light": if not self.settings.shadersLight.has_key(path): found = False print "setting found to False at key test" elif len(self.settings.shadersLight[path]) < 1: f... |
self.evt_manager.showConfirmDialog("No " + self.s_type + " shaders found!", "There were no " + self.s_type + "shaders found on the selected shader path!", None, False) | self.evt_manager.showConfirmDialog("No " + self.stype + " shaders found!", "There were no " + self.s_type + "shaders found on the selected shader path!", None, False) | def makeShaderMenu(self): self.shadersMenu = [] path = self.searchPaths.getValue() self.shadersMenu.append("None Selected") found = False if self.s_type == "light": if not self.settings.shadersLight.has_key(path): found = False print "setting found to False at key test" elif len(self.settings.shadersLight[path]) < 1: f... |
self.paths = self.shaderpaths.getValue().split(";") | paths = self.shaderpaths.getValue().split(";") | def __init__(self): self.options = {"Renderer":["Renderer:", { "Aqsis":"aqsis", "BMRT":"bmrt", "Pixie":"Pixie", "3Delight":"renderdl", "RenderDotC":"wrendrdc" }], "UseSlParams":["Use CGKIT Slparams?", True], "RenderMatsStartup":["Render Mats on Startup?", True]} sdict = globals() |
def accumulatorFunction(target, source, env): """Function called when builder is called""" destDir = str(target[0]) if not os.path.exists(destDir): os.makedirs(destDir) for s in source: s = str(s) if os.path.isdir(s): myShutil.copytree(s, destDir, symlinks = False) else: shutil.copy2(s, destDir) def copytree(src, dest... | def zipperFunction(target, source, env): """Function to use as an action which creates a ZIP file from the arguments""" targetName = str(target[0]) sourceDir = str(source[0]) distutils.archive_util.make_archive(targetName, 'zip', sourceDir) | |
"render:float:patch_minlevel:none":["Patch Min Level:", 1], | "render:float:patch_minlevel:none":["Patch Min Level:", 1, 1], | def loadProperties(self, xml): xmlTypes = { "int" : int, "str" : str, "list" : list, "dict": dict, "float" : float, "bool": bool } xmlProperties = xml.getElementsByTagName("property") # what I should really do is move the properties from the object's UI to the object adapter, since that's really where I control the dat... |
if self.stickyToggle: for element in self.scroller.elements: if element <> button: element.set_state(False) button.set_state(True) else: if button.state == False: self.value = None else: for element in self.scroller.elements: if element <> button: | if 1 == 2: if self.stickyToggle: for element in self.scroller.elements: if element <> button: | def toggleOn(self, button): # sticky toggle keeps the button set, no matter what if self.stickyToggle: for element in self.scroller.elements: if element <> button: element.set_state(False) # simply set the state of this button and move on button.set_state(True) else: # print button.state if button.state == False: self.... |
self.value = button.name | button.set_state(True) else: if button.state == False: self.value = None else: for element in self.scroller.elements: if element <> button: element.set_state(False) self.value = button.name | def toggleOn(self, button): # sticky toggle keeps the button set, no matter what if self.stickyToggle: for element in self.scroller.elements: if element <> button: element.set_state(False) # simply set the state of this button and move on button.set_state(True) else: # print button.state if button.state == False: self.... |
self.scene = None | def __init__(self): self.options = {"Renderer":["Renderer:", { "Aqsis":"aqsis", "BMRT":"bmrt", "Pixie":"rndr", "3Delight":"renderdl", "RenderDotC":"wrendrdc" }, "aqsis"], "UseSlParams":["Use CGKIT Slparams?", True, True], "RenderMatsStartup":["Render Mats on Startup?", True, True]} sdict = globals() | |
panel.pathName.setValue(path) | panel.pathName.setValue(path[0]) panel.recurse.setValue(path[1]) | def selectRenderer(self, button): self.renderer = self.rendererMenu.getValue() # setup the search paths self.paths = [] self.pathsScroller.clearElements() for path in self.shaderPathList[self.renderer]: panel = self.addPath(None, False) panel.pathName.setValue(path) |
self.options = { | self.base_options = { | def __init__(self): self.options = { "ShadingRate" : ["Shading Rate:", 1.0], "PixelSamplesX":["Pixel Samples X:", 2], "PixelSamplesY":["Pixel Samples Y:", 2], "Gain":["Gain:", 1.0], "Gamma":["Gamma:", 1.0], "PixelFilter":["Pixel Filter:", {"Box":"box", "Triangle":"triangle", "Catmull-Rom":"catmull-rom", "Sinc":"sinc","... |
self.optionOrder = [ | self.base_optionOrder = [ | def __init__(self): self.options = { "ShadingRate" : ["Shading Rate:", 1.0], "PixelSamplesX":["Pixel Samples X:", 2], "PixelSamplesY":["Pixel Samples Y:", 2], "Gain":["Gain:", 1.0], "Gamma":["Gamma:", 1.0], "PixelFilter":["Pixel Filter:", {"Box":"box", "Triangle":"triangle", "Catmull-Rom":"catmull-rom", "Sinc":"sinc","... |
def resetProperties(self): self.scroller.clearElements() self.properties = {} self.editors = {} self.options = {} self.optionOrder = [] for option in self.base_optionOrder: self.optionOrder.append(option) for key in self.base_options: self.options[key] = self.base_options[key] self.setupRendererProperties() | def setupRendererProperties(self, xml = None, sysGlobal = None): rproperties = self.settings.getRendererOptions() if rproperties != None and len(rproperties) > 0: for prop in rproperties: self.options[prop] = rproperties[prop] # I probably don't care about ordering for the render properties, but their keys will keep t... | |
global Materials, ShaderTypeMenu, DeleteMaterial, Material, ShaderPath, DeleteShaderPath, BrowseButton, ShaderMenu, ShaderPathMenu, PreviewButton, RestoreButton | global Materials, ShaderTypeMenu, DeleteMaterial, Material, ShaderPath, DeleteShaderPath, BrowseButton, ShaderMenu, ShaderPathMenu global PreviewButton, RestoreButton, filebuttons, overridebuttons, ColorSpaceMenuStrings, ProjectionMenuStrings, SpaceMenuStrings | def shader_draw(): # button global variables global Materials, ShaderTypeMenu, DeleteMaterial, Material, ShaderPath, DeleteShaderPath, BrowseButton, ShaderMenu, ShaderPathMenu, PreviewButton, RestoreButton # event global variables global evt_material_delete, evt_path_delete, evt_browse_button, evt_preview_button, evt_... |
global haveValues, parameditors, paramvalues, parameditortypes, currentitem, filebuttons | global haveValues, parameditors, paramvalues, parameditortypes, currentitem | def shader_draw(): # button global variables global Materials, ShaderTypeMenu, DeleteMaterial, Material, ShaderPath, DeleteShaderPath, BrowseButton, ShaderMenu, ShaderPathMenu, PreviewButton, RestoreButton # event global variables global evt_material_delete, evt_path_delete, evt_browse_button, evt_preview_button, evt_... |
global highlighta, highlightb, color, ColorSpaceMenuStrings, ProjectionMenuStrings, SpaceMenuStrings, ColorSpaceList, ProjectList, SpaceList | global highlighta, highlightb, color, ColorSpaceList, ProjectList, SpaceList | def shader_draw(): # button global variables global Materials, ShaderTypeMenu, DeleteMaterial, Material, ShaderPath, DeleteShaderPath, BrowseButton, ShaderMenu, ShaderPathMenu, PreviewButton, RestoreButton # event global variables global evt_material_delete, evt_path_delete, evt_browse_button, evt_preview_button, evt_... |
if count > 1: if count % 2: color = highlighta else: color = highlightb idx = count - 2 eventidx = evt_shader_parm_modify + idx if haveValues == False: parameditors.append("") | e = parameditortypes[idx] if count >= currentitem and (currenty - scrolllayout[idx - 4]) > 25: if e == "float": if isinstance(thisVal, float): finit = thisVal else: print thisVal print x finit = thisVal.val currenty = currenty - 31 glColor3f(color[0], color[1], color[2]) glRecti(4, currenty - 4, 668, currenty + 24) gl... | def shader_draw(): # button global variables global Materials, ShaderTypeMenu, DeleteMaterial, Material, ShaderPath, DeleteShaderPath, BrowseButton, ShaderMenu, ShaderPathMenu, PreviewButton, RestoreButton # event global variables global evt_material_delete, evt_path_delete, evt_browse_button, evt_preview_button, evt_... |
tex = re.compile("tex") mapx = re.compile("map") if x[2] == "string" and (tex.search(x[4], 1) or mapx.search(x[4], 1)): parameditortypes.append("file") thisVal = cgkit.slparams.convertdefault(x) paramvalues.append(thisVal) | if e == "colorspace": currenty = currenty - 31 if isinstance(thisVal, basestring): for a in ColorSpaceList: icount = 1 if thisVal == a: xval = icount icount = icount + 1 else: xval = thisVal glColor3f(color[0], color[1], color[2]) glRecti(4, currenty - 4, 668, currenty + 24) glColor3f(1, 1, 1) glRasterPos2i(13, cur... | def shader_draw(): # button global variables global Materials, ShaderTypeMenu, DeleteMaterial, Material, ShaderPath, DeleteShaderPath, BrowseButton, ShaderMenu, ShaderPathMenu, PreviewButton, RestoreButton # event global variables global evt_material_delete, evt_path_delete, evt_browse_button, evt_preview_button, evt_... |
elif x[2] == "string": sval = cgkit.slparams.convertdefault(x) isMenu = False | if e == "projection": currenty = currenty - 31 if isinstance(thisVal, basestring): | def shader_draw(): # button global variables global Materials, ShaderTypeMenu, DeleteMaterial, Material, ShaderPath, DeleteShaderPath, BrowseButton, ShaderMenu, ShaderPathMenu, PreviewButton, RestoreButton # event global variables global evt_material_delete, evt_path_delete, evt_browse_button, evt_preview_button, evt_... |
if re.compile(a).search(sval, 1): parameditortypes.append("projection") isMenu = True for a in SpaceList: if re.compile(a).search(sval, 1): parameditortypes.append("space") isMenu = True for a in ColorSpaceList: if re.compile(a).search(sval, 1): parameditortypes.append("colorspace") isMenu = True if not isMenu: par... | icount = 1 if thisVal == a: xval = icount icount = icount + 1 else: xval = thisVal glColor3f(color[0], color[1], color[2]) glRecti(4, currenty - 4, 668, currenty + 24) glColor3f(1, 1, 1) glRasterPos2i(13, currenty + 4) stext = "Parameter: " + x[4] Text(stext) parameditors[idx] = Menu(ProjectionMenuStrings, eventidx, 1... | def shader_draw(): # button global variables global Materials, ShaderTypeMenu, DeleteMaterial, Material, ShaderPath, DeleteShaderPath, BrowseButton, ShaderMenu, ShaderPathMenu, PreviewButton, RestoreButton # event global variables global evt_material_delete, evt_path_delete, evt_browse_button, evt_preview_button, evt_... |
if not currentitem == 1: | if not currentitem == 0: | def shader_event(evt, val): # shader screen mouse/keyboard events global currentitem, scrolllayout if evt in [WHEELUPMOUSE, UPARROWKEY]: # scroll down if not currentitem == 1: currentitem = currentitem -1 Draw() if evt in [WHEELDOWNMOUSE, DOWNARROWKEY]: # scroll up if not currentitem == (len(scrolllayout) - 1): # find ... |
print "[openwebrx-spectrum] Spectrum thread initialized successfully. Thread id:", ctypes.CDLL('/lib/i386-linux-gnu/libc.so.6').syscall(224) | print "[openwebrx-spectrum] Spectrum thread initialized successfully." | def spectrum_thread_function(): global clients_mutex global clients dsp=getattr(plugins.dsp,cfg.dsp_plugin).plugin.dsp_plugin() dsp.set_demodulator("fft") dsp.set_samp_rate(cfg.samp_rate) dsp.set_fft_size(cfg.fft_size) dsp.set_fft_fps(cfg.fft_fps) sleep_sec=0.87/cfg.fft_fps print "[openwebrx-spectrum] Spectrum thread i... |
message = time.strftime('%d.%m.%y %H:%M:%S', time.localtime(time.time())) thread_id = thread.get_ident() message = message + ' Td.: '+str(thread_id) message = message + ' -- ' message = message + sDebugInfo | def DebugStr(self, sDebugInfo, iLevel=0): """Handles Debug-Output from all classes. | |
raise SystemExit | thread.exit() | def error(self, code, body): """Answer Client with an error page |
pManager.manager.DebugStr('cNetManager '+ __version__ +': Cant open owlfile for caching owls.', 0) | pManager.manager.DebugStr('cNetManager '+ __version__ +': Cant open file for caching owls.', 0) | def WriteCache(self): """Write neighbourowls to file""" |
pManager.manager.DebugStr('cNetManager '+ __version__ +': Caching neighbourowls.', 0) | pManager.manager.DebugStr('cNetManager '+ __version__ +': Caching neighbourowls.', 1) | def WriteCache(self): """Write neighbourowls to file""" |
pManager.manager.DebugStr('cProxyHandler '+ __version__ +': Detected explicit click. Title: '+str(self.ClickTitle)+' Status: '+str(self.ClickStatus)) | pManager.manager.DebugStr('cProxyHandler '+ __version__ +': Detected explicit click. Status: '+str(self.ClickStatus)) | def handle(self): """Get called by cProxyCore for each request""" |
self.Document.documentElement = None | def CleanElements(self): """Remove all elements despite root element.""" # create root element el = self.CreateElement(self.sRootElementName, {'version' : self.sVersion}, '') | |
lSessionFiles.sort() | def OpenSessions(self): """Read sessions into list.""" | |
pManager.manager.DebugStr('pClickstreamInterface '+ __version__ +': Closing current session.') | def CloseSession(self): """Close current session. | |
pManager.manager.DebugStr('cNeighbourOwl '+ __version__ +': Cant do RPC for '+str(self.IP)+':'+str(self.iPort)+'. Deleting owl from list of known owls.') | pManager.manager.DebugStr('cNeighbourOwl '+ __version__ +': Cant do RPC for '+str(self.IP)+':'+str(self.iPort)+'. Discarding owl.') | def Ping(self, sPing): """Ping owl""" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.