Merge branch 'master' into hl1-mdl-remove-texture-256-clamping-2
commit
b33272b1c8
|
@ -250,7 +250,7 @@ aiNode* COBImporter::BuildNodes(const Node& root,const Scene& scin,aiScene* fill
|
||||||
const Mesh& ndmesh = (const Mesh&)(root);
|
const Mesh& ndmesh = (const Mesh&)(root);
|
||||||
if (ndmesh.vertex_positions.size() && ndmesh.texture_coords.size()) {
|
if (ndmesh.vertex_positions.size() && ndmesh.texture_coords.size()) {
|
||||||
|
|
||||||
typedef std::pair<unsigned int,Mesh::FaceRefList> Entry;
|
typedef std::pair<const unsigned int,Mesh::FaceRefList> Entry;
|
||||||
for(const Entry& reflist : ndmesh.temp_map) {
|
for(const Entry& reflist : ndmesh.temp_map) {
|
||||||
{ // create mesh
|
{ // create mesh
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
|
|
|
@ -1312,7 +1312,6 @@ void SceneCombiner::Copy(aiMetadata** _dest, const aiMetadata* src) {
|
||||||
aiMetadata* dest = *_dest = aiMetadata::Alloc( src->mNumProperties );
|
aiMetadata* dest = *_dest = aiMetadata::Alloc( src->mNumProperties );
|
||||||
std::copy(src->mKeys, src->mKeys + src->mNumProperties, dest->mKeys);
|
std::copy(src->mKeys, src->mKeys + src->mNumProperties, dest->mKeys);
|
||||||
|
|
||||||
dest->mValues = new aiMetadataEntry[src->mNumProperties];
|
|
||||||
for (unsigned int i = 0; i < src->mNumProperties; ++i) {
|
for (unsigned int i = 0; i < src->mNumProperties; ++i) {
|
||||||
aiMetadataEntry& in = src->mValues[i];
|
aiMetadataEntry& in = src->mValues[i];
|
||||||
aiMetadataEntry& out = dest->mValues[i];
|
aiMetadataEntry& out = dest->mValues[i];
|
||||||
|
|
|
@ -37,7 +37,7 @@ The ASSBIN file format is composed of chunks to represent the hierarchical aiSce
|
||||||
This makes the format extensible and allows backward-compatibility with future data structure
|
This makes the format extensible and allows backward-compatibility with future data structure
|
||||||
versions. The <tt><root>/code/assbin_chunks.h</tt> header contains some magic constants
|
versions. The <tt><root>/code/assbin_chunks.h</tt> header contains some magic constants
|
||||||
for use by stand-alone ASSBIN loaders. Also, Assimp's own file writer can be found
|
for use by stand-alone ASSBIN loaders. Also, Assimp's own file writer can be found
|
||||||
in <tt><root>/tools/assimp_cmd/WriteDumb.cpp</tt> (yes, the 'b' is no typo ...).
|
in <tt><root>/tools/assimp_cmd/WriteDump.cpp</tt> (yes, the 'b' is no typo ...).
|
||||||
|
|
||||||
@verbatim
|
@verbatim
|
||||||
|
|
||||||
|
|
|
@ -448,6 +448,12 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
|
||||||
std::vector<T> tempData;
|
std::vector<T> tempData;
|
||||||
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
|
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
|
||||||
|
|
||||||
|
if (tempData.size() != vertex_count) {
|
||||||
|
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByVertice mapping: ")
|
||||||
|
<< tempData.size() << ", expected " << vertex_count);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
data_out.resize(vertex_count);
|
data_out.resize(vertex_count);
|
||||||
for (size_t i = 0, e = tempData.size(); i < e; ++i) {
|
for (size_t i = 0, e = tempData.size(); i < e; ++i) {
|
||||||
|
|
||||||
|
@ -461,10 +467,17 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
|
||||||
std::vector<T> tempData;
|
std::vector<T> tempData;
|
||||||
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
|
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
|
||||||
|
|
||||||
data_out.resize(vertex_count);
|
|
||||||
|
|
||||||
std::vector<int> uvIndices;
|
std::vector<int> uvIndices;
|
||||||
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
|
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
|
||||||
|
|
||||||
|
if (uvIndices.size() != vertex_count) {
|
||||||
|
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByVertice mapping: ")
|
||||||
|
<< uvIndices.size() << ", expected " << vertex_count);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
data_out.resize(vertex_count);
|
||||||
|
|
||||||
for (size_t i = 0, e = uvIndices.size(); i < e; ++i) {
|
for (size_t i = 0, e = uvIndices.size(); i < e; ++i) {
|
||||||
|
|
||||||
const unsigned int istart = mapping_offsets[i], iend = istart + mapping_counts[i];
|
const unsigned int istart = mapping_offsets[i], iend = istart + mapping_counts[i];
|
||||||
|
@ -493,16 +506,17 @@ void ResolveVertexDataArray(std::vector<T>& data_out, const Scope& source,
|
||||||
std::vector<T> tempData;
|
std::vector<T> tempData;
|
||||||
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
|
ParseVectorDataArray(tempData, GetRequiredElement(source, dataElementName));
|
||||||
|
|
||||||
data_out.resize(vertex_count);
|
|
||||||
|
|
||||||
std::vector<int> uvIndices;
|
std::vector<int> uvIndices;
|
||||||
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
|
ParseVectorDataArray(uvIndices,GetRequiredElement(source,indexDataElementName));
|
||||||
|
|
||||||
if (uvIndices.size() != vertex_count) {
|
if (uvIndices.size() != vertex_count) {
|
||||||
FBXImporter::LogError("length of input data unexpected for ByPolygonVertex mapping");
|
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygonVertex mapping: ")
|
||||||
|
<< uvIndices.size() << ", expected " << vertex_count);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data_out.resize(vertex_count);
|
||||||
|
|
||||||
const T empty;
|
const T empty;
|
||||||
unsigned int next = 0;
|
unsigned int next = 0;
|
||||||
for(int i : uvIndices) {
|
for(int i : uvIndices) {
|
||||||
|
|
|
@ -323,7 +323,7 @@ public:
|
||||||
// oh well.
|
// oh well.
|
||||||
bool have_param = false, have_point = false;
|
bool have_param = false, have_point = false;
|
||||||
IfcVector3 point;
|
IfcVector3 point;
|
||||||
for(const Entry sel :entity.Trim1) {
|
for(const Entry& sel :entity.Trim1) {
|
||||||
if (const ::Assimp::STEP::EXPRESS::REAL* const r = sel->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) {
|
if (const ::Assimp::STEP::EXPRESS::REAL* const r = sel->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) {
|
||||||
range.first = *r;
|
range.first = *r;
|
||||||
have_param = true;
|
have_param = true;
|
||||||
|
@ -340,7 +340,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
have_param = false, have_point = false;
|
have_param = false, have_point = false;
|
||||||
for(const Entry sel :entity.Trim2) {
|
for(const Entry& sel :entity.Trim2) {
|
||||||
if (const ::Assimp::STEP::EXPRESS::REAL* const r = sel->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) {
|
if (const ::Assimp::STEP::EXPRESS::REAL* const r = sel->ToPtr<::Assimp::STEP::EXPRESS::REAL>()) {
|
||||||
range.second = *r;
|
range.second = *r;
|
||||||
have_param = true;
|
have_param = true;
|
||||||
|
|
|
@ -1421,11 +1421,11 @@ void MDLImporter::InternReadFile_3DGS_MDL7( )
|
||||||
avOutList[i].reserve(3);
|
avOutList[i].reserve(3);
|
||||||
|
|
||||||
// buffer to held the names of all groups in the file
|
// buffer to held the names of all groups in the file
|
||||||
const size_t buffersize( AI_MDL7_MAX_GROUPNAMESIZE*pcHeader->groups_num );
|
const size_t buffersize(AI_MDL7_MAX_GROUPNAMESIZE*pcHeader->groups_num);
|
||||||
char* aszGroupNameBuffer = new char[ buffersize ];
|
char* aszGroupNameBuffer = new char[ buffersize ];
|
||||||
|
|
||||||
// read all groups
|
// read all groups
|
||||||
for (unsigned int iGroup = 0; iGroup < (unsigned int)pcHeader->groups_num;++iGroup) {
|
for (unsigned int iGroup = 0; iGroup < (unsigned int)pcHeader->groups_num; ++iGroup) {
|
||||||
MDL::IntGroupInfo_MDL7 groupInfo((BE_NCONST MDL::Group_MDL7*)szCurrent,iGroup);
|
MDL::IntGroupInfo_MDL7 groupInfo((BE_NCONST MDL::Group_MDL7*)szCurrent,iGroup);
|
||||||
szCurrent = (const unsigned char*)(groupInfo.pcGroup+1);
|
szCurrent = (const unsigned char*)(groupInfo.pcGroup+1);
|
||||||
|
|
||||||
|
|
|
@ -685,7 +685,7 @@ bool XGLImporter::ReadMesh(TempScope& scope)
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally extract output meshes and add them to the scope
|
// finally extract output meshes and add them to the scope
|
||||||
typedef std::pair<unsigned int, TempMaterialMesh> pairt;
|
typedef std::pair<const unsigned int, TempMaterialMesh> pairt;
|
||||||
for(const pairt& p : bymat) {
|
for(const pairt& p : bymat) {
|
||||||
aiMesh* const m = ToOutputMesh(p.second);
|
aiMesh* const m = ToOutputMesh(p.second);
|
||||||
scope.meshes_linear.push_back(m);
|
scope.meshes_linear.push_back(m);
|
||||||
|
|
|
@ -54,7 +54,7 @@ ADD_EXECUTABLE( assimp_cmd
|
||||||
Main.cpp
|
Main.cpp
|
||||||
Main.h
|
Main.h
|
||||||
resource.h
|
resource.h
|
||||||
WriteDumb.cpp
|
WriteDump.cpp
|
||||||
Info.cpp
|
Info.cpp
|
||||||
Export.cpp
|
Export.cpp
|
||||||
)
|
)
|
||||||
|
|
|
@ -168,7 +168,7 @@ bool ExportModel(const aiScene* pOut,
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
/** assimp_dump utility
|
/** assimp_dump utility
|
||||||
* @param params Command line parameters to 'assimp dumb'
|
* @param params Command line parameters to 'assimp dump'
|
||||||
* @param Number of params
|
* @param Number of params
|
||||||
* @return An #AssimpCmdError value.*/
|
* @return An #AssimpCmdError value.*/
|
||||||
int Assimp_Dump (
|
int Assimp_Dump (
|
||||||
|
|
|
@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @file WriteTextDumb.cpp
|
/** @file WriteDump.cpp
|
||||||
* @brief Implementation of the 'assimp dump' utility
|
* @brief Implementation of the 'assimp dump' utility
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue