quadproduction / OpenPype

QuadProd version of OpenPype
MIT License
4 stars 0 forks source link

Bug: Bug: Error when opening create interface : 'NukeHost' object has no attribute 'list_instances' #532

Closed OlivierOsotimehin closed 1 year ago

OlivierOsotimehin commented 1 year ago

Before posting a new ticket, have you looked through the documentation to find an answer?

Not yet

Have you looked through the existing tickets to find any related issues ?

Not yet

Author of the bug

olivier.osotimehin@fixstudio.com

Version

3.15.12-quad.3.0

What platform you are running OpenPype on?

Linux / Centos

Current Behavior:

error when opening the Openpype Create menu in Nuke

Expected Behavior:

no error

What type of bug is it ?

Happens everytime with different configurations

Which project / workfile / asset / ...

TEST_OP2_PUB_23_7 / 001_0010 / compo

Steps To Reproduce:

open the TEST_OP2_PUB_23_7 / 001_0010 / compo and Create in openpype menu

Relevant log output:

Creator: Json (imagesequence)

Error: 'NukeHost' object has no attribute 'list_instances'

Traceback (most recent call last):
  File "/users_roaming/oso/.local/share/openpype/3.15/openpype-v3.15.12-quad.3.3/openpype/pipeline/create/context.py", line 2136, in reset_instances
    creator.collect_instances()
  File "/users_roaming/oso/.local/share/openpype/3.15/openpype-v3.15.12-quad.3.3/openpype/hosts/tvpaint/api/plugin.py", line 133, in collect_instances
    self._collect_create_instances()
  File "/users_roaming/oso/.local/share/openpype/3.15/openpype-v3.15.12-quad.3.3/openpype/hosts/tvpaint/api/plugin.py", line 29, in _collect_create_instances
    instances_by_identifier = self._cache_and_get_instances()
  File "/users_roaming/oso/.local/share/openpype/3.15/openpype-v3.15.12-quad.3.3/openpype/hosts/tvpaint/api/plugin.py", line 25, in _cache_and_get_instances
    self, SHARED_DATA_KEY, self.host.list_instances
AttributeError: 'NukeHost' object has no attribute 'list_instances'

Additional context:

No response

ccaillot commented 1 year ago

It seems that the plugin ``/quad_pyblish_module/plugins/tvpaint/create/create_json.py``` is causing a problem, the Class declaration is not good which explains the error.

To remedy this, I've wrote a documentation which explains how to declare each kind of plugins and attributes you can use.

For this issue, you have to use :

from openpype.pipeline.create import Creator
class TVPaintJsonCreator(Creator): 

instead of this :

from openpype.hosts.tvpaint.api.plugin import TVPaintAutoCreator
class TVPaintJsonCreator(TVPaintAutoCreator):

With the help of Creator(), you should also save some code with the help of create(self, subset_name, instance_data, pre_create_data) instead of create(self)

I let you check and let me know if you have some trouble with the quad-plugins repository.

SherineKB commented 1 year ago

PR : https://github.com/quadproduction/quad-plugins/pull/14