blob: 2170ad22d7655f237035b678ff4d7386079b27d9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#!/bin/sh
# Shave and a Haircut
# (c) 2019 Epic Games
# US Patent 6720962
maya=$1
if [ "${maya}" = "" ]; then
echo "Usage: $0 mayaVersion" >&2
echo ""
exit 1
fi
if [ "${SHAVE_ARNOLD_SDKS}" = "" ]; then
echo "SHAVE_ARNOLD_SDKS not defined. Shave will be built without Arnold support." >&2
exit 3
fi
gpp=`../utils/getg++.sh ${maya}`
if [ "${gpp}" = "" ]; then
echo "Could not find correct version of g++ for Maya ${maya}." >&2
echo ""
exit 2
fi
if [ -d Release/${maya} ]; then
rm -rf Release/${maya}
fi
grep "^${maya}:" supportedMtoAVersions.txt | while read mayaVer minVer maxVer buildVer garbage; do
mtoaMin=${minVer/\/*/}
arnoldMin=${minVer/*\//}
mtoaMax=${maxVer/\/*/}
arnoldMax=${maxVer/*\//}
mtoaBuild=${buildVer/\/*/}
arnoldBuild=${buildVer/*\//}
safeMtoABuild=${mtoaBuild//./_}
safeArnoldBuild=${arnoldBuild//./_}
arnoldPath=${SHAVE_ARNOLD_SDKS}/arnold/${arnoldBuild}/linux
mtoaPath=${SHAVE_ARNOLD_SDKS}/mtoa/${mtoaBuild}/maya${maya}/linux
CPPFLAGS="-fvisibility=hidden -Wno-reorder -Wall -Wsign-compare -O3 -funroll-loops -fPIC \
-DENABLE_COLOR_MANAGEMENT -DNDEBUG -DENABLE_XGEN -DENABLE_VP2 -DENABLE_BIFROST -DENABLE_LOOKDEVKIT -DENABLE_RENDERSETUP \
-D_LINUX -Dnullptr=0 \
-DMIN_ARNOLD_VERSION=${arnoldMin} -DMAX_ARNOLD_VERSION=${arnoldMax} \
-I${arnoldPath}/include"
if [ `echo "${maya} >= 2018" | bc` == 1 ]; then
CPPFLAGS+=" -std=c++0x"
fi
PLUGIN_CPPFLAGS="${CPPFLAGS} -D_BOOL -DREQUIRE_IOSTREAM \
-Iplugin \
-I../mayaPlug \
-I${mtoaPath}/include \
-I/usr/autodesk/maya${maya}/include"
LDFLAGS="-fvisibility=hidden -z origin -shared \
-L${arnoldPath}/bin \
-lGL -lpthread \
-lai"
PLUGIN_LDFLAGS="${LDFLAGS} \
-L${mtoaPath}/lib \
-L../mayaPlug \
-L/usr/autodesk/maya${maya}/lib \
-lFoundation -lOpenMaya -lOpenMayaRender -lOpenMayaUI -lOpenMayaAnim -lOpenMayaFX \
-lmtoa_api -lShaveAPI"
OUTDIR=Release/${maya}/${mtoaBuild}
mkdir -p ${OUTDIR}
${gpp} ${PLUGIN_CPPFLAGS} -o ${OUTDIR}/plugin.o -c plugin/plugin.cpp
${gpp} ${PLUGIN_CPPFLAGS} -o ${OUTDIR}/ShaveAndHaircut.o -c plugin/ShaveAndHaircut.cpp
${gpp} ${PLUGIN_LDFLAGS} -o ${OUTDIR}/shave.so ${OUTDIR}/plugin.o ${OUTDIR}/ShaveAndHaircut.o
${gpp} ${CPPFLAGS} -o ${OUTDIR}/ShaveHair.o -c shaders/ShaveHair.cpp
# We may have several versions of the shader for a given version of
# MtoA, so we have to differentiate them.
#
${gpp} ${LDFLAGS} -o ${OUTDIR}/shave_shaders-${safeArnoldBuild}.so ${OUTDIR}/ShaveHair.o
done
|