diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-06 11:52:50 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-06-06 13:36:51 +0300 |
commit | 82ec06cbfa95564b1bc84f006292d9bede2c27a4 (patch) | |
tree | 3c35628a3382c77508b2135a54e3b3b2052aedde /source/blender/depsgraph | |
parent | ca7de1ff22c70df0f82e8f860cf4dad37bf2ef4b (diff) |
Depsgraph: Object data separation, camera
Diffstat (limited to 'source/blender/depsgraph')
4 files changed, 27 insertions, 22 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index b1a31ebf4a9..32c38f0d1f5 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -572,7 +572,7 @@ void DepsgraphNodeBuilder::build_object_data(Object *object) build_object_data_lamp(object); break; case OB_CAMERA: - build_camera(object); + build_object_data_camera(object); break; case OB_LIGHTPROBE: build_object_data_lightprobe(object); @@ -588,6 +588,12 @@ void DepsgraphNodeBuilder::build_object_data(Object *object) } } +void DepsgraphNodeBuilder::build_object_data_camera(Object *object) +{ + Camera *camera = (Camera *)object->data; + build_camera(camera); +} + void DepsgraphNodeBuilder::build_object_data_lamp(Object *object) { Lamp *lamp = (Lamp *)object->data; @@ -1166,12 +1172,8 @@ void DepsgraphNodeBuilder::build_obdata_geom(Object *object) DEG_OPCODE_GEOMETRY_SELECT_UPDATE); } -/* Cameras */ -void DepsgraphNodeBuilder::build_camera(Object *object) +void DepsgraphNodeBuilder::build_camera(Camera *camera) { - /* Object data. */ - /* TODO: Link scene-camera links in somehow... */ - Camera *camera = (Camera *)object->data; if (built_map_.checkIsBuiltAndTag(camera)) { return; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 564d15781f2..4f19a7a58f8 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -37,6 +37,7 @@ struct Base; struct CacheFile; +struct Camera; struct bGPdata; struct ListBase; struct GHash; @@ -167,6 +168,7 @@ struct DepsgraphNodeBuilder { Object *object, eDepsNode_LinkedState_Type linked_state); void build_object_data(Object *object); + void build_object_data_camera(Object *object); void build_object_data_lamp(Object *object); void build_object_data_lightprobe(Object *object); void build_object_transform(Object *object); @@ -190,7 +192,7 @@ struct DepsgraphNodeBuilder { void build_proxy_rig(Object *object); void build_shapekeys(Key *key); void build_obdata_geom(Object *object); - void build_camera(Object *object); + void build_camera(Camera *camera); void build_lamp(Lamp *lamp); void build_nodetree(bNodeTree *ntree); void build_material(Material *ma); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 9d978aff9fb..37f1023e134 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -612,7 +612,7 @@ void DepsgraphRelationBuilder::build_object_data(Object *object) build_object_data_lamp(object); break; case OB_CAMERA: - build_camera(object); + build_object_data_camera(object); break; case OB_LIGHTPROBE: build_object_data_lightprobe(object); @@ -627,6 +627,15 @@ void DepsgraphRelationBuilder::build_object_data(Object *object) } } +void DepsgraphRelationBuilder::build_object_data_camera(Object *object) +{ + Camera *camera = (Camera *)object->data; + build_camera(camera); + ComponentKey object_parameters_key(&object->id, DEG_NODE_TYPE_PARAMETERS); + ComponentKey camera_parameters_key(&camera->id, DEG_NODE_TYPE_PARAMETERS); + add_relation(camera_parameters_key, object_parameters_key, "Camera -> Object"); +} + void DepsgraphRelationBuilder::build_object_data_lamp(Object *object) { Lamp *lamp = (Lamp *)object->data; @@ -1859,25 +1868,15 @@ void DepsgraphRelationBuilder::build_obdata_geom(Object *object) } } -/* Cameras */ -// TODO: Link scene-camera links in somehow... -void DepsgraphRelationBuilder::build_camera(Object *object) +void DepsgraphRelationBuilder::build_camera(Camera *camera) { - Camera *camera = (Camera *)object->data; if (built_map_.checkIsBuiltAndTag(camera)) { return; } - - ComponentKey object_parameters_key(&object->id, DEG_NODE_TYPE_PARAMETERS); - ComponentKey camera_parameters_key(&camera->id, DEG_NODE_TYPE_PARAMETERS); - - add_relation(camera_parameters_key, object_parameters_key, - "Camera -> Object"); - - /* DOF */ if (camera->dof_ob != NULL) { + ComponentKey camera_parameters_key(&camera->id, DEG_NODE_TYPE_PARAMETERS); ComponentKey dof_ob_key(&camera->dof_ob->id, DEG_NODE_TYPE_TRANSFORM); - add_relation(dof_ob_key, object_parameters_key, "Camera DOF"); + add_relation(dof_ob_key, camera_parameters_key, "Camera DOF"); } } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 5546d6fd32e..b613b839b96 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -51,6 +51,7 @@ struct Base; struct bGPdata; struct CacheFile; +struct Camera; struct ListBase; struct GHash; struct ID; @@ -203,6 +204,7 @@ struct DepsgraphRelationBuilder void build_object(Base *base, Object *object); void build_object_flags(Base *base, Object *object); void build_object_data(Object *object); + void build_object_data_camera(Object *object); void build_object_data_lamp(Object *object); void build_object_data_lightprobe(Object *object); void build_object_parent(Object *object); @@ -245,7 +247,7 @@ struct DepsgraphRelationBuilder void build_proxy_rig(Object *object); void build_shapekeys(ID *obdata, Key *key); void build_obdata_geom(Object *object); - void build_camera(Object *object); + void build_camera(Camera *camera); void build_lamp(Lamp *lamp); void build_nodetree(bNodeTree *ntree); void build_material(Material *ma); |