[Bf-blender-cvs] [9c13923] depsgraph_refactor: Depsgraph: Correction for camera DOF relation

Sergey Sharybin noreply at git.blender.org
Wed Feb 25 10:56:51 CET 2015


Commit: 9c13923df707394ecf8308d44d8912e954350f60
Author: Sergey Sharybin
Date:   Wed Feb 25 14:54:53 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rB9c13923df707394ecf8308d44d8912e954350f60

Depsgraph: Correction for camera DOF relation

For now it's unclear how to handle it on the camera datablock level,
so moved parameters to the camera object level.

This kinda of makes sense because for DOF you need to know object
matrix and having DOF decoupled from it is kinda weird.. IN any case
it's always easy to make it camera data relation and add relation
between camera datablock and camera object.

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

M	source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
M	source/blender/depsgraph/intern/depsgraph_build_relations.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
index 4e77157..de9055d 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
@@ -848,6 +848,15 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
 void DepsgraphNodeBuilder::build_camera(Object *ob)
 {
 	/* TODO: Link scene-camera links in somehow... */
+	Camera *cam = (Camera *)ob->data;
+
+	if (cam->dof_ob != NULL) {
+		/* TODO(sergey): For now parametrs are on object level. */
+		add_operation_node(&ob->id, DEPSNODE_TYPE_PARAMETERS,
+		                   DEPSOP_TYPE_EXEC, NULL,
+		                   DEG_OPCODE_PLACEHOLDER,
+		                   "Camera DOF");
+	}
 }
 
 /* Lamps */
diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
index b282dd9..443da8b 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -1557,7 +1557,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Scene *scene, Object *ob)
 void DepsgraphRelationBuilder::build_camera(Object *ob)
 {
 	Camera *cam = (Camera *)ob->data;
-	ComponentKey param_key(&cam->id, DEPSNODE_TYPE_PARAMETERS);
+	ComponentKey param_key(&ob->id, DEPSNODE_TYPE_PARAMETERS);
 
 	/* DOF */
 	if (cam->dof_ob) {




More information about the Bf-blender-cvs mailing list