Maniphest T74996

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

Assigned To
Brecht Van Lommel (brecht)
Authored By
Bruno Ducloy (helowan)
Mar 21 2020, 2:29 PM
Tags
  • BF Blender
Subscribers
Brecht Van Lommel (brecht)
Bruno Ducloy (helowan)
Robert Guetzkow (rjg)
William Reynish (billreynish)
Tokens
"Like" token, awarded by weasel.

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

Revisions and Commits

rB Blender
D7223

Event Timeline

Bruno Ducloy (helowan) created this task.Mar 21 2020, 2:29 PM
William Reynish (billreynish) changed the task status from Needs Triage to Confirmed.Mar 21 2020, 9:22 PM
William Reynish (billreynish) changed the subtype of this task from "Report" to "Bug".
William Reynish (billreynish) added a subscriber: William Reynish (billreynish).

Probably just a wrong poll.

Robert Guetzkow (rjg) added a subscriber: Robert Guetzkow (rjg).Mar 23 2020, 11:34 PM

Cycles is missing from the COMPAT_ENGINES in MATERIAL_PT_custom_props.

Henrik Dick (weasel) awarded a token.Mar 24 2020, 12:32 AM
William Reynish (billreynish) added a comment.Mar 24 2020, 8:42 PM

@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) updated the task description.Mar 24 2020, 8:43 PM
Robert Guetzkow (rjg) added a subscriber: Brecht Van Lommel (brecht).EditedMar 24 2020, 9:09 PM

@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.

Brecht Van Lommel (brecht) closed this task as Resolved by committing rBfcd6fac0a75d: Fix T74996: material custom properties not displayed for Cycles.Mar 27 2020, 1:04 AM
Brecht Van Lommel (brecht) claimed this task.
Brecht Van Lommel (brecht) added a commit: rBfcd6fac0a75d: Fix T74996: material custom properties not displayed for Cycles.