Skip to content

Track copy pasted templates - #119

Draft
YuanQI295 wants to merge 20 commits into
ynput:developfrom
YuanQI295:track_copy-pasted_templates
Draft

Track copy pasted templates#119
YuanQI295 wants to merge 20 commits into
ynput:developfrom
YuanQI295:track_copy-pasted_templates

Conversation

@YuanQI295

@YuanQI295 YuanQI295 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Description

Enables users of the Ayon Harmony addon to copy and paste templates between scenes, with those templates automatically tracked through the Scene Inventory (Manage button).

Additional review information

The tracking of those templates between scenes is enabled by the writing of metadata in a note node in the first scene, and the reading of that node in the second scene. The node is created in the template backdrop when the template is loaded. The reading happens at the opening of the Scene Inventory (in the harmony scene that you pasted into).

Testing

  1. Load one or two templates into a scene.
  2. Open another harmony scene.
  3. Copy the templates into the second scene.
  4. Click on Manage in the Ayon menu.

@kalisp
kalisp self-requested a review May 11, 2026 14:24
@kalisp

kalisp commented May 11, 2026

Copy link
Copy Markdown
Member

Not completely sure what this PR actually solves.
Could you please elaborate more, just for future posterity, as code changes could be traversed back to PRs.

@YuanQI295

Copy link
Copy Markdown
Contributor Author

Not completely sure what this PR actually solves. Could you please elaborate more, just for future posterity, as code changes could be traversed back to PRs.

I just added the additional review info. 👍

@kalisp

kalisp commented Jun 1, 2026

Copy link
Copy Markdown
Member

So you are bypassing/stepping over Load phase. It is just shortcut for copying loaded template from one file to another?

What is actual use case, why would artist like to use this one? (Your artists do have multiple Harmony apps open?)

@YuanQI295

Copy link
Copy Markdown
Contributor Author

Yes this is how artists are gonna work.

@kalisp

kalisp commented Jun 2, 2026

Copy link
Copy Markdown
Member

Why they dont use Loader in the other scene?

Does this persist metadata about loaded/copied over containers?

@BigRoy

BigRoy commented Jun 2, 2026

Copy link
Copy Markdown
Member

Similar to @kalisp I'm quite confused by this PR.

Could you describe your exact use case? What template? Why are these being copy-pasted? and where are they copied from? And if just pasted in - what are we actually tracking from AYON's side?

@YuanQI295

Copy link
Copy Markdown
Contributor Author

Similar to @kalisp I'm quite confused by this PR.

Could you describe your exact use case? What template? Why are these being copy-pasted? and where are they copied from? And if just pasted in - what are we actually tracking from AYON's side?

In Harmony, we load different assets (templates) through the Ayon Loader. These assets are visible and tracked in the Manage panel.

When working on a new scene that is very similar to a previous one, we need to copy assets from the source scene to avoid redundant loads and preserve work already done on them.
Currently, using a standard copy-paste (Ctrl+C / Ctrl+V) correctly duplicates the content within Harmony, but the Manage panel does not reflect the pasted assets the tracking is lost.

@BigRoy

BigRoy commented Jun 2, 2026

Copy link
Copy Markdown
Member

I know nothing of Harmony integration - but isn't it that you should be copying then what is containerized (which I think would be the group node?)

@kalisp

kalisp commented Jun 3, 2026

Copy link
Copy Markdown
Member

Maybe @Tilix4 could chime in how they are working with Harmony and if he has any comments for this PR.

@Tilix4

Tilix4 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

you should be copying then what is containerized

In fact a template is containerized into a backdrop, that's why this PR proposes to add a node holding container metadata

Maybe @Tilix4 could chime in how they are working with Harmony and if he has any comments for this PR.

I'm not sure you're aware @YuanQI295 works for Normaal, so my insight isn't really neutral. This PR comes from a need on our side, sometimes it is more efficient to copy/paste directly from an harmony to another because you want to use work from another scene, but that work may not be generic enough to put it into a bank. Having the possibility to paste and keep Ayon's tracking is very useful.

