Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-30 18:33:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-30 18:33:46 +0400
commit44eb9f509552162d776c1b39a0689d8ddac8f1c7 (patch)
tree165f4423d6a11f924c76063c0fa5105deb9986e9 /source/blender/makesrna/intern/rna_scene.c
parenteab50148e23955ab38dca74b964f33eaacf42d27 (diff)
missed this one too
scene.add_keying_set() --> scene.keying_sets.new() also removed the use_ prefix since argument names, since this is mainly for properties.
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c58
1 files changed, 43 insertions, 15 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index c21c6fb4aba..7ccef4ba031 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -164,6 +164,7 @@ EnumPropertyItem image_type_items[] = {
#include "BKE_mesh.h"
#include "BKE_sound.h"
#include "BKE_screen.h"
+#include "BKE_animsys.h"
#include "BLI_threads.h"
#include "BLI_editVert.h"
@@ -938,6 +939,33 @@ static void rna_TimeLine_remove(Scene *scene, ReportList *reports, TimeMarker *m
MEM_freeN(marker);
}
+static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports,
+ char name[], int absolute, int insertkey_needed, int insertkey_visual)
+{
+ KeyingSet *ks= NULL;
+ short flag=0, keyingflag=0;
+
+ /* validate flags */
+ if (absolute)
+ flag |= KEYINGSET_ABSOLUTE;
+ if (insertkey_needed)
+ keyingflag |= INSERTKEY_NEEDED;
+ if (insertkey_visual)
+ keyingflag |= INSERTKEY_MATRIX;
+
+ /* call the API func, and set the active keyingset index */
+ ks= BKE_keyingset_add(&sce->keyingsets, name, flag, keyingflag);
+
+ if (ks) {
+ sce->active_keyingset= BLI_countlist(&sce->keyingsets);
+ return ks;
+ }
+ else {
+ BKE_report(reports, RPT_ERROR, "Keying Set could not be added.");
+ return NULL;
+ }
+}
+
#else
static void rna_def_transform_orientation(BlenderRNA *brna)
@@ -2954,28 +2982,28 @@ static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop)
StructRNA *srna;
PropertyRNA *prop;
-// FunctionRNA *func;
-// PropertyRNA *parm;
+ FunctionRNA *func;
+ PropertyRNA *parm;
RNA_def_property_srna(cprop, "KeyingSets");
srna= RNA_def_struct(brna, "KeyingSets", NULL);
RNA_def_struct_sdna(srna, "Scene");
RNA_def_struct_ui_text(srna, "Keying Sets", "Scene keying sets");
- /*
- func= RNA_def_function(srna, "new", "rna_Curve_spline_new");
- RNA_def_function_ui_description(func, "Add a new spline to the curve.");
- parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline.");
- RNA_def_property_flag(parm, PROP_REQUIRED);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline.");
- RNA_def_function_return(func, parm);
-
- func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
- RNA_def_function_ui_description(func, "Remove a spline from a curve.");
+ /* Add Keying Set */
+ func= RNA_def_function(srna, "new", "rna_Scene_keying_set_new");
+ RNA_def_function_ui_description(func, "Add a new Keying Set to Scene.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
- parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove.");
- RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
- */
+ /* returns the new KeyingSet */
+ parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set.");
+ RNA_def_function_return(func, parm);
+ /* name */
+ RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set");
+ /* flags */
+ RNA_def_boolean(func, "absolute", 1, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)");
+ /* keying flags */
+ RNA_def_boolean(func, "insertkey_needed", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves.");
+ RNA_def_boolean(func, "insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'.");
prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "KeyingSet");