Jump to content

Gluon preview for blender files


critchomatic
 Share

Recommended Posts

  • 3 months later...

I found this interesting and wanted to try it myself, but ultimately didn't succeed. However, if anyone wants to pick up where I left:

The blog page describes how to setup a basic image preview generation program, however blender is a little more complicated because it needs to first open the .blend file, then create a preview scene and render that to a file. Luckily, there seems to be a python utility exactly for this purpose. You can invoke it like this:

"E:\blender\blender.exe" --background "PathTo\Fairy.blend" --python "E:\blender\2.93\scripts\modules\bl_previews_utils\bl_previews_render.py" 

We can try to use this to setup a preview tool in plastic, since it provides the "@src" variable which points to the .blend file. However, now comes the issue: Plastic expects us to pass on the "@output" path and let our preview utility render to that file path.

As far as I could tell, the python script is hardcoded to only render to the temp location and doesn't accept any file path argument. I've also tried setting the blender.exe output path, but it didn't do anything in this case. So I guess some options would be:

- implement a custom python scripts that's basically a copy of the default one with the option to provide a custom path
- ask the blender community to do that
- hack around at trying to get the temp path and copy the image over to the plastic output directory

 

I went so far as to try changing the default python script, however it then complained that "file format not supported" which simply referred to the path of the temporary preview file being "something.tmp" instead "something.png". At this point I gave up, because I'm not sure I can make the image library accept a path that doesn't have the "correct" file extension.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...