Asset Pipeline v2 #145
@ -8,6 +8,8 @@ ADDON_NAME = "asset_pipeline_2"
|
||||
TASK_LAYER_CONFIG_NAME = "task_layers.json"
|
||||
TASK_LAYER_CONFIG_DIR_NAME = "task_layer_configs"
|
||||
|
||||
DELIMITER = "-"
|
||||
|
||||
NONE_KEY = "NONE"
|
||||
VERTEX_GROUP_KEY = "GROUP_VERTEX"
|
||||
MODIFIER_KEY = "MODIFIER"
|
||||
|
@ -128,9 +128,9 @@ def asset_prefix_name_get(name: str) -> str:
|
||||
str: Returns name with prefix
|
||||
"""
|
||||
asset_pipe = bpy.context.scene.asset_pipeline
|
||||
if name.startswith(asset_pipe.prefix + "."):
|
||||
if name.startswith(asset_pipe.prefix + constants.DELIMITER):
|
||||
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
|
||||
|
||||
|
||||
@ -147,10 +147,12 @@ def task_layer_prefix_name_get(name: str, task_layer_owner: str) -> str:
|
||||
str: Returns name with prefix
|
||||
"""
|
||||
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
|
||||
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:
|
||||
@ -165,8 +167,10 @@ def task_layer_prefix_basename_get(name: str) -> str:
|
||||
str: Returns name without task layer prefix
|
||||
"""
|
||||
for task_layer_key in config.TASK_LAYER_TYPES:
|
||||
if name.startswith(config.TASK_LAYER_TYPES[task_layer_key] + "."):
|
||||
return name.replace(name.split(".")[0], "")[1:]
|
||||
if name.startswith(
|
||||
config.TASK_LAYER_TYPES[task_layer_key] + constants.DELIMITER
|
||||
):
|
||||
return name.replace(name.split(constants.DELIMITER)[0], "")[1:]
|
||||
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)
|
||||
base_name = task_layer_prefix_basename_get(transfer_data_item.name)
|
||||
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):
|
||||
return
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user