Browse files

cgfx hardware shader export

  • Loading branch information...
1 parent bda829d commit 5874ec9b09061626ddedffe4f7eaeed93d6cb88a @opencollada-sebastian opencollada-sebastian committed Sep 16, 2008
Showing with 8,632 additions and 1,222 deletions.
  1. +101 −12 COLLADA.sln
  2. +1 −1 COLLADAMax/include/COLLADAMaxEffectExporter.h
  3. +1 −1 COLLADAMax/include/COLLADAMaxExtra.h
  4. +1 −1 COLLADAMax/src/COLLADAMaxAnimationExporter.cpp
  5. +1 −1 COLLADAMax/src/COLLADAMaxCameraExporter.cpp
  6. +21 −6 COLLADAMax/src/COLLADAMaxEffectExporter.cpp
  7. +2 −2 COLLADAMax/src/COLLADAMaxExtra.cpp
  8. +1 −1 COLLADAMax/src/COLLADAMaxGeometryExtra.cpp
  9. +1 −1 COLLADAMax/src/COLLADAMaxLightExporter.cpp
  10. +8 −2 COLLADAMax/src/COLLADAMaxMaterialExporter.cpp
  11. +39 −0 COLLADAMaya/COLLADAMaya.sln
  12. +1 −1 COLLADAMaya/include/COLLADAMayaAnimationCurves.h
  13. +2 −2 COLLADAMaya/include/COLLADAMayaDagHelper.h
  14. +8 −4 COLLADAMaya/include/COLLADAMayaEffectExporter.h
  15. +6 −3 COLLADAMaya/include/COLLADAMayaEffectTextureExporter.h
  16. +134 −0 COLLADAMaya/include/COLLADAMayaHwShaderExporter.h
  17. +1 −1 COLLADAMaya/include/COLLADAMayaImageExporter.h
  18. +1 −1 COLLADAMaya/include/COLLADAMayaLightExporter.h
  19. +34 −1 COLLADAMaya/include/COLLADAMayaMaterialExporter.h
  20. +3 −4 COLLADAMaya/include/COLLADAMayaSyntax.h
  21. +12 −7 COLLADAMaya/include/COLLADAMayaVisualSceneExporter.h
  22. +370 −12 COLLADAMaya/scripts/COLLADAMaya.vcproj
  23. +1 −2 COLLADAMaya/src/COLLADAMayaAnimationClipExporter.cpp
  24. +4 −2 COLLADAMaya/src/COLLADAMayaAnimationElement.cpp
  25. +9 −8 COLLADAMaya/src/COLLADAMayaAnimationExporter.cpp
  26. +14 −8 COLLADAMaya/src/COLLADAMayaCameraExporter.cpp
  27. +10 −2 COLLADAMaya/src/COLLADAMayaControllerExporter.cpp
  28. +5 −5 COLLADAMaya/src/COLLADAMayaDagHelper.cpp
  29. +44 −279 COLLADAMaya/src/COLLADAMayaEffectExporter.cpp
  30. +75 −60 COLLADAMaya/src/COLLADAMayaEffectTextureExporter.cpp
  31. +8 −4 COLLADAMaya/src/COLLADAMayaGeometryExporter.cpp
  32. +1,355 −0 COLLADAMaya/src/COLLADAMayaHwShaderExporter.cpp
  33. +9 −2 COLLADAMaya/src/COLLADAMayaLightExporter.cpp
  34. +574 −13 COLLADAMaya/src/COLLADAMayaMaterialExporter.cpp
  35. +78 −48 COLLADAMaya/src/COLLADAMayaVisualSceneExporter.cpp
  36. +146 −0 COLLADAStreamWriter/include/COLLADAAnnotation.h
  37. +63 −0 COLLADAStreamWriter/include/COLLADACode.h
  38. +100 −145 COLLADAStreamWriter/include/COLLADAEffectProfile.h
  39. +3 −2 COLLADAStreamWriter/include/COLLADAElementWriter.h
  40. +7 −6 COLLADAStreamWriter/include/COLLADAExtraTechnique.h
  41. +211 −0 COLLADAStreamWriter/include/COLLADAFormatHint.h
  42. +108 −0 COLLADAStreamWriter/include/COLLADAImage.h
  43. +55 −0 COLLADAStreamWriter/include/COLLADAInclude.h
  44. +124 −0 COLLADAStreamWriter/include/COLLADAInstanceEffect.h
  45. +5 −6 COLLADAStreamWriter/include/COLLADALibraryEffects.h
  46. +2 −48 COLLADAStreamWriter/include/COLLADALibraryImages.h
  47. +26 −9 COLLADAStreamWriter/include/COLLADALibraryMaterials.h
  48. +130 −0 COLLADAStreamWriter/include/COLLADAOpenGLConstants.h
  49. +159 −0 COLLADAStreamWriter/include/COLLADAParamBase.h
  50. +169 −0 COLLADAStreamWriter/include/COLLADAParamTemplate.h
  51. +117 −0 COLLADAStreamWriter/include/COLLADAPass.h
  52. +192 −0 COLLADAStreamWriter/include/COLLADAPassState.h
  53. +53 −0 COLLADAStreamWriter/include/COLLADARenderState.h
  54. +144 −5 COLLADAStreamWriter/include/COLLADASWC.h
  55. +234 −0 COLLADAStreamWriter/include/COLLADASampler.h
  56. +85 −0 COLLADAStreamWriter/include/COLLADAShader.h
  57. +12 −12 COLLADAStreamWriter/include/COLLADASource.h
  58. +33 −1 COLLADAStreamWriter/include/COLLADAStreamWriter.h
  59. +68 −0 COLLADAStreamWriter/include/COLLADAString2WString.h
  60. +308 −0 COLLADAStreamWriter/include/COLLADASurface.h
  61. +287 −0 COLLADAStreamWriter/include/COLLADASurfaceInitOption.h
  62. +1 −3 COLLADAStreamWriter/include/COLLADATechnique.h
  63. +105 −0 COLLADAStreamWriter/include/COLLADATechniqueFX.h
  64. +28 −202 COLLADAStreamWriter/include/COLLADATexture.h
  65. +6 −6 COLLADAStreamWriter/include/COLLADAURI.h
  66. +17 −4 COLLADAStreamWriter/include/COLLADAUtils.h
  67. +86 −0 COLLADAStreamWriter/include/COLLADAValueType.h
  68. +121 −1 COLLADAStreamWriter/scripts/COLLADAStreamWriter.vcproj
  69. +1 −1 COLLADAStreamWriter/src/COLLADACamera.cpp
  70. +1 −1 COLLADAStreamWriter/src/COLLADACameraOptic.cpp
  71. +334 −165 COLLADAStreamWriter/src/COLLADAEffectProfile.cpp
  72. +6 −8 COLLADAStreamWriter/src/COLLADAExtraTechnique.cpp
  73. +147 −0 COLLADAStreamWriter/src/COLLADAFormatHint.cpp
  74. +51 −0 COLLADAStreamWriter/src/COLLADAImage.cpp
  75. +93 −0 COLLADAStreamWriter/src/COLLADAInstanceEffect.cpp
  76. +11 −6 COLLADAStreamWriter/src/COLLADALibraryEffects.cpp
  77. +1 −20 COLLADAStreamWriter/src/COLLADALibraryImages.cpp
  78. +21 −15 COLLADAStreamWriter/src/COLLADALibraryMaterials.cpp
  79. +3 −4 COLLADAStreamWriter/src/COLLADALight.cpp
  80. +94 −0 COLLADAStreamWriter/src/COLLADAParamBase.cpp
  81. +125 −0 COLLADAStreamWriter/src/COLLADAPass.cpp
  82. +55 −0 COLLADAStreamWriter/src/COLLADAPassState.cpp
  83. +58 −0 COLLADAStreamWriter/src/COLLADARenderState.cpp
  84. +311 −0 COLLADAStreamWriter/src/COLLADARenderStateStatic.h
  85. +149 −9 COLLADAStreamWriter/src/COLLADASWC.cpp
  86. +324 −0 COLLADAStreamWriter/src/COLLADASampler.cpp
  87. +59 −0 COLLADAStreamWriter/src/COLLADAShader.cpp
  88. +151 −7 COLLADAStreamWriter/src/COLLADAStreamWriter.cpp
  89. +109 −0 COLLADAStreamWriter/src/COLLADASurface.cpp
  90. +164 −0 COLLADAStreamWriter/src/COLLADASurfaceInitOption.cpp
  91. +48 −0 COLLADAStreamWriter/src/COLLADATechniqueFX.cpp
  92. +76 −24 COLLADAStreamWriter/src/COLLADATexture.cpp
  93. +2 −2 COLLADAStreamWriter/src/COLLADAURI.cpp
  94. +71 −13 COLLADAStreamWriter/src/COLLADAUtils.cpp
  95. +27 −0 Externals/README
View
113 COLLADA.sln
@@ -10,55 +10,144 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "COLLADAStreamWriter", "COLL
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "COLLADAMaya", "COLLADAMaya\scripts\COLLADAMaya.vcproj", "{60331F1F-2334-42AF-80A8-A4A6E3299186}"
ProjectSection(ProjectDependencies) = postProject
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713} = {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B} = {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgfxShader", "Externals\cgfxShader\scripts\cgfxShader.vcproj", "{F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug Max2008|Win32 = Debug Max2008|Win32
+ Debug Max2008|x64 = Debug Max2008|x64
Debug Max2009|Win32 = Debug Max2009|Win32
+ Debug Max2009|x64 = Debug Max2009|x64
Debug Max9|Win32 = Debug Max9|Win32
+ Debug Max9|x64 = Debug Max9|x64
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
Release Max2008|Win32 = Release Max2008|Win32
+ Release Max2008|x64 = Release Max2008|x64
Release Max2009|Win32 = Release Max2009|Win32
+ Release Max2009|x64 = Release Max2009|x64
Release Max9|Win32 = Release Max9|Win32
+ Release Max9|x64 = Release Max9|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
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 Max2008|x64.ActiveCfg = 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 Max2009|x64.ActiveCfg = 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}.Debug Max9|x64.ActiveCfg = Debug Max9|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Debug|Win32.ActiveCfg = Debug Max2008|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Debug|Win32.Build.0 = Debug Max2008|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Debug|x64.ActiveCfg = Debug Max2008|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 Max2008|x64.ActiveCfg = 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 Max2009|x64.ActiveCfg = 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
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release Max9|x64.ActiveCfg = Release Max9|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release|Win32.ActiveCfg = Release Max2008|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release|Win32.Build.0 = Release Max2008|Win32
+ {8840B0EA-A0B3-45D6-855D-8382B247CE8B}.Release|x64.ActiveCfg = Release Max2008|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2008|Win32.ActiveCfg = Debug fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2008|Win32.Build.0 = Debug fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2008|x64.ActiveCfg = Debug fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2009|Win32.ActiveCfg = Debug fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2009|Win32.Build.0 = Debug fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max2009|x64.ActiveCfg = Debug fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max9|Win32.ActiveCfg = Debug fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max9|Win32.Build.0 = Debug fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug Max9|x64.ActiveCfg = Debug fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug|Win32.Build.0 = Debug|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Debug|x64.ActiveCfg = Debug|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2008|Win32.ActiveCfg = Release fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2008|Win32.Build.0 = Release fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2008|x64.ActiveCfg = Release fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2009|Win32.ActiveCfg = Release fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2009|Win32.Build.0 = Release fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max2009|x64.ActiveCfg = Release fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max9|Win32.ActiveCfg = Release fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max9|Win32.Build.0 = Release fprintf_s|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2008|Win32.ActiveCfg = DebugConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2008|Win32.Build.0 = DebugConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2009|Win32.ActiveCfg = DebugConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2009|Win32.Build.0 = DebugConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max9|Win32.ActiveCfg = DebugConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max9|Win32.Build.0 = DebugConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2008|Win32.ActiveCfg = ReleaseConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2008|Win32.Build.0 = ReleaseConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2009|Win32.ActiveCfg = ReleaseConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2009|Win32.Build.0 = ReleaseConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max9|Win32.ActiveCfg = ReleaseConsole2008|Win32
- {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max9|Win32.Build.0 = ReleaseConsole2008|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release Max9|x64.ActiveCfg = Release fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release|Win32.ActiveCfg = Release|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release|Win32.Build.0 = Release|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.Release|x64.ActiveCfg = Release|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2008|Win32.ActiveCfg = DebugPlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2008|Win32.Build.0 = DebugPlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2008|x64.ActiveCfg = DebugConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2008|x64.Build.0 = DebugConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2009|Win32.ActiveCfg = DebugPlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2009|Win32.Build.0 = DebugPlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2009|x64.ActiveCfg = DebugConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max2009|x64.Build.0 = DebugConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max9|Win32.ActiveCfg = DebugPlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max9|Win32.Build.0 = DebugPlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max9|x64.ActiveCfg = DebugConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug Max9|x64.Build.0 = DebugConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug|Win32.ActiveCfg = DebugPlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug|Win32.Build.0 = DebugPlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug|x64.ActiveCfg = DebugConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Debug|x64.Build.0 = DebugConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2008|Win32.ActiveCfg = ReleasePlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2008|Win32.Build.0 = ReleasePlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2008|x64.ActiveCfg = ReleaseConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2008|x64.Build.0 = ReleaseConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2009|Win32.ActiveCfg = ReleasePlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2009|Win32.Build.0 = ReleasePlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2009|x64.ActiveCfg = ReleaseConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max2009|x64.Build.0 = ReleaseConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max9|Win32.ActiveCfg = ReleasePlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max9|Win32.Build.0 = ReleasePlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max9|x64.ActiveCfg = ReleaseConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release Max9|x64.Build.0 = ReleaseConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release|Win32.ActiveCfg = ReleaseConsole2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release|Win32.Build.0 = ReleaseConsole2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release|x64.ActiveCfg = ReleaseConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.Release|x64.Build.0 = ReleaseConsole2008|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max2008|Win32.ActiveCfg = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max2008|Win32.Build.0 = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max2008|x64.ActiveCfg = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max2008|x64.Build.0 = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max2009|Win32.ActiveCfg = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max2009|Win32.Build.0 = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max2009|x64.ActiveCfg = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max2009|x64.Build.0 = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max9|Win32.ActiveCfg = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max9|Win32.Build.0 = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max9|x64.ActiveCfg = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug Max9|x64.Build.0 = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug|Win32.Build.0 = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug|x64.ActiveCfg = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Debug|x64.Build.0 = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max2008|Win32.ActiveCfg = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max2008|Win32.Build.0 = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max2008|x64.ActiveCfg = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max2008|x64.Build.0 = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max2009|Win32.ActiveCfg = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max2009|Win32.Build.0 = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max2009|x64.ActiveCfg = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max2009|x64.Build.0 = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max9|Win32.ActiveCfg = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max9|Win32.Build.0 = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max9|x64.ActiveCfg = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release Max9|x64.Build.0 = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release|Win32.ActiveCfg = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release|Win32.Build.0 = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release|x64.ActiveCfg = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
2 COLLADAMax/include/COLLADAMaxEffectExporter.h
@@ -268,7 +268,7 @@ namespace COLLADAMax
/** Determines shader type from max shader.*/
- COLLADA::EffectProfile::ShaderTypes maxShaderToShaderType ( Class_ID id );
+ COLLADA::EffectProfile::ShaderType maxShaderToShaderType ( Class_ID id );
static EffectExporter::Channel channelFromString ( const String & value );
View
2 COLLADAMax/include/COLLADAMaxExtra.h
@@ -129,7 +129,7 @@ namespace COLLADAMax
ids for the animation.*/
void addParamBlockAnimatedExtraParameters ( const String & childElementName, const ExtraParameter extraParameters[], int extraParametersCount, IParamBlock2 * paramBlock, const String& baseId );
- void addExtraTechniques();
+ void addMaxExtraTechniques();
/** Writes all information of the IParamBlock2 @a parameters to the file @a fileName. For development purposes
only.
View
2 COLLADAMax/src/COLLADAMaxAnimationExporter.cpp
@@ -2129,7 +2129,7 @@ namespace COLLADAMax
int keyCount = (endTime - startTime) / ticksPerFrame + 1;
int keyLength = animation.getDimension();
- COLLADA::Float4x4Source source ( mSW );
+ COLLADA::Float4x4SourceF source ( mSW );
source.setId ( baseId + OUTPUT_SOURCE_ID_SUFFIX );
source.setArrayId ( baseId + OUTPUT_SOURCE_ID_SUFFIX + ARRAY_ID_SUFFIX );
source.setAccessorStride ( keyLength );
View
2 COLLADAMax/src/COLLADAMaxCameraExporter.cpp
@@ -232,7 +232,7 @@ namespace COLLADAMax
}
}
}
- addExtraTechniques();
+ addMaxExtraTechniques();
delete optics;
}
View
27 COLLADAMax/src/COLLADAMaxEffectExporter.cpp
@@ -272,7 +272,7 @@ namespace COLLADAMax
addEffectProfile ( effectProfile );
- addExtraTechniques();
+ addMaxExtraTechniques();
closeEffect();
@@ -526,7 +526,22 @@ namespace COLLADAMax
if ( !imageId.empty() )
{
- COLLADA::Texture texture ( imageId, COLLADA::Texture::SURFACE_TYPE_2D );
+ COLLADA::Texture texture ( imageId );
+
+ // Create the surface
+ String surfaceSid = imageId + COLLADA::Surface::SURFACE_SID_SUFFIX;
+ COLLADA::Surface surface ( COLLADA::Surface::SURFACE_TYPE_2D, surfaceSid );
+ //surface.setFormat ( FORMAT );
+ COLLADA::SurfaceInitOption initOption ( COLLADA::SurfaceInitOption::INIT_FROM );
+ initOption.setImageReference ( imageId );
+ surface.setInitOption ( initOption );
+ texture.setSurface ( surface );
+
+ // Create the sampler
+ String samplerSid = imageId + COLLADA::Sampler::SAMPLER_SID_SUFFIX;
+ COLLADA::Sampler sampler ( COLLADA::Sampler::SAMPLER_TYPE_2D, samplerSid );
+ sampler.setSource ( surfaceSid );
+ texture.setSampler ( sampler );
int mapChannel = 1;
@@ -540,7 +555,7 @@ namespace COLLADAMax
StdUVGen* uvGenParameters = (StdUVGen*)uvCoordinatesGenerator;
int uvFlags = uvGenParameters->GetTextureTiling();
- texture.setWrapS(COLLADA::Texture::WRAP_MODE_WRAP);
+ sampler.setWrapS(COLLADA::Sampler::WRAP_MODE_WRAP);
IParamBlock* uvParams = (IParamBlock*)uvGenParameters->GetReference(StdUVGenEnums::pblock);
@@ -772,7 +787,7 @@ namespace COLLADAMax
addEffectProfile ( effectProfile );
- addExtraTechniques();
+ addMaxExtraTechniques();
closeEffect();
@@ -990,7 +1005,7 @@ namespace COLLADAMax
}
//---------------------------------------------------------------
- COLLADA::EffectProfile::ShaderTypes EffectExporter::maxShaderToShaderType ( Class_ID id )
+ COLLADA::EffectProfile::ShaderType EffectExporter::maxShaderToShaderType ( Class_ID id )
{
switch ( id.PartA() )
{
@@ -1050,7 +1065,7 @@ namespace COLLADAMax
BMMGetFullFilename ( &bitmapInfo );
fullFileName = bitmapInfo.Name();
- String fullFileNameURI = COLLADA::Utils::FILE_PROTOCOL + COLLADA::Utils::UriEncode ( fullFileName );
+ String fullFileNameURI = COLLADA::Utils::FILE_PROTOCOL + COLLADA::Utils::uriEncode ( fullFileName );
String imageId;
// Export the equivalent <image> node in the image library and add
// the <init_from> element to the sampler's surface definition.
View
4 COLLADAMax/src/COLLADAMaxExtra.cpp
@@ -161,9 +161,9 @@ namespace COLLADAMax
}
//---------------------------------------------------------------
- void Extra::addExtraTechniques()
+ void Extra::addMaxExtraTechniques()
{
- addTextureExtraTechniques(*mSW);
+ addExtraTechniques(mSW);
}
void Extra::writeParameterBlockInfo( const String& fileName, IParamBlock* parameters )
View
2 COLLADAMax/src/COLLADAMaxGeometryExtra.cpp
@@ -534,7 +534,7 @@ namespace COLLADAMax
#endif
- addExtraTechniques();
+ addMaxExtraTechniques();
}
View
2 COLLADAMax/src/COLLADAMaxLightExporter.cpp
@@ -341,7 +341,7 @@ namespace COLLADAMax
}
}
- addExtraTechniques();
+ addMaxExtraTechniques();
delete colladaLight;
View
10 COLLADAMax/src/COLLADAMaxMaterialExporter.cpp
@@ -69,7 +69,10 @@ namespace COLLADAMax
{
const String & effectURL = EffectExporter::getEffectId ( *it );
String materialId = getMaterialIdFromEffectId ( effectURL );
- addInstanceEffect ( "#" + effectURL, materialId, materialId );
+
+ openMaterial ( materialId, materialId );
+ addInstanceEffect ( "#" + effectURL );
+ closeMaterial ();
}
// export all ordinary materials
@@ -78,7 +81,10 @@ namespace COLLADAMax
{
const String & effectURL = *it;
String materialId = getMaterialIdFromEffectId ( effectURL );
- addInstanceEffect ( "#" + effectURL, materialId, materialId );
+
+ openMaterial ( materialId, materialId );
+ addInstanceEffect ( "#" + effectURL );
+ closeMaterial ();
}
closeLibrary();
View
39 COLLADAMaya/COLLADAMaya.sln
@@ -4,34 +4,73 @@ Microsoft Visual Studio Solution File, Format Version 9.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "COLLADAMaya", "scripts\COLLADAMaya.vcproj", "{60331F1F-2334-42AF-80A8-A4A6E3299186}"
ProjectSection(ProjectDependencies) = postProject
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B} = {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713} = {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "COLLADAStreamWriter", "..\COLLADAStreamWriter\scripts\COLLADAStreamWriter.vcproj", "{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgfxShader", "..\Externals\cgfxShader\scripts\cgfxShader.vcproj", "{F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugConsole2008|Win32 = DebugConsole2008|Win32
+ DebugConsole2008|x64 = DebugConsole2008|x64
DebugPlugin2008|Win32 = DebugPlugin2008|Win32
+ DebugPlugin2008|x64 = DebugPlugin2008|x64
ReleaseConsole2008|Win32 = ReleaseConsole2008|Win32
+ ReleaseConsole2008|x64 = ReleaseConsole2008|x64
ReleasePlugin2008|Win32 = ReleasePlugin2008|Win32
+ ReleasePlugin2008|x64 = ReleasePlugin2008|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{60331F1F-2334-42AF-80A8-A4A6E3299186}.DebugConsole2008|Win32.ActiveCfg = DebugConsole2008|Win32
{60331F1F-2334-42AF-80A8-A4A6E3299186}.DebugConsole2008|Win32.Build.0 = DebugConsole2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.DebugConsole2008|x64.ActiveCfg = DebugConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.DebugConsole2008|x64.Build.0 = DebugConsole2008|x64
{60331F1F-2334-42AF-80A8-A4A6E3299186}.DebugPlugin2008|Win32.ActiveCfg = DebugPlugin2008|Win32
{60331F1F-2334-42AF-80A8-A4A6E3299186}.DebugPlugin2008|Win32.Build.0 = DebugPlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.DebugPlugin2008|x64.ActiveCfg = DebugPlugin2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.DebugPlugin2008|x64.Build.0 = DebugPlugin2008|x64
{60331F1F-2334-42AF-80A8-A4A6E3299186}.ReleaseConsole2008|Win32.ActiveCfg = ReleaseConsole2008|Win32
{60331F1F-2334-42AF-80A8-A4A6E3299186}.ReleaseConsole2008|Win32.Build.0 = ReleaseConsole2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.ReleaseConsole2008|x64.ActiveCfg = ReleaseConsole2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.ReleaseConsole2008|x64.Build.0 = ReleaseConsole2008|x64
{60331F1F-2334-42AF-80A8-A4A6E3299186}.ReleasePlugin2008|Win32.ActiveCfg = ReleasePlugin2008|Win32
{60331F1F-2334-42AF-80A8-A4A6E3299186}.ReleasePlugin2008|Win32.Build.0 = ReleasePlugin2008|Win32
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.ReleasePlugin2008|x64.ActiveCfg = ReleasePlugin2008|x64
+ {60331F1F-2334-42AF-80A8-A4A6E3299186}.ReleasePlugin2008|x64.Build.0 = ReleasePlugin2008|x64
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.DebugConsole2008|Win32.ActiveCfg = Debug fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.DebugConsole2008|Win32.Build.0 = Debug fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.DebugConsole2008|x64.ActiveCfg = Debug|x64
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.DebugConsole2008|x64.Build.0 = Debug fprintf_s|x64
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.DebugPlugin2008|Win32.ActiveCfg = Debug fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.DebugPlugin2008|Win32.Build.0 = Debug fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.DebugPlugin2008|x64.ActiveCfg = Debug fprintf_s|x64
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.DebugPlugin2008|x64.Build.0 = Debug fprintf_s|x64
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.ReleaseConsole2008|Win32.ActiveCfg = Release fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.ReleaseConsole2008|Win32.Build.0 = Release fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.ReleaseConsole2008|x64.ActiveCfg = Release fprintf_s|x64
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.ReleaseConsole2008|x64.Build.0 = Release fprintf_s|x64
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.ReleasePlugin2008|Win32.ActiveCfg = Release fprintf_s|Win32
{EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.ReleasePlugin2008|Win32.Build.0 = Release fprintf_s|Win32
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.ReleasePlugin2008|x64.ActiveCfg = Release fprintf_s|x64
+ {EAB66F01-60B5-43C9-B78D-A8B0B545A20B}.ReleasePlugin2008|x64.Build.0 = Release fprintf_s|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.DebugConsole2008|Win32.ActiveCfg = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.DebugConsole2008|Win32.Build.0 = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.DebugConsole2008|x64.ActiveCfg = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.DebugConsole2008|x64.Build.0 = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.DebugPlugin2008|Win32.ActiveCfg = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.DebugPlugin2008|Win32.Build.0 = Debug|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.DebugPlugin2008|x64.ActiveCfg = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.DebugPlugin2008|x64.Build.0 = Debug|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.ReleaseConsole2008|Win32.ActiveCfg = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.ReleaseConsole2008|Win32.Build.0 = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.ReleaseConsole2008|x64.ActiveCfg = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.ReleaseConsole2008|x64.Build.0 = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.ReleasePlugin2008|Win32.ActiveCfg = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.ReleasePlugin2008|Win32.Build.0 = Release|Win32
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.ReleasePlugin2008|x64.ActiveCfg = Release|x64
+ {F2BFF69E-9E62-4CD5-B3C3-19A9CEC83713}.ReleasePlugin2008|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
2 COLLADAMaya/include/COLLADAMayaAnimationCurves.h
@@ -37,7 +37,6 @@ namespace COLLADAMaya
* Represents the base of an animation curve.
*/
template <class T>
-
class BaseAnimationCurve
{
@@ -86,6 +85,7 @@ namespace COLLADAMaya
bool mIsStatic;
public:
+
/** Returns the owning element of the current curve */
const AnimationElement* getParent() const
{
View
4 COLLADAMaya/include/COLLADAMayaDagHelper.h
@@ -84,8 +84,8 @@ namespace COLLADAMaya
static bool getPlugValue ( const MPlug& plug, float& x, float& y );
static bool getPlugValue ( const MPlug& plug, float& x, float& y, float& z );
static bool getPlugValue ( const MPlug& plug, MVector& value );
- static void getPlugValue ( const MObject& node, const String attributeName, MStringArray& output, MStatus* ReturnStatus = NULL );
- static void getPlugValue ( const MPlug& plug, MStringArray& output, MStatus* ReturnStatus = NULL );
+ static void getPlugValue ( const MObject& node, const String attributeName, MStringArray& output, MStatus* status = NULL );
+ static void getPlugValue ( const MPlug& plug, MStringArray& output, MStatus* status = NULL );
static bool setPlugValue ( MPlug& plug, const MVector& value );
static bool setPlugValue ( MPlug& plug, const MMatrix& value );
View
12 COLLADAMaya/include/COLLADAMayaEffectExporter.h
@@ -65,7 +65,6 @@ namespace COLLADAMaya
typedef std::map<String, MObject*> EffectMap;
/** This class writes the <library_materials>. It uses informations created my an effect exporter*/
-
class EffectExporter : public COLLADA::LibraryEffects
{
@@ -154,6 +153,9 @@ namespace COLLADAMaya
return mTextureExporter.getExportedImageMap();
}
+ /** For export the textures */
+ EffectTextureExporter* getTextureExporter () { return &mTextureExporter; }
+
private:
/** Exports the effects of a shader */
@@ -172,9 +174,11 @@ namespace COLLADAMaya
MObject shadingNetwork,
bool initialized=false );
- /** Export a shader, by type */
- void exportColladaFXShader ( COLLADA::EffectProfile* effectProfile,
- MObject shadingNetwork );
+ /** Export a hardware shader node. */
+ void exportHwShaderNode (
+ const String &effectId,
+ COLLADA::EffectProfile *effectProfile,
+ MObject shadingNetwork );
/**
* Find any textures connected to a material attribute and create the
View
9 COLLADAMaya/include/COLLADAMayaEffectTextureExporter.h
@@ -116,17 +116,20 @@ namespace COLLADAMaya
return &mExportedImageMap;
}
- private:
-
/** Exports the texture image */
String exportImage ( const MObject &texture );
+ /** Exports the texture image */
+ COLLADA::Image* exportImage( const String& colladaImageId, const String& sourceFile );
+
+ private:
+
/**
* Returns the target file name of the given source file name.
* @param sourceFileName The source file name.
* @return String The target file name.
*/
- String getTargetFileName( String &sourceFileName );
+ String getTargetFileName ( const String &sourceFileName );
/** Dump a place2dTexture node */
void add2DPlacement ( COLLADA::Texture* colladaTexture, MObject texture );
View
134 COLLADAMaya/include/COLLADAMayaHwShaderExporter.h
@@ -0,0 +1,134 @@
+/*
+ Copyright (c) 2008 NetAllied Systems GmbH
+
+ This file is part of COLLADAMaya.
+
+ Portions of the code are:
+ Copyright (c) 2005-2007 Feeling Software Inc.
+ Copyright (c) 2005-2007 Sony Computer Entertainment America
+ Copyright (c) 2004-2005 Alias Systems Corp.
+
+ Licensed under the MIT Open Source License,
+ for details please see LICENSE file or the website
+ http://www.opensource.org/licenses/mit-license.php
+*/
+
+#ifndef __COLLADA_MAYA_HW_SHADER_EXPORTER_H__
+#define __COLLADA_MAYA_HW_SHADER_EXPORTER_H__
+
+#include "ColladaMayaPrerequisites.h"
+#include "COLLADAMayaDocumentExporter.h"
+
+#include "COLLADAParamBase.h"
+#include "COLLADAParamTemplate.h"
+#include "COLLADAValueType.h"
+#include "COLLADAEffectProfile.h"
+
+#include "cgfxAttrDef.h"
+
+#include <maya/MFnDependencyNode.h>
+
+namespace COLLADAMaya
+{
+
+ class HwShaderExporter
+ {
+
+ private:
+
+ /** Pointer to the document exporter */
+ DocumentExporter* mDocumentExporter;
+
+ /** The filename of the current shader to export. */
+ COLLADA::URI mShaderFxFileUri;
+
+ /** The currently used collada effect profile to write the data. */
+ COLLADA::EffectProfile *mEffectProfile;
+
+ public:
+
+ HwShaderExporter ( DocumentExporter* documentExporter ) : mDocumentExporter ( documentExporter ) {}
+
+ virtual ~HwShaderExporter () {}
+
+ /** Export a hardware shader node. */
+ void exportPluginHwShaderNode (
+ const String &effectId,
+ COLLADA::EffectProfile *effectProfile,
+ MObject shadingNetwork );
+
+ private:
+
+ /** Set the filename of the current shader to export. */
+ void setShaderFxFileUri ( const COLLADA::URI& shaderFxFileName );
+
+ /** Returns the filename of the current shader fx file. */
+ const COLLADA::URI& getShaderFxFileUri () const;
+
+ /** Exports the effect data of a cgfxShader node. */
+ void exportCgfxShader ( MFnDependencyNode &fnNode );
+
+ /** Export the effects parameter. */
+ void exportEffectParameters ( CGeffect &cgEffect );
+
+ /** Export the current sampler. */
+ void exportSampler( CGparameter& cgParameter );
+
+ /** Export the current texture element. */
+ void exportTexture(
+ const CGparameter& cgTextureParam,
+ const COLLADA::Surface::SurfaceType& surfaceType );
+
+ /** Returns the type data of the current resource. */
+ void getResourceType(
+ const CGparameter& cgTextureParam,
+ COLLADA::Surface::SurfaceType &surfaceType,
+ COLLADA::Sampler::SamplerType &samplerType,
+ COLLADA::ValueType::ColladaType &samplerValueType );
+
+ /** Export the current sampler state assignments. */
+ void exportSamplerStateAssignments(
+ const CGparameter &cgParameter,
+ CGparameter &cgTextureParam );
+
+ /** Exports the annotation data of the given parameter. */
+ void exportAnnotations ( const CGparameter &cgParameter, COLLADA::ParamBase* param );
+
+ /** Write the current technique and all sub-elements into the current collada document. */
+ void exportTechnique ( const CGtechnique& cgTechnique );
+
+ /** Write the pass data into the collada file. */
+ void exportPass ( CGpass &cgPass );
+
+ /** Export the current pass state. */
+ void exportPassState ( CGstateassignment &cgStateAssignment );
+
+ /** Write the render states parameter. */
+ template <class Type>
+ void exportRenderStateParam ( const String &renderStateName, const Type *values, int valueCount );
+
+ /** Export the shader program data into the collada file. */
+ void exportShaderProgramData ( CGstateassignment& cgStateAssignment, bool readCode=false );
+
+ /** Gernerate the program source string. */
+ String getProgramSourceString( const char* programSourceCG );
+
+ /** Adds a <newparam> of the given attribute to the collada document. */
+ void setNewParam ( const cgfxShaderNode* shaderNodeCgfx, const cgfxAttrDef* attribute );
+
+ /** Adds the <newparam> element of the attributes texture. */
+ void setNewParamTexture(
+ const cgfxAttrDef* attribute,
+ MObject textureNode,
+ COLLADA::Surface::SurfaceType surfaceType,
+ COLLADA::Sampler::SamplerType samplerType,
+ COLLADA::ValueType::ColladaType samplerValueType );
+
+ /** Set the semantic and the annotation to the parameter. */
+ template<class Type>
+ void prepareParam ( Type &newParam, const cgfxAttrDef *attribute );
+
+ };
+}
+
+#endif // __COLLADA_MAYA_HW_SHADER_EXPORTER_H__
View
2 COLLADAMaya/include/COLLADAMayaImageExporter.h
@@ -16,7 +16,7 @@
#ifndef __COLLADA_MAYA_IMAGE_EXPORTER_H__
#define __COLLADA_MAYA_IMAGE_EXPORTER_H__
-#include "COLLADAMayaStableHeaders.h"
+#include "ColladaMayaPrerequisites.h"
#include "COLLADAStreamWriter.h"
#include "COLLADALibraryImages.h"
View
2 COLLADAMaya/include/COLLADAMayaLightExporter.h
@@ -16,7 +16,7 @@
#ifndef __COLLADA_MAYA_LIGHT_EXPORTER_H__
#define __COLLADA_MAYA_LIGHT_EXPORTER_H__
-#include "COLLADAMayaStableHeaders.h"
+#include "ColladaMayaPrerequisites.h"
#include "COLLADAStreamWriter.h"
#include "COLLADALibraryLights.h"
View
35 COLLADAMaya/include/COLLADAMayaMaterialExporter.h
@@ -19,13 +19,19 @@
#include "COLLADAMayaStableHeaders.h"
#include "COLLADAMayaDocumentExporter.h"
#include "COLLADAMayaSceneElement.h"
-#include <map>
#include "COLLADAStreamWriter.h"
#include "COLLADALibraryMaterials.h"
+#include "COLLADASurface.h"
+#include "COLLADASampler.h"
+#include "COLLADAValueType.h"
+
+#include "cgfxAttrDef.h"
#include <maya/MObject.h>
+#include <map>
+
class DocumentExporter;
namespace COLLADAMaya
@@ -66,6 +72,10 @@ namespace COLLADAMaya
/** list already exported materials with the corresponding collada material id*/
std::vector<String> mExportedMaterials;
+ /** The filename of the current shader to export. */
+ COLLADA::URI mShaderFxFileUri;
+
+
public:
/**
@@ -81,6 +91,12 @@ namespace COLLADAMaya
private:
+ /** Set the filename of the current shader to export. */
+ void setShaderFxFileUri ( const COLLADA::URI& shaderFxFileName );
+
+ /** Returns the filename of the current shader fx file. */
+ const COLLADA::URI& getShaderFxFileUri () const;
+
/**
* Get all shaders, which are in the default shader list.
* Unfortunately, you will not get the default initialShadingGroup elements,
@@ -103,6 +119,23 @@ namespace COLLADAMaya
and adds the material into the materials list. */
void exportMaterial ( MObject shadingEngine );
+ /** Exports the data for a custom hardware shader node. */
+ void exportCustomHwShaderNode( COLLADA::InstanceEffect &effectInstance, MObject shader );
+
+ /** Adds the technique hint and the effect attributes to the collada document. */
+ void exportCgfxShaderNode ( COLLADA::InstanceEffect &effectInstance, MFnDependencyNode &fnNode );
+
+ /** Adds a <setparam> of the given attribute to the collada document. */
+ void setSetParam( const cgfxShaderNode* shaderNodeCgfx, const cgfxAttrDef* attribute );
+
+ /** Adds the <setparam> element of the attributes texture. */
+ void setSetParamTexture (
+ const cgfxAttrDef* attribute,
+ MObject textureNode,
+ COLLADA::Surface::SurfaceType surfaceType,
+ COLLADA::Sampler::SamplerType samplerType,
+ COLLADA::ValueType::ColladaType samplerValueType );
+
};
}
View
7 COLLADAMaya/include/COLLADAMayaSyntax.h
@@ -38,14 +38,11 @@ namespace COLLADAMaya
static char* MEL_IMPORT_OPTS = "colladaImporterOpts";
// COLLADA NetAllied Systems
- static const char* COLLADA_PROFILE = "COLLADA";
static const char* TRANSLATOR_VENDOR = "NetAllied Systems GmbH";
static const char* TRANSLATOR_VERSION = "0.8.0";
static const char* TRANSLATOR_MAYA_API_VERSION = "2008";
// COLLADA 1.4 Maya-specific definitions
- static const char* MAYA_PROFILE = "MAYA";
-
static const char* MAYA_TEXTURE_NODETYPE = "dgnode_type";
static const char* MAYA_TEXTURE_FILETEXTURE = "kFile";
static const char* MAYA_TEXTURE_PSDTEXTURE = "kPSDFile";
@@ -213,6 +210,7 @@ namespace COLLADAMaya
static const char* ATTR_COLORSET_POINTS = "clsp";
static const char* ATTR_CONE_ANGLE = "coneAngle";
static const char* ATTR_COSINE_POWER = "cosinePower";
+ static const char* ATTR_DEFAULT_SHADER_LIST1 = "defaultShaderList1";
static const char* ATTR_DOUBLE_SIDED = "doubleSided";
static const char* ATTR_DROP_OFF = "dropoff";
static const char* ATTR_ENVELOPE = "en";
@@ -272,8 +270,9 @@ namespace COLLADAMaya
static const char* ATTR_SCALE_PIVOT_INVERSE = "scalePivotInverse";
static const char* ATTR_SCALE_PIVOT = "scalePivot";
static const char* ATTR_SCALE_PIVOT_TRANSLATION = "scalePivotTranslation";
- static const char* ATTR_SPECULAR_COLOR = "specularColor";
+ static const char* ATTR_SHADERS = "shaders";
static const char* ATTR_SEGMENT_SCALE_COMPENSATE = "ssc";
+ static const char* ATTR_SPECULAR_COLOR = "specularColor";
static const char* ATTR_SURFACE_SHADER = "surfaceShader";
static const char* ATTR_TRANSFORM = "transform";
static const char* ATTR_TRANSLATE = "translate";
View
19 COLLADAMaya/include/COLLADAMayaVisualSceneExporter.h
@@ -134,28 +134,34 @@ namespace COLLADAMaya
* Exports the geometry instances of the given transform scene element.
* @param childElement The transform scene element.
*/
- void exportGeometryInstance( SceneElement* childElement );
+ void exportGeometryInstance( SceneElement* sceneElement );
/**
* Exports the skin controller instances of the given transform scene element.
* @param childElement The transform scene element.
*/
void exportControllerInstance(
SceneElement* childElement,
- bool hasSkinController,
- bool hasMorphController );
+ const bool hasSkinController,
+ const bool hasMorphController );
/**
* Exports the light instances of the given transform scene element.
* @param childElement The transform scene element.
*/
- void exportLightInstance ( SceneElement* childElement );
+ void exportLightInstance ( const SceneElement* childElement );
+
+ /**
+ * Creates the uri for the scene element. Checks for instances
+ * and creates the right element.
+ */
+ COLLADA::URI getSceneElementURI ( const SceneElement* sceneElement, const String& elementId = "" );
/**
* Exports the camera instances of the given transform scene element.
* @param childElement The transform scene element.
*/
- void exportCameraInstance ( SceneElement* childElement );
+ void exportCameraInstance ( const SceneElement* childElement );
/**
* Exports the material instances.
@@ -165,8 +171,7 @@ namespace COLLADAMaya
*/
void exportMaterialList(
COLLADA::InstanceMaterialList &instanceMaterialList,
- MDagPath &childDagPath,
- const uint instanceNumber );
+ const MDagPath &dagPath );
/**
* Initializes the transform objects.
View
382 COLLADAMaya/scripts/COLLADAMaya.vcproj
@@ -10,6 +10,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -38,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;"
+ AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;;..\..\Externals\cgfxShader\include;&quot;$(CG_INC_PATH)&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_AFXDLL;_MBCS;NT_PLUGIN;REQUIRE_IOSTREAM;CM_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -60,9 +63,9 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/subsystem:windows /dll /incremental:yes /debug /machine:I386 /export:initializePlugin /export:uninitializePlugin"
- AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib COLLADAStreamWriter.lib"
+ AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaRender.lib OpenMayaUI.lib COLLADAStreamWriter.lib cgfxShader.lib cg.lib cgGL.lib glut32.lib OpenGL32.lib winmm.lib"
OutputFile="$(OutDir)\$(ProjectName).mll"
- AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;&quot;$(BOOST_ROOT)\lib&quot;;..\..\COLLADAStreamWriter\lib\debug"
+ AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\debug;&quot;$(BOOST_ROOT)\lib&quot;;..\..\Externals\cgfxShader\lib\debug;&quot;$(CG_LIB_PATH)&quot;"
GenerateDebugInformation="true"
/>
<Tool
@@ -93,6 +96,86 @@
/>
</Configuration>
<Configuration
+ Name="DebugPlugin2008|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;;..\..\cgfxShader\include;&quot;$(CG_INC_PATH)&quot;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_AFXDLL;_MBCS;NT_PLUGIN;REQUIRE_IOSTREAM;CM_EXPORTS"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="1"
+ PrecompiledHeaderThrough="ColladaMayaStableHeaders.h"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/subsystem:windows /dll /incremental:yes /debug /machine:I386 /export:initializePlugin /export:uninitializePlugin"
+ AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaRender.lib OpenMayaUI.lib COLLADAStreamWriter.lib cgfxShader.lib cg.lib cgGL.lib glut32.lib OpenGL32.lib winmm.lib"
+ OutputFile="$(OutDir)\$(ProjectName).mll"
+ AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\debug;&quot;$(BOOST_ROOT)\lib&quot;;..\..\cgfxShader\lib\debug;&quot;$(CG_LIB_PATH)&quot;"
+ GenerateDebugInformation="true"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying plugin to Maya install"
+ CommandLine="mkdir ..\bin\$(ConfigurationName) 2&gt; nul&#x0D;&#x0A;copy $(TargetPath) ..\bin\$(ConfigurationName) &gt; nul&#x0D;&#x0A;copy &quot;$(TargetDir)\COLLADAMaya.mll&quot; &quot;%MAYA_PATH2008%\bin\plug-ins&quot;&#x0D;&#x0A;copy &quot;$(ProjectDir)*.mel&quot; &quot;%MAYA_PATH2008%\scripts\others&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
Name="ReleasePlugin2008|Win32"
OutputDirectory="..\obj\$(ConfigurationName)"
IntermediateDirectory="..\obj\$(ConfigurationName)"
@@ -116,7 +199,89 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;"
+ AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;;..\..\Externals\cgfxShader\include;&quot;$(CG_INC_PATH)&quot;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_AFXDLL;_MBCS;NT_PLUGIN;REQUIRE_IOSTREAM;CM_EXPORTS"
+ RuntimeLibrary="2"
+ RuntimeTypeInfo="true"
+ UsePrecompiledHeader="1"
+ PrecompiledHeaderThrough="ColladaMayaStableHeaders.h"
+ WarningLevel="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/subsystem:windows /machine:I386 /export:initializePlugin /export:uninitializePlugin "
+ AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaRender.lib OpenMayaUI.lib COLLADAStreamWriter.lib cgfxShader.lib cg.lib cgGL.lib glut32.lib OpenGL32.lib winmm.lib"
+ OutputFile="$(OutDir)\$(ProjectName).mll"
+ AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\release;&quot;$(BOOST_ROOT)\lib&quot;;..\..\Externals\cgfxShader\lib\release;&quot;$(CG_LIB_PATH)&quot;"
+ IgnoreAllDefaultLibraries="false"
+ OptimizeReferences="1"
+ EnableCOMDATFolding="1"
+ LinkTimeCodeGeneration="1"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="false"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying plugin to Maya install"
+ CommandLine="mkdir ..\bin\$(ConfigurationName) 2&gt; nul&#x0D;&#x0A;copy $(TargetPath) ..\bin\$(ConfigurationName) &gt; nul&#x0D;&#x0A;copy $(TargetPath) &quot;%MAYA_PATH2008%\bin\plug-ins&quot;&#x0D;&#x0A;copy &quot;$(ProjectDir)*.mel&quot; &quot;%MAYA_PATH2008%\scripts\others&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleasePlugin2008|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;;..\..\cgfxShader\include;&quot;$(CG_INC_PATH)&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_AFXDLL;_MBCS;NT_PLUGIN;REQUIRE_IOSTREAM;CM_EXPORTS"
RuntimeLibrary="2"
RuntimeTypeInfo="true"
@@ -136,9 +301,11 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/subsystem:windows /incremental:no /machine:I386 /export:initializePlugin /export:uninitializePlugin /LTCG"
- AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib COLLADAStreamWriter.lib"
+ AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaRender.lib OpenMayaUI.lib COLLADAStreamWriter.lib cgfxShader.lib cg.lib cgGL.lib glut32.lib OpenGL32.lib winmm.lib"
OutputFile="$(OutDir)\$(ProjectName).mll"
- AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\release;&quot;$(BOOST_ROOT)\lib&quot;"
+ AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\debug;&quot;$(BOOST_ROOT)\lib&quot;;..\..\cgfxShader\lib\debug;&quot;$(CG_LIB_PATH)&quot;"
+ IgnoreAllDefaultLibraries="false"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@@ -191,7 +358,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;"
+ AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;;..\..\Externals\cgfxShader\include;&quot;$(CG_INC_PATH)&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WINDOWS;_AFXDLL;_MBCS;NT_PLUGIN;REQUIRE_IOSTREAM;CM_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -212,11 +379,91 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib COLLADAStreamWriter.lib"
+ AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaRender.lib OpenMayaUI.lib COLLADAStreamWriter.lib cgfxShader.lib cg.lib cgGL.lib glut32.lib OpenGL32.lib winmm.lib"
+ OutputFile="$(OutDir)\$(ProjectName).exe"
+ AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\debug;&quot;$(BOOST_ROOT)\lib&quot;;..\..\Externals\cgfxShader\lib\debug;&quot;$(CG_LIB_PATH)&quot;"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying console application into the testsuite"
+ CommandLine="mkdir ..\bin\$(ConfigurationName) 2&gt; nul&#x0D;&#x0A;copy $(TargetPath) ..\bin\$(ConfigurationName) &gt; nul&#x0D;&#x0A;copy $(TargetPath) ..\testsuite &gt; nul&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="DebugConsole2008|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;;..\..\cgfxShader\include;&quot;$(CG_INC_PATH)&quot;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WINDOWS;_AFXDLL;_MBCS;NT_PLUGIN;REQUIRE_IOSTREAM;CM_EXPORTS"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="1"
+ PrecompiledHeaderThrough="ColladaMayaStableHeaders.h"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaRender.lib OpenMayaUI.lib COLLADAStreamWriter.lib cgfxShader.lib cg.lib cgGL.lib glut32.lib OpenGL32.lib winmm.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
- AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\debug;&quot;$(BOOST_ROOT)\lib&quot;"
+ AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\debug;&quot;$(BOOST_ROOT)\lib&quot;;..\..\cgfxShader\lib\debug;&quot;$(CG_LIB_PATH)&quot;"
GenerateDebugInformation="true"
SubSystem="1"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@@ -269,7 +516,89 @@
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;"
+ AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;;..\..\Externals\cgfxShader\include;&quot;$(CG_INC_PATH)&quot;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_AFXDLL;_MBCS;NT_PLUGIN;REQUIRE_IOSTREAM;CM_EXPORTS"
+ RuntimeLibrary="2"
+ RuntimeTypeInfo="true"
+ UsePrecompiledHeader="1"
+ PrecompiledHeaderThrough="ColladaMayaStableHeaders.h"
+ WarningLevel="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaRender.lib OpenMayaUI.lib COLLADAStreamWriter.lib cgfxShader.lib cg.lib cgGL.lib glut32.lib OpenGL32.lib winmm.lib"
+ OutputFile="$(OutDir)\$(ProjectName).exe"
+ AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\release;&quot;$(BOOST_ROOT)\lib&quot;;..\..\Externals\cgfxShader\lib\release;&quot;$(CG_LIB_PATH)&quot;"
+ IgnoreAllDefaultLibraries="false"
+ IgnoreDefaultLibraryNames=""
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ LinkTimeCodeGeneration="1"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="false"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ Description="Copying console application into the testsuite"
+ CommandLine="mkdir ..\bin\$(ConfigurationName) 2&gt; nul&#x0D;&#x0A;copy $(TargetPath) ..\bin\$(ConfigurationName) &gt; nul&#x0D;&#x0A;copy $(TargetPath) ..\testsuite &gt; nul&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="ReleaseConsole2008|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ AdditionalIncludeDirectories="..\include;&quot;$(MAYA_PATH2008)\include&quot;;..\..\COLLADAStreamWriter\include;&quot;$(BOOST_ROOT)&quot;;..\..\cgfxShader\include;&quot;$(CG_INC_PATH)&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_AFXDLL;_MBCS;NT_PLUGIN;REQUIRE_IOSTREAM;CM_EXPORTS"
RuntimeLibrary="2"
RuntimeTypeInfo="true"
@@ -288,9 +617,14 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib COLLADAStreamWriter.lib"
+ AdditionalDependencies="Foundation.lib OpenMaya.lib OpenMayaAnim.lib OpenMayaRender.lib OpenMayaUI.lib COLLADAStreamWriter.lib cgfxShader.lib cg.lib cgGL.lib glut32.lib OpenGL32.lib winmm.lib"
OutputFile="$(OutDir)\$(ProjectName).exe"
- AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\release;&quot;$(BOOST_ROOT)\lib&quot;"
+ AdditionalLibraryDirectories="&quot;$(MAYA_PATH2008)\lib&quot;;..\..\COLLADAStreamWriter\lib\debug;&quot;$(BOOST_ROOT)\lib&quot;;..\..\cgfxShader\lib\debug;&quot;$(CG_LIB_PATH)&quot;"
+ IgnoreAllDefaultLibraries="false"
+ IgnoreDefaultLibraryNames=""
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
@@ -342,13 +676,29 @@
/>
</FileConfiguration>
<FileConfiguration
+ Name="ReleasePlugin2008|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
Name="ReleaseConsole2008|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="ReleaseConsole2008|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\src\COLLADAMayaReferenceManager.cpp"
@@ -455,6 +805,10 @@
>
</File>
<File
+ RelativePath="..\src\COLLADAMayaHwShaderExporter.cpp"
+ >
+ </File>
+ <File
RelativePath="..\src\COLLADAMayaImageExporter.cpp"
>
</File>
@@ -664,6 +1018,10 @@
>
</File>
<File
+ RelativePath="..\include\COLLADAMayaHwShaderExporter.h"
+ >
+ </File>
+ <File
RelativePath="..\include\COLLADAMayaImageExporter.h"
>
</File>
View
3 COLLADAMaya/src/COLLADAMayaAnimationClipExporter.cpp
@@ -18,7 +18,7 @@
namespace COLLADAMaya
{
-
+
//---------------------------------------------------------------
AnimationClipExporter::AnimationClipExporter ( COLLADA::StreamWriter* _streamWriter )
: COLLADA::LibraryAnimationClips ( _streamWriter )
@@ -28,7 +28,6 @@ namespace COLLADAMaya
void AnimationClipExporter::exportAnimationClips ( const AnimationClipList* animationClips )
{
AnimationClipList::const_iterator clipIter = animationClips->begin();
-
for ( ; clipIter!= animationClips->end(); ++clipIter )
{
AnimationClip* animationClip = *clipIter;
View
6 COLLADAMaya/src/COLLADAMayaAnimationElement.cpp
@@ -81,7 +81,10 @@ namespace COLLADAMaya
// return 0;
// }
- if ( ( mSampleType & kMatrix ) == kMatrix )
+ if ( ( mSampleType & kBoolean ) == kBoolean )
+ return 1;
+
+ else if ( ( mSampleType & kMatrix ) == kMatrix )
return 16;
else if ( ( mSampleType & kColour ) == kColour )
@@ -91,7 +94,6 @@ namespace COLLADAMaya
return 3;
else if ( ( ( mSampleType & kSingle ) == kSingle ) ||
- ( ( mSampleType & kBoolean ) == kBoolean ) ||
( ( mSampleType & kAngle ) == kAngle ) ||
( ( mSampleType & kQualifiedAngle ) == kQualifiedAngle ) )
return 1;
View
17 COLLADAMaya/src/COLLADAMayaAnimationExporter.cpp
@@ -949,7 +949,7 @@ namespace COLLADAMaya
// Export the infinity parameters
COLLADA::StreamWriter* streamWriter = mDocumentExporter->getStreamWriter();
COLLADA::Technique techniqueSource ( streamWriter );
- techniqueSource.openTechnique ( MAYA_PROFILE );
+ techniqueSource.openTechnique ( COLLADA::CSWC::COLLADA_PROFILE_MAYA );
techniqueSource.addParameter ( MAYA_PREINFINITY_PARAMETER, preInfinityType );
techniqueSource.addParameter ( MAYA_POSTINFINITY_PARAMETER, postInfinityType );
techniqueSource.closeTechnique();
@@ -958,10 +958,11 @@ namespace COLLADAMaya
}
//---------------------------------------------------------------
- void AnimationExporter::writeOutputSource ( const String sourceId,
- const String* parameters,
- const uint dimension,
- const std::vector<float> &values )
+ void AnimationExporter::writeOutputSource (
+ const String sourceId,
+ const String* parameters,
+ const uint dimension,
+ const std::vector<float> &values )
{
// Just export if there are values
uint size = values.size();
@@ -977,22 +978,22 @@ namespace COLLADAMaya
if ( dimension != 16 && dimension != 32 )
{
// It's a float source.
- source.setParameterTypeName ( &COLLADA::CSWC::COLLADA_PARAM_TYPE_FLOAT );
+ source.setParameterTypeName ( &COLLADA::CSWC::COLLADA_VALUE_TYPE_FLOAT );
for ( uint i=0; i<dimension; ++i )
source.getParameterNameList().push_back ( * ( parameters + i ) );
}
else if ( dimension == 16 )
{
// It's a matrix source.
- source.setParameterTypeName ( &COLLADA::CSWC::COLLADA_PARAM_TYPE_FLOAT4x4 );
+ source.setParameterTypeName ( &COLLADA::CSWC::COLLADA_VALUE_TYPE_FLOAT4x4 );
source.getParameterNameList().push_back ( PARAM_TYPE_TRANSFORM ); // That's the "TRANSFORM" parameter
}
else if ( dimension == 32 )
{
// It's a matrix source.
- source.setParameterTypeName ( &COLLADA::CSWC::COLLADA_PARAM_TYPE_FLOAT4x4 );
+ source.setParameterTypeName ( &COLLADA::CSWC::COLLADA_VALUE_TYPE_FLOAT4x4 );
source.getParameterNameList().push_back ( PARAM_TYPE_X_Y ); // That's the "X_Y" parameter
}
View
22 COLLADAMaya/src/COLLADAMayaCameraExporter.cpp
@@ -60,12 +60,18 @@ namespace COLLADAMaya
//---------------------------------------------------------------
void CameraExporter::exportCameras ( SceneElement* sceneElement )
{
+ // If we have a external reference, we don't need to export the data here.
+ if ( !sceneElement->getIsLocal() ) return;
+
// Get the current dag path
MDagPath dagPath = sceneElement->getPath();
+ // Check for instance
+ bool isInstance = ( dagPath.isInstanced() && dagPath.instanceNumber() > 0 );
+
// Check if it is a camera and an export node
if ( sceneElement->getType() == SceneElement::CAMERA &&
- sceneElement->getIsExportNode() )
+ sceneElement->getIsExportNode() && !isInstance )
{
// Export the geometry
bool exported = exportCamera ( dagPath );
@@ -169,36 +175,36 @@ namespace COLLADAMaya
animated = anim->addNodeAnimation( cameraFn.object(), VERTICAL_APERTURE_SID, ATTR_VERTICAL_FILM_APERTURE,
kSingle | kLength, EMPTY_PARAMETER, -1, false, new ConversionScaleFunctor(2.54f) );
paramSid = ""; if ( animated ) paramSid = VERTICAL_APERTURE_SID;
- camera.addExtraTechniqueParameter( MAYA_PROFILE, MAYA_VAPERTURE_PARAMETER, vAperture, paramSid );
+ camera.addExtraTechniqueParameter( COLLADA::CSWC::COLLADA_PROFILE_MAYA, MAYA_VAPERTURE_PARAMETER, vAperture, paramSid );
double hAperture = cameraFn.horizontalFilmAperture ( &status ) * 2.54f; CHECK_MSTATUS(status);
animated = anim->addNodeAnimation( cameraFn.object(), HORIZONTAL_APERTURE_SID, ATTR_HORIZONTAL_FILM_APERTURE,
kSingle | kLength, EMPTY_PARAMETER, -1, false, new ConversionScaleFunctor(2.54f) );
paramSid = ""; if ( animated ) paramSid = HORIZONTAL_APERTURE_SID;
- camera.addExtraTechniqueParameter( MAYA_PROFILE, MAYA_HAPERTURE_PARAMETER, hAperture, paramSid );
+ camera.addExtraTechniqueParameter( COLLADA::CSWC::COLLADA_PROFILE_MAYA, MAYA_HAPERTURE_PARAMETER, hAperture, paramSid );
double lensSqueeze = cameraFn.lensSqueezeRatio ( &status ); CHECK_MSTATUS(status);
animated = anim->addNodeAnimation( cameraFn.object(), LENS_SQUEEZE_SID, ATTR_LENS_SQUEEZE_RATIO, kSingle );
paramSid = ""; if ( animated ) paramSid = LENS_SQUEEZE_SID;
- camera.addExtraTechniqueParameter( MAYA_PROFILE, MAYA_LENS_SQUEEZE_PARAMETER, lensSqueeze, paramSid );
+ camera.addExtraTechniqueParameter( COLLADA::CSWC::COLLADA_PROFILE_MAYA, MAYA_LENS_SQUEEZE_PARAMETER, lensSqueeze, paramSid );
int filmFit = cameraFn.filmFit ( &status ); CHECK_MSTATUS(status);
- camera.addExtraTechniqueParameter( MAYA_PROFILE, MAYA_FILM_FIT_PARAMETER, filmFit );
+ camera.addExtraTechniqueParameter( COLLADA::CSWC::COLLADA_PROFILE_MAYA, MAYA_FILM_FIT_PARAMETER, filmFit );
double filmFitOffset = cameraFn.filmFitOffset ();
animated = anim->addNodeAnimation( cameraFn.object(), FILM_FIT_OFFSET_SID, ATTR_FILM_FIT_OFFSET, kSingle );
paramSid = ""; if ( animated ) paramSid = FILM_FIT_OFFSET_SID;
- camera.addExtraTechniqueParameter( MAYA_PROFILE, MAYA_FILM_FIT_OFFSET_PARAMETER, filmFitOffset, paramSid );
+ camera.addExtraTechniqueParameter( COLLADA::CSWC::COLLADA_PROFILE_MAYA, MAYA_FILM_FIT_OFFSET_PARAMETER, filmFitOffset, paramSid );
double filmOffsetX = cameraFn.horizontalFilmOffset ();
animated = anim->addNodeAnimation( cameraFn.object(), HORIZONTAL_FILM_OFFSET_SID, ATTR_HORIZONTAL_FILM_OFFSET, kSingle, XYZ_PARAMETERS );
paramSid = ""; if ( animated ) paramSid = HORIZONTAL_FILM_OFFSET_SID;
- camera.addExtraTechniqueParameter( MAYA_PROFILE, MAYA_FILM_OFFSET_X_PARAMETER, filmOffsetX, paramSid );
+ camera.addExtraTechniqueParameter( COLLADA::CSWC::COLLADA_PROFILE_MAYA, MAYA_FILM_OFFSET_X_PARAMETER, filmOffsetX, paramSid );
double filmOffsetY = cameraFn.verticalFilmOffset ();
animated = anim->addNodeAnimation( cameraFn.object(), VERTICAL_FILM_OFFSET_SID, ATTR_FILM_FIT_OFFSET, kSingle, XYZ_PARAMETERS );
paramSid = ""; if ( animated ) paramSid = VERTICAL_FILM_OFFSET_SID;
- camera.addExtraTechniqueParameter( MAYA_PROFILE, MAYA_FILM_OFFSET_Y_PARAMETER, filmOffsetY, paramSid );
+ camera.addExtraTechniqueParameter( COLLADA::CSWC::COLLADA_PROFILE_MAYA, MAYA_FILM_OFFSET_Y_PARAMETER, filmOffsetY, paramSid );
// Write the camera data in the collada document.
addCamera ( camera );
View
12 COLLADAMaya/src/COLLADAMayaControllerExporter.cpp
@@ -83,12 +83,18 @@ namespace COLLADAMaya
//------------------------------------------------------
void ControllerExporter::exportControllers( SceneElement* sceneElement )
{
+ // If we have a external reference, we don't need to export the data here.
+ if ( !sceneElement->getIsLocal() ) return;
+
// Get the current dag path
MDagPath dagPath = sceneElement->getPath();
+ // Check for instance
+ bool isInstance = ( dagPath.isInstanced() && dagPath.instanceNumber() > 0 );
+
// Check if it is a mesh and an export node
if ( sceneElement->getType() == SceneElement::MESH &&
- sceneElement->getIsExportNode() )
+ sceneElement->getIsExportNode() && !isInstance )
{
// Create a skin/morph transform object and export the controller.
bool exported = exportController ( sceneElement );
@@ -105,8 +111,10 @@ namespace COLLADAMaya
//------------------------------------------------------
bool ControllerExporter::exportController( SceneElement* sceneElement )
{
- // Get the current mesh node.
MDagPath dagPath = sceneElement->getPath();
+ if ( dagPath.isInstanced() && dagPath.instanceNumber() > 0 ) return false;
+
+ // Get the current mesh node.
MObject meshNode = dagPath.node();
// The stacks of the controllers for the affected nodes.
View
10 COLLADAMaya/src/COLLADAMayaDagHelper.cpp
@@ -763,18 +763,18 @@ namespace COLLADAMaya
const MObject& node,
const String attributeName,
MStringArray& output,
- MStatus* ReturnStatus )
+ MStatus* status )
{
- MPlug plug = MFnDependencyNode ( node ).findPlug ( attributeName.c_str(), ReturnStatus );
- getPlugValue ( plug, output, ReturnStatus );
+ MPlug plug = MFnDependencyNode ( node ).findPlug ( attributeName.c_str(), status );
+ getPlugValue ( plug, output, status );
}
//---------------------------------------------------
- void DagHelper::getPlugValue ( const MPlug& plug, MStringArray& output, MStatus* ReturnStatus )
+ void DagHelper::getPlugValue ( const MPlug& plug, MStringArray& output, MStatus* status )
{
MObject str_obj;
plug.getValue ( str_obj );
- MFnStringArrayData f_astr ( str_obj, ReturnStatus );
+ MFnStringArrayData f_astr ( str_obj, status );
unsigned int len = f_astr.length();
for ( unsigned int i = 0; i < len; ++i )
{
View
323 COLLADAMaya/src/COLLADAMayaEffectExporter.cpp
@@ -20,6 +20,12 @@
#include "COLLADAMayaDagHelper.h"
#include "COLLADAMayaShaderHelper.h"
#include "COLLADAMayaSyntax.h"
+#include "COLLADAMayaHwShaderExporter.h"
+
+#include "COLLADAUtils.h"
+#include "COLLADANode.h"
+#include "COLLADAEffectProfile.h"
+#include "COLLADAExtraTechnique.h"
#include <assert.h>
@@ -33,11 +39,6 @@
#include <maya/MPxHwShaderNode.h>
#endif // _MPxHwShaderNode
-#include "COLLADANode.h"
-#include "COLLADAUtils.h"
-#include "COLLADAEffectProfile.h"
-#include "COLLADAExtraTechnique.h"
-
namespace COLLADAMaya
{
@@ -103,11 +104,15 @@ namespace COLLADAMaya
//------------------------------------------------------
void EffectExporter::exportMeshEffects ( SceneElement* sceneElement )
{
+ // If we have a external reference, we don't need to export the data here.
+ if ( !sceneElement->getIsLocal() ) return;
+
+ // Get the current path
const MDagPath dagPath = sceneElement->getPath();
// Check if it is a mesh and an export node
if ( sceneElement->getType() == SceneElement::MESH &&
- sceneElement->getIsExportNode() )
+ sceneElement->getIsExportNode() )
{
MStatus status;
MFnMesh fnMesh ( dagPath.node(), &status );
@@ -124,7 +129,6 @@ namespace COLLADAMaya
// Find the polygons that correspond to each materials and export them
uint realShaderCount = ( uint ) shaders.length();
uint numShaders = ( uint ) max ( ( size_t ) 1, ( size_t ) shaders.length() );
-
for ( uint shaderPosition = 0; shaderPosition < numShaders; ++shaderPosition )
{
if ( shaderPosition < realShaderCount )
@@ -205,8 +209,10 @@ namespace COLLADAMaya
else if ( shader.hasFn ( MFn::kPluginHwShaderNode ) )
{
// TODO
- // exportColladaFXShader(&effectProfile, shader, colladaMaterial);
- MGlobal::displayError("Export of HwShaderNode not implemented!");
+// exportStandardShader ( effectId, &effectProfile, shader );
+
+ exportHwShaderNode ( effectId, &effectProfile, shader );
+ //MGlobal::displayError("Export of HwShaderNode not implemented!");
}
// Custom hardware shaders derived from MPxHwShaderNode (the old stuff)
else if ( shader.hasFn ( MFn::kPluginHardwareShader ) )
@@ -222,13 +228,20 @@ namespace COLLADAMaya
exportConstantShader ( effectId, &effectProfile, shader );
}
- // Writes the current effect profile into the collada document
- addEffectProfile ( effectProfile );
-
// Closes the current effect tag
closeEffect();
}
+ // ---------------------------------
+ void EffectExporter::exportHwShaderNode (
+ const String &effectId,
+ COLLADA::EffectProfile *effectProfile,
+ MObject shaderNode )
+ {
+ HwShaderExporter hwShaderExporter ( mDocumentExporter );
+ hwShaderExporter.exportPluginHwShaderNode ( effectId, effectProfile, shaderNode );
+ }
+
//------------------------------------------------------
void EffectExporter::exportConstantShader (
const String &effectId,
@@ -267,6 +280,12 @@ namespace COLLADAMaya
DagHelper::getPlugValue ( shadingNetwork, ATTR_OUT_TRANSPARENCY, transparentColor );
exportTransparency ( effectId, effectProfile, shadingNetwork, transparentColor,
ATTR_OUT_TRANSPARENCY, nextTextureIndex );
+
+ // Writes the current effect profile into the collada document
+ effectProfile->openProfile ();
+ effectProfile->addProfileElements ();
+ effectProfile->closeProfile ();
+
}
//------------------------------------------------------
@@ -395,6 +414,11 @@ namespace COLLADAMaya
effectProfile->setShininess ( blinnFn.eccentricity(), animated );
#endif // BLINN_EXPONENT_MODEL
}
+
+ // Writes the current effect profile into the collada document
+ effectProfile->openProfile ();
+ effectProfile->addProfileElements ();
+ effectProfile->closeProfile ();
}
@@ -480,9 +504,9 @@ namespace COLLADAMaya
{
// Set the profile name and the child element name to the texture.
// Then we can add it as the extra technique texture.
- colladaTexture.setProfileName( COLLADA_PROFILE );
+ colladaTexture.setProfileName( COLLADA::CSWC::COLLADA_PROFILE_COLLADA );
colladaTexture.setChildElementName( MAYA_BUMP_PARAMETER );
- effectProfile->setExtraTechniqueColorOrTexture( COLLADA::ColorOrTexture(colladaTexture), MAYA_BUMP_PARAMETER );
+ effectProfile->setExtraTechniqueColorOrTexture( COLLADA::ColorOrTexture ( colladaTexture ), MAYA_BUMP_PARAMETER );
break;
}
case DIFFUSE:
@@ -516,10 +540,11 @@ namespace COLLADAMaya
//---------------------------------------------------------------
// Retrieve any texture (file or layered) associated with a material attribute
//
- void EffectExporter::getShaderTextures ( const MObject& shader,
- const char* attributeName,
- MObjectArray& textures,
- MIntArray& blendModes )
+ void EffectExporter::getShaderTextures (
+ const MObject& shader,
+ const char* attributeName,
+ MObjectArray& textures,
+ MIntArray& blendModes )
{
MObject texture = DagHelper::getSourceNodeConnectedTo ( shader, attributeName );
@@ -547,7 +572,6 @@ namespace COLLADAMaya
textures.append ( texture );
blendModes.append ( 0 ); // 0 -> No blending
}
-
else if ( isLayeredTexture )
{
ShaderHelper::getLayeredTextures ( texture, textures, blendModes );
@@ -572,7 +596,7 @@ namespace COLLADAMaya
//---------------------------------------------------------------
COLLADA::ColorOrTexture EffectExporter::mayaColor2ColorOrTexture ( const MColor &color, double scale )
{
- return COLLADA::ColorOrTexture ( COLLADA::Color ( color.r * scale, color.g * scale, color.b * scale, scale ) );
+ return COLLADA::ColorOrTexture ( COLLADA::Color ( color.r * scale, color.g * scale, color.b * scale, color.a ) );
}
//---------------------------------------------------------------
@@ -662,263 +686,4 @@ namespace COLLADAMaya
}
}
- //---------------------------------------------------------------
- // Export ColladaFX shader
- void EffectExporter::exportColladaFXShader ( COLLADA::EffectProfile* effectProfile,
- MObject shadingNetwork
- /*FCDMaterial* instance*/ )
- {
- // FCDEffect* effect = colladaDocument->GetEffectLibrary()->AddEntity();
- MFnDependencyNode nodeFn ( shadingNetwork );
- /*
- CFXShaderNode* fxShader = (CFXShaderNode*) nodeFn.userNode();
-
- // Retrieve the ColladaFX shader node and force its loading.
- CFXShaderNode* colladaFxNode = (CFXShaderNode*) nodeFn.userNode();
- if (colladaFxNode == NULL) return effect;
- if (!colladaFxNode->IsLoaded()) colladaFxNode->forceLoad();
-
- FCDEffectProfileFX* profile = (FCDEffectProfileFX*) effect->AddProfile(FUDaeProfileType::CG);
-
- // export effect parameters
- ExportNewParameters(profile, shadingNetwork, instance);
-
- // add effect technique node
- FCDEffectTechnique* technique = profile->AddTechnique();
- technique->SetName(fxShader->getTechniqueName());
- FCDEffectPass* pass = technique->AddPass();
- pass->SetPassName(fxShader->getPassName());
- ExportPass(profile, pass, shadingNetwork, instance);
-
- // Export a <technique_hint>.
- FCDMaterialTechniqueHint hint;
- hint.platform = FC("PC-OGL");
- hint.technique = TO_STRING(fxShader->getTechniqueName());
- instance->GetTechniqueHints().push_back(hint);
- */
- }
-
-
- /*
- void DaeMaterialLibrary::ExportPass(FCDEffectProfileFX* profile, FCDEffectPass* pass, MObject shaderObj, FCDMaterial* instance)
- {
- profile->SetPlatform(FC("PC-OGL"));
-
- // Retrieve the ColladaFX shader node and make sure it is loaded.
- MFnDependencyNode shaderFn(shaderObj);
- CFXShaderNode* pNode = (CFXShaderNode*)shaderFn.userNode();
- if (pNode == NULL) return;
- if (!pNode->IsLoaded()) pNode->forceLoad();
-
- pass->SetPassName(MConvert::ToFChar(doc->MayaNameToColladaName(shaderFn.name())));
- FCDEffectPassShader* vertexShader = pass->AddVertexShader();
- FCDEffectPassShader* fragmentShader = pass->AddFragmentShader();
-
- vertexShader->SetName(pNode->getVertexEntry());
- fragmentShader->SetName(pNode->getFragmentEntry());
-
- MString f_strM;
- DagHelper::GetPlugValue(shaderObj, "vertexProgram", f_strM);
- FCDEffectCode* vCode = profile->AddCode();
- vCode->SetFilename(MConvert::ToFChar(f_strM));
- vertexShader->SetCode(vCode);
-
- DagHelper::GetPlugValue(shaderObj, "fragmentProgram", f_strM);
- vCode = profile->AddCode();
- vCode->SetFilename(MConvert::ToFChar(f_strM));
- fragmentShader->SetCode(vCode);
-
- ExportProgramBinding(vertexShader, MString("vertParam"), shaderFn);
- ExportProgramBinding(fragmentShader, MString("fragParam"), shaderFn);
-
- // Export the pass render states.
- for (CFXRenderStateList::iterator it = pNode->GetRenderStates().begin(); it != pNode->GetRenderStates().end(); ++it)
- {
- const FCDEffectPassState* fxState = (*it)->GetData();
- FCDEffectPassState* colladaState = pass->AddRenderState(fxState->GetType());
- fxState->Clone(colladaState);
- }
- }
- */
-
- /*
- void DaeMaterialLibrary::ExportNewParameters(FCDEffectProfileFX* profile, const MObject& shader, FCDMaterial* instance)
- {
- MFnDependencyNode shaderFn(shader);
- CFXShaderNode* pNode = (CFXShaderNode*)shaderFn.userNode();
- CFXParameterList& parameters = pNode->GetParameters();
- size_t parameterCount = parameters.size();
- for (size_t i = 0; i < parameterCount; ++i)
- {
- CFXParameter* attrib = parameters[i];
- fm::String reference = (shaderFn.name() + attrib->getName()).asChar();
-
- switch (attrib->getType())
- {
- case CFXParameter::kBool: {
- bool bval;
- DagHelper::GetPlugValue(attrib->getPlug(), bval);
-
- FCDEffectParameterBool* parameter = (FCDEffectParameterBool*) profile->AddEffectParameter(FCDEffectParameter::BOOLEAN);
- parameter->SetGenerator();
- parameter->SetSemantic(attrib->getSemanticStringForFXC());
- parameter->SetValue(bval);
- parameter->SetReference(reference);
- parameter->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UINAME), FCDEffectParameter::STRING, attrib->getName());
-
- parameter = (FCDEffectParameterBool*) instance->AddEffectParameter(FCDEffectParameter::BOOLEAN);
- parameter->SetModifier();
- parameter->SetReference(reference);
- parameter->SetValue(bval);
- break; }
-
- case CFXParameter::kHalf:
- case CFXParameter::kFloat: {
- FCDEffectParameterFloat* parameter = (FCDEffectParameterFloat*) profile->AddEffectParameter(FCDEffectParameter::FLOAT);
- parameter->SetGenerator();
- parameter->SetSemantic(attrib->getSemanticStringForFXC());
- parameter->SetValue(attrib->getFloatValue());
- parameter->SetReference(reference);
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat ? FCDEffectParameterFloat::FLOAT : FCDEffectParameterFloat::HALF);
-
- MFnNumericAttribute fnum(attrib->getAttribute());
- double fmin, fmax;
- fnum.getMin(fmin);
- fnum.getMax(fmax);
-
- parameter->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UINAME), FCDEffectParameter::STRING, attrib->getName());
- parameter->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UIMIN), FCDEffectParameter::FLOAT, (float)fmin);
- parameter->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UIMAX), FCDEffectParameter::FLOAT, (float)fmax);
-
- if (attrib->getSemantic() != CFXParameter::kTIME)
- {
- FCDAnimated* animated = parameter->GetValue().GetAnimated();
- ANIM->AddPlugAnimation(shader, attrib->getAttributeName(), animated, kSingle);
- }
-
- parameter = (FCDEffectParameterFloat*) instance->AddEffectParameter(FCDEffectParameter::FLOAT);
- parameter->SetModifier();
- parameter->SetValue(attrib->getFloatValue());
- parameter->SetReference(reference);
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat ? FCDEffectParameterFloat::FLOAT : FCDEffectParameterFloat::HALF);
- break; }
-
- case CFXParameter::kFloat2:
- case CFXParameter::kHalf2: {
- FCDEffectParameterFloat2* parameter = (FCDEffectParameterFloat2*) profile->AddEffectParameter(FCDEffectParameter::FLOAT2);
- parameter->SetGenerator();
- parameter->SetSemantic(attrib->getSemanticStringForFXC());
- parameter->SetValue(FMVector2(attrib->getFloatValueX(), attrib->getFloatValueY()));
- parameter->SetReference(reference);
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat2 ? FCDEffectParameterFloat2::FLOAT : FCDEffectParameterFloat2::HALF);
-
- parameter->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UINAME), FCDEffectParameter::STRING, attrib->getName());
-
- parameter = (FCDEffectParameterFloat2*) instance->AddEffectParameter(FCDEffectParameter::FLOAT2);
- parameter->SetModifier();
- parameter->SetValue(FMVector2(attrib->getFloatValueX(), attrib->getFloatValueY()));
- parameter->SetReference(reference);
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat2 ? FCDEffectParameterFloat2::FLOAT : FCDEffectParameterFloat2::HALF);
- break; }
-
- case CFXParameter::kHalf3:
- case CFXParameter::kFloat3: {
- FCDEffectParameterFloat3* parameter = (FCDEffectParameterFloat3*) profile->AddEffectParameter(FCDEffectParameter::FLOAT3);
- parameter->SetGenerator();
- parameter->SetSemantic(attrib->getSemanticStringForFXC());
- parameter->SetValue(FMVector3(attrib->getFloatValueX(), attrib->getFloatValueY(), attrib->getFloatValueZ()));
- parameter->SetReference(reference);
-
- parameter->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UINAME), FCDEffectParameter::STRING, attrib->getName());
- fstring s = TO_FSTRING(attrib->getUIType().asChar());
- parameter->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UITYPE), FCDEffectParameter::STRING, s.c_str());
-
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat3 ? FCDEffectParameterFloat3::FLOAT : FCDEffectParameterFloat3::HALF);
-
- ANIM->AddPlugAnimation(shader, attrib->getAttributeName(), parameter->GetValue().GetAnimated(), kColour);
-
- parameter = (FCDEffectParameterFloat3*) instance->AddEffectParameter(FCDEffectParameter::FLOAT3);
- parameter->SetModifier();
- parameter->SetValue(FMVector3(attrib->getFloatValueX(), attrib->getFloatValueY(), attrib->getFloatValueZ()));
- parameter->SetReference(reference);
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat3 ? FCDEffectParameterFloat3::FLOAT : FCDEffectParameterFloat3::HALF);
- break; }
-
- case CFXParameter::kFloat4:
- case CFXParameter::kHalf4: {
- FCDEffectParameterVector* parameter = (FCDEffectParameterVector*) profile->AddEffectParameter(FCDEffectParameter::VECTOR);
- parameter->SetGenerator();
- parameter->SetSemantic(attrib->getSemanticStringForFXC());
- parameter->SetValue(FMVector4(attrib->getFloatValueX(), attrib->getFloatValueY(), attrib->getFloatValueZ(), 0.0f));
- parameter->SetReference(reference);
-
- parameter->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UINAME), FCDEffectParameter::STRING, attrib->getName());
- fstring s = TO_FSTRING(attrib->getUIType().asChar());
- parameter->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UITYPE), FCDEffectParameter::STRING, s.c_str());
-
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat4 ? FCDEffectParameterVector::FLOAT : FCDEffectParameterVector::HALF);
-
- ANIM->AddPlugAnimation(shader, attrib->getAttributeName(), parameter->GetValue().GetAnimated(), kColour);
-
- parameter = (FCDEffectParameterVector*) instance->AddEffectParameter(FCDEffectParameter::VECTOR);
- parameter->SetModifier();
- parameter->SetValue(FMVector4(attrib->getFloatValueX(), attrib->getFloatValueY(), attrib->getFloatValueZ(), 0.0f));
- parameter->SetReference(reference);
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat4 ? FCDEffectParameterVector::FLOAT : FCDEffectParameterVector::HALF);
- break; }
-
- case CFXParameter::kHalf4x4:
- case CFXParameter::kFloat4x4: {
- FCDEffectParameterMatrix* parameter = (FCDEffectParameterMatrix*) profile->AddEffectParameter(FCDEffectParameter::MATRIX);
- parameter->SetGenerator();
- parameter->SetSemantic(attrib->getSemanticStringForFXC());
- parameter->SetValue(FMMatrix44::Identity);
- parameter->SetReference(reference);
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat4x4 ? FCDEffectParameterMatrix::FLOAT : FCDEffectParameterMatrix::HALF);
-
- parameter = (FCDEffectParameterMatrix*) instance->AddEffectParameter(FCDEffectParameter::MATRIX);
- parameter->SetModifier();
- parameter->SetValue(FMMatrix44::Identity);
- parameter->SetReference(reference);
- parameter->SetFloatType(attrib->getType() == CFXParameter::kFloat4x4 ? FCDEffectParameterMatrix::FLOAT : FCDEffectParameterMatrix::HALF);
- break; }
-
- case CFXParameter::kSampler2D:
- case CFXParameter::kSamplerCUBE:
- {
- MPlug tex_plug;
- if (DagHelper::GetPlugConnectedTo(attrib->getPlug(), tex_plug))
- {
- FCDEffectParameterSampler* parameter1 = (FCDEffectParameterSampler*) profile->AddEffectParameter(FCDEffectParameter::SAMPLER);
- parameter1->SetGenerator();
- parameter1->SetSemantic(attrib->getSemanticStringForFXC());
- parameter1->SetReference(reference);
- parameter1->AddAnnotation(TO_FSTRING(CFX_ANNOTATION_UINAME), FCDEffectParameter::STRING, attrib->getName());
- parameter1->SetSamplerType(attrib->getType() == CFXParameter::kSampler2D ? FCDEffectParameterSampler::SAMPLER2D : FCDEffectParameterSampler::SAMPLERCUBE);
-
- FCDEffectParameterSampler* parameter2 = (FCDEffectParameterSampler*) instance->AddEffectParameter(FCDEffectParameter::SAMPLER);
- parameter2->SetModifier();
- parameter2->SetReference(reference);
- parameter2->SetSamplerType(attrib->getType() == CFXParameter::kSampler2D ? FCDEffectParameterSampler::SAMPLER2D : FCDEffectParameterSampler::SAMPLERCUBE);
-
- const char* type = attrib->getType() == CFXParameter::kSampler2D ? "2D" : "CUBE";
-
- // Export the surface.
- FCDEffectParameterSurface* surfaceParameter = writeSurfaceTexture(profile, tex_plug.node(), instance, type);
- parameter1->SetSurface(surfaceParameter);
- parameter2->SetSurface(surfaceParameter);