rfm2  22.0
A python-based rewrite of RenderMan for Maya
rfm2.ui.aov.AovUI Class Reference
+ Inheritance diagram for rfm2.ui.aov.AovUI:
+ Collaboration diagram for rfm2.ui.aov.AovUI:

Public Member Functions

def __init__ (self, ui_parent, ui_prefix, bake)
 
def __del__ (self)
 
def valid_node_name (self, node_name)
 
def get_nodes_by_type (self, ntype, ignore_namespaced=True, all_nodes=False)
 
def delete_unused_aov_nodes (self)
 
def select_display (self, item, clear=False)
 
def selected_displays (self, return_items=False)
 
def selected_custom_channels (self)
 
def display_selected (self, display_only=False)
 
def channel_selected (self)
 
def delete_custom_channel (self, *_)
 
def rename_display_item (self, current_name, proposed_name)
 
def display_item_parent (self, item)
 
def do_rename_display_item (self, item, new_name)
 
def double_click_channels (self, *args)
 
def create_display_channel_node (self, channel_name, do_update, *_, **kwargs)
 
def create_new_display (self, *_)
 
def create_selected_displaychannels (self, *_)
 
def create_display_from_channel (self, channel)
 
def remove_from_display_list (self)
 
def connect_channel_to_display (self, channel_list, display=None)
 
def add_channel_to_display (self, *_)
 
def add_tree_view_item (self, ctl, item, label, parent, description='', ntypes=())
 
def drag_n_drop_display (self, ctlsuffix, *args)
 
def save_items_state (self, ctl)
 
def restore_item_state (self, ctl, item, state_dict)
 
def update_available_channel_list (self, glob_filter)
 
def update_display_list (self, glob_filter)
 
def available_select_callback (self, *args)
 
def display_select_callback (self, *args)
 
def list_selection_changed_callback (self, *_)
 
def update_inspector (self, selected_item)
 
def set_preset_display_params (self, dspy, data)
 
def add_preset_display (self, *args)
 
def unshare_channel (self, ch_node, dspy_node, *_)
 
def dspy_contextual_menu (self, treeview, popup, item)
 
def create_list_widget (self, ctl_name, label, search_func, select_func, **kwargs)
 
def create (self)
 
def update (self)
 

Public Attributes

 selected_list
 
 active_color
 
 inactive_color
 
 valid_node_re
 
 aov_node_types
 
 ornc
 
 ch_sep
 
 uiparent
 
 uiprefix
 
 bake
 
 globals
 
 plug
 

Constructor & Destructor Documentation

◆ __init__()

def rfm2.ui.aov.AovUI.__init__ (   self,
  ui_parent,
  ui_prefix,
  bake 
)

◆ __del__()

def rfm2.ui.aov.AovUI.__del__ (   self)

Member Function Documentation

◆ add_channel_to_display()

def rfm2.ui.aov.AovUI.add_channel_to_display (   self,
_ 
)
Create displayChannels (if need be) and connect them to the selected
display.

Args:
- *args (tuple): un-used.

Returns:
- None
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_preset_display()

def rfm2.ui.aov.AovUI.add_preset_display (   self,
args 
)
Create a fully configured display based on aovs.json. If the display
already exists (and we are not in batch mode), we ask the user what to do.
In batch mode, we just raise an error.

Args:
- name:  the display's name
- data:  the display's dict
- uiprefix: the current UI prefix.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_tree_view_item()

def rfm2.ui.aov.AovUI.add_tree_view_item (   self,
  ctl,
  item,
  label,
  parent,
  description = '',
  ntypes = () 
)
Add a treeView item. The item is named after the maya node and its label
is the channel source name.
+ Here is the caller graph for this function:

◆ available_select_callback()

def rfm2.ui.aov.AovUI.available_select_callback (   self,
args 
)
Called whenever a selection occurs in the available channels list.
Stores the current selection.
+ Here is the caller graph for this function:

◆ channel_selected()