@BigRoy

BigRoy commented Jun 3, 2026

Copy link
Copy Markdown
Member

So these backdrops are not copy-pastable? Shouldn't the means of copy-pasting that be the thing that makes you maintain the containerization?

I'd love to preserve containerization - it's just that the note hack feels so... hacky. Now suddenly we're containerizing in two ways, on a backdrop AND some note?

@BigRoy BigRoy added type: enhancement Improvement of existing functionality or minor addition community Issues and PRs coming from the community members labels Jun 3, 2026
@BigRoy
BigRoy self-requested a review June 3, 2026 09:26
@Tilix4

Tilix4 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

So these backdrops are not copy-pastable? Shouldn't the means of copy-pasting that be the thing that makes you maintain the containerization?

I'd love that, unfortunately Harmony is very restricted and containers information are stored into scene's metadata. They are not attached to the backdrop itself.

Now suddenly we're containerizing in two ways, on a backdrop AND some note?

No, the point is it will look into the scene to find any note node holding container information. If it finds one, it adds the container to the scene's metadata to consider the newly pasted backdrop as a container. But the truth remains the regular way, attached to the scene.

We could choose to completely switch the way it deals with containers, using the note in backdrops as container truth, which would be better IMO. But it adds more legacy to deal with.

@BigRoy

BigRoy commented Jun 3, 2026

Copy link
Copy Markdown
Member

I'd love that, unfortunately Harmony is very restricted and containers information are stored into scene's metadata. They are not attached to the backdrop itself.

I see - that explains things. Got to love software. :)

  • What's the reason of using ast over json?
  • Can we hide the note inside the backdrop? (or in some other way make it rather obscure? or what does it look like currently?)

@YuanQI295

YuanQI295 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

I'd love that, unfortunately Harmony is very restricted and containers information are stored into scene's metadata. They are not attached to the backdrop itself.

I see - that explains things. Got to love software. :)

  • What's the reason of using ast over json?
  • Can we hide the note inside the backdrop? (or in some other way make it rather obscure? or what does it look like currently?)

Since the metadata is constructed with ', ast would be more suited.

exemple :
{'harmony_template_Main': {'schema': 'openpype:container-2.0', 'id': 'ayon.load.container', 'name': 'harmony_template_Main', 'namespace': None, 'loader': 'TemplateLoader', 'representation': '3cd2a2d01d5e11f1942c10ddb1bdbb2e'}}

And about hiding the note node maybe we could put the metadata inside the top node(in the hierarchy of the nodes , here would be LAYOUT-P) of the backdrop instead

image

@YuanQI295

YuanQI295 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

After discussing about how to hide and store Metadata in the template, we reached a conclusion on our end. It seems we can add text in the backdrops. We'll insert the metadata 100 lines below anything already written in the template's text area, so it stays hidden.

We also decided that the correponding Metadata will be written to the template at the loading of the template, and at the updating for new versions, and at the openning of the harmony scene for any template already in use.

Also opening or refreshing the Scene Manager triggers a scan of all backdrops any embedded metadata that isn't already tracked gets registered as a container.

image

t
Merge branch 'track_copy-pasted_templates' of https://github.com/YuanQI295/ayon-harmony into track_copy-pasted_templates
:wq
:wq
:wq
:wq
he commit.
@BigRoy

BigRoy commented Jun 11, 2026

Copy link
Copy Markdown
Member

@YuanQI295 pretty sure you pushed some commits unintentionally and they should not be there 🗡️

@YuanQI295
YuanQI295 marked this pull request as draft June 15, 2026 11:23
@YuanQI295

Copy link
Copy Markdown
Contributor Author

@YuanQI295 pretty sure you pushed some commits unintentionally and they should not be there 🗡️

It was unintentional, just cleaned it up. Currently working on tracking copy counts for duplicate templates.

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