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

[ui] Intrinsics: Fix warnings and exceptions #1898

Merged
merged 2 commits into from
Feb 16, 2023

Conversation

cbentejac
Copy link
Contributor

Description

This PR fixes a QML warning and a raised exception related to the intrinsics:

  • The QML warning "Unable to assign QJSValue to QObject*", which was related to the wrong initialisation of the attribute variant in the intrinsics table.
  • The exception that raised with "Failed to parse Viewpoint metadata: 'the JSON object must be str, bytes or bytearray, not Property'" whenever there was a switch between the different CameraInit groups after all the intrinsics had been cleared. The metadata value is now accessed if and only if it exists, ie. if it is a string instance and not a PySide property (the metadata value becomes a PySide property when the viewpoint attribute is deleted).

…sics table

This commit fixes an "Unable to assign QJSValue to QObject*".

In IntrinsicDisplayDelegate, initialize the "attribute" variant to null
and set it as a parameter during the instantiation in ImageGallery.
All references to "model.display" in IntrinsicDisplayDelegate have been
replaced with a correct use of "attribute".
The metadata value of the viewpoint is meant to be a string, but if the
viewpoint attribute has already been removed and does not exist anymore,
then the metadata value becomes a PySide property.

When trying to access that property, an exception is raised. This commit
avoids raising exceptions in that case by checking that the viewpoint
attribute still exists (the metadata value is a string instance) before
accessing the metadata value.

This fixes the "Failed to parse Viewpoint metadata: 'the JSON object must
be str, bytes or bytearray, not Property'" warning raised by the exception
which occurred every single time there was a switch between cameraInit
groups that had been cleared.
@cbentejac cbentejac self-assigned this Feb 15, 2023
@fabiencastan fabiencastan added this to the Meshroom 2023.1.0 milestone Feb 16, 2023
@fabiencastan fabiencastan merged commit 69d45fd into develop Feb 16, 2023
@fabiencastan fabiencastan deleted the fix/intrinsicsWarnings branch February 16, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants