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

Resolve: avoiding clips without mediapoolitems #92

Merged
merged 8 commits into from
Mar 18, 2024

Conversation

jakubjezek001
Copy link
Member

@jakubjezek001 jakubjezek001 commented Feb 19, 2024

Changelog Description

When encountering a scenario where resolve timelineitems are not connected to any media pool items, it is possible that these items could be either an Adjustment Clip or a Fusion Composition.

Testing steps

  1. add to your timeline Adjustment Clip (from effect panel)
  2. open Loader and try to load anything
  3. no error should happen and clip should be loaded to timeline

Asserts creation of media pool item when not found for specified files. This ensures proper handling and error messaging in such cases.
@jakubjezek001
Copy link
Member Author

Task linked: OP-8273 Resolve: missing GetClipProperty

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 19, 2024

Can we get Resolve: in the PR title as well - as long as the multiple hosts/applications are in core that can help changelogs and/or e-mail notifications since "labels" don't usually appear there?

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 19, 2024

Asserts creation of media pool item when not found for specified files. This ensures proper handling and error messaging in such cases.

Could you include testing notes?

  • When does this occur?
  • Is there something the user can do about this? Like, can the error message also describe WHY it's wrong or what the user can do about it?
  • As far as I'm aware when using assert you don't need to make the value after the , a AssertionError instance. If it's just a string then Python will raise that string as AssertionError automatically. Right? For example, see here
  • Instead of an assert should this be LoadError?

@jakubjezek001 jakubjezek001 changed the title Add assertion for creating media pool item if not found Resolve: Add assertion for creating media pool item if not found Feb 22, 2024
Copy link
Member

@tokejepsen tokejepsen left a comment

Choose a reason for hiding this comment

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

Address some of these questions; #92 (comment)

ClipLoader class in the plugin file now handles LoadError exceptions for creating media pool items when processing files. This change ensures proper error handling during media item creation.
… handling in timeline items retrieval function.

- Added a check to skip processing if MediaPoolItem doesn't exist.
- Enhanced data handling within the timeline items retrieval function.
- this is for case some adjustment clips or fusion clips are on timeline
@jakubjezek001
Copy link
Member Author

Thanks to @BigRoy there was found the reason why this error can happen. Thanks man!

Copy link
Member

@tokejepsen tokejepsen left a comment

Choose a reason for hiding this comment

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

Lets address @BigRoy comments.

@tokejepsen tokejepsen marked this pull request as draft March 7, 2024 08:01
@jakubjezek001 jakubjezek001 changed the title Resolve: Add assertion for creating media pool item if not found Resolve: avoiding clips without mediapoolitems Mar 12, 2024
@jakubjezek001 jakubjezek001 marked this pull request as ready for review March 12, 2024 10:02
jakubjezek001 added a commit that referenced this pull request Mar 12, 2024
those are addressed in #92
Copy link
Member

@tokejepsen tokejepsen left a comment

Choose a reason for hiding this comment

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

Tested successfully in Resolve 18.6.

For completeness, the error in current develop is this when loading in a clip while having an adjustment clip on the timeline;

During load error happened on Product: "renderCompositingMain" Representation: "exr" Version: 1

Error message: 'NoneType' object has no attribute 'GetClipProperty'

Traceback (most recent call last):
  File "C:\Users\tokejepsen\ayon-core\client\ayon_core\tools\loader\models\actions.py", line 763, in _load_representations_by_loader
    load_with_repre_context(
  File "C:\Users\tokejepsen\ayon-core\client\ayon_core\pipeline\load\utils.py", line 323, in load_with_repre_context
    return loader.load(repre_context, name, namespace, options)
  File "C:\Users\tokejepsen\ayon-core\client\ayon_core\hosts\resolve\plugins\load\load_clip.py", line 48, in load
    timeline_item = plugin.ClipLoader(
  File "C:\Users\tokejepsen\ayon-core\client\ayon_core\hosts\resolve\api\plugin.py", line 462, in load
    timeline_item = lib.create_timeline_item(
  File "C:\Users\tokejepsen\ayon-core\client\ayon_core\hosts\resolve\api\lib.py", line 306, in create_timeline_item
    output_timeline_item = get_timeline_item(
  File "C:\Users\tokejepsen\ayon-core\client\ayon_core\hosts\resolve\api\lib.py", line 343, in get_timeline_item
    _ti_clip_property = _ti_clip.GetMediaPoolItem().GetClipProperty
AttributeError: 'NoneType' object has no attribute 'GetClipProperty'

@jakubjezek001 jakubjezek001 merged commit 02fe605 into develop Mar 18, 2024
2 checks passed
@jakubjezek001 jakubjezek001 deleted the bugfix/OP-8273_Resolve-missing-GetClipProperty branch March 18, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants