[Bf-blender-cvs] [10b976d2eb8] blender2.8: Fix 3D cursor update

Campbell Barton noreply at git.blender.org
Tue Jul 10 09:38:57 CEST 2018


Commit: 10b976d2eb8a5de24c19bbb469005d59c6cd7c17
Author: Campbell Barton
Date:   Tue Jul 10 09:37:39 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB10b976d2eb8a5de24c19bbb469005d59c6cd7c17

Fix 3D cursor update

Changing the values for the 3D cursor wasn't updating.

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

M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index ab83cedd232..78174c10128 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -545,6 +545,14 @@ static void rna_View3D_Cursor_rotation_set(PointerRNA *ptr, const float *values)
 	copy_qt_qt(cursor->rotation, values);
 }
 
+static void rna_View3D_Cursor_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
+{
+	View3D *v3d = ptr->data;
+	if (v3d->localvd == NULL) {
+		DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE);
+	}
+}
+
 static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr)
 {
 	View3D *v3d = (View3D *)(ptr->data);
@@ -2844,14 +2852,14 @@ static void rna_def_space_view3d(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "3D Cursor Location",
 	                         "3D cursor location for this view (dependent on local view setting)");
 	RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, RNA_TRANSLATION_PREC_DEFAULT);
-	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_View3D_Cursor_update");
 
 	prop = RNA_def_property(srna, "cursor_rotation", PROP_FLOAT, PROP_QUATERNION);
 	RNA_def_property_array(prop, 4);
 	RNA_def_property_float_funcs(prop, "rna_View3D_Cursor_rotation_get", "rna_View3D_Cursor_rotation_set", NULL);
 	RNA_def_property_ui_text(prop, "3D Cursor Rotation",
 	                         "Rotation in quaternions (keep normalized)");
-	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_View3D_Cursor_update");
 
 	prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_UNIT_CAMERA);
 	RNA_def_property_float_sdna(prop, NULL, "lens");



More information about the Bf-blender-cvs mailing list