diff --git a/client/ayon_core/pipeline/create/context.py b/client/ayon_core/pipeline/create/context.py index ca88b9b63c..934dc66eed 100644 --- a/client/ayon_core/pipeline/create/context.py +++ b/client/ayon_core/pipeline/create/context.py @@ -2043,7 +2043,8 @@ class CreateContext: variant, folder_entity=None, task_entity=None, - pre_create_data=None + pre_create_data=None, + active=True ): """Trigger create of plugins with standartized arguments. @@ -2061,6 +2062,8 @@ class CreateContext: of creation (possible context of created instance/s). task_entity (Dict[str, Any]): Task entity. pre_create_data (Dict[str, Any]): Pre-create attribute values. + active (Optional[bool]): Whether the created instance defaults + to be active or not. Defaults to True. Returns: Any: Output of triggered creator's 'create' method. @@ -2124,7 +2127,8 @@ class CreateContext: "folderPath": folder_entity["path"], "task": task_entity["name"] if task_entity else None, "productType": creator.product_type, - "variant": variant + "variant": variant, + "active": bool(active) } return creator.create( product_name, diff --git a/client/ayon_core/pipeline/workfile/workfile_template_builder.py b/client/ayon_core/pipeline/workfile/workfile_template_builder.py index 4a1f3a84da..99f320e9c1 100644 --- a/client/ayon_core/pipeline/workfile/workfile_template_builder.py +++ b/client/ayon_core/pipeline/workfile/workfile_template_builder.py @@ -1797,6 +1797,16 @@ class PlaceholderCreateMixin(object): "\ncompiling of product name." ) ), + attribute_definitions.BoolDef( + "active", + label="Active", + default=options.get("active", True), + tooltip=( + "Active" + "\nDefines whether the created instance will default to " + "active or not." + ) + ), attribute_definitions.UISeparatorDef(), attribute_definitions.NumberDef( "order", @@ -1826,6 +1836,7 @@ class PlaceholderCreateMixin(object): legacy_create = self.builder.use_legacy_creators creator_name = placeholder.data["creator"] create_variant = placeholder.data["create_variant"] + active = placeholder.data.get("active", True) creator_plugin = self.builder.get_creators_by_name()[creator_name] @@ -1873,7 +1884,8 @@ class PlaceholderCreateMixin(object): create_variant, folder_entity, task_entity, - pre_create_data=pre_create_data + pre_create_data=pre_create_data, + active=active ) except: # noqa: E722