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

Initial Silhouette integration #1

Open
wants to merge 46 commits into
base: develop
Choose a base branch
from

Conversation

BigRoy
Copy link

@BigRoy BigRoy commented Jan 8, 2025

Changelog Description

Initial integration of BorisFX Silhouette

Additional review information

General

  • Launch and configure Silhouette application via Add BorisFX Silhouette application ayon-applications#45
  • Last workfile opens, via Add BorisFX Silhouette support ayon-core#1070
  • OCIO env var is set, via Add BorisFX Silhouette support ayon-core#1070
  • AYON menu inside Silhouette
  • AYON tools open inside Silhouette
  • Workfiles can be managed correctly:
    • Correctly list projects (which are folders!)
    • Correctly open and save projects
    • TODO: We may want to manage the "projects" as .zip instead so that their published equivalents are also just .zip workfiles. That'd be similar to Harmony integration.
  • Add hooks:
    • rudimentary hooks set up
    • on workfile open check for outdated containers
    • on save/load check scene settings,
    • on load check fps (etc.)
    • on new project initialize with correct FPS, frame range, etc.
      • Unfortunately this one may be tricky, or at least a bit odd. The FPS and resolution are not defined on the project, but are per session inside the project. We can detect the creation of a new session and do what we want - however creating a new session usually happens via a dedicated "new session" dialog which shows attributes for setting FPS and resolution, and it'd be odd if suddenly after we'd "change" it directy and not adhere to the dialog? Or a new session gets auto-created by dropping a source media clip into an empty project - which is when the session defaults to matching the media. So I'm not entirely sure what to do here. I asked on BorisFX forums for other approach to set session defaults.

Loading

  • Load media (like a plate) and manage the version
  • Utility actions to set session frame range and FPS

Publishing

  • Support publishing
    • Render with support for output formats EXR, JPEG, PNG
      • Include compression and bit depth based on project specs
    • Render output local
    • Render output on farm
    • Publish workfile
      • This currently errors due to the workfile actually being a folder and hence it's not allowed to integrate as representation.
    • Ability to select and export roto shapes and track points as MATTE SHAPES and TRACK_POINTS product types with representations:
      • Matte Shapes as Nuke Shapes (.nk)
      • Matte Shapes as Silhouette Shapes (.fxs)
      • Matte Shapes as Shake Shapes (.ssf)
      • Track Points as Nuke Shapes (.txt)
      • Track Points as Nuke Shapes (.nk)

Testing notes:

Test with:

  1. Silhouette integration should work

@BigRoy BigRoy self-assigned this Jan 8, 2025
@BigRoy BigRoy added the type: feature Adding something new and exciting to the product label Jan 8, 2025
@BigRoy BigRoy requested a review from philippe-ynput January 9, 2025 23:53
@BigRoy BigRoy requested a review from jakubjezek001 January 13, 2025 11:34
@jakubjezek001
Copy link
Member

Saving as in workfile tools is failing:

Traceback (most recent call last):
  File "C:\CODE\__YNPUT\ayon-core\client\ayon_core\tools\workfiles\widgets\files_widget.py", line 253, in _on_workarea_save_clicked
    result = self._exec_save_as_dialog()
  File "C:\CODE\__YNPUT\ayon-core\client\ayon_core\tools\workfiles\widgets\files_widget.py", line 175, in _exec_save_as_dialog
    dialog.update_context()
  File "C:\CODE\__YNPUT\ayon-core\client\ayon_core\tools\workfiles\widgets\save_as_dialog.py", line 254, in update_context
    self._extension_combobox.addItems(data["extensions"])
TypeError: 'PySide2.QtWidgets.QComboBox.addItems' called with wrong argument types:
  PySide2.QtWidgets.QComboBox.addItems(NoneType)
Supported signatures:
  PySide2.QtWidgets.QComboBox.addItems(typing.Sequence[str])

@jakubjezek001
Copy link
Member

Could we move Workfile to the second position after the context label please? It seems to be more logical that way and we are usually having it that way in any other 2d related DCC.

image

@BigRoy
Copy link
Author

BigRoy commented Jan 14, 2025

Could we move Workfile to the second position after the context label please? It seems to be more logical that way and we are usually having it that way in any other 2d related DCC.

image

Ah - I matched it with Maya in this case. I'm fine with moving it - but I think we should maybe do it across all hosts over time?

Anyway, like this?

image

@jakubjezek001
Copy link
Member

Also I was creating Matte Shapes, Track Points with Use selection and none of them connected automatically to selected Roto node.

session.addNode(instance_node)
lib.set_new_node_position(instance_node)
instance_node = None
if pre_create_data.get("use_selection"):
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this change had not fixed the situation with unconnected node creation.

Copy link
Author

