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

Incorrect frame range detection #34

Open
1 task done
georgeantonopoulos-bcnvisuals opened this issue Jan 8, 2025 · 2 comments · May be fixed by #35
Open
1 task done

Incorrect frame range detection #34

georgeantonopoulos-bcnvisuals opened this issue Jan 8, 2025 · 2 comments · May be fixed by #35
Labels
community Issues and PRs coming from the community members type: bug Something isn't working

Comments

@georgeantonopoulos-bcnvisuals

Is there an existing issue for this?

  • I have searched the existing issues and added correct labels.

Description

Current Behavior

  1. In development mode, the pre-launch hooks (pre_setup_openrv.py, etc.) are not being loaded because the addon uses OPENRV_ROOT_DIR instead of the development directory path in the addon.py file.

  2. When loading image sequences in OpenRV, the frame range detection in client/ayon_openrv/plugins/load/openrv/load_frames.py is checking representation attributes first, which often contain incorrect frame range data (showing same start and end frame), causing sequences to be loaded as single frames. This has only been confirmed for publishes from Houdini and Nuke.

Expected Behavior

  1. When AYON_USE_DEV environment variable is set, the addon should look for hooks in the development directory structure (client/ayon_openrv/hooks) instead of using OPENRV_ROOT_DIR.

  2. Frame range detection should check version attributes first, as they contain the correct frame range information for the sequence (e.g., frameStart: 1635, frameEnd: 1765). Only if version attributes are not available, it should fall back to representation attributes.

Steps To Reproduce:

Steps to Reproduce

DEV Mode Issue:

  1. Set up OpenRV addon in development mode
  2. Set AYON_USE_DEV=1 environment variable
  3. Try to launch OpenRV
  4. Observe that pre-launch hooks are not executed because they're not found in the correct path

Frame Range Issue:

  1. Have an image sequence with multiple frames (e.g., 1635-1765) published from Houdini or Nuke
  2. Try to load the sequence through OpenRV
  3. Observe that only a single frame (1635) is loaded
  4. Add debug logging to see that it's using representation attributes instead of version attributes which contain the correct frame range

Additional context:

Additional Context

Version

  • AYON Server: 1.5.3+202410241812
  • ayon-core: 1.0.12-bcn.1
  • openrv addon: 1.0.1

What platform were you running when you found the bug?

Linux - Rocky9

Additional Information

Two separate issues were identified in specific files:

  1. DEV Mode Fix: In client/ayon_openrv/addon.py, the get_launch_hook_paths method needed to be modified to check for AYON_USE_DEV environment variable and use the development directory path:

    if DEV_MODE:
        # In development mode, use the current directory's hooks
        return [
            os.path.join(os.getcwd(), "client/ayon_openrv/hooks")
        ]
  2. Frame Range Fix: In client/ayon_openrv/plugins/load/openrv/load_frames.py, the _get_sequence_range method needs to prioritize version attributes over representation attributes, as version attributes contain the correct frame range information (e.g., frameStart: 1635, frameEnd: 1765).

Relevant log output:

Custom debug to see original frame range from representation:
- { load_frames }: [ ============================= ] 
 - { load_frames }: [ Frame range from attributes - start: 1001, end: 1001 ] 
 - { load_frames }: [ Single frame detected ] 
 - { load_frames }: [ Got sequence range: None ]
@MustafaJafar MustafaJafar added type: bug Something isn't working community Issues and PRs coming from the community members labels Jan 8, 2025
georgeantonopoulos-bcnvisuals added a commit to bcnvisuals/ayon-openrv_bcn that referenced this issue Jan 8, 2025
Dev mode fix to load plugins from dev folder instead or OPENRV_ROOT_DIR

Load Frames gets frame range from version instead of representation first.
@BigRoy
Copy link
Contributor

BigRoy commented Jan 9, 2025

Not a huge issue for now - but please in the future make separate issues for the individual separate cases (and preferably even separate PRs). It help for easier and faster reviews, and also generates better changelogs.

@georgeantonopoulos-bcnvisuals georgeantonopoulos-bcnvisuals changed the title DEV mode hooks not loading & incorrect frame range detection Incorrect frame range detection Jan 9, 2025
@georgeantonopoulos-bcnvisuals
Copy link
Author

Sure thing will keep it in mind, in this case the first issue is redundant so renamed it to be just about the frame range

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: bug Something isn't working
Projects
None yet
3 participants