rfm2  22.0
A python-based rewrite of RenderMan for Maya
rfm2.ui.widgets Namespace Reference

Functions

def rfm_ui_templates ()
 
def set_rfm_stylesheet (root)
 
def rfm_node_help (ntype)
 
def page_iterator (lyt)
 
def register_condvis_pages (ntype, pnames, func=None)
 
def expand_closure (ntype)
 
def update_page_visibility (nodeattr, retry=False)
 
def hide_ramp_frame (page_name, *_args)
 
def rfm_control (ntype, nattr, prefix='', debug=False)
 
def rfm_ext_control (nattr)
 
def setup_control (ui_class, desc, param, ctlname, nodeattr)
 

Variables

 long = int
 
string RGSTYLESHEET
 
dictionary WIDGET_CLASS
 
list SPECIAL_WIDGETS
 
dictionary CONDVIS_PAGES = {}
 

Detailed Description

Defines the widget creation and update mecanism.

Function Documentation

◆ expand_closure()

def rfm2.ui.widgets.expand_closure (   ntype)
Return a function to update conditional page visibility when a page is
expanded.

Arguments:
    ntype {str} -- node type

Returns:
    function pointer
+ Here is the caller graph for this function:

◆ hide_ramp_frame()

def rfm2.ui.widgets.hide_ramp_frame (   page_name,
_args 
)
Hide a maya ramp widget's enclosing frame label if the enclosing page
label starts with the same label.

Arguments:
    page_name {str} -- name of the enclosing page
    _args {stuff} -- unused: obey MEL calling convention.
+ Here is the call graph for this function:

◆ page_iterator()

def rfm2.ui.widgets.page_iterator (   lyt)
Generator recursively finding frameLayout controls enclosed in
'lyt'.
NOTE: it will only find pages that have already been created. The AE only
creates sub pages when they are made visible.

Args:
- layout (str): name/path of the layout we descend into.
+ Here is the caller graph for this function:

◆ register_condvis_pages()

def rfm2.ui.widgets.register_condvis_pages (   ntype,
  pnames,
  func = None 
)
Recursively parse the editor layout to store layouts affected by
conditional visibility.

Args:
    ntype (str) -- the node type
    pnames (str) -- list of page labels with conditional visibility.

Kwargs:
    func (functions pointer) -- A function to be evaluated once we're done. (default: None)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rfm_control()

def rfm2.ui.widgets.rfm_control (   ntype,
  nattr,
  prefix = '',
  debug = False 
)
Implements a classic maya new/replace control workflow.

Args:
- ntype (str): node type
- nattr (str): node dot attribute
- prefix (str): a prefix appended to the control name.
- debug (bool): display debug messages.

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

◆ rfm_ext_control()

def rfm2.ui.widgets.rfm_ext_control (   nattr)
Creates an extension control.
+ Here is the call graph for this function:

◆ rfm_node_help()

def rfm2.ui.widgets.rfm_node_help (   ntype)
Create a widget displaying a node's help.

Arguments:
    ntype {str} -- the node's type.
+ Here is the call graph for this function:

◆ rfm_ui_templates()

def rfm2.ui.widgets.rfm_ui_templates ( )
define UI templates for consistant visual tweaks

◆ set_rfm_stylesheet()

def rfm2.ui.widgets.set_rfm_stylesheet (   root)
Tweak the Qt stylesheet of some controls to match Maya's.

Arguments:
    root {str} -- name of the control
+ Here is the caller graph for this function:

◆ setup_control()

def rfm2.ui.widgets.setup_control (   ui_class,
  desc,
  param,
  ctlname,
  nodeattr 
)
setup a control's layout and contents.

Arguments:
    ui_class {obj} -- instance of the class used to generate the widget
    desc {RfmNodeDesc} -- The node's description
    param {NodeDescParam} -- The parameters's description
    ctlname {str} -- the control's name
    nodeattr {str} -- the plug controled by this widget
+ Here is the caller graph for this function:

◆ update_page_visibility()

def rfm2.ui.widgets.update_page_visibility (   nodeattr,
  retry = False 
)
Update conditional visibility of pages.

We get the list of pages with conditional visibility expressions
and then evaluate their expressions in turn. Page layouts are
referenced by names and will be renamed to match the canonical
format if need be. In practice, it means the renaming will happen
the very first time a node is displayed in the Attribute Editor.

Args:
- nodeattr (str): the full plug, i.e. 'filter1.msg'
+ Here is the call graph for this function:

Variable Documentation

◆ CONDVIS_PAGES

dictionary rfm2.ui.widgets.CONDVIS_PAGES = {}

◆ long

rfm2.ui.widgets.long = int

◆ RGSTYLESHEET

string rfm2.ui.widgets.RGSTYLESHEET

◆ SPECIAL_WIDGETS

list rfm2.ui.widgets.SPECIAL_WIDGETS
Initial value:
1 = [kk.W_NODEEDITOR, kk.W_OSLEDITOR, kk.W_AOVEDITOR,
2  kk.W_BAKEAOVEDITOR, kk.W_ABCMANIFEST, kk.W_USERATTRIBUTES]

◆ WIDGET_CLASS

dictionary rfm2.ui.widgets.WIDGET_CLASS
Initial value:
1 = {'int': uic.NumericalWidget(),
2  'int2': uic.Numerical2Widget(),
3  'float': uic.NumericalWidget(),
4  'float2': uic.Numerical2Widget(),
5  'float3': uic.NumericalWidget(),
6  'color': uic.ColorWidget(),
7  'point': uic.NumericalWidget(),
8  'vector': uic.NumericalWidget(),
9  'normal': uic.NumericalWidget(),
10  'matrix': uic.MatrixWidget(),
11  'string': uic.StringWidget(),
12  'struct': uic.StringWidget(),
13  'bxdf': uic.ColorWidget(),
14  'message': uic.MessageWidget(),
15  kk.W_NODEEDITOR: uic.NodeEditorWidget(),
16  kk.W_OSLEDITOR: uic.OSLEditorWidget(),
17  kk.W_AOVEDITOR: uic.AOVEditorWidget(),
18  kk.W_BAKEAOVEDITOR: uic.AOVEditorWidget(bake=True),
19  kk.W_ABCMANIFEST: uic.AbcManifestWidget(),
20  kk.W_USERATTRIBUTES: uiua.UserAttrWidget()}