blender: add materialx

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
This commit is contained in:
Florian Brandes 2024-04-30 10:47:17 +02:00
parent b9ca769194
commit 442860880f
No known key found for this signature in database
GPG Key ID: 074048E893713170
2 changed files with 8 additions and 1 deletions

View File

@ -53,6 +53,7 @@
libxkbcommon,
llvmPackages,
makeWrapper,
materialx,
mesa,
ocl-icd,
openal,
@ -118,7 +119,8 @@ stdenv.mkDerivation (finalAttrs: {
: > build_files/cmake/platform/platform_apple_xcode.cmake
substituteInPlace source/creator/CMakeLists.txt \
--replace-fail '${"$"}{LIBDIR}/python' \
'${python3}'
'${python3}' \
--replace-fail '${"$"}{LIBDIR}/materialx/' '${materialx}/'
substituteInPlace build_files/cmake/platform/platform_apple.cmake \
--replace-fail '${"$"}{LIBDIR}/brotli/lib/libbrotlicommon-static.a' \
'${lib.getLib brotli}/lib/libbrotlicommon.dylib' \
@ -151,6 +153,7 @@ stdenv.mkDerivation (finalAttrs: {
"-DWITH_FFTW3=ON"
"-DWITH_IMAGE_OPENJPEG=ON"
"-DWITH_INSTALL_PORTABLE=OFF"
"-DMaterialX_DIR=${materialx}/lib/cmake/MaterialX"
"-DWITH_MOD_OCEANSIM=ON"
"-DWITH_OPENCOLLADA=${if colladaSupport then "ON" else "OFF"}"
"-DWITH_OPENCOLORIO=ON"
@ -221,6 +224,7 @@ stdenv.mkDerivation (finalAttrs: {
libsndfile
libtiff
libwebp
materialx
opencolorio
openexr
openimageio
@ -286,6 +290,7 @@ stdenv.mkDerivation (finalAttrs: {
ps = python3Packages;
in
[
materialx
ps.numpy
ps.requests
ps.zstandard

View File

@ -52,6 +52,8 @@ python3Packages.buildPythonPackage rec {
cmakeFlags = [
(lib.cmakeBool "MATERIALX_BUILD_OIIO" true)
(lib.cmakeBool "MATERIALX_BUILD_PYTHON" true)
# don't build MSL shader back-end on x86_x64-darwin, as it requires a newer SDK with metal support
(lib.cmakeBool "MATERIALX_BUILD_GEN_MSL" (stdenv.isLinux || (stdenv.isAarch64 && stdenv.isDarwin)))
];
pythonImportsCheck = [ "MaterialX" ];