Blender Kitsu: fix task type filtering for the active project #216

Merged
Nick Alberelli merged 2 commits from slumber/blender-studio-pipeline:fix-project-task-filtering into main 2024-02-01 14:21:57 +01:00
Showing only changes of commit dbb40d3f6f - Show all commits

View File

@ -443,19 +443,32 @@ def get_task_types_enum_for_current_context(
self: bpy.types.Operator, context: bpy.types.Context self: bpy.types.Operator, context: bpy.types.Context
) -> List[Tuple[str, str, str]]: ) -> List[Tuple[str, str, str]]:
global _task_types_enum_list global _task_types_enum_list
global _project_active
# Import within function to avoid circular import # Import within function to avoid circular import
from .context import core as context_core from .context import core as context_core
items = [] items = []
if context_core.is_shot_context(): if context_core.is_shot_context():
items = [(t.id, t.name, "") for t in TaskType.all_shot_task_types()] items = [
(t.id, t.name, "")
for t in TaskType.all_shot_task_types()
if t.id in _project_active.task_types
]
if context_core.is_asset_context(): if context_core.is_asset_context():
items = [(t.id, t.name, "") for t in TaskType.all_asset_task_types()] items = [
(t.id, t.name, "")
for t in TaskType.all_asset_task_types()
if t.id in _project_active.task_types
]
if context_core.is_sequence_context(): if context_core.is_sequence_context():
items = [(t.id, t.name, "") for t in TaskType.all_sequence_task_types()] items = [
(t.id, t.name, "")
for t in TaskType.all_sequence_task_types()
if t.id in _project_active.task_types
]
_task_types_enum_list.clear() _task_types_enum_list.clear()
_task_types_enum_list.extend(items) _task_types_enum_list.extend(items)