on which can save and load custom props (drive shape keys) and pose bone transform for Armature characters as preset.json with some options.
Then I hope to enhance it by generating preview images (jpg, or png) with json. (eg When I save "preset.json" from add on UI button,it will auto generate preset.png of current scene preview)
I suppose I can use the bpy.utils previews submodule (bpy.utils.previews) but do not know clearly how it actually works. What I hope to know is, if there's a function which can generate the preview at a user-defined path.
I suspect I can mix the funciton with my custom operator class to save json (so when save the json, same name image file will be genrated as perview)...
If someone has experience with this, would you teach me how you achieve it (with simple code)?
I suppose I may need to use the bpy.utils.submodule (bpy.utils.previews) but even though I read the docs and example (which uses the image as UI widgt, which I don't need, I only need to know how to generate a current scene preview as image file)
//////
Though my final goal is same, I took some of the steps and made a few changes...
What I planned is,
- render and save viewport as open GL image with current user scene settings, when you save "preset.json" from my add-on's UI button
Then I hope to make render and save function, which renders the view port (Open GL) image and saves the image "without image editor>render-image>save"
I plan to use bpy.ops.render.opengl(), to render a thumbnail, is there good way, "without opening the image editor(Render image) and choosing slots" but saving to the directory with file name, as arguments?
Has someone already built a simillar (simple) custom function?