cgl.ui.tools.assetizer package

Submodules

cgl.ui.tools.assetizer.back_end module

cgl.ui.tools.assetizer.back_end.create_asset(project, category, asset, filepath=False, open_result=False)[source]

This function creates an asset, it can be on disk or in the database or both. :param path_object: :param task_source:

Returns:

cgl.ui.tools.assetizer.maya module

cgl.ui.tools.assetizer.maya.load_smart_task(task, dcc='maya')[source]

This function loads the smart task for the current selection. Returns:

cgl.ui.tools.assetizer.maya.organize_ref(ref=None)[source]
Parameters:

ref

Returns:

cgl.ui.tools.assetizer.maya.recenter_selected(asset_name, filename='', task='mdl')[source]

This function re-centers the selected object in the scene. It’s used when a mesh it not at the origin. We take its current position, store that in memory then move it to the origin, then create a locator then move the locator to the stored position then parent the mesh to the locator Returns:

cgl.ui.tools.assetizer.maya.replace_locators(delete=True)[source]

go through all the items named “*_loc” and replace them with the published reference Returns:

cgl.ui.tools.assetizer.maya.replace_with_published_reference(delete=False)[source]

This function replaces the selected object with the published reference. Returns:

cgl.ui.tools.assetizer.maya.select_objects_in_namespace(namespace)[source]

This function selects all the objects in the given namespace Returns:

cgl.ui.tools.assetizer.maya.tag_selected_asset(selection=None, filepath='')[source]

This function tags the current selection with the asset we’ve exported it to this will allow us to track the asset in the future Returns:

cgl.ui.tools.assetizer.ui module

class cgl.ui.tools.assetizer.ui.Assetizer(project=None, company=None, task='mdl', ext='.ma', dcc='maya', asset_name=None, parent=None)[source]

Bases: QDialog

This is the main widget for the Assetizer tool. It allows you to select a mesh inside of a scene and create it to the asset you’ve defined within the Assetizer.

It has 3 rows on a gridLayout: Asset Category: [ComboBox] Asset Name: [AdvComboBox] message: [QLabel]

create_asset_clicked()[source]

This function creates the asset on disk and in the database.

export_selection(filename, open_result=True)[source]

Uses the smart task sysemt to auotmatically pull out an export function for the current selection. :param filename:

Returns:

get_asset_path()[source]

This function returns the path to the asset based on the asset_category and asset_name combobox selections.

get_assets()[source]

This function returns a list of assets based on the asset_category combobox selection.

get_categories()[source]

This function returns a list of asset categories.

get_path_object()[source]

This function returns a PathObject based on the asset_category and asset_name combobox selections. Returns:

is_valid_name(asset_name)[source]

This function checks if the asset name is valid. valid asset names are camelCase starting with lower case letter and they are less than 15 characters long. we’ll use the re module to check if the name is valid. :param asset_name:

Returns:

model_selected(selected)[source]

This function acts as a way to interact with the UI from the outside when somnething is selcted. Returns:

set_categories()[source]

This function sets the asset_category combobox with the asset categories.

staticMetaObject = PySide6.QtCore.QMetaObject("Assetizer" inherits "QDialog": )
update_asset_name()[source]

This function is called when the user selects a new asset category. It will update the asset_name combobox with the assets that are available for that category.

update_message()[source]

This function is called when the user selects a new asset name. It will update the message label with the path to the asset.

Module contents