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

If possible for BlenderProc to use blender4? #1128

Open
YZHUA opened this issue Jul 16, 2024 · 1 comment
Open

If possible for BlenderProc to use blender4? #1128

YZHUA opened this issue Jul 16, 2024 · 1 comment
Labels
question Question, not yet a bug ;)

Comments

@YZHUA
Copy link

YZHUA commented Jul 16, 2024

Describe the issue

Thanks for the work of this great project first. When I was trying to use Blender, I found that the rendering nodes of Blender are not unified. Sometimes there is 'Principled BSDF', and sometimes there isn't. However, in Blender 4, this node appeared uniformly after testing several cases. Therefore, there is a demand to call Blender 4 using BlenderProc. But I couldn't find relevant information. So, I would like to ask, can this demand be fulfilled now?
image
image

Minimal code example

for ob in bpy.data.objects:
    if ob.type != 'MESH': continue
    if len(ob.data.materials) == 0: continue
    for material in ob.data.materials:
        key = 'Principled BSDF'
        for node in material.node_tree.nodes:
            if node.name==key:
                roughness_exist = True
            if not roughness_exist: continue
            principled_bsdf=material.node_tree.nodes[key]
            ob["cp_roughness"] = principled_bsdf.inputs['Roughness'].default_value

Files required to run the code

No response

Expected behavior

'Principled BSDF' always exist

BlenderProc version

v2.7.1

@YZHUA YZHUA added the question Question, not yet a bug ;) label Jul 16, 2024
@Griperis
Copy link
Contributor

We are currently interested and are starting to work on porting Blenderproc to Blender 4.1 as we need it for other features.

However IMO the Principled BSDF doesn't have to exist in Blender 4.1 either, as you can have node setup without it. For example my super arbitrary node setup:

image

Your script will fail on the second to last line anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question, not yet a bug ;)
Projects
None yet
Development

No branches or pull requests

2 participants