def postSolve_setViewportState(options, panel_objs, panel_node_type_vis): LOG.debug( 'postSolve_setViewportState: ' 'options=%r ' 'panel_objs=%r ' 'panel_node_type_vis=%r', options, panel_objs, panel_node_type_vis) if options.refresh is not True: return s = time.time() # Isolate Objects restore. for panel, objs in panel_objs.items(): if objs is None: # No original objects, disable 'isolate # selected' after resetting the objects. if options.do_isolate is True: viewport_utils.set_isolated_nodes(panel, [], False) else: if options.do_isolate is True: viewport_utils.set_isolated_nodes(panel, list(objs), True) # Show menu restore. for panel, node_types_vis in panel_node_type_vis.items(): for node_type, value in node_types_vis.items(): LOG.debug('turn on node_type=%r with value=%r', node_type, value) if value is None: continue viewport_utils.set_node_type_visibility(panel, node_type, value) e = time.time() LOG.debug('Finally; reset isolate selected; time=%r', e - s) return
def preSolve_setIsolatedNodes(actions_list, options, panels): """ Prepare frame solve Isolate all nodes used in all of the kwargs to be run. Note; This assumes the isolated objects are visible, but they may actually be hidden. """ if options.refresh is not True: return if options.do_isolate is True: isolate_nodes = set() for action in actions_list: kwargs = action.kwargs isolate_nodes |= collectionutils.generate_isolate_nodes(kwargs) if len(isolate_nodes) == 0: raise excep.NotValid isolate_node_list = list(isolate_nodes) for panel in panels: viewport_utils.set_isolated_nodes(panel, isolate_node_list, True) display_node_types = options.display_node_types if display_node_types is not None: assert isinstance(display_node_types, dict) for panel in panels: for node_type, value in display_node_types.items(): if value is None: continue assert isinstance(value, bool) viewport_utils.set_node_type_visibility(panel, node_type, value) return
def postSolve_setViewportState(options, panel_objs, panel_node_type_vis): """ Change the viewport state based on the ExecuteOptions given :param options: The execution options for the current solve. :type options: ExecuteOptions :param panel_objs: The panels and object to isolate, in a list of tuples. :type panel_objs: [(str, [str, ..] or None), ..] :param panel_node_type_vis: The panels and node-type visibility options in a list of tuples. :type panel_node_type_vis: [(str, {str: int or bool or None}), ..] """ if options.refresh is not True: return # Isolate Objects restore. for panel, objs in panel_objs.items(): if objs is None: # No original objects, disable 'isolate # selected' after resetting the objects. if options.do_isolate is True: viewport_utils.set_isolated_nodes(panel, [], False) else: if options.do_isolate is True: viewport_utils.set_isolated_nodes(panel, list(objs), True) # Show menu restore. for panel, node_types_vis in panel_node_type_vis.items(): for node_type, value in node_types_vis.items(): if value is None: continue viewport_utils.set_node_type_visibility(panel, node_type, value) return