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:
authorJoshua Leung <aligorith@gmail.com>2009-07-11 03:25:30 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-11 03:25:30 +0400
commit66a81a4062b8cc01452316c8eeb442b0acf2663e (patch)
tree3a0a40d65ad8cf39e6b9ea72042ef2d04ce8f60d /source/blender/makesrna/intern/rna_nla.c
parentb609f2aa790e122504aad34512d08241c2e01079 (diff)
NLA SoC: Names for NLA Strips
In order to be able to better identify NLA Strips (and to reduce the complexity of the text on them), I've implemented a name property for the strips. The names are made to be unique within the AnimData block the strip comes from, though this may not always happen if not enough relevant context info is present to validate this.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nla.c')
-rw-r--r--source/blender/makesrna/intern/rna_nla.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c
index 97f35af1db7..bc636af6849 100644
--- a/source/blender/makesrna/intern/rna_nla.c
+++ b/source/blender/makesrna/intern/rna_nla.c
@@ -41,11 +41,27 @@
#include <math.h>
/* needed for some of the validation stuff... */
+#include "BKE_animsys.h"
#include "BKE_nla.h"
/* temp constant defined for these funcs only... */
#define NLASTRIP_MIN_LEN_THRESH 0.1f
+void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value)
+{
+ NlaStrip *data= (NlaStrip *)ptr->data;
+
+ /* copy the name first */
+ BLI_strncpy(data->name, value, sizeof(data->name));
+
+ /* validate if there's enough info to do so */
+ if (ptr->id.data) {
+ AnimData *adt= BKE_animdata_from_id(ptr->id.data);
+ BKE_nlastrip_validate_name(adt, data);
+ }
+}
+
+
static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value)
{
NlaStrip *data= (NlaStrip*)ptr->data;
@@ -255,6 +271,12 @@ void rna_def_nlastrip(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action.");
RNA_def_struct_ui_icon(srna, ICON_NLA); // XXX
+ /* name property */
+ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Name", "");
+ RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NlaStrip_name_set");
+ RNA_def_struct_name_property(srna, prop);
+
/* Enums */
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");