Page 2 of 2

Re: Blender-to-Blender-to-Noesis-to-Q2: how to animate?

Posted: Tue Nov 27, 2012 2:40 am
by taniwha
Well, I suppose I could do something silly like add md2 and sp2 support to QF, and since QF includes a blender io addon for mdl, and a pcx->spr converter... :)

Re: Blender-to-Blender-to-Noesis-to-Q2: how to animate?

Posted: Tue Nov 27, 2012 7:59 am
by taniwha
I just had a look at the sp2 format. It's ridiculously simple (my jaw dropped when I saw the structs in qfiles.h).

Code: Select all

#define MAX_SKINNAME    64
#define IDSPRITEHEADER  (('2'<<24)+('S'<<16)+('D'<<8)+'I')
// little-endian "IDS2"
#define SPRITE_VERSION  2

typedef struct {
    int width, height;
    int origin_x, origin_y;     // raster coordinates inside pic
    char    name[MAX_SKINNAME];     // name of pcx file
}
dsprframe_t;

typedef struct {
    int ident;
    int version;
    int numframes;
    dsprframe_t frames[1];          // variable sized
}
dsprite_t;
It would be pretty trivial to put something together in python. I'm not sure it's worth doing in C, though if I do, I'll put it in qfspritegen as an option (spr or sp2).

Oh, I had a look at an actual sp2 file, and the name is the gamedir relative path including the .pcx extension.

Re: Blender-to-Blender-to-Noesis-to-Q2: how to animate?

Posted: Mon Jan 14, 2013 8:45 pm
by Rich
Gaku wrote:I've managed to setup a workflow of sorts for getting Blender files into Quake 2.

1) Create the model in Blender 2.63
2) Export it as a .obj
3) Import it into Blender 2.49b
4) Export as .mdl
5) Convert .mdl to .md2 using Noesis

Unfortunately my md2s are just a single frame, which results in spam error messages in-game.
I'm curious, what would be my best bet for compiling animation frames, and how could I pack them into the md2?

Also, is there a listing of which animation frames correspond to which states?

Thanks,
First, make sure your Noesis is up to date. Anything released in the last year or so will support auto-updating from within the program. Then, create and animate your skeletal model in anything you want, export to a suitable format (FBX, COLLADA from an OpenCOLLADA-based exporter, md5mesh+md5anim, SMD+SMD sequence, or any number of the other formats supported by Noesis), then use Noesis to go from that format directly to MDL or MD2. And you're done. It automatically gathers textures (in any supported format, as long as you have them in the model directory) and bakes them into a single page for both MDL and MD2, and it automatically bakes skeletal animations into vertex animations for those formats.