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

Bug: Representations right click error - 3.15.6-nightly.1 next-minor #4949

Closed
2 tasks done
Jeremyball opened this issue May 8, 2023 · 6 comments
Closed
2 tasks done
Labels

Comments

@Jeremyball
Copy link

Jeremyball commented May 8, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior:

Right click on subset produces an error.

Expected Behavior:

Produce a list of available representations.

Version

3.15.6-nightly.1

What platform you are running OpenPype on?

Windows

Steps To Reproduce:

Created new project on Ayon Server

In Editor Tab

  • Create folder assets
  • Create asset
  • Create modeling task

image

Launch Maya via Launcher

  • Create sphere - ball_GEO
  • Grouped under geo_GRP
  • Create modeling publish
  • Add geo_GRP to set
  • Publish(all checks green, publish is good)

New Maya scene

  • Loader
  • Navigate to asset
  • Right click subset
  • No menu - error

image

Are there any labels you wish to add?

  • I have added the relevant labels to the bug report.

Relevant log output:

# Traceback (most recent call last):
#   File "E:\ayon\OpenPype-release-next-minor\build\exe.win-amd64-3.9\openpype\tools\loader\widgets.py", line 481, in on_context_menu
#     self._repre_contexts_for_loaders_filter(items)
#   File "E:\ayon\OpenPype-release-next-minor\build\exe.win-amd64-3.9\openpype\tools\loader\widgets.py", line 350, in _repre_contexts_for_loaders_filter
#     for repre_doc in repre_docs:
#   File "E:\ayon\OpenPype-release-next-minor\build\exe.win-amd64-3.9\openpype\client\server\entities.py", line 502, in get_representations
#     fields = representation_fields_v3_to_v4(fields, con)
#   File "E:\ayon\OpenPype-release-next-minor\build\exe.win-amd64-3.9\openpype\client\server\conversion_utils.py", line 603, in representation_fields_v3_to_v4
#     fields |= {
# TypeError: unsupported operand type(s) for |=: 'list' and 'set'

Additional context:

Windows
3.15.6-nightly.1
Banch: release/next-minor
Maya 2023.2

[cuID:OP-5881]

@Jeremyball Jeremyball added the type: bug Something isn't working label May 8, 2023
@sjt-rvx
Copy link
Contributor

sjt-rvx commented May 9, 2023

I ran into the same thing, got it working with small changes to openpype/client/server/conversion_utils.py
Haven't gotten around to making this a real fix.

...
   if not fields:
        return None

    representation_attributes = con.get_attributes_for_type("representation")

    output = set()
    # my hack starts
    fields = set(fields)
    iterfields = fields.copy()
    for field in iterfields:  # replaced the line 'for field in fields:'
    # my hack ends
        if field in ("type", "schema"):
            continue

        if field in REPRESENTATION_FIELDS_MAPPING_V3_V4:
            output |= REPRESENTATION_FIELDS_MAPPING_V3_V4[field]
...

@BigRoy
Copy link
Collaborator

BigRoy commented May 9, 2023

Just out of curiosity. Where is that file? I can't seem to find it in the repository source code.

@antirotor
Copy link
Member

Just out of curiosity. Where is that file? I can't seem to find it in the repository source code.

it is in release/next-minor so 3.15 is little misleading.

@Jeremyball
Copy link
Author

Thanks! that works, menu and functions are working as expected.
image

@Jeremyball Jeremyball reopened this May 9, 2023
@sjt-rvx
Copy link
Contributor

sjt-rvx commented May 10, 2023

I've created a pull request which incorporates this fix (#4959)

@BigRoy
Copy link
Collaborator

BigRoy commented Jul 29, 2024

Fixed in ayon :)

@BigRoy BigRoy closed this as completed Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants