Blender V2.61 - r43446
|
#include <AnimationExporter.h>
Public Member Functions | |
AnimationExporter (COLLADASW::StreamWriter *sw) | |
void | exportAnimations (Scene *sce) |
void | operator() (Object *ob) |
Protected Member Functions | |
void | dae_animation (Object *ob, FCurve *fcu, char *transformName, bool is_param, Material *ma=NULL) |
void | write_bone_animation_matrix (Object *ob_arm, Bone *bone) |
void | write_bone_animation (Object *ob_arm, Bone *bone) |
void | sample_and_write_bone_animation (Object *ob_arm, Bone *bone, int transform_type) |
bool | is_bone_deform_group (Bone *bone) |
void | sample_and_write_bone_animation_matrix (Object *ob_arm, Bone *bone) |
void | sample_animation (float *v, std::vector< float > &frames, int type, Bone *bone, Object *ob_arm, bPoseChannel *pChan) |
void | sample_animation (std::vector< float[4][4]> &mats, std::vector< float > &frames, Bone *bone, Object *ob_arm, bPoseChannel *pChan) |
void | dae_bone_animation (std::vector< float > &fra, float *v, int tm_type, int axis, std::string ob_name, std::string bone_name) |
void | dae_baked_animation (std::vector< float > &fra, Object *ob_arm, Bone *bone) |
float | convert_time (float frame) |
float | convert_angle (float angle) |
std::string | get_semantic_suffix (COLLADASW::InputSemantic::Semantics semantic) |
void | add_source_parameters (COLLADASW::SourceBase::ParameterNameList ¶m, COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis, bool transform) |
void | get_source_values (BezTriple *bezt, COLLADASW::InputSemantic::Semantics semantic, bool rotation, float *values, int *length) |
float * | get_eul_source_for_quat (Object *ob) |
std::string | create_source_from_fcurve (COLLADASW::InputSemantic::Semantics semantic, FCurve *fcu, const std::string &anim_id, const char *axis_name) |
std::string | create_source_from_array (COLLADASW::InputSemantic::Semantics semantic, float *v, int tot, bool is_rot, const std::string &anim_id, const char *axis_name) |
std::string | create_source_from_vector (COLLADASW::InputSemantic::Semantics semantic, std::vector< float > &fra, bool is_rot, const std::string &anim_id, const char *axis_name) |
std::string | create_xyz_source (float *v, int tot, const std::string &anim_id) |
std::string | create_4x4_source (std::vector< float > &frames, Object *ob_arm, Bone *bone, const std::string &anim_id) |
std::string | create_interpolation_source (FCurve *fcu, const std::string &anim_id, const char *axis_name, bool *has_tangents) |
std::string | fake_interpolation_source (int tot, const std::string &anim_id, const char *axis_name) |
std::string | get_transform_sid (char *rna_path, int tm_type, const char *axis_name, bool append_axis) |
std::string | get_light_param_sid (char *rna_path, int tm_type, const char *axis_name, bool append_axis) |
std::string | get_camera_param_sid (char *rna_path, int tm_type, const char *axis_name, bool append_axis) |
void | find_frames (Object *ob, std::vector< float > &fra, const char *prefix, const char *tm_name) |
void | find_frames (Object *ob, std::vector< float > &fra) |
void | find_rotation_frames (Object *ob, std::vector< float > &fra, const char *prefix, int rotmode) |
void | enable_fcurves (bAction *act, char *bone_name) |
bool | hasAnimations (Scene *sce) |
char * | extract_transform_name (char *rna_path) |
std::string | getObjectBoneName (Object *ob, const FCurve *fcu) |
Definition at line 78 of file AnimationExporter.h.
AnimationExporter::AnimationExporter | ( | COLLADASW::StreamWriter * | sw | ) | [inline] |
Definition at line 86 of file AnimationExporter.h.
void AnimationExporter::add_source_parameters | ( | COLLADASW::SourceBase::ParameterNameList & | param, |
COLLADASW::InputSemantic::Semantics | semantic, | ||
bool | is_rot, | ||
const char * | axis, | ||
bool | transform | ||
) | [protected] |
Definition at line 532 of file AnimationExporter.cpp.
References OUTPUT.
Referenced by create_4x4_source(), create_source_from_array(), create_source_from_fcurve(), create_source_from_vector(), and create_xyz_source().
float AnimationExporter::convert_angle | ( | float | angle | ) | [protected] |
Definition at line 508 of file AnimationExporter.cpp.
float AnimationExporter::convert_time | ( | float | frame | ) | [protected] |
Definition at line 503 of file AnimationExporter.cpp.
References FRA2TIME.
Referenced by create_source_from_vector(), and get_source_values().
std::string AnimationExporter::create_4x4_source | ( | std::vector< float > & | frames, |
Object * | ob_arm, | ||
Bone * | bone, | ||
const std::string & | anim_id | ||
) | [protected] |
Definition at line 728 of file AnimationExporter.cpp.
References AnimData::action, add_source_parameters(), Object::adt, ADT_RECALC_ANIM, BKE_animsys_evaluate_animdata(), BKE_frame_to_ctime(), copy_m4_m4(), enable_fcurves(), get_pose_channel(), get_semantic_suffix(), Object::id, invert_m4_m4(), UnitConverter::mat4_to_dae(), mult_m4_m4m4(), Bone::name, NULL, OUTPUT, bPoseChannel::parent, Bone::parent, Object::pose, bPoseChannel::pose_mat, and where_is_pose_bone().
Referenced by dae_baked_animation().
std::string AnimationExporter::create_interpolation_source | ( | FCurve * | fcu, |
const std::string & | anim_id, | ||
const char * | axis_name, | ||
bool * | has_tangents | ||
) | [protected] |
Definition at line 819 of file AnimationExporter.cpp.
References FCurve::bezt, BEZT_IPO_BEZ, BEZT_IPO_CONST, get_semantic_suffix(), i, BezTriple::ipo, and FCurve::totvert.
Referenced by dae_animation().
std::string AnimationExporter::create_source_from_array | ( | COLLADASW::InputSemantic::Semantics | semantic, |
float * | v, | ||
int | tot, | ||
bool | is_rot, | ||
const std::string & | anim_id, | ||
const char * | axis_name | ||
) | [protected] |
Definition at line 668 of file AnimationExporter.cpp.
References add_source_parameters(), get_semantic_suffix(), i, RAD2DEGF, and simple_enum_gen::val.
Referenced by dae_animation(), and dae_bone_animation().
std::string AnimationExporter::create_source_from_fcurve | ( | COLLADASW::InputSemantic::Semantics | semantic, |
FCurve * | fcu, | ||
const std::string & | anim_id, | ||
const char * | axis_name | ||
) | [protected] |
Definition at line 621 of file AnimationExporter.cpp.
References add_source_parameters(), FCurve::bezt, get_semantic_suffix(), get_source_values(), i, length(), OUTPUT, FCurve::rna_path, and FCurve::totvert.
Referenced by dae_animation().
std::string AnimationExporter::create_source_from_vector | ( | COLLADASW::InputSemantic::Semantics | semantic, |
std::vector< float > & | fra, | ||
bool | is_rot, | ||
const std::string & | anim_id, | ||
const char * | axis_name | ||
) | [protected] |
Definition at line 698 of file AnimationExporter.cpp.
References add_source_parameters(), convert_time(), get_semantic_suffix(), and simple_enum_gen::val.
Referenced by dae_baked_animation(), and dae_bone_animation().
std::string AnimationExporter::create_xyz_source | ( | float * | v, |
int | tot, | ||
const std::string & | anim_id | ||
) | [protected] |
Definition at line 793 of file AnimationExporter.cpp.
References add_source_parameters(), get_semantic_suffix(), i, NULL, and OUTPUT.
Referenced by dae_bone_animation().
void AnimationExporter::dae_animation | ( | Object * | ob, |
FCurve * | fcu, | ||
char * | transformName, | ||
bool | is_param, | ||
Material * | ma = NULL |
||
) | [protected] |
Definition at line 194 of file AnimationExporter.cpp.
References FCurve::array_index, BLI_snprintf(), create_interpolation_source(), create_source_from_array(), create_source_from_fcurve(), credits_svn_gen::empty, get_camera_id(), get_camera_param_sid(), get_eul_source_for_quat(), get_light_id(), get_light_param_sid(), get_transform_sid(), getObjectBoneName(), i, id_name(), MEM_callocN(), MEM_freeN(), NULL, OB_ARMATURE, OB_CAMERA, OB_LAMP, OUTPUT, FCurve::rna_path, FCurve::totvert, translate_id(), and Object::type.
Referenced by operator()().
void AnimationExporter::dae_baked_animation | ( | std::vector< float > & | fra, |
Object * | ob_arm, | ||
Bone * | bone | ||
) | [protected] |
Definition at line 402 of file AnimationExporter.cpp.
References BLI_snprintf(), create_4x4_source(), create_source_from_vector(), credits_svn_gen::empty, fake_interpolation_source(), id_name(), Bone::name, OUTPUT, and translate_id().
Referenced by sample_and_write_bone_animation_matrix().
void AnimationExporter::dae_bone_animation | ( | std::vector< float > & | fra, |
float * | v, | ||
int | tm_type, | ||
int | axis, | ||
std::string | ob_name, | ||
std::string | bone_name | ||
) | [protected] |
Definition at line 447 of file AnimationExporter.cpp.
References BLI_snprintf(), create_source_from_array(), create_source_from_vector(), create_xyz_source(), credits_svn_gen::empty, fake_interpolation_source(), get_transform_sid(), NULL, OUTPUT, and translate_id().
Referenced by sample_and_write_bone_animation().
void AnimationExporter::enable_fcurves | ( | bAction * | act, |
char * | bone_name | ||
) | [protected] |
Definition at line 1081 of file AnimationExporter.cpp.
References BLI_snprintf(), bAction::curves, FCURVE_DISABLED, ListBase::first, FCurve::flag, FCurve::next, FCurve::rna_path, and strlen().
Referenced by create_4x4_source(), and sample_animation().
void AnimationExporter::exportAnimations | ( | Scene * | sce | ) |
Definition at line 41 of file AnimationExporter.cpp.
References forEachObjectInScene(), and hasAnimations().
Referenced by DocumentExporter::exportCurrentScene().
char * AnimationExporter::extract_transform_name | ( | char * | rna_path | ) | [protected] |
Definition at line 1053 of file AnimationExporter.cpp.
References dot().
Referenced by find_frames(), get_camera_param_sid(), get_eul_source_for_quat(), get_light_param_sid(), get_transform_sid(), and operator()().
std::string AnimationExporter::fake_interpolation_source | ( | int | tot, |
const std::string & | anim_id, | ||
const char * | axis_name | ||
) | [protected] |
Definition at line 853 of file AnimationExporter.cpp.
References get_semantic_suffix(), and i.
Referenced by dae_baked_animation(), and dae_bone_animation().
void AnimationExporter::find_frames | ( | Object * | ob, |
std::vector< float > & | fra, | ||
const char * | prefix, | ||
const char * | tm_name | ||
) | [protected] |
Definition at line 1149 of file AnimationExporter.cpp.
References AnimData::action, Object::adt, FCurve::bezt, bAction::curves, extract_transform_name(), find(), ListBase::first, i, anim_index::name, FCurve::next, FCurve::rna_path, sort(), strlen(), FCurve::totvert, and BezTriple::vec.
Referenced by find_rotation_frames(), sample_and_write_bone_animation(), and sample_and_write_bone_animation_matrix().
void AnimationExporter::find_frames | ( | Object * | ob, |
std::vector< float > & | fra | ||
) | [protected] |
Definition at line 1060 of file AnimationExporter.cpp.
References AnimData::action, Object::adt, FCurve::bezt, bAction::curves, find(), ListBase::first, i, FCurve::next, sort(), FCurve::totvert, and BezTriple::vec.
void AnimationExporter::find_rotation_frames | ( | Object * | ob, |
std::vector< float > & | fra, | ||
const char * | prefix, | ||
int | rotmode | ||
) | [protected] |
Definition at line 1139 of file AnimationExporter.cpp.
References find_frames(), and ROT_MODE_QUAT.
Referenced by sample_and_write_bone_animation().
std::string AnimationExporter::get_camera_param_sid | ( | char * | rna_path, |
int | tm_type, | ||
const char * | axis_name, | ||
bool | append_axis | ||
) | [protected] |
Definition at line 925 of file AnimationExporter.cpp.
References extract_transform_name(), and anim_index::name.
Referenced by dae_animation().
float * AnimationExporter::get_eul_source_for_quat | ( | Object * | ob | ) | [protected] |
Definition at line 143 of file AnimationExporter.cpp.
References AnimData::action, Object::adt, FCurve::array_index, FCurve::bezt, bAction::curves, extract_transform_name(), ListBase::first, i, MEM_callocN(), MEM_freeN(), FCurve::next, quat_to_eul(), FCurve::rna_path, FCurve::totvert, and BezTriple::vec.
Referenced by dae_animation().
std::string AnimationExporter::get_light_param_sid | ( | char * | rna_path, |
int | tm_type, | ||
const char * | axis_name, | ||
bool | append_axis | ||
) | [protected] |
Definition at line 877 of file AnimationExporter.cpp.
References extract_transform_name(), and anim_index::name.
Referenced by dae_animation().
std::string AnimationExporter::get_semantic_suffix | ( | COLLADASW::InputSemantic::Semantics | semantic | ) | [protected] |
Definition at line 513 of file AnimationExporter.cpp.
References OUTPUT.
Referenced by create_4x4_source(), create_interpolation_source(), create_source_from_array(), create_source_from_fcurve(), create_source_from_vector(), create_xyz_source(), and fake_interpolation_source().
void AnimationExporter::get_source_values | ( | BezTriple * | bezt, |
COLLADASW::InputSemantic::Semantics | semantic, | ||
bool | rotation, | ||
float * | values, | ||
int * | length | ||
) | [protected] |
Definition at line 568 of file AnimationExporter.cpp.
References BEZT_IPO_BEZ, convert_time(), BezTriple::ipo, OUTPUT, RAD2DEGF, and BezTriple::vec.
Referenced by create_source_from_fcurve().
std::string AnimationExporter::get_transform_sid | ( | char * | rna_path, |
int | tm_type, | ||
const char * | axis_name, | ||
bool | append_axis | ||
) | [protected] |
Definition at line 976 of file AnimationExporter.cpp.
References extract_transform_name(), and anim_index::name.
Referenced by dae_animation(), and dae_bone_animation().
Definition at line 179 of file AnimationExporter.cpp.
References id_name(), NULL, and FCurve::rna_path.
Referenced by dae_animation(), and sample_and_write_bone_animation_matrix().
bool AnimationExporter::hasAnimations | ( | Scene * | sce | ) | [protected] |
Definition at line 1102 of file AnimationExporter.cpp.
References AnimData::action, Material::adt, Object::adt, Scene::base, bAction::curves, data, ListBase::first, give_current_material(), Base::next, OB_CAMERA, OB_LAMP, Base::object, Object::totcol, and Object::type.
Referenced by exportAnimations().
bool AnimationExporter::is_bone_deform_group | ( | Bone * | bone | ) | [protected] |
Definition at line 347 of file AnimationExporter.cpp.
References BONE_NO_DEFORM, Bone::childbase, ListBase::first, and Bone::flag.
void AnimationExporter::operator() | ( | Object * | ob | ) |
Definition at line 55 of file AnimationExporter.cpp.
References AnimData::action, Material::adt, Object::adt, bArmature::bonebase, bAction::curves, dae_animation(), data, Object::data, extract_transform_name(), ListBase::first, give_current_material(), if(), FCurve::next, OB_ARMATURE, OB_CAMERA, OB_LAMP, FCurve::rna_path, ROT_MODE_EUL, Object::rotmode, Object::totcol, Object::type, and write_bone_animation_matrix().
void AnimationExporter::sample_and_write_bone_animation | ( | Object * | ob_arm, |
Bone * | bone, | ||
int | transform_type | ||
) | [protected] |
Definition at line 1187 of file AnimationExporter.cpp.
References ARM_RESTPOS, BLI_snprintf(), dae_bone_animation(), Object::data, find_frames(), find_rotation_frames(), bArmature::flag, get_pose_channel(), i, id_name(), MEM_callocN(), MEM_freeN(), Bone::name, Object::pose, bPoseChannel::rotmode, sample_animation(), and where_is_pose().
Referenced by write_bone_animation().
void AnimationExporter::sample_and_write_bone_animation_matrix | ( | Object * | ob_arm, |
Bone * | bone | ||
) | [protected] |
Definition at line 365 of file AnimationExporter.cpp.
References AnimData::action, Object::adt, ARM_RESTPOS, BLI_strcasecmp(), bAction::curves, dae_baked_animation(), Object::data, find_frames(), ListBase::first, bArmature::flag, get_pose_channel(), getObjectBoneName(), Bone::name, Object::pose, simple_enum_gen::val, and where_is_pose().
Referenced by write_bone_animation_matrix().
void AnimationExporter::sample_animation | ( | float * | v, |
std::vector< float > & | frames, | ||
int | type, | ||
Bone * | bone, | ||
Object * | ob_arm, | ||
bPoseChannel * | pChan | ||
) | [protected] |
Definition at line 1250 of file AnimationExporter.cpp.
References AnimData::action, Object::adt, ADT_RECALC_ANIM, BKE_animsys_evaluate_animdata(), BKE_frame_to_ctime(), copy_m4_m4(), copy_v3_v3(), enable_fcurves(), get_pose_channel(), Object::id, invert_m4_m4(), mat4_to_eul(), mat4_to_size(), mult_m4_m4m4(), Bone::name, NULL, bPoseChannel::parent, Bone::parent, Object::pose, bPoseChannel::pose_mat, and where_is_pose_bone().
Referenced by sample_and_write_bone_animation().
void AnimationExporter::sample_animation | ( | std::vector< float[4][4]> & | mats, |
std::vector< float > & | frames, | ||
Bone * | bone, | ||
Object * | ob_arm, | ||
bPoseChannel * | pChan | ||
) | [protected] |
Definition at line 1171 of file AnimationExporter.cpp.
References Object::adt, Bone::childbase, ListBase::first, i, and sample_and_write_bone_animation().
Definition at line 332 of file AnimationExporter.cpp.
References Object::adt, Bone::childbase, ListBase::first, and sample_and_write_bone_animation_matrix().
Referenced by operator()().