BlenderProc
BlenderProc copied to clipboard
[Q] How to change blend_mode in blenderproc?
Describe the issue
Is there a way to modify the blend_method in blenderproc? Here's the link to the property in BlenderPy that I would like to modify via bproc: https://docs.blender.org/api/current/bpy.types.Material.html#bpy.types.Material.blend_method. My goal is to make an object transparent and simply changing the 'Alpha' value of the principled bsdf shader to 0 doesn't help me allow light to pass through this object in view mode: Viewport Shading.
Minimal code example
No response
Files required to run the code
No response
Expected behavior
- Learn to modify the blend_method in bproc
- Make objects transparent
BlenderProc version
v3.1.0
I think this is the only way to do this via bproc since there are no methods available to directly modify this. It accesses the blender_obj attribute of the object with type blenderproc.types.MeshObject, followed by directly accessing the material of the object, named 'transparent_mat'.
obj_spawn_area.blender_obj.data.materials[
"transparent_mat"
].blend_method = "BLEND"
Yes you are right, there is currently no blenderproc api method to change the blend_method. Feel free to add one and create a PR.