def rfm2.ui.aov.AovUI.channel_selected (   self)
Return True if a channel is selected.

Args:
- uiprefix (str): the treeView control prefix

Returns:
- True if a channel is selected
+ Here is the caller graph for this function:

◆ connect_channel_to_display()

def rfm2.ui.aov.AovUI.connect_channel_to_display (   self,
  channel_list,
  display = None 
)
Connect a rmanDisplayChannel to a rmanDisplay to indicate that it will
contribute to this AOV. We trigger an update of the display list at the
end.

Args:
- channel_list (list): list of rmanDisplayChannel nodes to connect.
- display (str): the name of the display we should connect the channels to.
                If provided, we will ignore the UI selection.

Returns:
- True on success, False if no connection occured because there wasn't any
selected display.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

def rfm2.ui.aov.AovUI.create (   self)
Build the AOV configuration UI. This is the upper part of the UI,
without the selection inspector pane.

Args:
- uiroot (str): ui parent layout in which we will build. The parent will
                be restored at the end of the function.

Returns:
- None
+ Here is the call graph for this function:

◆ create_display_channel_node()

def rfm2.ui.aov.AovUI.create_display_channel_node (   self,
  channel_name,
  do_update,
_,
**  kwargs 
)
Create a new rmanDisplayChannel Node.
* if the channel name is 'Custom...', we create a blank (un-configured)
node. In interactive mode, we ask the user to name it first.
* Otherwise, we use the associated channel definition to configure the
newly created node.

Args:
- channel_name (str): the new node's name.
- do_update (str): trigger a channel list update if True.

Kwargs:
- if_exists=None (str): define policy if node already exists: 'reuse' or
'create'. The interactive dialog won't be displayed.

Returns:
- str: the node name
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_display_from_channel()

def rfm2.ui.aov.AovUI.create_display_from_channel (   self,
  channel 
)
Create a new display with a named channel.

Args:
- uiprefix (str): prefix of the layout hinting at the window kind.
- channel (str): name of the channel used by the new display.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_list_widget()

def rfm2.ui.aov.AovUI.create_list_widget (   self,
  ctl_name,
  label,
  search_func,
  select_func,
**  kwargs 
)
Build a compound widget with a label, a search field and a treeView
list.

Args:
- ctl_name (str): The base name of this control. Sub-control names will
derive from this.

Kwargs:
- double_click_func (func)
- edit_label_func (func)
- item_renamed_func (func)
- drag_and_drop_cmd (func)
- multi_selection (bool): default to False
- popup_func (func)

Returns:
- return_type: the widget's layout
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_new_display()

def rfm2.ui.aov.AovUI.create_new_display (   self,
_ 
)
Create a new rmanDisplay node and trigger an update of the display list.

Args:
- *args (tuple): un-used

Returns:
- None
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_selected_displaychannels()

def rfm2.ui.aov.AovUI.create_selected_displaychannels (   self,
_ 
)
Create one or more rmanDisplayChannel nodes based on the current
selection in the available channel list and trigger a channel list
update.

Args:
- *args (tuple): un-used.

Returns:
- List of created channel nodes
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete_custom_channel()

def rfm2.ui.aov.AovUI.delete_custom_channel (   self,
_ 
)
Delete selected custom displayChannels and refresh the UI.

Args:
- args: passed by Maya but ignored.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete_unused_aov_nodes()

def rfm2.ui.aov.AovUI.delete_unused_aov_nodes (   self)
Delete any display, channel or driver left un-connected in the scene.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ display_item_parent()

def rfm2.ui.aov.AovUI.display_item_parent (   self,
  item 
)
Return the parent item (the display) of a given item (a displayChannel).
None if at the root.

Arguments:
    item {str} -- the treeView item (NOT the label)

Returns:
    str -- the parent treeView item.

◆ display_select_callback()

def rfm2.ui.aov.AovUI.display_select_callback (   self,
args 
)
Called whenever a selection occurs in the display list. Stores the
current selection.
+ Here is the caller graph for this function:

