An optional variable specifies a set of Python scripts that are additionally executed when performing actions in the plugin, such as opening a file, creating a new file in a task, saving a version, and publishing a report. For each operation, there are 3 starting points for the selected procedure relative to the main function: before execution, replacing the main function, and after execution.

Structure of the processors element:

{
"soft_name":
{
"open_pre":
{
"script_path": "path/to/script.py",
"function": "open_pre"
},
"open_replace":
{
"script_path": "path/to/script.py",
"function": "open_replace"
},
"open_post":
{
"script_path": "path/to/script.py",
"function": "open_post"
},
"new_pre":
{
"script_path": "E:/files/testwnd.py",
"function": "new_pre"
},
"new_replace":
{
"script_path": "path/to/script.py",
"function": "new_replace"
},
"new_post":
{
"script_path": "path/to/script.py",
"function": "new_post"
},
"version_pre":
{
"script_path": "path/to/script.py",
"function": "version_pre"
},
"version_replace":
{
"script_path": "path/to/script.py",
"function": "version_post"
},
"publish_pre":
{
"script_path": "path/to/script.py",
"function": "publish_pre"
},
"publish_replace":
{
"script_path": "path/to/script.py",
"function": "publish_replace"
},
"publish_post":
{
"script_path": "path/to/script.py",
"function": "publish_post"
},
"link_pre":
{
"script_path": "path/to/script.py",
"function": "link_pre"
},
"link_replace":
{
"script_path": "path/to/script.py",
"function": "link_replace"
},
"link_post":
{
"script_path": "path/to/script.py",
"function": "link_post"
},
"embed_pre":
{
"script_path": "path/to/script.py",
"function": "embed_pre"
},
"embed_replace":
{
"script_path": "path/to/script.py",
"function": "embed_replace"
},
"embed_post":
{
"script_path": "path/to/script.py",
"function": "embed_post"
},
"indicator_task":
{
"script_path": "path/to/script.py",
"function": "indicator_task"
}
}
}

The soft_name key is the internal name of one of the supported applications (maya, nuke, houdini, blender, cinema4d, 3dsmax).

The script_path variable specifies the full path to the Python script, and function is the name of the function being called. The called function must take 2 dictionary parameters as arguments and return the second one, modified if necessary.
The first argument is common to all cases, and contains the following keys:

  • task_id - ID of task;;
  • task_name - name of the task;
  • task_parent_id - ID of the parent task;
  • task_parent_path - Path of the parent task in Cerebro;
  • task_status_id - ID of the current task status;
  • task_status_name - Name of the current task status;;
  • task_activity_id - ID of the task activity type;
  • task_activity_name - Name of the task activity type;
  • current_user_id - ID of the current user;
  • current_user_name - Display name of the current user.

The second argument is a dictionary with the following elements:

  • open_/new_
    - original_file_path (неизменяемое) - Full path to the source file;
    - local_file_path - Full path to the working file;
  • version_/publish_
{
“local_file_path”: “”,
“version_file_path”: “”, # full path to the published version file
“publish_file_path”: “”, # full path to the final file to publish (relevant only for publish_)
“report”:
{
“plain_text”: “”, # report text
“work_time”: “” # working time in minutes
},
“attachments”: # a set of files attached to a report via Cargador
{
“file_path”: [ paths to file thumbnails ], # file_path - the path to the file
...
},
“links”: # a set of files attached to the report by a link
{
“file_path”: [ paths to file thumbnails ],
...
}
}
  • link_/embed_
    - file_path - Full path to the imported file;
  • indicator_task

The second argument is not used. a string with the hex value of the display color is returned.

Did this answer your question?