From 0e7d4658d8fbbe3823a5c79a0042b92cb9122897 Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Fri, 26 Jan 2024 16:18:35 +0100 Subject: [PATCH 1/2] fix: filter task type for the active project (as expected) --- scripts-blender/addons/blender_kitsu/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-blender/addons/blender_kitsu/cache.py b/scripts-blender/addons/blender_kitsu/cache.py index c261545d..7b2a9ba8 100644 --- a/scripts-blender/addons/blender_kitsu/cache.py +++ b/scripts-blender/addons/blender_kitsu/cache.py @@ -479,7 +479,7 @@ def get_shot_task_types_enum( # Update Cache project ID _all_shot_tasks_cache_proj_id = project_active.id - 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] _task_types_shots_enum_list.clear() _task_types_shots_enum_list.extend(items) -- 2.30.2 From dbb40d3f6f2b233b4cc9ca7fd39b1159a5402060 Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Thu, 1 Feb 2024 10:44:06 +0100 Subject: [PATCH 2/2] fix: adds active project task filtering for get_task_types_enum_for_current_context --- scripts-blender/addons/blender_kitsu/cache.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts-blender/addons/blender_kitsu/cache.py b/scripts-blender/addons/blender_kitsu/cache.py index 7b2a9ba8..e97afda7 100644 --- a/scripts-blender/addons/blender_kitsu/cache.py +++ b/scripts-blender/addons/blender_kitsu/cache.py @@ -443,19 +443,32 @@ def get_task_types_enum_for_current_context( self: bpy.types.Operator, context: bpy.types.Context ) -> List[Tuple[str, str, str]]: global _task_types_enum_list + global _project_active # Import within function to avoid circular import from .context import core as context_core items = [] 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(): - 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(): - 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.extend(items) -- 2.30.2