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" PARENT_KEY = "PARENT"
# Information about supported transferable data. # 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 = { TRANSFER_DATA_TYPES = {
NONE_KEY: ("None", "BLANK1"), NONE_KEY: ("None", "BLANK1", 'none'),
VERTEX_GROUP_KEY: ("Vertex Groups", 'GROUP_VERTEX'), VERTEX_GROUP_KEY: ("Vertex Groups", 'GROUP_VERTEX', 'group_vertex_ui_bool'),
MODIFIER_KEY: ("Modifiers", 'MODIFIER'), MODIFIER_KEY: ("Modifiers", 'MODIFIER', 'modifier_ui_bool'),
CONSTRAINT_KEY: ("Constraints", 'CONSTRAINT'), CONSTRAINT_KEY: ("Constraints", 'CONSTRAINT', 'constraint_ui_bool'),
MATERIAL_SLOT_KEY: ("Materials", 'MATERIAL'), MATERIAL_SLOT_KEY: ("Materials", 'MATERIAL', 'material_ui_bool'),
SHAPE_KEY_KEY: ("Shape Keys", 'SHAPEKEY_DATA'), SHAPE_KEY_KEY: ("Shape Keys", 'SHAPEKEY_DATA', 'shapekey_ui_bool'),
ATTRIBUTE_KEY: ("Attributes", 'EVENT_A'), ATTRIBUTE_KEY: ("Attributes", 'EVENT_A', 'attribute_ui_bool'),
PARENT_KEY: ("Parent", 'FILE_PARENT'), PARENT_KEY: ("Parent", 'FILE_PARENT', 'file_parent_ui_bool'),
} }
# Convert it to the format that EnumProperty.items wants: # 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 asset_pipe = bpy.context.scene.asset_pipeline
if transfer_data == []: if transfer_data == []:
return 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() box = layout.box()
row = box.row() row = box.row()
row.prop( row.prop(
asset_pipe, asset_pipe,
f"{icon}_BOOL", ui_bool,
icon=icon, icon=icon,
text="", text="",
) )
row.label(text=name) row.label(text=name)
if not bool(asset_pipe.get(f"{icon}_BOOL")): if not bool(asset_pipe.get(ui_bool)):
return return
scene = bpy.context.scene scene = bpy.context.scene

View File

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