Skip to content

Commit

Permalink
chore(docu): Updates docu to newest sphinx version and fixes some doc…
Browse files Browse the repository at this point in the history
…string bugs
  • Loading branch information
cornerfarmer committed Nov 2, 2023
1 parent e846938 commit 07adbe0
Show file tree
Hide file tree
Showing 17 changed files with 88 additions and 848 deletions.
2 changes: 1 addition & 1 deletion blenderproc/python/loader/CCMaterialLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def load_ccmaterials(folder_path: str = "resources/cctextures", used_assets: lis
:param add_custom_properties: A dictionary of materials and the respective properties.
:param use_all_materials: If this is false only a selection of probably useful textures is used. This excludes \
some see through texture and non tileable texture.
:return a list of all loaded materials, if preload is active these materials do not contain any textures yet
:return: a list of all loaded materials, if preload is active these materials do not contain any textures yet
and have to be filled before rendering (by calling this function again, no need to save the prior
returned list)
"""
Expand Down
2 changes: 1 addition & 1 deletion blenderproc/python/loader/HavenEnvironmentLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_random_world_background_hdr_img_path_from_haven(data_path: str) -> str:
""" Sets the world background to a random .hdr file from the given directory.
:param data_path: A path pointing to a directory containing .hdr files.
:return The path to a random selected path
:return: The path to a random selected path
"""

if os.path.exists(data_path):
Expand Down
23 changes: 12 additions & 11 deletions blenderproc/python/loader/HavenMaterialLoader.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
"""
Loading the haven materials, which then can be assigned to objects.
Haven textures are stored as a directory with several texture maps .jpgs e.g:
textures
|- rock_01
| |- rock_01_ao_1k.jpg
| |- rock_01_diff_1k.jpg
| |- rock_01_disp_1k.jpg
| |- rock_01_nor_gl_1k.jpg
| |- rock_01_rough_1k.jpg
|- rock_02
| ...
Haven textures are stored as a directory with several texture maps .jpgs e.g::
textures
|- rock_01
| |- rock_01_ao_1k.jpg
| |- rock_01_diff_1k.jpg
| |- rock_01_disp_1k.jpg
| |- rock_01_nor_gl_1k.jpg
| |- rock_01_rough_1k.jpg
|- rock_02
| ...
The general naming pattern of the texture maps is: {name}_{type}_{resolution}.jpg
However, the type abbreviation is not consistent for all textures. E.g. for some textures the base color map is
Expand Down Expand Up @@ -111,7 +112,7 @@ def load_haven_mat(folder_path: Union[str, Path] = "resources/haven", used_asset
:param return_random_element: If this is True only a single Material is loaded and returned, if you want to sample
many materials load them all with the preload option, use them and then fill the used
empty materials instead of calling this function multiple times.
:return a list of all loaded materials, if preload is active these materials do not contain any textures yet
:return: a list of all loaded materials, if preload is active these materials do not contain any textures yet
and have to be filled before rendering (by calling this function again, there is no need to save the prior
returned list) or if return_random_element is True only a single Material is returned
"""
Expand Down
2 changes: 1 addition & 1 deletion blenderproc/python/object/ObjectReplacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def bb_ratio(bb1: np.ndarray, bb2: np.ndarray) -> list:
:param bb1: bounding box 1. Type: float multi-dimensional array of 8 * 3.
:param bb2: bounding box 2. Type: float multi-dimensional array of 8 * 3.
returns the ratio between each side of the bounding box. Type: a list of floats.
:return: the ratio between each side of the bounding box. Type: a list of floats.
"""
ratio_a = (bb1[0, 0] - bb1[4, 0]) / (bb2[0, 0] - bb2[4, 0])
ratio_b = (bb1[0, 1] - bb1[3, 1]) / (bb2[0, 1] - bb2[3, 1])
Expand Down
2 changes: 1 addition & 1 deletion blenderproc/python/utility/BlenderUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def add_nodes_to_group(nodes: bpy.types.Node, group_name: str) -> bpy.types.Shad
:param nodes: Nodes, which should be used
:param group_name: Name of the group
:return bpy.types.ShaderNodeTree: the group which can be used inside of a bpy.types.ShaderNodeGroup
:return: bpy.types.ShaderNodeTree: the group which can be used inside of a bpy.types.ShaderNodeGroup
"""
# create new node group
group = bpy.data.node_groups.new(name=group_name, type="ShaderNodeTree")
Expand Down
2 changes: 2 additions & 0 deletions blenderproc/python/writer/BopWriterUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def write_camera(camera_path: str, depth_scale: float = 1.0):
def get_frame_gt(dataset_objects: List[bpy.types.Mesh], unit_scaling: float, ignore_dist_thres: float,
destination_frame: Optional[List[str]] = None):
""" Returns GT pose annotations between active camera and objects.
:param dataset_objects: Save annotations for these objects.
:param unit_scaling: 1000. for outputting poses in mm
:param ignore_dist_thres: Distance between camera and object after which object is ignored.
Expand Down Expand Up @@ -350,6 +351,7 @@ def get_frame_gt(dataset_objects: List[bpy.types.Mesh], unit_scaling: float, ign
def get_frame_camera(save_world2cam: bool, depth_scale: float = 1.0, unit_scaling: float = 1000.,
destination_frame: Optional[List[str]] = None):
""" Returns camera parameters for the active camera.
:param save_world2cam: If true, camera to world transformations "cam_R_w2c", "cam_t_w2c" are saved
in scene_camera.json
:param depth_scale: Multiply the uint16 output depth image with this factor to get depth in mm.
Expand Down
9 changes: 4 additions & 5 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXBUILD = /home/${USER}/blender/blender-2.93.0-linux-x64/blender --background --python cli.py --
SPHINXPROJ = BlenderProc
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= /home_local/${USER}/blender/blender-3.3.1-linux-x64/blender --background --python run.py --
SOURCEDIR = source
BUILDDIR = build

Expand Down
10 changes: 7 additions & 3 deletions docs/Readme.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Documentation


The scripts assume that blender is installed at `/home_local/${USER}/blender/blender-2.92.0-linux64`.
The scripts assume that blender is installed at `/home_local/$USER/blender/blender-3.3.1-linux-x64/blender`.
If this is not the case please change it in the [Makefile](Makefile).

First run `config_for_pip_install.yaml` to make sure to install all packages used in our code:
First make sure to install all necessary packages:

```bash
python cli.py docs/config_for_pip_install.yaml
blenderproc pip install sphinx pygments packaging sphinx-autodoc-typehints sphinx-autodoc-typehints m2r2 sphinx-rtd-theme docutils
```

```bash
blenderproc pip install git+https://github.com/abahnasy/smplx git+https://github.com/abahnasy/human_body_prior git+https://github.com/wboerdijk/urdfpy.git git+https://github.com/thodan/bop_toolkit PyOpenGL==3.1.0
```

Now copy markdowns files from examples and main directory:
Expand Down
Loading

0 comments on commit 07adbe0

Please sign in to comment.