Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Fusion: Moved implementation into OpenPype #2713

Merged
merged 12 commits into from
Feb 16, 2022

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Feb 14, 2022

Brief description

Moved implementation from avalon-core into openpype repository.

Changes

  • moved the code
  • fixed imports to match new code locations
  • moved prelaunch hook code from api to prelaunch hook
  • removed unused scripts from avalon

Testing notes:

  1. Fusion should work as before (not sure if it worked?)

Related to PR ynput/avalon-core#422

@mkolar
Copy link
Member

mkolar commented Feb 14, 2022

Task linked: OP-2542 fusion

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 14, 2022

Thanks. At first glance the code changes look solid. I'll test this as soon as possible. What do we want to do with the hound errors?

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 14, 2022

I've given this a go. And it works fine - has the same 'problems' that were there before the move so I think it's best to address them separately. I'll work towards a PR regarding that sometime soon. But in the basis the issues would be:

  1. Loaders don't have "render" family set, and thus won't work for e.g. on Maya render outputs.
  2. Fusion 17 isn't in the applications list currently.
  3. The logic in the prelaunch hook checks whether os.path.normpath({envvar}) is a directory, but if the env var was not set an empty string would be passed to os.path.normpath which returns the current working directory. As such the logic is not correctly checking whether the variable was set at all.
  4. Fusion needs to be manually set to use Python 3 by default instead of Python 2. Otherwise the menu script will not work.
  5. Python 3.6 will need to be installed locally by default.
  6. The Python 3.6 locally installed will need to have PySide2 (or another Qt) installed for the tools to work.

I'll set up a quick PR to fix 1 and 2 as they seemed the more pressing issues.
I'm also working on a bigger refactor of the Fusion implementation on the side already so I'm thinking to try and address the rest separate from this PR since this is mostly just for the move.

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 14, 2022

We don't really used the switch_ui.py script that comes with OP for Fusion. But when disabling 'current comp' and clicking on the browse icon I get this error:

Traceback (most recent call last):
  File "C:\ProgramData\Blackmagic Design\Fusion\Scripts\Comp\switch_ui.py", line 126, in _on_open_from_dir
    start_dir = self._get_context_directory()
  File "C:\ProgramData\Blackmagic Design\Fusion\Scripts\Comp\switch_ui.py", line 166, in _get_context_directory
    template = project["config"]["template"]["work"]
KeyError: 'template'

Was likely the same issue before the move.

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 14, 2022

Updating a loader fails - fixed in my PR with this commit. Likely unrelated to the move.

Traceback (most recent call last):
  File "S:\openpype\OpenPype\openpype\tools\sceneinventory\view.py", line 275, in <lambda>
    lambda: self._show_version_dialog(items))
  File "S:\openpype\OpenPype\openpype\tools\sceneinventory\view.py", line 726, in _show_version_dialog
    api.update(item, version)
  File "S:\openpype\OpenPype\repos\avalon-core\avalon\pipeline.py", line 1563, in update
    return loader.update(container, new_representation)
  File "<string>", line 208, in update
  File "<string>", line 253, in _get_first_image
NotADirectoryError: [WinError 267] The directory name is invalid: \path\to\file.1001.exr'

@iLLiCiTiT
Copy link
Member Author

iLLiCiTiT commented Feb 14, 2022

I'll set up a quick PR to fix 1 and 2 as they seemed the more pressing issues.

  • 3 Changed
  • 4 Changed by removing use_python_2 key from schemas
  • 5 and 6 are nice features but not goal of this PR
  • Issue with templates seems to be more important than 5. and 6. but also not related to this PR.

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 14, 2022

4 Changed by removing use_python_2 key from schemas

This isn't actually at the core an OpenPype issue. It's that whatever Fusion (actual app) settings is set at is what will decide whether the script runs in Py2 or Py3. A solution I think is to rename the Menu script to a .py3 extension. I think then Fusion will force it to always run with Py3 no matter the user's default settings.

Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

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

works suprisingly well ;)

@iLLiCiTiT iLLiCiTiT merged commit 926eb5b into develop Feb 16, 2022
@iLLiCiTiT iLLiCiTiT deleted the feature/OP-2542_move_fusion branch February 22, 2022 14:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants