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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r--source/blender/makesrna/intern/rna_define.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 4e6c3748230..c32255ac645 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -61,7 +61,7 @@
/* Global used during defining */
-BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1};
+BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1, 1};
/* Duplicated code since we can't link in blenkernel or blenlib */
@@ -506,6 +506,13 @@ void RNA_define_verify_sdna(int verify)
DefRNA.verify = verify;
}
+#ifndef RNA_RUNTIME
+void RNA_define_animate_sdna(int animate)
+{
+ DefRNA.animate = animate;
+}
+#endif
+
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext)
{
#ifdef RNA_RUNTIME
@@ -1031,8 +1038,15 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier
if (type != PROP_COLLECTION && type != PROP_POINTER) {
prop->flag = PROP_EDITABLE;
- if (type != PROP_STRING)
+ if (type != PROP_STRING) {
+#ifdef RNA_RUNTIME
prop->flag |= PROP_ANIMATABLE;
+#else
+ if (DefRNA.animate) {
+ prop->flag |= PROP_ANIMATABLE;
+ }
+#endif
+ }
}
if (type == PROP_STRING) {
@@ -2120,6 +2134,7 @@ void RNA_def_property_int_funcs_runtime(PropertyRNA *prop, IntPropertyGetFunc ge
if (getfunc) iprop->get_ex = getfunc;
if (setfunc) iprop->set_ex = setfunc;
+ if (rangefunc) iprop->range_ex = rangefunc;
if (getfunc || setfunc) {
/* don't save in id properties */
@@ -2136,6 +2151,7 @@ void RNA_def_property_int_array_funcs_runtime(PropertyRNA *prop, IntArrayPropert
if (getfunc) iprop->getarray_ex = getfunc;
if (setfunc) iprop->setarray_ex = setfunc;
+ if (rangefunc) iprop->range_ex = rangefunc;
if (getfunc || setfunc) {
/* don't save in id properties */
@@ -2558,21 +2574,6 @@ PropertyRNA *RNA_def_string_file_name(StructOrFunctionRNA *cont_, const char *id
return prop;
}
-PropertyRNA *RNA_def_string_py_translate(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value,
- int maxlen, const char *ui_name, const char *ui_description)
-{
- ContainerRNA *cont = cont_;
- PropertyRNA *prop;
-
- prop = RNA_def_property(cont, identifier, PROP_STRING, PROP_NONE);
- RNA_def_property_flag(prop, PROP_STRING_PY_TRANSLATE);
- if (maxlen != 0) RNA_def_property_string_maxlength(prop, maxlen);
- if (default_value) RNA_def_property_string_default(prop, default_value);
- RNA_def_property_ui_text(prop, ui_name, ui_description);
-
- return prop;
-}
-
PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items,
int default_value, const char *ui_name, const char *ui_description)
{