ynput / ayon-shotgrid

A Shotgrid Addon for the Ayon server.
Apache License 2.0
5 stars 8 forks source link

AYON hierarchy-aware SG->AYON sync #137

Open jakubjezek001 opened 2 weeks ago

jakubjezek001 commented 2 weeks ago

Is there an existing issue for this?

Please describe the feature you have in mind and explain what the current shortcomings are?

SG doesn't have the ability to structure entities into generic folders as AYON. Using SG's project tracking features allows you to create hierarchies like Episode->Sequence->Shot however it's currently not possible to place these SG hierarchies in a custom AYON folder. You could probably disable SG project tracking and do all linking manually but I don't believe anyone is doing something like this. You can also use SGTK with tk-config-default2 and storage root links, however imho we shouldn't depend on it.

I believe this issue boils down to being able to use custom AYON folders as roots for SG hierarchies.

Syncing AYON entities to SG is easier since we just need folder_name and folder_type of AYON and create the SG entities respectively as SG takes care of the linking.

How would you imagine the implementation of the feature?

User Stories

As a dev I want to configure root folders for synced entities in AYON's hierarchy in order to integrate them better into custom AYON hierarchies.

As a user I want to use my custom AYON hierarchy for synced entities in order to place remotely created entities (SG) in the same folder structure I'd manually do in AYON.

As a user I wnat to use AYON's folder structure for the pipeline tools and local folder structure but create and organize my shots and assets in SG.

Example

Let's assume we're using SG project tracking with:

In AYON we're using this hierarchy. * marks non Folder type AYON folders ** marks AYON tasks

.
├── pre
│   ├── references
│   ├── storyboards
│   └── concept**
├── editorial
│   ├── dailies
│   ├── online**
│   └── offline**
├── build
│   └── assets
│       └── Prop
│       ├── Character
│       └── Environment
├── post
│   ├── schedules
│   └── episodes
│       └── ep01*
│           ├── seq01*
│           └── ep02*
└── deliveries
    ├── VendorA
    │   └── <SG_PLAYLIST>
    └── Client
        └── <SG_PLAYLIST>

I want the SG episodes to end up in AYON at /post/episodes/, the shots in /post/episodes/{episode}/{sequence}/ and the assets in /build/assets/{asset[type]}/.

Suggestion

We get SG's project tracking settings for enabled entity types and expose them as part of a new settings field in the compatibility settings. Each SG tracking setting gets a string field representing the AYON folder hierarchy to follow. E.g.:

SG Asset: AssetType->Asset --> AYON hierarchy to follow: /build/assets/{asset[type]}/

If a user doesn't want to use custom AYON hierarchies and basically start with a blank AYON project populated from SG they'd leave all lineedits empty and SG's project tracking settings will be followed (even if flat? error otherwise?).

I think this way we could support any AYON hierarchy with any SG project tracking.

Are there any labels you wish to add?

Describe alternatives you've considered:

No response

Additional context:

No response

kalisp commented 1 week ago

I think that base of this is already in https://github.com/ynput/ayon-shotgrid/pull/129

You could configure starting location (hierarchy in AYON) for these types. image

Current implementation differentiate between shots with OR without sequence. Without sequence are put into shots folder, with sequence under sequences folder. Not yet implemented requirement is to have one folder for sequences, one for shots, shots shouln't appear under sequences at all.

It seems that arbitrary separation on asset, shots, sequences is not supporting this use case (and it is pretty much hard-coded).