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:
Diffstat (limited to 'source/blender/collada/DocumentImporter.cpp')
-rw-r--r--source/blender/collada/DocumentImporter.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index f06f299d381..226f319cefd 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -904,6 +904,7 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
i++;
}
}
+
// EMISSION
// color
if (ef->getEmission().isColor()) {
@@ -919,8 +920,22 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
i++;
}
}
-
- if (ef->getOpacity().isTexture()) {
+
+ // TRANSPARENT
+ // color
+ if (ef->getOpacity().isColor()) {
+ col = ef->getTransparent().getColor();
+ float alpha = ef->getTransparency().getFloatValue();
+ if (col.isValid()) {
+ alpha *= col.getAlpha(); // Assuming A_ONE opaque mode
+ }
+ if (col.isValid() || alpha < 1.0) {
+ ma->alpha = alpha;
+ ma->mode |= MA_ZTRANSP | MA_TRANSP;
+ }
+ }
+ // texture
+ else if (ef->getOpacity().isTexture()) {
COLLADAFW::Texture ctex = ef->getOpacity().getTexture();
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
if (mtex != NULL) {
@@ -930,22 +945,7 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
ma->mode |= MA_ZTRANSP | MA_TRANSP;
}
}
- // TRANSPARENT
- // color
-#if 0
- if (ef->getOpacity().isColor()) {
- // XXX don't know what to do here
- }
- // texture
- else if (ef->getOpacity().isTexture()) {
- ctex = ef->getOpacity().getTexture();
- if (mtex != NULL) mtex->mapto &= MAP_ALPHA;
- else {
- mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
- if (mtex != NULL) mtex->mapto = MAP_ALPHA;
- }
- }
-#endif
+
material_texture_mapping_map[ma] = texindex_texarray_map;
}