Sprite Batch Render addon for Blender

Any utility that assists in the creation of mods, assets, etc, go here.

Sprite Batch Render addon for Blender

Postby cce » Sat Jan 25, 2014 6:46 pm

Hello!

Image

Creating Doom sprites by hand is very tedious but Sprite Batch Render addon makes it a lot easier.

It's a Blender addon that renders the given scene from multiple directions by rotating the object and creates Doom compatible sprite names.

The addon interface looks like this:
Image

Obviously you need to also set sprite offsets to use the sprites in Doom.

Documentation and script download at
https://github.com/seece/SpriteBatchRender

See also Blender addon installation instructions.

Edit: Updated screenshot.
Last edited by cce on Fri Sep 02, 2016 9:10 am, edited 3 times in total.
cce
 
Joined: 11 Dec 2012

Re: Sprite Batch Render addon for Blender

Postby HavoX » Sat Jan 25, 2014 8:00 pm

But then it would be cheating. :P

Still, looks very promising.
HavoX
I don't post as often as I used to...
 
Joined: 11 Apr 2012
Location: St. Louis, MO

Re: Sprite Batch Render addon for Blender

Postby Gez » Sun Jan 26, 2014 12:35 am

It's interesting, though there is some subtlety with rotation steps. ZDoom supports 16 rotation angles, but to make it compatible with the usual 8 angles, the characters for the in-between rotations come after the letters from the original 8 rotations.

That's not clear at all, so basically:
for 8 rotations: stepnames = "12345678"
for 16 rotations: stepnames = "192A3B4C5D6E7F8G" and not "123456789ABCDEFG"
Gez
 
 
 
Joined: 06 Jul 2007

Re: Sprite Batch Render addon for Blender

Postby Nash » Sun Jan 26, 2014 1:57 am

WOW! Thank you so much! I was always doing it the manual way... this is going to save soooooo much time in my asset pipeline! Thanks for providing this!
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Sprite Batch Render addon for Blender

Postby Batandy » Sun Jan 26, 2014 4:36 am

I've added the script to 2.66/scripts/addons, but the addon doesn't show up in the User Preferences :(
I've also tried installing it from Blender, with no results
I'm using Blender 2.66.1
User avatar
Batandy
"If it's not fun, why bother?"
 
Joined: 19 Jul 2011

Re: Sprite Batch Render addon for Blender

Postby Nash » Sun Jan 26, 2014 5:18 am

File -> User Preferences, File tab, be sure "Auto run Python scripts" is ticked.

(Also be sure to click "Save User Settings" at the bottom because Blender always starts with a clean slate by default)

EDIT: Derp. Misintepreted your problem. According the PY source of the script, it's apparently made for Blender 2.68 and above. Maybe that's why it's not appearing in your copy of Blender.

EDIT 2: Confirmed as showing up in my version of Blender 2.69. Haven't actually used the script though, will have to try that when I have more time.

(I have a quick suggestion - the Rotation Steps control should be buttons that allow you to select either 8 or 16 only because right now with the way it's being setup as a vaue slider, it's possible to set it to ridiculous values that won't be useful for ZDoom usage and might be prone to user error. Or possibly a "mirrored" option so that it only exports half of the angles and intelligently names the files so that mirroring will work. See the wiki page Gez linked to for more info)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Sprite Batch Render addon for Blender

Postby Batandy » Sun Jan 26, 2014 6:02 am

Updated to 2.69, still no results, it doesn't appear in the user settings' addon tab,again, i've tried to place it in the new addons folder and also installing it by loading the py file, nothing :(
User avatar
Batandy
"If it's not fun, why bother?"
 
Joined: 19 Jul 2011

Re: Sprite Batch Render addon for Blender

Postby cce » Sun Jan 26, 2014 8:34 am

Thanks for all the feedback!

I made a little update to the script applying the following changes:

  • Lowered the version requirement down to 2.60 (I hope it works!)
  • Added custom step name option to help when rendering 16-step rotation sprites
  • Removed custom frame name checkbox, custom frame names are now always used
  • Created a sample blend file: monkeeh.blend

Download at https://github.com/seece/SpriteBatchRender

Batandy wrote:Updated to 2.69, still no results, it doesn't appear in the user settings' addon tab,again, i've tried to place it in the new addons folder and also installing it by loading the py file, nothing :(

Make sure you placed sprite_batch_render.py at
Code: Select allExpand view
%APPDATA%/Roaming/Blender Foundation/Blender/$VERSION/scripts/addons
For example
Code: Select allExpand view
C:\Users\Username\AppData\Roaming\Blender Foundation\Blender\2.69\scripts\addons


I also uploaded some scripts I used to postprocess the generated tiles. They are basically used to join multiple frames to a single tileset with Imagemagick, and to split them back to singular sprites afterwards. Use at your own risk :wink:
cce
 
Joined: 11 Dec 2012

Re: Sprite Batch Render addon for Blender

Postby Nash » Sun Nov 22, 2015 1:15 pm

Hello, the example monkeeh.blend download isn't available anymore, can you please reupload it? Thanks. Nevermind, found it! The hyperlink is wrong but the text is the correct link. :D I was doing this hastily and didn't see that the text and the hyperlink were different.

EDIT: Had a lot of trouble figuring this out, here are some additional notes for anyone who's looking for information:

1) To setup the camera tracking setup that this script expects to work with:

- Delete any cameras in the scene if there are any, add a new camera (there must be only 1 camera in the scene) and position it however you want the sprite to end up looking like (adding a new viewport and using the camera view (keypad 0) might be helpful for you at this stage)
- With the camera selected, go to the Constraints tab (it should look like a chain, to the right of the Object tab)
- Add object constraint -> Track to
- For the Target, click it and choose the object you want to render (your monster/character/whatever)
- To: -Z
- Up: Y
- After setting the To and Up options correctly, the red colour from the constraint name should disappear, meaning it is now setup properly.

2) New users will most probably still get errors when trying to run this script. There is an oversight in the source code. In sprite_batch_render.py, line 169, the path needs to be fixed to this: C:/temp/sprite/sprite%s%s.png (it previously was using %s%d which was wrong. Alternatively, the user can just correct the path themselves before clicking the Render Batch button, but having the Python script fixed with the correct defaults is more user friendly)

