Contexts

NodegraphAPI.SynchronousContext()

Context manager that ensures that changes to parameters are taken into account when cooking the scene. All Katana events are processed before and after running code that is scoped with this context manager. Is used when running Python scripts in script mode and when executing Python code in the B{Python} tab.

NodegraphAPI.AsynchronousContext()

Context manager that undoes the effects of the SynchronousContext context manager. When using the AsynchronousContext context manager, users should explicitly process events when needed or otherwise be aware that correctness of the result is not guaranteed.

NodegraphAPI.IsInSynchronousContext()
Return type:

bool

Returns:

True if called when inside a synchronous context, for example when evaluating a Python script in the B{Python} tab, or when running a Python script in script mode.