chrishayesmu / Blender-Spritesheet-Renderer

MIT License
16 stars 4 forks source link

Option to render using Multi-View instead of rotating an empty #6

Open Sookhaal opened 3 years ago

Sookhaal commented 3 years ago

I need to render 8 angles per animations for my topdown game. I did some tests and found out that rendering using Multi-View instead of rotating an empty is way, way faster.

I think it would be great to add a checkbox to allow the user to render using Multi-View.

One thing to note if you've never used Multi-View rendering: to my knowledge, there is no simple way to change the name of the output file, it will always have the camera suffix property appended at the end. image

The simplest idea I had to work around that is to sort the files differently right here: https://github.com/chrishayesmu/Blender-Spritesheet-Renderer/blob/5db8d0c2b889d910a139209b37d33a0c98f74b40/util/ImageMagick.py#L101 For example, if you had a _rot_XXX suffix to the camera (like in the screenshots above):

files = sorted(glob.glob(os.path.join(temp_dir_path, "*.png")), key = lambda x: (x.split("_rot_")[-1]))

That should give you a sorted filelist.txt:

"Walk_01_rot_000.png"
"Walk_08_rot_000.png"
"Walk_15_rot_000.png"
"Walk_22_rot_000.png"
"Walk_29_rot_000.png"
"Walk_36_rot_000.png"
"Walk_01_rot_045.png"
"Walk_08_rot_045.png"
"Walk_15_rot_045.png"
"Walk_22_rot_045.png"
"Walk_29_rot_045.png"
...