Skip to content
This repository
Browse code

Operators on uniqueId;

Maya instance nodes, instance geometries;
Maya light import;
colladaSax error handling;
extensions on maya data model
  • Loading branch information...
commit 87a3515299364cc81fbe6c4b0fcbfdac58d4f44a 1 parent eae45c8
opencollada-sebastian opencollada-sebastian authored

Showing 241 changed files with 11,103 additions and 1,519 deletions. Show diff stats Hide diff stats

  1. +2 1  COLLADAFramework/include/COLLADAFWUniqueId.h
  2. +26 4 COLLADAFramework/src/COLLADAFWUniqueId.cpp
  3. +0 3  COLLADAMaya/COLLADAMaya.sln
  4. +16 1 COLLADAMaya/include/COLLADAMayaBaseImporter.h
  5. +1 1  COLLADAMaya/include/COLLADAMayaCameraImporter.h
  6. +10 5 COLLADAMaya/include/COLLADAMayaDocumentImporter.h
  7. +96 137 COLLADAMaya/include/COLLADAMayaEffectImporter.h
  8. +82 0 COLLADAMaya/include/COLLADAMayaGeometryBinding.h
  9. +35 24 COLLADAMaya/include/COLLADAMayaGeometryImporter.h
  10. +3 9 COLLADAMaya/include/COLLADAMayaImageImporter.h
  11. +1 1  COLLADAMaya/include/COLLADAMayaLightImporter.h
  12. +3 1 COLLADAMaya/include/COLLADAMayaMaterialExporter.h
  13. +36 64 COLLADAMaya/include/COLLADAMayaMaterialImporter.h
  14. +30 18 COLLADAMaya/include/COLLADAMayaNode.h
  15. +54 0 COLLADAMaya/include/COLLADAMayaSaxParserErrorHandler.h
  16. +93 0 COLLADAMaya/include/COLLADAMayaShadingBinding.h
  17. +34 11 COLLADAMaya/include/COLLADAMayaVisualSceneImporter.h
  18. +24 0 COLLADAMaya/scripts/COLLADAMaya.vcproj
  19. +37 0 COLLADAMaya/src/COLLADAMayaBaseImporter.cpp
  20. +25 9 COLLADAMaya/src/COLLADAMayaCameraImporter.cpp
  21. +6 4 COLLADAMaya/src/COLLADAMayaConsoleMain.cpp
  22. +83 18 COLLADAMaya/src/COLLADAMayaDocumentImporter.cpp
  23. +367 43 COLLADAMaya/src/COLLADAMayaEffectImporter.cpp
  24. +1 1  COLLADAMaya/src/COLLADAMayaFileTranslator.cpp
  25. +52 0 COLLADAMaya/src/COLLADAMayaGeometryBinding.cpp
  26. +167 39 COLLADAMaya/src/COLLADAMayaGeometryImporter.cpp
  27. +11 12 COLLADAMaya/src/COLLADAMayaImageImporter.cpp
  28. +40 13 COLLADAMaya/src/COLLADAMayaLightImporter.cpp
  29. +306 172 COLLADAMaya/src/COLLADAMayaMaterialImporter.cpp
  30. +36 1 COLLADAMaya/src/COLLADAMayaNode.cpp
  31. +56 0 COLLADAMaya/src/COLLADAMayaSaxParserErrorHandler.cpp
  32. +70 0 COLLADAMaya/src/COLLADAMayaShadingBinding.cpp
  33. +211 88 COLLADAMaya/src/COLLADAMayaVisualSceneImporter.cpp
  34. +1 1  COLLADAMaya/testsuite/testFile.bat
  35. +2 2 COLLADAMaya/tools/doxygen_html.cfg
  36. +2 2 COLLADASaxFrameworkLoader/include/COLLADASaxFWLIError.h
  37. +4 1 COLLADASaxFrameworkLoader/include/COLLADASaxFWLSaxParserError.h
  38. +809 809 COLLADASaxFrameworkLoader/src/COLLADASaxFWLColladaParserAutoGenPrivate.cpp
  39. +4 2 COLLADASaxFrameworkLoader/src/COLLADASaxFWLSaxParserError.cpp
  40. +6 0 Externals/MayaDataModel/include/MayaDMAddMatrix.h
  41. +90 0 Externals/MayaDataModel/include/MayaDMAimConstraint.h
  42. +12 0 Externals/MayaDataModel/include/MayaDMAnimClip.h
  43. +6 0 Externals/MayaDataModel/include/MayaDMAnnotationShape.h
  44. +6 0 Externals/MayaDataModel/include/MayaDMAttachCurve.h
  45. +36 0 Externals/MayaDataModel/include/MayaDMAvgNurbsSurfacePoints.h
  46. +24 0 Externals/MayaDataModel/include/MayaDMAvgSurfacePoints.h
  47. +42 0 Externals/MayaDataModel/include/MayaDMBevelPlus.h
  48. +6 0 Externals/MayaDataModel/include/MayaDMBlend.h
  49. +12 0 Externals/MayaDataModel/include/MayaDMBlendDevice.h
  50. +54 0 Externals/MayaDataModel/include/MayaDMBlendShape.h
  51. +6 0 Externals/MayaDataModel/include/MayaDMBlendWeighted.h
  52. +210 0 Externals/MayaDataModel/include/MayaDMBrush.h
  53. +6 0 Externals/MayaDataModel/include/MayaDMCacheBase.h
  54. +48 0 Externals/MayaDataModel/include/MayaDMCacheBlend.h
  55. +12 0 Externals/MayaDataModel/include/MayaDMCacheFile.h
  56. +12 0 Externals/MayaDataModel/include/MayaDMCamera.h
  57. +24 0 Externals/MayaDataModel/include/MayaDMCharacter.h
  58. +6 0 Externals/MayaDataModel/include/MayaDMCharacterMap.h
  59. +6 0 Externals/MayaDataModel/include/MayaDMChoice.h
  60. +18 0 Externals/MayaDataModel/include/MayaDMChooser.h
  61. +102 0 Externals/MayaDataModel/include/MayaDMClipLibrary.h
  62. +138 0 Externals/MayaDataModel/include/MayaDMClipScheduler.h
  63. +6 0 Externals/MayaDataModel/include/MayaDMCluster.h
  64. +24 0 Externals/MayaDataModel/include/MayaDMClusterHandle.h
  65. +10 0 Externals/MayaDataModel/include/MayaDMConnectables.h
  66. +138 12 Externals/MayaDataModel/include/MayaDMControlPoint.h
  67. +6 0 Externals/MayaDataModel/include/MayaDMCurveFromMeshEdge.h
  68. +12 0 Externals/MayaDataModel/include/MayaDMCurveFromSubdivEdge.h
  69. +12 0 Externals/MayaDataModel/include/MayaDMCurveFromSubdivFace.h
  70. +36 0 Externals/MayaDataModel/include/MayaDMCurveInfo.h
  71. +12 0 Externals/MayaDataModel/include/MayaDMCurveIntersect.h
  72. +12 0 Externals/MayaDataModel/include/MayaDMCurveVarGroup.h
  73. +72 0 Externals/MayaDataModel/include/MayaDMDagNode.h
  74. +18 0 Externals/MayaDataModel/include/MayaDMDagPose.h
  75. +90 0 Externals/MayaDataModel/include/MayaDMDefaultLightList.h
  76. +6 0 Externals/MayaDataModel/include/MayaDMDefaultRenderUtilityList.h
  77. +6 0 Externals/MayaDataModel/include/MayaDMDefaultShaderList.h
  78. +6 0 Externals/MayaDataModel/include/MayaDMDefaultTextureList.h
  79. +18 0 Externals/MayaDataModel/include/MayaDMDetachCurve.h
  80. +18 0 Externals/MayaDataModel/include/MayaDMDetachSurface.h
  81. +6 0 Externals/MayaDataModel/include/MayaDMDisplayLayerManager.h
  82. +30 0 Externals/MayaDataModel/include/MayaDMDoubleShadingSwitch.h
  83. +66 0 Externals/MayaDataModel/include/MayaDMDynamicConstraint.h
  84. +6 0 Externals/MayaDataModel/include/MayaDMExplodeNurbsShell.h
  85. +12 0 Externals/MayaDataModel/include/MayaDMExpression.h
  86. +12 0 Externals/MayaDataModel/include/MayaDMFfBlendSrf.h
  87. +12 0 Externals/MayaDataModel/include/MayaDMFfBlendSrfObsolete.h
  88. +12 0 Externals/MayaDataModel/include/MayaDMFfd.h
  89. +72 0 Externals/MayaDataModel/include/MayaDMField.h
  90. +12 0 Externals/MayaDataModel/include/MayaDMFlexorShape.h
  91. +30 0 Externals/MayaDataModel/include/MayaDMFlow.h
  92. +414 0 Externals/MayaDataModel/include/MayaDMFluidShape.h
  93. +72 0 Externals/MayaDataModel/include/MayaDMFollicle.h
  94. +12 0 Externals/MayaDataModel/include/MayaDMFrameCache.h
  95. +180 0 Externals/MayaDataModel/include/MayaDMFurFeedback.h
  96. +18 0 Externals/MayaDataModel/include/MayaDMGeoConnectable.h
  97. +78 0 Externals/MayaDataModel/include/MayaDMGeoConnector.h
  98. +18 0 Externals/MayaDataModel/include/MayaDMGeometryConstraint.h
  99. +24 0 Externals/MayaDataModel/include/MayaDMGeometryFilter.h
  100. +18 0 Externals/MayaDataModel/include/MayaDMGeometryShape.h
  101. +12 0 Externals/MayaDataModel/include/MayaDMGeometryVarGroup.h
  102. +30 0 Externals/MayaDataModel/include/MayaDMGlobalStitch.h
  103. +12 0 Externals/MayaDataModel/include/MayaDMHairConstraint.h
  104. +234 0 Externals/MayaDataModel/include/MayaDMHairSystem.h
  105. +42 0 Externals/MayaDataModel/include/MayaDMHairTubeShader.h
  106. +6 0 Externals/MayaDataModel/include/MayaDMHardenPoint.h
  107. +12 0 Externals/MayaDataModel/include/MayaDMHikEffector.h
  108. +30 0 Externals/MayaDataModel/include/MayaDMHikHandle.h
  109. +18 0 Externals/MayaDataModel/include/MayaDMHistorySwitch.h
  110. +6 0 Externals/MayaDataModel/include/MayaDMHyperGraphInfo.h
  111. +36 0 Externals/MayaDataModel/include/MayaDMHyperLayout.h
  112. +6 0 Externals/MayaDataModel/include/MayaDMHyperView.h
  113. +6 0 Externals/MayaDataModel/include/MayaDMIkEffector.h
  114. +6 0 Externals/MayaDataModel/include/MayaDMIkSystem.h
  115. +12 0 Externals/MayaDataModel/include/MayaDMInsertKnotCurve.h
  116. +12 0 Externals/MayaDataModel/include/MayaDMInsertKnotSurface.h
  117. +6 0 Externals/MayaDataModel/include/MayaDMInstancer.h
  118. +18 0 Externals/MayaDataModel/include/MayaDMIntersectSurface.h
  119. +84 0 Externals/MayaDataModel/include/MayaDMJointCluster.h
  120. +12 0 Externals/MayaDataModel/include/MayaDMJointFfd.h
  121. +90 0 Externals/MayaDataModel/include/MayaDMLambert.h
  122. +6 0 Externals/MayaDataModel/include/MayaDMLattice.h
  123. +78 0 Externals/MayaDataModel/include/MayaDMLayeredShader.h
  124. +48 0 Externals/MayaDataModel/include/MayaDMLayeredTexture.h
  125. +45 0 Externals/MayaDataModel/include/MayaDMLeastSquaresModifier.h
  126. +90 0 Externals/MayaDataModel/include/MayaDMLightFog.h
  127. +72 0 Externals/MayaDataModel/include/MayaDMLightLinker.h
  128. +12 0 Externals/MayaDataModel/include/MayaDMLightList.h
  129. +30 0 Externals/MayaDataModel/include/MayaDMLineModifier.h
  130. +24 0 Externals/MayaDataModel/include/MayaDMLocator.h
  131. +18 0 Externals/MayaDataModel/include/MayaDMLodGroup.h
  132. +12 0 Externals/MayaDataModel/include/MayaDMLodThresholds.h
  133. +18 0 Externals/MayaDataModel/include/MayaDMLoft.h
  134. +36 0 Externals/MayaDataModel/include/MayaDMMakeIllustratorCurves.h
  135. +36 0 Externals/MayaDataModel/include/MayaDMMakeTextCurves.h
  136. +6 0 Externals/MayaDataModel/include/MayaDMMaterialInfo.h
  137. +90 0 Externals/MayaDataModel/include/MayaDMMesh.h
  138. +12 0 Externals/MayaDataModel/include/MayaDMMeshVarGroup.h
  139. +12 0 Externals/MayaDataModel/include/MayaDMMotionPath.h
  140. +6 0 Externals/MayaDataModel/include/MayaDMMpBirailSrf.h
  141. +6 0 Externals/MayaDataModel/include/MayaDMMultMatrix.h
  142. +6 0 Externals/MayaDataModel/include/MayaDMNComponent.h
  143. +12 0 Externals/MayaDataModel/include/MayaDMNetwork.h
  144. +18 0 Externals/MayaDataModel/include/MayaDMNormalConstraint.h
  145. +42 0 Externals/MayaDataModel/include/MayaDMNucleus.h
  146. +54 0 Externals/MayaDataModel/include/MayaDMNurbsCurve.h
  147. +12 0 Externals/MayaDataModel/include/MayaDMNurbsSurface.h
  148. +24 0 Externals/MayaDataModel/include/MayaDMObjectSet.h
  149. +72 0 Externals/MayaDataModel/include/MayaDMOcean.h
  150. +204 0 Externals/MayaDataModel/include/MayaDMOceanShader.h
  151. +6 0 Externals/MayaDataModel/include/MayaDMOffsetCos.h
  152. +6 0 Externals/MayaDataModel/include/MayaDMOffsetCurve.h
  153. +96 0 Externals/MayaDataModel/include/MayaDMOrientConstraint.h
  154. +240 0 Externals/MayaDataModel/include/MayaDMParentConstraint.h
  155. +162 0 Externals/MayaDataModel/include/MayaDMParticle.h
  156. +90 0 Externals/MayaDataModel/include/MayaDMParticleCloud.h
  157. +6 0 Externals/MayaDataModel/include/MayaDMPartition.h
  158. +48 0 Externals/MayaDataModel/include/MayaDMPfxGeometry.h
  159. +48 0 Externals/MayaDataModel/include/MayaDMPfxToon.h
  160. +6 0 Externals/MayaDataModel/include/MayaDMPlanarTrimSurface.h
  161. +48 0 Externals/MayaDataModel/include/MayaDMPlusMinusAverage.h
  162. +90 0 Externals/MayaDataModel/include/MayaDMPointConstraint.h
  163. +42 0 Externals/MayaDataModel/include/MayaDMPointEmitter.h
  164. +30 0 Externals/MayaDataModel/include/MayaDMPolyAppend.h
  165. +30 0 Externals/MayaDataModel/include/MayaDMPolyAppendVertex.h
  166. +24 0 Externals/MayaDataModel/include/MayaDMPolyBridgeEdge.h
  167. +120 0 Externals/MayaDataModel/include/MayaDMPolyColorMod.h
  168. +12 0 Externals/MayaDataModel/include/MayaDMPolyCrease.h
  169. +30 0 Externals/MayaDataModel/include/MayaDMPolyCreateFace.h
  170. +24 0 Externals/MayaDataModel/include/MayaDMPolyExtrudeEdge.h
  171. +24 0 Externals/MayaDataModel/include/MayaDMPolyExtrudeFace.h
  172. +6 0 Externals/MayaDataModel/include/MayaDMPolyMoveVertex.h
  173. +6 0 Externals/MayaDataModel/include/MayaDMPolyReduce.h
  174. +6 0 Externals/MayaDataModel/include/MayaDMPolySeparate.h
  175. +36 0 Externals/MayaDataModel/include/MayaDMPolySplit.h
  176. +24 0 Externals/MayaDataModel/include/MayaDMPolySplitRing.h
  177. +24 0 Externals/MayaDataModel/include/MayaDMPolyToSubdiv.h
  178. +24 0 Externals/MayaDataModel/include/MayaDMPolyTweak.h
  179. +48 0 Externals/MayaDataModel/include/MayaDMPolyTweakUV.h
  180. +12 0 Externals/MayaDataModel/include/MayaDMPolyUnite.h
  181. +6 0 Externals/MayaDataModel/include/MayaDMPolyWedgeFace.h
  182. +6 0 Externals/MayaDataModel/include/MayaDMPostProcessList.h
  183. +6 0 Externals/MayaDataModel/include/MayaDMProjectCurve.h
  184. +6 0 Externals/MayaDataModel/include/MayaDMProxyManager.h
  185. +48 0 Externals/MayaDataModel/include/MayaDMQuadShadingSwitch.h
  186. +36 0 Externals/MayaDataModel/include/MayaDMRamp.h
  187. +348 0 Externals/MayaDataModel/include/MayaDMRampShader.h
  188. +18 0 Externals/MayaDataModel/include/MayaDMRbfSrf.h
  189. +78 0 Externals/MayaDataModel/include/MayaDMReference.h
  190. +72 0 Externals/MayaDataModel/include/MayaDMRemapColor.h
  191. +72 0 Externals/MayaDataModel/include/MayaDMRemapHsv.h
  192. +66 0 Externals/MayaDataModel/include/MayaDMRemapValue.h
  193. +18 0 Externals/MayaDataModel/include/MayaDMRenderGlobalsList.h
  194. +42 0 Externals/MayaDataModel/include/MayaDMRenderLayer.h
  195. +6 0 Externals/MayaDataModel/include/MayaDMRenderLayerManager.h
  196. +66 0 Externals/MayaDataModel/include/MayaDMRigidBody.h
  197. +114 0 Externals/MayaDataModel/include/MayaDMRigidSolver.h
  198. +48 0 Externals/MayaDataModel/include/MayaDMRoundConstantRadius.h
  199. +6 0 Externals/MayaDataModel/include/MayaDMSampler.h
  200. +42 0 Externals/MayaDataModel/include/MayaDMScaleConstraint.h
  201. +18 0 Externals/MayaDataModel/include/MayaDMSingleShadingSwitch.h
  202. +60 0 Externals/MayaDataModel/include/MayaDMSkinCluster.h
  203. +6 0 Externals/MayaDataModel/include/MayaDMSmoothCurve.h
  204. +6 0 Externals/MayaDataModel/include/MayaDMSmoothTangentSrf.h
  205. +6 0 Externals/MayaDataModel/include/MayaDMSnapshot.h
  206. +30 0 Externals/MayaDataModel/include/MayaDMSoftMod.h
  207. +24 0 Externals/MayaDataModel/include/MayaDMSoftModHandle.h
  208. +54 0 Externals/MayaDataModel/include/MayaDMSpring.h
  209. +6 0 Externals/MayaDataModel/include/MayaDMStitchAsNurbsShell.h
  210. +144 0 Externals/MayaDataModel/include/MayaDMStitchSrf.h
  211. +108 0 Externals/MayaDataModel/include/MayaDMStroke.h
  212. +24 0 Externals/MayaDataModel/include/MayaDMSubdTweak.h
  213. +18 0 Externals/MayaDataModel/include/MayaDMSubdTweakUV.h
  214. +72 0 Externals/MayaDataModel/include/MayaDMSubdiv.h
  215. +12 0 Externals/MayaDataModel/include/MayaDMSubdivSurfaceVarGroup.h
  216. +6 0 Externals/MayaDataModel/include/MayaDMSubdivToNurbs.h
  217. +42 0 Externals/MayaDataModel/include/MayaDMSubdivToPoly.h
  218. +42 0 Externals/MayaDataModel/include/MayaDMSurfaceInfo.h
  219. +90 0 Externals/MayaDataModel/include/MayaDMSurfaceLuminance.h
  220. +12 0 Externals/MayaDataModel/include/MayaDMSurfaceSampler.h
  221. +96 0 Externals/MayaDataModel/include/MayaDMSurfaceShape.h
  222. +12 0 Externals/MayaDataModel/include/MayaDMSurfaceVarGroup.h
  223. +18 0 Externals/MayaDataModel/include/MayaDMTangentConstraint.h
  224. +48 0 Externals/MayaDataModel/include/MayaDMTextureToGeom.h
  225. +6 0 Externals/MayaDataModel/include/MayaDMTransferAttributes.h
  226. +24 0 Externals/MayaDataModel/include/MayaDMTrim.h
  227. +6 0 Externals/MayaDataModel/include/MayaDMTrimWithBoundaries.h
  228. +36 0 Externals/MayaDataModel/include/MayaDMTripleShadingSwitch.h
  229. +60 0 Externals/MayaDataModel/include/MayaDMTweak.h
  230. +6 0 Externals/MayaDataModel/include/MayaDMUntrim.h
  231. +90 0 Externals/MayaDataModel/include/MayaDMUseBackground.h
  232. +6 0 Externals/MayaDataModel/include/MayaDMUvChooser.h
  233. +132 0 Externals/MayaDataModel/include/MayaDMVolumeFog.h
  234. +66 0 Externals/MayaDataModel/include/MayaDMVolumeLight.h
  235. +12 0 Externals/MayaDataModel/include/MayaDMWeightGeometryFilter.h
  236. +54 0 Externals/MayaDataModel/include/MayaDMWire.h
  237. +36 0 Externals/MayaDataModel/include/MayaDMWrap.h
  238. +18 0 Externals/MayaDataModel/include/MayaDMWtAddMatrix.h
  239. +1 1  GeneratedSaxParser/include/GeneratedSaxParserParserError.h
  240. +8 8 GeneratedSaxParser/include/GeneratedSaxParserParserTemplate.h
  241. +1 1  GeneratedSaxParser/src/GeneratedSaxParserCoutErrorHandler.cpp
