problem with ms3d files...

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
TheGibberingFool
Posts: 3
Joined: Sun Jan 18, 2004 3:30 pm
Contact:

Nooo!

Post by TheGibberingFool »

Nooo! You can't! Skeletal animation rocks :(

I get the same thing, however. One frame = 1000 and also only a quarter of the animation plays before it starts going strange.

I hope that you get this fixed soon or something. I'd hate to see this feature go :cry:
www.gibbering.net | gibbersoft.illicitdev.net
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

here's hopin .X works better...

Post by buhatkj »

welp, there isnt much the milkshape format can do that .X can't, and milkshape exports it nicely anywho, so here's hopin .X works better!
cheers...
-Ted
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
TheGibberingFool
Posts: 3
Joined: Sun Jan 18, 2004 3:30 pm
Contact:

Post by TheGibberingFool »

You have a point. Cheers.
www.gibbering.net | gibbersoft.illicitdev.net
TheGibberingFool
Posts: 3
Joined: Sun Jan 18, 2004 3:30 pm
Contact:

Actually

Post by TheGibberingFool »

It seems .x doesn't work yet. I don't want to use MD2 either. Oh well... :(
www.gibbering.net | gibbersoft.illicitdev.net
knoo

ms3d solution

Post by knoo »

I had this same problem, so I checked CAnimatedMesgMS3D.cpp file for an explanation.

There is one problem and it's that there is no keyframe for timeindex 0
so it's an awful mess before first keyframe.

So just add code (line 230):

// set first rotation keyframe to timeindex 0
k.timeindex = 0;
k.data.X = 0;
k.data.Y = 0;
k.data.Z = 0;
jnt.RotationKeys.push_back(k);

and same thing for TranslationKeys

this should help for a start, I hope.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

heyheyhey..

who said x does not work? :roll:

Indeed, my two kilometers latest posts (I know: hard to read all that) demonstrate that :

- x files WORK. Is more a matter of the package, but the fact is Niko did things correctly ;)


- Ultimate unwrap will open any directx8 file exported from any 3d package that exports it. And its export, also in dx, is proved now -thanks to bappy- to work in irlitch.

- Character Fx work (i made a test with Niko) I mean, it's x files do load well in Irlitch.

Indeed. you only need character Fx. 15$. (Ultimate Unwrap is for uv mapping, mostly.Though do perfect conversions, supporting weights, not like Milkshape that kills them)

- My latest long threads...demonstrate you actually can export directx8 fromat using the free Panda Exporter, from Max, and succesfully :)
I just posted (I think in "direct x exporter" thread, in Off Topic) the exact settings of the export dialog to check, so that it works well. Even more, I explain a bit some of those settings.

- I am lately checking FBX. Having now both max 5 and Max 6 trials, I may make a nice test: fbx export from max 6, so to open max 6 files in max5.
Also, this is a way to export directx character WITH BIPED :)
I mean, exporting fbx from max 6 (or 5) and reimporting later, will convert you character studio biped as standard bones and skin modifier. This actually rocks, as then, you can export with direct x panda exporter. As it does support standard bones. Supposedly, visually is the same thing. I have read this trick in a forum today. After several hard searches.


-Even more. No many artists around here :roll: so, as if not, we would be now seing tests with Lightwave, Maya, Hash AnimationMaster, XSI, as all these have directx 8 weighted animation export. Only the Hash is comercial.

Directx 8 is weighted animation. Is modern format. Milkshape is more or less like halflife 1. Rigid vertices. And all what is opened in MS3d, loose the weights. So the smooth bending, etc...

Even more. Spline interpolation...that rocks for mixing different animations, as well as adding additional timing smoothness...

I'd bet for directx.... ;)


max users, see the "directx exporter" thread, copy somewhere those values, and before exporting with panda, please, add a pair of keyframes. It hangs if there is no animation...

And wait somedays, I may have ironed the only lacking stuff...biped puppet support...With the help with the free fbx plugin, I may solve it and share the tips in same thread.. :)

Imho, it's quite a better bet. There's no engine for free that i know that allows this. And this is a very small portion of problems and limits having several comercial "game creation packages" .niko has added it with many features.
Mercior
Posts: 100
Joined: Tue Feb 24, 2004 1:53 am
Location: UK
Contact:

Post by Mercior »

I too can't get ms3d files to load correctly, I have been exporting to MD2 from milkshape for my game, but annoyingly I have to hard code frame sequences for each model because there seems to be no relation between the frame numbers in milkshape and the frames irrlicht gets from the md2 :/
buhatkj
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am
Contact:

not sure about ultimate unwrap working...

Post by buhatkj »

welp i opened both a milkshape and a milkshape exported x in UU3d, exported each as .x, opened in irrlicht and they were still all screwy. in a different WAY mind you, but still messed up.
seems like any skeletal animated model i use has some pretty serious deformations.
md2's of course, work great, but have the common prob of the vertex swimming and lack of joints to attach child meshes to.
also they have 8* the number of frames they had in milkshape.
perhaps somebody could post a link to the thread where bappy posted his info about what he did to make them work? perhaps i missed something.
the fact is, ALL of the different ways i have exported .x models have looked fine in the directx mesh viewer, but have had deformations in irrlicht.

i have thought about making my own model format based on XML and writing custom irrlicht plugins and milkshape exporters for it. .x has a bunch of stuff game developers don't need(my opinion, hold your flames...)and md3's(the other most common modern game format) are sort of unnecessarily complex(the whole 3-pieces thing...) and lack TRUE bones...
(tags are cool too, but not quite as good)

trouble is i doubt i could do it any better than anybody else ;-)

