Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q] How to change blend_mode in blenderproc? #926

Open
scotgopal opened this issue Jun 14, 2023 · 2 comments
Open

[Q] How to change blend_mode in blenderproc? #926

scotgopal opened this issue Jun 14, 2023 · 2 comments

Comments

@scotgopal
Copy link

scotgopal commented Jun 14, 2023

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

@scotgopal scotgopal added the question Question, not yet a bug ;) label Jun 14, 2023
@scotgopal
Copy link
Author

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"
@cornerfarmer
Copy link
Member

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.

@cornerfarmer cornerfarmer added first answer provided feature request and removed question Question, not yet a bug ;) labels Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment