[Bf-blender-cvs] [392ab38] depsgraph_refactor: Depsgraph: Make sure changing DOF keeps valid depsgraph

Sergey Sharybin noreply at git.blender.org
Wed Feb 25 13:56:52 CET 2015


Commit: 392ab38514b4bfafc217f300c2f55a8881b980b4
Author: Sergey Sharybin
Date:   Wed Feb 25 15:13:55 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rB392ab38514b4bfafc217f300c2f55a8881b980b4

Depsgraph: Make sure changing DOF keeps valid depsgraph

Not sure how it worked in master branch actually, maybe we need to do
something like this there as well.

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

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

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

diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 31e991d..8943e54 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -87,6 +87,13 @@ static void rna_Camera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointer
 	DAG_id_tag_update(&camera->id, 0);
 }
 
+static void rna_Camera_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
+{
+	Camera *camera = (Camera *)ptr->id.data;
+	DAG_relations_tag_update(bmain);
+	DAG_id_tag_update(&camera->id, 0);
+}
+
 #else
 
 void RNA_def_camera(BlenderRNA *brna)
@@ -289,7 +296,7 @@ void RNA_def_camera(BlenderRNA *brna)
 	RNA_def_property_pointer_sdna(prop, NULL, "dof_ob");
 	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point");
-	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dependency_update");
 
 	prop = RNA_def_property(srna, "gpu_dof", PROP_POINTER, PROP_NONE);
 	RNA_def_property_struct_type(prop, "GPUDOFSettings");




More information about the Bf-blender-cvs mailing list