ayon-core icon indicating copy to clipboard operation
ayon-core copied to clipboard

`FileDef` doesn't work properly

Open MustafaJafar opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current Behavior:

when using a FileDef e.g.

FileDef(
    "reviewable_image",
    folders=False,
    extensions=[".jpg", ".png", ".tif", ".exr"],
    single_item=True,
    allow_sequences=True,
    label="Image reviewable representations",
    extensions_label="Multiple Image reviewable items",
),

Tested in Maya and Houdini:

  1. clicking on this icon, result in this Error:
    TypeError: FilesWidget._on_context_menu_requested() missing 1 required positional argument: 'valid_index'
    
    Image

In Houdini :

  1. Drag and drop a new item doesn't replace the existing item. (when having single_item=True)
  2. Drag and drop a new item doesn't add the item to the existing list. (when having single_item=False)

Expected Behavior:

It should work normally.

Version

1.0.0

What platform you are running on?

Windows

Steps To Reproduce:

  1. Add a FileDef in a Houdini plugin
  2. Try steps mentioned above.

Are there any labels you wish to add?

  • [x] I have added the relevant labels to the bug report.

Relevant log output:


Additional context:

No response

MustafaJafar avatar Nov 29 '24 12:11 MustafaJafar

This pull request doesn't solve the original issue

https://github.com/user-attachments/assets/77e9525a-892c-4718-9dc4-b4d1a7baab90

vivimage avatar Dec 16 '24 12:12 vivimage

Tested on Houdini 19.5 py3.7, Houdini 20.5 py10 and Houdini 20.5 py3.11

The behavior is the same. So it is not dependent on the QT or python version

vivimage avatar Jan 10 '25 14:01 vivimage

@vivimage could you provide the file definition you're using so we can easily replicate the issue?

Like:

FileDef("some_key", ...)

iLLiCiTiT avatar Feb 11 '25 17:02 iLLiCiTiT

@iLLiCiTiT Its provided in the description of the ticket. Here is another example from my addon.

@classmethod
    def get_attribute_defs(cls):
        return [
            FileDef(
                "reviewable_image",
                folders=False,
                extensions=IMAGE_EXTENSIONS,
                single_item=False,
                label="Image reviewable representations",
                extensions_label="Image reviewable item",
            ),
            TextDef(
                "comment",
                multiline=True,
                label="Было сделано",
            ),
        ]

vivimage avatar Feb 13 '25 08:02 vivimage

bumping up

vivimage avatar Mar 13 '25 12:03 vivimage