From 51c034686a2a86629030a02c398d2686b8331ad4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Feb 2019 09:40:19 +1100 Subject: DNA: rename camera YF_dofdist -> dof_distance --- source/blender/blenkernel/intern/camera.c | 2 +- source/blender/blenkernel/intern/ipo.c | 2 +- source/blender/collada/CameraExporter.cpp | 2 +- source/blender/collada/DocumentImporter.cpp | 2 +- source/blender/makesdna/DNA_camera_types.h | 6 +----- source/blender/makesdna/intern/dna_rename_defs.h | 6 ++++-- source/blender/makesrna/intern/rna_camera.c | 1 - 7 files changed, 9 insertions(+), 12 deletions(-) diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index 449948b016d..e11a0b327ba 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -133,7 +133,7 @@ float BKE_camera_object_dof_distance(Object *ob) sub_v3_v3v3(dof_dir, ob->obmat[3], cam->dof_ob->obmat[3]); return fabsf(dot_v3v3(view_dir, dof_dir)); } - return cam->YF_dofdist; + return cam->dof_distance; } float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y) diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index e612e5885bb..c812c9598bc 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -600,7 +600,7 @@ static const char *camera_adrcodes_to_paths(int adrcode, int *array_index) case CAM_YF_APERT: poin = &(ca->YF_aperture); break; case CAM_YF_FDIST: - poin = &(ca->YF_dofdist); break; + poin = &(ca->dof_distance); break; #endif // XXX these are not defined in RNA case CAM_SHIFT_X: diff --git a/source/blender/collada/CameraExporter.cpp b/source/blender/collada/CameraExporter.cpp index 525fdf6f4f7..8a327e01651 100644 --- a/source/blender/collada/CameraExporter.cpp +++ b/source/blender/collada/CameraExporter.cpp @@ -93,7 +93,7 @@ bool CamerasExporter::exportBlenderProfile(COLLADASW::Camera &cm,Camera *cam) { cm.addExtraTechniqueParameter("blender","shiftx",cam->shiftx); cm.addExtraTechniqueParameter("blender","shifty",cam->shifty); - cm.addExtraTechniqueParameter("blender","YF_dofdist",cam->YF_dofdist); + cm.addExtraTechniqueParameter("blender","dof_distance",cam->dof_distance); return true; } diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 76a34c75e0e..a6a87cb7f32 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -836,7 +836,7 @@ bool DocumentImporter::writeCamera(const COLLADAFW::Camera *camera) if (et && et->isProfile("blender")) { et->setData("shiftx",&(cam->shiftx)); et->setData("shifty",&(cam->shifty)); - et->setData("YF_dofdist",&(cam->YF_dofdist)); + et->setData("dof_distance",&(cam->dof_distance)); } cam->clipsta = camera->getNearClippingPlane().getValue(); cam->clipend = camera->getFarClippingPlane().getValue(); diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h index cf62b034041..f73f3dc8def 100644 --- a/source/blender/makesdna/DNA_camera_types.h +++ b/source/blender/makesdna/DNA_camera_types.h @@ -90,11 +90,7 @@ typedef struct Camera { float lens, ortho_scale, drawsize; float sensor_x, sensor_y; float shiftx, shifty; - - /* yafray: dof params */ - /* qdn: yafray var 'YF_dofdist' now enabled for defocus composite node as well. - * The name was not changed so that no other files need to be modified */ - float YF_dofdist; + float dof_distance; /** Old animation system, deprecated for 2.5. */ struct Ipo *ipo DNA_DEPRECATED; diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h index cdf13e7103d..8e7b0be8471 100644 --- a/source/blender/makesdna/intern/dna_rename_defs.h +++ b/source/blender/makesdna/intern/dna_rename_defs.h @@ -38,10 +38,12 @@ /* No include guard (intentional). */ -/* Match RNA names where possible. */ +/* Match RNA names where possible, keep sorted. */ + +DNA_STRUCT_RENAME_ELEM(Camera, YF_dofdist, dof_distance) + #if 0 DNA_STRUCT_RENAME(Lamp, Light) DNA_STRUCT_RENAME(SpaceOops, SpaceOutliner) -DNA_STRUCT_RENAME_ELEM(Camera, YF_dofdist, dof_distance) DNA_STRUCT_RENAME_ELEM(Object, dup_group, instance_collection) #endif diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 6d29fdcbf70..aaae5c35c20 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -517,7 +517,6 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "YF_dofdist"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 5000.0f, 1, 2); RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field"); -- cgit v1.2.3