Merge branch 'master' into SignCompareFix

pull/3625/head
contriteobserver 2021-01-30 16:57:22 -08:00 committed by GitHub
commit 5a8e00b219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 41 additions and 18 deletions

View File

@ -38,7 +38,7 @@ SET(CMAKE_POLICY_DEFAULT_CMP0012 NEW)
SET(CMAKE_POLICY_DEFAULT_CMP0074 NEW) SET(CMAKE_POLICY_DEFAULT_CMP0074 NEW)
SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW) SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW)
CMAKE_MINIMUM_REQUIRED( VERSION 3.0 ) CMAKE_MINIMUM_REQUIRED( VERSION 3.10 )
# Toggles the use of the hunter package manager # Toggles the use of the hunter package manager
option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF) option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF)

View File

@ -329,8 +329,8 @@ void AMFImporter::Postprocess_AddMetadata(const AMFMetaDataArray &metadataList,
sceneNode.mMetaData = aiMetadata::Alloc(static_cast<unsigned int>(metadataList.size())); sceneNode.mMetaData = aiMetadata::Alloc(static_cast<unsigned int>(metadataList.size()));
size_t meta_idx(0); size_t meta_idx(0);
for (const AMFMetadata &metadata : metadataList) { for (const AMFMetadata *metadata : metadataList) {
sceneNode.mMetaData->Set(static_cast<unsigned int>(meta_idx++), metadata.Type, aiString(metadata.Value)); sceneNode.mMetaData->Set(static_cast<unsigned int>(meta_idx++), metadata->Type, aiString(metadata->Value));
} }
} }

View File

