=========== wapi.assets =========== Use this module to interact with the wizard assets. ----------------- Creation commands ----------------- .. py:function:: wapi.assets.create_sequence(name) Create a sequence in the current wizard project. :param name: The sequence name :type name: str :return: The sequence asset as string. :rtype: str .. py:function:: wapi.assets.create_asset(parent, name) Create an asset ( or a shot ) for the given category parent ( for example : "assets/characters" or the given parent id as int, ex : 2) :param parent: The parent category as string or int :type parent: str or int :param name: The asset name :type name: str :return: The asset as string. :rtype: str .. py:function:: wapi.assets.create_stage(parent, stage) Create a stage for the given asset parent ( for example : "assets/characters/Joe" or the parent id, ex : 23) :param parent: The parent asset as string or int :type parent: str or int :param stage: The stage name :type stage: str :return: The stage as string. :rtype: str .. py:function:: wapi.assets.create_variant(parent, name) Create a variant for the given stage parent ( for example : "assets/characters/Joe/modeling" or the parent id) :param parent: The parent stage as string or int :type parent: str or int :param name: The variant name :type name: str :return: The variant as string. :rtype: str .. py:function:: wapi.assets.create_work_env(parent, software) Create a work environment for the given variant parent ( for example : "assets/characters/Joe/modeling/main" or the parent id ) :param parent: The parent variant as string or int :type parent: str or int :param software: The software name :type software: str :return: The work environment as string. :rtype: str ---------------- Exports commands ---------------- .. py:function:: wapi.assets.create_export(variant, export_name, files_list, comment='') Create a new export in the given variant as string or int. :param variant: The variant as string or int :type variant: str or int :param export_name: The export name ( LOD1, LOD2, etc ) :type export_name: str :param files_list: The list of files to add to the export. :type files_list: list[str] :param comment: An optionnal comment :type comment: str :return: The success :rtype: bool .. py:function:: wapi.assets.batch_export(work_env, namespaces_list=[], rolls=False, custom_frame_range=None, refresh_assets_in_scene=False) Launch a batch export of the given work environment as subtask. :param work_env: The work environment as string or int :type work_env: str or int :param namespaces_list: The list of namespaces to export ( only for the export of animation, camera and cfx ) :type namespaces_list: list[str] :param rolls: Apply rolls to the frame range :type rolls: bool :param custom_frame_range: Give a custom frame range for the export here, if None, wizard will export the default frame range of the asset or shot. :type custom_frame_range: list[int, int] :param refresh_assets_in_scene: Referesh the assets in the scene before the export. :type refresh_assets_in_scene: bool :return: None :rtype: None .. py:function:: wapi.assets.batch_export_camera(work_env, namespaces_list=[], rolls=False, custom_frame_range=None, refresh_assets_in_scene=False) Launch a batch export the given camrig list of the given work environment as subtask. :param work_env: The work environment as string or int :type work_env: str or int :param namespaces_list: The list of camrig namespaces to export :type namespaces_list: list[str] :param rolls: Apply rolls to the frame range :type rolls: bool :param custom_frame_range: Give a custom frame range for the export here, if None, wizard will export the default frame range of the asset or shot. :type custom_frame_range: list[int, int] :param refresh_assets_in_scene: Referesh the assets in the scene before the export. :type refresh_assets_in_scene: bool :return: None :rtype: None --------------- Groups commands --------------- .. py:function:: wapi.assets.create_group(name) Create a group with the given name. :param name: The name of the new group :type name: str :return: The group id :rtype: int .. py:function:: wapi.assets.modify_group_color(group, color) Modify the group color with the given hex color code. :param group: The name or the id of the group to modify :type group: str or int :param color: The color as a hex color code string. :type color: str :return: The success :rtype: bool .. py:function:: wapi.assets.delete_group(group) Delete the given group. :param group: The name or the id of the group to delete :type group: str or int :return: The success :rtype: bool ------------------- References commands ------------------- .. py:function:: wapi.assets.create_reference(destination_work_env, variant_to_reference) Create a reference of the given variant in the given destination work environment :param destination_work_env: The destination work environment as string or int :type destination_work_env: str or int :param variant_to_reference: The variant to reference as string or int :type variant_to_reference: str or int :return: The new references as a list of namespaces :rtype: list[str] .. py:function:: wapi.assets.create_grouped_reference(destination_group, variant_to_reference) Create a reference of the given variant in the given destination group :param destination_group: The destination group name as string or int :type destination_group: str or int :param variant_to_reference: The variant to reference as string or int :type variant_to_reference: str or int :return: The new references as a list of namespaces :rtype: list[str] .. py:function:: wapi.assets.create_referenced_group(destination_work_env, group) Create a reference of the given group in the given destination work environment :param destination_work_env: The destination work environment as string or int :type destination_work_env: str or int :param group: The group name to reference as string or int :type group: str or int :return: The new referenced groups as a list of namespaces :rtype: list[str] .. py:function:: wapi.assets.get_references(work_env) Return the work environment references as a list of namespaces :param work_env: The work environment as string or int :type work_env: str or int :return: The references as a list of namespaces :rtype: list[str] .. py:function:: wapi.assets.get_references_from_group(group) Return the grouped references as a list of namespaces :param group: The group name as string or group id as int :type group: str or int :return: The grouped references as a list of namespaces :rtype: list[str] .. py:function:: wapi.assets.get_referenced_groups(work_env) Return the work environment referenced groups as a list of namespaces :param work_env: The work environment as string or int :type work_env: str or int :return: The referenced groups as a list of namespaces :rtype: list[str] .. py:function:: wapi.assets.remove_reference(work_env, reference) Remove the given reference ( as namespace ) from the given work environment :param work_env: The work environment as string or int :type work_env: str or int :param reference: The reference namespace :type reference: str :return: The success :rtype: bool or None .. py:function:: wapi.assets.remove_reference_from_group(group, reference) Remove the given reference ( as namespace ) from the given group :param group: The group name as string or group id as int :type group: str or int :param reference: The grouped reference namespace :type reference: str :return: The success :rtype: bool or None .. py:function:: wapi.assets.remove_referenced_group(work_env, referenced_group) Remove the given referenced_group ( as namespace ) from the given work environment :param work_env: The work environment as string or int :type work_env: str or int :param referenced_group: The group namespace :type referenced_group: str :return: The success :rtype: bool or None .. py:function:: wapi.assets.set_reference_as_default(work_env, reference) Modify the reference in the given work environment to match the default export version :param work_env: The work environment as string or int :type work_env: str or int :param reference: The reference namespace :type reference: str :return: The success :rtype: bool or None .. py:function:: wapi.assets.set_grouped_reference_as_default(group, reference) Modify the reference in the given group to match the default export version :param group: The group name as string or group id as int :type group: str or int :param reference: The reference namespace :type reference: str :return: The success :rtype: bool or None .. py:function:: wapi.assets.modify_reference_auto_update(work_env, reference, auto_update=True) Set the given reference to `auto update` in the given work environment :param work_env: The work environment as string or int :type work_env: str or int :param reference: The reference namespace :type reference: str :param auto_update: Auto update state ( default is True ) :type auto_update: bool :return: The success :rtype: bool or None .. py:function:: wapi.assets.modify_grouped_reference_auto_update(group, reference, auto_update=True) Set the given reference to `auto update` in the given group :param group: The group name as string or group id as int :type group: str or int :param reference: The grouped reference namespace :type reference: str :param auto_update: Auto update state ( default is True ) :type auto_update: bool :return: The success :rtype: bool or None ---------------- Archive commands ---------------- .. py:function:: wapi.assets.archive_asset(asset) Archive the given asset :param asset: The asset as string ( for example : "assets/characters/Joe" ) or as int ( ex : 24 ) :type asset: str or int :return: The success. :rtype: bool .. py:function:: wapi.assets.archive_sequence(sequence) Archive the given sequence :param sequence: The sequence as string ( for example : "sequences/seq_0001" ) or int :type sequence: str or int :return: The success. :rtype: bool .. py:function:: wapi.assets.archive_stage(stage) Archive the given stage :param stage: The stage as string ( for example : "sequences/seq_0001/sh_0001/animation" ) or int :type stage: str or int :return: The success. :rtype: bool .. py:function:: wapi.assets.archive_variant(variant) Archive the given variant :param variant: The variant as string ( for example : "sequences/seq_0001/sh_0001/animation/main" ) or int :type variant: str or int :return: The success. :rtype: bool .. py:function:: wapi.assets.archive_work_env(work_env) Archive the given work_env :param work_env: The work_env as string ( for example : "sequences/seq_0001/sh_0001/animation/main/maya" ) or int :type work_env: str or int :return: The success. :rtype: bool .. py:function:: wapi.assets.archive_work_version(work_version) Archive the given work_version :param work_version: The work_version as string ( for example : "sequences/seq_0001/sh_0001/animation/main/maya/0001" ) or int :type work_version: str or int :return: The success. :rtype: bool ------------- List commands ------------- .. note:: The list items formatting depend on the column argument, by default it will return a list of dictionnaries. You can enter a column argument that match the dictionnary keys to get a list of data. For example the column argument can be 'id', 'name', 'creation_user'... see :ref:`wapi_examples` section. .. py:function:: wapi.assets.list_domains(column='*') Return a list with the domains of the current project. ( `['assets', 'library', 'sequences']` ) :param column: The requested column data ( default is '*' ) :type column: str :return: A list with the project domains data. :rtype: list[objects] .. py:function:: wapi.assets.list_categories(parent, column='*') Return a list of the child categories of the given parent. :param parent: The parent domain ( for example : "assets", "library" or "sequences" ) as string or int :type parent: str or int :param column: The requested column data ( default is '*' ) :type column: str :return: A list with the categories data. :rtype: list[objects] .. py:function:: wapi.assets.list_assets(parent, column='*') Return a list of the child assets of the given parent. :param parent: The parent category ( for example : "assets/characters" ) as string or int :type parent: str or int :param column: The requested column data ( default is '*' ) :type column: str :return: A list with the assets data. :rtype: list[objects] .. py:function:: wapi.assets.list_stages(parent, column='*') Return a list of the child stages of the given parent. :param parent: The parent asset ( for example : "assets/characters/Joe" ) as string or int :type parent: str or int :param column: The requested column data ( default is '*' ) :type column: str :return: A list with the stages data. :rtype: list[objects] .. py:function:: wapi.assets.list_variants(parent, column='*') Return a list of the child variants of the given parent. :param parent: The parent stage ( for example : "assets/characters/Joe/modeling" ) as string or int :type parent: str or int :param column: The requested column data ( default is '*' ) :type column: str :return: A list with the variants data. :rtype: list[objects] .. py:function:: wapi.assets.list_work_envs(parent, column='*') Return a list of the child work environments of the given parent. :param parent: The parent variant ( for example : "assets/characters/Joe/modeling/main" ) as string or int :type parent: str or int :param column: The requested column data ( default is '*' ) :type column: str :return: A list with the work environments data. :rtype: list[objects] .. py:function:: wapi.assets.list_work_versions(parent, column='*') Return a list of the child work versions of the given parent. :param parent: The parent work environment ( for example : "assets/characters/Joe/modeling/main/blender" ) as string or int :type parent: str or int :param column: The requested column data ( default is '*' ) :type column: str :return: A list with the work versions data. :rtype: list[objects]