wapi.assets#
Use this module to interact with the wizard assets.
Creation commands#
- wapi.assets.create_sequence(name)#
Create a sequence in the current wizard project.
- Parameters:
name (str) – The sequence name
- Returns:
The sequence asset as string.
- Return type:
str
- 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)
- Parameters:
parent (str or int) – The parent category as string or int
name (str) – The asset name
- Returns:
The asset as string.
- Return type:
str
- 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)
- Parameters:
parent (str or int) – The parent asset as string or int
stage (str) – The stage name
- Returns:
The stage as string.
- Return type:
str
- wapi.assets.create_variant(parent, name)#
Create a variant for the given stage parent ( for example : “assets/characters/Joe/modeling” or the parent id)
- Parameters:
parent (str or int) – The parent stage as string or int
name (str) – The variant name
- Returns:
The variant as string.
- Return type:
str
- 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 )
- Parameters:
parent (str or int) – The parent variant as string or int
software (str) – The software name
- Returns:
The work environment as string.
- Return type:
str
Exports commands#
- wapi.assets.create_export(variant, export_name, files_list, comment='')#
Create a new export in the given variant as string or int.
- Parameters:
variant (str or int) – The variant as string or int
export_name (str) – The export name ( LOD1, LOD2, etc )
files_list (list[str]) – The list of files to add to the export.
comment (str) – An optionnal comment
- Returns:
The success
- Return type:
bool
- 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.
- Parameters:
work_env (str or int) – The work environment as string or int
namespaces_list (list[str]) – The list of namespaces to export ( only for the export of animation, camera and cfx )
rolls (bool) – Apply rolls to the frame range
custom_frame_range (list[int, int]) – Give a custom frame range for the export here, if None, wizard will export the default frame range of the asset or shot.
refresh_assets_in_scene (bool) – Referesh the assets in the scene before the export.
- Returns:
None
- Return type:
None
- 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.
- Parameters:
work_env (str or int) – The work environment as string or int
namespaces_list (list[str]) – The list of camrig namespaces to export
rolls (bool) – Apply rolls to the frame range
custom_frame_range (list[int, int]) – Give a custom frame range for the export here, if None, wizard will export the default frame range of the asset or shot.
refresh_assets_in_scene (bool) – Referesh the assets in the scene before the export.
- Returns:
None
- Return type:
None
Groups commands#
- wapi.assets.create_group(name)#
Create a group with the given name.
- Parameters:
name (str) – The name of the new group
- Returns:
The group id
- Return type:
int
- wapi.assets.modify_group_color(group, color)#
Modify the group color with the given hex color code.
- Parameters:
group (str or int) – The name or the id of the group to modify
color (str) – The color as a hex color code string.
- Returns:
The success
- Return type:
bool
- wapi.assets.delete_group(group)#
Delete the given group.
- Parameters:
group (str or int) – The name or the id of the group to delete
- Returns:
The success
- Return type:
bool
References commands#
- wapi.assets.create_reference(destination_work_env, variant_to_reference)#
Create a reference of the given variant in the given destination work environment
- Parameters:
destination_work_env (str or int) – The destination work environment as string or int
variant_to_reference (str or int) – The variant to reference as string or int
- Returns:
The new references as a list of namespaces
- Return type:
list[str]
- wapi.assets.create_grouped_reference(destination_group, variant_to_reference)#
Create a reference of the given variant in the given destination group
- Parameters:
destination_group (str or int) – The destination group name as string or int
variant_to_reference (str or int) – The variant to reference as string or int
- Returns:
The new references as a list of namespaces
- Return type:
list[str]
- wapi.assets.create_referenced_group(destination_work_env, group)#
Create a reference of the given group in the given destination work environment
- Parameters:
destination_work_env (str or int) – The destination work environment as string or int
group (str or int) – The group name to reference as string or int
- Returns:
The new referenced groups as a list of namespaces
- Return type:
list[str]
- wapi.assets.get_references(work_env)#
Return the work environment references as a list of namespaces
- Parameters:
work_env (str or int) – The work environment as string or int
- Returns:
The references as a list of namespaces
- Return type:
list[str]
- wapi.assets.get_references_from_group(group)#
Return the grouped references as a list of namespaces
- Parameters:
group (str or int) – The group name as string or group id as int
- Returns:
The grouped references as a list of namespaces
- Return type:
list[str]
- wapi.assets.get_referenced_groups(work_env)#
Return the work environment referenced groups as a list of namespaces
- Parameters:
work_env (str or int) – The work environment as string or int
- Returns:
The referenced groups as a list of namespaces
- Return type:
list[str]
- wapi.assets.remove_reference(work_env, reference)#
Remove the given reference ( as namespace ) from the given work environment
- Parameters:
work_env (str or int) – The work environment as string or int
reference (str) – The reference namespace
- Returns:
The success
- Return type:
bool or None
- wapi.assets.remove_reference_from_group(group, reference)#
Remove the given reference ( as namespace ) from the given group
- Parameters:
group (str or int) – The group name as string or group id as int
reference (str) – The grouped reference namespace
- Returns:
The success
- Return type:
bool or None
- wapi.assets.remove_referenced_group(work_env, referenced_group)#
Remove the given referenced_group ( as namespace ) from the given work environment
- Parameters:
work_env (str or int) – The work environment as string or int
referenced_group (str) – The group namespace
- Returns:
The success
- Return type:
bool or None
- wapi.assets.set_reference_as_default(work_env, reference)#
Modify the reference in the given work environment to match the default export version
- Parameters:
work_env (str or int) – The work environment as string or int
reference (str) – The reference namespace
- Returns:
The success
- Return type:
bool or None
- wapi.assets.set_grouped_reference_as_default(group, reference)#
Modify the reference in the given group to match the default export version
- Parameters:
group (str or int) – The group name as string or group id as int
reference (str) – The reference namespace
- Returns:
The success
- Return type:
bool or None
- wapi.assets.modify_reference_auto_update(work_env, reference, auto_update=True)#
Set the given reference to auto update in the given work environment
- Parameters:
work_env (str or int) – The work environment as string or int
reference (str) – The reference namespace
auto_update (bool) – Auto update state ( default is True )
- Returns:
The success
- Return type:
bool or None
- wapi.assets.modify_grouped_reference_auto_update(group, reference, auto_update=True)#
Set the given reference to auto update in the given group
- Parameters:
group (str or int) – The group name as string or group id as int
reference (str) – The grouped reference namespace
auto_update (bool) – Auto update state ( default is True )
- Returns:
The success
- Return type:
bool or None
Archive commands#
- wapi.assets.archive_asset(asset)#
Archive the given asset
- Parameters:
asset (str or int) – The asset as string ( for example : “assets/characters/Joe” ) or as int ( ex : 24 )
- Returns:
The success.
- Return type:
bool
- wapi.assets.archive_sequence(sequence)#
Archive the given sequence
- Parameters:
sequence (str or int) – The sequence as string ( for example : “sequences/seq_0001” ) or int
- Returns:
The success.
- Return type:
bool
- wapi.assets.archive_stage(stage)#
Archive the given stage
- Parameters:
stage (str or int) – The stage as string ( for example : “sequences/seq_0001/sh_0001/animation” ) or int
- Returns:
The success.
- Return type:
bool
- wapi.assets.archive_variant(variant)#
Archive the given variant
- Parameters:
variant (str or int) – The variant as string ( for example : “sequences/seq_0001/sh_0001/animation/main” ) or int
- Returns:
The success.
- Return type:
bool
- wapi.assets.archive_work_env(work_env)#
Archive the given work_env
- Parameters:
work_env (str or int) – The work_env as string ( for example : “sequences/seq_0001/sh_0001/animation/main/maya” ) or int
- Returns:
The success.
- Return type:
bool
- wapi.assets.archive_work_version(work_version)#
Archive the given work_version
- Parameters:
work_version (str or int) – The work_version as string ( for example : “sequences/seq_0001/sh_0001/animation/main/maya/0001” ) or int
- Returns:
The success.
- Return type:
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 Wapi examples section.
- wapi.assets.list_domains(column='*')#
Return a list with the domains of the current project. ( [‘assets’, ‘library’, ‘sequences’] )
- Parameters:
column (str) – The requested column data ( default is ‘*’ )
- Returns:
A list with the project domains data.
- Return type:
list[objects]
- wapi.assets.list_categories(parent, column='*')#
Return a list of the child categories of the given parent.
- Parameters:
parent (str or int) – The parent domain ( for example : “assets”, “library” or “sequences” ) as string or int
column (str) – The requested column data ( default is ‘*’ )
- Returns:
A list with the categories data.
- Return type:
list[objects]
- wapi.assets.list_assets(parent, column='*')#
Return a list of the child assets of the given parent.
- Parameters:
parent (str or int) – The parent category ( for example : “assets/characters” ) as string or int
column (str) – The requested column data ( default is ‘*’ )
- Returns:
A list with the assets data.
- Return type:
list[objects]
- wapi.assets.list_stages(parent, column='*')#
Return a list of the child stages of the given parent.
- Parameters:
parent (str or int) – The parent asset ( for example : “assets/characters/Joe” ) as string or int
column (str) – The requested column data ( default is ‘*’ )
- Returns:
A list with the stages data.
- Return type:
list[objects]
- wapi.assets.list_variants(parent, column='*')#
Return a list of the child variants of the given parent.
- Parameters:
parent (str or int) – The parent stage ( for example : “assets/characters/Joe/modeling” ) as string or int
column (str) – The requested column data ( default is ‘*’ )
- Returns:
A list with the variants data.
- Return type:
list[objects]
- wapi.assets.list_work_envs(parent, column='*')#
Return a list of the child work environments of the given parent.
- Parameters:
parent (str or int) – The parent variant ( for example : “assets/characters/Joe/modeling/main” ) as string or int
column (str) – The requested column data ( default is ‘*’ )
- Returns:
A list with the work environments data.
- Return type:
list[objects]
- wapi.assets.list_work_versions(parent, column='*')#
Return a list of the child work versions of the given parent.
- Parameters:
parent (str or int) – The parent work environment ( for example : “assets/characters/Joe/modeling/main/blender” ) as string or int
column (str) – The requested column data ( default is ‘*’ )
- Returns:
A list with the work versions data.
- Return type:
list[objects]