Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/collada/AnimationExporter.cpp21
-rw-r--r--source/blender/collada/AnimationExporter.h1
-rw-r--r--source/blender/collada/AnimationImporter.cpp7
-rw-r--r--source/blender/collada/AnimationImporter.h3
4 files changed, 30 insertions, 2 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index 53f3cc9aae3..b1b26fa2915 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -367,7 +367,7 @@ void AnimationExporter::exportAnimations(Scene *sce)
if (!pchan)
return;
- find_all_frames(ob_arm, fra);
+ find_frames(ob_arm, fra);
if (flag & ARM_RESTPOS) {
arm->flag &= ~ARM_RESTPOS;
@@ -1119,6 +1119,25 @@ void AnimationExporter::exportAnimations(Scene *sce)
return;
}
+
+ void AnimationExporter::find_frames(Object *ob, std::vector<float> &fra)
+ {
+ FCurve *fcu= (FCurve*)ob->adt->action->curves.first;
+
+ for (; fcu; fcu = fcu->next) {
+
+ for (unsigned int i = 0; i < fcu->totvert; i++) {
+ float f = fcu->bezt[i].vec[1][0]; //
+ if (std::find(fra.begin(), fra.end(), f) == fra.end())
+ fra.push_back(f);
+ }
+ }
+
+ // keep the keys in ascending order
+ std::sort(fra.begin(), fra.end());
+ }
+
+
void AnimationExporter::find_frames(Object *ob, std::vector<float> &fra, const char *prefix, const char *tm_name)
{
FCurve *fcu= (FCurve*)ob->adt->action->curves.first;
diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h
index cadd6940e9d..d4559782ff4 100644
--- a/source/blender/collada/AnimationExporter.h
+++ b/source/blender/collada/AnimationExporter.h
@@ -144,6 +144,7 @@ protected:
std::string get_transform_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_all_frames(Object *ob, std::vector<float> &fra);
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 8ae2d6970cd..0fc01e51020 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -929,6 +929,12 @@ void AnimationImporter::translate_Animations_NEW ( COLLADAFW::Node * node ,
Assign_float_animations( listid, AnimCurves , "specular_hardness" );
}
+ if((animType->material & MATERIAL_IOR) != 0){
+ const COLLADAFW::FloatOrParam *ior = &(efc->getIndexOfRefraction());
+ const COLLADAFW::UniqueId& listid = ior->getAnimationList();
+ Assign_float_animations( listid, AnimCurves , "raytrace_transparency.ior" );
+ }
+
if((animType->material & MATERIAL_SPEC_COLOR) != 0){
const COLLADAFW::ColorOrTexture *cot = &(efc->getSpecular());
const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
@@ -1010,6 +1016,7 @@ AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLAD
types->material = setAnimType(&(efc->getSpecular().getColor()),(types->material), MATERIAL_SPEC_COLOR);
types->material = setAnimType(&(efc->getDiffuse().getColor()),(types->material), MATERIAL_DIFF_COLOR);
// types->material = setAnimType(&(efc->get()),(types->material), MATERIAL_TRANSPARENCY);
+ types->material = setAnimType(&(efc->getIndexOfRefraction()),(types->material), MATERIAL_IOR);
}
}
return types;
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index 02b7b05afec..ea7de961382 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -111,7 +111,8 @@ private:
MATERIAL_SHININESS = 2,
MATERIAL_SPEC_COLOR = 4,
MATERIAL_DIFF_COLOR = 1 << 3,
- MATERIAL_TRANSPARENCY = 1 << 4
+ MATERIAL_TRANSPARENCY = 1 << 4,
+ MATERIAL_IOR = 1 << 5
};
enum AnimationType