Setting -E render engine via command line not working for 3D viewport #59089

Closed
opened 2018-12-09 22:06:26 +01:00 by Paul Melis · 6 comments

System Information
Operating system: Arch Linux
Graphics card: GTX 970

Blender Version
Broken: blender-2.80-e79bb957fc3-linux-glibc224-x86_64

Short description of error

I'm testing with a new rendering backend, based on the example script at https://docs.blender.org/api/blender2.8/bpy.types.RenderEngine.html. With the attached script (which I only use for testing an understanding the API) a final render with F12 correctly calls the custom engine, but when switching the 3D view to Rendered mode I get an EVEE render instead. I first have to change the render engine from "Flat Color Renderer" to EVEE and back again for preview render to correctly call the custom engine.

blender_render_engine.2.8.py

Exact steps for others to reproduce the error

  1. $ blender -P blender_render_engine.2.8.py -E custom_renderer
  2. Check that render engine is set to "Flat Color Renderer"
  3. Switch 3D view to Rendered view
  4. Observe that it's an EVEE render
  5. Switch back to Solid view
  6. Change render engine to EVEE
  7. Change render engine to "Flat Color Renderer"
  8. Switch 3D view to Rendered view
  9. Observe that it's now a custom render

I know I'm not following the official route of using an addon, but I believe calling the script at startup like this installs the necessary classes in the correct way, right?

**System Information** Operating system: Arch Linux Graphics card: GTX 970 **Blender Version** Broken: blender-2.80-e79bb957fc3-linux-glibc224-x86_64 **Short description of error** I'm testing with a new rendering backend, based on the example script at https://docs.blender.org/api/blender2.8/bpy.types.RenderEngine.html. With the attached script (which I only use for testing an understanding the API) a final render with F12 correctly calls the custom engine, but when switching the 3D view to Rendered mode I get an EVEE render instead. I first have to change the render engine from "Flat Color Renderer" to EVEE and back again for preview render to correctly call the custom engine. [blender_render_engine.2.8.py](https://archive.blender.org/developer/F5903183/blender_render_engine.2.8.py) **Exact steps for others to reproduce the error** 1. `$ blender -P blender_render_engine.2.8.py -E custom_renderer` 2. Check that render engine is set to "Flat Color Renderer" 3. Switch 3D view to Rendered view 4. Observe that it's an EVEE render 5. Switch back to Solid view 6. Change render engine to EVEE 7. Change render engine to "Flat Color Renderer" 8. Switch 3D view to Rendered view 9. Observe that it's now a custom render I know I'm not following the official route of using an addon, but I believe calling the script at startup like this installs the necessary classes in the correct way, right?
Author

Added subscriber: @PaulMelis

Added subscriber: @PaulMelis

Added subscriber: @brhumphe

Added subscriber: @brhumphe

Confirmed on 168a6a4bfc1 on windows. Running the script AND setting the renderer from the command line does not update which engine is used in the renderer shading mode in the 3d viewport, despite the mode being set:

>>> bpy.context.scene.render.engine

'custom_renderer'

>>> bpy.context.scene.render.engine = 'custom_renderer'

Only after running the second command does the viewport change from an eevee render to.... well, no shading at all, but that's to be expected since you don't seem to have implemented any drawing in view_draw yet.

Confirmed on 168a6a4bfc1 on windows. Running the script AND setting the renderer from the command line does not update which engine is used in the renderer shading mode in the 3d viewport, despite the mode being set: ``` >>> bpy.context.scene.render.engine 'custom_renderer' >>> bpy.context.scene.render.engine = 'custom_renderer' ``` Only after running the second command does the viewport change from an eevee render to.... well, no shading at all, but that's to be expected since you don't seem to have implemented any drawing in `view_draw` yet.
Author

well, no shading at all, but that's to be expected since you don't seem to have implemented any drawing in view_draw yet.

Yes, as I mentioned this script is merely meant as a stripped down class to understand the API. It's not the actual implementation of a new render engine, which is something I work on separately.

> well, no shading at all, but that's to be expected since you don't seem to have implemented any drawing in view_draw yet. Yes, as I mentioned this script is merely meant as a stripped down class to understand the API. It's not the actual implementation of a new render engine, which is something I work on separately.
Brecht Van Lommel changed title from Custom render engine not being called for interactive rendering, get EVEE instead. to Setting -E render engine via command line not working for 3D viewport 2019-05-29 20:12:32 +02:00

This issue was referenced by blender/blender@ec324d8741

This issue was referenced by blender/blender@ec324d87411b1e6ae9285eab2efcecb479d4dd46

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2020-05-14 03:13:12 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#59089
No description provided.