◆ display_selected()

def rfm2.ui.aov.AovUI.display_selected (   self,
  display_only = False 
)
True if a display is currently selected.

Kwargs:
- display_only:  True if we are only interested in the display, not the \
displayChannels.

Returns:
- True if selected.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_rename_display_item()

def rfm2.ui.aov.AovUI.do_rename_display_item (   self,
  item,
  new_name 
)
Rename the display or channel as new_name.

Arguments:
    uiprefix {str} -- the ui prefix
    item {str} -- the treeView item, most likely a label.
    new_name {str} -- new valid name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ double_click_channels()

def rfm2.ui.aov.AovUI.double_click_channels (   self,
args 
)
Add a channel to a selected display or create a new channel from the
double-clicked channel.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drag_n_drop_display()

def rfm2.ui.aov.AovUI.drag_n_drop_display (   self,
  ctlsuffix,
args 
)
Implements drag and drop inside the display list. We support re-ordering
and transferring channels to a different display.

Args:
- uiprefix (str): the current UI prefix.
- ctlsuffix (str): a suffix for the control name.
- dropped_items (list): items that were dropped.
- prev_parents (list): previous parents of the dropped items.
- prev_idxs (list): previous indices of dropped items.
- new_parent (str): new parent under which items were dropped.
- item_above (str): the items above the drop location.
- item_below (str): the items below the drop location.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dspy_contextual_menu()

def rfm2.ui.aov.AovUI.dspy_contextual_menu (   self,
  treeview,
  popup,
  item 
)
Populate the display list contextual menu to toggle params, copy and
paste settings, etc.

Arguments:
    treeview {str} -- treeView widget of the display list.
    popup {str} -- popup menu widget the items should be parented to.
    item {str} -- the item over which the contextual menu was invoked.

Returns:
    bool -- True if the event was handled.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_nodes_by_type()

def rfm2.ui.aov.AovUI.get_nodes_by_type (   self,
  ntype,
  ignore_namespaced = True,
  all_nodes = False 
)
Return a list of ntype nodes in the scene, with an option to take
namespaces into account.

Arguments:
    ntype {str} -- node type we want

Keyword Arguments:
    ignore_namespaced {bool} -- ignore namespaced nodes (default: {True})

Returns:
    list -- The list of nodes
+ Here is the caller graph for this function:

◆ list_selection_changed_callback()

def rfm2.ui.aov.AovUI.list_selection_changed_callback (   self,
_ 
)
Called by the treeView whenever the user selection changes. We update
both list as well as the buttons' states and the inspector layout
displaying the selection's parameters.

Args:
- args (str): passed by Maya but ignored.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_from_display_list()

def rfm2.ui.aov.AovUI.remove_from_display_list (   self)
Remove an entry from the display list. The entry could either be a
display or a displaychannel.
- display: we simply delete the display node.
- displayChannel: we list connected nodes are re-connect them to the array
                plugs to maintain their order. The array is sparse as
                usual and if we don't do this the next insertion will
                happen at the first available position.

Args:
- uiprefix (str): prefix of the layout hinting at the window kind.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rename_display_item()

def rfm2.ui.aov.AovUI.rename_display_item (   self,
  current_name,
  proposed_name 
)
Validates an item renaming opration.
* This is called by maya.cmds.treeView to validate the new name.
* If the proposed name is invalid, we simply warn the user instead of
raising an exception.

Args:
- current_name (str): current node name.
- proposed_name (str): potential new node name.

Returns:
- str: The new name if valid.
- None: If the new name isn't a valid maya node name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ restore_item_state()

def rfm2.ui.aov.AovUI.restore_item_state (   self,
  ctl,
  item,
  state_dict 
)
Restore the expanded state of each parent item.
+ Here is the caller graph for this function:

◆ save_items_state()

def rfm2.ui.aov.AovUI.save_items_state (   self,
  ctl 
)
Save the expanded state of each parent item.
+ Here is the caller graph for this function:

