def addClicked(self): col = lib_state.get_active_collection() if col is None: msg = 'Cannot add markers, active collection is not defined.' LOG.warning(msg) return sel = lib_maya_utils.get_scene_selection() mkr_list = lib_maya_utils.get_markers_from_selection() if len(mkr_list) == 0: msg = 'Please select objects, found no markers.' LOG.warning(msg) return lib_marker.add_markers_to_collection(mkr_list, col) def update_func(): if uiutils.isValidQtObject(self) is False: return self.dataChanged.emit() self.viewUpdated.emit() return # Add Callbacks callback_manager = self.callback_manager if callback_manager is not None: lib_marker.add_callbacks_to_markers(mkr_list, update_func, callback_manager) update_func() # Restore selection. lib_maya_utils.set_scene_selection(sel) return
def objectAddClicked(self): col = lib_state.get_active_collection() if col is None: msg = 'Cannot add markers, active collection is not defined.' LOG.warning(msg) return sel = lib_maya_utils.get_scene_selection() mkr_list = lib_maya_utils.get_markers_from_selection() if len(mkr_list) == 0: msg = 'Please select objects, found no markers.' LOG.warning(msg) return lib_marker.add_markers_to_collection(mkr_list, col) def update_func(): if uiutils.isValidQtObject(self) is False: return self.updateObjectToggleButtons() self.updateObjectColumnVisibility() self.updateObjectModel() self.updateSolveValidState() return # Add Callbacks callback_manager = self.getCallbackManager() if callback_manager is not None: lib_marker.add_callbacks_to_markers(mkr_list, update_func, callback_manager) update_func() # Restore selection. lib_maya_utils.set_scene_selection(sel) return
def addClicked(self): col = lib_state.get_active_collection() if col is None: msg = 'Cannot add markers, active collection is not defined.' LOG.warning(msg) return sel = lib_maya_utils.get_scene_selection() mkr_list = lib_maya_utils.get_markers_from_selection() if len(mkr_list) == 0: msg = 'Please select objects, found no markers.' LOG.warning(msg) return lib_marker.add_markers_to_collection(mkr_list, col) # Add Callbacks callback_manager = self.callback_manager if callback_manager is not None: lib_marker.add_callbacks_to_markers( mkr_list, callback_manager ) # Restore selection. lib_maya_utils.set_scene_selection(sel) return
def objectAddClicked(self): mkr_list = lib_maya_utils.get_markers_from_selection() if len(mkr_list) == 0: msg = 'Please select objects, found no markers.' LOG.warning(msg) return col = lib_state.get_active_collection() if col is None: msg = 'Cannot add markers, active collection is not defined.' LOG.warning(msg) return lib_marker.add_markers_to_collection(mkr_list, col) def update_func(): self.updateObjectModel() self.updateSolveValidState() self.setStatusLine(const.STATUS_READY) return # Add Callbacks callback_manager = self.getCallbackManager() if callback_manager is not None: lib_marker.add_callbacks_to_markers( mkr_list, update_func, callback_manager ) update_func() return