[Bf-blender-cvs] [975e258] gooseberry: Support animation of camera dof properties.
Antony Riakiotakis
noreply at git.blender.org
Tue Nov 4 16:48:02 CET 2014
Commit: 975e2580a8b17044a372c797db8b2104bb971b52
Author: Antony Riakiotakis
Date: Tue Nov 4 16:47:40 2014 +0100
Branches: gooseberry
https://developer.blender.org/rB975e2580a8b17044a372c797db8b2104bb971b52
Support animation of camera dof properties.
Also minor cleanup
===================================================================
M release/scripts/startup/bl_ui/properties_data_camera.py
M source/blender/makesrna/intern/rna_camera.c
M source/blender/makesrna/intern/rna_scene.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py
index 6f0845b..395492c 100644
--- a/release/scripts/startup/bl_ui/properties_data_camera.py
+++ b/release/scripts/startup/bl_ui/properties_data_camera.py
@@ -172,14 +172,6 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
col.active = cam.dof_object is None
col.prop(cam, "dof_distance", text="Distance")
- col.label("Real Time Viewport values")
- dof_options = cam.gpu_dof
- subcol = col.column(align=True)
- subcol.prop(dof_options, "dof_focus_distance")
- subcol.prop(dof_options, "dof_fstop")
- subcol.prop(dof_options, "dof_focal_length")
- subcol.prop(dof_options, "dof_sensor")
-
class DATA_PT_camera_gpu_dof(Panel):
bl_label = "GPU Depth of Field"
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index b235220..efe3722 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -279,8 +279,6 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface");
/* pointers */
- rna_def_animdata_common(srna);
-
prop = RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Object");
RNA_def_property_pointer_sdna(prop, NULL, "dof_ob");
@@ -289,7 +287,11 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
prop = RNA_def_property(srna, "gpu_dof", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "GPUDOFOptions");
RNA_def_property_ui_text(prop, "GPU Depth Of Field", "");
+ RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
+
+ rna_def_animdata_common(srna);
/* Camera API */
RNA_api_camera(srna);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 48bf62c..628924a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1691,6 +1691,21 @@ static void rna_FreestyleSettings_module_remove(ID *id, FreestyleSettings *confi
WM_main_add_notifier(NC_SCENE | ND_RENDER_OPTIONS, NULL);
}
+char *rna_GPUDOF_path(PointerRNA *ptr)
+{
+ /* if there is ID-data, resolve the path using the index instead of by name,
+ * since the name used is the name of the texture assigned, but the texture
+ * may be used multiple times in the same stack
+ */
+ if (ptr->id.data) {
+ if (GS(((ID *)ptr->id.data)->name) == ID_CA) {
+ return BLI_strdup("gpu_dof");
+ }
+ }
+
+ return BLI_strdup("");;
+}
+
#else
static void rna_def_transform_orientation(BlenderRNA *brna)
@@ -3814,6 +3829,7 @@ static void rna_def_gpu_dof_fx(BlenderRNA *brna)
srna = RNA_def_struct(brna, "GPUDOFOptions", NULL);
RNA_def_struct_ui_text(srna, "GPU DOF", "Options for GPU based depth of field");
RNA_def_struct_ui_icon(srna, ICON_RENDERLAYERS);
+ RNA_def_struct_path_func(srna, "rna_GPUDOF_path");
prop = RNA_def_property(srna, "dof_focus_distance", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_ui_text(prop, "Focus distance", "Viewport depth of field focus distance");
More information about the Bf-blender-cvs
mailing list