Asset Pipeline v2 #145

Closed
Nick Alberelli wants to merge 431 commits from (deleted):feature/asset-pipeline-v2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 7fc699a58f - Show all commits

View File

@ -116,22 +116,6 @@ def add_suffix_to_hierarchy(collection: bpy.types.Collection, suffix_base: str)
# TODO Cleanup prefix doc strings # TODO Cleanup prefix doc strings
def get_name_with_prefix(name: str, prefix: str) -> str:
"""Returns a string with the prefix.
Args:
name (str): Name to add prefix to
prefix (str): Prefix to add to name
Returns:
str: Returns name with prefix
"""
if name.startswith(prefix + "."):
return name
prefix = prefix + "." if prefix != "" else ""
return prefix + name
def get_name_with_asset_prefix(name: str) -> str: def get_name_with_asset_prefix(name: str) -> str:
"""Returns a string with the prefix if it is not already set. """Returns a string with the prefix if it is not already set.
Users can specify a prefix to live on all objects during the Users can specify a prefix to live on all objects during the
@ -144,7 +128,10 @@ def get_name_with_asset_prefix(name: str) -> str:
str: Returns name with prefix str: Returns name with prefix
""" """
asset_pipe = bpy.context.scene.asset_pipeline asset_pipe = bpy.context.scene.asset_pipeline
return get_name_with_prefix(name, asset_pipe.prefix) if name.startswith(asset_pipe.prefix + "."):
return name
prefix = asset_pipe.prefix + "." if asset_pipe.prefix != "" else ""
return prefix + name
def get_name_with_task_layer_prefix(name: str) -> str: def get_name_with_task_layer_prefix(name: str) -> str:
@ -159,7 +146,11 @@ def get_name_with_task_layer_prefix(name: str) -> str:
str: Returns name with prefix str: Returns name with prefix
""" """
asset_pipe = bpy.context.scene.asset_pipeline asset_pipe = bpy.context.scene.asset_pipeline
return get_name_with_prefix(name, asset_pipe.task_layer_name) for task_layer_key in constants.TASK_LAYER_TYPES.keys():
if name.startswith(task_layer_key + "."):
return name
prefix = asset_pipe.prefix + "." if asset_pipe.prefix != "" else ""
return prefix + name
def get_task_layer_col_name(task_layer_key) -> str: def get_task_layer_col_name(task_layer_key) -> str: