ynput / OpenPype

OpenPype has been surpassed by AYON and is now read only.
https://ayon.ynput.io
MIT License
287 stars 129 forks source link

Bug: error when trying to load fbx of .blend file inside Blender, if it was published by the Tray Publisher #6017

Open alainxi opened 11 months ago

alainxi commented 11 months ago

Is there an existing issue for this?

Current Behavior:

If you use the WindowsTray-->Ayon-->Publisher to publish an fbx or a .blend file, then you cannot load it from inside Blender (menu Ayon-->Load).

It only bugs if the publish was done using the Tray publisher (I tried both fbx and blend files). If I publish from inside Blender, then there is no load error and no popup appears.

Expected Behavior:

We should be able to load in Blender, fbx and .blend scenes that where publish by the Tray publisher.

Version

3.17.7-nightly.5

What platform you are running OpenPype on?

Windows

Steps To Reproduce:

Using the WindowsTray-->Ayon-->Publisher, publish an fbx file (or a .blend file). Select an asset and a Modeling task, and choose the "Model" publish type. The publish works all right, no errors.

From inside Blender, use the menu Ayon-->Load Then select the product you just published, and click on RightMouseButton-->Load FBX (fbx)

An error popup will display this : "Error : No asset group found" error

Are there any labels you wish to add?

Relevant log output:

Traceback (most recent call last):

  File "C:\Users\Alain\AppData\Local\Ynput\AYON\addons\openpype_3.17.7\openpype\hosts\blender\api\ops.py", line 113, in execute
    result = callback(*args, **kwargs)

  File "C:\Users\Alain\AppData\Local\Ynput\AYON\addons\openpype_3.17.7\openpype\hosts\blender\api\plugin.py", line 476, in _load
    nodes = self.process_asset(

  File "C:\Users\Alain\AppData\Local\Ynput\AYON\addons\openpype_3.17.7\openpype\hosts\blender\plugins\load\load_fbx.py", line 150, in process_asset
    objects = self._process(libpath, asset_group, group_name, None)

  File "C:\Users\Alain\AppData\Local\Ynput\AYON\addons\openpype_3.17.7\openpype\hosts\blender\plugins\load\load_fbx.py", line 71, in _process
    assert container, "No asset group found"

AssertionError: No asset group found

Also, checking the Blender output window,  this appears when clicking on  RightMouseButton-->Load FBX (fbx)  :

Initialising WM_OT_avalon_loader...
execute_in_main_thread
Executing process in main thread
Running callback: <bound method AssetLoader._load of []>
FBX version: 7400
Done

Additional context:

The problem is the same on Blender 3.3 and Blender 4.

The "No asset group found" problem is detected by several load kinds (blend, blendscene, fbx, animation) :

https://github.com/ynput/OpenPype/blob/3cf3c93fa608d12262b9f84fd88ed13c54f29046/openpype/hosts/blender/plugins/load/load_blend.py#L95 https://github.com/ynput/OpenPype/blob/3cf3c93fa608d12262b9f84fd88ed13c54f29046/openpype/hosts/blender/plugins/load/load_blendscene.py#L55 https://github.com/ynput/OpenPype/blob/3cf3c93fa608d12262b9f84fd88ed13c54f29046/openpype/hosts/blender/plugins/load/load_fbx.py#L71 https://github.com/ynput/OpenPype/blob/3cf3c93fa608d12262b9f84fd88ed13c54f29046/openpype/hosts/blender/plugins/load/load_animation.py#L47

Looking at the load code, it seems the imported file (fbx, .blend, etc...) must contain an empty, or else it raises a "No asset group found" exception. As we will use the WindowsTray-->Ayon-->Publisher to publish fbx of blend files that are purchased or provided by our clients, their content does not automatically contain an empty, but it should still be possible to load it inside Blender using Ayon's Load menu.

[cuID:OP-7547]

LiborBatek commented 11 months ago

I guess that assets originating from Tray Publisher not working at all. So not just FBX but any other like for ie Pointcache or Model etc.

They do not have present any nodes with neccessary metadata present ATM ??

LiborBatek commented 10 months ago

@simonebarbieri @iLLiCiTiT I think that this not being supported at all and might need solution in the future, not simply possible feature wise ATM

BigRoy commented 9 months ago

Shouldn't an alembic gone through tray publisher as abc be loaded with this loader: https://github.com/ynput/OpenPype/blob/3cf3c93fa608d12262b9f84fd88ed13c54f29046/openpype/hosts/blender/plugins/load/load_abc.py

All that seems to expect is that there's at least one top node that it'll use as 'container'. No?

For your FBX case isn't the issue that it's just not able to find anything that Blender loads as an empty, like a group? Are you FBX'es flat direct meshes maybe?

alainxi commented 9 months ago

Yes, the use case is to have the pipeline ingest fbx files that were produced elsewhere (provided by the client, purchased on the web, etc...), so most of the time it has a random structure. I just tested, it works all right if I parent the mesh below an empty, and export as fbx.