Пример #1
0
 def accept(save=False):
     dia.acceptData()
     print("RESULTS", dia.results)
     if dia.results['render/mode'].startswith('smooth'):
         res = utils.subDict(dia.results, 'render/', strip=False)
         matname = dia.results['render/material']
         matdata = utils.subDict(dia.results, 'material/')
         # Currently, set both in cfg and Material db
         pf.cfg['material/%s' % matname] = matdata
         pf.GUI.materials[matname] = canvas.Material(matname, **matdata)
     else:
         res = utils.selectDict(dia.results,
                                ['render/mode', 'render/lighting'])
     res['_save_'] = save
     print("RES", res)
     updateSettings(res)
     print(pf.cfg)
     vp = pf.GUI.viewports.current
     vp.resetLighting()
     #if pf.cfg['render/mode'] != vp.rendermode:
     print("SETMODE %s %s" %
           (pf.cfg['render/mode'], pf.cfg['render/lighting']))
     vp.setRenderMode(pf.cfg['render/mode'], pf.cfg['render/lighting'])
     print(vp.rendermode, vp.settings.lighting)
     vp.update()
     toolbar.updateLightButton()
Пример #2
0
    def setCurrent(self,canv):
        """Make the specified viewport the current one.

        canv can be either a viewport or viewport number.
        """
        if type(canv) == int and canv in range(len(self.all)):
            canv = self.all[canv]
        if canv == self.current:
            return  # already current

        if canv in self.all:
            if self.current:
                self.current.focus = False
                self.current.updateGL()
            self.current = canv
            self.current.focus = True
            self.current.updateGL()
            toolbar.updateTransparencyButton()
            toolbar.updatePerspectiveButton()
            toolbar.updateLightButton()
Пример #3
0
 def accept(save=False):
     dia.acceptData()
     print("RESULTS",dia.results)
     if dia.results['render/mode'].startswith('smooth'):
         res = utils.subDict(dia.results,'render/',strip=False)
         matname = dia.results['render/material']
         matdata = utils.subDict(dia.results,'material/')
         # Currently, set both in cfg and Material db
         pf.cfg['material/%s' % matname] = matdata
         pf.GUI.materials[matname] = canvas.Material(matname,**matdata)
     else:
         res = utils.selectDict(dia.results,['render/mode','render/lighting'])
     res['_save_'] = save
     print("RES",res)
     updateSettings(res)
     print(pf.cfg)
     vp = pf.GUI.viewports.current
     vp.resetLighting()
     #if pf.cfg['render/mode'] != vp.rendermode:
     print("SETMODE %s %s" % (pf.cfg['render/mode'],pf.cfg['render/lighting']))
     vp.setRenderMode(pf.cfg['render/mode'],pf.cfg['render/lighting'])
     print(vp.rendermode,vp.settings.lighting)
     vp.update()
     toolbar.updateLightButton()
Пример #4
0
 def accept(save=False):
     dia.acceptData()
     print "RESULTS", dia.results
     if dia.results["render/mode"].startswith("smooth"):
         res = utils.subDict(dia.results, "render/", strip=False)
         matname = dia.results["render/material"]
         matdata = utils.subDict(dia.results, "material/")
         # Currently, set both in cfg and Material db
         pf.cfg["material/%s" % matname] = matdata
         pf.GUI.materials[matname] = canvas.Material(matname, **matdata)
     else:
         res = utils.selectDict(dia.results, ["render/mode", "render/lighting"])
     res["_save_"] = save
     print "RES", res
     updateSettings(res)
     print pf.cfg
     vp = pf.GUI.viewports.current
     vp.resetLighting()
     # if pf.cfg['render/mode'] != vp.rendermode:
     print "SETMODE %s %s" % (pf.cfg["render/mode"], pf.cfg["render/lighting"])
     vp.setRenderMode(pf.cfg["render/mode"], pf.cfg["render/lighting"])
     print vp.rendermode, vp.lighting
     vp.update()
     toolbar.updateLightButton()
Пример #5
0
def lights(state=True):
    """Set the lights on or off"""
    pf.canvas.setLighting(state)
    pf.canvas.update()
    toolbar.updateLightButton()
    pf.GUI.processEvents()
Пример #6
0
def renderMode(mode, avg=False):
    pf.canvas.setRenderMode(mode)
    pf.canvas.update()
    toolbar.updateNormalsButton()
    toolbar.updateLightButton()
    pf.GUI.processEvents()