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

Classes

class  RmanAssetMayaError
 
class  MayaEnv
 
class  MayaProgress
 
class  MayaNode
 
class  MayaGraph
 
class  MayaPrefs
 
class  MayaPresetBrowserWorkspaceCtl
 
class  AssetsPrefs
 

Functions

def warn_only (msg)
 
def isValidNodeType (nodetype)
 
def maya_version ()
 
def asset_name_from_label (label)
 
def maya_params (nodetype)
 
def parse_node_graph (nodes, Asset)
 
def parse_texture (imagePath, Asset)
 
def parse_display_filters (Asset)
 
def parse_displaychannels (Asset)
 
def export_asset (nodes, atype, infodict, category, cfg, renderPreview='std', alwaysOverwrite=False)
 
def get_enum_value (cattr, vals)
 
def set_params (nodeName, paramsList)
 
def set_transform (name, fmt, vals)
 
def create_nodes (Asset, internalNodesDict)
 
def create_display_nodes (asset, node_dict)
 
def connect_nodes (Asset, nodeDict, internalNodesDict)
 
def connect_display_nodes (asset, node_dict)
 
def compatibility_check (Asset)
 
def import_asset (filepath)
 
def get_shading_group (node)
 
def get_selected_nodes (mode)
 
def default_label_from_node_name (node)
 
def default_label_from_file_name (filename)
 
def MayaPresetBrowserUIScript (restore=False)
 
def show_preset_browser ()
 
def update_preset_browser ()
 
def prefs_ui_create ()
 
def prefs_ui_update ()
 
def prefs_ui_cancel ()
 
def prefs_ui_accept ()
 
def prefs_ui_reset_prefs ()
 
def prefs_ui_unparent ()
 
def check ()
 
def register_prefs ()
 
def init ()
 

Variables

 long = int
 
string DOCK_NAME = 'rmanPresetBrowserWorkspaceControl'
 
dictionary RAMP_ATTRS
 
 g_ui = None
 
 g_prefs = None
 
 RMANVERSION = cfg().build_info.version()
 
dictionary MAYA_TO_PXR_NODES = {}
 
dictionary PXR_TO_MAYA_NODES = {}
 
list VALID_NODE_TYPES = []
 
 MAYA_VERSION = None
 

Detailed Description

Asset browser implementatioin for Maya 2017+

Function Documentation

◆ asset_name_from_label()

def rfm2.ui.assets_browser.asset_name_from_label (   label)
Builds a filename from the asset label string.

Args:
- label (str): User-friendly label

Returns:
- the asset file name
+ Here is the caller graph for this function:

◆ check()

def rfm2.ui.assets_browser.check ( )

◆ compatibility_check()

def rfm2.ui.assets_browser.compatibility_check (   Asset)
Check the compatibility of the loaded asset with the host app and the
renderman version. We pass VALID_NODE_TYPES to help determine if we have
any substitution nodes available. To support Katana/Blender/Houdini nodes
in Maya, you would just need to implement a node with the same name (C++
or OSL) and make it available to RfM.

Args:
- Asset (RmanAsset): The asset we are checking out.

Returns: True if compatible, False otherwise.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ connect_display_nodes()

