Sprite Batch Render addon for Blender

Any utility that assists in the creation of mods, assets, etc, go here. For example: Ultimate Doom Builder, Slade, WadSmoosh, Oblige, etc.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Sprite Batch Render addon for Blender

Post by Nash »

User avatar
Jaxxoon R
Posts: 772
Joined: Sun May 04, 2014 7:22 pm

Re: Sprite Batch Render addon for Blender

Post by Jaxxoon R »

cce wrote:Edit: I also updated the plugin to be more user friendly. Now the camera stays still and just an user selectable object rotates.
But won't that lead to the object getting mangled as it's rotated independently from its bones?
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Sprite Batch Render addon for Blender

Post by Nash »

You parent the Empty to the Armature OBJECT, not a bone.

An Armature, as an object (in Object Mode, for example), will rotate the mesh it's assigned to deform without any problems.

It's only when you move the MESH that it will start to get mangled.

I just rendered some sprites 5 minutes ago, it works perfectly if you parent things correctly (except for the reversed angle issue, which fortunately is just a matter of changing a + to a - in the .py).

Again: parent the Empty to the ARMATURE, not the MESH.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Sprite Batch Render addon for Blender

Post by Nash »

Hey cce, thanks for the quick fix. However, now I have a feature request... I wish I could do it on my own but Blender scripting is just beyond me currently. :'(

Would it be possible to somehow add an option to render more than 26 frames in 1 click? I was thinking, make a separate text box for just the sprite name. Then, if the name is 4 characters (POSS), the script would assume only 26 maximum frames.

If the name is 3 characters (POS), what the script will do is, it will append 0 to 9 to that name. The first 26 frames would be POS0 A to Z... then the next 26 will be POS1 A to Z... etc etc... right up to the maximum limit allowed by this naming convention.

Or... I don't know, any better ideas? Because right now I'm doing it all manually - set frame range to 1 to 26, type in POS0, click Render Batch, wait... then set the frame range to 27 to 52, type in POS1, render... wait... lather rinse repeat... it never ends. >_<

A second suggestion would be a "mirrored" option that would only render 5 angles instead of 8 - and duplicate the side angles and name them properly (angle 2 = angle 8, angle 3 = angle 7, angle 4 = angle 6)
User avatar
Major Cooke
Posts: 8196
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Sprite Batch Render addon for Blender

Post by Major Cooke »

Now that blender 2.8 is out, I suppose it's time I either try updating this for myself or, if CCE wants to, he can too.
cce
Posts: 17
Joined: Tue Dec 11, 2012 8:12 am

Re: Sprite Batch Render addon for Blender

Post by cce »

Major Cooke wrote:Now that blender 2.8 is out, I suppose it's time I either try updating this for myself or, if CCE wants to, he can too.
The plugin now works with Blender 2.8 :) Download the latest version at GitHub.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Sprite Batch Render addon for Blender

Post by Nash »

While we're here...

@ cce : I've created a fork and have been using it for quite some time now, that changes how the script works: https://github.com/nashmuhandes/SpriteB ... dfe60c3c7e
- Angle and frame names are now determined automatically. Didn't make sense to expose those data for the user to tinker with.
- Each mesh to be rendered now has a new property, SpriteName, to determine file name output.
- Support for more than 26 frames; in such a case, only the first 3 letters of SpriteName will be used. The 4th letter will be substituted with a number that increases every 26 frames.
- Added property (set on the Empty parent) for mirrored sprite names, and single angle sprites.
I'm still using 2.79, but I figured I'd just let you know my fork exists, in case you'd want to compare notes. I feel like the changes I introduced improves the productivity of the script. Feel free to hand-merge if you think my changes are useful, although I know that's not going to be convenient because my fork still works for 2.79. :)

Image

Image

Image
User avatar
Major Cooke
Posts: 8196
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Sprite Batch Render addon for Blender

Post by Major Cooke »

