def update_size(self): if not self.renderer_ready: return if self.use_fixed_res: size = (self.fixed_width, self.fixed_height) else: size = accel.getViewportSize() size = (int(size[0] * self.relative_res), int(size[1] * self.relative_res)) width = max(16, size[0]) height = max(16, size[1]) if width != self.img_width or height != self.img_height: print "Resizing (",self.img_width,",",self.img_height,") to (",width,",",height,")" self.img_width = width self.img_height = height self.vray_renderer.size = (width, height)
def update_size(self): if not self.renderer_ready: return if self.use_fixed_res: size = (self.fixed_width, self.fixed_height) else: size = accel.getViewportSize() size = (int(size[0] * self.relative_res), int(size[1] * self.relative_res)) width = max(16, size[0]) height = max(16, size[1]) if width != self.img_width or height != self.img_height: print "Resizing (", self.img_width, ",", self.img_height, ") to (", width, ",", height, ")" self.img_width = width self.img_height = height self.vray_renderer.size = (width, height)
def __init__(self, name): super(VRayRenderCallback, self).__init__(name) size = accel.getViewportSize() # getting this from the MoBu GL widget didn't give correct results self.img_width = max(16, size[0]) self.img_height = max(16, size[1]) self.use_fixed_res = False self.relative_res = 1.0 self.last_resize_check_time = time.clock() self.updates_blocked = False self.session = Session() self.counter = 0 self.last_presented_image = 0 self.lock = threading.Lock() self._init_custom_props() FBSystem().OnConnectionDataNotify.Add(self.OnConnectionDataNotify) FBApplication().OnFileExit.Add(self._unregister)
def __init__(self, name): super(VRayRenderCallback, self).__init__(name) size = accel.getViewportSize( ) # getting this from the MoBu GL widget didn't give correct results self.img_width = max(16, size[0]) self.img_height = max(16, size[1]) self.use_fixed_res = False self.relative_res = 1.0 self.last_resize_check_time = time.clock() self.updates_blocked = False self.session = Session() self.counter = 0 self.last_presented_image = 0 self.lock = threading.Lock() self._init_custom_props() FBSystem().OnConnectionDataNotify.Add(self.OnConnectionDataNotify) FBApplication().OnFileExit.Add(self._unregister)