Page MenuHome

UI: Custom Properties panel for Materials unavailable with Cycles
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Linux-4.15.0-91-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 435.21

Blender Version
Broken: version: 2.83 (sub 10), branch: master, commit date: 2020-03-19 21:12, hash: rBd2c3544c5cb0
Worked: 2.79

Short description of error
When Cycles is set as the Render Engine, the Custom Properties panel for Materials is unavailable. The panel is available with EEVEE.

Exact steps for others to reproduce the error

  • Open Blender
  • Go to the Materials panel and notice that the Custom Properties panel is available (with EEVEE set by default)
  • Set Cycles as Render Engine
  • Go back to the Materials panel and notice that the Custom Properties panel is no longer available

Screenshots

Event Timeline

William Reynish (billreynish) changed the task status from Needs Triage to Confirmed.Sat, Mar 21, 9:22 PM
William Reynish (billreynish) changed the subtype of this task from "Report" to "Bug".

Probably just a wrong poll.

Cycles is missing from the COMPAT_ENGINES in MATERIAL_PT_custom_props.

@Robert Guetzkow (rjg) technically Cycles is an addon, so we don't set it there, but in Cycles' own ui.py file. I had a look in there, and this panel is not excluded from the panel inclusion, so I don't actually understand why this doesn't work.

@William Reynish (billreynish) COMPAT_ENGINES in MATERIAL_PT_custom_props needs to include 'BLENDER_RENDER'. Cycles uses get_panels() (ui.py) and only adds the panel if 'BLENDER_RENDER' is in COMPAT_ENGINES and the panel is not in the list of excluded panels. This is also the recommended approach for third-party render engines, according to the API docs.

def get_panels():
    exclude_panels = {
        'DATA_PT_area',
        'DATA_PT_camera_dof',
        'DATA_PT_falloff_curve',
        'DATA_PT_light',
        'DATA_PT_preview',
        'DATA_PT_spot',
        'MATERIAL_PT_context_material',
        'MATERIAL_PT_preview',
        'NODE_DATA_PT_light',
        'NODE_DATA_PT_spot',
        'OBJECT_PT_visibility',
        'VIEWLAYER_PT_filter',
        'VIEWLAYER_PT_layer_passes',
        'RENDER_PT_post_processing',
        'RENDER_PT_simplify',
    }

    panels = []
    for panel in bpy.types.Panel.__subclasses__():
        if hasattr(panel, 'COMPAT_ENGINES') and 'BLENDER_RENDER' in panel.COMPAT_ENGINES:
            if panel.__name__ not in exclude_panels:
                panels.append(panel)

    return panels

You're right though, COMPAT_ENGINES shouldn't include 'CYCLES', since this would neither solve the problem for Cycles nor work for other external render engines. That was a misguided idea I had at the beginning. The patch uses 'BLENDER_RENDER', which is the correct solution.

I've already discussed this with @Brecht Van Lommel (brecht) on blender-coders, the patch works and has already been accepted by him.