[arch-commits] Commit in qt6-quick3d/repos (3 files)

Antonio Rojas arojas at gemini.archlinux.org
Fri Jan 28 14:12:41 UTC 2022


    Date: Friday, January 28, 2022 @ 14:12:40
  Author: arojas
Revision: 435302

archrelease: copy trunk to testing-x86_64

Added:
  qt6-quick3d/repos/testing-x86_64/
  qt6-quick3d/repos/testing-x86_64/PKGBUILD
    (from rev 435301, qt6-quick3d/trunk/PKGBUILD)
  qt6-quick3d/repos/testing-x86_64/qt6-quick3d-assimp-5.1.patch
    (from rev 435301, qt6-quick3d/trunk/qt6-quick3d-assimp-5.1.patch)

------------------------------+
 PKGBUILD                     |   37 +++++++++++
 qt6-quick3d-assimp-5.1.patch |  137 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 174 insertions(+)

Copied: qt6-quick3d/repos/testing-x86_64/PKGBUILD (from rev 435301, qt6-quick3d/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2022-01-28 14:12:40 UTC (rev 435302)
@@ -0,0 +1,37 @@
+# Maintainer: Antonio Rojas <arojas at archlinux.org>
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Andrea Scarpino <andrea at archlinux.org>
+
+pkgname=qt6-quick3d
+_qtver=6.2.3
+pkgver=${_qtver/-/}
+pkgrel=1
+arch=(x86_64)
+url='https://www.qt.io'
+license=(GPL3)
+pkgdesc='Qt module and API for defining 3D content in Qt Quick'
+depends=(qt6-quicktimeline)
+makedepends=(cmake ninja qt6-shadertools assimp)
+optdepends=('qt6-shadertools: for shadergen' 'assimp: assimp import plugin')
+groups=(qt6)
+_pkgfn="${pkgname/6-/}-everywhere-src-$_qtver"
+source=(https://download.qt.io/official_releases/qt/${pkgver%.*}/$_qtver/submodules/$_pkgfn.tar.xz
+        qt6-quick3d-assimp-5.1.patch)
+sha256sums=('c45294f917232320a2cf67ee25b518f6ff3cdf989b8cecfb2ed73569ab28661e'
+            '49eb8feec3fdd1972266cf97fd8d40f0eb7e544c1957569c4b9f182348b17492')
+
+prepare() {
+  patch -d $_pkgfn -p1 < qt6-quick3d-assimp-5.1.patch # Fix build with assimp 5.1
+}
+
+build() {
+  cmake -B build -S $_pkgfn -G Ninja
+  cmake --build build
+}
+
+package() {
+  DESTDIR="$pkgdir" cmake --install build
+
+  install -d "$pkgdir"/usr/share/licenses
+  ln -s /usr/share/licenses/qt6-base "$pkgdir"/usr/share/licenses/$pkgname
+}

Copied: qt6-quick3d/repos/testing-x86_64/qt6-quick3d-assimp-5.1.patch (from rev 435301, qt6-quick3d/trunk/qt6-quick3d-assimp-5.1.patch)
===================================================================
--- testing-x86_64/qt6-quick3d-assimp-5.1.patch	                        (rev 0)
+++ testing-x86_64/qt6-quick3d-assimp-5.1.patch	2022-01-28 14:12:40 UTC (rev 435302)
@@ -0,0 +1,137 @@
+diff --git a/src/plugins/assetimporters/assimp/assimpimporter.cpp b/src/plugins/assetimporters/assimp/assimpimporter.cpp
+index cb8f92a3..4ce57d64 100644
+--- a/src/plugins/assetimporters/assimp/assimpimporter.cpp
++++ b/src/plugins/assetimporters/assimp/assimpimporter.cpp
+@@ -1268,7 +1268,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
+         // GLTF Mode
+         {
+             aiColor4D baseColorFactor;
+-            result = material->Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_FACTOR, baseColorFactor);
++            result = material->Get(AI_MATKEY_BASE_COLOR, baseColorFactor);
+             if (result == aiReturn_SUCCESS)
+                 QSSGQmlUtilities::writeQmlPropertyHelper(output,
+                                                          tabLevel + 1,
+@@ -1276,7 +1276,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
+                                                          QStringLiteral("baseColor"),
+                                                          aiColorToQColor(baseColorFactor));
+ 
+-            QString baseColorImage = generateImage(material, AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_TEXTURE, tabLevel + 1);
++            QString baseColorImage = generateImage(material, aiTextureType_BASE_COLOR, 0, tabLevel + 1);
+             if (!baseColorImage.isNull()) {
+                 output << QSSGQmlUtilities::insertTabs(tabLevel + 1) << QStringLiteral("baseColorMap: ") << baseColorImage << QStringLiteral("\n");
+                 output << QSSGQmlUtilities::insertTabs(tabLevel + 1) << QStringLiteral("opacityChannel: Material.A\n");
+@@ -1294,7 +1294,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
+             }
+ 
+             ai_real metallicFactor;
+-            result = material->Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLIC_FACTOR, metallicFactor);
++            result = material->Get(AI_MATKEY_METALLIC_FACTOR, metallicFactor);
+             if (result == aiReturn_SUCCESS) {
+                 QSSGQmlUtilities::writeQmlPropertyHelper(output,
+                                                          tabLevel + 1,
+@@ -1304,7 +1304,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
+             }
+ 
+             ai_real roughnessFactor;
+-            result = material->Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_ROUGHNESS_FACTOR, roughnessFactor);
++            result = material->Get(AI_MATKEY_ROUGHNESS_FACTOR, roughnessFactor);
+             if (result == aiReturn_SUCCESS) {
+                 QSSGQmlUtilities::writeQmlPropertyHelper(output,
+                                                          tabLevel + 1,
+@@ -1410,16 +1410,14 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
+         }
+ 
+         {
+-            bool isUnlit;
+-            result = material->Get(AI_MATKEY_GLTF_UNLIT, isUnlit);
+-            if (result == aiReturn_SUCCESS && isUnlit)
++            aiShadingMode shadingMode;
++            material->Get(AI_MATKEY_SHADING_MODEL, shadingMode);
++            if (shadingMode == aiShadingMode_Unlit)
+                 output << QSSGQmlUtilities::insertTabs(tabLevel + 1) << QStringLiteral("lighting: PrincipledMaterial.NoLighting\n");
+         }
+ 
+         // SpecularGlossiness Properties
+-        bool hasSpecularGlossiness;
+-        result = material->Get(AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS, hasSpecularGlossiness);
+-        if (result == aiReturn_SUCCESS && hasSpecularGlossiness) {
++        {
+ 
+             // diffuseFactor (color) // not used (yet), but ends up being diffuseColor
+ //            {
+@@ -1448,7 +1446,7 @@ void AssimpImporter::generateMaterial(aiMaterial *material, QTextStream &output,
+             // glossinessFactor (float)
+             {
+                 ai_real glossiness;
+-                result = material->Get(AI_MATKEY_GLTF_PBRSPECULARGLOSSINESS_GLOSSINESS_FACTOR, glossiness);
++                result = material->Get(AI_MATKEY_GLOSSINESS_FACTOR, glossiness);
+                 if (result == aiReturn_SUCCESS)
+                     QSSGQmlUtilities::writeQmlPropertyHelper(output,
+                                                              tabLevel + 1,
+@@ -1560,7 +1558,7 @@ QString AssimpImporter::generateImage(aiMaterial *material, aiTextureType textur
+ 
+     if (m_gltfMode) {
+         uint gltfUvIndex = 0;
+-        result = material->Get(AI_MATKEY_GLTF_TEXTURE_TEXCOORD(textureType, index), gltfUvIndex);
++        result = material->Get(AI_MATKEY_UVWSRC(textureType, index), gltfUvIndex);
+         if (result == aiReturn_SUCCESS)
+             uvIndex = gltfUvIndex;
+     }
+diff --git a/src/plugins/assetimporters/assimp/assimpimporter_rt.cpp b/src/plugins/assetimporters/assimp/assimpimporter_rt.cpp
+index c3c77d7e..90aee0c5 100644
+--- a/src/plugins/assetimporters/assimp/assimpimporter_rt.cpp
++++ b/src/plugins/assetimporters/assimp/assimpimporter_rt.cpp
+@@ -344,7 +344,7 @@ static void setMaterialProperties(QSSGSceneDesc::Material &target, const aiMater
+                     texInfo.transform = &transform;
+ 
+                 if (sceneInfo.ver == SceneInfo::GltfVersion::v2) {
+-                    material.Get(AI_MATKEY_GLTF_TEXTURE_TEXCOORD(textureType, index), texInfo.uvIndex);
++                    material.Get(AI_MATKEY_UVWSRC(textureType, index), texInfo.uvIndex);
+                     material.Get(AI_MATKEY_GLTF_MAPPINGFILTER_MIN(textureType, index), texInfo.minFilter);
+                     material.Get(AI_MATKEY_GLTF_MAPPINGFILTER_MAG(textureType, index), texInfo.magFilter);
+                 }
+@@ -414,12 +414,12 @@ static void setMaterialProperties(QSSGSceneDesc::Material &target, const aiMater
+         aiReturn result;
+         {
+             aiColor4D baseColorFactor;
+-            result = source.Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_FACTOR, baseColorFactor);
++            result = source.Get(AI_MATKEY_BASE_COLOR, baseColorFactor);
+             if (result == aiReturn_SUCCESS)
+                 QSSGSceneDesc::setProperty(target, "baseColor", &QQuick3DPrincipledMaterial::setBaseColor, aiColorToQColor(baseColorFactor));
+         }
+ 
+-        if (auto baseColorTexture = createTextureNode(source, AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_BASE_COLOR_TEXTURE)) {
++        if (auto baseColorTexture = createTextureNode(source, aiTextureType_BASE_COLOR, 0)) {
+             QSSGSceneDesc::setProperty(target, "baseColorMap", &QQuick3DPrincipledMaterial::setBaseColorMap, baseColorTexture);
+             QSSGSceneDesc::setProperty(target, "opacityChannel", &QQuick3DPrincipledMaterial::setOpacityChannel, QQuick3DPrincipledMaterial::TextureChannelMapping::A);
+         }
+@@ -433,14 +433,14 @@ static void setMaterialProperties(QSSGSceneDesc::Material &target, const aiMater
+ 
+         {
+             ai_real metallicFactor;
+-            result = source.Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLIC_FACTOR, metallicFactor);
++            result = source.Get(AI_MATKEY_METALLIC_FACTOR, metallicFactor);
+             if (result == aiReturn_SUCCESS)
+                 QSSGSceneDesc::setProperty(target, "metalness", &QQuick3DPrincipledMaterial::setMetalness, float(metallicFactor));
+         }
+ 
+         {
+             ai_real roughnessFactor;
+-            result = source.Get(AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_ROUGHNESS_FACTOR, roughnessFactor);
++            result = source.Get(AI_MATKEY_ROUGHNESS_FACTOR, roughnessFactor);
+             if (result == aiReturn_SUCCESS)
+                 QSSGSceneDesc::setProperty(target, "roughness", &QQuick3DPrincipledMaterial::setRoughness, float(roughnessFactor));
+         }
+@@ -509,9 +509,9 @@ static void setMaterialProperties(QSSGSceneDesc::Material &target, const aiMater
+         }
+ 
+         {
+-            bool isUnlit = false;
+-            result = source.Get(AI_MATKEY_GLTF_UNLIT, isUnlit);
+-            if (result == aiReturn_SUCCESS && isUnlit)
++            aiShadingMode shadingMode;
++            source.Get(AI_MATKEY_SHADING_MODEL, shadingMode);
++            if (shadingMode == aiShadingMode_Unlit)
+                 QSSGSceneDesc::setProperty(target, "lighting", &QQuick3DPrincipledMaterial::setLighting, QQuick3DPrincipledMaterial::Lighting::NoLighting);
+         }
+     } else { // Ver1



More information about the arch-commits mailing list