DLR-RM / DLR-RM/BlenderProc

Render Roughness Metallic or others

Open
#1,105 14 comments 0 reactions 0 assignees View on GitHub
first answer provided question
Dominant language
Python
Stars
3.7k
Forks
518
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue

Hey,
I want to render roughness, I see the code you gave at [#282 ](https://github.com/DLR-RM/BlenderProc/issues/282) but I can't render it, can you help me with this? Thank you very much!
I noticed that the code you gave is different from the one in SegMapRender. the first one use `get_all_mesh_objects()` but the second one use "get_all_blender_mesh_objects()". It seems that one returns a MeshObject, while the second returns an Object.

### Minimal code example

```python
# your code at issue 282
objects = get_all_mesh_objects()
for obj in objects:
materials = obj.get_materials()
for material in materials:
principled_bsdf = material.get_the_one_node_with_type("BsdfPrincipled")
for key in ["Roughness", "Metallic", "Specular"]:
obj.set_cp("cp_"+ key, principled_bsdf.inputs[key].default_value)

# code in SegMapRendererUtility.py
objs_with_mats = get_all_blender_mesh_objects()
```

### Files required to run the code

Nothing

### Expected behavior

render segmap such as roughness.

### BlenderProc version

2.7

Contributor guide

Open the contributing guide

Research direction

Start by comparing the code in issue #282 with SegMapRendererUtility.py, focusing on get_all_mesh_objects() versus get_all_blender_mesh_objects() and the MeshObject/Object distinction. Determine the intended way to expose Roughness, Metallic, or Specular values for rendering, then verify that the minimal example can produce the requested segmentation output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.