Those would actually be highly appreciated. Being able to use this would be great for the larger scale production.
Awez
Posts: 30
Joined: Thu Jun 02, 2016 9:38 pm
Location: 'Murrica

Re: Sprite Batch Render addon for Blender

Post by Awez »

I cannot believe I haven't seen this earlier, would have saved me so much time on my project. Great work, thanks Nash for updating this.
User avatar
Major Cooke
Posts: 8196
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Sprite Batch Render addon for Blender

Post by Major Cooke »

He didn't update it. He just made his own, but it was for 2.79.
cce
Posts: 17
Joined: Tue Dec 11, 2012 8:12 am

Re: Sprite Batch Render addon for Blender

Post by cce »

Nash wrote:While we're here...

@ cce : I've created a fork and have been using it for quite some time now, that changes how the script works: https://github.com/nashmuhandes/SpriteB ... dfe60c3c7e
Hey pretty cool! Since you are working actively with ZDoom I suppose you have a better idea what the plugin should be like :)
I made an issue in the repo so I don't forget. Let's see if I have the time to work on the addon though.

One question: how do you use the multiple model support? Do you go and manually point the camera to the selected mesh, and then click render? How does it work out with multiple meshes selected?
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Sprite Batch Render addon for Blender

Post by Nash »

cce wrote: Hey pretty cool! Since you are working actively with ZDoom I suppose you have a better idea what the plugin should be like :)
I made an issue in the repo so I don't forget. Let's see if I have the time to work on the addon though.

One question: how do you use the multiple model support? Do you go and manually point the camera to the selected mesh, and then click render? How does it work out with multiple meshes selected?
I've left a note on your Issues page about my fork being a little buggy at the moment. :) I am working on fixing all loose ends.

About your question - good one actually. I never took this into account. I can't test it right now, but I suspect what would happen is, it would just keep on rendering the same shots over and over again, every pass with each individual mesh's SpriteName as the output, because it's just for-looping through all the meshes... not sure what's the best way to deal with this for now; originally, I made it this way because for the specific game I'm working on, this was actually the desired behaviour (I had some extra steps in the script that would show/hide each object individually with each mesh, this was for multi-part actors). I'm not sure how to handle this situation so that it can be more useful generically. Any ideas welcome.

[UPDATE] I have fixed pretty much all buggy behaviour and have thoroughly tested it with an animated character... as far as I can tell, everything now works perfectly. Only 2 issues left (multiple mesh selection and 16-angle support) and I think I can declare my overhaul as final.

[UPDATE 2] After thinking carefully, I am thinking of moving the SpriteName property to the render panel (along with NoRotation and Mirror). It doesn't make sense for every object to have individual SpriteName properties.
User avatar
Nash
 
 
Posts: 17465
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Sprite Batch Render addon for Blender

Post by Nash »

I have fixed all bugs, and moved the sprite name to the render panel, so it is no longer relevant what objects you have selected or not - it will just render the entire scene as seen by the camera. I don't plan to support 16 angles for now, as I am not using that feature for my current projects. :)

I think I will declare my fork complete, for now. Unless I find other bugs. :P
User avatar
Major Cooke
Posts: 8196
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Sprite Batch Render addon for Blender

Post by Major Cooke »

I use 16 angles for a number of things. If this is adapted, CCE, I would appreciate having the ability to render out 16 angles as that was a feature part of the original design. I use it quite heavily.
User avatar
neoworm
Posts: 1748
Joined: Fri Sep 23, 2005 9:17 am
Location: Czech Republic

Re: Sprite Batch Render addon for Blender

Post by neoworm »

I just found that the 2.81a version of the script is not compatible with 2.9. That's kinda bad, I moved with most of my monster models to 2.9 since it has some new shader nodes that I wanted to use. Is anybody planning on updating to 2.9 anytime soon? The backporting from 2.9 to 2.82 introduced some problems to my models so I am kinda stuck right now.

Return to “Creation, Conversion, and Editing”