AFTER 2.73 - env map update bug #41900

Closed
opened 2014-09-21 18:42:37 +02:00 by Alexey · 11 comments

System Information
windows7 64
ASUS ATI Radeon HD6870

Blender Version
Broken: (All)
Worked: (None)

Short description of error
env_map1.png
env_map2.png
env_map3.png
env_map4.png
env_map5.png
env_map6.png
env_map7.png
Exact steps for others to reproduce the error
open this and select rendered shading mode
env_map.blend

1)change any settings of env map or other object
we wil not see update
2)press down arrow, and go to last keyframe
we will not see update

System Information windows7 64 ASUS ATI Radeon HD6870 Blender Version Broken: (All) Worked: (None) **Short description of error** ![env_map1.png](https://archive.blender.org/developer/F111515/env_map1.png) ![env_map2.png](https://archive.blender.org/developer/F111517/env_map2.png) ![env_map3.png](https://archive.blender.org/developer/F111519/env_map3.png) ![env_map4.png](https://archive.blender.org/developer/F111521/env_map4.png) ![env_map5.png](https://archive.blender.org/developer/F111523/env_map5.png) ![env_map6.png](https://archive.blender.org/developer/F111525/env_map6.png) ![env_map7.png](https://archive.blender.org/developer/F111527/env_map7.png) **Exact steps for others to reproduce the error** open this and select rendered shading mode [env_map.blend](https://archive.blender.org/developer/F111529/env_map.blend) 1)change any settings of env map or other object we wil not see update 2)press down arrow, and go to last keyframe we will not see update
Author

Changed status to: 'Open'

Changed status to: 'Open'
Alexey self-assigned this 2014-09-21 18:42:37 +02:00
Author

Added subscriber: @Inwader77

Added subscriber: @Inwader77
Alexey changed title from env map bug to env map update bug 2014-09-21 18:46:00 +02:00
Alexey was unassigned by Bastien Montagne 2014-09-22 13:48:18 +02:00
Bastien Montagne self-assigned this 2014-09-22 13:48:18 +02:00

Added subscriber: @Sergey

Added subscriber: @Sergey

Ok, so basically, we'd need to invalidate all envmaps when changing a setting (at least, all visible ones).

Here is a quick patch that works, by invalidating all envmaps when a 3DView get an NC_MATERIAL notifier, but most likely a bit too radical (invalidates all envmaps) - and not sure using G.main in this context is a good thing either… And we probably need to regenerate envmaps on other cases too? :/

P144: #41900

diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h
index 14595a4..f0e730a 100644
--- a/source/blender/editors/include/ED_render.h
+++ b/source/blender/editors/include/ED_render.h
@@ -56,6 +56,8 @@ void ED_render_scene_update(struct Main *bmain, struct Scene *scene, int updated
 void ED_viewport_render_kill_jobs(const struct bContext *C, bool free_database);
 struct Scene *ED_render_job_get_scene(const struct bContext *C);
 
+void ED_render_envmap_clear_all(const struct Main *bmain);
+
 /* render_preview.c */
 
 /* stores rendered preview  - is also used for icons */
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 72b4da6..da215c7 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -1510,16 +1510,22 @@ void TEXTURE_OT_envmap_clear(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
 }
 
-static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op))
+void ED_render_envmap_clear_all(const Main *bmain)
 {
-	Main *bmain = CTX_data_main(C);
 	Tex *tex;
-	
+
 	for (tex = bmain->tex.first; tex; tex = tex->id.next)
 		if (tex->env)
 			BKE_free_envmapdata(tex->env);
-	
-	WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, tex);
+}
+
+static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op))
+{
+	Main *bmain = CTX_data_main(C);
+
+	ED_render_envmap_clear_all(bmain);
+
+	WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, NULL);
 	
 	return OPERATOR_FINISHED;
 }
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 8b76ec3..95d9b71 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -44,6 +44,7 @@
 
 #include "BKE_context.h"
 #include "BKE_depsgraph.h"
+#include "BKE_global.h"
 #include "BKE_icons.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
@@ -51,6 +52,7 @@
 #include "BKE_scene.h"
 #include "BKE_screen.h"
 
+#include "ED_render.h"
 #include "ED_space_api.h"
 #include "ED_screen.h"
 
