-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_blender_with_rpr_Ubuntu.sh
executable file
·75 lines (58 loc) · 2.1 KB
/
run_blender_with_rpr_Ubuntu.sh
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
#!/bin/bash
#**********************************************************************
# Copyright 2020 Advanced Micro Devices, Inc
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#********************************************************************
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORK_DIR=`mktemp -d -p /tmp rpr_blender_workdir_XXXXXXXX`
RPR_SDK="ThirdParty/RadeonProRender SDK/Linux-Ubuntu"
IMAGE_FILTER_DIR="ThirdParty/RadeonProImageProcessing/Linux/Ubuntu"
IMAGE_FILTER_LIBNAME="libRadeonImageFilters64.so"
GLTF_DIR="ThirdParty/RadeonProRender-GLTF/Linux-Ubuntu/lib"
GLTF_LIBNAME="libProRenderGLTF.so"
function init()
{
if [ ! -x "$BLENDER_EXE" ]; then
echo "Could not find blender application. Please, specify BLENDER_EXE environment variable"
exit 1
fi
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "Could not create work dir $WORK_DIR"
exit 2
fi
# link rpr libs to workdir
for f in "$DIR/$RPR_SDK/lib/"*.so; do
ln -s "$f" "$WORK_DIR/"
done
# link imageprocessing lib to workdir
ln -s "$DIR/$IMAGE_FILTER_DIR/lib64/$IMAGE_FILTER_LIBNAME" "$WORK_DIR/"
# link gltf lib to workdir
ln -s "$DIR/$GLTF_DIR/$GLTF_LIBNAME" "$WORK_DIR/"
# link helper to workdir
ln -s "$DIR/RPRBlenderHelper/.build/libRPRBlenderHelper.so" "$WORK_DIR/"
}
# deletes the work directory
function cleanup {
rm -rf "$WORK_DIR"
}
# register the cleanup function to be called on the EXIT signal
trap cleanup EXIT
function main()
{
init
export RPR_BLENDER_DEBUG=1
export LD_LIBRARY_PATH="$WORK_DIR:$LD_LIBRARY_PATH"
python3 cmd_tools/run_blender.py "$BLENDER_EXE" cmd_tools/test_rpr.py
}
main