Message 1 of 3
Morph Exporting Plugin - chanBank problems solved!!!

Not applicable
03-16-2009
04:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey all,
There's been a lot of trouble around on forums on the net about trying to export morpher modifier's data. I also have had this problem.
The general complaints tend to be:-
Crashing when trying to access morph channel data.
chanBank vector in the MorphR3 class is empty.
MorphR3 class data is corrupted.
etc..
I am not quite sure exactly why this problem occurs, but we know why it breaks code and how to get around it so that you can export morph data from your exporter plugin.
The culprit is the morphChannel class. Again, I don't know why this is happening, because i am compiling the morpher dle myself, and referring to the wm3.h from my exporter in order to use MorphR3 classes and morphChannel classes, so it's not like i have two copies of the code that differ. Anyway, essentially, from within morpher.dle, the apparent size of a morpherChannel is 140 bytes. But from within my exporter dle, the apparent size is 172 bytes. This makes it obvious as to why data is appearing corrupted, when looking at the data from my exporter, we are looking through mis-aligned memory glasses you might say!
As i said, i can't think why the dles would think of morphChannel differently as there's only one copy of the source for the class, which is creating the lib file, which is used as input to the linker in my exporter. But simply extending the morpher.dle source to have getter functions for any data you want to export, will be a good enough work around. Also declaring the chanBank variable at the end of the MorphR3 class will help to ensure that's the only variable that is currupt in the eyes of the exporter, assuming data order in the memory isnt changed by any optimisation.
I hope that this post helps out some people out there, it's been doing our nutt's in and morph targets are essential for us! And i havn't found any other forum threads which actually tell of a solution! I'll be sure to post this wherever this problem is documented.
If anyone has any insight, to help further understand the cause of this class size difference, it would be appreciated :o).
Thanks,
Leigh
There's been a lot of trouble around on forums on the net about trying to export morpher modifier's data. I also have had this problem.
The general complaints tend to be:-
Crashing when trying to access morph channel data.
chanBank vector in the MorphR3 class is empty.
MorphR3 class data is corrupted.
etc..
I am not quite sure exactly why this problem occurs, but we know why it breaks code and how to get around it so that you can export morph data from your exporter plugin.
The culprit is the morphChannel class. Again, I don't know why this is happening, because i am compiling the morpher dle myself, and referring to the wm3.h from my exporter in order to use MorphR3 classes and morphChannel classes, so it's not like i have two copies of the code that differ. Anyway, essentially, from within morpher.dle, the apparent size of a morpherChannel is 140 bytes. But from within my exporter dle, the apparent size is 172 bytes. This makes it obvious as to why data is appearing corrupted, when looking at the data from my exporter, we are looking through mis-aligned memory glasses you might say!
As i said, i can't think why the dles would think of morphChannel differently as there's only one copy of the source for the class, which is creating the lib file, which is used as input to the linker in my exporter. But simply extending the morpher.dle source to have getter functions for any data you want to export, will be a good enough work around. Also declaring the chanBank variable at the end of the MorphR3 class will help to ensure that's the only variable that is currupt in the eyes of the exporter, assuming data order in the memory isnt changed by any optimisation.
I hope that this post helps out some people out there, it's been doing our nutt's in and morph targets are essential for us! And i havn't found any other forum threads which actually tell of a solution! I'll be sure to post this wherever this problem is documented.
If anyone has any insight, to help further understand the cause of this class size difference, it would be appreciated :o).
Thanks,
Leigh