EEmmanuel7 / ozz-animation

Automatically exported from code.google.com/p/ozz-animation
zlib License
0 stars 0 forks source link

Cannot save runtime skeleton. #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

I was using the ozz::io::OArchive to try saving a runtime skeleton. Works fine 
for raw skeletons and runtime animations.

Here is the error message:
/usr/local/include/ozz/base/io/archive.h: In instantiation of ‘void 
ozz::io::OArchive::SaveVersion() [with _Ty = ozz::animation::Skeleton*]’:
/usr/local/include/ozz/base/io/archive.h:123:22:   required from ‘void 
ozz::io::OArchive::operator<<(const _Ty&) [with _Ty = 
ozz::animation::Skeleton*]’
/home/noob/assimp_loader/mesh_import.hpp:407:20:   required from here
/usr/local/include/ozz/base/io/archive.h:159:55: error: incomplete type 
‘ozz::io::internal::Version<ozz::animation::Skeleton* const>’ used in 
nested name specifier
     if (void(0), internal::Version<const _Ty>::kValue != 0) {
                                                       ^
/usr/local/include/ozz/base/io/archive.h:160:56: error: incomplete type 
‘ozz::io::internal::Version<ozz::animation::Skeleton* const>’ used in 
nested name specifier
       uint32_t version = internal::Version<const _Ty>::kValue;
                                                        ^
/usr/local/include/ozz/base/io/archive.h: In instantiation of ‘void 
ozz::io::Save(ozz::io::OArchive&, const _Ty*, size_t) [with _Ty = 
ozz::animation::Skeleton*; size_t = long unsigned int]’:
/usr/local/include/ozz/base/io/archive.h:124:24:   required from ‘void 
ozz::io::OArchive::operator<<(const _Ty&) [with _Ty = 
ozz::animation::Skeleton*]’
/home/noob/assimp_loader/mesh_import.hpp:407:20:   required from here
/usr/local/include/ozz/base/io/archive.h:278:5: error: request for member 
‘Save’ in ‘*(_ty + ((sizetype)(i * 8ul)))’, which is of pointer type 
‘ozz::animation::Skeleton* const’ (maybe you meant to use ‘->’ ?)
     _ty[i].Save(_archive);
     ^

What version of the product are you using? On what operating system?
Latest version (0.72) on Gentoo.

Please provide any additional information below.

Here is the project itself: www.github.com/ColinGilbert/ozz-assimp-loader

Original issue reported on code.google.com by colingil...@gmail.com on 29 Jul 2015 at 2:13

GoogleCodeExporter commented 8 years ago
I forgot to mention. Its a compiler error. :P

Original comment by colingil...@gmail.com on 29 Jul 2015 at 2:14

GoogleCodeExporter commented 8 years ago
Thanks for posting this issue.

According to this error string "with _Ty = ozz::animation::Skeleton*" it looks 
like you're saving a pointer to an ozz::animation:: Skeleton, instead of saving 
the object itself. Ozz can serialize objects and arrays of objects, but not 
pointers.

It seems to be a frequent mistake with ozz archives, maybe I should find a way 
to prevent it or document it better. What do you think?

Original comment by guillaum...@gmail.com on 29 Jul 2015 at 8:10

GoogleCodeExporter commented 8 years ago
Thanks for the quick reply!

I also wanted to add that runtime animations give the same.

Regards,
Colin

Original comment by colingil...@gmail.com on 29 Jul 2015 at 6:48

GoogleCodeExporter commented 8 years ago
Have you tried to save the ozz::animation::Skeleton instance instead of it's 
pointer? It should fix the compiler error, same for the animation.

Original comment by guillaum...@gmail.com on 29 Jul 2015 at 7:48

GoogleCodeExporter commented 8 years ago
Yep! It all works now. Thanks!

Original comment by colingil...@gmail.com on 29 Jul 2015 at 10:08

GoogleCodeExporter commented 8 years ago

Original comment by guillaum...@gmail.com on 29 Jul 2015 at 10:55