◆ select_display()

def rfm2.ui.aov.AovUI.select_display (   self,
  item,
  clear = False 
)
Select an item in the display list.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selected_custom_channels()

def rfm2.ui.aov.AovUI.selected_custom_channels (   self)
Return a list of selected custom channels. Return [] if none selected.
+ Here is the caller graph for this function:

◆ selected_displays()

def rfm2.ui.aov.AovUI.selected_displays (   self,
  return_items = False 
)
Return the names of the selected display nodes.

Returns:
- A list of items matching maya node names.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_preset_display_params()

def rfm2.ui.aov.AovUI.set_preset_display_params (   self,
  dspy,
  data 
)
Sets the parameters on the nodes of a newly created display. We run this
function using maya.utils.executeDeferred() to allow the node's
postContructor() to run and finish the nodes' setup before we start making
modifications.

Args:
- dspy (str): name of the display node
- data (dict): {param: value} dict to configure the display and the display
            driver.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unshare_channel()

def rfm2.ui.aov.AovUI.unshare_channel (   self,
  ch_node,
  dspy_node,
_ 
)
If a channel is connected to more than one display, make copies to
un-share them.

Arguments:
    uiprefix {str} -- current UI prefix
    ch_node {str} -- rmanDisplayChannel node name
    dspy_node {str} -- the name of the rmanDisplay node
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

def rfm2.ui.aov.AovUI.update (   self)
Refresh the pre-built AOV configuration UI. We assume there is only one
instance of this UI.

Args:
- uiroot (str): ui parent layout in which we will build. The parent will
                be restored at the end of the function.

Returns:
- None
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_available_channel_list()

def rfm2.ui.aov.AovUI.update_available_channel_list (   self,
  glob_filter 
)
Refresh the available channel list based on the AOV definitions in
config/aov.json.
* Channels are displayed by groups and groups are greyed out.
* Channels are also glob-filtered using the glob_filter string. In order
to be user-friendly, we add a star at the begining and end of the
glob_filter and ignore case.

Args:
- glob_filter (str): a glob pattern without stars at begining and end. If
                    None, we look up the search field's current value.

Returns:
- None
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_display_list()

def rfm2.ui.aov.AovUI.update_display_list (   self,
  glob_filter 
)
Redraw the contents of the display list. The list is filtered based on
the glob_filter string. Matching is not case-sensitive.

Args:
- glob_filter (str): a glob pattern without stars at the begining and end.
                    If None, we look up the search field's current value.

Returns:
- None
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_inspector()

def rfm2.ui.aov.AovUI.update_inspector (   self,
  selected_item 
)
Update the layout displaying the selection's parameters.

Args:
- selected_item (str): The item currently selected in the treeView.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ valid_node_name()

def rfm2.ui.aov.AovUI.valid_node_name (   self,
  node_name 
)
Validate a potential node name, based on Maya's conventions:
- Name should have at least 1 character.
- First character can not be a number.
- Valid character set is [a-zA-Z0-9_]

Args:
- node_name (str): name to be validated.

Returns:
- bool: True is valid.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ active_color

rfm2.ui.aov.AovUI.active_color

◆ aov_node_types

rfm2.ui.aov.AovUI.aov_node_types

◆ bake

rfm2.ui.aov.AovUI.bake

◆ ch_sep

rfm2.ui.aov.AovUI.ch_sep

◆ globals

rfm2.ui.aov.AovUI.globals

◆ inactive_color

rfm2.ui.aov.AovUI.inactive_color

◆ ornc

rfm2.ui.aov.AovUI.ornc

◆ plug

rfm2.ui.aov.AovUI.plug

◆ selected_list

rfm2.ui.aov.AovUI.selected_list

◆ uiparent

rfm2.ui.aov.AovUI.uiparent

◆ uiprefix

rfm2.ui.aov.AovUI.uiprefix

◆ valid_node_re

rfm2.ui.aov.AovUI.valid_node_re

The documentation for this class was generated from the following file: