def _on_slider_value_changed(self): if self._entity is None or not self.isEnabled(): return slider_value = state.get('current_slider_value') real_frame = get_real_frame(slider_value) body_mode = state.get('body_mode') if body_mode is BodyMode.PLAYBACK: closeup_camera = state.get('closeup_camera') state.cast( 'camera', 'request_shot_image', self._entity.get_id(), real_frame, closeup_camera=closeup_camera, delay=True ) elif body_mode is BodyMode.MODEL: job = state.get('current_job') if job is None: return state.cast( 'resolve', 'request_geometry', self._entity, real_frame ) self._playback_bar.on_slider_value_changed(slider_value)
def _new_project(self): if state.get('project_new_dialog'): result = popup(self, 'Create New Project', "Please input new project's name", 'Project Name') if result: state.cast('project', 'create_project', result) state.set('project_new_dialog', False)
def mousePressEvent(self, event): if event.button() == Qt.LeftButton: current_select = state.get('current_shot') if current_select != self._shot: state.cast('project', 'select_shot', self._shot) elif event.button() == Qt.RightButton: pos = self.mapToGlobal(event.pos()) self._menu.exec_(pos)
def _on_save(self): directory = str( QFileDialog.getExistingDirectory(self, "Select Directory")) if directory is not None and directory != '': state.cast( 'camera', 'request_save_image', state.get('current_slider_value') + state.get('offset_frame'), directory)
def _on_show(self): state.cast( 'camera', 'submit_shot', self._job_name, self._job_frames, self._job_parms )
def _get_rig_geo(self): job = state.get('current_job') body_mode = state.get('body_mode') if job is None or body_mode is not BodyMode.MODEL: return state.cast( 'resolve', 'request_geometry', job, None )
def _on_show(self): body_mode = state.get('body_mode') if body_mode is BodyMode.PLAYBACK: state.cast( 'camera', 'cache_whole_shot', state.get('closeup_camera') ) elif body_mode is BodyMode.MODEL: state.cast('resolve', 'cache_whole_job') state.set('caching', True)
def _on_show(self): offset_frame = state.get('offset_frame') frames = state.get('frames') state.cast( 'resolve', 'export_model', state.get('current_project'), state.get('current_shot'), state.get('current_job'), [f + offset_frame for f in frames], self._export_path )
def _update_shot_list(self): current_shot = state.get('current_shot') body_mode = state.get('body_mode') if (body_mode is BodyMode.MODEL and current_shot == self._shot and len(self._shot.jobs) > 0): if self._job_list is None: self._job_list = JobList(self._shot._jobs) self.addWidget(self._job_list) else: if self._job_list is not None: self._job_list.deleteLater() self._job_list = None state.cast('project', 'select_job', None)
def _submit(self): if self._is_server_on: shot = state.get('current_shot') if not shot.is_cali(): result = popup(dialog=ShotSubmitDialog) if result: popup(dialog=SubmitProgressDialog, dialog_args=(result['name'], result['frames'], result['parms'])) else: state.cast('camera', 'submit_shot', shot.name, [0], {}) else: self._check_server()
def _on_click(self, preset_type): if preset_type == 'Base': state.cast('camera', 'load_parameters', 'Base') elif preset_type == 'User': state.cast('camera', 'load_parameters', 'User') elif preset_type == 'Save': state.cast('camera', 'save_parameters')
def _update(self): body_mode = state.get('body_mode') if body_mode is BodyMode.MODEL: self.layout().setCurrentIndex(1) else: self.layout().setCurrentIndex(0) if body_mode is BodyMode.LIVEVIEW: state.cast('camera', 'offline') trigger = state.get('trigger') if trigger: state.cast('camera', 'live_view', True, scale_length=state.get('live_view_size'), close_up=state.get('closeup_camera')) elif state.get('live_view'): state.cast('camera', 'live_view', False)
def _on_slider_changed(self, value): if not state.get('parm_outside'): v = self._vmin + (self._vmax - self._vmin) * value / self._length state.cast('camera', 'change_parameter', self._name, v)
def _record(self): state.cast('camera', 'record')
def _trigger(self): state.cast('camera', 'retrigger')
def _load_project(): state.cast('project', 'select_project', state.get('project_list_select')) state.set('project_list_dialog', False)
def __init__(self): super().__init__() state.on_changed('cali_list', self._update) state.cast('project', 'update_cali_list')
def _check_server(self): state.cast('project', 'check_deadline_server')