-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
archibate
committed
Feb 16, 2023
1 parent
8d69fee
commit 929d066
Showing
5 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# How to cihou Zeno-Python | ||
|
||
1. Uninstall Wendous! | ||
|
||
2. Turn on python project and build: | ||
```bash | ||
cmake -B build -DZENO_WITH_Python:BOOL=ON | ||
cmake --build build | ||
``` | ||
|
||
3. Install numpy locally via pip: | ||
```bash | ||
build/bin/zenoedit -invoke python -m ensurepip | ||
build/bin/zenoedit -invoke python -m pip install -i https://mirrors.aliyun.com/pypi/simple/ numpy | ||
``` | ||
|
||
4. Play with `PythonScript` node with `code` being multiline string: | ||
```python | ||
import ze | ||
import numpy as np | ||
prim = ze.ZenoPrimitiveObject.new() | ||
prim.verts.resize(4) | ||
pos_np = np.array([ | ||
[0, 0, 0], | ||
[0, 0, 1], | ||
[0, 1, 0], | ||
[1, 0, 0], | ||
]) | ||
prim.verts.pos.from_numpy(pos_np) | ||
ze.rets.prim = prim | ||
``` | ||
|
||
5. Use `ExtractDict` to get `rets` output key `prim`, use a `Route` to VIEW it. | ||
|
||
See `misc/graphs/cihounumpytest.zsg` for full demo. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters