Skip to content

Conversation

@jakubjezek001
Copy link
Member

@jakubjezek001 jakubjezek001 commented Sep 25, 2025

Changelog Description

The CollectInstanceData plugin and its corresponding settings model have been renamed to CollectNukeInstanceData for better clarity and specificity within the Nuke context. This renaming ensures that the plugin's purpose is immediately apparent, reducing ambiguity and improving the overall maintainability of the codebase.

The plugin's execution order has been adjusted to ensure that instance data is collected at the appropriate time. This adjustment helps prevent potential issues related to data dependencies and ensures that all necessary information is available when the plugin is executed.

Finally, the sync_workfile_version_on_families setting has been renamed to sync_workfile_version_on_product_types for a more semantically correct representation of its function.

Additional info

Settings change do not have backward compatibility check, because it was broken anyway for some time.

Testing notes:

  1. Ensure that the Nuke instance data is collected correctly after the renaming and refactoring.
  2. Verify that the plugin execution order does not introduce any data dependency issues.
  3. Confirm that the sync_workfile_version_on_product_types setting functions as expected.

closes #111

Renames the collector plugin for better clarity.

Updates settings to reflect the plugin name change.

Adjusts the order of the collector in the pipeline.

Clarifies the setting key to reflect its purpose.
@jakubjezek001 jakubjezek001 self-assigned this Sep 25, 2025
@jakubjezek001 jakubjezek001 added the type: bug Something isn't working label Sep 25, 2025
"""

order = pyblish.api.CollectorOrder - 0.49
order = pyblish.api.CollectorOrder + 0.001
Copy link
Member

@iLLiCiTiT iLLiCiTiT Sep 26, 2025

Choose a reason for hiding this comment

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

Why this changed? It is on purpose to collect "core" instance data as early as possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is all linked to the Collect Scene Version, this plugin needs to be executed after it.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I really feel like this plug-in actually is not warranted to exist at all - the behavior should not need to be "Nuke" specific (I'm talking about this scene version aspect of it). And if you really really want to... I'd separate that into a plug-in of it own. That just targets the families of those product types - so that the full plug-in just runs or not based on whether it's relevant, plus the functionality of that plug-in then becomes much clearer... but admittedly that also just shows that it can live just as well inside ayon-core.

At the least separate the actual nuke instance data into its own plug-in, as early ordered as possible.

Copy link
Member

Choose a reason for hiding this comment

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

I highly agree with you.

There are few caveats though:

  • Exposing product types: to have an easy enum so that admins can select easily. The enum can be a static dictionary or maybe we can a have an end point that returns product types per host.
  • The follow_workfile_version logic is interlaced.
  • Also, unfortunately, fixing this collector can be faster than generalizing this feature.

Copy link
Member

Choose a reason for hiding this comment

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

So, to sum up, the sync of workfile version with instance version should be probably moved to separate plugin that can run after CollectSceneVersion. This plugin should change the order back to previous order.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes.
And "sync of workfile version with instance version should be probably moved to separate plugin" I'd argue should be core functionality and likely be moved out of ayon-nuke.

Copy link
Member

Choose a reason for hiding this comment

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

I'd argue should be core functionality and likely be moved out of ayon-nuke.

Agree, but it is not there now, or?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree, but it is not there now, or?

No, we lack product type specific filtering in core to behave similar to what this tried to do.

Copy link
Member

@iLLiCiTiT iLLiCiTiT Oct 1, 2025

Choose a reason for hiding this comment

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

So not in this PR. In this PR there should be added new plugin with correct order that just adds "version" from context data to "version" in instance data.

@MustafaJafar
Copy link
Member

MustafaJafar commented Sep 30, 2025

I didn't tested yet but when looking at the code, I'm concerned that this plugin will be redundant if admins enabled ayon+settings://core/publish/CollectAnatomyInstanceData/follow_workfile_version which effectively adds the context versions to all instances.

See here

https://github.com/ynput/ayon-core/blob/2393c333191d966f0c472694e38c2b4bcc612be5/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py#L318-L325

and here

https://github.com/ynput/ayon-core/blob/2393c333191d966f0c472694e38c2b4bcc612be5/client/ayon_core/plugins/publish/collect_anatomy_instance_data.py#L353

@sjt-rvx
Copy link
Contributor

sjt-rvx commented Dec 5, 2025

On the topic of execution order; I gave this a spin earlier and shifting the order works just fine. Just throwing those 2cents in the pool.

@iLLiCiTiT
Copy link
Member

iLLiCiTiT commented Dec 5, 2025

The point is that the collect instance plugin should not change order, we should add new plugin that adds the version (if it is necessary, we could just use CollectAnatomyInstanceData as far as I understand).

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

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyError in CollectInstanceData

6 participants