Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creators: fix undefined task name #480

Merged
merged 4 commits into from
May 6, 2024
Merged

Conversation

antirotor
Copy link
Member

Changelog Description

When there was no taskEntity passed, task name was filled correctly but if not task name was None, passed down the line and causing crashes. This change is trying to find taskEntity and fill task name properly.

Testing notes:

Difficult to test as it depends on specific creator login at the end. But running something like this in Maya script editor should test it:

import ayon_api
from ayon_core.pipeline import registered_host
from ayon_core.pipeline.create import CreateContext


host = registered_host() 
context = CreateContext(host)
project_name = host.get_current_project_name()
folder_path = "/path/to/your/test/folder"
task_name = "layout"

folder_entity = ayon_api.get_folder_by_path(project_name, folder_path)

creator_identifier = f"io.openpype.creators.maya.layout"
task = ayon_api.get_task_by_name(project_name, folder_entity["id"], task_name)

context_set = context.create(
            creator_identifier,
            variant="Main",
            folder_entity=ayon_api.get_folder_by_path(project_name, folder_path),
            task_entity=ayon_api.get_task_by_name(project_name, folder_entity["id"], task_name),
            pre_create_data={"use_selection": False}
)

@antirotor antirotor added the bug label May 3, 2024
@antirotor antirotor requested a review from iLLiCiTiT May 3, 2024 10:06
@antirotor antirotor self-assigned this May 3, 2024
@ynbot ynbot added type: bug Something isn't working size/XS labels May 3, 2024
client/ayon_core/pipeline/create/context.py Outdated Show resolved Hide resolved
client/ayon_core/pipeline/create/context.py Outdated Show resolved Hide resolved
client/ayon_core/pipeline/create/context.py Outdated Show resolved Hide resolved
@antirotor antirotor merged commit d592e56 into develop May 6, 2024
1 check failed
@antirotor antirotor deleted the bugfix/fix-creator-task-name branch May 6, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS type: bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants