mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Default active to None and then do not pass it to the instance_data
This commit is contained in:
parent
2841e20e96
commit
849ab8b624
1 changed files with 6 additions and 4 deletions
|
|
@ -2044,7 +2044,7 @@ class CreateContext:
|
||||||
folder_entity=None,
|
folder_entity=None,
|
||||||
task_entity=None,
|
task_entity=None,
|
||||||
pre_create_data=None,
|
pre_create_data=None,
|
||||||
active=True
|
active=None
|
||||||
):
|
):
|
||||||
"""Trigger create of plugins with standartized arguments.
|
"""Trigger create of plugins with standartized arguments.
|
||||||
|
|
||||||
|
|
@ -2063,7 +2063,7 @@ class CreateContext:
|
||||||
task_entity (Dict[str, Any]): Task entity.
|
task_entity (Dict[str, Any]): Task entity.
|
||||||
pre_create_data (Dict[str, Any]): Pre-create attribute values.
|
pre_create_data (Dict[str, Any]): Pre-create attribute values.
|
||||||
active (Optional[bool]): Whether the created instance defaults
|
active (Optional[bool]): Whether the created instance defaults
|
||||||
to be active or not. Defaults to True.
|
to be active or not.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Any: Output of triggered creator's 'create' method.
|
Any: Output of triggered creator's 'create' method.
|
||||||
|
|
@ -2127,9 +2127,11 @@ class CreateContext:
|
||||||
"folderPath": folder_entity["path"],
|
"folderPath": folder_entity["path"],
|
||||||
"task": task_entity["name"] if task_entity else None,
|
"task": task_entity["name"] if task_entity else None,
|
||||||
"productType": creator.product_type,
|
"productType": creator.product_type,
|
||||||
"variant": variant,
|
"variant": variant
|
||||||
"active": bool(active)
|
|
||||||
}
|
}
|
||||||
|
if active is not None:
|
||||||
|
instance_data["active"] = bool(active)
|
||||||
|
|
||||||
return creator.create(
|
return creator.create(
|
||||||
product_name,
|
product_name,
|
||||||
instance_data,
|
instance_data,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue