Jump to content

Automatic Sprite Rendering


HENDRIX

Recommended Posts

HENDRIX

So I talked about this idea with Vondell a long time ago, but today finally sat down to code it... Introducing the


AUTOMATIC BLENDER SPRITE RENDERER



Say you have a model in blender, and some animations for it. This tool will go over each animation and render all five required views for ZT1. It also sets up the camera, lighting and shadow - you don't have to worry about a thing!



Obviously, this tool also allows you to import existing models and animations, for example from ZT2 with the scripts I made.


Below is some of the output with models from my ZT2 WWD project:



pt34Y5j.pngF0WqMzj.gif



5cM8VzC.pngYHBJz6x.gif



Crwhj7E.png5QbWuZM.gif


N7lgjgr.pngueXuC8b.gif



(incase the left version is a still image for you, change your browser for something with APNG support!)



The current assumption is that 1 meter ingame equals 16 pixels. You can scale to the blender grid before rendering and should then get corresponding results ingame.


Note that I forgot to scale them in blender, which is why Koola looks ridiculously huge :P



Gosh - it's been more than a decade since I designed for ZT1! It doesn't support soft transparencies, does it? Is the size of the images relevant? Is there a software solution to crop and anchor each frame as in the official files?


Does zoot have a commandline interface? If so, I could make the program export finished ZT1 anims instead of individual PNG sets.



Release should follow soon, I have to add some button to the user interface...


Link to comment
Share on other sites

Jay is over at the Download Directory and he is the one who did the latest updates on both zoot and APExp so if you join there you can ask him directly and he can probably give you any technical advise as he is a computer programmer.

This I will be interested in seeing.

Link to comment
Share on other sites

Very nice work HENDRIX ! Great to still see new tools to create content for such an ancient game :)

APE's missing a lot of essential features. Its main benefit is: it was an original tool and allowed for some configuration of animals and basic objects; but it created a very ugly mess of a code. ZOOT is for the graphic part a lot better but still has a few things it can't handle well.
Based upon info mostly from MadScientist (creator of ZOOT and the person who figured out most of the original ZT1 graphic format) and some of Jay, I came up with ZT Studio, which supports most (perhaps all) ZT1 sprite variations so far.

 

It allows for batch conversion of all .PNG files you render with your method. Vondell and I have used it for the Red Panda.

I must say it's been a while since I coded it, I had plans for command line but I think it's missing at the moment.
Anyhow, you can simply name your files appropriately, put them in a typical ZT1 folder structure, set the path and ZT Studio will convert everything for you.

 

Try it and if it's to your liking, I might reinstall Visual Studio and add a quick method to convert the folder containing the images (or a single image) from the command line.

Link to comment
Share on other sites

HENDRIX

Initial version is done! You can find the link in my signature under "ZT1 Sprite Renderer".

First, you must install and activate the provided script. If you want to import from ZT2, also install my BFB and edited NIF scripts.

1) Import / create a model. If you import a BFB file, make sure to turn the mirror option OFF.
iQOiHS7m.jpg
eZRG8qCm.jpg

2) Import / create animations. You should probably rename them to match what the ANI file expects, but I'm not sure.
qzEBlbAm.jpg

3) Scale the armature, not the model (that would distort it). 1 blender grid square should correspond to 1 meter ingame.

4) Then you only need the "Render Tab".
Locate the "Output" field. Specify where the files should be created. ZT Studio expects "temp/output".
Locate the "ZT1 Sprite Rendering Tab". There are four buttons at the moment.
For ZT2 imports: Try each of the muting buttons and see when walk or run animations become stationary. That means they no longer move forwards and walk on a treadmill. You could also do this manually in the Action editor, and of course this step is not needed if you made your own anims to begin with.
Once you have done that, click "Render Sprites for all Anims"
SLpOAZUm.jpg

5) Process the images as described here: https://github.com/jbostoen/ZTStudio/wiki/How-to-create-a-color-palette-to-share-with-several-graphics-(views,-animations)-using-GIMP
If you don't do this, ZT Studio will raise an error because every image has too many colors.

6) Open ZT Studio. Make sure you have the fiiles in "C:/temp/output" now. Change ZT Studio's settings like this:
Conversions > Batch Conversions > Start Numbering at Frame 0
Writing PNG Files > Crop to relevant pixels of this frame (might not be needed)
Run the Batch Conversion feature and you should get ZT1 animations and palettes.

Link to comment
Share on other sites

HENDRIX

Very nice work HENDRIX ! Great to still see new tools to create content for such an ancient game :)

APE's missing a lot of essential features. Its main benefit is: it was an original tool and allowed for some configuration of animals and basic objects; but it created a very ugly mess of a code. ZOOT is for the graphic part a lot better but still has a few things it can't handle well.

Based upon info mostly from MadScientist (creator of ZOOT and the person who figured out most of the original ZT1 graphic format) and some of Jay, I came up with ZT Studio, which supports most (perhaps all) ZT1 sprite variations so far.

 

 

It allows for batch conversion of all .PNG files you render with your method. Vondell and I have used it for the Red Panda.

I must say it's been a while since I coded it, I had plans for command line but I think it's missing at the moment.

Anyhow, you can simply name your files appropriately, put them in a typical ZT1 folder structure, set the path and ZT Studio will convert everything for you.

 

Try it and if it's to your liking, I might reinstall Visual Studio and add a quick method to convert the folder containing the images (or a single image) from the command line.

 

Hi jbl!

I just tried ZT Studio so I could test the workflow with the file structure and all. It worked! It looks like it crops and anchors each frame, great job!

The scripts can't interact directly with ZT Studio, as the images have to be pre-processed with gimp to palettize them. So for now it doesn't make much sense to have a console interface.

Automatic palette generation from PNG series would be cool, but I suppose there's no plan to code that if it works with gimp...? But if those two features were implemented, the whole process could happen in the background, on the fly.

 

Also, I get different PALs for each view angle, even though I had created every frame using the same palette in gimp. Am I doing something wrong? If I remember correctly, original animals had just one PAL for each life stage?

Link to comment
Share on other sites

I only created ZT Studio at a point where ZT1 isn't that popular anymore.

I considered adding a couple of features - including some image manipulation, but decided against implementing complicated.

That's why it might indeed be necessary to do a few preparations. The amount of colors is actually a ZT1 limit, so I had to program it that way.

 

ZT Studio should recognize the gimp color palette you've created. You provided the correct link to generate such a color palette.
I assume you also read this? https://github.com/jbostoen/ZTStudio/wiki/How-to-convert-.PNG-images-to-ZT1-Graphics-in-batch

If you don't provide the palette which should be used, ZT Studio creates one for each view of each animation (similar to APE and ZOOT).

 

I must admit I only tested a few scenarios with Vondell's Red Panda.

Link to comment
Share on other sites

HENDRIX

I hear you. Whenever I'm think about adding a feature to APE2, I'm always wondering the same...

 

A note about the colors - I get an error for every surplus color. Even for one image, this gives a huge chain of errors. One error saying "there are too many colors" would be more elegant.

 

Oh, I overlooked that I should export the palette into the folder. I just thought having them palettized would be enough. I think I'll make one test project and actually put it ingame. Shouldn't take long if all goes well...

Link to comment
Share on other sites

It's been brought to my attention by Jay that I didn't properly publish a minor update to GitHub. I've updated the 2017.02.03 release to contain the proper files. There, ZT Studio should just quit a lot faster if an error has occurred (such as too many colors).

 

Yes, I consider it to be two steps.
1) making sure not too many colors are used (okay, the original APE wins in this area)

2) sharing a palette is something which 99% of the designers wouldn't be interested in, it's more of an advanced feature. But if you just like me want to come close to creating graphics by the "Blue Fang" standard as I'd call it, then it's an extra step.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...