Choose a reason for hiding this comment

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

It seems like this change had not fixed the situation with unconnected node creation.

Could you describe what you mean?

  1. When clicking Create without any valid node (of the correct type) selected it will still generate a new node.
  2. When clicking Create with a valid node type selected it will now use that node to publish from - so that you could e.g. publish an existing roto node instead of needing to generate a new node.

But reading this now.. it sounds like what you expected was that the newly created node would just connect (as input) to the user's selection?

Copy link
Member

Choose a reason for hiding this comment

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

But reading this now.. it sounds like what you expected was that the newly created node would just connect (as input) to the user's selection?

Corret. Not sure what is correct approach but for example if I want to create render product I am selecting Read node or Roto node and neither of those is linking the newly created render node.

@jakubjezek001
Copy link
Member

I had bypassed the situation with blocked workfile creation and wanted to publish render product but following error was failing it.

Traceback (most recent call last):
  File "C:\Users\jakub\AppData\Local\Ynput\AYON\dependency_packages\ayon_2412190933_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\CODE\__YNPUT\ayon-silhouette\client\ayon_silhouette\plugins\publish\extract_render.py", line 25, in process
    output_node = instance.data["transientData"]["node"]
KeyError: 'node'

@BigRoy
Copy link
Author

BigRoy commented Jan 14, 2025

Also I was creating Matte Shapes, Track Points with Use selection and none of them connected automatically to selected Roto node.

Correct - it'll currently force a new node still I think.

I had bypassed the situation with blocked workfile creation and wanted to publish render product but following error was failing it.

Traceback (most recent call last):
  File "C:\Users\jakub\AppData\Local\Ynput\AYON\dependency_packages\ayon_2412190933_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\CODE\__YNPUT\ayon-silhouette\client\ayon_silhouette\plugins\publish\extract_render.py", line 25, in process
    output_node = instance.data["transientData"]["node"]
KeyError: 'node'

Correct - render is yet to be implemented and finished. See todo in PR description.

@BigRoy
Copy link
Author

BigRoy commented Jan 14, 2025

Saving as in workfile tools is failing:

Traceback (most recent call last):
  File "C:\CODE\__YNPUT\ayon-core\client\ayon_core\tools\workfiles\widgets\files_widget.py", line 253, in _on_workarea_save_clicked
    result = self._exec_save_as_dialog()
  File "C:\CODE\__YNPUT\ayon-core\client\ayon_core\tools\workfiles\widgets\files_widget.py", line 175, in _exec_save_as_dialog
    dialog.update_context()
  File "C:\CODE\__YNPUT\ayon-core\client\ayon_core\tools\workfiles\widgets\save_as_dialog.py", line 254, in update_context
    self._extension_combobox.addItems(data["extensions"])
TypeError: 'PySide2.QtWidgets.QComboBox.addItems' called with wrong argument types:
  PySide2.QtWidgets.QComboBox.addItems(NoneType)
Supported signatures:
  PySide2.QtWidgets.QComboBox.addItems(typing.Sequence[str])

Unfortunately this looks like some bug in the Workfiles tool? Or I'm not sure where it originates from.

It enters this if statement here: https://github.com/ynput/ayon-core/blob/8db81098af5d15e20607c661ab510c6b6a6ef767/client/ayon_core/tools/workfiles/models/workfiles.py#L322-L333

Which means the workfiles tool controller thinks there is no current folder or task entity somehow - I need to investigate further why the heck it does that.

EDIT

So it seems we were just to quick - and workfiles tool opens relatively slow in Silhouette it seems and hence it exaggerated the issue. The issue is that the Workfiles tool allowed saving even when not initialized fully in the UI to the "task" so you were actually trying to save 'without task context'. This PR should fix that: ynput/ayon-core#1085

@jakubjezek001
Copy link
Member

The workflow had improved greatly, thank you @BigRoy. I believe the way we are approaching node creation is more intuitive for the way I see the workflow - perhaps opinionated but will see how users will understand once they get their hands on it.

I was testing RotoShape publishing and it had published the product as expected - there were some messages poping up during publishing but at the end the product is available at publish area. I will need to test loading in Nuke later.

Very good progress!

@BigRoy
Copy link
Author

BigRoy commented Jan 15, 2025

I was testing RotoShape publishing and it had published the product as expected - there were some messages poping up during publishing but at the end the product is available at publish area. I will need to test loading in Nuke later.

Be aware that the product types are just somewhat arbitrarily picked - I assume there may not be an existing Loader plug-in in Nuke yet to load these via the loader (but of course you could try load manually to confirm they do work)... but we may want to coordinate the final product type names once a Nuke loader plug-in is to be implemented, and same goes for e.g. fusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Adding something new and exciting to the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants