Hi,
First of all, thanks for the awesome exporter. I can really appreciate the truck load of work gone into it after starting a 3DS Max fbx exporter.
I'm trying to use the Animation Library on the Xbox360 and am having quite a few issues.
If I follow the instructions in the readme file, I am unable to build my solution. (I've tried with base and base360).
I get the error error
: The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration='Release' Platform='Xbox 360'
From Google searching, this appears to be a rather crappy bug in visual studio.
If I compile the project separately and add the .dll as references to my 360 project, the Model is processed but when it comes to loading - testAnimModel = mContentManger.Load("Content\\Models\\animTest"); It crashes and I get a message message about not being able to find the ModelProcessor (something like that...) - I tried reproducing that error but now my solution won't deploy to the xbox.
Any ideas would be much appreciated.
Bino
ps: got my solution back in working order: The error from the xbox is:
An unhandled exception of type 'Microsoft.Xna.Framework.Content.ContentLoadException' occurred in Microsoft.Xna.Framework.dll
Additional information: Error loading "Content\Models\animTest". Cannot find ContentTypeReader KiloWatt.Base.Animation.AnimationSetReader, KiloWatt.Base.360.
This error was produced by compiling the libraries on their own and references their .dlls.
Having trouble getting the
Having trouble getting the model to display in the animation viewer (just green background on two vista machines), but looked through the code and the project seems very well put together, congrats.
a
a
I decided to convert the
I decided to convert the example project and try it on the 360. After selecting a model to load, an error is printed down the bottom (doesn't crash).
They are for the 3 examples:
Error loading "archer". Cannot find ContentTypeReader KiloWatt.Base.Animation.SkinnedBoneReader, KiloWatt.Base.360.
Error loading "threeboxes2". Cannot find ContentTypeReader KiloWatt.Base.Animation.AnimationSetReader, KiloWatt.Base.360.
Error loading "Tw Cen MT". File contains Microsoft.Xna.Framework.Graphics.SpriteFont but trying to load as Microsoft.Xna.Framework.Graphics.Model.
Bino
Phew finally
Finally got it working on the Xbox. You need to rename the Window's base assembly name to KiloWatt.Base.360. The pipeline needs to use this version and not the 360 base that gets created during conversion.
That drove me nuts :)
Bino
No I give up :)
Hey Jon,
I _really_ wanted to use this, but it's too much of a pain to use on the xbox at the moment and I'm not sure if you're around anymore? I love how you can specify a DXMaterial in Max (this is why i tried really hard to get it working)
I did get the example provided to work on the xbox but was unable to apply it to my project using the documentation to get a simple none blended animation working. I'm pretty certain I followed the instructions on what to do at load, update and draw.
I tried using your helper draw function and just doing manually on my own.
If I managed to get it working, I was going to create a simpler example to help others as the provided example is a bit confusing to work out core usage of the library.
I'm not sure why, but all of a sudden my project won't deploy as I get the error message "Error: Object reference not set to an instance of an object.". I tried to track down the issue causing that but was unsuccessful.
My problems are most likely due to user error and how I've integrated it into my application. I was unable to just compile the .dlls and reference them. I added Pipeline, a converted copy of Base to the 360, added the original Base with the assembly name change (pipeline won't compile without it, complains about being unable to convert Matrix, Vector etc types to Matrix, Vector types - I think it's mixing up xbox and x86 runtimes).
Things were getting a bit too messy and frustrating.
I really appreciate the effort gone into this (and the kwexporter!!) but I'm not sure if this is being supported (or continued) and I've spent way too much time trying to get it to work.
Bino
"Error: Object reference not set to an instance of an object."
I still had this error after removing all references to this animation library. Restarting Visual Studio seems to have fixed it. Love strange VS problems.
Bino
I _really_ wanted to use
Yes, I'm still here, albeit not every day :-)
I'm sorry to hear about your problem. It worked for me before I uploaded it. However, I'm currently away from my Xbox for a few weeks, so I can't look into the problem until I get back.
The good news is that I'm testing a new version of the kW X-porter, which ought to generate better files for animations. You can try it if you want: 080717 1.3.2 test version. Let me know if it works. This will not fix the build/deploy problems, of course...
What I would recommend is first getting it to build and run correctly for Windows. That assures that all the code is right. Note that I'm using Visual Studio 2005 SP1, not the express version; I don't know what the compatibility between Pro and Express is -- if unlucky, that might get in your way.
Once it builds on Windows, you should be able to build for Xbox too. It's a little tricky, though, as you'll need to build the "Base" and "Pipeline" libraries for Windows, and attach them as references to the Content project of the "AnimationViewer" project, to be able to select the Animation Processor for the meshes. Then you need to build Base and AnimationViewer for 360. Make sure the AnimationProcessor is set as the processor for the meshes you want to use. You should be able to safely ignore the Runtime library entirely.
The name of the output assemblies should end in ".360" for the 360, but be without on Windows. The runtime code, and the content processor, should generate those references. If you have to re-do the projects, and/or specify the output assembly names, you have to follow that convention.
Hope this helps, and let me know how it goes!
Great to hear from you :) I
Great to hear from you :)
I actually didn't give up, I tried another library but my instincts tell me this is way to go. Even though it's not quite working yet. (perhaps I'm too stubborn?)
The link you provided doesn't work. (at the time of writing).
I'm using VS2005 pro SP1.
I got the example working on Windows and I did eventually get it working on the Xbox aswell. I am however having issues integrating it into my project.
I'm keeping it simple with no blending animations and would like to do the draw code myself. It's not animating. I check the matrices, and it seems to be updating.
Is the following correct? I'm sure it's what you mean in the documentation. I've taken out what I think is unnecessary. Sorry if the formatting is bad!
LoadContent - same as the exmaple
Update(GameTime gameTime)
{
instances_[0].Advance((float)gameTime.ElapsedGameTime.TotalSeconds);
}
public void Draw(GameTime gameTime)
{
Model m = loadedModel_.Model;
Matrix[] transforms = new Matrix[m.Bones.Count];
instances_[0].CopyPoseTo(m);
m.CopyAbsoluteBoneTransformsTo(transforms);
foreach (ModelMesh mesh in m.Meshes)
{
foreach (Effect effect in mesh.Effects)
{
Matrix world = transforms[mesh.ParentBone.Index];
Matrix worldView = world * camera.ViewMatrix;
Matrix worldViewI = Matrix.Invert(worldView);
Matrix worldVP = worldView * camera.ProjectionMatrix;
//Matrix worldI = Matrix.Invert(world);
//Matrix worldIT = Matrix.Transpose(worldI);
//Matrix viewInverse = Matrix.Invert(camera.mView);
effect.Parameters["__object_to_ndc"].SetValue(worldVP);
effect.Parameters["__object_to_camera"].SetValue(worldView);
effect.Parameters["__camera_to_object"].SetValue(worldViewI);
}
mesh.Draw();
}
I feel like I'm _really_ close to getting this to work. I'm just not sure where I'm going wrong.
Thanks for the reply. As always, much appreciated.
Bino
Ahhh GPU skinning... Looks
Ahhh GPU skinning...
Looks like I have to use the skin shader\or modify mine to perform these calculations. When I use that and your drawing code, it works on the 360. (I didn't find that entirely clear).
Now I see why you have ForceSkinnedShader +-skinned. You have a non skinned version to display in max and then a skinned version for XNA. I can live with this.
Currently, I'm setting up my game so that the artist (which is me :P) can test a shader in mental mill, put that in max and then quickly put that in XNA without having to set parameters in code. It'd be nice if I could keep that workflow, but I'm happy to modify the generated shader to add the skinning code. (hopefully that doesn't turn out to be a pain!). I'll probably modify drawdetails? Haven't worked out the best plan of attack. Ideas?
Mental Mill produces quite large shader code but this is just for the xbox and should fall easily within SM3.0 instruction limits.
On a side note, I've gone through a lot of the code base to see how you engineered this and just wow... how long did this take? Everytime I think I'm getting mildly good, someone just blows me away.
Hmm 12am.. should I sleep? nah!
Bino
Me again :) ok i can get the
Me again :)
ok i can get the diffused skinned shader to work using code from the sample... to an extent. It's just a cube moving from side to side (my standard programmer art test). I can see through the front of the cube. Although the other sides are ok. Quite strange.
I think the easiest way to use my custom shaders is to write my own draw code. I'm just not sure how to go about creating the Pose paramater;
In modeldraw, you create an identity pose with something called an inverseBindPose and set it during DrawChunk. As far as I can tell, this pose data is stored in the private member List chl = new List();
Below is my current drawing code, what should I do to get the pose information? Sorry if this is an obvious question.
I'm trying to avoid touching your code base for obvious reasons.
Looking forward to some insight :)
Bino
foreach (ModelMesh mesh in m.Meshes)
{
foreach (Effect effect in mesh.Effects)
{
Matrix world = transforms[mesh.ParentBone.Index];
Matrix worldView = world * camera.ViewMatrix;
Matrix worldViewI = Matrix.Invert(worldView);
Matrix worldVP = worldView * camera.ProjectionMatrix;
//Matrix worldI = Matrix.Invert(world);
//Matrix worldIT = Matrix.Transpose(worldI);
Matrix viewInverse = Matrix.Invert(camera.ViewMatrix);
//effect.Parameters["__object_to_ndc"].SetValue(worldVP);
//effect.Parameters["__object_to_camera"].SetValue(worldView);
//effect.Parameters["__camera_to_object"].SetValue(worldViewI);
effect.Parameters["ViewProjection"].SetValue(camera.ViewMatrix * camera.ProjectionMatrix);
effect.Parameters["World"].SetValue(world);
effect.Parameters["ViewInverse"].SetValue(viewInverse);
effect.Parameters["Pose"].SetValue(??????);
}
mesh.Draw();
}
ps: The link you put up is still now working :)
The right link is now in
The right link is now in there: http://www.enchantedage.com/sites/default/files/kwxport-080719.msi
I really need to get the notification of new posts to work right on this site. The old "notify" script I use for kwxport.sourceforge.net is not supported for the new version of Drupal I use on this site, and the "subscriptions" service which is supposed to be "better" actually isn't. Bah!
Anyway, if you're still interested, the inverse bind pose is the inverse of the pose the skeleton had when the mesh was bound to it. If you want a new skeleton pose, your matrices should multiply the vertex first by the inverse bind pose, then by the new skeleton pose. This means that the vertex goes from bind pose, to "bone identity pose" and then forward to the new bone object-space transform.
However, in the animation code, it's all already taken care of, so I don't think you should have to worry about it, unless you go fairly deep into the code with your replacements.
In ModelDraw, inside GeneratePose(), you can see this going on: when I get a new skeleton pose from the animation system, I multiply the inverse bind pose for each bone by the bone matrix for that bone, and that's what I pass to the skinning shader parameter for bones.
Regarding how long it took, that's a hard question to answer. I've had a bunch of code laying around for a long time, and I've worked on the kW X-port plug-in for literally years (although only the occasional night or week-end). Pulling all of KiloWatt Animation together as a cohesive whole, and writing the animation playback/blending part to match that cohesive API probably took about a week's worth of evenings for the initial release -- but, again, it's drawing on other code that's been laying around for a while.
Hope this helps.