3  COLLADAFramework/include/COLLADAFWUniqueId.h
@@ -53,8 +53,9 @@ namespace COLLADAFW
53 53 bool isValid() const { return mClassId != COLLADA_TYPE::NO_TYPE; }
54 54
55 55 bool operator<(const UniqueId& rhs) const;
56   -
  56 + bool operator>(const UniqueId& rhs) const;
57 57 bool operator==(const UniqueId& uid) const;
  58 + bool operator!=(const UniqueId& uid) const;
58 59
59 60 };
60 61 } // namespace COLLADAFW
30 COLLADAFramework/src/COLLADAFWUniqueId.cpp
@@ -27,13 +27,11 @@ namespace COLLADAFW
27 27 {
28 28 if ( mClassId < rhs.mClassId )
29 29 return true;
30   -
31 30 if ( mClassId > rhs.mClassId )
32 31 return false;
33 32
34 33 if ( mObjectId < rhs.mObjectId )
35 34 return true;
36   -
37 35 if ( mObjectId > rhs.mObjectId )
38 36 return false;
39 37
@@ -41,11 +39,35 @@ namespace COLLADAFW
41 39 }
42 40
43 41 //-------------------------------
  42 + bool UniqueId::operator>( const UniqueId& rhs ) const
  43 + {
  44 + if ( mClassId > rhs.mClassId )
  45 + return true;
  46 + if ( mClassId < rhs.mClassId )
  47 + return false;
  48 +
  49 + if ( mObjectId > rhs.mObjectId )
  50 + return true;
  51 + if ( mObjectId < rhs.mObjectId )
  52 + return false;
  53 +
  54 + return false;
  55 + }
  56 +
  57 + //-------------------------------
44 58 bool UniqueId::operator== ( const UniqueId& uid ) const
45 59 {
46   - if (mClassId != uid.getClassId ()) return false;
47   - if (mObjectId != uid.getObjectId ()) return false;
  60 + if ( mClassId != uid.getClassId () ) return false;
  61 + if ( mObjectId != uid.getObjectId () ) return false;
48 62 return true;
49 63 }
50 64
  65 + //-------------------------------
  66 + bool UniqueId::operator!= ( const UniqueId& uid ) const
  67 + {
  68 + if ( mClassId != uid.getClassId () ) return true;
  69 + if ( mObjectId != uid.getObjectId () ) return true;
  70 + return false;
  71 + }
  72 +
51 73 } // namespace COLLADAFW
3  COLLADAMaya/COLLADAMaya.sln
@@ -465,7 +465,4 @@ Global
465 465 GlobalSection(SolutionProperties) = preSolution
466 466 HideSolutionNode = FALSE
467 467 EndGlobalSection
468   - GlobalSection(ExtensibilityGlobals) = postSolution
469   - AMDCaProjectFile = C:\netallied\projekte\COLLADA\COLLADANextgen\COLLADAMaya\CodeAnalyst\COLLADAMaya.caw
470   - EndGlobalSection
471 468 EndGlobal
17 COLLADAMaya/include/COLLADAMayaBaseImporter.h
@@ -34,6 +34,7 @@ namespace COLLADAMaya
34 34 public:
35 35
36 36 typedef std::set<const COLLADAFW::UniqueId> UniqueIdSet;
  37 + typedef std::pair<COLLADAFW::UniqueId, COLLADAFW::UniqueId> UniqueIdsPair;
37 38
38 39 typedef std::map<COLLADAFW::UniqueId, COLLADAFW::UniqueId> UniqueIdUniqueIdMap;
39 40 typedef std::map<COLLADAFW::UniqueId, String> UniqueIdNamesMap;
@@ -41,7 +42,10 @@ namespace COLLADAMaya
41 42 typedef std::vector<const COLLADAFW::UniqueId> UniqueIdVec;
42 43 typedef std::map<COLLADAFW::UniqueId, UniqueIdVec> UniqueIdUniqueIdsMap;
43 44
44   - typedef std::map<COLLADAFW::UniqueId, MayaNode> UniqueIdMayaNodesMap;
  45 + typedef std::vector<MayaNode*> MayaNodesList;
  46 + typedef std::map<COLLADAFW::UniqueId, MayaNodesList> UniqueIdMayaNodesMap;
  47 +
  48 + typedef std::map<COLLADAFW::UniqueId, MayaNode*> UniqueIdMayaNodeMap;
45 49 typedef std::map<COLLADAFW::UniqueId, MayaDM::Mesh> UniqueIdMayaDMMeshMap;
46 50
47 51 typedef std::map<COLLADAFW::UniqueId, MayaDM::DependNode*> UniqueIdDependNodeMap;
@@ -75,6 +79,17 @@ namespace COLLADAMaya
75 79 MayaDM::double3 toLinearUnit ( const MayaDM::double3& val );
76 80
77 81 /**
  82 + * Converts the given value to the angular unit in meters.
  83 + * For this we need a conversion from radians to degrees and have to look for the up-axis.
  84 + */
  85 + MayaDM::double3 toAngularUnit ( const MayaDM::double3& val );
  86 +
  87 + /**
  88 + * In depend on the up axis, the order of the values will be changed.
  89 + */
  90 + MayaDM::double3 toUpAxisType ( const MayaDM::double3& val );
  91 +
  92 + /**
78 93 * Converts the given value to the linear unit in meters.
79 94 * How many real-world meters in one distance unit as a floating-point number.
80 95 * For example, 1.0 for the name "meter"; 1000 for the name "kilometer";
2  COLLADAMaya/include/COLLADAMayaCameraImporter.h
@@ -45,7 +45,7 @@ namespace COLLADAMaya
45 45 /**
46 46 * The map holds the unique ids of the camera nodes to the maya specific nodes.
47 47 */
48   - UniqueIdMayaNodesMap mMayaCameraNodesMap;
  48 + UniqueIdMayaNodeMap mMayaCameraNodesMap;
49 49
50 50 public:
51 51
15 COLLADAMaya/include/COLLADAMayaDocumentImporter.h
@@ -19,14 +19,10 @@
19 19 #include "COLLADAMayaStableHeaders.h"
20 20 #include "COLLADAMayaPrerequisites.h"
21 21 #include "COLLADAMayaNode.h"
  22 +#include "COLLADAMayaSaxParserErrorHandler.h"
22 23
23 24 #include "COLLADAFWIWriter.h"
24 25 #include "COLLADAFWFileInfo.h"
25   -// #include "COLLADAFWVisualScene.h"
26   -// #include "COLLADAFWGeometry.h"
27   -// #include "COLLADAFWMaterial.h"
28   -// #include "COLLADAFWEffect.h"
29   -// #include "COLLADAFWCamera.h"
30 26
31 27 #include "MayaDMMesh.h"
32 28
@@ -75,8 +71,10 @@ namespace COLLADAMaya
75 71
76 72 bool mAssetWritten;
77 73 bool mSceneGraphWritten;
  74 + bool mLibraryNodesWritten;
78 75
79 76 bool mSceneGraphRead;
  77 + bool mLibraryNodesRead;
80 78 bool mGeometryRead;
81 79 bool mCameraRead;
82 80 bool mLightRead;
@@ -106,6 +104,9 @@ namespace COLLADAMaya
106 104 /** The variable tells, how many times the document is read. */
107 105 size_t mNumDocumentParses;
108 106
  107 + /** The error handler for the sax parser. */
  108 + SaxParserErrorHandler mSaxParserErrorHandler;
  109 +
109 110 public:
110 111
111 112 /** Constructor. */
@@ -164,6 +165,10 @@ namespace COLLADAMaya
164 165 LightImporter* getLightImporter () { return mLightImporter; }
165 166 const LightImporter* getLightImporter () const { return mLightImporter; }
166 167
  168 + /** Pointer to the image importer. */
  169 + ImageImporter* getImageImporter () { return mImageImporter; }
  170 + const ImageImporter* getImageImporter () const { return mImageImporter; }
  171 +
167 172 /** This method will be called if an error in the loading process occurred and the loader
168 173 cannot continue to to load. The writer should undo all operations that have been performed.
169 174 @param errorMessage A message containing informations about the error that occurred.
233 COLLADAMaya/include/COLLADAMayaEffectImporter.h
@@ -19,6 +19,10 @@
19 19 #include "COLLADAFWEffectCommon.h"
20 20 //#include "COLLADAFWFloatOrParam.h"
21 21
  22 +#include "MayaDMLambert.h"
  23 +#include "MayaDMBlinn.h"
  24 +#include "MayaDMPhong.h"
  25 +
22 26
23 27 namespace COLLADAMaya
24 28 {
@@ -31,6 +35,18 @@ namespace COLLADAMaya
31 35 /** The standard name for a effect without name. */
32 36 static const String EFFECT_NAME;
33 37
  38 + /** The standard name for a place2dTexture. */
  39 + static const String PLACE_2D_TEXTURE_NAME;
  40 +
  41 + /** The standard name for a place2dTexture. */
  42 + static const String PLACE_3D_TEXTURE_NAME;
  43 +
  44 + public:
  45 +
  46 + typedef std::map<COLLADAFW::UniqueId, MayaDM::Lambert*> UniqueIdLambertMap;
  47 +
  48 + private:
  49 +
34 50 /**
35 51 * The enumeration of valid shader attributes.
36 52 * We need this for the connections of the effect attributes to textures.
@@ -39,7 +55,9 @@ namespace COLLADAMaya
39 55 {
40 56 ATTR_COLOR,
41 57 ATTR_INCANDESCENE,
42   - ATTR_TRANSPARENCY,
  58 + ATTR_TRANSPARENT,
  59 + ATTR_REFLECTIVE,
  60 + ATTR_SPECULAR,
43 61 ATTR_UNKNOWN
44 62 };
45 63
@@ -59,16 +77,16 @@ namespace COLLADAMaya
59 77 * The type of the effect depends on the attribute.
60 78 * It's either an lambert, blinn or phong shader.
61 79 */
62   - struct ShaderNodeAttribute
  80 + struct TextureAttribute
63 81 {
64   - MayaDM::DependNode* mShaderNode;
  82 + MayaDM::Lambert* mShaderNode;
65 83 ShaderType mShaderType;
66 84 ShaderAttribute mShaderAttribute;
67 85 };
68 86
69 87 private:
70 88
71   - typedef std::map<COLLADAFW::SamplerID, std::vector<ShaderNodeAttribute>> SamplerIdShaderNodesMap;
  89 + typedef std::map<COLLADAFW::SamplerID, std::vector<TextureAttribute>> SamplerIdShaderNodesMap;
72 90
73 91 private:
74 92
@@ -77,6 +95,11 @@ namespace COLLADAMaya
77 95 */
78 96 COLLADABU::IDList mEffectIdList;
79 97
  98 + /**
  99 + * The list with the unique maya place2dtexture names.
  100 + */
  101 + COLLADABU::IDList mPlace2dTextureIdList;
  102 +
80 103 /**
81 104 * The map holds the unique ids of the nodes to the maya effect name.
82 105 */
@@ -85,7 +108,19 @@ namespace COLLADAMaya
85 108 /**
86 109 * The map holds the maya effect objects for the connections.
87 110 */
88   - UniqueIdDependNodeMap mMayaEffectMap;
  111 + UniqueIdLambertMap mMayaEffectMap;
  112 +
  113 + /**
  114 + * The map holds for every unique image id the list of placed2dTextures, which use this image.
  115 + */
  116 + // TODO Push the texure placement in the list of texture placements of the image.
  117 + struct TexturePlacement
  118 + {
  119 + COLLADAFW::UniqueId mImageId;
  120 + COLLADAFW::Sampler::SamplerType mSamplerType;
  121 + MayaDM::DependNode* mTexturePlacementNode;
  122 + };
  123 + std::vector<TexturePlacement*> mTexturePlacements;
89 124
90 125 /**
91 126 * The map holds for every sampler id the shader node attributes,
@@ -105,21 +140,38 @@ namespace COLLADAMaya
105 140 bool importEffect ( const COLLADAFW::Effect* effect );
106 141
107 142 /**
  143 + * Writes the connections of the effect texture placements to the image files.
  144 + */
  145 + void writeConnections ();
  146 +
  147 + /**
108 148 * The map holds the maya material objects.
109 149 */
110   - MayaDM::DependNode* findMayaEffect ( const COLLADAFW::UniqueId& val ) const;
  150 + MayaDM::Lambert* findMayaEffect ( const COLLADAFW::UniqueId& effectId ) const;
111 151
112 152 /**
113 153 * The map holds the maya material objects.
114 154 */
115   - const UniqueIdDependNodeMap& getMayaEffectMap () const { return mMayaEffectMap; }
  155 + const UniqueIdLambertMap& getMayaEffectMap () const { return mMayaEffectMap; }
116 156
117 157 private:
118 158
119 159 /**
  160 + * Import shader data by type.
  161 + */
  162 + void importShaderData (
  163 + const COLLADAFW::EffectCommon* commonEffect,
  164 + const COLLADAFW::Effect* effect );
  165 +
  166 + /**
  167 + * Create the texture placement and push it to the image in a map.
  168 + */
  169 + void importTexturePlacement ( const COLLADAFW::EffectCommon* commonEffect );
  170 +
  171 + /**
120 172 * The map holds the maya material objects.
121 173 */
122   - void appendEffect ( const COLLADAFW::UniqueId& id, MayaDM::DependNode* effectNode );
  174 + void appendEffect ( const COLLADAFW::UniqueId& efefctId, MayaDM::Lambert* effectNode );
123 175
124 176 /**
125 177 * Imports a blinn shader effect.
@@ -143,144 +195,51 @@ namespace COLLADAMaya
143 195 const COLLADAFW::EffectCommon* commonEffect );
144 196
145 197 /**
146   - * Imports the shader attributes.
147   - */
148   - template<class T>
149   - void importShaderAttributes (
  198 + * Imports the shader attributes.
  199 + */
  200 + void importStandardShaderAttributes (
  201 + MayaDM::Lambert* shaderNode,
  202 + const COLLADAFW::Effect* effect );
  203 +
  204 + /**
  205 + * Imports the shader attributes.
  206 + */
  207 + void importLambertShaderAttributes (
150 208 const ShaderType& shaderType,
151   - T* shaderNode,
152   - const COLLADAFW::Effect* effect,
153   - const COLLADAFW::EffectCommon* commonEffect )
154   - {
155   - // --------------------
156   - // Get the color and set it into the shader node (if it is a valid color).
157   - const COLLADAFW::Color& standardColor = effect->getStandardColor ();
158   - if ( standardColor.isValid () )
159   - {
160   - shaderNode->setColor ( MayaDM::float3 ( (float)standardColor.getRed (), (float)standardColor.getGreen (), (float)standardColor.getBlue ()) );
161   - }
162   -
163   - // --------------------
164   - const COLLADAFW::ColorOrTexture& diffuse = commonEffect->getDiffuse ();
165   - if ( diffuse.isColor () )
166   - {
167   - // Get the color and set it into the shader node (if it is a valid color).
168   - const COLLADAFW::Color& color = diffuse.getColor ();
169   - if ( color.isValid () )
170   - shaderNode->setColor ( MayaDM::float3 ( (float)color.getRed (), (float)color.getGreen (), (float)color.getBlue ()) );
171   - }
172   - else
173   - {
174   - // Get the texure and the current shader attribute.
175   - const COLLADAFW::Texture& texture = diffuse.getTexture ();
176   - ShaderAttribute shaderAttribute = ATTR_COLOR;
177   -
178   - // Create a shader node attribute and append it on the list of shader node
179   - // attributes to the current sampler file id.
180   - appendShaderNodeAttribute ( texture, shaderType, shaderAttribute, shaderNode );
181   - }
182   -
183   -
184   - // --------------------
185   - const COLLADAFW::ColorOrTexture& emission = commonEffect->getEmission ();
186   - if ( emission.isColor () )
187   - {
188   - // Get the color and set it into the shader node (if it is a valid color).
189   - const COLLADAFW::Color& color = emission.getColor ();
190   - if ( color.isValid () )
191   - shaderNode->setIncandescence ( MayaDM::float3 ( (float)color.getRed (), (float)color.getGreen (), (float)color.getBlue ()) );
192   - }
193   - else
194   - {
195   - // Get the texure and the current shader attribute.
196   - const COLLADAFW::Texture& texture = diffuse.getTexture ();
197   - ShaderAttribute shaderAttribute = ATTR_INCANDESCENE;
198   -
199   - // Create a shader node attribute and append it on the list of shader node
200   - // attributes to the current sampler file id.
201   - appendShaderNodeAttribute ( texture, shaderType, shaderAttribute, shaderNode );
202   - }
203   -
204   - // --------------------
205   - // TODO
206   - const COLLADAFW::FloatOrParam& indexOfRefraction = commonEffect->getIndexOfRefraction ();
207   - shaderNode->setRefractiveIndex ( indexOfRefraction );
208   -
209   - // --------------------
210   - const COLLADAFW::ColorOrTexture& reflective = commonEffect->getReflective ();
211   - if ( reflective.isColor () )
212   - {
213   - // Get the color and set it into the shader node (if it is a valid color).
214   - const COLLADAFW::Color& color = reflective.getColor ();
215   - // TODO
216   - }
217   -
218   - // --------------------
219   - // TODO
220   - {
221   - const COLLADAFW::FloatOrParam& reflectivity = commonEffect->getReflectivity ();
222   -// const COLLADAFW::FloatOrParam::Type& type = reflectivity.getType ();
223   -// switch ( type )
224   -// {
225   -// case COLLADAFW::FloatOrParam::FLOAT:
226   -// break;
227   -// case COLLADAFW::FloatOrParam::PARAM:
228   -// break;
229   -// default:
230   -// MGlobal::displayError ( "Unknown param type!" );
231   -// std::cerr << "Unknown param type!" << endl;
232   -// break;
233   -// }
234   - }
235   -
236   - // --------------------
237   - // TODO Not on lambert shader! Just phong and blinn!
238   - const COLLADAFW::FloatOrParam& shininess = commonEffect->getShininess ();
239   -
240   - // --------------------
241   - // TODO Not on lambert shader! Just phong and blinn!
242   - const COLLADAFW::ColorOrTexture& specular = commonEffect->getSpecular ();
243   - if ( specular.isColor () )
244   - {
245   - // Get the color and set it into the shader node (if it is a valid color).
246   - const COLLADAFW::Color& color = specular.getColor ();
247   - // TODO
248   - }
249   -
250   - // --------------------
251   - // TODO
252   - const COLLADAFW::FloatOrParam& transparency = commonEffect->getTransparency ();
253   -
254   - // --------------------
255   - const COLLADAFW::ColorOrTexture& transparent = commonEffect->getTransparent();
256   - if ( transparent.isColor () )
257   - {
258   - // Get the color and set it into the shader node (if it is a valid color).
259   - const COLLADAFW::Color& color = transparent.getColor ();
260   - if ( color.isValid () )
261   - shaderNode->setTransparency ( MayaDM::float3 ( (float)color.getRed (), (float)color.getGreen (), (float)color.getBlue ()) );
262   - }
263   - else
264   - {
265   - // Get the texure and the current shader attribute.
266   - const COLLADAFW::Texture& texture = diffuse.getTexture ();
267   - ShaderAttribute shaderAttribute = ATTR_INCANDESCENE;
268   -
269   - // Create a shader node attribute and append it on the list of shader node
270   - // attributes to the current sampler file id.
271   - appendShaderNodeAttribute ( texture, shaderType, shaderAttribute, shaderNode );
272   - }
273   - }
  209 + MayaDM::Lambert* shaderNode,
  210 + const COLLADAFW::EffectCommon* commonEffect );
  211 +
  212 + /**
  213 + * Imports the shader attributes.
  214 + */
  215 + void importReflectShaderAttributes (
  216 + const ShaderType& shaderType,
  217 + MayaDM::Reflect* shaderNode,
  218 + const COLLADAFW::EffectCommon* commonEffect );
  219 +
  220 + /**
  221 + * Imports the shader attributes.
  222 + */
  223 + void importBlinnShaderAttributes (
  224 + MayaDM::Blinn* shaderNode,
  225 + const COLLADAFW::EffectCommon* commonEffect );
  226 +
  227 + /**
  228 + * Imports the shader attributes.
  229 + */
  230 + void importPhongShaderAttributes (
  231 + MayaDM::Phong* shaderNode,
  232 + const COLLADAFW::EffectCommon* commonEffect );
274 233
275 234 /**
276 235 * Create a shader node attribute and append it on the list of shader node attributes
277 236 * to the current sampler file id.
278 237 */
279   - void appendShaderNodeAttribute (
  238 + void appendTextureAttribute (
280 239 const COLLADAFW::Texture &texture,
281 240 const ShaderType& shaderType,
282 241 const ShaderAttribute& shaderAttribute,
283   - MayaDM::DependNode* shaderNode );
  242 + MayaDM::Lambert* shaderNode );
284 243
285 244 /** Disable default copy ctor. */
286 245 EffectImporter( const EffectImporter& pre );
82 COLLADAMaya/include/COLLADAMayaGeometryBinding.h
... ... @@ -0,0 +1,82 @@
  1 +/*
  2 + Copyright (c) 2008 NetAllied Systems GmbH
  3 +
  4 + This file is part of COLLADAFramework.
  5 +
  6 + Licensed under the MIT Open Source License,
  7 + for details please see LICENSE file or the website
  8 + http://www.opensource.org/licenses/mit-license.php
  9 +*/
  10 +
  11 +#ifndef __COLLADAMAYA_GEOMETRYBINDING_H__
  12 +#define __COLLADAMAYA_GEOMETRYBINDING_H__
  13 +
  14 +#include "COLLADAMayaPrerequisites.h"
  15 +
  16 +#include "COLLADAFWUniqueId.h"
  17 +#include "COLLADAFWMaterial.h"
  18 +
  19 +
  20 +namespace COLLADAMaya
  21 +{
  22 +
  23 + /**
  24 + * The binding for a geometry and transform node.
  25 + */
  26 + class GeometryBinding
  27 + {
  28 + private:
  29 + COLLADAFW::UniqueId mGeometryId;
  30 + COLLADAFW::UniqueId mTransformId;
  31 +
  32 + public:
  33 + GeometryBinding ();
  34 + GeometryBinding (
  35 + const COLLADAFW::UniqueId& geometryId,
  36 + const COLLADAFW::UniqueId& transformId )
  37 + : mGeometryId (geometryId)
  38 + , mTransformId (transformId)
  39 + {}
  40 + virtual ~GeometryBinding ();
  41 +
  42 + const COLLADAFW::UniqueId& getGeometryId () const { return mGeometryId; }
  43 + void setGeometryId ( const COLLADAFW::UniqueId& val ) { mGeometryId = val; }
  44 +
  45 + const COLLADAFW::UniqueId& getTransformId () const { return mTransformId; }
  46 + void setTransformId ( const COLLADAFW::UniqueId& val ) { mTransformId = val; }
  47 +
  48 + bool operator<(const GeometryBinding& rhs) const;
  49 + bool operator==(const GeometryBinding& uid) const;
  50 + };
  51 +
  52 +
  53 +
  54 + class MaterialInfo
  55 + {
  56 + private:
  57 + COLLADAFW::UniqueId mMaterialId;
  58 + COLLADAFW::MaterialId mShadingEngineId;
  59 +
  60 + public:
  61 + MaterialInfo () {}
  62 + MaterialInfo (
  63 + const COLLADAFW::UniqueId& materialId,
  64 + const COLLADAFW::MaterialId& shadingEngineId )
  65 + : mMaterialId (materialId)
  66 + , mShadingEngineId (shadingEngineId)
  67 + {}
  68 + virtual ~MaterialInfo () {}
  69 +
  70 + const COLLADAFW::UniqueId& getMaterialId () const { return mMaterialId; }
  71 + void setMaterialId ( const COLLADAFW::UniqueId& val ) { mMaterialId = val; }
  72 +
  73 + const COLLADAFW::MaterialId& getShadingEngineId () const { return mShadingEngineId; }
  74 + void setShadingEngineId ( const COLLADAFW::MaterialId& val ) { mShadingEngineId = val; }
  75 + };
  76 + typedef std::map<GeometryBinding, std::vector<MaterialInfo>> GeometryBindingMaterialInfosMap;
  77 +
  78 +
  79 +
  80 +} // namespace COLLADAMAYA
  81 +
  82 +#endif // __COLLADAMAYA_GEOMETRYBINDING_H__
59 COLLADAMaya/include/COLLADAMayaGeometryImporter.h
@@ -19,6 +19,7 @@
19 19 #include "COLLADAMayaStableHeaders.h"
20 20 #include "COLLADAMayaBaseImporter.h"
21 21 #include "COLLADAMayaNode.h"
  22 +#include "COLLADAMayaShadingBinding.h"
22 23
23 24 #include "COLLADAFWMesh.h"
24 25
@@ -53,32 +54,22 @@ namespace COLLADAMaya
53 54 * Assign the group to the unique geometry id, the transform node
54 55 * to the mesh instance and the index of the geometry's primitives.
55 56 */
56   - class GroupIdAssignment
  57 + class GroupAssignment
57 58 {
58 59 private:
59 60 MayaDM::GroupId mGroupId;
60   - COLLADAFW::UniqueId mGeometryId;
  61 + COLLADAFW::MaterialId mShadingEngineId;
61 62 size_t mGeometryInstanceIndex;
62 63 size_t mPrimitiveIndex;
63 64 public:
64   - GroupIdAssignment () {}
65   - GroupIdAssignment (
66   - MayaDM::GroupId& groupId,
67   - const COLLADAFW::UniqueId& geometryId,
68   - const size_t geometryInstanceIndex,
69   - const size_t primitiveIndex )
70   - : mGroupId (groupId)
71   - , mGeometryId (geometryId)
72   - , mGeometryInstanceIndex (geometryInstanceIndex)
73   - , mPrimitiveIndex (primitiveIndex)
74   - {}
75   - virtual ~GroupIdAssignment () {}
  65 + GroupAssignment () {}
  66 + virtual ~GroupAssignment () {}
76 67
77 68 const MayaDM::GroupId& getGroupId () const { return mGroupId; }
78 69 void setGroupId ( MayaDM::GroupId& val ) { mGroupId = val; }
79 70
80   - const COLLADAFW::UniqueId& getGeometryId () const { return mGeometryId; }
81   - void setGeometryId ( const COLLADAFW::UniqueId& val ) { mGeometryId = val; }
  71 + const COLLADAFW::MaterialId& getShadingEngineId () const { return mShadingEngineId; }
  72 + void setShadingEngineId ( const COLLADAFW::MaterialId& val ) { mShadingEngineId = val; }
82 73
83 74 const size_t getGeometryInstanceIndex () const { return mGeometryInstanceIndex; }
84 75 void setGeometryInstanceIndex ( const size_t val ) { mGeometryInstanceIndex = val; }
@@ -86,7 +77,7 @@ namespace COLLADAMaya
86 77 const size_t getPrimitiveIndex () const { return mPrimitiveIndex; }
87 78 void setPrimitiveIndex ( const size_t val ) { mPrimitiveIndex = val; }
88 79 };
89   - typedef std::vector<GroupIdAssignment> GroupIdAssignments;
  80 +
90 81
91 82 private:
92 83
@@ -103,7 +94,7 @@ namespace COLLADAMaya
103 94 /**
104 95 * The map holds the unique ids of the geometry nodes to the maya specific nodes.
105 96 */
106   - UniqueIdMayaNodesMap mMayaMeshNodesMap;
  97 + UniqueIdMayaNodeMap mMayaMeshNodesMap;
107 98
108 99 /**
109 100 * The map holds the unique ids of the nodes to the specific nodes.
@@ -118,9 +109,9 @@ namespace COLLADAMaya
118 109
119 110 /**
120 111 * Assign the group to the unique geometry id, the transform node
121   - * to the mesh instance and the index of the geometry's primitives.
  112 + * to the mesh instance and the shading engine.
122 113 */
123   - GroupIdAssignments mGroupIdAssignments;
  114 + ShadingBindingGroupInfoMap mShadingBindingGroupMap;
124 115
125 116 public:
126 117
@@ -128,7 +119,7 @@ namespace COLLADAMaya
128 119 GeometryImporter ( DocumentImporter* documentImporter );
129 120
130 121 /** Destructor. */
131   - virtual ~GeometryImporter () {}
  122 + virtual ~GeometryImporter ();
132 123
133 124 /** Imports the geometry element. */
134 125 void importGeometry ( const COLLADAFW::Geometry* geometry );
@@ -153,6 +144,11 @@ namespace COLLADAMaya
153 144 */
154 145 const MayaDM::Mesh* findMayaDMMeshNode ( const COLLADAFW::UniqueId& uniqueId ) const;
155 146
  147 + /**
  148 + * The map holds the unique ids of the nodes to the specific nodes.
  149 + */
  150 + const UniqueIdMayaDMMeshMap& getMayaDMMeshNodesMap () const { return mMayaDMMeshNodesMap; }
  151 +
156 152 /**
157 153 * Returns a pointer to the vector of indices of the given geometry and shading engine.
158 154 * The map holds for every geometry's shading engine a list of the index values of the
@@ -166,7 +162,21 @@ namespace COLLADAMaya
166 162 * Assign the group to the unique geometry id, the transform node
167 163 * to the mesh instance and the index of the geometry's primitives.
168 164 */
169   - const GroupIdAssignments& getGroupIdAssignments () const { return mGroupIdAssignments; }
  165 + const ShadingBindingGroupInfoMap& getShadingBindingGroupMap () const { return mShadingBindingGroupMap; }
  166 +
  167 + /**
  168 + * Get the groupId assignement data for the current geometry under the transform.
  169 + */
  170 + std::vector<GroupInfo>* findShadingBindingGroups (
  171 + const COLLADAFW::UniqueId& geometryId,
  172 + const COLLADAFW::UniqueId& transformId,
  173 + const COLLADAFW::MaterialId& shadingEngineId );
  174 +
  175 + /**
  176 + * Get the groupId assignement data for the current geometry under the transform.
  177 + */
  178 + std::vector<GroupInfo>* findShadingBindingGroups (
  179 + const ShadingBinding& shadingBinding );
170 180
171 181 private:
172 182
@@ -188,7 +198,8 @@ namespace COLLADAMaya
188 198 */
189 199 void createGroupNodes (
190 200 const COLLADAFW::Mesh* mesh,
191   - const size_t geometryInstanceIndex );
  201 + const COLLADAFW::UniqueId& transformNodeId,
  202 + size_t& geometryInstanceIndex );
192 203
193 204 /**
194 205 * Create the object group instances and the object groups and write it into the maya file.
@@ -196,7 +207,7 @@ namespace COLLADAMaya
196 207 void writeObjectGroups (
197 208 const COLLADAFW::Mesh* mesh,
198 209 MayaDM::Mesh &meshNode,
199   - size_t numNodeInstances );
  210 + const COLLADAFW::UniqueId& transformNodeId );
200 211
201 212 /**
202 213 * Iterates over the mesh primitives and reads the edge indices.
12 COLLADAMaya/include/COLLADAMayaImageImporter.h
@@ -31,7 +31,6 @@ namespace COLLADAMaya
31 31
32 32 /** The standard name for image without name. */
33 33 static const String IMAGE_NAME;
34   - static const String PLACE_2D_TEXTURE_NAME;
35 34 static const String DEFAULT_TEXTURE_LIST;
36 35
37 36 private:
@@ -45,11 +44,6 @@ namespace COLLADAMaya
45 44 COLLADABU::IDList mImageIdList;
46 45
47 46 /**
48   - * The list with the unique maya place2dtexture names.
49   - */
50   - COLLADABU::IDList mPlace2dTextureIdList;
51   -
52   - /**
53 47 * The map holds the Maya image file objects for the unique image file ids.
54 48 */
55 49 UniqueIdMayaImagesMap mImageIdMayaImageFileMap;
@@ -72,15 +66,15 @@ namespace COLLADAMaya
72 66 */
73 67 void writeConnections ();
74 68
75   - private:
76   -
77 69 /**
78 70 * Returns a pointer to the maya image file with the given image id,
79 71 * or NULL, if it is not in the list.
80 72 */
81 73 const MayaDM::File* findMayaImageFile ( const COLLADAFW::UniqueId& imageId );
82 74
83   - };
  75 + private:
  76 +
  77 + };
84 78
85 79 } // namespace COLLADAMAYA
86 80
2  COLLADAMaya/include/COLLADAMayaLightImporter.h
@@ -64,7 +64,7 @@ namespace COLLADAMaya
64 64 * The map holds the unique ids of the light nodes to the maya specific nodes.
65 65 * Need for the instances.
66 66 */
67   - UniqueIdMayaNodesMap mMayaLightNodesMap;
  67 + UniqueIdMayaNodeMap mMayaLightNodesMap;
68 68
69 69 /**
70 70 * The map holds the maya light objects for the connections.
4 COLLADAMaya/include/COLLADAMayaMaterialExporter.h
@@ -50,10 +50,12 @@ namespace COLLADAMaya
50 50
51 51 class ExportedEffect
52 52 {
53   - MObject* shader; // The shader object, that was use to export the effect
  53 + MObject* shader; // The shader object, that was used to export the effect
54 54 unsigned long mColor; // The color that was used to export the effect
55 55 };
56 56
  57 + private:
  58 +
57 59 /** Pointer to the document exporter */
58 60 DocumentExporter* mDocumentExporter;
59 61
100 COLLADAMaya/include/COLLADAMayaMaterialImporter.h
@@ -18,6 +18,8 @@
18 18
19 19 #include "COLLADAMayaStableHeaders.h"
20 20 #include "COLLADAMayaBaseImporter.h"
  21 +#include "COLLADAMayaShadingBinding.h"
  22 +#include "COLLADAMayaGeometryBinding.h"
21 23
22 24 #include "COLLADABUIDList.h"
23 25
@@ -64,58 +66,26 @@ namespace COLLADAMaya
64 66
65 67 /**
66 68 * The maya shading engine and material info.
  69 + * Holds the shadingEngine and the materialInfo.
67 70 */
68 71 class ShadingData
69 72 {
70 73 private:
71   - MayaDM::ShadingEngine* mShadingEngine;
72   - MayaDM::MaterialInfo* mMaterialInfo;
  74 + MayaDM::ShadingEngine mShadingEngine;
  75 + MayaDM::MaterialInfo mMaterialInfo;
73 76
74 77 public:
75   - ShadingData () : mShadingEngine (0), mMaterialInfo (0) {}
76   - ShadingData (
77   - MayaDM::ShadingEngine* shadingEngine,
78   - MayaDM::MaterialInfo* materialInfo )
  78 + ShadingData () {}
  79 + ShadingData ( const MayaDM::ShadingEngine& shadingEngine, const MayaDM::MaterialInfo& materialInfo )
79 80 : mShadingEngine ( shadingEngine )
80 81 , mMaterialInfo ( materialInfo )
81 82 {}
82   - virtual ~ShadingData()
83   - {
84   - delete mShadingEngine;
85   - delete mMaterialInfo;
86   - }
87   -
88   - MayaDM::ShadingEngine* getShadingEngine () const { return mShadingEngine; }
89   - MayaDM::MaterialInfo* getMaterialInfo () const { return mMaterialInfo; }
90   - };
91   - typedef std::map<COLLADAFW::UniqueId, ShadingData*> ShadingDataMap;
92   -
93   - private:
94   -
95   - /**
96   - * The binding of a geometry instance to a material.
97   - */
98   - class ShadingBinding
99   - {
100   - private:
101   - COLLADAFW::UniqueId mGeometryId;
102   - COLLADAFW::UniqueId mTransformNodeId;
103   - COLLADAFW::UniqueId mMaterialId;
104 83
105   - public:
106   - ShadingBinding () {}
107   - virtual ~ShadingBinding () {}
108   -
109   - const COLLADAFW::UniqueId& getGeometryId () const { return mGeometryId; }
110   - void setGeometryId ( const COLLADAFW::UniqueId& val ) { mGeometryId = val; }
111   -
112   - const COLLADAFW::UniqueId& getTransformNodeId () const { return mTransformNodeId; }
113   - void setTransformNodeId ( const COLLADAFW::UniqueId& val ) { mTransformNodeId = val; }
114   -
115   - const COLLADAFW::UniqueId& getMaterialId () const { return mMaterialId; }
116   - void setMaterialId ( const COLLADAFW::UniqueId& val ) { mMaterialId = val; }
  84 + const MayaDM::ShadingEngine& getShadingEngine () const { return mShadingEngine; }
  85 + const MayaDM::MaterialInfo& getMaterialInfo () const { return mMaterialInfo; }
117 86 };
118   - typedef std::map<COLLADAFW::MaterialId, std::set<ShadingBinding*>> ShadingEngineBindingMap;
  87 + /** Holds for a material id the shadingEngine and materialInfo. */
  88 + typedef std::map<COLLADAFW::UniqueId, ShadingData*> ShadingDataMap;
119 89
120 90 private:
121 91
@@ -153,7 +123,7 @@ namespace COLLADAMaya
153 123 /**
154 124 * The map holds for every shader engine a list of geometry ids, which use this shader engine.
155 125 */
156   - ShadingEngineBindingMap mShadingEngineBindingMap;
  126 + GeometryBindingMaterialInfosMap mGeometryBindingMaterialInfosMap;
157 127
158 128 public:
159 129
@@ -168,7 +138,6 @@ namespace COLLADAMaya
168 138
169 139 /** Write the shader data into the maya file. */
170 140 void writeShaderData (
171   - const COLLADAFW::InstanceGeometry::MaterialBinding& materialBinding,
172 141 const COLLADAFW::UniqueId& transformNodeId,
173 142 const COLLADAFW::InstanceGeometry* instanceGeometry );
174 143
@@ -189,14 +158,20 @@ namespace COLLADAMaya
189 158
190 159 private:
191 160
192   - /** Connect the material with the shading engine and the material info. */
  161 + /**
  162 + * Connect the material with the shading engine and the material info.
  163 + */
193 164 void connectShadingEngines ();
194 165
195   - /** Connect the material with the depending geometries. */
196   - void connectGeometries ();
  166 + /**
  167 + * Connects the shading engines with the object groups.
  168 + */
  169 + void connectShadingEngineObjectGroups ();
197 170
198   - /** If there are some object groups, we have to connect them with the geometries. */
199   - void connectGeometryGroups ();
  171 + /**
  172 + * Connects the material with the depending geometries.
  173 + */
  174 + void connectGeometries ();
200 175
201 176 /**
202 177 * Connects the default shader list with the materials.