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

Functions

def oslc ()
 
def load_src_from_disk (node)
 
def compile_source (node)
 
def refresh_ui (node)
 
def load_shader (node, fpath)
 
def update_pxr_osl_descriptions ()
 

Variables

string SRC_NOT_AVAILABLE_MSG = '// Source code not available !'
 
string LAST_ANSWER = 'Write to an edit file'
 

Detailed Description

Functions used by the PxrOSL node.

Function Documentation

◆ compile_source()

def rfm2.ui.osl.compile_source (   node)
Compile the osl file to an oso object.

1. Read the file fpath from the 'shadername' attribute.
1. Save the contents of the scriptEditor to the file path.
   * Ask the user if he wants to overwrite the osl file or use an edit file.
   * In batch mode, we always default to the edit file.
1. Set the current working dir to the osl file's location.
1. Compile the osl file.
   1. Restore the current working dir to it's original location.
   1. if an error occurs, print to the script editor and return.
   1. warn if the compiled object doesn't have the same name as the source file.
1. Register the new node description.
+ Here is the call graph for this function:

◆ load_shader()

def rfm2.ui.osl.load_shader (   node,
  fpath 
)
Called by the file dialog and asset browser to initialize a PxrOSL node.

Args:
- node (str): The PxrOSL node's name
- fpath (str): file path of the oso/osl file

Raises:
- error_type: error_condition
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_src_from_disk()

def rfm2.ui.osl.load_src_from_disk (   node)
Reload the oso's source (if available) and saves it in the oslCode attribute
so it may be displayed in the code editor.
+ Here is the call graph for this function:

◆ oslc()

def rfm2.ui.osl.oslc ( )
Return oslc's full path.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refresh_ui()

def rfm2.ui.osl.refresh_ui (   node)
Use the oso file to build/rebuild the params. We save/restore
connections and parameter values to minimize workflow disruption.

Args:
- node (str): the PxrOSL node's name
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_pxr_osl_descriptions()

def rfm2.ui.osl.update_pxr_osl_descriptions ( )
Called at the beginning of a render to update all external osl nodes.
+ Here is the call graph for this function:

Variable Documentation

◆ LAST_ANSWER

string rfm2.ui.osl.LAST_ANSWER = 'Write to an edit file'

◆ SRC_NOT_AVAILABLE_MSG

string rfm2.ui.osl.SRC_NOT_AVAILABLE_MSG = '// Source code not available !'