Exporting problem resulting in invisible model

Topics: Developer Forum, User Forum
Apr 4, 2007 at 11:02 AM
Hi again.
As stated in earlier posts: This animation library is my choice over Microsofts own.

Although there are some issues now. I'll try to be as specific as possible.

First of all. Panda Exporter caused my modellers' (I have a bunch) 3DSMax to crash when trying to export the models with animations. I think this is the main problem. If anyone has the export options for the Dwarf model I'd be happy to have a look at them.

All other problems might be solved if this just works. Anyone being able to help?
Coordinator
Apr 4, 2007 at 12:11 PM
This is an exporter problem, correct? If the model displays in the mesh viewer but not in the game, then you can feel free to send it. To my knowledge, the library has a 100% success rate one valid .X ascii files.

I don't use max personally, but I know someone who uses panda. I'll send them an email to see if I can get the options.
Apr 4, 2007 at 12:19 PM
Ok. Thanks again for the help.
Now we have some messed up things.
I cannot view the Dwarf in meshview, but I can see the Dummy.x. Freaky eh?
Even freakier, the bones seem to be exported with animation as they appear just as in 3DS. They don't transform the skin at all, they just move outside the textured skin. So I now have a dummy with freely moving skeleton... Not too sexy.

Appreciate the help.
Apr 4, 2007 at 12:41 PM
Another thing.
Did your fine tutorial once again but without the dwarf and with my own model.
I scrambled up some things. The drawing is now done in Draw() for instance (i tried keeping it the way it was but no difference).

The problem occurs here
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicPaletteEffect effect in mesh.Effects)
{
effect.View = view;
effect.Projection = projection;
}
}

My model does not contain BasicPaletteEffect according to the compiler. And it usually is right.

That's as much narrowing-down I can do for the moment.
Apr 4, 2007 at 1:39 PM
http://www.codeplex.com/animationcomponents/Wiki/View.aspx?title=Troubleshooting

Doesn't work.
Just so you don't say that I am to go there for help.
Coordinator
Apr 4, 2007 at 8:07 PM

Aglet wrote:
Ok. Thanks again for the help.
Now we have some messed up things.
I cannot view the Dwarf in meshview, but I can see the Dummy.x. Freaky eh?
Even freakier, the bones seem to be exported with animation as they appear just as in 3DS. They don't transform the skin at all, they just move outside the textured skin. So I now have a dummy with freely moving skeleton... Not too sexy.

Appreciate the help.



So, Dummy.x appears messed up in the mesh viewer, or just in the XNA library?

Microsoft's .X Importer has trouble parsing the dwarf. I don't know why (there is almost certainly something wrong with it), but that's why it won't display in the mesh viewer (or when you use X File - Xna Framework importer)
Coordinator
Apr 4, 2007 at 8:14 PM

Aglet wrote:
Another thing.
Did your fine tutorial once again but without the dwarf and with my own model.
I scrambled up some things. The drawing is now done in Draw() for instance (i tried keeping it the way it was but no difference).

The problem occurs here
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicPaletteEffect effect in mesh.Effects)
{
effect.View = view;
effect.Projection = projection;
}
}

My model does not contain BasicPaletteEffect according to the compiler. And it usually is right.

That's as much narrowing-down I can do for the moment.


Sounds like your exporter is exporting its own effects then. So, the effects are not instances of BasicEffect, correct? If they aren't BasicEffect or BasicPaletteEffect, then that is what is happening.

There are quite a few ways to fix this, but none of them are trivial because you can't instantiate BasicPaletteEffect without creating it through the pipeline (the reason for this is because I didn't want to ship an .fx file along with the dll). If you can confirm that this is the case (i.e., the effects are neither an instance of BasicEffect nor BasicPaletteEffect), I can post a fix.
Apr 5, 2007 at 7:53 AM
Edited Apr 5, 2007 at 7:58 AM

dastle wrote:

So, Dummy.x appears messed up in the mesh viewer, or just in the XNA library?

Microsoft's .X Importer has trouble parsing the dwarf. I don't know why (there is almost certainly something wrong with it), but that's why it won't display in the mesh viewer (or when you use X File - Xna Framework importer)


The Dummy appears messed up in the Meshview, and the dwarf is not visible at all.
I have now discussed things with the modellers and every time they try to export from 3DSMax 8 with Panda Exporter (the right version) the application crashes. Reinstall? Yeh sure, but this problem appears on three independent computers.
Also tried KiloWattexporter. None is succesful. The later works, but does not export the bones or something. So the compiler passes an InvalidCastException:
"Unable to cast object of type 'Microsoft.Xna.Framework.Graphics.BasicEffect' to type 'Xclna.Xna.Animation.BasicPaletteEffect'."

Note, when using KiloWattexporter I cannot view it in the MeshView, but neither can I with Psionic's dwarf.

Appreciate the help.
Apr 5, 2007 at 8:48 AM
*Progressupdate*

We managed to export with Panda exporter. Now we see the bones and the skin in Meshview.
AND in the example application.

They are not merged together, the bones appear a bit under the skin.
However, I find that a later issue.

Now we are just trying to get the animations out of the file. To be continued...
Coordinator
Apr 5, 2007 at 9:06 AM
It's unfortunate that you are having trouble with the exporter. Have you tried using the fbx format? I notice that fbx work less often, but some people have had success.

If you have the model geometry exported correctly, thats 90% of the battle. There are tons of ways to get the animation data once that part is done.
Apr 5, 2007 at 9:13 AM
Edited Apr 5, 2007 at 9:18 AM
We now have the bones and the model skinned. It's moving finally!!!

However!
There are still bones visible in the application... Not too pleasant. Ever heard of that?

I cannot thank you enough for your help so far. I think I will post the settings we had in Panda Exporter later if anyone else encounters this weird problem....
Coordinator
Apr 5, 2007 at 9:22 AM
The bones shouldn't display at all. That is very odd and the first time I've heard of an exporter exporting bones as mesh geometry! The good news is that its probably an easyish fix. In the processor you would just remove the bone meshes; the problem is identifying them. If you want to send me the model I can take a look (if it's in ascii format, that is).
Apr 5, 2007 at 9:33 AM
Edited Apr 5, 2007 at 9:57 AM
You're making me worried when you say it's an odd first-time problem. Why do all bad things happen to us? sadface

Anyhooooow,
Here's the model
http://medieteknik.bth.se/rosk05/project/ddd2.X
And the texture if you want to see it:
http://medieteknik.bth.se/rosk05/project/tiger.bmp

Coordinator
Apr 5, 2007 at 10:10 AM
Yikes. It looks TOTALLY borked in the mesh viewer, quite borked if you use the XNA importer in the library, and slightly borked with the anim library importer. I made a processor that removes the skeleton.. but that doesn't stop the model from animating incorrectly.

The skeleton animates perfectly, and its obvious the exporter was meant to export the model where the skeleton is!

Rather than post the processor, I'm going to tell you the bad news that there is no non-extremely-aggravating fix other than getting your exporter to work properly.
Coordinator
Apr 5, 2007 at 10:13 AM
Oh, are you using biped?
Apr 5, 2007 at 10:24 AM
Yes we are.
Coordinator
Apr 5, 2007 at 10:32 AM
Edited Apr 5, 2007 at 10:33 AM
Hmm, I should put a message in the faq that the .X format is not friendly at all with biped. Heres a forum post from earlier:

"hello hinchy i can tell you that you can not use byped with this animation class, becasuse the 3dmax byped need a physique modifier and the animation class only support skinned, to use skin modifier you need to use bones, i have this error over two weeks and i have solved using bones, if you not are good working with bones a have a few tools that will make your life very easy contact me at enzo_ravo@yahoo.com. i hope that this help to you."

I'd like to make the amendment to this post that this isn't an issue with the animation class, it's an issue with the directx file format, which doesn't support physique modifiers.
Sorry for the bad news :(


However, with that being said, tiny.x has "Bip" all over the place, which means it was made with a biped type thing. So perhaps you just have to set some obscure export options or bake the animation.
Apr 5, 2007 at 10:56 AM
How 'bout "hide bones"?

We solved it!

*thrilled*
Coordinator
Apr 5, 2007 at 10:58 AM
This is from the panda .X exporter site:

Version 4.9.63.0 (23/11/2006) of the Exporter supports:-

* Mesh Vertices
* Mesh Faces
...

* Skinning using Character Studio Physique and Max Bones/Skinning (Not Biped)

Looks like you'll need to find another exporter or solution. Have you tried exporting to fbx?

Coordinator
Apr 5, 2007 at 10:59 AM
The visible bones weren't the only problem though - the skin weights were messed up, so when the mesh moved its arm, the geometry got all messed up. Did you fix that as well?
Apr 5, 2007 at 11:10 AM
We got to that problem just now. And with the options we have set for now we will have to do some serious extra work to get this to work. I will post how we managed to do all this here later. Maybe that can help some poor bastard in the future.
Apr 13, 2007 at 7:28 AM
The closest we've been to a solution is where we are right now. We exported the Biped model, imported it and found an option that said "Transform biped to bones" or something like that. We thought 'wth, let's try it!' and it worked quite brilliantly.
Aug 14, 2007 at 4:07 AM
Edited Aug 14, 2007 at 12:03 PM
How do you export your Biped model and find that option (Transform biped to bones)? I have the same problem as u did and i want to give ur solution a try.
Jan 22, 2009 at 10:18 PM
Hi guys, first of all, thanks a lot for deploying this great Library (i cannot understand how they broadcast a "tool" -xna- that is supposed to simplify DirectX complexity but has no functionallity like this, has no documentation, has some forums full of posh people (not all but many) that bully you when u ask questions, correcting you instead of answering. I think it's a shame). So thank you for giving us a hand.

Ok, here I go:
I try to load my model (a downloaded mazinger.x -rigged, from turbosquid - or just a biped that walks .x) & they both have BassicEffects when we come here:
(I CAN SHARE MY MODELS WITH U IF U WANT)


foreach

 

(ModelMesh mesh in newModel.Meshes)
{
    
foreach(ModelMeshPart part in mesh.MeshParts)
    {
        
BasicPaletteEffect oldEffect = (BasicPaletteEffect)part.Effect;
        
//BasicPaletteEffect oldEffect = part.Effect as BasicPaletteEffect;
        
Effect newEffect = myEffect.Clone(graphics.GraphicsDevice);
        newEffect.Parameters[
"BasicTexture"].SetValue(oldEffect.Texture);
        newEffect.Parameters[
"View"].SetValue(viewMatrix);
        newEffect.Parameters[
"Projection"].SetValue(projection);
        part.Effect = newEffect;
        oldEffect.Dispose();
    }
}

so it crashes (i tried with the "as BasicPaletteEffect"; it doesn't crash but it doesn't fill the oldEffect either (what does this "as" do? I've never casted in this way).

I'm using 3dMax 6 with Panda (last version). There's an option in panda that says "Bones" (i enable it) & whether i "include fx file" & fx options or not, it just crashes anyway. I've read about the biped non-compatibility but... come on, I came to this point & now i find this? Biped is a bones template, Aglet said he solved it but not how... I need the model to move please...! It's unbelievable the lack of info about this themes & it gets hard at this point!
I hope u can help me!

Thank u very much every1!