cgl.plugins package

Subpackages

Submodules

cgl.plugins.AlchemyScene module

class cgl.plugins.AlchemyScene.Scene[source]

Bases: object

build()[source]
clean_turntable()[source]
confirm_prompt()[source]
create_turntable()[source]
static deselect()[source]
export_msd()[source]
static export_selected(file_path, ext)[source]
filename = None
static get_class(task)[source]

Gets the smart task class that relates to the specified task.

If no task is specified, the task for the current scene will be used.

Parameters:

task (str) – The name of the task to get the class for.

Returns:

the class for the specified task.

Return type:

class_ (class)

get_path_object()[source]
static get_scene_path()[source]
get_shot_cam()[source]

Returns the name of the shot camera for the current shot.

static import_file(file_path: str)[source]
import_task(task: str, **kwargs)[source]

Imports the latest version of the specified task into the scene.

Parameters:
  • task – the task to import.

  • **kwargs – Used to pass additional arguments to the import_latest() function of the task class.

Returns:

the class for the specified task.

Return type:

class_

static open_file(file_path: str)[source]
path = None
path_object = None
preflight_dialog(preflight_type: str)[source]
preview()[source]
publish()[source]
render()[source]

Launches the preflight dialog for the current scene based off what’s available in the alchemist’s cookbook.

render_dir = None
review()[source]

Checks for review media in the folder structure for the current version, if it finds it, goes through the magic_browser “review” process for this media type. This typically consists of:

  1. Check for existing renders

  2. Create jpg proxies of the renders

  3. Create a mov from the jpg proxies.

  4. Upload mov to review platform (like shotgrid)

  5. Launch URL for the review.

Returns:

URL

save_file()[source]
save_file_as(file_path: str)[source]
screen_grab(dialog=False)[source]

Allows the user to capture a thumbnail for the current scene.

Pops open a screen capture window and when you grab the screen it does the following:
  1. Create preview file for current scene_object()

  2. Creates thumb_file for current scene_object()

  3. Updates Project Management with new thumbnail.

Returns:

True if the thumbnail was captured successfully, otherwise False.

Return type:

bool

static select(items: list)[source]
set_path_object()[source]
set_render_path()[source]
set_scene_path()[source]
setup_alchemy_plugin(version)[source]

Function designed to set up the application to autoload magic_browser tools and cookbook menus.

Parameters:

version (str) – The version of the magic_browser plugin to load.

Returns:

None

source_dir = None
version_up()[source]

Creates a new minor version on disk of the current “Scene()”.

Assumes a minor version as a “publish” would create a major version. it only creates files in the “source” directory, as “product” files will be created as a result of work on the new version.

Returns:

None

cgl.plugins.CustomMenu module

class cgl.plugins.CustomMenu.CustomMenu(software, type_)[source]

Bases: object

A Base Class to be used in conjunction with the “Menu Designer”.

A user simply has to fill in the following functions: get_scene_path() set_menu_parent() create_menu() add_button()f delete_menu() find_menu_by_name()

Examples can be found here:

1) plugins/nuke/custom_menu.py 1) plugins/maya/custom_menu.py

add_button(menu_label, label='', annotation='', command='', icon='', image_overlay_label='', hot_key='', menu_name=None)[source]

Adds a button with telemetry wrapping. Subclasses implement _create_button to attach to the actual UI.

add_menu_buttons(menu_label, buttons, menu_name=None)[source]
create_menu(label, name=None)[source]
delete_after_menus()[source]
delete_menu(menu_name)[source]
delete_menus()[source]
static find_menu_by_name(**kwargs)[source]
get_icon_path(shelf, button)[source]

returns the icon path within the current menu of the cgl_tools directory of the corresponding icon :param shelf: :param button:

Returns:

icon path string

get_scene_path()[source]
load_cgl()[source]
Returns:

all the shelves, menus, or publish from the json file

Return type:

dict

load_menus(test=False)[source]

Loads all menus :param test:

order_buttons(menu)[source]

Orders the buttons correctly within a menu. :param menu: the name of the menu to order :type menu: str

Returns:

a sorted list of buttons

Return type:

list

static order_menus(menus)[source]

Orders the Menus from the json file correctly.

This is necessary for the menus to show up in the correct order within the interface.

Returns:

A list of the menus in the correct order

path_object = None
static remove_inactive_buttons(menus)[source]
remove_inactive_menus()[source]
set_menu_parent()[source]
set_path_object()[source]

cgl.plugins.setup module

cgl.plugins.smart_task module

class cgl.plugins.smart_task.SmartTask(msd=None, task_object=None, path_object=None, dcc=None, task=None, scene=None, **kwargs)[source]

Bases: object

This is a template for a “task” within the cookbook. It covers common areas when dealing with digital assets specific to different tasks.

dcc = None
export_task()[source]

Basic export method for tasks

This should call the customizable ‘_export()’ method per file.

This method is typically overridden in the specific task class to handle the export logic.

get_msd_data()[source]

creates the msd dictionary for the task being called. This is used at publish time to get the data to be wrtten to the .msd file. :param task_name:

get_task_object(task, latest=True)[source]

Returns a PathObject with the task set to the input task :param task: the task we want to set the PathObject to

Returns:

the PathObject with the task set to the input task

Return type:

PathObject

import_latest(task=None, reference=False, **kwargs)[source]

Imports the lastest published version of whatever files this task is responsible for.

This method is typically overridden in the specific task class to handle the import logic.

msd_dict = None
msd_path = ''
path_object = None
render()[source]
scene = None
select()[source]

Selects the task in the scene

This must be customized per dcc

set_path_object()[source]
set_scene()[source]
set_task_object()[source]

Gets the Unreal Engine Task Object for this task. Returns:

task = None
task_entity_type = None
task_object = None
version_up()[source]

Version up the task. Override this method in the task class if you want to add additional functionality.

cgl.plugins.smart_task.get_dcc_from_task_file(caller_file)[source]

Gets the dcc from the caller file path.

Parameters:

caller_file – the file path of the caller

Returns:

the dcc name

Return type:

str

cgl.plugins.smart_task.get_legacy_task_class(software, task)[source]

Gets the legacy task class for the specified software and task. This is used for tasks that are not in the cookbook structure.

Parameters:
  • software – the dcc in the plugins directory where we can find Task().get_msd_data()

  • task – the task to get the class for

Returns:

class or None if the class does not exist

cgl.plugins.smart_task.get_task_class(software, task)[source]

gets the class that relates to the specified task, if no task is specified the task for the current scene will be used.

Parameters:
  • software – the dcc in the plugins directory where we can find Task().get_msd_data()

  • task – the task to get the class for

Returns:

class or None if the class does not exist

Module contents