micwalk / blender-export-diffusion

Export blender camera animations to Deforum Diffusion notebook format.
MIT License
64 stars 3 forks source link

Added code to output clean for webui #4

Open KewkLW opened 1 year ago

KewkLW commented 1 year ago

Added code to output clean code to make it easier to double click on the block of data to copy/paste into webui. Previously, I had to manually edit out all the extraneous info. Also working on fixing the json output for parseq merging and an import feature for Blender. I may merge this with my other code that outputs a curve that represents the camera path.

micwalk commented 1 year ago

Thanks for the PR! I just started using the WebUI myself and was starting to take a second look at making this easier to copy into the webui. The format I had was designed for easy copy/paste of the parameter block into the notebook source code. This new output format is definitely easier to copy/paste each line into the web ui, and good catch on the trailing commas. I'm curious though why you re-implemented the logic from arr_to_keyframes instead of just calling that function?

Also thank you for adding for the import operation (from json it looks like?). However it looks like there are some errors in the import section of the code, possibly from copy/pasting things between files. Notably the execute function isn't inside the import class, and the write_camera_data function is defined twice.

Another note is it appears you have removed quite a few of my comments, possibly looks like you ran the code through some sort of linter?

KewkLW commented 1 year ago

I use a combination of gpt4 and copilot and wanted to minimize tokens. When I checked in the first, wrong file I panicked a little bit cause I hate checking in bad code >__< and jumped back in, tested and it all worked so PR the fix lol but that had a bunch of other sloppy things in it, but still worked so didn't catch it. I have it all fixed now. The import code is still being worked on. I found another bug when outputting json, it still outputs cam_code so will fix that then do a new PR.

I also have the output for parseq working but I started over on that one since it was way less complicated lol.