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.
3 changed files with 26 additions and 23 deletions
Showing only changes of commit 415d9e3993 - Show all commits

View File

@ -16,16 +16,17 @@ ATTRIBUTE_KEY = "ATTRIBUTE"
PARENT_KEY = "PARENT"
# Information about supported transferable data.
# {Key string : ("UI Name", 'ICON')}
# UI Bools are defined in props.py file
# {Key string : ("UI Name", 'ICON', "UI_BOOL_KEY")}
TRANSFER_DATA_TYPES = {
NONE_KEY: ("None", "BLANK1"),
VERTEX_GROUP_KEY: ("Vertex Groups", 'GROUP_VERTEX'),
MODIFIER_KEY: ("Modifiers", 'MODIFIER'),
CONSTRAINT_KEY: ("Constraints", 'CONSTRAINT'),
MATERIAL_SLOT_KEY: ("Materials", 'MATERIAL'),
SHAPE_KEY_KEY: ("Shape Keys", 'SHAPEKEY_DATA'),
ATTRIBUTE_KEY: ("Attributes", 'EVENT_A'),
PARENT_KEY: ("Parent", 'FILE_PARENT'),
NONE_KEY: ("None", "BLANK1", 'none'),
VERTEX_GROUP_KEY: ("Vertex Groups", 'GROUP_VERTEX', 'group_vertex_ui_bool'),
MODIFIER_KEY: ("Modifiers", 'MODIFIER', 'modifier_ui_bool'),
CONSTRAINT_KEY: ("Constraints", 'CONSTRAINT', 'constraint_ui_bool'),
MATERIAL_SLOT_KEY: ("Materials", 'MATERIAL', 'material_ui_bool'),
SHAPE_KEY_KEY: ("Shape Keys", 'SHAPEKEY_DATA', 'shapekey_ui_bool'),
ATTRIBUTE_KEY: ("Attributes", 'EVENT_A', 'attribute_ui_bool'),
PARENT_KEY: ("Parent", 'FILE_PARENT', 'file_parent_ui_bool'),
}
# Convert it to the format that EnumProperty.items wants:

View File

@ -10,17 +10,17 @@ def draw_transfer_data_type(
asset_pipe = bpy.context.scene.asset_pipeline
if transfer_data == []:
return
name, icon = constants.TRANSFER_DATA_TYPES[transfer_data[0].type]
name, icon, ui_bool = constants.TRANSFER_DATA_TYPES[transfer_data[0].type]
box = layout.box()
row = box.row()
row.prop(
asset_pipe,
f"{icon}_BOOL",
ui_bool,
icon=icon,
text="",
)
row.label(text=name)
if not bool(asset_pipe.get(f"{icon}_BOOL")):
if not bool(asset_pipe.get(ui_bool)):
return
scene = bpy.context.scene

View File

@ -110,20 +110,22 @@ class AssetPipeline(bpy.types.PropertyGroup):
all_task_layers: bpy.props.CollectionProperty(type=TaskLayerSettings)
local_task_layers: bpy.props.CollectionProperty(type=TaskLayerSettings)
# UI BOOLS
# The names of the bools are the ICON keys for each transfer data type with the name _BOOL appened to it
# TODO See if there is a better way to handle hide/expand panels without creating bools like this
GROUP_VERTEX_BOOL: bpy.props.BoolProperty(
# UI BOOLS: used to show/hide transfer data elements
# The names are also hard coded in constants.py under TRANSFER_DATA_TYPES
# any changes will need to be reflected both here and in that enum
group_vertex_ui_bool: bpy.props.BoolProperty(
name="Show/Hide Vertex Groups", default=False
)
MODIFIER_BOOL: bpy.props.BoolProperty(name="Show/Hide Modifiers", default=False)
CONSTRAINT_BOOL: bpy.props.BoolProperty(name="Show/Hide Constraints", default=False)
MATERIAL_BOOL: bpy.props.BoolProperty(name="Show/Hide Materials", default=False)
SHAPEKEY_DATA_BOOL: bpy.props.BoolProperty(
name="Show/Hide Shape Keys", default=False
modifier_ui_bool: bpy.props.BoolProperty(name="Show/Hide Modifiers", default=False)
constraint_ui_bool: bpy.props.BoolProperty(
name="Show/Hide Constraints", default=False
)
EVENT_A_BOOL: bpy.props.BoolProperty(name="Show/Hide Attributes", default=False)
FILE_PARENT_BOOL: bpy.props.BoolProperty(name="Show/Hide Parent", default=False)
material_ui_bool: bpy.props.BoolProperty(name="Show/Hide Materials", default=False)
shapekey_ui_bool: bpy.props.BoolProperty(name="Show/Hide Shape Keys", default=False)
attribute_ui_bool: bpy.props.BoolProperty(
name="Show/Hide Attributes", default=False
)
file_parent_ui_bool: bpy.props.BoolProperty(name="Show/Hide Parent", default=False)
classes = (