Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild for assimp 5.4.3 #45

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci_support/linux_64_ffmpeg6.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- gcc
c_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_64_ffmpeg7.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- gcc
c_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_aarch64_ffmpeg6.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BUILD:
- aarch64-conda_cos7-linux-gnu
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- gcc
c_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux_aarch64_ffmpeg7.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BUILD:
- aarch64-conda_cos7-linux-gnu
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- gcc
c_compiler_version:
Expand Down
4 changes: 3 additions & 1 deletion .ci_support/linux_ppc64le_ffmpeg6.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- gcc
c_compiler_version:
Expand All @@ -24,6 +24,8 @@ ffmpeg:
- '6'
glib:
- '2'
libgdal:
- '3.9'
libuuid:
- '2'
target_platform:
Expand Down
4 changes: 3 additions & 1 deletion .ci_support/linux_ppc64le_ffmpeg7.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- gcc
c_compiler_version:
Expand All @@ -24,6 +24,8 @@ ffmpeg:
- '7'
glib:
- '2'
libgdal:
- '3.9'
libuuid:
- '2'
target_platform:
Expand Down
8 changes: 8 additions & 0 deletions .ci_support/migrations/assimp543.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
__migrator:
build_number: 1
commit_message: Rebuild for assimp 5.4.3
kind: version
migration_number: 1
assimp:
- 5.4.3
migrator_ts: 1725100349.1005585
2 changes: 1 addition & 1 deletion .ci_support/osx_64_ffmpeg6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET:
MACOSX_SDK_VERSION:
- '10.13'
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- clang
c_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_64_ffmpeg7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET:
MACOSX_SDK_VERSION:
- '10.13'
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- clang
c_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_arm64_ffmpeg6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET:
MACOSX_SDK_VERSION:
- '11.0'
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- clang
c_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_arm64_ffmpeg7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MACOSX_DEPLOYMENT_TARGET:
MACOSX_SDK_VERSION:
- '11.0'
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- clang
c_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/win_64_ffmpeg6.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- vs2019
c_stdlib:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/win_64_ffmpeg7.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
assimp:
- 5.4.2
- 5.4.3
c_compiler:
- vs2019
c_stdlib:
Expand Down
2 changes: 2 additions & 0 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .scripts/run_win_build.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion build-locally.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions recipe/641.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
From df5f9654d7c3420fd923fd0c2a88e4b72d10e261 Mon Sep 17 00:00:00 2001
From: Ian Chen <[email protected]>
Date: Thu, 5 Sep 2024 15:13:31 -0700
Subject: [PATCH] Fix AssimpLoader collada texture coordinates (#634)

Fixes UNIT_AssimpLoader_TEST with assimp 5.4.3. This should fix homebrew CI.

This PR tweaks the way we checks for texture coordinates from assimp. Empty texture coordinate slots are now allowed as of assimp/assimp#5636. The new logic should be compatible with assimp 5.4.3 and prior versions

Signed-off-by: Ian Chen <[email protected]>
---
graphics/src/AssimpLoader.cc | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/graphics/src/AssimpLoader.cc b/graphics/src/AssimpLoader.cc
index f0bcf194..52edddbd 100644
--- a/graphics/src/AssimpLoader.cc
+++ b/graphics/src/AssimpLoader.cc
@@ -650,15 +650,14 @@ SubMesh AssimpLoader::Implementation::CreateSubMesh(
subMesh.AddVertex(vertex);
subMesh.AddNormal(normal);
// Iterate over sets of texture coordinates
- int uvIdx = 0;
- while(_assimpMesh->HasTextureCoords(uvIdx))
+ for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i)
{
+ if (!_assimpMesh->HasTextureCoords(i))
+ continue;
math::Vector3d texcoords;
- texcoords.X(_assimpMesh->mTextureCoords[uvIdx][vertexIdx].x);
- texcoords.Y(_assimpMesh->mTextureCoords[uvIdx][vertexIdx].y);
- // TODO(luca) why do we need 1.0 - Y?
- subMesh.AddTexCoordBySet(texcoords.X(), 1.0 - texcoords.Y(), uvIdx);
- ++uvIdx;
+ texcoords.X(_assimpMesh->mTextureCoords[i][vertexIdx].x);
+ texcoords.Y(_assimpMesh->mTextureCoords[i][vertexIdx].y);
+ subMesh.AddTexCoordBySet(texcoords.X(), texcoords.Y(), i);
}
}
for (unsigned faceIdx = 0; faceIdx < _assimpMesh->mNumFaces; ++faceIdx)
@@ -695,6 +694,7 @@ Mesh *AssimpLoader::Load(const std::string &_filename)
aiProcess_JoinIdenticalVertices |
aiProcess_RemoveRedundantMaterials |
aiProcess_SortByPType |
+ aiProcess_FlipUVs |
#ifndef GZ_ASSIMP_PRE_5_2_0
aiProcess_PopulateArmatureData |
#endif
@@ -756,11 +756,17 @@ Mesh *AssimpLoader::Load(const std::string &_filename)
// Recursive call to keep track of transforms,
// mesh is passed by reference and edited throughout
this->dataPtr->RecursiveCreate(scene, rootNode, rootTransform, mesh);
+ auto rootSkeleton = mesh->MeshSkeleton();
// Add the animations
for (unsigned animIdx = 0; animIdx < scene->mNumAnimations; ++animIdx)
{
auto& anim = scene->mAnimations[animIdx];
auto animName = ToString(anim->mName);
+ if (animName.empty())
+ {
+ animName = "animation" +
+ std::to_string(rootSkeleton->AnimationCount() + 1);
+ }
SkeletonAnimation* skelAnim = new SkeletonAnimation(animName);
for (unsigned chanIdx = 0; chanIdx < anim->mNumChannels; ++chanIdx)
{
3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ source:
- librt_linkage.patch # [linux]
- macro_path_binary_relocation.patch
- apple_disable_profiler_error_test.patch
- 641.patch

build:
number: 6
number: 7

outputs:
- name: {{ cxx_name }}
Expand Down