[Bf-blender-cvs] [dfaf420e930] ui-asset-view-template: Fix missing view3d updates after recent NC_SPACE notifier filters

Philipp Oeser noreply at git.blender.org
Sun Mar 21 16:11:58 CET 2021


Commit: dfaf420e930e77111e70449b13ab6955867fc705
Author: Philipp Oeser
Date:   Thu Mar 18 13:42:28 2021 +0100
Branches: ui-asset-view-template
https://developer.blender.org/rBdfaf420e930e77111e70449b13ab6955867fc705

Fix missing view3d updates after recent NC_SPACE notifier filters

Since {rB46aa70cb486d}, using `NC_SPACE | ND_SPACE_VIEW3D` as notifier is
restricted to space data as a reference. This was still used though for
RNA updates in other places (namely `rna_camera`, `rna_scene`,
`rna_animviz`), and passing NULL would automatically set the notifier
reference to the owner id. Above commit would happily filter these out,
leading to missing refreshes.

Now use more specific notifiers (in case of animviz a new
`ND_DRAW_ANIMVIZ` was added).

This was reported for Camera background images btw.
Fixes T86670.

Maniphest Tasks: T86670

Differential Revision: https://developer.blender.org/D10758

===================================================================

M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/makesrna/intern/rna_animviz.c
M	source/blender/makesrna/intern/rna_camera.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/windowmanager/WM_types.h

===================================================================

diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 3d260a9a05b..d90e4c4743a 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -921,6 +921,9 @@ static void view3d_main_region_listener(const wmRegionListenerParams *params)
           ED_region_tag_redraw(region);
           WM_gizmomap_tag_refresh(gzmap);
           break;
+        case ND_DRAW_ANIMVIZ:
+          ED_region_tag_redraw(region);
+          break;
       }
       switch (wmn->action) {
         case NA_ADDED:
diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c
index 7be155605e6..b205b3d7139 100644
--- a/source/blender/makesrna/intern/rna_animviz.c
+++ b/source/blender/makesrna/intern/rna_animviz.c
@@ -144,14 +144,14 @@ static void rna_def_animviz_motion_path(BlenderRNA *brna)
   prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
   RNA_def_property_array(prop, 3);
   RNA_def_property_ui_text(prop, "Color", "Custom color for motion path");
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   /* Line width */
   prop = RNA_def_property(srna, "line_thickness", PROP_INT, PROP_NONE);
   RNA_def_property_int_sdna(prop, NULL, "line_thickness");
   RNA_def_property_range(prop, 1, 6);
   RNA_def_property_ui_text(prop, "Line Thickness", "Line thickness for motion path");
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   /* Settings */
   prop = RNA_def_property(srna, "use_bone_head", PROP_BOOLEAN, PROP_NONE);
@@ -171,13 +171,13 @@ static void rna_def_animviz_motion_path(BlenderRNA *brna)
   prop = RNA_def_property(srna, "use_custom_color", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_CUSTOM);
   RNA_def_property_ui_text(prop, "Custom Colors", "Use custom color for this motion path");
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   /* Draw lines between keyframes */
   prop = RNA_def_property(srna, "lines", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_LINES);
   RNA_def_property_ui_text(prop, "Lines", "Use straight lines between keyframe points");
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 }
 
 /* --- */
@@ -212,36 +212,31 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
   RNA_def_property_enum_sdna(prop, NULL, "path_type");
   RNA_def_property_enum_items(prop, prop_type_items);
   RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Motion Paths");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   prop = RNA_def_property(srna, "bake_location", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_bitflag_sdna(prop, NULL, "path_bakeflag");
   RNA_def_property_enum_items(prop, rna_enum_motionpath_bake_location_items);
   RNA_def_property_ui_text(prop, "Bake Location", "When calculating Bone Paths, use Head or Tips");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   /* Settings */
   prop = RNA_def_property(srna, "show_frame_numbers", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_FNUMS);
   RNA_def_property_ui_text(prop, "Show Frame Numbers", "Show frame numbers on Motion Paths");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   prop = RNA_def_property(srna, "show_keyframe_highlight", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFRAS);
   RNA_def_property_ui_text(
       prop, "Highlight Keyframes", "Emphasize position of keyframes on Motion Paths");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   prop = RNA_def_property(srna, "show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFNOS);
   RNA_def_property_ui_text(
       prop, "Show Keyframe Numbers", "Show frame numbers of Keyframes on Motion Paths");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   prop = RNA_def_property(srna, "show_keyframe_action_all", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFACT);
@@ -250,8 +245,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
       "All Action Keyframes",
       "For bone motion paths, search whole Action for keyframes instead of in group"
       " with matching name only (is slower)");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
   RNA_def_property_int_sdna(prop, NULL, "path_step");
@@ -260,8 +254,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
       prop,
       "Frame Step",
       "Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method)");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   /* Playback Ranges */
   prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
@@ -271,8 +264,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
                            "Start Frame",
                            "Starting frame of range of paths to display/calculate "
                            "(not for 'Around Current Frame' Onion-skinning method)");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
   RNA_def_property_int_sdna(prop, NULL, "path_ef");
@@ -281,8 +273,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
                            "End Frame",
                            "End frame of range of paths to display/calculate "
                            "(not for 'Around Current Frame' Onion-skinning method)");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   /* Around Current Ranges */
   prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME);
@@ -292,8 +283,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
                            "Before Current",
                            "Number of frames to show before the current frame "
                            "(only for 'Around Current Frame' Onion-skinning method)");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   prop = RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME);
   RNA_def_property_int_sdna(prop, NULL, "path_ac");
@@ -302,8 +292,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna)
                            "After Current",
                            "Number of frames to show after the current frame "
                            "(only for 'Around Current Frame' Onion-skinning method)");
-  RNA_def_property_update(
-      prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL);
 
   /* Readonly Property - Do any motion paths exist/need updating? (Mainly for bone paths) */
   prop = RNA_def_property(srna, "has_motion_paths", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 9d0ee90de60..f48a781cfab 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -200,21 +200,21 @@ static void rna_def_camera_background_image(BlenderRNA *brna)
   RNA_def_property_enum_sdna(prop, NULL, "source");
   RNA_def_property_enum_items(prop, bgpic_source_items);
   RNA_def_property_ui_text(prop, "Background Source", "Data source used for background");
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+  RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL);
 
   prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "ima");
   RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space");
   RNA_def_property_flag(prop, PROP_EDITABLE);
   RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+  RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL);
 
   prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE);
   RNA_def_property_pointer_sdna(prop, NULL, "clip");
   RNA_def_property_ui_text(prop, "MovieClip", "Movie clip displayed and edited in this space");
   RNA_def_property_flag(prop, PROP_EDITABLE);
   RNA_def_property_override_flag(prop, PROPOV

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list