Merge branch 'master' into lws-leak
commit
ef66dfb5c7
|
@ -7,10 +7,10 @@ on:
|
|||
branches: [ master ]
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
contents: write # to fetch code (actions/checkout),and release
|
||||
|
||||
jobs:
|
||||
job:
|
||||
build:
|
||||
name: ${{ matrix.name }}-build-and-test
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
|
@ -70,12 +70,12 @@ jobs:
|
|||
- name: Set Windows specific CMake arguments
|
||||
if: contains(matrix.name, 'windows')
|
||||
id: windows_extra_cmake_args
|
||||
run: echo "::set-output name=args::-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1 -DASSIMP_BUILD_ZLIB=1"
|
||||
run: echo ":set-output name=args::=-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set Hunter specific CMake arguments
|
||||
if: contains(matrix.name, 'hunter')
|
||||
id: hunter_extra_cmake_args
|
||||
run: echo "::set-output name=args::-DBUILD_SHARED_LIBS=OFF -DASSIMP_HUNTER_ENABLED=ON -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/cmake/polly/${{ matrix.toolchain }}.cmake"
|
||||
run: echo "args=-DBUILD_SHARED_LIBS=OFF -DASSIMP_HUNTER_ENABLED=ON -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/cmake/polly/${{ matrix.toolchain }}.cmake" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: configure and build
|
||||
uses: lukka/run-cmake@v3
|
||||
|
@ -92,7 +92,7 @@ jobs:
|
|||
- name: Exclude certain tests in Hunter specific builds
|
||||
if: contains(matrix.name, 'hunter')
|
||||
id: hunter_extra_test_args
|
||||
run: echo "::set-output name=args::--gtest_filter=-utOpenGEXImportExport.Importissue1340_EmptyCameraObject:utColladaZaeImportExport.importBlenFromFileTest"
|
||||
run: echo "args=--gtest_filter=-utOpenGEXImportExport.Importissue1340_EmptyCameraObject:utColladaZaeImportExport.importBlenFromFileTest" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: test
|
||||
run: cd build/bin && ./unit ${{ steps.hunter_extra_test_args.outputs.args }}
|
||||
|
@ -101,5 +101,89 @@ jobs:
|
|||
- uses: actions/upload-artifact@v4
|
||||
if: matrix.name == 'windows-msvc'
|
||||
with:
|
||||
name: 'assimp-bins-${{ matrix.name }}-${{ github.sha }}'
|
||||
path: build/bin
|
||||
name: 'assimp-bins-${{ matrix.name }}'
|
||||
path: build/bin/assimp*.exe
|
||||
|
||||
- uses: marvinpinto/action-automatic-releases@latest
|
||||
if: contains(matrix.name, 'windows-msvc-hunter')
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: "master"
|
||||
prerelease: true
|
||||
title: "AutoRelease"
|
||||
files: |
|
||||
build/bin/assimp*.exe
|
||||
|
||||
create-release:
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- id: create-release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
|
||||
with:
|
||||
tag_name: '${{github.ref}}'
|
||||
release_name: 'Release ${{github.ref}}'
|
||||
draft: false
|
||||
prerelease: true
|
||||
- run: |
|
||||
echo '${{steps.create-release.outputs.upload_url}}' > release_upload_url.txt
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: create-release
|
||||
path: release_upload_url.txt
|
||||
|
||||
upload-release:
|
||||
strategy:
|
||||
matrix:
|
||||
name: [ubuntu-latest-g++, macos-latest-clang++, windows-latest-cl.exe, ubuntu-latest-clang++, ubuntu-gcc-hunter, macos-clang-hunter, windows-msvc-hunter]
|
||||
# For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux.
|
||||
include:
|
||||
- name: windows-latest-cl.exe
|
||||
os: windows-latest
|
||||
cxx: cl.exe
|
||||
cc: cl.exe
|
||||
- name: ubuntu-latest-clang++
|
||||
os: ubuntu-latest
|
||||
cxx: clang++
|
||||
cc: clang
|
||||
- name: macos-latest-clang++
|
||||
os: macos-latest
|
||||
cxx: clang++
|
||||
cc: clang
|
||||
- name: ubuntu-latest-g++
|
||||
os: ubuntu-latest
|
||||
cxx: g++
|
||||
cc: gcc
|
||||
- name: ubuntu-gcc-hunter
|
||||
os: ubuntu-latest
|
||||
toolchain: ninja-gcc-cxx17-fpic
|
||||
- name: macos-clang-hunter
|
||||
os: macos-latest
|
||||
toolchain: ninja-clang-cxx17-fpic
|
||||
- name: windows-msvc-hunter
|
||||
os: windows-latest
|
||||
toolchain: ninja-vs-win64-cxx17
|
||||
|
||||
needs: [create-release]
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: create-release
|
||||
- id: upload-url
|
||||
run: |
|
||||
echo "url=$(cat create-release/release_upload_url.txt)" >> $GITHUB_OUTPUT
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: 'assimp-bins-${{ matrix.name }}-${{ github.sha }}'
|
||||
- uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: '${{secrets.GITHUB_TOKEN}}'
|
||||
with:
|
||||
files: |
|
||||
*.zip
|
||||
|
||||
|
|
|
@ -2128,6 +2128,10 @@ void FBXConverter::SetTextureProperties(aiMaterial *out_mat, const TextureMap &_
|
|||
TrySetTextureProperties(out_mat, _textures, "Maya|emissionColor", aiTextureType_EMISSION_COLOR, mesh);
|
||||
TrySetTextureProperties(out_mat, _textures, "Maya|metalness", aiTextureType_METALNESS, mesh);
|
||||
TrySetTextureProperties(out_mat, _textures, "Maya|diffuseRoughness", aiTextureType_DIFFUSE_ROUGHNESS, mesh);
|
||||
TrySetTextureProperties(out_mat, _textures, "Maya|base", aiTextureType_MAYA_BASE, mesh);
|
||||
TrySetTextureProperties(out_mat, _textures, "Maya|specular", aiTextureType_MAYA_SPECULAR, mesh);
|
||||
TrySetTextureProperties(out_mat, _textures, "Maya|specularColor", aiTextureType_MAYA_SPECULAR_COLOR, mesh);
|
||||
TrySetTextureProperties(out_mat, _textures, "Maya|specularRoughness", aiTextureType_MAYA_SPECULAR_ROUGHNESS, mesh);
|
||||
|
||||
// Maya stingray
|
||||
TrySetTextureProperties(out_mat, _textures, "Maya|TEX_color_map", aiTextureType_BASE_COLOR, mesh);
|
||||
|
|
|
@ -512,6 +512,11 @@ void aiGetMemoryRequirements(const C_STRUCT aiScene *pIn,
|
|||
ASSIMP_END_EXCEPTION_REGION(void);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
ASSIMP_API const C_STRUCT aiTexture *aiGetEmbeddedTexture(const C_STRUCT aiScene *pIn, const char *filename) {
|
||||
return pIn->GetEmbeddedTexture(filename);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
ASSIMP_API aiPropertyStore *aiCreatePropertyStore(void) {
|
||||
return reinterpret_cast<aiPropertyStore *>(new PropertyMap());
|
||||
|
@ -1268,7 +1273,6 @@ ASSIMP_API void aiQuaternionInterpolate(
|
|||
aiQuaternion::Interpolate(*dst, *start, *end, factor);
|
||||
}
|
||||
|
||||
|
||||
// stb_image is a lightweight image loader. It is shared by:
|
||||
// - M3D import
|
||||
// - PBRT export
|
||||
|
@ -1279,21 +1283,21 @@ ASSIMP_API void aiQuaternionInterpolate(
|
|||
#define ASSIMP_HAS_M3D ((!ASSIMP_BUILD_NO_EXPORT && !ASSIMP_BUILD_NO_M3D_EXPORTER) || !ASSIMP_BUILD_NO_M3D_IMPORTER)
|
||||
|
||||
#ifndef STB_USE_HUNTER
|
||||
# if ASSIMP_HAS_PBRT_EXPORT
|
||||
# define ASSIMP_NEEDS_STB_IMAGE 1
|
||||
# elif ASSIMP_HAS_M3D
|
||||
# define ASSIMP_NEEDS_STB_IMAGE 1
|
||||
# define STBI_ONLY_PNG
|
||||
# endif
|
||||
#if ASSIMP_HAS_PBRT_EXPORT
|
||||
#define ASSIMP_NEEDS_STB_IMAGE 1
|
||||
#elif ASSIMP_HAS_M3D
|
||||
#define ASSIMP_NEEDS_STB_IMAGE 1
|
||||
#define STBI_ONLY_PNG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Ensure all symbols are linked correctly
|
||||
#if ASSIMP_NEEDS_STB_IMAGE
|
||||
// Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy.
|
||||
# define STBI_ONLY_PNG
|
||||
# ifdef ASSIMP_USE_STB_IMAGE_STATIC
|
||||
# define STB_IMAGE_STATIC
|
||||
# endif
|
||||
# define STB_IMAGE_IMPLEMENTATION
|
||||
# include "Common/StbCommon.h"
|
||||
// Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy.
|
||||
#define STBI_ONLY_PNG
|
||||
#ifdef ASSIMP_USE_STB_IMAGE_STATIC
|
||||
#define STB_IMAGE_STATIC
|
||||
#endif
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "Common/StbCommon.h"
|
||||
#endif
|
||||
|
|
|
@ -1067,7 +1067,7 @@ void SceneCombiner::CopyScene(aiScene **_dest, const aiScene *src, bool allocate
|
|||
dest->mFlags = src->mFlags;
|
||||
|
||||
// source private data might be nullptr if the scene is user-allocated (i.e. for use with the export API)
|
||||
if (dest->mPrivate != nullptr) {
|
||||
if (src->mPrivate != nullptr) {
|
||||
ScenePriv(dest)->mPPStepsApplied = ScenePriv(src) ? ScenePriv(src)->mPPStepsApplied : 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -380,3 +380,4 @@ ai_real ImproveCacheLocalityProcess::ProcessMesh(aiMesh *pMesh, unsigned int mes
|
|||
}
|
||||
|
||||
} // namespace Assimp
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
struct aiScene;
|
||||
struct aiTexture;
|
||||
struct aiFileIO;
|
||||
|
||||
typedef void (*aiLogStreamCallback)(const char * /* message */, char * /* user */);
|
||||
|
@ -373,6 +374,13 @@ ASSIMP_API void aiGetMemoryRequirements(
|
|||
const C_STRUCT aiScene *pIn,
|
||||
C_STRUCT aiMemoryInfo *in);
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Returns an embedded texture, or nullptr.
|
||||
* @param pIn Input asset.
|
||||
* @param filename Texture path extracted from aiGetMaterialString.
|
||||
*/
|
||||
ASSIMP_API const C_STRUCT aiTexture *aiGetEmbeddedTexture(const C_STRUCT aiScene *pIn, const char *filename);
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
/** Create an empty property store. Property stores are used to collect import
|
||||
* settings.
|
||||
|
|
|
@ -292,6 +292,14 @@ enum aiTextureType {
|
|||
aiTextureType_DIFFUSE_ROUGHNESS = 16,
|
||||
aiTextureType_AMBIENT_OCCLUSION = 17,
|
||||
|
||||
/** Unknown texture
|
||||
*
|
||||
* A texture reference that does not match any of the definitions
|
||||
* above is considered to be 'unknown'. It is still imported,
|
||||
* but is excluded from any further post-processing.
|
||||
*/
|
||||
aiTextureType_UNKNOWN = 18,
|
||||
|
||||
/** PBR Material Modifiers
|
||||
* Some modern renderers have further PBR modifiers that may be overlaid
|
||||
* on top of the 'base' PBR materials for additional realism.
|
||||
|
@ -318,20 +326,20 @@ enum aiTextureType {
|
|||
*/
|
||||
aiTextureType_TRANSMISSION = 21,
|
||||
|
||||
/** Unknown texture
|
||||
*
|
||||
* A texture reference that does not match any of the definitions
|
||||
* above is considered to be 'unknown'. It is still imported,
|
||||
* but is excluded from any further post-processing.
|
||||
*/
|
||||
aiTextureType_UNKNOWN = 18,
|
||||
/**
|
||||
* Maya material declarations
|
||||
*/
|
||||
aiTextureType_MAYA_BASE = 22,
|
||||
aiTextureType_MAYA_SPECULAR = 23,
|
||||
aiTextureType_MAYA_SPECULAR_COLOR = 24,
|
||||
aiTextureType_MAYA_SPECULAR_ROUGHNESS = 25,
|
||||
|
||||
#ifndef SWIG
|
||||
_aiTextureType_Force32Bit = INT_MAX
|
||||
#endif
|
||||
};
|
||||
|
||||
#define AI_TEXTURE_TYPE_MAX aiTextureType_TRANSMISSION
|
||||
#define AI_TEXTURE_TYPE_MAX aiTextureType_MAYA_SPECULAR_ROUGHNESS
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
/**
|
||||
|
|
|
@ -401,8 +401,9 @@ struct ASSIMP_API aiScene {
|
|||
//! Returns a short filename from a full path
|
||||
static const char* GetShortFilename(const char* filename) {
|
||||
const char* lastSlash = strrchr(filename, '/');
|
||||
if (lastSlash == nullptr) {
|
||||
lastSlash = strrchr(filename, '\\');
|
||||
const char* lastBackSlash = strrchr(filename, '\\');
|
||||
if (lastSlash < lastBackSlash) {
|
||||
lastSlash = lastBackSlash;
|
||||
}
|
||||
const char* shortFilename = lastSlash != nullptr ? lastSlash + 1 : filename;
|
||||
return shortFilename;
|
||||
|
|
|
@ -260,6 +260,10 @@ TEST_F(MaterialSystemTest, testMaterialTextureTypeEnum) {
|
|||
case aiTextureType_METALNESS:
|
||||
case aiTextureType_DIFFUSE_ROUGHNESS:
|
||||
case aiTextureType_AMBIENT_OCCLUSION:
|
||||
case aiTextureType_MAYA_BASE:
|
||||
case aiTextureType_MAYA_SPECULAR:
|
||||
case aiTextureType_MAYA_SPECULAR_COLOR:
|
||||
case aiTextureType_MAYA_SPECULAR_ROUGHNESS:
|
||||
case aiTextureType_SHEEN:
|
||||
case aiTextureType_CLEARCOAT:
|
||||
case aiTextureType_TRANSMISSION:
|
||||
|
|
Loading…
Reference in New Issue