def expand_outliner_hierarchy(focus=False): sel = pm.ls(sl=True) # Store current focus panel current_panel = get_focus_panel() or [] # Get the ontliner from current scene vis_panels = pm.getPanel(vis=True) or [] outliner_panels = [] if vis_panels: for each in vis_panels: if "outlinerPanel" in each: outliner_panels.append(each) if outliner_panels: for each in outliner_panels: # If focus = True, will only expand hierarchy for the focus outliner if focus: # If the outliner panel does not equal the current pannel, continue the loop if each != current_panel: continue # Expand the outliner hierarchy for the selected node set_focus_panel(each) if sel: pm.outlinerEditor(each, edit=True, eas=True) # Return to previous focus panel set_focus_panel(current_panel)
def clean_outliner_command_script(): outliner_panels = pm.getPanel(typ='outlinerPanel') dirty_commands = ['look'] for each in outliner_panels: if pm.outlinerEditor(each.name(), q=True, selectCommand=True) in dirty_commands: pm.outlinerEditor(each.name(), e=True, selectCommand='')
def graphEditorFilter(self): ''' Create an itemFilterAttr to hide the display of coloredKey_ attributes in the graph editor. It will first delete any previous cKattrFilter if found. ''' filter = pmc.ls('cKattrFilter', exactType='objectMultiFilter') if filter: pmc.setAttr('cKattrFilter.disable', 1) pmc.delete('cKattrFilter') if self.filterGraphAction.isChecked(): cKattrFilter = pmc.itemFilterAttr('cKattrFilter', bn='coloredKey_*', negate=True) pmc.outlinerEditor('graphEditor1OutlineEd', edit=True, attrFilter=cKattrFilter)
def _build_graph_editor_pane(self, parent_layout): """ """ garph_editor_formLayout = pm.formLayout() pm.scriptedPanel(self.graph_editor, type='graphEditor') # Initialize custom selectionConnection for only FIZ nodes outliner_selectionConnection = pm.selectionConnection() # Create a custom outlineEditor and assign our mainListConnection # This way, the mFIZ outliner will only show mFIZ nodes oulineEditor_name = self.graph_editor + 'OutlineEd' pm.outlinerEditor( oulineEditor_name, # scriptedPanel name + 'OutlineEd' found with pm.lsUI(editors=True) edit=True, mainListConnection=outliner_selectionConnection) pm.formLayout(garph_editor_formLayout, edit=True, attachForm=[(self.graph_editor, "top", 3), (self.graph_editor, "bottom", 3), (self.graph_editor, "left", 3), (self.graph_editor, "right", 3)]) pm.setParent(parent_layout) # Set a 'keyable' filter on the outlineEditor to only show keyable attributes keyable_attr_filter = pm.itemFilterAttr(KEYABLE_ATTR_FILTER_NAME, keyable=True) pm.outlinerEditor(oulineEditor_name, edit=True, attrFilter=keyable_attr_filter) # Create a selectionConnection # sel_con = pm.selectionConnection(activeList=True, mainListConnection= # Store the selectionConnections to an instance attribute self.outliner_selection_connection = outliner_selectionConnection
def clean_outliner(): outliners = pm.getPanel(type='outlinerPanel') for outliner in outliners: pm.outlinerEditor(outliner, e=True, setFilter="defaultSetFilter")
lockatBtn = pm.symbolButton('lockatrBtn',p = 'ControlsForm',i = 'Lock_ON.png',w = 63,h=25,ebg =1 , bgc = [(.3),(.2),(.2)],en = 1) unlockatBtn = pm.symbolButton('unlockatrBtn',p = 'ControlsForm',i = 'Lock_OFF.png',w = 63,h=25,ebg =1 , bgc = [(.3),(.2),(.2)],en = 1) keyableBtn = pm.symbolButton('keyableAtBtn',p = 'ControlsForm',i = 'keyIntoclip.png',w = 63,h=25,ebg =1 , bgc = [(.3),(.2),(.2)],en = 1) hideBtn = pm.symbolButton('hideAtBtn',p = 'ControlsForm',i = 'RS_visible.png',w = 63,h=25,ebg =1 , bgc = [(.3),(.2),(.2)],en = 1) OnOffAttr = pm.button('OnOff',l= 'Off/On',p = 'ControlsForm',w = 63,h=19, bgc = [(.2),(.2),(.2)],hlc = [(.9),(.2),(.2)],en =1) ZeroOneAttr = pm.button('ZeroOneAtr',l= '0.0-1.0',p = 'ControlsForm',w = 63,h=19, bgc = [(.2),(.2),(.2)],hlc = [(.9),(.2),(.2)],en =1) ZeroTenAttr = pm.button('ZeroTenAtr',l= '0-10',p = 'ControlsForm',w = 63,h=19, bgc = [(.2),(.2),(.2)],hlc = [(.9),(.2),(.2)],en =1) IntAttr= pm.button('IntAtr',l= '0-1',p = 'ControlsForm',w = 63,h=19, bgc = [(.2),(.2),(.2)],hlc = [(.9),(.2),(.2)],en =1) EnumAttrBtn= pm.button('EnumAtr',l= 'Enum',p = 'ControlsForm',w = 132,h=19, bgc = [(.2),(.2),(.2)],hlc = [(.9),(.2),(.2)],en =1) StringAttrBtn= pm.button('StringAtr',l= 'String',p = 'ControlsForm',w = 132,h=19, bgc = [(.2),(.2),(.2)],hlc = [(.9),(.2),(.2)],en =1) outliner = pm.outlinerPanel(outpanel, query=True,outlinerEditor=True) pm.outlinerEditor( outliner, edit=True, mainListConnection='worldList', selectionConnection='modelList', showShapes=False, showReferenceNodes=False, showReferenceMembers=False, showAttributes=False, showConnected=False, showAnimCurvesOnly=False, autoExpand=False, showDagOnly=True, ignoreDagHierarchy=False, expandConnections=False, showNamespace=True, showCompounds=True, showNumericAttrsOnly=False, highlightActive=True, autoSelectNewObjects=False, doNotSelectNewObjects=False, transmitFilters=False, showSetMembers=True, setFilter='defaultSetFilter' ) pm.formLayout('Outliner',e =1,af=[(outpanel,'top',0),(outpanel,'left',0),(outpanel,'right',0),(outpanel,'bottom',0)]) pm.formLayout('ControlsForm',e=1, attachForm = [ (GlobalName,'top',8), (BaseCtlBtn,'top',45), (BaseCtlShapeBtn,'top',45), (Border01Btn,'right',10), (BaseCtlShapeBtn,'right',10),