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.
2 changed files with 13 additions and 7 deletions
Showing only changes of commit cb37e1acfa - Show all commits

View File

@ -8,6 +8,8 @@ ADDON_NAME = "asset_pipeline_2"
TASK_LAYER_CONFIG_NAME = "task_layers.json" TASK_LAYER_CONFIG_NAME = "task_layers.json"
TASK_LAYER_CONFIG_DIR_NAME = "task_layer_configs" TASK_LAYER_CONFIG_DIR_NAME = "task_layer_configs"
DELIMITER = "-"
NONE_KEY = "NONE" NONE_KEY = "NONE"
VERTEX_GROUP_KEY = "GROUP_VERTEX" VERTEX_GROUP_KEY = "GROUP_VERTEX"
MODIFIER_KEY = "MODIFIER" MODIFIER_KEY = "MODIFIER"

View File

@ -128,9 +128,9 @@ def asset_prefix_name_get(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
if name.startswith(asset_pipe.prefix + "."): if name.startswith(asset_pipe.prefix + constants.DELIMITER):
return name return name
prefix = asset_pipe.prefix + "." if asset_pipe.prefix != "" else "" prefix = asset_pipe.prefix + constants.DELIMITER if asset_pipe.prefix != "" else ""
return prefix + name return prefix + name
@ -147,10 +147,12 @@ def task_layer_prefix_name_get(name: str, task_layer_owner: str) -> str:
str: Returns name with prefix str: Returns name with prefix
""" """
for task_layer_key in config.TASK_LAYER_TYPES: for task_layer_key in config.TASK_LAYER_TYPES:
if name.startswith(config.TASK_LAYER_TYPES[task_layer_key] + "."): if name.startswith(
config.TASK_LAYER_TYPES[task_layer_key] + constants.DELIMITER
):
return name return name
prefix = config.TASK_LAYER_TYPES[task_layer_owner] prefix = config.TASK_LAYER_TYPES[task_layer_owner]
return prefix + "." + name return prefix + constants.DELIMITER + name
def task_layer_prefix_basename_get(name: str) -> str: def task_layer_prefix_basename_get(name: str) -> str:
@ -165,8 +167,10 @@ def task_layer_prefix_basename_get(name: str) -> str:
str: Returns name without task layer prefix str: Returns name without task layer prefix
""" """
for task_layer_key in config.TASK_LAYER_TYPES: for task_layer_key in config.TASK_LAYER_TYPES:
if name.startswith(config.TASK_LAYER_TYPES[task_layer_key] + "."): if name.startswith(
return name.replace(name.split(".")[0], "")[1:] config.TASK_LAYER_TYPES[task_layer_key] + constants.DELIMITER
):
return name.replace(name.split(constants.DELIMITER)[0], "")[1:]
return name return name
@ -192,7 +196,7 @@ def task_layer_prefix_transfer_data_update(
td_data = data_type_from_transfer_data_key(obj, transfer_data_item.type) td_data = data_type_from_transfer_data_key(obj, transfer_data_item.type)
base_name = task_layer_prefix_basename_get(transfer_data_item.name) base_name = task_layer_prefix_basename_get(transfer_data_item.name)
prefix = config.TASK_LAYER_TYPES[transfer_data_item.owner] prefix = config.TASK_LAYER_TYPES[transfer_data_item.owner]
new_name = prefix + "." + base_name new_name = prefix + constants.DELIMITER + base_name
if new_name == transfer_data_item.name or not td_data.get(transfer_data_item.name): if new_name == transfer_data_item.name or not td_data.get(transfer_data_item.name):
return return