Asset Pipeline v2 #145
@ -5,23 +5,13 @@
|
|||||||
# You could even choose to name your task layers after artists in your team.
|
# You could even choose to name your task layers after artists in your team.
|
||||||
# {Task Layer Key: Collection/UI name}
|
# {Task Layer Key: Collection/UI name}
|
||||||
|
|
||||||
# TODO Replace ENUM with List
|
TASK_LAYER_TYPES = [
|
||||||
TASK_LAYER_TYPES = {
|
"Modeling",
|
||||||
"NONE": "None",
|
"Rigging",
|
||||||
"Modeling": "Modeling",
|
"Shading",
|
||||||
"Rigging": "Rigging",
|
|
||||||
"Shading": "Shading",
|
|
||||||
}
|
|
||||||
|
|
||||||
# When creating a new asset, start in this task layer's file.
|
|
||||||
STARTING_FILE = 'Modeling'
|
|
||||||
|
|
||||||
# Convert it to the format that EnumProperty.items wants:
|
|
||||||
# List of 3-tuples, re-use name as description at 3rd element.
|
|
||||||
TASK_LAYER_TYPES_ENUM_ITEMS = [
|
|
||||||
(key, value, value) for key, value in TASK_LAYER_TYPES.items()
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
NONE_KEY = "NONE"
|
NONE_KEY = "NONE"
|
||||||
VERTEX_GROUP_KEY = "GROUP_VERTEX"
|
VERTEX_GROUP_KEY = "GROUP_VERTEX"
|
||||||
VERTEX_COLOR_KEY = "COLOR_ATTRIBUTE"
|
VERTEX_COLOR_KEY = "COLOR_ATTRIBUTE"
|
||||||
|
@ -99,12 +99,6 @@ class AssetTransferMapping:
|
|||||||
"""
|
"""
|
||||||
coll_map: Dict[bpy.types.Collection, bpy.types.Collection] = {}
|
coll_map: Dict[bpy.types.Collection, bpy.types.Collection] = {}
|
||||||
|
|
||||||
local_tl_names = [
|
|
||||||
get_name_with_asset_prefix(tl_ui_name)
|
|
||||||
for tl_key, tl_ui_name in constants.TASK_LAYER_TYPES.items()
|
|
||||||
if tl_key in self._local_tls
|
|
||||||
]
|
|
||||||
|
|
||||||
for local_task_layer_col in self._local_top_col.children:
|
for local_task_layer_col in self._local_top_col.children:
|
||||||
if local_task_layer_col.asset_id_owner not in self._local_tls:
|
if local_task_layer_col.asset_id_owner not in self._local_tls:
|
||||||
# Replace source object suffix with target suffix to get target object.
|
# Replace source object suffix with target suffix to get target object.
|
||||||
|
@ -147,7 +147,7 @@ def get_name_with_task_layer_prefix(name: str, td_type_key: str) -> str:
|
|||||||
str: Returns name with prefix
|
str: Returns name with prefix
|
||||||
"""
|
"""
|
||||||
prefix = get_default_task_layer(td_type_key)
|
prefix = get_default_task_layer(td_type_key)
|
||||||
for task_layer_key in constants.TASK_LAYER_TYPES.keys():
|
for task_layer_key in constants.TASK_LAYER_TYPES:
|
||||||
if name.startswith(task_layer_key + "."):
|
if name.startswith(task_layer_key + "."):
|
||||||
return name
|
return name
|
||||||
return prefix + "." + name
|
return prefix + "." + name
|
||||||
|
@ -50,7 +50,7 @@ class ASSETPIPE_OT_create_new_asset(bpy.types.Operator):
|
|||||||
# Dynamically Create Task Layer Bools
|
# Dynamically Create Task Layer Bools
|
||||||
all_task_layers = context.scene.asset_pipeline.all_task_layers
|
all_task_layers = context.scene.asset_pipeline.all_task_layers
|
||||||
all_task_layers.clear()
|
all_task_layers.clear()
|
||||||
for task_layer_key in constants.TASK_LAYER_TYPES.keys():
|
for task_layer_key in constants.TASK_LAYER_TYPES:
|
||||||
if task_layer_key == "NONE":
|
if task_layer_key == "NONE":
|
||||||
continue
|
continue
|
||||||
new_task_layer = all_task_layers.add()
|
new_task_layer = all_task_layers.add()
|
||||||
@ -119,7 +119,7 @@ class ASSETPIPE_OT_create_new_asset(bpy.types.Operator):
|
|||||||
|
|
||||||
# TODO Support mulitple task layers in same file
|
# TODO Support mulitple task layers in same file
|
||||||
# Create the file for each task layer.
|
# Create the file for each task layer.
|
||||||
for task_layer_key in constants.TASK_LAYER_TYPES.keys():
|
for task_layer_key in constants.TASK_LAYER_TYPES:
|
||||||
if task_layer_key == "NONE" or task_layer_key in local_tls:
|
if task_layer_key == "NONE" or task_layer_key in local_tls:
|
||||||
continue
|
continue
|
||||||
name = self._name + "." + task_layer_key + ".blend"
|
name = self._name + "." + task_layer_key + ".blend"
|
||||||
|
@ -144,7 +144,7 @@ def sync_execute_push(self, context):
|
|||||||
|
|
||||||
local_tls = [
|
local_tls = [
|
||||||
task_layer
|
task_layer
|
||||||
for task_layer in constants.TASK_LAYER_TYPES.keys()
|
for task_layer in constants.TASK_LAYER_TYPES
|
||||||
if task_layer not in self._task_layer_keys
|
if task_layer not in self._task_layer_keys
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user