[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25311] branches/soc-2009-chingachgook/ source/blender/collada/DocumentExporter.cpp: COLLADA branch: patch from Jan Diederich for bump-map export via <extra> tag.

Arystanbek Dyussenov arystan.d at gmail.com
Fri Dec 11 14:54:56 CET 2009


Revision: 25311
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25311
Author:   kazanbas
Date:     2009-12-11 14:54:56 +0100 (Fri, 11 Dec 2009)

Log Message:
-----------
COLLADA branch: patch from Jan Diederich for bump-map export via <extra> tag.

Modified Paths:
--------------
    branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp

Modified: branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp
===================================================================
--- branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp	2009-12-11 13:06:18 UTC (rev 25310)
+++ branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp	2009-12-11 13:54:56 UTC (rev 25311)
@@ -1538,9 +1538,23 @@
 			if (t->mapto & MAP_REF) {
 				ep.setReflective(createTexture(ima, uvname, sampler));
 			}
+			// alpha
 			if (t->mapto & MAP_ALPHA) {
 				ep.setTransparent(createTexture(ima, uvname, sampler));
 			}
+			// extension:
+			// Normal map --> Must be stored with <extra> tag as different technique, 
+			// since COLLADA doesn't support normal maps, even in current COLLADA 1.5.
+			if (t->mapto & MAP_NORM) {
+				COLLADASW::Texture texture(key);
+				texture.setTexcoord(uvname);
+				texture.setSampler(*sampler);
+				// technique FCOLLADA, with the <bump> tag, is most likely the best understood,
+				// most widespread de-facto standard.
+				texture.setProfileName("FCOLLADA");
+				texture.setChildElementName("bump");				
+				ep.setExtraTechniqueColorOrTexture(COLLADASW::ColorOrTexture(texture));
+			}
 		}
 		// performs the actual writing
 		ep.addProfileElements();





More information about the Bf-blender-cvs mailing list