in any case, i'm confident that given a month or two's time niko and us will figure out how to get .x models to render right, and export them in a way so that they dont get all goofed up.

-Ted
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

At the end I may say it maybe happening.

Unless bappy's viewer has some problem, his irlitch viewer is displaying weird things...

I opened the boned , weighted and animated box in x format, exported from panda, also another from my character fx (this one a full human with weights, many are partial) and I get a dark scenery where only the light bulb is seen.

If I open in meshview and resave, then opening in the Bappy irlitch viewer, shows some weird deformation in the box, and in both examples, like a black outline but out of place, with strange shapes...

Maybe is a serious problem in Bappy's viewer, but also could be a problem in the directx file loading of Irlitch.

What I am wondering.... Niko surely saw it well, so there's something yet I can't understand...

I get all the files work perfect now in Skinnedmesh viewer (I think is a dx9 tool some coder passed me sometime ago, included in dx9 sdk) and seems more or less also in an old meshview release.

Problems in those viewer is just adjust a bit better the timing...


So, seems to me character fx, UU3d, and Panda exporter are working fine in directx export...

Milkshape will kill all your weights, I must insist..if you want to do a more than 600 tris characters, be prepared to have certain knowledge about extra joints and mesh acomodation...and trust me, is not trivial, if you want to make it look cool. :/

Md2 has the vertex wobbling thing. bad shading and probably a limit of vertices, not sure. It could be just a recomendation for hardware of those times.

md3, yep, the three parts...dunno though if u could just use it without breaking it...I made a try importing OBJs into npherno mesh compiler, and exporter as md3...did seem to work in deep exploration demo. Only the smooth interpolation was missing.

But yep, none of this have bones, and are way memory heavy (each frame+++ memory, so you have to use very few frames-->worse animation)

Accessing bones in code is really helpful.
knoo

new solution to ms3d-loader

Post by knoo »

to add null keyframe to timeindex 0 wasn't the best solution,
I noticed.. So let's set first keyframe to timeindex 0 and add
the same keyframe to timeindex totalTime..

This looks quite working. New code is under:


CAnimatedMeshMS3D.cpp
Line 226 ->

// get rotation keyframes
s32 j;
SKeyframe k;
MS3DKeyframe* eka = NULL; // this contains data of first keyframe
f32 first = 0; // this is time of first keyframe

// The idea is to set first keyframe to timeindex 0
// now we don't have last keyframe (timeindex totalTime) anymore
// so let's copy first keyframe to timeindex totalTime
// new totalTime is totalTime - first timeindex
// And here is the code:

for(j=0; j<pJoint->NumRotationKeyframes; j++)
{
MS3DKeyframe* kf = (MS3DKeyframe*)pPtr;
pPtr += sizeof(MS3DKeyframe);

if(j==0)
{
eka = kf;
first = kf->Time;
}

k.timeindex = (kf->Time-first) * 1000.0f;
k.data.X = kf->Parameter[0];
k.data.Y = kf->Parameter[1];
k.data.Z = kf->Parameter[2];
jnt.RotationKeys.push_back(k);
}
totalTime -= first;

// Let's add one keyframe to the end
if(eka)
{
k.timeindex = totalTime;
k.data.X = eka->Parameter[0];
k.data.Y = eka->Parameter[1];
k.data.Z = eka->Parameter[2];
jnt.RotationKeys.push_back(k);
}
eka = NULL;

// get translation keyframes
first = 0;
for(j=0; j<pJoint->NumTranslationKeyframes; j++)
{
MS3DKeyframe* kf = (MS3DKeyframe*)pPtr;
pPtr += sizeof(MS3DKeyframe);

if(j==0)
{
eka = kf;
first = kf->Time;
}

k.timeindex = (kf->Time-first) * 1000.0f;
k.data.X = kf->Parameter[0];
k.data.Y = kf->Parameter[1];
k.data.Z = kf->Parameter[2];
jnt.TranslationKeys.push_back(k);
}

// Let's add one keyframe to the end
if(eka)
{
k.timeindex = totalTime;
k.data.X = eka->Parameter[0];
k.data.Y = eka->Parameter[1];
k.data.Z = eka->Parameter[2];
jnt.TranslationKeys.push_back(k);
}
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

I need to add:

the weird deformation problem is seen once I resave in meshview from Ms.

as directly in Irlitch viewer from bappy, it just don' show it. It shows a blank screen...

when I hit then "w", see all the time a diagonal line in the whole screen. As if it where a wall of the box...but if I rotate my "head" it goes with me, so is not an scale problem (as it may got huge scale) unless the box gets tied to the user camera view.

And I think am wasted...can't thinkl now on more possibilities....
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

hey, buhatkj ...

(this is not a flame... ;) )

Yep, I know coders you don't need full weights, but artists really do.Today is where engines are heading to... And if artists make graphics for irlitch, it will be better for irllitch and games don with in irlitch.. :)
(imho) ;)

I always had a big issue convincing coders of weights advantage... heh

But at the end all gave agreed with this fact till today...

this is what weights can do and make it way harder to do in Milkshape or any other software that don't support weights. Don't take me wrong, I purchased ms3d, and love that th eformat is supported, and that Knoo is solving the problem. Just that lotsa artist will run paniced when know no weights for animation in an engine. I do..

[ heck, and with all time put in this(Panda issues, etc) I could have done that martial animated sample for Niko in x format...oh, well.. :D ]

character fx screens.Full weights.
Image
Image
Image
Image
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

vermeer wrote:
Accessing bones in code is really helpful.
Is there any information anywhere on how this can be done in Irrlicht? I know that the engine can't read skeletal information from .x right now.
My knowledge of the 3d formats is very limited. :oops:
Post Reply