@@ -868,6 +870,9 @@ static void view3d_main_area_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmN
 				ED_region_tag_redraw_overlay(ar);
 			break;
 		case NC_MATERIAL:
+			if (v3d->drawtype == OB_RENDER) {
+				ED_render_envmap_clear_all(G.main);
+			}
 			switch (wmn->data) {
 				case ND_SHADING:
 				case ND_NODES:

Anyway, this is for after 2.72 imho.

Ok, so basically, we'd need to invalidate all envmaps when changing a setting (at least, all visible ones). Here is a quick patch that works, by invalidating all envmaps when a 3DView get an `NC_MATERIAL` notifier, but most likely a bit too radical (invalidates all envmaps) - and not sure using G.main in this context is a good thing either… And we probably need to regenerate envmaps on other cases too? :/ [P144: #41900](https://archive.blender.org/developer/P144.txt) ``` diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index 14595a4..f0e730a 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -56,6 +56,8 @@ void ED_render_scene_update(struct Main *bmain, struct Scene *scene, int updated void ED_viewport_render_kill_jobs(const struct bContext *C, bool free_database); struct Scene *ED_render_job_get_scene(const struct bContext *C); +void ED_render_envmap_clear_all(const struct Main *bmain); + /* render_preview.c */ /* stores rendered preview - is also used for icons */ diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 72b4da6..da215c7 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1510,16 +1510,22 @@ void TEXTURE_OT_envmap_clear(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; } -static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op)) +void ED_render_envmap_clear_all(const Main *bmain) { - Main *bmain = CTX_data_main(C); Tex *tex; - + for (tex = bmain->tex.first; tex; tex = tex->id.next) if (tex->env) BKE_free_envmapdata(tex->env); - - WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, tex); +} + +static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Main *bmain = CTX_data_main(C); + + ED_render_envmap_clear_all(bmain); + + WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 8b76ec3..95d9b71 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -44,6 +44,7 @@ #include "BKE_context.h" #include "BKE_depsgraph.h" +#include "BKE_global.h" #include "BKE_icons.h" #include "BKE_library.h" #include "BKE_main.h" @@ -51,6 +52,7 @@ #include "BKE_scene.h" #include "BKE_screen.h" +#include "ED_render.h" #include "ED_space_api.h" #include "ED_screen.h" @@ -868,6 +870,9 @@ static void view3d_main_area_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmN ED_region_tag_redraw_overlay(ar); break; case NC_MATERIAL: + if (v3d->drawtype == OB_RENDER) { + ED_render_envmap_clear_all(G.main); + } switch (wmn->data) { case ND_SHADING: case ND_NODES: ``` Anyway, this is for after 2.72 imho.
Bastien Montagne changed title from env map update bug to AFTER 2.72 - env map update bug 2014-09-22 14:25:43 +02:00
Author

i don' understand why after 2.72, open my file with 2.71 this bug will be active

i don' understand why after 2.72, open my file with 2.71 this bug will be active

AFTER 2.72 means this issue is to tricky/involved to be fixed before 2.72 release, given the fact we are in stabilization state (it is to be release within a few weeks at worse), so it will have to wait for after 2.72 release, that’s all…

`AFTER 2.72` means this issue is to tricky/involved to be fixed before 2.72 release, given the fact we are in stabilization state (it is to be release within a few weeks at worse), so it will have to wait for after 2.72 release, that’s all…

Added subscriber: @mont29

Added subscriber: @mont29

@mont29, would prefer to use differencial for code reviews, not embedded patches in here. So we can comment on it.

@mont29, would prefer to use differencial for code reviews, not embedded patches in here. So we can comment on it.

Made comments in the patch. And don't really think those changes would be safe for 2.73.

Made comments in the patch. And don't really think those changes would be safe for 2.73.
Sergey Sharybin changed title from AFTER 2.72 - env map update bug to AFTER 2.73 - env map update bug 2014-12-18 09:55:50 +01:00

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Closing this as a TODO for now, this is really complex to solve correctly, added an entry in our TODO list…

Closing this as a TODO for now, this is really complex to solve correctly, added [an entry](http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Tools#Materials) in our TODO list…
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 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#41900
No description provided.