rfm2  22.0
A python-based rewrite of RenderMan for Maya
 All Classes Namespaces Files Functions Variables Pages
rfm2.utils.string_expr Namespace Reference

Classes

class  StringExpression
 

Functions

def time_this
 
def fixup_file_name
 
def test
 
def ntest
 

Variables

 COUNTERS = None
 
tuple STD_TOKENS = OrderedDict()
 

Detailed Description

Token substitution in strings.

We will use maya's <token> format and slightly extend it.
- our tokens are lower case but we accept capitalized tokens like Maya's.
- we allow for simple attribute lookups:
  - Explicit/named nodes: <rmanGlobals.hider_maxSamples>
  - Implicit nodes: <shape.hider_maxSamples>

Global tokens:
- <ws>: Current workspace root
- <file>: current scene name (with extension)
- <scene>: current scene name (no extension)
- <camera>: current camera
- <aov>: AOV display name
- <ext>: image file extension
- <layer> <renderlayer>: render layer name
- <shape>: short shape name
- <shapepath>: long shape name
- <frame>: float frame number
- <f>: integer frame
- <f2> <f3> <f4>: zero-padded integer frame
- <jobid>: unique job id, i.e. '170524182112' (see <date> and <time>)
- <date>: current date, i.e. '17_05_24' for 24th of May 2017
- <time>: current time, i.e. '18-21-12' for 18h 21m 24s
- <version>: Current version
- <take>: Current take
- <assetlib>: Path to the standard RenderManAssetLibrary'

Per-invocation tokens (optional):
- <shape>: the short shape name
- <shapepath>: the long shape name

Attribute lookups:
- <shape.frame> or <shapepath.frame>: the value of the 'frame' attribute on the current shape.
- This syntax accepts a colon-separated python formatting string, when you need
  to format a numeric value:
if frame == 12.25,  <shape.frame:%04d>  ->  '0012'

Environment variable lookups:
- $MY_ENV_VAR: env vars must start with '$' and be all upper-case with a minimum length of 3 characters

NOTE: To run the tests, you will need to un-comment the @time_this decorators in
  StringExpression.

Function Documentation

def rfm2.utils.string_expr.fixup_file_name (   inputNm)
def rfm2.utils.string_expr.ntest (   n)
def rfm2.utils.string_expr.test ( )
def rfm2.utils.string_expr.time_this (   f)
Function that can be used as a decorator to time any method.

Variable Documentation

rfm2.utils.string_expr.COUNTERS = None
tuple rfm2.utils.string_expr.STD_TOKENS = OrderedDict()