io_export_blend icon indicating copy to clipboard operation
io_export_blend copied to clipboard

Preview not created when marking export as asset

Open Fweeb opened this issue 3 years ago • 4 comments

Report from BlenderMarket:

i get no preview after exporting selected object and marking it as Asset when exporting. I only see an icon and name in Asset Library.

Fweeb avatar Nov 09 '22 15:11 Fweeb

Additional information:

I can add that I export from 3D view, selecting object and using quick menu command, where I added export to blend command.

i Can’t find export to blend under right click menu.

Fweeb avatar Nov 09 '22 19:11 Fweeb

Linking the conversation so we can reply again if there's an update: https://blendermarket.com/inbox/conversations/83670 Hope you don't mind that I replied for you on the second question since it was an easy answer

jlampel avatar Nov 12 '22 18:11 jlampel

I dug into this a little bit and found that the preview does show up if we wait a bit for the generate process to finish before exporting.

A simple time.sleep(0.1) will fix the issue in most cases, but how long the preview takes depends on the complexity of the object / material.

Ideally, we would be able to wait until a preview image is detected or a max time limit is reached and then do the export. We can detect the image with preview.image_size[0] , but looping the time.sleep function with a while loop doesn't seem to work well in Blender. Instead, we're supposed to use app timers, but I have yet to get that working like their examples.

jlampel avatar Mar 09 '23 18:03 jlampel

https://github.com/CGCookie/io_export_blend/pull/20 has the simple fix that will satisfy the user who asked about it, but I'd still like to find a proper solution.

jlampel avatar Mar 09 '23 18:03 jlampel