rfm2  22.0
A python-based rewrite of RenderMan for Maya
 All Classes Namespaces Files Functions Variables Pages
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
 
def isValidNodeType
 
def maya_version
 
def asset_name_from_label
 
def maya_params
 
def parse_node_graph
 
def parse_texture
 
def export_asset
 
def set_params
 
def set_transform
 
def create_nodes
 
def connect_nodes
 
def compatibility_check
 
def import_asset
 
def get_shading_group
 
def get_selected_nodes
 
def default_label_from_node_name
 
def default_label_from_file_name
 
def MayaPresetBrowserUIScript
 
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

string DOCK_NAME = 'rmanPresetBrowserWorkspaceControl'
 
tuple RMANVERSION = cfg()
 
dictionary MAYA_TO_PXR_NODES = {}
 
             #

GLOBALS # # More...

 
dictionary PXR_TO_MAYA_NODES = {}
 
list VALID_NODE_TYPES = []
 
 MAYA_VERSION = None
 
 g_ui = None
 
 g_prefs = None
 

Detailed Description

Asset browser implementatioin for Maya 2017+

Function Documentation

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:

def rfm2.ui.assets_browser.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:

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:

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:

def rfm2.ui.assets_browser.default_label_from_file_name (   filename)

+ Here is the caller graph for this function:

def rfm2.ui.assets_browser.default_label_from_node_name (   node)

+ Here is the caller graph for this function:

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:

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:

def rfm2.ui.assets_browser.get_shading_group (   node)

+ Here is the caller graph for this function:

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:

def rfm2.ui.assets_browser.init ( )

+ Here is the call graph for this function:

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:

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:

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:

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:

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:

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 call graph for this function:

+ Here is the caller graph for this function:

def rfm2.ui.assets_browser.prefs_ui_accept ( )

+ Here is the call graph for this function:

def rfm2.ui.assets_browser.prefs_ui_cancel ( )
def rfm2.ui.assets_browser.prefs_ui_create ( )

+ Here is the caller graph for this function:

def rfm2.ui.assets_browser.prefs_ui_reset_prefs ( )
def rfm2.ui.assets_browser.prefs_ui_unparent ( )

+ Here is the call graph for this function:

def rfm2.ui.assets_browser.prefs_ui_update ( )
def rfm2.ui.assets_browser.register_prefs ( )

+ Here is the call graph for this function:

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:

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:

def rfm2.ui.assets_browser.show_preset_browser ( )

+ Here is the call graph for this function:

def rfm2.ui.assets_browser.update_preset_browser ( )

+ Here is the caller graph for this function:

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

string rfm2.ui.assets_browser.DOCK_NAME = 'rmanPresetBrowserWorkspaceControl'
rfm2.ui.assets_browser.g_prefs = None
rfm2.ui.assets_browser.g_ui = None
dictionary rfm2.ui.assets_browser.MAYA_TO_PXR_NODES = {}

             #

GLOBALS # #

rfm2.ui.assets_browser.MAYA_VERSION = None
dictionary rfm2.ui.assets_browser.PXR_TO_MAYA_NODES = {}
tuple rfm2.ui.assets_browser.RMANVERSION = cfg()
list rfm2.ui.assets_browser.VALID_NODE_TYPES = []