Changeset View
Standalone View
source/blender/editors/render/render_update.c
| Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_DerivedMesh.h" | #include "BKE_DerivedMesh.h" | ||||
| #include "BKE_icons.h" | #include "BKE_icons.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_sequencer.h" | |||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "GPU_lamp.h" | #include "GPU_lamp.h" | ||||
| #include "GPU_material.h" | #include "GPU_material.h" | ||||
| #include "GPU_buffers.h" | #include "GPU_buffers.h" | ||||
| #include "RE_engine.h" | #include "RE_engine.h" | ||||
| #include "RE_pipeline.h" | #include "RE_pipeline.h" | ||||
| #include "ED_node.h" | #include "ED_node.h" | ||||
| #include "ED_render.h" | #include "ED_render.h" | ||||
| #include "ED_view3d.h" | #include "ED_view3d.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | |||||
| #include "render_intern.h" // own include | #include "render_intern.h" // own include | ||||
| extern Material defmaterial; | extern Material defmaterial; | ||||
| /***************************** Render Engines ********************************/ | /***************************** Render Engines ********************************/ | ||||
| void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int updated) | void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int updated) | ||||
| ▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | void ED_render_engine_area_exit(Main *bmain, ScrArea *sa) | ||||
| for (ar = sa->regionbase.first; ar; ar = ar->next) { | for (ar = sa->regionbase.first; ar; ar = ar->next) { | ||||
| if (ar->regiontype != RGN_TYPE_WINDOW || !(ar->regiondata)) | if (ar->regiontype != RGN_TYPE_WINDOW || !(ar->regiondata)) | ||||
| continue; | continue; | ||||
| ED_view3d_stop_render_preview(wm, ar); | ED_view3d_stop_render_preview(wm, ar); | ||||
| } | } | ||||
| } | } | ||||
| void ED_render_engine_changed(Main *bmain) | void ED_render_engine_changed(bContext *C, Main *bmain) | ||||
| { | { | ||||
campbellbarton: Why is this needed? | |||||
Not Done Inline ActionsWas my attempt at clearing the VSE cache when the user changes preview engine for strip. If user has previewed 3 frames (say 1, 2, 3) w/ eevee as preview engine, then switches to clay, frames 1, 2, and 3 would still show the eevee frames (since they are cached, they don't get re-rendered I think) even though clicking on other frames renders w/ clay as expected. Seems to work in initial tests. spockTheGray: Was my attempt at clearing the VSE cache when the user changes preview engine for strip. If… | |||||
Not Done Inline ActionsShoudn't this just clear the cache for a single strip? campbellbarton: Shoudn't this just clear the cache for a single strip? | |||||
Not Done Inline ActionsYes - sorry my first attempt was a bit off lol. Was a bit of a doozy - but I got it working in a slightly more sane manner this time :) spockTheGray: Yes - sorry my first attempt was a bit off lol. Was a bit of a doozy - but I got it working in… | |||||
Not Done Inline ActionsThink it would be better to have a separate function for the sequencer, eg: void ED_render_engine_changed(Main *bmain); void ED_render_engine_changed_sequencer(Main *bmain); campbellbarton: Think it would be better to have a separate function for the sequencer,
eg:
```
void… | |||||
| if (C) { | |||||
| Scene *current_scene = CTX_data_scene(C); | |||||
| /* Notify the necessary editors (just sequencer for now) */ | |||||
| BKE_sequencer_scene_render_engine_changed(current_scene); | |||||
campbellbartonUnsubmitted Not Done Inline ActionsLogic here is a bit strange too, the engine has not changed for the current scene, it is for a sequence strip within the current scenes Edit struct. So the update call looks wrong. If for some reason this is correct, that should be explained in a comment since it's not intuitive. campbellbarton: Logic here is a bit strange too, the engine has not changed for the current scene, it is for a… | |||||
campbellbartonUnsubmitted Not Done Inline ActionsCorrection, when I made this comment I assumed BKE_sequencer_scene_render_engine_changed was just some updating function. As it turns out I think it should not be needed at all. so perhaps all changes here can be removed. campbellbarton: Correction, when I made this comment I assumed `BKE_sequencer_scene_render_engine_changed` was… | |||||
| WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, current_scene); | |||||
| } | |||||
| /* on changing the render engine type, clear all running render engines */ | /* on changing the render engine type, clear all running render engines */ | ||||
| for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { | for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { | ||||
| for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { | for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { | ||||
| ED_render_engine_area_exit(bmain, sa); | ED_render_engine_area_exit(bmain, sa); | ||||
| } | } | ||||
| } | } | ||||
| RE_FreePersistentData(); | RE_FreePersistentData(); | ||||
| /* Inform all render engines and draw managers. */ | /* Inform all render engines and draw managers. */ | ||||
| ▲ Show 20 Lines • Show All 417 Lines • Show Last 20 Lines | |||||
Why is this needed?