zengqh / slimdx

Automatically exported from code.google.com/p/slimdx
0 stars 0 forks source link

Fail to load mesh FromFile and GetEffects always is 0 with Meshes with two or more effects #384

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I believe that I have detected a bug at the moment of loading a file .X.
The test you can do with the file DwarfWithEffectInstance.x that comes in
DirectX's SDK. To seeing how I explain it.

The question is that I use the function Mesh.FromFile (...) and when I make
then the GetEffects function does not return anything. Nevertheless,
examining SlimDX's code that does not return anything for the fact that in
the loop that iters the EffectInstance GetAttributeTable's value (count
value) is used and this is 0. I believe that this is due to the fact that a
CloneMesh has not been used.

There is another way of it doing that I not? Or have you to check it? Thank
you very much and I think that it is an excellent project. Be still boys
like that.

Already I have managed to obtain effects by means of Mesh.GetEffects ()
changing a line into Mesh:: FromFile.

What I have done is to change in the line:

Result -> SetEffects (EffectInstance:: FromBuffer (instanceBuffer,
instanceCount));

I have changed the variable "instanceCount" for "materialCount", since
"instanceCount" always it is 0 inside this function.

This way already he returns InstanceEffect's[] array to me.

But I suppose that equal you will have to look how to do it. At the moment
this way it me goes, but I say it to you for to seeing if you it can solve
in future versions. Thank you very much again.

Sorry for my english.

Original issue reported on code.google.com by jerez.ra...@gmail.com on 19 Dec 2008 at 8:30

GoogleCodeExporter commented 9 years ago
Fixed.

Original comment by Mike.Popoloski on 21 Dec 2008 at 2:39