Skip to content

Conversation

@Tilix4
Copy link

@Tilix4 Tilix4 commented Sep 17, 2025

Changelog Description

Allow to launch an application from a context without folder nor task.

Additional review information

This feature is based on stax integration use case: we want to open a folder which doesn't have a task, like an episode, in order to open blender in the episode context and load all shots from this episode.

Testing notes:

  1. Launch Blender using this code in console
from ayon_core.addon import AddonsManager
manager = AddonsManager()
apps = manager.get_enabled_addon("applications")
apps.launch_application(
            "blender/4-2",
            project_name="your_project", # TODO
            folder_path="/episodes/se01/sh001", # TODO
        )

@MustafaJafar MustafaJafar added type: enhancement Improvement of existing functionality or minor addition community Issues and PRs coming from the community members labels Sep 17, 2025
@iLLiCiTiT
Copy link
Member

I won't be devil's advocate here because I'm not the one who decided, but the decision in past was that host integrations do require a task to be able to launch them. Which is also connected to actions showed in UIs BTW.

@Tilix4
Copy link
Author

Tilix4 commented Sep 17, 2025

I'll insist on this, blocking to basically launch an app on raw folders is a strong limitation. Avoiding workfile creation on folders I'd understand, but there are many use cases where we would like to open at a hierarchy folder context, and overviewing an editing is one of them.

@MustafaJafar
Copy link
Member

Adding my 2 cents,

  • I can imagine you want to have something similar in UX to tray publisher where you can launch without folder or task context and it should get the context from the context selection on the left panel. Also, you don't care about saving any workfiles.
  • As far as I know, Launching apps without task can cause some issues, e.g. default work template expect a task name, publisher expect current task as the default task when creating publish instnances.

@Tilix4
Copy link
Author

Tilix4 commented Sep 18, 2025

  • As far as I know, Launching apps without task can cause some issues

I think it's okay to allow a process to work when someone knows what they are doing, while not supporting it as regular behaviour.

  • publisher expect current task as the default task when creating publish instnances

That's the next step of Stax integration: make possible to publish a review to several tasks during a single publish. We'll see how it goes.

Comment on lines +624 to 632
missing_context = []
if not folder_entity:
missing_context.append('folder')
if not task_entity:
missing_context.append('task')
log.warning(
f"Missing {', '.join(missing_context)} from context. "
"Skipping workfile preparation."
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
missing_context = []
if not folder_entity:
missing_context.append('folder')
if not task_entity:
missing_context.append('task')
log.warning(
f"Missing {', '.join(missing_context)} from context. "
"Skipping workfile preparation."
)
log.warning(
"Task is not set. Skipping workfile preparation."
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall I raise an error when a folder is not provided? I can imagine working without tasks but not without folders ATM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about that. Considering what actually happens here in this function, it should be just:

if not task_entity:
    log.warning(
        "Task is not set. Skipping workfile preparation."
    )
    return

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry of maybe getting it wrong, but I've added above, which is about folder too

missing_context = []
if not folder_entity:
       missing_context.append('folder')

What am I missing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to, the information has no value, only what matters is if is set task.

The message should be "Task is not set. Skipping workfile preparation." and it doesn't matter if folder is or is not set, the task is the important bit.

@BigRoy
Copy link
Contributor

BigRoy commented Sep 18, 2025

I'll insist on this, blocking to basically launch an app on raw folders is a strong limitation. Avoiding workfile creation on folders I'd understand, but there are many use cases where we would like to open at a hierarchy folder context, and overviewing an editing is one of them.

Sure - but you'd never be in a working context because in AYON, that requires an active task. The logic assumes or is written around the fact that you're always working in a task. So the only thing you would only be able to do outside a task is launch the app - but you couldn't initialize the full launch logic due to not being inside a task to work in... and hence unable to initialize work directories, etc.

Also, if the launcher would show applications... for all folders, even when not actively in a task. Then I can assure you that you'll face situations where people do not know what they're doing where they'll be launching that app unintentionally outside of a task. Hence, if we would allow it in some form then:

  • Do not make it appear everywhere all the time, users will be doing it wrong. It should be edge cases only.
  • It should be very clear that it's special behavior somehow.
  • Perhaps an application should be able to define whether it's allowed to launch without an active task in context. So that it's special to those integrations only?
  • And I want to stress that the majority of logic in DCCs (especially work area logic, etc.) will be assuming a task context is set, since it has always been the rule for a working context.

Admittedly it sounds like what you're doing is purely viewing... and that viewing you wouldn't save any workfiles for - in a way... you're not in a working context perhaps. Hence it's not a "workfiles host integration" and perhaps for those cases the strictness can be lifted.

@MustafaJafar
Copy link
Member

I think this special behaviour may need additional tweaks to prevent using some AYON tools. e.g. the workfile tools.

@Tilix4
Copy link
Author

Tilix4 commented Sep 19, 2025

I agree with most of @BigRoy statement and I'll contribute to the brainstorming.

  • Do not make it appear everywhere all the time, users will be doing it wrong

I'm not saying that every host should appear on every folder. Only that it should be possible to launch any app on a folder without a task in context, but not by default in the launcher. Maybe I wasn't explicit enough there, making it "possible" doesn't mean "accessible" all the time.

  • Perhaps an application should be able to define whether it's allowed to launch without an active task in context. So that it's special to those integrations only?

I think this isn't up to the application to decide. For example, Stax is a way of working with Blender, so if you prevent Blender to be launched from folders, you're blocking Stax to function.

My point is: All is about what kind of data you're about to create. Most of the time DCCs are used to create production data, which are meant to be used in the final render. In such case, tasks are the way to work.
If you want to create content about a data, metadata like, which is what review is about (it could be considered as a metadata about a file, about a version in Ayon's workflow), therefore you can open from folders and will create metadata for a bunch of files/representations/versions in a row. BUT this is not a matter of which DCC you're about to use, I agree for most DCCs this has no point and will never be considered though (imagine reviewing an editing in nuke...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants