Skip to content

Commit

Permalink
Merge pull request #114 from FishingCactus/Max2012
Browse files Browse the repository at this point in the history
3DSMax fixes + support for 2012
  • Loading branch information
fabrobinet committed Oct 3, 2012
2 parents 68317cf + e0aa6e4 commit b2a151a
Show file tree
Hide file tree
Showing 34 changed files with 4,137 additions and 1,187 deletions.
36 changes: 36 additions & 0 deletions COLLADAFramework/include/COLLADAFWMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ namespace COLLADAFW
*/
MeshVertexData mUVCoords;

/**
* The Tangent array
*/

MeshVertexData mTangents;

/**
* The Binormal array
*/

MeshVertexData mBinormals;

/**
* Geometric primitives, which assemble values from the inputs into vertex attribute data.
* Each primitive element holds the index arrays of the used input elements
Expand Down Expand Up @@ -215,6 +227,30 @@ namespace COLLADAFW
return 0;
}

/**
* The 3 dimensional tangent coordinates array.
* Tangent coordinates can be stored as float or double values.
*/
const MeshVertexData& getTangents () const { return mTangents; }

/**
* The 3 dimensional tangent coordinates array.
* Tangent coordinates can be stored as float or double values.
*/
MeshVertexData& getTangents () { return mTangents; }

/**
* The 3 dimensional binormal coordinates array.
* Binormal coordinates can be stored as float or double values.
*/
const MeshVertexData& getBinormals () const { return mBinormals; }

/**
* The 3 dimensional binormal coordinates array.
* Binormal coordinates can be stored as float or double values.
*/
MeshVertexData& getBinormals () { return mBinormals; }

/**
* Geometric primitives, which assemble values from the inputs into vertex attribute data.
* Can be any combination of the following in any order:
Expand Down
49 changes: 48 additions & 1 deletion COLLADAFramework/include/COLLADAFWMeshPrimitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ namespace COLLADAFW
*/
UIntValuesArray mNormalIndices;

/**
* The index list of the tangent array (support of multiple uv sets).
*/
UIntValuesArray mTangentIndices;

/**
* The index list of the binormal array (support of multiple uv sets).
*/
UIntValuesArray mBinormalIndices;


/**
* The index list of the colors array (support of multiple colors).
*/
Expand All @@ -117,7 +128,7 @@ namespace COLLADAFW
* The index list of the uv coordinates array (support of multiple uv sets).
*/
IndexListArray mUVCoordIndicesArray;

public:

/**
Expand Down Expand Up @@ -200,6 +211,42 @@ namespace COLLADAFW
/**Returns true if the mesh primitive has normals.*/
bool hasNormalIndices() const { return !mNormalIndices.empty(); }

/**
* The index list of the normals array.
*/
UIntValuesArray& getTangentIndices () { return mTangentIndices; }

/**
* The index list of the normals array.
*/
const UIntValuesArray& getTangentIndices () const{ return mTangentIndices; }

/**
* The index list of the normals array.
*/
void setTagentIndices ( const UIntValuesArray& TangentIndices ) { mTangentIndices = TangentIndices; }

/**Returns true if the mesh primitive has normals.*/
bool hasTangentIndices() const { return !mTangentIndices.empty(); }

/**
* The index list of the normals array.
*/
UIntValuesArray& getBinormalIndices () { return mBinormalIndices; }

/**
* The index list of the normals array.
*/
const UIntValuesArray& getBinormalIndices () const{ return mBinormalIndices; }

/**
* The index list of the normals array.
*/
void setBinormalIndices ( const UIntValuesArray& BinormalIndices ) { mBinormalIndices = BinormalIndices; }

/**Returns true if the mesh primitive has normals.*/
bool hasBinormalIndices() const { return !mBinormalIndices.empty(); }

/**
* The index list of the colors array.
*/
Expand Down
276 changes: 138 additions & 138 deletions COLLADAMax/COLLADAMax.sln

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions COLLADAMax/include/COLLADAMaxDocumentExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace COLLADAMax

class AnimationExporter;

typedef std::map<String, String> StringToStringMap;

/** Class that uniquely identifies object.*/
class ObjectIdentifier
{
Expand Down Expand Up @@ -164,6 +166,12 @@ namespace COLLADAMax
return mOptions;
}

/**
* Returns a pointer to the collada stream writer.
* @return StreamWriter* Pointer to the collada stream writer
*/
COLLADASW::StreamWriter & getStreamWriter() { return mStreamWriter; };

/** The uri of the main output file.*/
const COLLADASW::URI& getOutputFileUri()const { return mOutputFileUri; }

Expand Down
13 changes: 13 additions & 0 deletions COLLADAMax/include/COLLADAMaxEffectExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "COLLADAMaxExportSceneGraph.h"
#include "COLLADAMaxMaterialExporter.h"
#include "COLLADAMaxEffectTextureExporter.h"
#include "COLLADAMaxExtra.h"
#include "COLLADAMaxTypes.h"

Expand Down Expand Up @@ -174,6 +175,8 @@ namespace COLLADAMax

AnimationExporter * mAnimationExporter;

EffectTextureExporter mTextureExporter;

/** List of ids of the already exported materials that are used in the COLLADASW file.*/
ExportedEffectIdAndNameList * mExportedEffectIdList;

Expand All @@ -189,6 +192,10 @@ namespace COLLADAMax
/** Maps material and channels to the IParamBlock of the corresponding StdUVGen*/
MaterialChannelPairParamBlockMap mMaterialChannelPairParamBlockMap;

/**
* The max id with the collada id.
*/
StringToStringMap mMaxIdColladaImageIdMap;

public:
/** Constructor
Expand Down Expand Up @@ -221,6 +228,9 @@ namespace COLLADAMax
return mExportedImageMap;
}

/** Returns the TextureExporter of the effect exporter.*/
EffectTextureExporter* getTextureExporter () { return &mTextureExporter; }

/** Returns the MaterialChannelPairParamBlockMap used by the effect exporter*/
const MaterialChannelPairParamBlockMap & getMaterialChannelPairParamBlockMap() const
{
Expand Down Expand Up @@ -260,6 +270,9 @@ namespace COLLADAMax
/** Exports am common COLLADASW effect created from @a material.*/
void exportCommonEffect ( COLLADASW::EffectProfile & effectProfile, ExportNode* exportNode, Mtl* material, const String & effectId, float weight = 1.0, bool inited = false );

/** Exports a HLSL COLLADASW effect created from @a material.*/
void exportHLSLEffect ( COLLADASW::EffectProfile & effectProfile, ExportNode* exportNode, Mtl* material, const String & effectId, float weight = 1.0, bool inited = false );

/** Exports the material @a material.*/
void exportSimpleEffect ( ExportNode* exportNode, Mtl* material );

Expand Down
Loading

0 comments on commit b2a151a

Please sign in to comment.