3) HANDY TIP! If you plan to render your model with lighting, be sure to add constraints to your lights as well, with the Camera as the target. Depending on how your lights are setup, tick and untick the X, Y and Z boxes accordingly. If your lights don't have any constraints, the lighting will remain static, and because the script actually physically rotates the camera around the world, some angles in the render will have dark shadows, which you most probably do not want.
Last edited by Nash on Mon Jan 25, 2016 11:11 pm, edited 4 times in total.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Sprite Batch Render addon for Blender

Postby Gez » Sun Nov 22, 2015 2:38 pm

Nash wrote:Hello, the example monkeeh.blend download isn't available anymore, can you please reupload it? Thanks.


http://www.lofibucket.com/blender/monkeeh.blend works for me.

It's linked from the project's readme.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Sprite Batch Render addon for Blender

Postby Nash » Mon Nov 23, 2015 2:23 am

Ahh I see it now; the hyperlink is wrong but the text is the correct link. :D I was doing this hastily and didn't see that the text and the hyperlink were different.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Sprite Batch Render addon for Blender

Postby Tormentor667 » Mon Nov 23, 2015 6:26 am

This is neat
Image
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: Sprite Batch Render addon for Blender

Postby Nash » Tue May 24, 2016 6:29 pm

Hi cce, semi Blender related question... I hope you can help me out.

I'm trying to modify your script to write the camera's current angle in every frame to a text file... based on what I have so far, it seems to be writing the frame number correctly, but the angle of the camera seems to be ignored! What am I doing wrong here?

File with script embedded: https://dl.dropboxusercontent.com/u/473 ... ngle.blend
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Sprite Batch Render addon for Blender

Postby MetallicaSepultura » Thu May 26, 2016 10:55 am

i did a similar thing some days ago using maya, but since i don't think there's such plugin, i had to rotate the camera manually.
User avatar
MetallicaSepultura
Taking the Angst, setting Revenge
 
Joined: 15 May 2016
Location: Futura City, currently slaughtering Rahzs

Re: Sprite Batch Render addon for Blender

Postby cce » Fri Sep 02, 2016 7:15 am

Nash wrote:based on what I have so far, it seems to be writing the frame number correctly, but the angle of the camera seems to be ignored! What am I doing wrong here?

The camera angle is read correctly, but because the script does no rotation it's the same every frame. You can see that the number written changes if you rotate the camera. So I guess you want to add back in the rotation from the original script :)

MetallicaSepultura wrote:i did a similar thing some days ago using maya, but since i don't think there's such plugin, i had to rotate the camera manually. --

Pretty sweet!

Edit: I also updated the plugin to be more user friendly. Now the camera stays still and just an user selectable object rotates. Grab the latest version from GitHub.
cce
 
Joined: 11 Dec 2012

Next

Return to Editors / Asset Manipulation

Who is online

Users browsing this forum: TDRR and 0 guests