From 122291b24be1df76a14f155b944fe7088758583b Mon Sep 17 00:00:00 2001 From: ashawkey Date: Fri, 22 Mar 2024 14:38:09 +0800 Subject: [PATCH] 0.2.6: better doc --- docs/readme.md | 19 +++++++++++++++++++ docs/source/blender.md | 10 +++++----- docs/source/camera.md | 11 +++++++---- docs/source/conf.py | 2 +- docs/source/mesh.md | 2 +- kiui/cam.py | 2 +- kiui/mesh_utils.py | 2 +- setup.py | 2 +- 8 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 docs/readme.md diff --git a/docs/readme.md b/docs/readme.md new file mode 100644 index 0000000..b2bc873 --- /dev/null +++ b/docs/readme.md @@ -0,0 +1,19 @@ +# Docs for kiuikit + +We use [sphinx](https://www.sphinx-doc.org/en/master/) and [m2r2](https://github.com/CrossNox/m2r2) to build the documentation in markdown language. + +### Usage + +Since sphinx needs to import the module for auto-doc, we need to install full dependency first: +```bash +pip install -e ".[full]" +pip install -r docs/requirements.txt +``` + +Build the docs by: +```bash +cd docs +make html +``` + +View the local [html](docs/build/html/index.html) by VSCode `Live Server` extension. \ No newline at end of file diff --git a/docs/source/blender.md b/docs/source/blender.md index 5330484..1b21b5b 100644 --- a/docs/source/blender.md +++ b/docs/source/blender.md @@ -1,22 +1,22 @@ -# Blender +# Blender Scripts To render complex 3D models (specifically with multiple submeshes), the only choice is to use `blender` and `bpy`. We provide an example code for rendering with blender: ```bash -# make sure you are using python 3.10 +# make sure you are using python>=3.10, tested with bpy==4.0.0 pip install bpy mathutils # help python -m kiui.cli.blender_render --help # example -python -m kiui.cli.blender_render --mesh chest.glb --gpu 0 --depth --normal --albedo +python -m kiui.cli.blender_render --mesh chest.glb --gpu 0 --depth --normal --albedo --camera --blend ``` Features include: * Set which GPU to use with `--gpu 0` for `CYCLES` rendering engine. -* Render with random HDRI environment texture shading (check `assets/blender_lights`). -* Render depth (`exr`), normal, and albedo. +* Render with random built-in HDRI environment texture shading (check `assets/blender_lights`). +* Optionally render depth (`exr`), normal, and albedo. * Empirical cleaning of the scene (remove the annoying plane under the object). \ No newline at end of file diff --git a/docs/source/camera.md b/docs/source/camera.md index cc2b1f4..ebc74bb 100644 --- a/docs/source/camera.md +++ b/docs/source/camera.md @@ -1,6 +1,6 @@ # Camera -### Common world coordinate systems +### World coordinate systems ``` OpenGL/MAYA OpenCV/Colmap Blender Unity/DirectX Unreal Right-handed Right-handed Right-handed Left-handed Left-handed @@ -20,7 +20,9 @@ A common color code: x = red, y = red., up =