@ -557,7 +557,12 @@ void ColladaLoader::BuildMeshesForNode(const ColladaParser &pParser, const Colla
faceStart += submesh.mNumFaces; faceStart += submesh.mNumFaces;
// assign the material index // assign the material index
dstMesh->mMaterialIndex = matIdx; std::map<std::string, size_t>::const_iterator subMatIt = mMaterialIndexByName.find(submesh.mMaterial);
if (subMatIt != mMaterialIndexByName.end()) {
dstMesh->mMaterialIndex = static_cast<unsigned int>(subMatIt->second);
} else {
dstMesh->mMaterialIndex = matIdx;
}
if (dstMesh->mName.length == 0) { if (dstMesh->mName.length == 0) {
dstMesh->mName = mid.mMeshOrController; dstMesh->mName = mid.mMeshOrController;
} }

View File

@ -1229,7 +1229,7 @@ unsigned int glTF2Exporter::ExportNode(const aiNode* n, Ref<Node>& parent)
node->name = name; node->name = name;
if (!n->mTransformation.IsIdentity()) { if (!n->mTransformation.IsIdentity()) {
if (mScene->mNumAnimations > 0) { if (mScene->mNumAnimations > 0 || (mProperties && mProperties->HasPropertyBool("GLTF2_NODE_IN_TRS"))) {
aiQuaternion quaternion; aiQuaternion quaternion;
n->mTransformation.Decompose(*reinterpret_cast<aiVector3D *>(&node->scale.value), quaternion, *reinterpret_cast<aiVector3D *>(&node->translation.value)); n->mTransformation.Decompose(*reinterpret_cast<aiVector3D *>(&node->scale.value), quaternion, *reinterpret_cast<aiVector3D *>(&node->translation.value));

View File

@ -43,7 +43,7 @@
# 3) Add libassimp using the file lists (eliminates duplication of file names between # 3) Add libassimp using the file lists (eliminates duplication of file names between
# source groups and library command) # source groups and library command)
# #
cmake_minimum_required( VERSION 3.0 ) cmake_minimum_required( VERSION 3.10 )
SET( HEADER_PATH ../include/assimp ) SET( HEADER_PATH ../include/assimp )
if(NOT ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM) if(NOT ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)

View File

@ -78,6 +78,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/Profiler.h> #include <assimp/Profiler.h>
#include <assimp/commonMetaData.h> #include <assimp/commonMetaData.h>
#include <exception>
#include <set> #include <set>
#include <memory> #include <memory>
#include <cctype> #include <cctype>

View File

@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef INCLUDED_AI_IMPORTER_H #ifndef INCLUDED_AI_IMPORTER_H
#define INCLUDED_AI_IMPORTER_H #define INCLUDED_AI_IMPORTER_H
#include <exception>
#include <map> #include <map>
#include <vector> #include <vector>
#include <string> #include <string>

View File

@ -844,7 +844,8 @@ void ValidateDSProcess::Validate(const aiAnimation *pAnimation,
Validate(&pMeshMorphAnim->mName); Validate(&pMeshMorphAnim->mName);
if (!pMeshMorphAnim->mNumKeys) { if (!pMeshMorphAnim->mNumKeys) {
ReportError("Empty mesh morph animation channel"); ReportWarning("Empty mesh morph animation channel");
return;
} }
// otherwise check whether one of the keys exceeds the total duration of the animation // otherwise check whether one of the keys exceeds the total duration of the animation

View File

@ -45,7 +45,7 @@ endif()
# ${gtest_BINARY_DIR}. # ${gtest_BINARY_DIR}.
# Language "C" is required for find_package(Threads). # Language "C" is required for find_package(Threads).
project(gtest CXX C) project(gtest CXX C)
cmake_minimum_required(VERSION 2.6.2) cmake_minimum_required(VERSION 3.10)
if (COMMAND set_up_hermetic_build) if (COMMAND set_up_hermetic_build)
set_up_hermetic_build() set_up_hermetic_build()

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 ) CMAKE_MINIMUM_REQUIRED( VERSION 3.10 )
PROJECT( OpenDDL-Parser ) PROJECT( OpenDDL-Parser )
SET ( OPENDDL_PARSER_VERSION_MAJOR 0 ) SET ( OPENDDL_PARSER_VERSION_MAJOR 0 )
SET ( OPENDDL_PARSER_VERSION_MINOR 1 ) SET ( OPENDDL_PARSER_VERSION_MINOR 1 )

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 3.10)
project(pugixml) project(pugixml)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.10)
project(zip project(zip
LANGUAGES C LANGUAGES C

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 3.10)
# test # test
set(test_out test.out) set(test_out test.out)

View File

@ -59,6 +59,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Public ASSIMP data structures // Public ASSIMP data structures
#include <assimp/types.h> #include <assimp/types.h>
#include <exception>
namespace Assimp { namespace Assimp {
// ======================================================================= // =======================================================================
// Public interface to Assimp // Public interface to Assimp

View File

@ -350,6 +350,10 @@ struct aiMetadata {
} else if (nullptr != mValues[index].mData && AI_AIMETADATA == mValues[index].mType) { } else if (nullptr != mValues[index].mData && AI_AIMETADATA == mValues[index].mType) {
*static_cast<T *>(mValues[index].mData) = value; *static_cast<T *>(mValues[index].mData) = value;
} else { } else {
if (nullptr != mValues[index].mData) {
delete mValues[index].mData;
mValues[index].mData = nullptr;
}
mValues[index].mData = new T(value); mValues[index].mData = new T(value);
} }

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 3.10)
include_directories(./) include_directories(./)
include_directories(./../../) include_directories(./../../)

View File

@ -36,7 +36,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
#---------------------------------------------------------------------- #----------------------------------------------------------------------
cmake_minimum_required( VERSION 3.0 ) cmake_minimum_required( VERSION 3.10 )
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${Assimp_SOURCE_DIR}/test/unit ${Assimp_SOURCE_DIR}/test/unit

View File

@ -51,11 +51,11 @@ class utMetadata: public ::testing::Test {
protected: protected:
aiMetadata *m_data; aiMetadata *m_data;
virtual void SetUp() { void SetUp() override {
m_data = nullptr; m_data = nullptr;
} }
virtual void TearDown() { void TearDown() override {
aiMetadata::Dealloc( m_data ); aiMetadata::Dealloc( m_data );
} }
@ -261,3 +261,12 @@ TEST_F( utMetadata, copy_test ) {
EXPECT_EQ( metaVal, v ); EXPECT_EQ( metaVal, v );
} }
} }
TEST_F( utMetadata, set_test ) {
aiMetadata v;
const std::string key_bool = "test_bool";
v.Set(1, key_bool, true);
v.Set(1, key_bool, true);
v.Set(1, key_bool, true);
v.Set(1, key_bool, true);
}

View File

@ -37,7 +37,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
#---------------------------------------------------------------------- #----------------------------------------------------------------------
cmake_minimum_required( VERSION 3.0 ) cmake_minimum_required( VERSION 3.10 )
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${Assimp_SOURCE_DIR}/include ${Assimp_SOURCE_DIR}/include

View File

@ -37,7 +37,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
#---------------------------------------------------------------------- #----------------------------------------------------------------------
cmake_minimum_required( VERSION 3.0 ) cmake_minimum_required( VERSION 3.10 )
FIND_PACKAGE(DirectX REQUIRED) FIND_PACKAGE(DirectX REQUIRED)