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

Add ShapeFX Loki support #1030

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Nov 29, 2024

Changelog Description

Add ShapeFX Loki support.

Additional info

Requires Loki in ayon-applications and the ayon-loki integration.

Testing notes:

  1. Install ShapeFX Loki
  2. Run through AYON
  3. Basics should work.
  4. OCIO env var should be set according to settings.
  5. Last workfile should be opened on launch.

@BigRoy BigRoy added community Issues and PRs coming from the community members type: feature Adding something new and exciting to the product labels Nov 29, 2024
@BigRoy BigRoy self-assigned this Nov 29, 2024
@ynbot ynbot added type: enhancement Improvement of existing functionality or minor addition size/XS labels Nov 29, 2024
Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

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

image

on opening loki, I believe we should create a new stage.
otherwise:

Bunch of errors because of a particular one reason

When saving a workfile:

*** WRN: >>> { WorkfilesUI }: [ Save as failed ] 
==============================
No active stage to save. Create or open a stage first.
==============================
Traceback (most recent call last):
  File "E:\Ynput\ayon-core\client\ayon_core\tools\workfiles\control.py", line 562, in save_as_workfile
    self._save_as_workfile(
  File "E:\Ynput\ayon-core\client\ayon_core\tools\workfiles\control.py", line 748, in _save_as_workfile
    self._host_save_workfile(dst_filepath)
  File "E:\Ynput\ayon-core\client\ayon_core\tools\workfiles\control.py", line 638, in _host_save_workfile
    host.save_workfile(filepath)
  File "E:\Ynput\ayon-loki\client\ayon_loki\api\pipeline.py", line 146, in save_workfile
    return save_file(filepath)
  File "E:\Ynput\ayon-loki\client\ayon_loki\api\workio.py", line 37, in save_file
    raise RuntimeError(
RuntimeError: No active stage to save. Create or open a stage first.

anyways, everything works once I created a new stage.


When loading an alembic or USD, it fails.
I can only see this error.

19:01:13  ERROR    | Traceback (most recent call last):
  File "C:\Program Files\ShapeFX Loki\python\lib\site-packages\opendcc\code_editor\code_editor.py", line 101, in hide_action
    self.hide()
RuntimeError: Internal C++ object (FindReplaceWidget) already deleted.

I tried creating a simple prims, it tells:
weird this also happens outside of AYON.

19:05:55  WARNING  | Warning: Failed to create prim: stage doesn't exist.
19:05:55           | Executing: "opendcc.cmds.select(opendcc.core.SelectionList(),replace=True)" 

Loading works:
image


Saving workfile (usdfile) works although, it threw this error

*** WRN: >>> { WorkfilesUI }: [ Save as failed ] 
==============================

	Error in 'pxrInternal_v0_22__pxrReserved__::SdfLayer::SetIdentifier' at line 2545 in file D:\projects\USD-22.05\pxr\usd\sdf\layer.cpp : 'Layer with identifier 'h:/AYON/projects/Experiments/things/random/work/Loki/Expr_random_Loki_v001.usd' and resolved path 'h:\AYON\projects\Experiments\things\random\work\Loki\Expr_random_Loki_v001.usd' exists.'
==============================
Traceback (most recent call last):
  File "E:\Ynput\ayon-core\client\ayon_core\tools\workfiles\control.py", line 562, in save_as_workfile
    self._save_as_workfile(
  File "E:\Ynput\ayon-core\client\ayon_core\tools\workfiles\control.py", line 748, in _save_as_workfile
    self._host_save_workfile(dst_filepath)
  File "E:\Ynput\ayon-core\client\ayon_core\tools\workfiles\control.py", line 638, in _host_save_workfile
    host.save_workfile(filepath)
  File "E:\Ynput\ayon-loki\client\ayon_loki\api\pipeline.py", line 146, in save_workfile
    return save_file(filepath)
  File "E:\Ynput\ayon-loki\client\ayon_loki\api\workio.py", line 60, in save_file
    layer.identifier = filepath
pxr.Tf.ErrorException: 
	Error in 'pxrInternal_v0_22__pxrReserved__::SdfLayer::SetIdentifier' at line 2545 in file D:\projects\USD-22.05\pxr\usd\sdf\layer.cpp : 'Layer with identifier 'h:/AYON/projects/Experiments/things/random/work/Loki/Expr_random_Loki_v001.usd' and resolved path 'h:\AYON\projects\Experiments\things\random\work\Loki\Expr_random_Loki_v001.usd' exists.'

on closing the file, it asks me if I want to save the anonymous layer that I created at the beginning.


opening last work file (usdfile), works

@BigRoy
Copy link
Collaborator Author

BigRoy commented Dec 4, 2024

on opening loki, I believe we should create a new stage.

Unfortunately - this is intentional in Loki - and is also described in their documentation. Confusing, yes. But I guess it's more about learning the app then anything else?

I tried creating a simple prims, it tells:

Errors that there are no stage if you've not initialized a stage in Loki are correct. If you get any while actually working in an active stage, then report them to Loki discord please.

When loading an alembic or USD, it fails.
I can only see this error.

Loading how? Via Loki itself? if so, report to loki discord. If AYON loader, then... interesting! Did you have an actual open stage (like pressed CTRL+N once inside Loki?)

Saving workfile (usdfile) works although, it threw this error

Thanks - yes, I'll need to look into this particular one - it might be worth reporting this on [ayon-loki repo](https://github.com/BigRoy/ayon-loki0 because the code related to it is actually there. I haven't investigated much further as to why that happens sometimes. I think my "save as" behavior might be doing something wrong.

Copy link
Contributor

@MustafaJafar MustafaJafar left a comment

Choose a reason for hiding this comment

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

This PR works.
Any errors found are not related to this PR and they should be reported somewhere else like ayon-core or loki discord.

@MustafaJafar
Copy link
Contributor

Unfortunately - this is intentional in Loki - and is also described in their documentation. Confusing, yes. But I guess it's more about learning the app then anything else?

The errors came from my lack of knowledge about loki.
tbh, I didn't like that I have to create a stage when opening a new empty scene. maybe I'll change my mind later.

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 size/XS type: enhancement Improvement of existing functionality or minor addition type: feature Adding something new and exciting to the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants