Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First release of the new generation collada exporters

  • Loading branch information...
commit 70f4c043d124394220180374b34282701ee23814 1 parent 8f0dbdc
@opencollada-sebastian opencollada-sebastian authored
Showing with 28,247 additions and 0 deletions.
  1. +9 −0 COLLADAMax/AUTHORS
  2. +4 −0 COLLADAMax/BUGS
  3. +57 −0 COLLADAMax/COLLADAMax.sln
  4. +18 −0 COLLADAMax/COPYING
  5. +34 −0 COLLADAMax/INSTALL
  6. +9 −0 COLLADAMax/README
  7. +58 −0 COLLADAMax/TODO
  8. +372 −0 COLLADAMax/include/COLLADAMaxAnimationExporter.h
  9. +146 −0 COLLADAMax/include/COLLADAMaxColladaExporter.h
  10. +152 −0 COLLADAMax/include/COLLADAMaxDocumentExporter.h
  11. +227 −0 COLLADAMax/include/COLLADAMaxEffectExporter.h
  12. +197 −0 COLLADAMax/include/COLLADAMaxExportNode.h
  13. +85 −0 COLLADAMax/include/COLLADAMaxExportSceneGraph.h
  14. +82 −0 COLLADAMax/include/COLLADAMaxExtra.h
  15. +83 −0 COLLADAMax/include/COLLADAMaxGeometriesExporter.h
  16. +150 −0 COLLADAMax/include/COLLADAMaxGeometryExporter.h
  17. +223 −0 COLLADAMax/include/COLLADAMaxGeometryExtra.h
  18. +64 −0 COLLADAMax/include/COLLADAMaxImageExporter.h
  19. +90 −0 COLLADAMax/include/COLLADAMaxMaterialExporter.h
  20. +217 −0 COLLADAMax/include/COLLADAMaxMultiMtl.h
  21. +146 −0 COLLADAMax/include/COLLADAMaxOptions.h
  22. +51 −0 COLLADAMax/include/COLLADAMaxPrerequisites.h
  23. +59 −0 COLLADAMax/include/COLLADAMaxStableHeaders.h
  24. +49 −0 COLLADAMax/include/COLLADAMaxTypes.h
  25. +108 −0 COLLADAMax/include/COLLADAMaxVisualSceneExporter.h
  26. +736 −0 COLLADAMax/scripts/COLLADAMax.vcproj
  27. +643 −0 COLLADAMax/src/COLLADAMaxAnimationExporter.cpp
  28. +164 −0 COLLADAMax/src/COLLADAMaxColladaExporter.cpp
  29. +91 −0 COLLADAMax/src/COLLADAMaxDllEntry.cpp
  30. +236 −0 COLLADAMax/src/COLLADAMaxDocumentExporter.cpp
  31. +963 −0 COLLADAMax/src/COLLADAMaxEffectExporter.cpp
  32. +156 −0 COLLADAMax/src/COLLADAMaxExportNode.cpp
  33. +99 −0 COLLADAMax/src/COLLADAMaxExportSceneGraph.cpp
  34. +55 −0 COLLADAMax/src/COLLADAMaxExtra.cpp
  35. +80 −0 COLLADAMax/src/COLLADAMaxGeometriesExporter.cpp
  36. +896 −0 COLLADAMax/src/COLLADAMaxGeometryExporter.cpp
  37. +580 −0 COLLADAMax/src/COLLADAMaxGeometryExtra.cpp
  38. +55 −0 COLLADAMax/src/COLLADAMaxImageExporter.cpp
  39. +130 −0 COLLADAMax/src/COLLADAMaxMaterialExporter.cpp
  40. +51 −0 COLLADAMax/src/COLLADAMaxOptions.cpp
  41. +22 −0 COLLADAMax/src/COLLADAMaxPrecompiledHeaders.cpp
  42. +312 −0 COLLADAMax/src/COLLADAMaxVisualSceneExporter.cpp
  43. +84 −0 COLLADAMax/tools/apidoc.sty
  44. +237 −0 COLLADAMax/tools/doxygen_html.cfg
  45. +7 −0 COLLADAMax/tools/footer.html
  46. +7 −0 COLLADAMax/tools/header.html
  47. +31 −0 COLLADAMax/tools/introduction.txt
  48. +7 −0 COLLADAMax/tools/make_html.bat
  49. +221 −0 COLLADAMax/tools/style.css
  50. +9 −0 COLLADAMaya/AUTHORS
  51. +6 −0 COLLADAMaya/BUGS
  52. +26 −0 COLLADAMaya/COLLADAMaya.sln
  53. +18 −0 COLLADAMaya/COPYING
  54. +1 −0  COLLADAMaya/INSTALL
  55. +8 −0 COLLADAMaya/README
  56. +58 −0 COLLADAMaya/TODO
  57. +54 −0 COLLADAMaya/include/COLLADAMayaAnimationClipExporter.h
  58. +534 −0 COLLADAMaya/include/COLLADAMayaAnimationCurves.h
  59. +209 −0 COLLADAMaya/include/COLLADAMayaAnimationElement.h
  60. +596 −0 COLLADAMaya/include/COLLADAMayaAnimationExporter.h
  61. +127 −0 COLLADAMaya/include/COLLADAMayaAnimationHelper.h
  62. +204 −0 COLLADAMaya/include/COLLADAMayaAnimationKeys.h
  63. +162 −0 COLLADAMaya/include/COLLADAMayaAnimationSampleCache.h
  64. +125 −0 COLLADAMaya/include/COLLADAMayaAnimationTools.h
  65. +117 −0 COLLADAMaya/include/COLLADAMayaControllerLibrary.h
  66. +104 −0 COLLADAMaya/include/COLLADAMayaConversion.h
  67. +48 −0 COLLADAMaya/include/COLLADAMayaConvert.h
  68. +158 −0 COLLADAMaya/include/COLLADAMayaDagHelper.h
  69. +294 −0 COLLADAMaya/include/COLLADAMayaDocumentExporter.h
  70. +80 −0 COLLADAMaya/include/COLLADAMayaDocumentNode.h
  71. +236 −0 COLLADAMaya/include/COLLADAMayaEffectExporter.h
  72. +160 −0 COLLADAMaya/include/COLLADAMayaEffectTextureExporter.h
  73. +292 −0 COLLADAMaya/include/COLLADAMayaExportOptions.h
  74. +169 −0 COLLADAMaya/include/COLLADAMayaFileTranslator.h
  75. +198 −0 COLLADAMaya/include/COLLADAMayaGeometryExporter.h
  76. +285 −0 COLLADAMaya/include/COLLADAMayaGeometryPolygonExporter.h
  77. +54 −0 COLLADAMaya/include/COLLADAMayaImageExporter.h
  78. +115 −0 COLLADAMaya/include/COLLADAMayaMaterialExporter.h
  79. +65 −0 COLLADAMaya/include/COLLADAMayaMeshHelper.h
  80. +227 −0 COLLADAMaya/include/COLLADAMayaPlatform.h
  81. +52 −0 COLLADAMaya/include/COLLADAMayaPrerequisites.h
  82. +204 −0 COLLADAMaya/include/COLLADAMayaSceneElement.h
  83. +178 −0 COLLADAMaya/include/COLLADAMayaSceneGraph.h
  84. +74 −0 COLLADAMaya/include/COLLADAMayaSetHelper.h
  85. +121 −0 COLLADAMaya/include/COLLADAMayaShaderHelper.h
  86. +95 −0 COLLADAMaya/include/COLLADAMayaStableHeaders.h
  87. +222 −0 COLLADAMaya/include/COLLADAMayaSyntax.h
  88. +194 −0 COLLADAMaya/include/COLLADAMayaTangentPoint.h
  89. +160 −0 COLLADAMaya/include/COLLADAMayaVisualSceneExporter.h
  90. +485 −0 COLLADAMaya/scripts/COLLADAMaya.vcproj
  91. +494 −0 COLLADAMaya/scripts/colladaTranslatorOpts.mel
  92. +47 −0 COLLADAMaya/src/COLLADAMayaAnimationClipExporter.cpp
  93. +605 −0 COLLADAMaya/src/COLLADAMayaAnimationCurves.cpp
  94. +113 −0 COLLADAMaya/src/COLLADAMayaAnimationElement.cpp
  95. +1,879 −0 COLLADAMaya/src/COLLADAMayaAnimationExporter.cpp
  96. +610 −0 COLLADAMaya/src/COLLADAMayaAnimationHelper.cpp
  97. +77 −0 COLLADAMaya/src/COLLADAMayaAnimationKeys.cpp
  98. +434 −0 COLLADAMaya/src/COLLADAMayaAnimationSampleCache.cpp
  99. +48 −0 COLLADAMaya/src/COLLADAMayaAnimationTools.cpp
  100. +38 −0 COLLADAMaya/src/COLLADAMayaControllerLibrary.cpp
  101. +62 −0 COLLADAMaya/src/COLLADAMayaConvert.cpp
  102. +1,419 −0 COLLADAMaya/src/COLLADAMayaDagHelper.cpp
  103. +393 −0 COLLADAMaya/src/COLLADAMayaDocumentExporter.cpp
  104. +101 −0 COLLADAMaya/src/COLLADAMayaDocumentNode.cpp
  105. +890 −0 COLLADAMaya/src/COLLADAMayaEffectExporter.cpp
  106. +385 −0 COLLADAMaya/src/COLLADAMayaEffectTextureExporter.cpp
  107. +285 −0 COLLADAMaya/src/COLLADAMayaExportOptions.cpp
  108. +516 −0 COLLADAMaya/src/COLLADAMayaFileTranslator.cpp
  109. +1,390 −0 COLLADAMaya/src/COLLADAMayaGeometryExporter.cpp
  110. +898 −0 COLLADAMaya/src/COLLADAMayaGeometryPolygonExporter.cpp
  111. +55 −0 COLLADAMaya/src/COLLADAMayaImageExporter.cpp
  112. +246 −0 COLLADAMaya/src/COLLADAMayaMaterialExporter.cpp
  113. +172 −0 COLLADAMaya/src/COLLADAMayaMeshHelper.cpp
  114. +22 −0 COLLADAMaya/src/COLLADAMayaPrecompiledHeaders.cpp
  115. +250 −0 COLLADAMaya/src/COLLADAMayaSceneElement.cpp
  116. +703 −0 COLLADAMaya/src/COLLADAMayaSceneGraph.cpp
  117. +139 −0 COLLADAMaya/src/COLLADAMayaSetHelper.cpp
  118. +899 −0 COLLADAMaya/src/COLLADAMayaShaderHelper.cpp
Sorry, we could not display the entire diff because it was too big.
View
9 COLLADAMax/AUTHORS
@@ -0,0 +1,9 @@
+AUTHORS
+=======
+
+NetAllied Systems GmbH
+---------
+Judith Schenk
+Robert Würfel
+
+If we've forgotten you in the above list, please contact us!
View
4 COLLADAMax/BUGS
@@ -0,0 +1,4 @@
+Please go to http://sourceforge.net/projects/COLLADAMaya for a full
+list of known bugs.
+
+Have a look on the TODO file!
View
57 COLLADAMax/COLLADAMax.sln
@@ -0,0 +1,57 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "COLLADAMax", "scripts\COLLADAMax.vcproj", "{8840B0EA-A0B3-45D6-855D-8382B247CE8B}"
+ ProjectSection(WebsiteProperties) = preProject
+ Debug.AspNetCompiler.Debug = "True"
+ Release.AspNetCompiler.Debug = "False"
+ EndProjectSection
+ ProjectSection(ProjectDependencies) = postProject
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B} = {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "COLLADAStreamWriter", "..\COLLADAStreamWriter\scripts\COLLADAStreamWriter.vcproj", "{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}"
+ ProjectSection(WebsiteProperties) = preProject
+ Debug.AspNetCompiler.Debug = "True"
+ Release.AspNetCompiler.Debug = "False"
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug Max2008|Win32 = Debug Max2008|Win32
+ Debug Max2009|Win32 = Debug Max2009|Win32
+ Debug Max9|Win32 = Debug Max9|Win32
+ Release Max2008|Win32 = Release Max2008|Win32
+ Release Max2009|Win32 = Release Max2009|Win32
+ Release Max9|Win32 = Release Max9|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Debug Max2008|Win32.ActiveCfg = Debug Max2008|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Debug Max2008|Win32.Build.0 = Debug Max2008|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Debug Max2009|Win32.ActiveCfg = Debug Max2009|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Debug Max2009|Win32.Build.0 = Debug Max2009|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Debug Max9|Win32.ActiveCfg = Debug Max9|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Debug Max9|Win32.Build.0 = Debug Max9|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release Max2008|Win32.ActiveCfg = Release Max2008|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release Max2008|Win32.Build.0 = Release Max2008|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release Max2009|Win32.ActiveCfg = Release Max2009|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release Max2009|Win32.Build.0 = Release Max2009|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release Max9|Win32.ActiveCfg = Release Max9|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release Max9|Win32.Build.0 = Release Max9|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2008|Win32.ActiveCfg = Debug|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2008|Win32.Build.0 = Debug|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2009|Win32.ActiveCfg = Debug|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2009|Win32.Build.0 = Debug|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max9|Win32.ActiveCfg = Debug|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max9|Win32.Build.0 = Debug|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2008|Win32.ActiveCfg = Release|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2008|Win32.Build.0 = Release|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2009|Win32.ActiveCfg = Release|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2009|Win32.Build.0 = Release|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max9|Win32.ActiveCfg = Release|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max9|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
18 COLLADAMax/COPYING
@@ -0,0 +1,18 @@
+Copyright (c) 2008 Intel Corporation
+Copyright (c) 2005-2008 Sony Computer Entertainment America
+Copyright (c) 2008 NetAllied Systems GmbH
+
+This file is part of COLLADAMaya.
+
+COLLADAMaya is free software; you can redistribute it and/or modify
+it under the terms of the MIT License as published by the
+Massachusetts Institute of Technology.
+
+COLLADAMaya is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+MIT License for more details.
+
+You should have received a copy of the MIT License along with
+COLLADAMaya; see the file COPYING. If not have a look here:
+http://www.opensource.org/licenses/mit-license.php
View
34 COLLADAMax/INSTALL
@@ -0,0 +1,34 @@
+Requirements:
+-------------
+To build the COLLADAMax plug-in you need to have a version of 3ds Max, including the SDK, installed.
+Supported versions are:
+3ds Max 9
+3ds Max 2008
+3ds Max 2009
+
+You also need MS Visual Studio 2005.
+
+
+
+Building:
+---------
+Before you can start to build you need to set an environment variable to the installation
+path of the 3ds Max installation you want to use, i.e. the path that contains the "maxsdk"
+and "plugins" directories. The name of the environment variable depends on the version of
+3ds Max as listed below:
+
+3ds Max Version | name of the environment variable
+-----------------------------------------------------
+3ds Max 9 | MAX_PATH9
+3ds Max 2008 | MAX_PATH2008
+3ds Max 2009 | MAX_PATH2009
+
+
+To build the plug-in open "COLLADAMax.sln" with MS Visual Studio 2005, choose the configuration
+you want to build und build the project.
+
+If the build process succeeded the plug-in file (ColladaMaxNew.dle) is automatically copied into
+your "plugins" directory of your 3ds Max installation.
+
+After the next start of 3ds Max the plugin is available and can be found as "NEWCOLLADA" in the
+export dialog.
View
9 COLLADAMax/README
@@ -0,0 +1,9 @@
+
+COLLADAMax is a new implementation of a 3ds Max plug-in to export a Max scene or
+parts of it to a COLLADA file, released under an MIT-license.
+In contrast to other existing 3ds Max to COLLADA exporters, this new plug-in does not store the
+COLLADA document in an intermidiate data model by writes it directly to file. This leads to a dramatic
+reduction of memory consumption and to much a better performance.
+
+
+For installation instructions please read the "INSTALL" file.
View
58 COLLADAMax/TODO
@@ -0,0 +1,58 @@
+=======================================
+- General
+ - absolute vs. relative path
+ - installer to automatically copy the plug-in and its dependencies to the right place
+ - 64bit version of the plug-in
+ - build system
+ - layer
+ - import plug-in
+ - unit tests
+ - test framework to test all the features of the plug-in
+ - options to control the behavior of the plug-in. i.e. what and how to export
+ - gui to select options and to report problems
+ - i18n
+ - documentation how to use the plug-in and what features are supported
+
+=======================================
+- VisualScene
+ - joints and skins
+ - Reference to effect texture
+
+=======================================
+- Geometry:
+
+ - Materials:
+ - test blinn
+
+ - Polygons export:
+ LINES
+ LINE_STRIPS
+ TRIANGLE_FANS
+ TRIANGLE_STRIPS
+ POINTS
+
+=======================================
+- Effects:
+ - Shader export
+
+=======================================
+- Animations
+ - Only simple transformation animations are currently supported
+
+=======================================
+- Lights
+
+=======================================
+- Cameras
+
+=======================================
+- PhysicalScene
+
+=======================================
+- Spline
+
+=======================================
+- Nurbs
+
+=======================================
+- Object External References (XREFs)
View
372 COLLADAMax/include/COLLADAMaxAnimationExporter.h
@@ -0,0 +1,372 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_ANIMATIONEXPORTER_H__
+#define __COLLADAMAX_ANIMATIONEXPORTER_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "COLLADAStreamWriter.h"
+#include "COLLADALibraryAnimations.h"
+
+#include "COLLADAMaxDocumentExporter.h"
+
+class Control;
+
+namespace COLLADAMax
+{
+
+ /** A class that holds all information needed to export an animation.*/
+
+ class Animation
+ {
+
+ public:
+ /** Type of Animation*/
+ enum Type
+ {
+ FLOAT, //!< Animated float
+ FLOAT3, //!< Animated float3
+ FLOAT4, //!< Animated float4
+
+ POSITION_X, //!< Animated x translation
+ POSITION_Y, //!< Animated y translation
+ POSITION_Z, //!< Animated z translation
+
+ ROTATION_X, //!< Animated x rotation
+ ROTATION_Y, //!< Animated y rotation
+ ROTATION_Z, //!< Animated z rotation
+
+ SCALE_ROT_AXIS, //!< The pivot rotation for scale/skew
+ SCALE_ROT_AXIS_R, //!< The reverse pivot rotation for scale/skew
+
+ // Collapsed types
+ SCALE = FLOAT3, //!< Animated scale in three dimensions
+ TRANSLATION = FLOAT3 //!< Animated translation in three dimensions
+ };
+
+ /** Function pointer for conversion functions, to convert doubles.*/
+ typedef double ( *ConversionFunction ) ( const double & );
+
+ private:
+ /** The max controller.*/
+ Control * mController;
+
+ /** The id of the element to animate.*/
+ String mId;
+
+ /** The sid of the element to animate.*/
+ String mSid;
+
+ /** A pointer to an array of parameters to animate.*/
+ const String * mParameters;
+
+ /** Type of animation.*/
+ int mType;
+
+ /** Pointer to conversion function, to convert all animated values.*/
+ ConversionFunction mConversionFunction;
+
+ public:
+ /**
+ @param controller the controller used for the animation
+ @param id The id of the element to animate
+ @param sid The sid of the element to animate
+ @param parameter A pointer to an array of parameters to animate
+ @param type Type of animation
+ @param conversionFunction Pointer to conversion function, to convert all animated values*/
+ Animation ( Control * controller, const String & id, const String & sid, const String * parameter, int type, ConversionFunction conversionFunction = 0 );
+
+ /** Destructor*/
+ virtual ~Animation()
+ {}
+
+
+
+ /** Returns the controller.*/
+ Control * getController() const
+ {
+ return mController;
+ }
+
+ /** Returns the id of the element to animate.*/
+ const String & getId() const
+ {
+ return mId;
+ }
+
+ /** Returns the sid of the element to animate.*/
+ const String & getSid() const
+ {
+ return mSid;
+ }
+
+ /** Returns the pointer to an array of parameters to animate.*/
+ const String * getParameter() const
+ {
+ return mParameters;
+ }
+
+ /** Returns the type of the animation.*/
+ int getType() const
+ {
+ return mType;
+ }
+
+ /** Returns the pointer to conversion function, to convert all animated values.*/
+ const ConversionFunction & getConversionFunction() const
+ {
+ return mConversionFunction;
+ }
+
+ /** Returns the dimension of the animation, i.e. how many values are animated. */
+ int getDimension() const;
+ };
+
+
+ /** Class to exports all animations of a max document.*/
+
+ class AnimationExporter : public COLLADA::LibraryAnimations
+ {
+
+ private:
+ /** List of animations*/
+ typedef std::vector<Animation> AnimationList;
+
+ /** Function pointer to a function that fills the float buffer @a keyValues with the @a keyIndex'th output value
+ of @a animation. */
+ typedef void ( *OutputValueFunctionPtr ) ( float * keyValues, IKeyControl * keyInterface, const int & keyIndex, const Animation & animation );
+
+ /** Function pointer to a function that fills the float buffer @a keyValues with the @a keyIndex'th output value
+ of @a animation. */
+ typedef void ( AnimationExporter::*TangentValueFunctionPtr ) ( float & x, float & y, IKeyControl * keyInterface, const int & keyIndex, const int & keyCount, const Animation & animation );
+
+ /** Function pointer to a function that returns the interpolation type as a string of @a i'th
+ key of @a keyInterface. */
+ typedef const String & ( *InterpolationTypeFunctionPtr ) ( IKeyControl * keyInterface, int i );
+
+ private:
+ /** Value uses for inlength if none is specified.*/
+ static const float DEFAULT_INLENGHT;
+
+ /** Value uses for outlength if none is specified.*/
+ static const float DEFAULT_OUTLENGHT;
+
+ /** The documentexporter this exporter belongs to.*/
+ DocumentExporter * mDocumentExporter;
+
+ /** List of all animations to export*/
+ AnimationList mAnimationList;
+
+ /** Factor to multiply the key time with to get the real time.*/
+ static const float mTimeFactor;
+
+ public:
+ /** Constructor
+ @param streamWriter The stream the animation should be written to
+ @param documentExporter The documentexporter this exporter belongs to
+ */
+ AnimationExporter ( COLLADA::StreamWriter * streamWriter, DocumentExporter * documentExporter );
+
+ /** Destructor*/
+ ~AnimationExporter()
+ {}
+
+
+ /** Start export of all the animations.*/
+ void doExport();
+
+ /** Add @a animation to the list of animations that should be exported.*/
+ void addAnimation ( const Animation & animation )
+ {
+ mAnimationList.push_back ( animation );
+ }
+
+ /** Adds an animation that animates a Point3.
+ @param controller The controller that contains the animation
+ @param id The id of the element to animate
+ @param sid The sid of the element to animate
+ @param parameters The parameter list of the element to animate
+ */
+ void addAnimatedPoint3 ( Control * controller, const String & id, const String & sid, const String parameters[] );
+
+ /** Adds an animation that animates an angle.
+ @param controller The controller that contains the animation
+ @param id The id of the element to animate
+ @param sid The sid of the element to animate
+ @param parameters The parameter list of the element to animate
+ @param animatedAngle The type of the angle that should be animated
+ */
+ void addAnimatedAngle ( Control * controller, const String & id, const String & sid, const String parameters[], int animatedAngle );
+
+ /** Adds an animation that animates a Point3.
+ @param controller The controller that contains the animation
+ @param id The id of the element to animate
+ @param sid The sid of the element to animate
+ @param parameters The parameter list of the element to animate
+ */
+ void addAnimation4 ( Control * controller, const String & id, const String & sid, const String parameters[] );
+
+ /** Returns true, if the controller is animated an should be exported.*/
+ static bool isAnimated ( Control * controller );
+
+ /** Generates an id from all the strings contained in @a animation.*/
+ static String getBaseId ( const Animation & animation );
+
+ /** Generates the correct target string for use in the @a \<channel\> element.*/
+ static String getTarget ( const Animation & animation );
+
+ private:
+ /** Disable copy constructor.*/
+ AnimationExporter ( const AnimationExporter & animationExporter );
+
+ /** Disable assignment operator.*/
+ AnimationExporter & operator= ( const AnimationExporter & animationExporter );
+
+
+ /** Get the time of the key prior to key number @a i of @a controller.*/
+ TimeValue getPreviousTime ( const int & i, Control * controller ) const;
+
+ /** Get the time of the key next to key number @a i of @a controller.*/
+ TimeValue getNextTime ( const int & i, const int & keyCount, Control * controller ) const;
+
+ /** Exports all the source elements for @a animation.*/
+ void exportSources ( const Animation & animation );
+
+ /** Exports the input source element.
+ @param baseId The base id of the animation
+ @param controller The controller being exported
+ @param keyInterface The IKeyControl interface*/
+
+ template <class KeyClassName>
+ void exportInputSource ( const String & baseId, Control * controller, IKeyControl* keyInterface );
+
+
+ /** Exports the output source element.
+ @param animation The animation being exported
+ @param baseId The base id of the animation
+ @param keyInterface The IKeyControl interface
+ @param outputValueFunction Function pointer to a function used to retrieve the output values*/
+ void exportOutputSource ( const Animation & animation, const String & baseId, IKeyControl* keyInterface, OutputValueFunctionPtr outputValueFunction );
+
+ /** Retrieves the @a keyIndex'th value of type float from @a keyInterface of @a animation and stores it
+ in the float buffer @a keyValues.*/
+ template <class KeyType>
+ static void getFloatValue ( float * keyValues, IKeyControl * keyInterface, const int & keyIndex, const Animation & animation );
+
+ /** Retrieves the @a keyIndex'th position value of a position animation that animates one value
+ from @a keyInterface of @a animation and stores it in the float buffer @a keyValues. The buffer
+ @a keyValues must have at least
+ length 1.*/
+ static void getLinearPositionSingleValue ( float * keyValues, IKeyControl * keyInterface, const int & keyIndex, const Animation & animation );
+
+ /** Retrieves the three @a keyIndex'th position values of a position animation that animates all
+ three values from @a keyInterface of @a animation and stores it in the float buffer @a keyValues.
+ The buffer @a keyValues must have at least length 3.*/
+ static void getLinearPositionValue ( float * keyValues, IKeyControl * keyInterface, const int & keyIndex, const Animation & animation );
+
+ /** Retrieves the @a keyIndex'th rotation value of a rotation animation that animates one value
+ from @a keyInterface of @a animation and stores it in the float buffer @a keyValues. The buffer
+ @a keyValues must have at least length 1.*/
+ static void getLinearRotationSingleValue ( float * keyValues, IKeyControl * keyInterface, const int & keyIndex, const Animation & animation );
+
+ /** Retrieves the three @a keyIndex'th rotation values of a rotation animation that animates all
+ three values from @a keyInterface of @a animation and stores it in the float buffer @a keyValues.
+ The buffer @a keyValues must have at least length 3.*/
+ static void getLinearRotationValue ( float * keyValues, IKeyControl * keyInterface, const int & keyIndex, const Animation & animation );
+
+
+ /** Exports a tangent source element. It can be used for both in and out tangents.
+ @param sourceIdSuffix The id suffix that should be used for the source element
+ @param animation The animation being exported
+ @param baseId The base id of the animation
+ @param keyInterface The IKeyControl interface
+ @param tangentValueFunction Function pointer to a function used to retrieve the tangent values*/
+ void exportTangentSource ( const String & sourceIdSuffix, const Animation & animation, const String & baseId, IKeyControl* keyInterface, TangentValueFunctionPtr tangentValueFunction );
+
+
+ /** Exports the in tangent source element.
+ @param animation The animation being exported
+ @param baseId The base id of the animation
+ @param keyInterface The IKeyControl interface
+ @param tangentValueFunction Function pointer to a function used to retrieve the in tangent values*/
+ void exportInTangentSource ( const Animation & animation, const String & baseId, IKeyControl* keyInterface, TangentValueFunctionPtr tangentValueFunction );
+
+ /** Retrieves an in tangent value.
+ @param x float to store the x value
+ @param y float to store the y value
+ @param keyInterface The IKeyControl interface
+ @param keyIndex The index of the key
+ @param keyCount The number of keys in the animation
+ @param animation The animation to export*/
+ void getInTangentValue ( float & x, float & y, IKeyControl * keyInterface, const int & keyIndex, const int & keyCount, const Animation & animation );
+
+
+ /** Exports the out tangent source element.
+ @param animation The animation being exported
+ @param baseId The base id of the animation
+ @param keyInterface The IKeyControl interface
+ @param tangentValueFunction Function pointer to a function used to retrieve the out tangent values*/
+ void exportOutTangentSource ( const Animation & animation, const String & baseId, IKeyControl* keyInterface, TangentValueFunctionPtr tangentValueFunction );
+
+
+ /** Retrieves an out tangent value
+ @param x float to store the x value
+ @param y float to store the y value
+ @param keyInterface The IKeyControl interface
+ @param keyIndex The index of the key
+ @param keyCount The number of keys in the animation
+ @param animation The animation to export*/
+ void getOutTangentValue ( float & x, float & y, IKeyControl * keyInterface, const int & keyIndex, const int & keyCount, const Animation & animation );
+
+ /** Determines the interpolation type depending on @a flags*/
+ static InterpolationType getInterpolationType ( const DWORD & flags );
+
+ /** Exports the interpolation source.
+ @param baseId The base id of the animation
+ @param keyInterface The IKeyControl interface
+ @param interpolationTypeFunction Function pointer to a function used to retrieve the interpolation type
+ @param keyCount The number of keys in the animation
+ */
+ void exportInterpolationSource ( const String & baseId, IKeyControl * keyInterface, InterpolationTypeFunctionPtr interpolationTypeFunction, int keyCount );
+
+ /** Returns @a interpolationTypeName for all values of @a keyInterface and keyIndex.*/
+ template <const String & interpolationTypeName>
+ static const String & getUniformInterpolation ( IKeyControl * keyInterface, int keyIndex );
+
+ /** Returns the type of the interpolation.
+ @param keyInterface The IKeyControl interface
+ @param keyIndex The number of the key*/
+ static const String & getBezierInterpolation ( IKeyControl * keyInterface, int keyIndex );
+
+ /** Exports the sampler element.*/
+ void exportSampler ( const Animation & animation );
+
+ /** Exports the channel element.*/
+ void exportChannel ( const Animation & animation );
+ };
+}
+
+#endif //__COLLADAMAX_ANIMATIONEXPORTER_H__
+
+
+
+
View
146 COLLADAMax/include/COLLADAMaxColladaExporter.h
@@ -0,0 +1,146 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_COLLADAEXPORTER_H__
+#define __COLLADAMAX_COLLADAEXPORTER_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include <max.h>
+#include <iparamb2.h>
+
+// Exporter class ID
+//#define COLLADAEXPORTER_CLASS_ID Class_ID(0x7d656d57, 0x6f963848)
+
+namespace COLLADAMax
+{
+
+ // main exporter class
+
+ class COLLADAExporter : public SceneExport
+ {
+
+ public:
+ static const Class_ID COLLADAEXPORTER_CLASS_ID;
+
+ static const String EXTENSIONNAME;
+ static const String LONGDESCRIPTION;
+ static const String SHORTDESCRIPTION;
+ static const String AUTHORNAME;
+ static const String COPYRIGHTMESSAGE;
+ static const String OTHERMESSAGE1;
+ static const String OTHERMESSAGE2;
+
+ static const String PROGRESSSTART;
+ static const String FATALERROR;
+
+
+ static const unsigned int PLUGINVERSION;
+
+
+ public:
+ COLLADAExporter();
+ virtual ~COLLADAExporter();
+
+ // from SceneExport
+ int ExtCount(); // Returns the number of file name extensions supported by the plug-in.
+ const TCHAR* Ext ( int n ); // Return the 'i-th' file name extension (i.e. "dae").
+ const TCHAR* LongDesc(); // Long ASCII description (i.e. "Autodesk 3D Studio File")
+ const TCHAR* ShortDesc(); // Short ASCII description (i.e. "3D Studio")
+ const TCHAR* AuthorName(); // ASCII Author name
+ const TCHAR* CopyrightMessage(); // ASCII Copyright message
+ const TCHAR* OtherMessage1(); // Other message #1
+ const TCHAR* OtherMessage2(); // Other message #2
+ unsigned int Version(); // Version number * 100 (i.e. v3.01 = 301)
+ void ShowAbout ( HWND hWnd ); // Show DLL's "About..." box
+
+ BOOL SupportsOptions ( int ext, DWORD options );
+ int DoExport ( const TCHAR* name, ExpInterface* ei, Interface* i, BOOL suppressPrompts = FALSE, DWORD options = 0 );
+
+ private:
+ /** Disable copy constructor*/
+ COLLADAExporter ( const COLLADAExporter & colladaExporter );
+
+ /** Disable assignment operator*/
+ COLLADAExporter & operator= ( const COLLADAExporter & colladaExporter );
+
+ };
+
+ ClassDesc2* getCOLLADAExporterDesc();
+
+
+ //
+ // ColladaExporterClassDesc
+ //
+
+ class ColladaExporterClassDesc : public ClassDesc2
+ {
+
+ public:
+ int IsPublic()
+ {
+ return TRUE;
+ }
+
+ void * Create ( BOOL isLoading = FALSE )
+ {
+ isLoading;
+ return new COLLADAExporter();
+ }
+
+ const TCHAR * ClassName()
+ {
+ return "NewCollada";
+ }
+
+ SClass_ID SuperClassID()
+ {
+ return SCENE_EXPORT_CLASS_ID;
+ }
+
+ Class_ID ClassID()
+ {
+ return COLLADAExporter::COLLADAEXPORTER_CLASS_ID;
+ }
+
+ const TCHAR* Category()
+ {
+ return "Export";
+ } //GetString(IDS_CATEGORY_E); }
+
+ const TCHAR* InternalName()
+ {
+ return _T ( "COLLADAExporter" );
+ } // returns fixed parsable name (scripter-visible name)
+
+ HINSTANCE HInstance()
+ {
+ return hInstance;
+ } // returns owning module handle
+
+ };
+
+
+
+}
+
+
+#endif // __COLLADAMAX_COLLADAEXPORTER_H__
View
152 COLLADAMax/include/COLLADAMaxDocumentExporter.h
@@ -0,0 +1,152 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_DOCUMENT_EXPORTER_H__
+#define __COLLADAMAX_DOCUMENT_EXPORTER_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "COLLADAStreamWriter.h"
+#include "COLLADAMaxExportSceneGraph.h"
+#include "COLLADAMaxOptions.h"
+
+class Interface;
+
+namespace COLLADAMax
+{
+
+ class EffectExporter;
+
+ class MaterialExporter;
+
+ class AnimationExporter;
+
+ class DocumentExporter
+ {
+
+ private:
+ /** The effect exporter used by the document exporter.*/
+ EffectExporter * mEffectExporter;
+
+ /** The material exporter used by the document exporter.*/
+ MaterialExporter * mMaterialExporter;
+
+ /** The Animation exporter used by the document exporter.*/
+ AnimationExporter * mAnimationExporter;
+
+ /** The options used by the exporter.*/
+ Options mOptions;
+
+ Interface* mMaxInterface;
+
+ /** The stream writer used to write the COLLADA file.*/
+ COLLADA::StreamWriter mStreamWriter;
+
+ /** The scene graph which nodes will be exported.*/
+ ExportSceneGraph mExportSceneGraph;
+
+ /** The id of the @a \<scene\> element.*/
+ static const String SCENE_ID;
+
+ public:
+ /** Constructor
+ @param i the max interface
+ @param filepath The file path the COLLADA document should be written to*/
+ DocumentExporter ( Interface* i, const String &filepath );
+
+ /** Returns a pointer to the max interface.*/
+ inline Interface* getMaxInterface()
+ {
+ return mMaxInterface;
+ }
+
+ /** Exports the scene currently loaded in max.*/
+ void exportCurrentMaxScene();
+
+ /** Returns a pointer to the effect exporter used by the document exporter.*/
+ const EffectExporter * const getEffectExporter() const
+ {
+ return mEffectExporter;
+ }
+
+ /** Returns a pointer to the material exporter used by the document exporter.*/
+ MaterialExporter * getMaterialExporter()
+ {
+ return mMaterialExporter;
+ }
+
+ /** Returns a pointer to the animation exporter used by the document exporter.*/
+ AnimationExporter * getAnimationExporter()
+ {
+ return mAnimationExporter;
+ }
+
+ /** Returns the options.*/
+ const Options & getOptions() const
+ {
+ return mOptions;
+ }
+
+ private:
+ DocumentExporter ( const DocumentExporter & documentExporter );
+ DocumentExporter & operator= ( const DocumentExporter & documentExporter );
+
+ /** Creates the scene graph of the nodes, that should be exported.*/
+ bool createExportSceneGraph();
+
+ /** Creates all the importers that are reused by other exporters.*/
+ void createExporters();
+
+ /** Exports the asset.*/
+ void exportAsset();
+
+ /** Exports all the geometries contained in the export scene graph.*/
+ void exportGeometries();
+
+ /** Exports all the effects used by the nodes in the export scene graph.*/
+ void exportEffects();
+
+ /** Exports all the materials used by the nodes in the export scene graph.*/
+ void exportMaterials();
+
+ /** Exports all the images used by the exported textures.*/
+ void exportImages();
+
+ /** Exports all the nodes contained in the export scene graph.*/
+ void exportVisualScenes();
+
+ /** Exports all animations contained in all animatable elements.*/
+ void exportAnimations();
+
+ /** Exports the scene.*/
+ void exportScene();
+
+ /** Deletes all exporters created by createExporters().*/
+ void deleteExporters();
+
+ /** Returns the value of the environment variable @a variableName.*/
+ String getEnvironmentVariable ( const String & variableName );
+
+ };
+}
+
+
+#endif // __COLLADAMAX_DOCUMENT_EXPORTER_H__
View
227 COLLADAMax/include/COLLADAMaxEffectExporter.h
@@ -0,0 +1,227 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_EFFECTEXPORTER_H__
+#define __COLLADAMAX_EFFECTEXPORTER_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "ColladaMaxStableHeaders.h"
+#include "COLLADAStreamWriter.h"
+#include "COLLADALibraryEffects.h"
+#include "COLLADAIDList.h"
+
+#include "COLLADAMaxExportSceneGraph.h"
+#include "COLLADAMaxMaterialExporter.h"
+#include "COLLADAMaxTypes.h"
+
+class Mtl;
+
+class StdMat2;
+
+namespace COLLADAMax
+{
+
+ /** Class to export all used materials in a max scene to the library effect in COLLADA*/
+
+ class EffectExporter : public COLLADA::LibraryEffects
+ {
+
+ private:
+ /** Holds information about an already exported effect.*/
+
+ class ExportedEffect
+ {
+ Mtl * mMaterial; // The max material, that was use to export the effect
+ DWORD mColor; // The color that was used to export the effect
+ };
+
+ /** A texture channel.
+ Used by standard effects to assign textures to channels.
+ Multi-texturing is done by assigning more than one texture per slot.
+ Defaults to diffuse texture slot. */
+ enum Channel
+ {
+ AMBIENT = 0, /**< The texels will be modulated with the ambient light colors. */
+ BUMP, /**< The texels will re-orient the geometric normals. */
+ DIFFUSE, /**< The texels will be modulated with the non-ambient light colors. */
+ DISPLACEMENT, /**< The texels will displace the pixel positions. */
+ EMISSION, /**< The texels will be added to the final color directly. */
+ FILTER, /**< Max-specific. */
+ REFLECTION, /**< The texels will modify the pixel reflection factor. */
+ REFRACTION, /**< The texels will modify the pixel refraction factor. */
+ SHININESS, /**< The texels will modify the specular shininess of the pixel. */
+ SPECULAR, /**< The texels will be modulated with the specular light colors. */
+ SPECULAR_LEVEL, /**< The texels will be modulated with the specular light colors. */
+ TRANSPARENt, /**< The texels will be modify the final color alpha. */
+ COUNT, /**< The number of texture channels. */
+ UNKNOWN, /**< An unknown texture channel. */
+ DEFAULT = DIFFUSE
+ };
+
+
+ enum ShaderClassID
+ {
+ STD2_PHONG_CLASS_ID = 0x00000037,
+ STD2_BLINN_SHADER_CLASS_ID = 0x00000038,
+ STD2_METAL_SHADER_CLASS_ID = 0x00000039,
+ STD2_ANISOTROPIC_SHADER_CLASS_ID = 0x2857f460,
+ STD2_MULTI_LAYER_SHADER_CLASS_ID = 0x2857f470,
+ STD2_OREN_NAYER_BLINN_CLASS_ID = 0x2857f421
+ };
+
+ public:
+ static const String COLOR_EFFECT_ID_PREFIX;
+
+ static const String TEXCOORD_BASE;
+
+
+ private:
+
+ static const String DAE_AMBIENT_TEXTURE_CHANNEL;
+ static const String DAE_BUMP_TEXTURE_CHANNEL;
+ static const String DAE_DIFFUSE_TEXTURE_CHANNEL;
+ static const String DAE_DISPLACEMENT_TEXTURE_CHANNEL;
+ static const String DAE_EMISSION_TEXTURE_CHANNEL;
+ static const String DAE_FILTER_TEXTURE_CHANNEL;
+ static const String DAE_OPACITY_TEXTURE_CHANNEL;
+ static const String DAE_REFLECTION_TEXTURE_CHANNEL;
+ static const String DAE_REFRACTION_TEXTURE_CHANNEL;
+ static const String DAE_SHININESS_TEXTURE_CHANNEL;
+ static const String DAE_SPECULAR_TEXTURE_CHANNEL;
+ static const String DAE_SPECULARLEVEL_TEXTURE_CHANNEL;
+ static const String DAE_TRANSPARENT_TEXTURE_CHANNEL;
+
+ static const String EMPTY_STRING;
+
+ ExportSceneGraph * mExportSceneGraph;
+
+ /** Maps already exported wire frame colors to the corresponding COLLADA effect id.*/
+ WireFrameColorEffectList mWireFrameColorEffectList;
+
+ DocumentExporter * mDocumentExporter;
+
+ /** List of ids of the already exported materials that are used in the COLLADA file.*/
+ ExportedEffectIdList * mExportedEffectIdList;
+
+ /** Maps already exported effect (material in max) to the corresponding COLLADA effect id.*/
+ EffectMap mEffectMap;
+
+ /** Maps already exported image file names to the corresponding image id.*/
+ ExportedImageMap mExportedImageMap;
+
+ /** List of unique base effect ids.*/
+ COLLADA::IDList mEffectIdList;
+
+ public:
+ /** Constructor
+ @param streamWriter The stream the animation should be written to
+ @param exportSceneGraph The scene graph to export
+ @param documentExporter The documentexporter this exporter belongs to
+ */
+ EffectExporter ( COLLADA::StreamWriter * streamWriter, ExportSceneGraph * exportSceneGraph, DocumentExporter * documentExporter );
+
+ void doExport();
+
+ /** Generates the unique id for an effect with color @a color.*/
+ static String EffectExporter::getEffectId ( DWORD color );
+
+ /** Returns the WireFrameColorEffectList of the effect exporter.*/
+ const WireFrameColorEffectList & getWireFrameColorEffectMap() const
+ {
+ return mWireFrameColorEffectList;
+ }
+
+ /** Returns the EffectMap of the effect exporter.*/
+ const EffectMap & getEffectMap() const
+ {
+ return mEffectMap;
+ }
+
+ /** Returns the ExportedImageMapp of the effect exporter.*/
+ const ExportedImageMap & getExportedImageMap() const
+ {
+ return mExportedImageMap;
+ }
+
+ private:
+ EffectExporter ( const EffectExporter & effectExporter );
+ EffectExporter & operator= ( const EffectExporter & effectExporter );
+
+ /** Exports all the effects of node @a exportNode and all its child nodes.*/
+ void exportEffect ( ExportNode* exportNode );
+
+ /** Exports all the effects of @a material and all its sub materials.*/
+ void exportEffect ( ExportNode* exportNode, Mtl* material );
+
+ /** Exports the max standard material @a material.*/
+ void exportStandardEffect ( COLLADA::EffectProfile & effectProfile, ExportNode* exportNode, StdMat2* material, const String & effectId, float weight, bool inited );
+
+ /** Exports the max standard material @a material.*/
+ void exportUnknownEffect ( COLLADA::EffectProfile & effectProfile, ExportNode* exportNode, Mtl* material, const String & effectId );
+
+ /** Exports am common COLLADA effect created from @a material.*/
+ void exportCommonEffect ( COLLADA::EffectProfile & effectProfile, ExportNode* exportNode, Mtl* material, const String & effectId, float weight = 1.0, bool inited = false );
+
+ /** Exports the material @a material.*/
+ void exportSimpleEffect ( ExportNode* exportNode, Mtl* material );
+
+ /** Exports a color effect with color @a color.*/
+ void exportColorEffect ( ExportNode* exportNode, DWORD color );
+
+ /** Converts a max color to a CommonColorOrTextureType.*/
+ static COLLADA::ColorOrTexture maxColor2ColorOrTexture ( const Color & color, double scale = 1.0 );
+
+ /** Retrieves the effect channel.
+ @param mtl The max material
+ @param id The id*/
+ static EffectExporter::Channel maxIdToEffectChannel ( StdMat2* mtl, int id );
+
+ /** Sets the appropriate opacity.*/
+ static COLLADA::EffectProfile::Opaque getOpacity ( Texmap *tmap );
+
+
+ /** Determines shader type from max shader.*/
+ COLLADA::EffectProfile::ShaderTypes maxShaderToShaderType ( Class_ID id );
+
+
+ static EffectExporter::Channel channelFromString ( const String & value );
+
+
+ /**Exports the map @a texMap.*/
+ void exportMap ( unsigned int index, Texmap* texMap, COLLADA::EffectProfile & profile, float weight );
+
+ /** Exports the image represented by @a map.*/
+ String EffectExporter::exportImage ( Texmap* map );
+
+ /** Exports the image represented by @a bitmapInfo.*/
+ String EffectExporter::exportImage ( BitmapInfo& bitmapInfo );
+
+
+ /** Blends the color on colorOrTexture with blendColor an amount @a amount.*/
+ void EffectExporter::blendColor ( COLLADA::ColorOrTexture & colorOrTexture, Color blendColor, double amount );
+
+
+ };
+
+}
+
+#endif //__COLLADAMAX_EFFECTEXPORTER_H__
View
197 COLLADAMax/include/COLLADAMaxExportNode.h
@@ -0,0 +1,197 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_EXPORTNODE_H__
+#define __COLLADAMAX_EXPORTNODE_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include <max.h>
+
+#include "COLLADAUtils.h"
+#include "COLLADAIDList.h"
+#include <map>
+#include <vector>
+
+class INode;
+
+class ExportSceneGraph;
+
+
+
+namespace COLLADAMax
+{
+
+
+ /** A class to represent a node that should be exported.
+ */
+
+ class ExportNode
+ {
+
+ public:
+ enum Type
+ {
+ UNDETERMINED,
+ UNKNOWN,
+ MESH,
+ CAMERA,
+ LIGHT,
+ BONE
+ };
+
+ struct Symbol
+ {
+ bool used;
+ String name;
+ };
+
+ /** Maps max materials to COLLADA symbols map<material, symbol>.*/
+ typedef std::map<Mtl *, Symbol> MeshSymbolMap;
+
+ private:
+ typedef std::vector<ExportNode *> Children;
+
+ private:
+ /** Maps max material to symbol name.*/
+ MeshSymbolMap mMeshSymbolMap;
+
+ /** Only used if mMeshSymbolMap is empty.*/
+ DWORD mWireFrameColor;
+
+ /** The INode this export node wraps.*/
+ INode * mINode;
+
+ Children mChildren;
+
+ /** The type of the node.*/
+ mutable Type mType;
+
+ /** The unique id of the node.*/
+ String mId;
+
+ COLLADA::IDList mIdList;
+
+
+ public:
+ /** Constructor
+ @param iNode The INode represented by the Export node. */
+ ExportNode ( INode * iNode );
+
+ /** Desrtuctor*/
+ virtual ~ExportNode()
+ {
+ clean();
+ }
+
+ /** Returns the unique id of the node.*/
+ const String & getId() const
+ {
+ return mId;
+ }
+
+ /** Returns the type of the node.*/
+ Type getType() const;
+
+ /** Returns the INode associated with this Export Node.*/
+ INode * getINode() const
+ {
+ return mINode;
+ }
+
+ /** Returns the number of child nodes.*/
+ size_t getNumberOfChildren() const
+ {
+ return mChildren.size();
+ }
+
+ /** Returns the @a i'th child.*/
+ ExportNode * getChild ( size_t i )
+ {
+ return mChildren[ i ];
+ }
+
+ /** Returns the @a i'th child.*/
+ const ExportNode * const getChild ( size_t i ) const
+ {
+ return mChildren[ i ];
+ }
+
+ /** Determines and returns the type of @a INode.*/
+ static Type determineType ( INode * iNode );
+
+ /** Adds channel @a channel with corresponding effect id @a effectId. The symbol us marked as unused.*/
+ void addSymbol ( Mtl * material, const String & symbol );
+
+ /** Returns the symbol that corresponds to @a material.*/
+ const String& getSymbolByMaterialAndSetAsUsed ( Mtl* material );
+
+ /** Returns the @a MeshSymbolMap of this node.*/
+ const MeshSymbolMap & getMeshSymbolMap() const
+ {
+ return mMeshSymbolMap;
+ }
+
+
+ /** Sets the wire frame color.*/
+ void setWireFrameColor ( DWORD color )
+ {
+ mWireFrameColor = color;
+ }
+
+ /** Returns the wire frame color.*/
+ DWORD getWireFrameColor() const
+ {
+ return mWireFrameColor;
+ }
+
+ /** Set the unique id of the export node to @a id.
+ It is ensured, that the id is a valid id according to the xml spec*/
+ const String& setId ( const String& id )
+ {
+ mId = COLLADA::Utils::checkID ( id );
+ return mId;
+ }
+
+ /** Removes all children.*/
+ void clean();
+
+ /** Adds @a exportNode to its children.*/
+
+ void add
+ ( ExportNode * exportNode )
+ {
+ mChildren.push_back ( exportNode );
+ }
+
+ protected:
+ ExportNode ( INode * iNode, Type type );
+
+ private:
+
+ /** Determines the type of the export node.*/
+ Type determineType() const;
+ };
+
+}
+
+
+#endif //__COLLADAMAX_EXPORTNODE_H__
View
85 COLLADAMax/include/COLLADAMaxExportSceneGraph.h
@@ -0,0 +1,85 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_EXPORTSCENEGRAPH_H__
+#define __COLLADAMAX_EXPORTSCENEGRAPH_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "COLLADAMaxExportNode.h"
+#include "COLLADAIDList.h"
+
+#include <map>
+
+namespace COLLADAMax
+{
+
+ /** Class to build a scene graph of all nodes that should be exported. It
+ allows to store additional data for each node.*/
+
+ class ExportSceneGraph
+ {
+
+ private:
+ /** True if only the selection should be exported, false if the entire scene should be exported.*/
+ bool mExportSelection;
+
+ /** The root export node.*/
+ ExportNode * mRootExportNode;
+
+ /** The root INode.*/
+ INode * mRootNode;
+
+ /** Holds the unique ids of the nodes.*/
+ COLLADA::IDList mNodeIdList;
+
+ public:
+ ExportSceneGraph ( INode * iNode );
+ ~ExportSceneGraph()
+ {}
+
+ /** Creates the export scene graph.
+ @a return returns true if there are nodes to export and false otherwise.*/
+ bool create ( bool exportSelection );
+
+ /** Returns the root export node.*/
+ ExportNode * getRootExportNode() const
+ {
+ return mRootExportNode;
+ }
+
+ private:
+ ExportSceneGraph ( const ExportSceneGraph & exportSceneGraph );
+ ExportSceneGraph & operator= ( const ExportSceneGraph & exportSceneGraph );
+
+ /** Creates the export scene graph.*/
+ ExportNode * create ( INode *iNode );
+
+ /** Returns true if @a iNode should be exported, false otherwise.
+ The result of this member function depends on user options and on the selection status of the INode.*/
+ bool exportThisNode ( INode * iNode );
+
+
+ };
+}
+
+
+#endif //__EXPORTSCENEGRAPH_H__
View
82 COLLADAMax/include/COLLADAMaxExtra.h
@@ -0,0 +1,82 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_EXTRA_H__
+#define __COLLADAMAX_EXTRA_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "COLLADAStreamWriter.h"
+#include "COLLADAExtraTechnique.h"
+#include "COLLADAExtra.h"
+
+
+class Object;
+
+namespace COLLADAMax
+{
+ /** Base class to export extra tags in max.*/
+
+ class Extra : public COLLADA::ElementWriter
+ {
+
+ public:
+ /** The technique profile name.*/
+ static const String TECHNIQUE_PROFILE;
+
+ private:
+ COLLADA::Extra mExtra;
+ COLLADA::Technique mTechnique;
+
+ public:
+ /** Constructor
+ @param streamWriter the stream the extra tags should be written to.*/
+ Extra ( COLLADA::StreamWriter * streamWriter );
+
+ /** Destructor*/
+ virtual ~Extra()
+ {}
+
+
+ protected:
+ /** Opens a new @a \<technique\> element.*/
+ void openTechnique();
+
+ /** closes the extra tag*/
+ void closeExtra();
+
+ /** Adds a parameter to the technique. */
+
+ template <class T>
+ void addParameter ( const String &paramName, const T &value )
+ {
+ mTechnique.addParameter ( paramName, value );
+ }
+
+
+ };
+
+
+}
+
+
+#endif //__COLLADAMAX_EXTRA_H__
+
View
83 COLLADAMax/include/COLLADAMaxGeometriesExporter.h
@@ -0,0 +1,83 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_GEOMETRIESEXPORTER_H__
+#define __COLLADAMAX_GEOMETRIESEXPORTER_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "COLLADAStreamWriter.h"
+#include "COLLADALibraryGeometries.h"
+
+#include "COLLADAMaxDocumentExporter.h"
+
+namespace COLLADAMax
+{
+
+ class ExportSceneGraph;
+
+ class ExportNode;
+
+ /** Class to exports all nodes in an export scene graph.*/
+
+ class GeometriesExporter : public COLLADA::LibraryGeometries
+ {
+
+ private:
+ /** The export scene graph to export.*/
+ ExportSceneGraph * mExportSceneGraph;
+
+ /** The document exporter used to export the document.*/
+ DocumentExporter * mDocumentExporter;
+
+ /** Prefix of the symbol names.*/
+ static const String SYMBOL_NAME_PREFIX;
+
+ public:
+ /** Constructor
+ @param streamWriter The stream the animation should be written to
+ @param exportSceneGraph The scene graph to export
+ @param documentExporter The document exporter this exporter belongs to
+ */
+ GeometriesExporter ( COLLADA::StreamWriter * streamWriter, ExportSceneGraph * exportSceneGraph, DocumentExporter * documentExporter );
+
+ /** Exports all geometries in the export scene graph.*/
+ void doExport();
+
+
+ private:
+ GeometriesExporter ( const GeometriesExporter & geometriesExporter );
+ GeometriesExporter &operator= ( const GeometriesExporter & geometriesExporter );
+
+ friend class GeometryExporter;
+
+ /** Exports all the geometries in @a node and all its child nodes.*/
+ void doExport ( ExportNode* exportNode );
+
+ };
+
+}
+
+#endif //__COLLADAMAX_GEOMETRIESEXPORTER_H__
+
+
+
+
View
150 COLLADAMax/include/COLLADAMaxGeometryExporter.h
@@ -0,0 +1,150 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_GEOMETRYEXPORTER_H__
+#define __COLLADAMAX_GEOMETRYEXPORTER_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "COLLADAStreamWriter.h"
+#include "COLLADALibraryGeometries.h"
+#include "COLLADAPrimitves.h"
+
+#include "COLLADAMaxGeometriesExporter.h"
+
+namespace COLLADAMax
+{
+
+ class ExportNode;
+
+ /** Class to export a single geometry.*/
+
+ class GeometryExporter
+ {
+
+ private:
+ /** List of channels.*/
+ typedef std::vector<int> ChannelList;
+
+ /** List of max materials.*/
+ typedef std::vector<Mtl*> MaterialList;
+
+ public:
+ /** Symbol used for simple color materials.*/
+ static const String COLOR_MATERIAL_SYMBOL;
+
+ private:
+ /** The export node which geoemetry should be exported.*/
+ ExportNode * mExportNode;
+
+ /** The id of the geometry.*/
+ String mId;
+
+ GeometriesExporter * mGeometriesExporter;
+
+ DocumentExporter * mDocumentExporter;
+
+ /** The geometry as a PolyObject.*/
+ PolyObject * mPolyObject;
+
+ /** The geometry as a TriObject.*/
+ TriObject * mTriObject;
+
+ /** The geometry as a GeomObject.*/
+ GeomObject * mGeomObject;
+
+ /** True if object must be deleted by us.*/
+ bool mDeleteObject;
+
+ static const String SYMBOL_NAME_PREFIX;
+
+ public:
+ /** Constructor
+ @param exportNode The node which geometry should be exported
+ @param geometriesExporter The geometries exporter
+ @param documentExporter The document exporter this exporter belongs to
+ */
+ GeometryExporter ( ExportNode * exportNode, GeometriesExporter * geometriesExporter, DocumentExporter * documentExporter );
+
+ /** Exports the geometry.*/
+ void doExport();
+
+ /** Returns the suffix of a texture that corresponds to channel @a channel.*/
+ static String getTextureSourceIdSuffix ( int channel );
+
+
+ private:
+ GeometryExporter ( const GeometryExporter & geometryExporter );
+ GeometryExporter & operator= ( const GeometryExporter & geometryExporter );
+
+ /** Retrieves the base object and its super class id.*/
+ void GeometryExporter::getBaseObjectAndID ( Object*& object, SClass_ID& sid );
+
+ /** Classifies the object, i.e. check if it is a triObject or a polyObject.*/
+ void GeometryExporter::classifyObject ( Object* object /*, bool affectsControllers*/ );
+
+ /** Returns true if the current geometry is an editable polygon, false if it is a triangle mesh.*/
+ bool isEditablePoly()
+ {
+ return mTriObject == 0;
+ }
+
+ /** Exports all the geometries in @a node and all its child nodes.*/
+ void doExport ( const ExportNode* exportNode );
+
+ /** Exports the positions of the mesh mesh.*/
+ void exportPositions();
+
+ /** Exports the normals of the mesh.*/
+ void exportNormals();
+
+ /** Exports the normals of a triangle mesh.*/
+ void exportTriangleMeshNormals();
+
+ /** Exports the normals of a editable poly mesh. */
+ void exportEditablePolyNormals();
+
+ /** Exports the textures of @a mesh.*/
+ void exportTextures ( const ChannelList & channelList );
+
+ /** Exports the texture channel of @a mesh.*/
+ void exportTextureChannel ( int channelIndex );
+
+ /** Exports the vertices element.*/
+ void exportVertices ( const String & meshId );
+
+ /** Exports the mesh as triangles.*/
+ void exportTriangles ( const String & symbol, unsigned long numberOfFaces, int matId, size_t numMaterials, const ChannelList & channelList );
+
+ /** Exports the mesh as a polylist.*/
+ void exportPolylist ( const String & symbol, COLLADA::Polylist & polylist, int matId, size_t numMaterials, const ChannelList & channelList );
+
+ /** Create list of materials used by this geometry.*/
+ void flattenMaterials ( Mtl* material, MaterialList& mtlMap, int materialIndex = -1 );
+ };
+
+}
+
+#endif //__COLLADAMAX_GEOMETRYEXPORTER_H__
+
+
+
+
View
223 COLLADAMax/include/COLLADAMaxGeometryExtra.h
@@ -0,0 +1,223 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_GEOMETRYEXTRA_H__
+#define __COLLADAMAX_GEOMETRYEXTRA_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "COLLADAStreamWriter.h"
+#include "COLLADAMaxExtra.h"
+
+#include <max.h>
+#include <iparamb2.h>
+#include <iparamm2.h>
+
+class Object;
+
+namespace COLLADAMax
+{
+ /** Class to export extra tags of geometries. Currently extra tags for primitives
+ like box, sphere... are exported.*/
+
+ class GeometryExtra : public Extra
+ {
+
+ private:
+
+ struct ExtraParameter
+ {
+ /** Type of the parameter. One of the max types TYPE_FLOAT, TYPE_INT, TYPE_BOOL.*/
+ int type;
+ /** The id of the option to retrieve from the param block.*/
+ int paramId;
+ /** The name of the parameter, which is equals the elements name in the extra tag.*/
+ String paramName;
+ };
+
+ private:
+ TimeValue mTimeValue;
+ Interval mInterval;
+
+ /** The object which extra tag should be exported.*/
+ Object * mObject;
+
+ /* Element names of the primitives*/
+ static const String ELEMENT_BOX;
+ static const String ELEMENT_SPHERE;
+ static const String ELEMENT_CYLINDER;
+ static const String ELEMENT_TORUS;
+ static const String ELEMENT_TEAPOT;
+ static const String ELEMENT_CONE;
+ static const String ELEMENT_TUBE;
+ static const String ELEMENT_GEOSPHERE;
+ static const String ELEMENT_PYRAMID;
+ static const String ELEMENT_PLANE;
+ static const String ELEMENT_HEDRA;
+ static const String ELEMENT_CHAMFERBOX;
+ static const String ELEMENT_OILTANK;
+ static const String ELEMENT_SPINDLE;
+ static const String ELEMENT_GENGON;
+ static const String ELEMENT_RINGWAVE;
+ static const String ELEMENT_PRISM;
+ static const String ELEMENT_TORUSKNOT;
+ static const String ELEMENT_CHAMFERCYL;
+ static const String ELEMENT_CAPSULE;
+ static const String ELEMENT_L_EXT;
+ static const String ELEMENT_C_EXT;
+ static const String ELEMENT_HOSE;
+ static const String ELEMENT_LTYPESTAIR;
+ static const String ELEMENT_STRAIGHTSTAIR;
+ static const String ELEMENT_SPIRALSTAIR;
+ static const String ELEMENT_UTYPESTAIR;
+
+
+ /* Parameter count and parameter list of the primitives extra tags.*/
+ static const int BOXPARAMETERSCOUNT;
+ static const ExtraParameter BOXPARAMETERS[];
+
+ static const int SPHEREPARAMETERSCOUNT;
+ static const ExtraParameter SPHEREPARAMETERS[];
+
+ static const int CYLINDERPARAMETERSCOUNT;
+ static const ExtraParameter CYLINDERPARAMETERS[];
+
+ static const int TORUSPARAMETERSCOUNT;
+ static const ExtraParameter TORUSPARAMETERS[];
+
+ static const int TEAPOTPARAMETERSCOUNT;
+ static const ExtraParameter TEAPOTPARAMETERS[];
+
+ static const int CONEPARAMETERSCOUNT;
+ static const ExtraParameter CONEPARAMETERS[];
+
+ static const int TUBEPARAMETERSCOUNT;
+ static const ExtraParameter TUBEPARAMETERS[];
+
+ static const int GEOSPHEREPARAMETERSCOUNT;
+ static const ExtraParameter GEOSPHEREPARAMETERS[];
+
+ static const int PYRAMIDPARAMETERSCOUNT;
+ static const ExtraParameter PYRAMIDPARAMETERS[];
+
+ static const int PLANEPARAMETERSCOUNT;
+ static const ExtraParameter PLANEPARAMETERS[];
+
+ static const int HEDRAPARAMETERSCOUNT;
+ static const ExtraParameter HEDRAPARAMETERS[];
+
+ static const int CHAMFERBOXPARAMETERSCOUNT;
+ static const ExtraParameter CHAMFERBOXPARAMETERS[];
+
+ static const int OILTANKPARAMETERSCOUNT;
+ static const ExtraParameter OILTANKPARAMETERS[];
+
+ static const int SPINDLEPARAMETERSCOUNT;
+ static const ExtraParameter SPINDLEPARAMETERS[];
+
+ static const int GENGONPARAMETERSCOUNT;
+ static const ExtraParameter GENGONPARAMETERS[];
+
+ static const int RINGWAVEPARAMETERSCOUNT;
+ static const ExtraParameter RINGWAVEPARAMETERS[];
+
+ static const int PRISMPARAMETERSCOUNT;
+ static const ExtraParameter PRISMPARAMETERS[];
+
+ static const int TORUSKNOTPARAMETERSCOUNT;
+ static const ExtraParameter TORUSKNOTPARAMETERS[];
+
+ static const int CHAMFERCYLPARAMETERSCOUNT;
+ static const ExtraParameter CHAMFERCYLPARAMETERS[];
+
+ static const int CAPSULEPARAMETERSCOUNT;
+ static const ExtraParameter CAPSULEPARAMETERS[];
+
+ static const int L_EXTPARAMETERSCOUNT;
+ static const ExtraParameter L_EXTPARAMETERS[];
+
+ static const int C_EXTPARAMETERSCOUNT;
+ static const ExtraParameter C_EXTPARAMETERS[];
+
+ static const int HOSEPARAMETERSCOUNT;
+ static const ExtraParameter HOSEPARAMETERS[];
+
+ static const int LTYPESTAIRPARAMETERSCOUNT;
+ static const ExtraParameter LTYPESTAIRPARAMETERS[];
+
+ static const int STRAIGHTSTAIRPARAMETERSCOUNT;
+ static const ExtraParameter STRAIGHTSTAIRPARAMETERS[];
+
+ static const int SPIRALSTAIRPARAMETERSCOUNT;
+ static const ExtraParameter SPIRALSTAIRPARAMETERS[];
+
+ static const int UTYPESTAIRPARAMETERSCOUNT;
+ static const ExtraParameter UTYPESTAIRPARAMETERS[];
+
+
+ public:
+ /** Constructor
+ @param streamWriter The stream the animation should be written to
+ @param object The object which extra tag should be exported
+ */
+ GeometryExtra ( COLLADA::StreamWriter * streamWriter, Object * object );
+
+ /** Performs the actual export.*/
+ void doExport();
+
+ private:
+
+ /**Opens a primitive element within a new extra tag.*/
+ void openPrimitive ( const String & primitive );
+
+ /** Exports all known parameters of the parameter block associated with the current object in to an extra tag.*/
+ void exportParamBlock ( const String & elementName, const ExtraParameter extraParameters[], int extraParametersCount );
+
+ /** Exports all known parameters of the parameter block 2 associated with the current object in to an extra tag.*/
+ void exportParamBlock2 ( const String & elementName, const ExtraParameter extraParameters[], int extraParametersCount );
+
+ /** Adds parameter of type @a type with index @a paramBlockIndex, contained in @a paramBlock in an element named @a parameterElementName.*/
+
+ template <class ParameterType, class ParameterBlock>
+ void addParamBlockParameter ( ParameterType type, int paramBlockIndex, const String & parameterElementName, ParameterBlock *paramBlock )
+ {
+ switch ( type )
+ {
+
+ case TYPE_BOOL:
+ addParameter ( parameterElementName, paramBlock->GetInt ( paramBlockIndex, mTimeValue ) );
+ break;
+
+ case TYPE_INT:
+ addParameter ( parameterElementName, paramBlock->GetInt ( paramBlockIndex, mTimeValue ) );
+ break;
+
+ case TYPE_FLOAT:
+ addParameter ( parameterElementName, paramBlock->GetFloat ( paramBlockIndex, mTimeValue ) );
+ break;
+ }
+ }
+ };
+}
+
+
+#endif //__COLLADAMAX_GEOMETRYEXTRA_H__
+
View
64 COLLADAMax/include/COLLADAMaxImageExporter.h
@@ -0,0 +1,64 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_IMAGE_EXPORTER_H__
+#define __COLLADAMAX_IMAGE_EXPORTER_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "COLLADAStreamWriter.h"
+#include "COLLADALibraryImages.h"
+
+#include "COLLADAMaxEffectExporter.h"
+#include "COLLADAMaxDocumentExporter.h"
+
+namespace COLLADAMax
+{
+
+
+ /** This class writes the @a \<library_images\>. It uses informations created by an effect exporter.*/
+
+ class ImageExporter : public COLLADA::LibraryImages
+ {
+
+ private:
+ /** Map of image filenames and image ids.*/
+ const ExportedImageMap & mExportedImageMap;
+
+ public:
+ /**
+ @param streamWriter The stream the output will be written to
+ @param documentExporter The document exporter this material exporter is used in*/
+ ImageExporter ( COLLADA::StreamWriter * streamWriter, DocumentExporter * documentExporter );
+ virtual ~ImageExporter()
+ {}
+
+ /** Exports the library images.*/
+ void doExport();
+
+ private:
+ ImageExporter ( const ImageExporter & imageExporter );
+ ImageExporter &operator= ( const ImageExporter & imageExporter );
+
+ };
+}
+
+#endif //__COLLADAMAX_IMAGE_EXPORTER_H__
View
90 COLLADAMax/include/COLLADAMaxMaterialExporter.h
@@ -0,0 +1,90 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADAMAX_MATERIAL_EXPORTER_H__
+#define __COLLADAMAX_MATERIAL_EXPORTER_H__
+
+#include "COLLADAMaxPrerequisites.h"
+
+#include "COLLADAStreamWriter.h"
+#include "COLLADALibraryMaterials.h"
+
+#include "COLLADAMaxDocumentExporter.h"
+#include "COLLADAMaxEffectExporter.h"
+#include "COLLADAMaxTypes.h"
+
+namespace COLLADAMax
+{
+
+ class ExportSceneGraph;
+
+ class ExportNode;
+
+ /** This class writes the @a \<library_materials\>. It uses informations created my an effect exporter*/
+
+ class MaterialExporter : public COLLADA::LibraryMaterials
+ {
+
+ private:
+ /** maps already exported wire frame colors to the corresponding COLLADA effect id*/
+ const WireFrameColorEffectList * mWireFrameColorEffectList;
+
+ /** The document exporter*/
+ DocumentExporter * mDocumentExporter;
+
+ /** List of the the ids used by all of the effects*/
+ ExportedEffectIdList mExportedEffectIdList;
+
+ public:
+ /**
+ @param streamWriter The stream the output will be written to.
+ @param documentExporter The document exporter this material exporter is used in.*/
+ MaterialExporter ( COLLADA::StreamWriter * streamWriter, DocumentExporter * documentExporter );
+
+ /** Destructor*/
+ virtual ~MaterialExporter()
+ {}
+
+
+ /** Export the library materials.*/
+ void doExport();
+
+ /** Creates an id that should be used as id for a material that instantiates the effect that has id @a id.*/
+ static String getMaterialIdFromEffectId ( const String & effectId );
+
+ /** Returns a pointer to the material with matID @a materialId.*/
+ static Mtl* GetSubMaterialById ( Mtl* mtl, int materialId );
+
+ /** Returns a reference to the Effect ID list.*/
+ ExportedEffectIdList & getEffectIdList()
+ {
+ return mExportedEffectIdList;
+ }
+
+ private:
+ MaterialExporter ( const MaterialExporter & materialExporter );
+ MaterialExporter & operator= ( const MaterialExporter & materialExporter );
+
+ };
+
+}
+
+#endif //__COLLADAMAX_MATERIAL_EXPORTER_H__
View
217 COLLADAMax/include/COLLADAMaxMultiMtl.h
@@ -0,0 +1,217 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+
+ You should have received a copy of the MIT License along with
+ COLLADAMaya; see the file COPYING. If not have a look here:
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef _COLLADAMAX_MULTI_MTL_H_
+#define _COLLADAMAX_MULTI_MTL_H_
+
+namespace COLLADAMax
+{
+
+ // The information from this file comes from the MaxSDK sample: /material/multi.cpp.
+
+ namespace MultiMaterial
+ {
+ const Class_ID classID ( MULTI_CLASS_ID, 0 );
+ // Reference #s.
+ const unsigned int PBLOCK_REF = 0;
+ const unsigned int MTL_REF = 1;
+
+ // multi_params param IDs
+ enum
+ {
+ multi_mtls,
+ multi_ons,
+ multi_names,
+ multi_ids,
+ };
+ }
+
+ // From the SDK sample /material/composit.cpp
+
+ namespace CompositeMap
+ {
+ const Class_ID classID ( COMPOSITE_CLASS_ID, 0 );
+
+ // Parameter and ParamBlock IDs
+ enum { comptex_params, }; // pblock ID
+ // param IDs
+ enum
+ {
+ comptex_tex, comptex_ons
+
+ };
+ }
+
+ namespace MixMap
+ {
+ // Mix controller param IDs
+ enum
+ {
+ mix_mix, mix_curvea, mix_curveb, mix_usecurve,
+ mix_color1, mix_color2,
+ mix_map1, mix_map2, mix_mask,
+ mix_map1_on, mix_map2_on, mix_mask_on, // main grad params
+ mix_output
+ };
+ }
+
+ namespace CompositeMtl
+ {
+ const Class_ID classID ( 0x61dc0cd7, 0x13640af6 );
+
+ enum { compmat_params, }; // pblock ID
+
+ enum
+ {
+ compmat_mtls,
+ compmat_type,
+ compmat_map_on,
+ compmat_amount
+ };
+ }
+
+ // This information is taken from the 'StdMat2' sample.
+
+ namespace StandardMaterial
+ {
+ // reference numbers
+ const unsigned int OLD_PBLOCK_REF = 0;
+ const unsigned int TEXMAPS_REF = 1;
+ const unsigned int SHADER_REF = 2;
+ const unsigned int SHADER_PB_REF = 3;
+ const unsigned int EXTENDED_PB_REF = 4;
+ const unsigned int SAMPLING_PB_REF = 5;
+ const unsigned int MAPS_PB_REF = 6;
+ const unsigned int DYNAMICS_PB_REF = 7; // [glaforte] typo corrected, so you won't find this #define in the MaxSDK!
+ const unsigned int SAMPLER_REF = 8;
+
+ // shdr_params param IDs
+ enum
+ {
+ shdr_ambient, shdr_diffuse, shdr_specular,
+ shdr_ad_texlock, shdr_ad_lock, shdr_ds_lock,
+ shdr_use_self_illum_color, shdr_self_illum_amnt, shdr_self_illum_color,
+ shdr_spec_lvl, shdr_glossiness, shdr_soften
+ };
+
+ // std2_shader param IDs
+ enum
+ {
+ std2_shader_type, std2_wire, std2_two_sided, std2_face_map, std2_faceted,
+ std2_shader_by_name, // virtual param for accessing shader type by name
+ };
+
+ // std2_extended param IDs
+ enum
+ {
+ std2_opacity_type, std2_opacity, std2_filter_color, std2_ep_filter_map,
+ std2_falloff_type, std2_falloff_amnt,
+ std2_ior,
+ std2_wire_size, std2_wire_units,
+ std2_apply_refl_dimming, std2_dim_lvl, std2_refl_lvl,
+ std2_translucent_blur, std2_ep_translucent_blur_map,
+ std2_translucent_color, std2_ep_translucent_color_map,
+ };
+
+ // std2_sampling param IDs
+ enum
+ {
+ std2_ssampler, std2_ssampler_qual, std2_ssampler_enable,
+ std2_ssampler_adapt_on, std2_ssampler_adapt_threshold, std2_ssampler_advanced,
+ std2_ssampler_subsample_tex_on, std2_ssampler_by_name,
+ std2_ssampler_param0, std2_ssampler_param1, std2_ssampler_useglobal
+ };
+
+ // std_maps param IDs
+ enum
+ {
+ std2_map_enables, std2_maps, std2_map_amnts, std2_mp_ad_texlock,
+ };
+
+ // std2_dynamics param IDs
+ enum
+ {
+ std2_bounce, std2_static_friction, std2_sliding_friction,
+ };
+
+ enum ShaderClassID
+ {
+ STD2_PHONG_CLASS_ID = 0x00000037,
+ STD2_BLINN_SHADER_CLASS_ID = 0x00000038,
+ STD2_METAL_SHADER_CLASS_ID = 0x00000039,
+ STD2_ANISOTROPIC_SHADER_CLASS_ID = 0x2857f460,
+ STD2_MULTI_LAYER_SHADER_CLASS_ID = 0x2857f470,
+ STD2_OREN_NAYER_BLINN_CLASS_ID = 0x2857f421
+ };
+ }
+
+ namespace StdUVGen
+ {
+ enum { pblock };
+
+ // paramblock subanims
+ enum
+ {
+ u_offset,
+ v_offset,
+ u_tiling,
+ v_tiling,
+ u_angle,
+ v_angle,
+ w_angle,
+ blur,
+ noise_amt,
+ noise_size,
+ noise_level,
+ phase,
+ blur_offset,
+ num_subs
+ };
+ }
+
+
+ // All values in here were devined by trial and error
+
+ namespace TextureOutputIDs
+ {
+ // Paramblock Ref Id
+ enum RefIds
+ {
+ param_block_ref_id,
+ unknown1,
+ unknown2
+ };
+
+ enum ParamBlockIds
+ {
+ rgb_level,
+ rgb_offset,
+ output_amount,
+ bump_amount,
+ };
+ }
+
+
+
+}
+
+
+#endif // _COLLADAMAX_MULTI_MTL_H_
View
146 COLLADAMax/include/COLLADAMaxOptions.h
@@ -0,0 +1,146 @@
+/*
+ Copyright (c) 2008 Intel Corporation
+ Copyright (c) 2005-2008 Sony Computer Entertainment America
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ COLLADAMaya is free software; you can redistribute it and/or modify
+ it under the terms of the MIT License as published by the
+ Massachusetts Institute of Technology.
+
+ COLLADAMaya is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ MIT License for more details.
+