UI: Custom Properties panel for Materials unavailable with Cycles #74996

Closed
opened 2020-03-21 14:29:37 +01:00 by Bruno Ducloy · 11 comments

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: d2c3544c5c
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

custom_properties_eevee.jpg custom_properties_cycles.jpg

**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: `d2c3544c5c` 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** ![custom_properties_eevee.jpg](https://archive.blender.org/developer/F8419860/custom_properties_eevee.jpg) ![custom_properties_cycles.jpg](https://archive.blender.org/developer/F8419862/custom_properties_cycles.jpg)
Author

Added subscriber: @Helo

Added subscriber: @Helo

Added subscriber: @WilliamReynish

Added subscriber: @WilliamReynish

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Probably just a wrong poll.

Probably just a wrong poll.

Added subscriber: @rjg

Added subscriber: @rjg

Cycles is missing from the COMPAT_ENGINES in MATERIAL_PT_custom_props.

Cycles is missing from the `COMPAT_ENGINES` in `MATERIAL_PT_custom_props`.

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

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

Added subscriber: @brecht

Added subscriber: @brecht

@WilliamReynish 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 [ https:*docs.blender.org/api/current/bpy.types.RenderEngine.html?highlight=blender_render | 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 on blender-coders, the patch works and has already been accepted by him.

@WilliamReynish `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 [[ https:*docs.blender.org/api/current/bpy.types.RenderEngine.html?highlight=blender_render | recommended approach for third-party render engines ](https:*developer.blender.org/diffusion/B/browse/master/intern/cycles/blender/addon/ui.py), 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 on blender-coders, the patch works and has already been accepted by him.

This issue was referenced by fcd6fac0a7

This issue was referenced by fcd6fac0a75db66f8dc0f147d2a17feaac092d7b

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2020-03-27 01:04:54 +01:00
Sign in to join this conversation.
5 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blender/blender#74996
No description provided.