Skip to content

Commit 290b526

Browse files
committed
Python binding - doc
1 parent 2d8f5ec commit 290b526

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ tutorials/Makefile
77
**/.DS_Store
88
python/build/
99
python/test/cache/
10+
python/test/OUT_PYTHON_*

python/test/test_script_gltf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
import sys
1010
import os
1111

12+
# add the RPR Python library folder in order to import the rpr,rprs,rprgltf modules.
1213
sys.path.insert(1, '../../python/build/Release')
14+
15+
# we need to add the RPR DLLs
1316
os.add_dll_directory( os.path.abspath(os.path.dirname(__file__) + '../../../RadeonProRender/binWin64') )
1417

1518
import rpr

python/test/test_script_rpr.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
import sys
1010
import os
1111

12+
# add the RPR Python library folder in order to import the rpr,rprs,rprgltf modules.
1213
sys.path.insert(1, '../../python/build/Release')
14+
15+
# we need to add the RPR DLLs
1316
os.add_dll_directory( os.path.abspath(os.path.dirname(__file__) + '../../../RadeonProRender/binWin64') )
1417

1518
import rpr

readme.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,33 @@ this demo generates the rendering output images: 05_00.png, 05_01.png, 05_02.png
7575
See detailed documentation at
7676
https://radeon-pro.github.io/RadeonProRenderDocs/sdk/tutorials.html
7777

78+
## Python Binding
79+
80+
You can create a RPR Python binding extension.
81+
82+
Build the RPR binding libraries:
83+
```
84+
> cd python/
85+
> mkdir build
86+
> cd build
87+
> cmake -Dnanobind_DIR=nanobind/cmake ..
88+
> cmake --build . --config Release
89+
```
90+
Those builds will be generated inside python/build/Release/ they are needed by the python script running RPR in order to execute the:
91+
```
92+
import rpr
93+
import rprs
94+
import rprgltf
95+
```
96+
97+
Run some test scripts:
98+
```
99+
> cd python/test
100+
> python test_script_rpr.py
101+
> python test_script_gltf.py
102+
```
103+
If tests run correctly, you should find the generated rendering images inside the python/test folder.
104+
78105
## Additional Info
79106

80107
- Radeon:tm: ProRender GPUOpen web site

0 commit comments

Comments
 (0)