Changeset 556
- Timestamp:
- 04/01/08 15:20:03 (9 months ago)
- Files:
-
- branches/morph-targets/libx42make/include/x42make-modelbuilder.h (modified) (1 diff)
- branches/morph-targets/libx42make/modelbuilder-animation.cpp (modified) (2 diffs)
- branches/morph-targets/libx42make/modelbuilder-skeleton.cpp (modified) (1 diff)
- branches/morph-targets/libx42pp/include/x42math-quat.h (modified) (1 diff)
- branches/morph-targets/x42maya/modelexporter.cpp (added)
- branches/morph-targets/x42maya/translator.h (modified) (5 diffs)
- branches/morph-targets/x42maya/x42maya.vcproj (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/morph-targets/libx42make/include/x42make-modelbuilder.h
r554 r556 680 680 void end_skeleton_update(); 681 681 682 void apply_root_scale( const ::x42::math::vec3 &pos_ofs, const ::x42::math::quat &rot_ofs,682 void insert_root_transform( const ::x42::math::vec3 &pos_ofs, const ::x42::math::quat &rot_ofs, 683 683 const ::x42::math::vec3 &inner_scale_ofs, const ::x42::math::vec3 &outer_scale_ofs ); 684 685 void make_animation_scales_uniform(); 686 void clean_animation_tracks(); 684 687 685 688 void collapse_constant_bones(); branches/morph-targets/libx42make/modelbuilder-animation.cpp
r522 r556 517 517 v = vec3c( mid ); 518 518 } 519 520 local_matrices.clear(); 521 world_matrices.clear(); 519 522 } 520 523 … … 544 547 } 545 548 546 void model_builder::apply_root_scale( const vec3 &pos_ofs, const quat &rot_ofs, 549 void model_builder::clean_animation_tracks() 550 { 551 for( size_t i = 0; i < bones.size(); i++ ) 552 { 553 bones[i]->anim_tracks.clean_tracks(); 554 } 555 } 556 557 void model_builder::make_animation_scales_uniform() 558 { 559 for( size_t i = 0; i < bones.size(); i++ ) 560 { 561 bones[i]->anim_tracks.make_scale_uniform(); 562 } 563 } 564 565 void model_builder::insert_root_transform( const vec3 &pos_ofs, const quat &rot_ofs, 547 566 const vec3 &inner_scale_ofs, const vec3 &outer_scale_ofs ) 548 567 { branches/morph-targets/libx42make/modelbuilder-skeleton.cpp
r517 r556 374 374 continue; 375 375 376 const animation_tracks &anim = bi->anim_tracks; 376 animation_tracks &anim = bi->anim_tracks; 377 anim.clean_tracks(); 377 378 378 379 if( anim.position.size() != 1 || anim.rotation.size() != 1 || branches/morph-targets/libx42pp/include/x42math-quat.h
r462 r556 55 55 inline quat quatc( const vec3 &ijk, float w ) { quat ret = { ijk.x, ijk.y, ijk.z, w }; return ret; } 56 56 57 inline quat quati() { quat ret = { 0, 0, 0, 1 }; return ret; } 58 57 59 quat quat_from_aa( const vec3 &axis, angle a ); 58 60 void quat_to_aa( vec3 &axis, angle &a, const quat &q ); branches/morph-targets/x42maya/translator.h
r554 r556 31 31 { 32 32 33 class maya_error : public std::exception 34 { 35 private: 36 MStatus statcode; 37 38 public: 39 explicit maya_error( MStatus status_code ) 40 : statcode( status_code ) 41 { 42 } 43 44 virtual const char* what() const 45 { 46 return statcode.errorString().asChar(); 47 } 48 49 MStatus status_code( void ) const { return statcode; } 50 }; 51 52 void check_status( MStatus status ); 53 33 54 typedef make::simple_api_tag< MObject > obj_tag; 34 55 typedef make::simple_api_tag< MDagPath > dag_tag; … … 37 58 { 38 59 public: 39 export_selection( MPxFileTranslator::FileAccessMode mode ); 60 export_selection(); 61 explicit export_selection( MPxFileTranslator::FileAccessMode mode ); 40 62 41 63 size_t mesh_count() const { return meshes.length(); } … … 45 67 const MDagPath& tag( size_t index ) const { return tags[(uint)index]; } 46 68 69 void add_mesh( const MDagPath &path ) { meshes.append( path ); } 70 void add_tag( const MDagPath &path ) { tags.append( path ); } 71 72 void add_all_objects(); 73 void add_selected_objects(); 74 47 75 private: 48 76 MDagPathArray tags; 49 77 MDagPathArray meshes; 50 78 51 voidis_tag( const MDagPath &path ) const;52 voidis_visible( const MDagPath &path ) const;79 bool is_tag( const MDagPath &path ) const; 80 bool is_visible( const MDagPath &path ) const; 53 81 void check_object( const MDagPath &path ); 54 82 }; … … 57 85 { 58 86 public: 87 model_exporter(); 88 89 void add_mesh( const MDagPath &path ); 90 void add_tag( const MDagPath &path ); 59 91 void add_objects( const export_selection &sel ); 92 93 void import_animations( MTime begin, MTime end, MTime step ); 60 94 61 95 void compile(); … … 63 97 void write_file( std::ostream &out ); 64 98 99 static const int do_not_split = -1; 100 65 101 private: 66 102 make::model_builder model; 103 104 persist_flags pers_flags; 105 bool force_uniform_scale; 106 vec3 pos_ofs; 107 quat rot_ofs; 108 vec3 scale_ofs; 109 float unit_scale; 110 float group_split_factor; 111 make::geometry::optimize_type preferred_geometry_type; 67 112 }; 68 113 branches/morph-targets/x42maya/x42maya.vcproj
r554 r556 663 663 > 664 664 <File 665 RelativePath=".\modelexporter.cpp" 666 > 667 </File> 668 <File 665 669 RelativePath=".\translator.cpp" 666 670 >
