Functions ¶
builtinFunctions()
→ list
of str
Returns the list of built-in functions that are imported into PDG’s expression context, used for evaluating Python Processor nodes and Python Script code in process.
dirtyAllAttribs()
Dirties all parameters in the current scene that have expressions that reference work item attributes or files.
evaluateCode(code, multiline)
→ object
Evaluates a snippet of Python code in the thread local context. If multiline
is set to True
, the code is interpreted as Python statements instead of a
single-line expression.
get()
→ pdg.EvaluationContext
Returns the thread-local evaluation context object.
isEvaluating()
→ bool
Returns True
if the function is called from a work item that’s cooking.
localDict()
→ dict
Returns the thread-local Python variable dictionary.
setDict(vars)
Sets the thread local variable dictionary for Python expressions.
setGlobalWorkItem(work_item, dirty)
Sets the global work item across all threads. If dirty
is True
, any
parameters that have expressions referencing the global PDG work item will
be dirtied.
setGlobalSubItemIndex(index, dirty)
Sets the global batch item index across all threads. This is used in job scripts that are cooking batches and need to advance the item index for expression evaluation. For example, when cooking a ROP Fetch as batch this function is called before each frame to ensure the correct sub item is selected.
When dirty
is True
, any parameter that references a work item attribute
will be dirtied and need to re-evaluate after this function is called.
setTimeDependentAttribs(time_dependent)
Sets a flag to tell PDG that work item attributes should be time dependent.
This is necessary when cooking batch work items with per-frame attributes or
input files. For example, if the batch is cooking a simulation that has a
source geometry file set using @pdg_input
, and a different file path per
frame.
workItem()
→ pdg.WorkItem
Returns the thread local active work item.
workItemDep()
→ pdg.WorkItem
Returns the thread local active work item, and creates a channel dependency on the work item if this function is called from a Houdini channel.