hooks.tk-multi-workfiles2.scene_operation_tk-katana module

class SceneOperation(*args, **kwargs)

Bases: sphinx.ext.autodoc.importer._MockObject

Hook called to perform an operation with the current scene.

execute(operation, file_path, context, parent_action, file_version, read_only, **kwargs)

Main hook entry point.

Parameters:
  • operation (str) – Scene operation to perform
  • file_path (str) – File path to use if the operation requires it (e.g. open)
  • context (sgtk.Context) – The context the file operation is being performed in.
  • parent_action (str) –

    Action that this scene operation is being executed for. This can be one of:

    • ”open_file”
    • ”new_file”
    • ”save_file_as”
    • ”version_up”
  • file_version – The version/revision of the file to be opened. If this is None then the latest version should be opened.
  • read_only (bool) – Specifies if the file should be opened read-only or not
Returns:

Depending on operation:

  • ’current_path’: Current scene file path as a str
  • ’reset’: True if scene was reset to an empty state,
    otherwise False
  • all others: None

Return type:

object