def rfm2.ui.assets_browser.connect_display_nodes (   asset,
  node_dict 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ connect_nodes()

def rfm2.ui.assets_browser.connect_nodes (   Asset,
  nodeDict,
  internalNodesDict 
)
Connect all nodes in the nodeGraph. Failed connections are only reported
as warning.

Args:
- Asset (RmanAsset): a RmanAssetNode object containg a nodeGraph
- nodeDict (dict): map from graph node name to maya node name. If there was
  already a node with the same name as the graph node, this maps to the new
  node name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_display_nodes()

def rfm2.ui.assets_browser.create_display_nodes (   asset,
  node_dict 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_nodes()

def rfm2.ui.assets_browser.create_nodes (   Asset,
  internalNodesDict 
)
Creates all maya nodes defined in the asset's nodeGraph and sets
their param values. Nodes will be renamed by Maya and the mapping
from original name to actual name retuned as a dict, to allow us
to connect the newly created nodes later.

Args:
- Asset (RmanAsset): RmanAsset object containing a nodeGraph
- internalNodesDict (dict): dict of internal nodes that will be updated

Returns:
- dict mapping the graph id to the actual maya node names
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ default_label_from_file_name()

def rfm2.ui.assets_browser.default_label_from_file_name (   filename)
+ Here is the caller graph for this function:

◆ default_label_from_node_name()

def rfm2.ui.assets_browser.default_label_from_node_name (   node)
Turn a node name into a UI label string.
examples:
 - 'matt_test_UDIM_Material1' -> 'Matt test UDIM Material 1'
 - 'mattTestUDIMMaterial2SG' -> 'Matt Test UDIM Material 2'
+ Here is the caller graph for this function:

◆ export_asset()

def rfm2.ui.assets_browser.export_asset (   nodes,
  atype,
  infodict,
  category,
  cfg,
  renderPreview = 'std',
  alwaysOverwrite = False 
)
Exports a nodeGraph or envMap as a RenderManAsset.

Args:
    nodes (str) -- Maya node used as root
    atype (str) -- Asset type : 'nodeGraph' or 'envMap'
    infodict (dict) -- dict with 'label', 'author' & 'version'
    category (str) -- Category as a path, i.e.: "/Lights/LookDev"

Kwargs:
    renderPreview (str) -- Render an asset preview ('std', 'fur', None).\
                    Render the standard preview swatch by default.\
                    (default: {'std'})
    alwaysOverwrite {bool) -- Will ask the user if the asset already \
                    exists when not in batch mode. (default: {False})
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_enum_value()

def rfm2.ui.assets_browser.get_enum_value (   cattr,
  vals 
)
takes an enum compound attribute and a list or str and returns the
corresponding enum values.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_selected_nodes()

def rfm2.ui.assets_browser.get_selected_nodes (   mode)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_shading_group()

def rfm2.ui.assets_browser.get_shading_group (   node)
+ Here is the caller graph for this function:

◆ import_asset()

def rfm2.ui.assets_browser.import_asset (   filepath)
Import an asset into the maya scene.

Args:
- filepath (str): full path to a *.rma directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

def rfm2.ui.assets_browser.init ( )
+ Here is the call graph for this function:

◆ isValidNodeType()

def rfm2.ui.assets_browser.isValidNodeType (   nodetype)
wrapper to avoid global access in code

Arguments:
    nodetype {str} -- a node type.
+ Here is the caller graph for this function:

◆ maya_params()

def rfm2.ui.assets_browser.maya_params (   nodetype)
Returns a params array similar to the one returned by rmanShadingNode.
This allows us to deal with maya nodes.

description

Args:
- nodetype (str): the maya node type

Returns:
- Array of structs
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maya_version()

def rfm2.ui.assets_browser.maya_version ( )
Returns a normalized maya version, i.e. add a '.0' if it is an integer.

Returns:
    str -- The normalized version string
+ Here is the caller graph for this function:

◆ MayaPresetBrowserUIScript()

def rfm2.ui.assets_browser.MayaPresetBrowserUIScript (   restore = False)
 When the control is restoring, the workspace control has already been
created and all that needs to be done is restoring its UI.
+ Here is the caller graph for this function:

◆ parse_display_filters()

def rfm2.ui.assets_browser.parse_display_filters (   Asset)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_displaychannels()

def rfm2.ui.assets_browser.parse_displaychannels (   Asset)
+ Here is the caller graph for this function:

◆ parse_node_graph()

def rfm2.ui.assets_browser.parse_node_graph (   nodes,
  Asset 
)
Parses a Maya node graph, starting from 'node'.

Args:
- node (str): root of the graph
- Asset (RmanAsset): RmanAsset object to store the nodeGraph
+ Here is the caller graph for this function:

◆ parse_texture()

def rfm2.ui.assets_browser.parse_texture (   imagePath,
  Asset 
)
Gathers infos from the image header

Args:
    imagePath {list} -- A list of texture paths.
    Asset {RmanAsset} -- the asset in which the infos will be stored.
+ Here is the caller graph for this function:

◆ prefs_ui_accept()

def rfm2.ui.assets_browser.prefs_ui_accept ( )
+ Here is the call graph for this function:

◆ prefs_ui_cancel()

def rfm2.ui.assets_browser.prefs_ui_cancel ( )

◆ prefs_ui_create()

def rfm2.ui.assets_browser.prefs_ui_create ( )
+ Here is the caller graph for this function:

◆ prefs_ui_reset_prefs()

def rfm2.ui.assets_browser.prefs_ui_reset_prefs ( )

◆ prefs_ui_unparent()

def rfm2.ui.assets_browser.prefs_ui_unparent ( )
+ Here is the call graph for this function:

◆ prefs_ui_update()

def rfm2.ui.assets_browser.prefs_ui_update ( )

◆ register_prefs()

def rfm2.ui.assets_browser.register_prefs ( )

◆ set_params()

def rfm2.ui.assets_browser.set_params (   nodeName,
  paramsList 
)
Sets param values of a nodeGraph node.
   Note: we are only handling a subset of maya attribute types.

   Args:
   - nodeName (str): graph node name
   - paramsList (list): list of RmanAssetNodeParam objects
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_transform()

def rfm2.ui.assets_browser.set_transform (   name,
  fmt,
  vals 
)
Set the transform values of the maya node.

We only support flat transformations for now, which means that we don't
rebuild hierarchies of transforms

Args:
- name (str): The name of the transform node
- fmt (list): The format data
- vals (list): The transformation values
+ Here is the caller graph for this function:

◆ show_preset_browser()

def rfm2.ui.assets_browser.show_preset_browser ( )
+ Here is the call graph for this function:

◆ update_preset_browser()

def rfm2.ui.assets_browser.update_preset_browser ( )
+ Here is the caller graph for this function:

◆ warn_only()

def rfm2.ui.assets_browser.warn_only (   msg)
Only warn when an Exception occured.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ DOCK_NAME

string rfm2.ui.assets_browser.DOCK_NAME = 'rmanPresetBrowserWorkspaceControl'

◆ g_prefs

rfm2.ui.assets_browser.g_prefs = None

◆ g_ui

rfm2.ui.assets_browser.g_ui = None

◆ long

rfm2.ui.assets_browser.long = int

◆ MAYA_TO_PXR_NODES

dictionary rfm2.ui.assets_browser.MAYA_TO_PXR_NODES = {}
             #

GLOBALS # #

◆ MAYA_VERSION

rfm2.ui.assets_browser.MAYA_VERSION = None

◆ PXR_TO_MAYA_NODES

dictionary rfm2.ui.assets_browser.PXR_TO_MAYA_NODES = {}

◆ RAMP_ATTRS

dictionary rfm2.ui.assets_browser.RAMP_ATTRS
Initial value:
1 = {'Knots': '_Position', 'Colors': '_Color',
2  'Floats': '_Value', 'Interpolation': '_Interp'}

◆ RMANVERSION

rfm2.ui.assets_browser.RMANVERSION = cfg().build_info.version()

◆ VALID_NODE_TYPES

list rfm2.ui.assets_browser.VALID_NODE_TYPES = []