From 56a47e58f4de3f66c2fee827fb2a7883b4f493e9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 Jun 2018 14:30:32 +0200 Subject: Cleanup: style --- source/blender/makesrna/intern/rna_ui_api.c | 54 +++++++++++++++++------------ 1 file changed, 32 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index dd3a2bf6fe2..d416e5d755d 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -95,9 +95,10 @@ const char *rna_translate_ui_text( return BLT_pgettext(BLT_I18NCONTEXT_DEFAULT, text); } -static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, const char *text_ctxt, - int translate, int icon, int expand, int slider, int toggle, int icon_only, int event, - int full_event, int emboss, int index, int icon_value) +static void rna_uiItemR( + uiLayout *layout, PointerRNA *ptr, const char *propname, const char *name, const char *text_ctxt, + int translate, int icon, int expand, int slider, int toggle, int icon_only, int event, + int full_event, int emboss, int index, int icon_value) { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); int flag = 0; @@ -125,8 +126,9 @@ static void rna_uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, uiItemFullR(layout, ptr, prop, index, 0, flag, name, icon); } -static void rna_uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, - const char *text_ctxt, int translate, int icon) +static void rna_uiItemMenuEnumR( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *name, + const char *text_ctxt, int translate, int icon) { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); @@ -140,8 +142,9 @@ static void rna_uiItemMenuEnumR(uiLayout *layout, struct PointerRNA *ptr, const uiItemMenuEnumR_prop(layout, ptr, prop, name, icon); } -static void rna_uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *value, - const char *name, const char *text_ctxt, int translate, int icon) +static void rna_uiItemEnumR_string( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *value, + const char *name, const char *text_ctxt, int translate, int icon) { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); @@ -157,9 +160,10 @@ static void rna_uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, con uiItemEnumR_string(layout, ptr, propname, value, name, icon); } -static void rna_uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, - struct PointerRNA *searchptr, const char *searchpropname, - const char *name, const char *text_ctxt, int translate, int icon) +static void rna_uiItemPointerR( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, + struct PointerRNA *searchptr, const char *searchpropname, + const char *name, const char *text_ctxt, int translate, int icon) { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); @@ -226,8 +230,9 @@ static PointerRNA rna_uiItemOMenuHold( } -static void rna_uiItemMenuEnumO(uiLayout *layout, bContext *C, const char *opname, const char *propname, const char *name, - const char *text_ctxt, int translate, int icon) +static void rna_uiItemMenuEnumO( + uiLayout *layout, bContext *C, const char *opname, const char *propname, const char *name, + const char *text_ctxt, int translate, int icon) { wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */ @@ -242,8 +247,9 @@ static void rna_uiItemMenuEnumO(uiLayout *layout, bContext *C, const char *opnam uiItemMenuEnumO_ptr(layout, C, ot, propname, name, icon); } -static void rna_uiItemL(uiLayout *layout, const char *name, const char *text_ctxt, int translate, - int icon, int icon_value) +static void rna_uiItemL( + uiLayout *layout, const char *name, const char *text_ctxt, int translate, + int icon, int icon_value) { /* Get translated name (label). */ name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate); @@ -255,8 +261,9 @@ static void rna_uiItemL(uiLayout *layout, const char *name, const char *text_ctx uiItemL(layout, name, icon); } -static void rna_uiItemM(uiLayout *layout, bContext *C, const char *menuname, const char *name, const char *text_ctxt, - int translate, int icon, int icon_value) +static void rna_uiItemM( + uiLayout *layout, bContext *C, const char *menuname, const char *name, const char *text_ctxt, + int translate, int icon, int icon_value) { /* Get translated name (label). */ name = rna_translate_ui_text(name, text_ctxt, NULL, NULL, translate); @@ -268,8 +275,9 @@ static void rna_uiItemM(uiLayout *layout, bContext *C, const char *menuname, con uiItemM(layout, C, menuname, name, icon); } -static void rna_uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *propname, const char *proptypename, - const char *name, const char *text_ctxt, int translate) +static void rna_uiTemplateAnyID( + uiLayout *layout, PointerRNA *ptr, const char *propname, const char *proptypename, + const char *name, const char *text_ctxt, int translate) { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); @@ -285,8 +293,9 @@ static void rna_uiTemplateAnyID(uiLayout *layout, PointerRNA *ptr, const char *p uiTemplateAnyID(layout, ptr, propname, proptypename, name); } -static void rna_uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *root_ptr, - const char *name, const char *text_ctxt, int translate) +static void rna_uiTemplatePathBuilder( + uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *root_ptr, + const char *name, const char *text_ctxt, int translate) { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); @@ -337,8 +346,9 @@ static const char *rna_ui_get_enum_name(bContext *C, PointerRNA *ptr, const char return name; } -static const char *rna_ui_get_enum_description(bContext *C, PointerRNA *ptr, const char *propname, - const char *identifier) +static const char *rna_ui_get_enum_description( + bContext *C, PointerRNA *ptr, const char *propname, + const char *identifier) { PropertyRNA *prop = NULL; const EnumPropertyItem *items = NULL, *item; -- cgit v1.2.3 From fb565ddb681f39cbe47e91d11e5b728bb4314a7b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 9 Jun 2018 14:40:09 +0200 Subject: Cleanup: trailing space in RNA --- source/blender/makesrna/RNA_types.h | 2 +- source/blender/makesrna/intern/makesrna.c | 22 +- source/blender/makesrna/intern/rna_ID.c | 12 +- source/blender/makesrna/intern/rna_access.c | 196 ++-- source/blender/makesrna/intern/rna_action.c | 126 +-- source/blender/makesrna/intern/rna_action_api.c | 2 +- source/blender/makesrna/intern/rna_actuator.c | 54 +- source/blender/makesrna/intern/rna_animation.c | 190 ++-- source/blender/makesrna/intern/rna_animation_api.c | 6 +- source/blender/makesrna/intern/rna_animviz.c | 86 +- source/blender/makesrna/intern/rna_armature.c | 142 +-- source/blender/makesrna/intern/rna_boid.c | 20 +- source/blender/makesrna/intern/rna_brush.c | 44 +- source/blender/makesrna/intern/rna_cloth.c | 54 +- source/blender/makesrna/intern/rna_color.c | 54 +- source/blender/makesrna/intern/rna_constraint.c | 178 ++-- source/blender/makesrna/intern/rna_controller.c | 14 +- source/blender/makesrna/intern/rna_curve.c | 124 +-- source/blender/makesrna/intern/rna_define.c | 98 +- source/blender/makesrna/intern/rna_dynamicpaint.c | 62 +- source/blender/makesrna/intern/rna_fcurve.c | 382 +++---- source/blender/makesrna/intern/rna_fluidsim.c | 30 +- source/blender/makesrna/intern/rna_gpencil.c | 150 +-- source/blender/makesrna/intern/rna_group.c | 2 +- source/blender/makesrna/intern/rna_image.c | 16 +- source/blender/makesrna/intern/rna_key.c | 62 +- source/blender/makesrna/intern/rna_lamp.c | 20 +- source/blender/makesrna/intern/rna_lattice.c | 10 +- source/blender/makesrna/intern/rna_main.c | 4 +- source/blender/makesrna/intern/rna_material.c | 302 +++--- source/blender/makesrna/intern/rna_mesh.c | 2 +- source/blender/makesrna/intern/rna_mesh_api.c | 4 +- source/blender/makesrna/intern/rna_mesh_utils.h | 2 +- source/blender/makesrna/intern/rna_meta.c | 40 +- source/blender/makesrna/intern/rna_modifier.c | 164 +-- source/blender/makesrna/intern/rna_nla.c | 160 +-- source/blender/makesrna/intern/rna_nodetree.c | 1066 ++++++++++---------- source/blender/makesrna/intern/rna_object.c | 146 +-- source/blender/makesrna/intern/rna_object_api.c | 8 +- source/blender/makesrna/intern/rna_object_force.c | 236 ++--- source/blender/makesrna/intern/rna_particle.c | 60 +- source/blender/makesrna/intern/rna_pose.c | 128 +-- source/blender/makesrna/intern/rna_render.c | 8 +- source/blender/makesrna/intern/rna_rigidbody.c | 94 +- source/blender/makesrna/intern/rna_rna.c | 18 +- source/blender/makesrna/intern/rna_scene.c | 358 +++---- source/blender/makesrna/intern/rna_scene_api.c | 4 +- source/blender/makesrna/intern/rna_screen.c | 8 +- source/blender/makesrna/intern/rna_sculpt_paint.c | 68 +- source/blender/makesrna/intern/rna_sensor.c | 30 +- source/blender/makesrna/intern/rna_sequencer.c | 100 +- source/blender/makesrna/intern/rna_sequencer_api.c | 2 +- source/blender/makesrna/intern/rna_smoke.c | 8 +- source/blender/makesrna/intern/rna_test.c | 2 +- source/blender/makesrna/intern/rna_text.c | 18 +- source/blender/makesrna/intern/rna_texture.c | 202 ++-- source/blender/makesrna/intern/rna_texture_api.c | 2 +- source/blender/makesrna/intern/rna_ui.c | 50 +- source/blender/makesrna/intern/rna_ui_api.c | 20 +- source/blender/makesrna/intern/rna_userdef.c | 368 +++---- source/blender/makesrna/intern/rna_vfont.c | 2 +- source/blender/makesrna/intern/rna_wm.c | 40 +- source/blender/makesrna/intern/rna_wm_api.c | 28 +- source/blender/makesrna/intern/rna_world.c | 8 +- source/blender/makesrna/rna_cleanup/rna_cleaner.py | 34 +- .../makesrna/rna_cleanup/rna_cleaner_merge.py | 20 +- 66 files changed, 2987 insertions(+), 2985 deletions(-) (limited to 'source') diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 705d3914a52..912ea0084d7 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -492,7 +492,7 @@ typedef struct ExtensionRNA { StructRNA *srna; StructCallbackFunc call; StructFreeFunc free; - + } ExtensionRNA; #ifdef __cplusplus diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index e197a8a3a4d..85b5e1f7186 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -290,7 +290,7 @@ static void rna_sortlist(ListBase *listbase, int (*cmp)(const void *, const void Link *link; void **array; int a, size; - + if (listbase->first == listbase->last) return; @@ -497,7 +497,7 @@ static int rna_enum_bitmask(PropertyRNA *prop) if (eprop->item[a].identifier[0]) mask |= eprop->item[a].value; } - + return mask; } @@ -1416,7 +1416,7 @@ static void rna_set_raw_property(PropertyDefRNA *dp, PropertyRNA *prop) return; if (!dp->dnatype || !dp->dnaname || !dp->dnastructname) return; - + if (STREQ(dp->dnatype, "char")) { prop->rawtype = PROP_RAW_CHAR; prop->flag_internal |= PROP_INTERN_RAW_ACCESS; @@ -1677,7 +1677,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR if (sprop->maxlength) { fprintf(f, "#define %s_%s_MAX %d\n\n", srna->identifier, prop->identifier, sprop->maxlength); } - + fprintf(f, "void %sget(PointerRNA *ptr, char *value);\n", func); fprintf(f, "int %slength(PointerRNA *ptr);\n", func); fprintf(f, "void %sset(PointerRNA *ptr, const char *value);\n", func); @@ -1733,7 +1733,7 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property if (prop->flag & PROP_IDPROPERTY || prop->flag_internal & PROP_INTERN_BUILTIN) { return; } - + /* disabled for now to avoid msvc compiler error due to large file size */ #if 0 if (prop->name && prop->description && prop->description[0] != '\0') @@ -2259,7 +2259,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA fprintf(f, "\n{\n"); /* variable definitions */ - + if (func->flag & FUNC_USE_SELF_ID) { fprintf(f, "\tstruct ID *_selfid;\n"); } @@ -2301,7 +2301,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA /* for dynamic parameters we pass an additional int for the length of the parameter */ if (flag & PROP_DYNAMIC) fprintf(f, "\tint %s%s_len;\n", pout ? "*" : "", dparm->prop->identifier); - + fprintf(f, "\t%s%s %s%s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier); } @@ -2317,7 +2317,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA if (func->flag & FUNC_USE_SELF_ID) { fprintf(f, "\t_selfid = (struct ID *)_ptr->id.data;\n"); } - + if ((func->flag & FUNC_NO_SELF) == 0) { if (dsrna->dnafromprop) fprintf(f, "\t_self = (struct %s *)_ptr->data;\n", dsrna->dnafromname); else if (dsrna->dnaname) fprintf(f, "\t_self = (struct %s *)_ptr->data;\n", dsrna->dnaname); @@ -2874,7 +2874,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr { char *strnest = (char *)"", *errnest = (char *)""; int len, freenest = 0; - + if (nest != NULL) { len = strlen(nest); @@ -3404,7 +3404,7 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const StructDefRNA *ds; PropertyDefRNA *dp; FunctionDefRNA *dfunc; - + fprintf(f, "\n" "/* Automatically generated struct definitions for the Data API.\n" @@ -3900,7 +3900,7 @@ static void rna_generate_header_cpp(BlenderRNA *UNUSED(brna), FILE *f) fprintf(f, "/* Automatically generated classes for the Data API.\n" " * Do not edit manually, changes will be overwritten. */\n\n"); - + fprintf(f, "#include \"RNA_blender.h\"\n"); fprintf(f, "#include \"RNA_types.h\"\n"); fprintf(f, "#include \"RNA_access.h\"\n"); diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 0520e639adf..d3331e6ca52 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -127,13 +127,13 @@ void rna_ID_name_set(PointerRNA *ptr, const char *value) static int rna_ID_name_editable(PointerRNA *ptr, const char **UNUSED(r_info)) { ID *id = (ID *)ptr->data; - + if (GS(id->name) == ID_VF) { VFont *vfont = (VFont *)id; if (BKE_vfont_is_builtin(vfont)) return false; } - + return PROP_EDITABLE; } @@ -300,7 +300,7 @@ static ID *rna_ID_copy(ID *id, Main *bmain) if (newid) id_us_min(newid); return newid; } - + return NULL; } @@ -775,7 +775,7 @@ static void rna_def_ID_properties(BlenderRNA *brna) srna = RNA_def_struct(brna, "PropertyGroupItem", NULL); RNA_def_struct_sdna(srna, "IDProperty"); RNA_def_struct_ui_text(srna, "ID Property", "Property that stores arbitrary, user defined properties"); - + /* IDP_STRING */ prop = RNA_def_property(srna, "string", PROP_STRING, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); @@ -861,7 +861,7 @@ static void rna_def_ID_materials(BlenderRNA *brna) StructRNA *srna; FunctionRNA *func; PropertyRNA *parm; - + /* for mesh/mball/curve materials */ srna = RNA_def_struct(brna, "IDMaterials", NULL); RNA_def_struct_sdna(srna, "ID"); @@ -1102,7 +1102,7 @@ static void rna_def_library(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "File Path", "Path to the library .blend file"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Library_filepath_set"); - + prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Library"); RNA_def_property_ui_text(prop, "Parent", ""); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c0871baca45..daa01f58e12 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -98,9 +98,9 @@ void RNA_init(void) void RNA_exit(void) { StructRNA *srna; - + RNA_property_update_cache_free(); - + for (srna = BLENDER_RNA.structs.first; srna; srna = srna->cont.next) { if (srna->cont.prophash) { BLI_ghash_free(srna->cont.prophash, NULL, NULL); @@ -128,7 +128,7 @@ void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr) PointerRNA tmp = {{NULL}}; tmp.data = id; idtype = rna_ID_refine(&tmp); - + while (idtype->refine) { type = idtype->refine(&tmp); @@ -138,7 +138,7 @@ void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr) idtype = type; } } - + r_ptr->id.data = id; r_ptr->type = idtype; r_ptr->data = id; @@ -280,7 +280,7 @@ IDProperty *RNA_struct_idprops(PointerRNA *ptr, bool create) if (type && type->idproperties) { return type->idproperties(ptr, create); } - + return NULL; } @@ -371,7 +371,7 @@ static bool rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDPr * description and otherwise removes it. this is to ensure that * rna property access is type safe, e.g. if you defined the rna * to have a certain array length you can count on that staying so */ - + switch (idprop->type) { case IDP_IDPARRAY: if (prop->type != PROP_COLLECTION) @@ -670,7 +670,7 @@ bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna) for (base = type; base; base = base->base) if (base == srna) return true; - + return false; } @@ -695,7 +695,7 @@ PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier) if (RNA_property_collection_lookup_string(ptr, iterprop, identifier, &propptr)) return propptr.data; } - + return NULL; } @@ -1152,7 +1152,7 @@ void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, { IntPropertyRNA *iprop = (IntPropertyRNA *)rna_ensure_property(prop); int hardmin, hardmax; - + if (prop->magic != RNA_MAGIC) { /* attempt to get the local ID values */ IDProperty *idp_ui = rna_idproperty_ui(prop); @@ -1665,7 +1665,7 @@ bool RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *pro { const EnumPropertyItem *item = NULL; bool free; - + RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); if (item) { bool result; @@ -1682,7 +1682,7 @@ bool RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, con { const EnumPropertyItem *item = NULL; bool free; - + RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); if (item) { bool result; @@ -1690,7 +1690,7 @@ bool RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, con if (free) { MEM_freeN((void *)item); } - + return result; } return false; @@ -1895,7 +1895,7 @@ bool RNA_property_animateable(PointerRNA *ptr, PropertyRNA *prop) /* check that base ID-block can support animation data */ if (!id_can_have_animdata(ptr->id.data)) return false; - + prop = rna_ensure_property(prop); if (!(prop->flag & PROP_ANIMATABLE)) @@ -1971,7 +1971,7 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR if (prop->noteflag) WM_main_add_notifier(prop->noteflag, ptr->id.data); } - + if (!is_rna || (prop->flag & PROP_IDPROPERTY)) { /* WARNING! This is so property drivers update the display! * not especially nice */ @@ -2025,7 +2025,7 @@ void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, Proper /* cache element */ typedef struct tRnaUpdateCacheElem { struct tRnaUpdateCacheElem *next, *prev; - + PointerRNA ptr; /* L1 key - id as primary, data secondary/ignored? */ ListBase L2Funcs; /* L2 functions (LinkData) */ } tRnaUpdateCacheElem; @@ -2041,18 +2041,18 @@ void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop) tRnaUpdateCacheElem *uce = NULL; UpdateFunc fn = NULL; LinkData *ld; - + /* sanity check */ if (NULL == ptr) return; - + prop = rna_ensure_property(prop); - + /* we can only handle update calls with no context args for now (makes animsys updates easier) */ if ((is_rna == false) || (prop->update == NULL) || (prop->flag & PROP_CONTEXT_UPDATE)) return; fn = prop->update; - + /* find cache element for which key matches... */ for (uce = rna_updates_cache.first; uce; uce = uce->next) { /* just match by id only for now, since most update calls that we'll encounter only really care about this */ @@ -2065,11 +2065,11 @@ void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop) /* create new instance */ uce = MEM_callocN(sizeof(tRnaUpdateCacheElem), "tRnaUpdateCacheElem"); BLI_addtail(&rna_updates_cache, uce); - + /* copy pointer */ RNA_pointer_create(ptr->id.data, ptr->type, ptr->data, &uce->ptr); } - + /* check on the update func */ for (ld = uce->L2Funcs.first; ld; ld = ld->next) { /* stop on match - function already cached */ @@ -2083,13 +2083,13 @@ void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_update_cache_flush(Main *bmain, Scene *scene) { tRnaUpdateCacheElem *uce; - + /* TODO: should we check that bmain and scene are valid? The above stuff doesn't! */ - + /* execute the cached updates */ for (uce = rna_updates_cache.first; uce; uce = uce->next) { LinkData *ld; - + for (ld = uce->L2Funcs.first; ld; ld = ld->next) { UpdateFunc fn = (UpdateFunc)ld->data; fn(bmain, scene, &uce->ptr); @@ -2100,13 +2100,13 @@ void RNA_property_update_cache_flush(Main *bmain, Scene *scene) void RNA_property_update_cache_free(void) { tRnaUpdateCacheElem *uce, *ucn; - + for (uce = rna_updates_cache.first; uce; uce = ucn) { ucn = uce->next; - + /* free L2 cache */ BLI_freelistN(&uce->L2Funcs); - + /* remove self */ BLI_freelinkN(&rna_updates_cache, uce); } @@ -2307,7 +2307,7 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values) { BoolPropertyRNA *bprop = (BoolPropertyRNA *)rna_ensure_property(prop); - + BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != false); @@ -2562,7 +2562,7 @@ int RNA_property_int_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values) { IntPropertyRNA *iprop = (IntPropertyRNA *)rna_ensure_property(prop); - + BLI_assert(RNA_property_type(prop) == PROP_INT); BLI_assert(RNA_property_array_check(prop) != false); @@ -2849,7 +2849,7 @@ float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) void RNA_property_float_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, float *values) { FloatPropertyRNA *fprop = (FloatPropertyRNA *)rna_ensure_property(prop); - + BLI_assert(RNA_property_type(prop) == PROP_FLOAT); BLI_assert(RNA_property_array_check(prop) != false); @@ -3285,7 +3285,7 @@ void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop) if ((idprop = rna_idproperty_check(&prop, ptr))) { group = RNA_struct_idprops(ptr, 0); - + if (group) { IDP_FreeFromGroup(group, idprop); } @@ -3566,7 +3566,7 @@ int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, Poi { CollectionPropertyIterator iter; int index = 0; - + BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); RNA_property_collection_begin(ptr, prop, &iter); @@ -3575,7 +3575,7 @@ int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, Poi break; } RNA_property_collection_end(&iter); - + /* did we find it? */ if (iter.valid) return index; @@ -3768,7 +3768,7 @@ static int rna_property_array_length_all_dimensions(PointerRNA *ptr, PropertyRNA for (size = 1, i = 0; i < dim; i++) size *= len[i]; - + return size; } @@ -3821,7 +3821,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro out.len * arraylen, in.len); return 0; } - + /* matching raw types */ if (out.type == in.type) { void *inp = in.array; @@ -4179,7 +4179,7 @@ void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int i internal->itemsize = itemsize; internal->skip = skip; internal->length = length; - + iter->valid = (internal->ptr != internal->endptr); if (skip && iter->valid && skip(iter, internal->ptr)) @@ -4220,7 +4220,7 @@ void *rna_iterator_array_dereference_get(CollectionPropertyIterator *iter) void rna_iterator_array_end(CollectionPropertyIterator *iter) { ArrayIterator *internal = &iter->internal.array; - + if (internal->free_ptr) { MEM_freeN(internal->free_ptr); internal->free_ptr = NULL; @@ -4275,7 +4275,7 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int len++; p++; } - + /* skip the last quoted char to get the ']' */ len++; p++; @@ -4292,11 +4292,11 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int p++; } } - + /* empty, return */ if (len == 0) return NULL; - + /* try to use fixed buffer if possible */ if (len + 1 < fixedlen) buf = fixedbuf; @@ -4342,22 +4342,22 @@ static bool rna_path_parse_collection_key(const char **path, PointerRNA *ptr, Pr { char fixedbuf[256]; int intkey; - + *r_nextptr = *ptr; /* end of path, ok */ if (!(**path)) return true; - + if (**path == '[') { char *token; /* resolve the lookup with [] brackets */ token = rna_path_token(path, fixedbuf, sizeof(fixedbuf), 1); - + if (!token) return false; - + /* check for "" to see if it is a string */ if (rna_token_strip_quotes(token)) { if (RNA_property_collection_lookup_string(ptr, prop, token + 1, r_nextptr)) { @@ -4380,7 +4380,7 @@ static bool rna_path_parse_collection_key(const char **path, PointerRNA *ptr, Pr r_nextptr->data = NULL; } } - + if (token != fixedbuf) { MEM_freeN(token); } @@ -4394,7 +4394,7 @@ static bool rna_path_parse_collection_key(const char **path, PointerRNA *ptr, Pr r_nextptr->data = NULL; } } - + return true; } @@ -4405,21 +4405,21 @@ static bool rna_path_parse_array_index(const char **path, PointerRNA *ptr, Prope int len[RNA_MAX_ARRAY_DIMENSION]; const int dim = RNA_property_array_dimension(ptr, prop, len); int i; - + *r_index = -1; - + /* end of path, ok */ if (!(**path)) return true; - + for (i = 0; i < dim; i++) { int temp_index = -1; char *token; - + /* multi index resolve */ if (**path == '[') { token = rna_path_token(path, fixedbuf, sizeof(fixedbuf), 1); - + if (token == NULL) { /* invalid syntax blah[] */ return false; @@ -4431,12 +4431,12 @@ static bool rna_path_parse_array_index(const char **path, PointerRNA *ptr, Prope else { /* otherwise do int lookup */ temp_index = atoi(token); - + if (temp_index == 0 && (token[0] != '0' || token[1] != '\0')) { if (token != fixedbuf) { MEM_freeN(token); } - + return false; } } @@ -4454,33 +4454,33 @@ static bool rna_path_parse_array_index(const char **path, PointerRNA *ptr, Prope /* just to avoid uninitialized pointer use */ token = fixedbuf; } - + if (token != fixedbuf) { MEM_freeN(token); } - + /* out of range */ if (temp_index < 0 || temp_index >= len[i]) return false; - + index_arr[i] = temp_index; /* end multi index resolve */ } - + /* arrays always contain numbers so further values are not valid */ if (**path) return false; - + /* flatten index over all dimensions */ { int totdim = 1; int flat_index = 0; - + for (i = dim - 1; i >= 0; i--) { flat_index += index_arr[i] * totdim; totdim *= len[i]; } - + *r_index = flat_index; } return true; @@ -4556,7 +4556,7 @@ static bool rna_path_parse(PointerRNA *ptr, const char *path, */ if (eval_pointer || *path) { PointerRNA nextptr = RNA_property_pointer_get(&curptr, prop); - + curptr = nextptr; prop = NULL; /* now we have a PointerRNA, the prop is our parent so forget it */ index = -1; @@ -4573,7 +4573,7 @@ static bool rna_path_parse(PointerRNA *ptr, const char *path, PointerRNA nextptr; if (!rna_path_parse_collection_key(&path, &curptr, prop, &nextptr)) return false; - + curptr = nextptr; prop = NULL; /* now we have a PointerRNA, the prop is our parent so forget it */ index = -1; @@ -4690,7 +4690,7 @@ char *RNA_path_append(const char *path, PointerRNA *UNUSED(ptr), PropertyRNA *pr DynStr *dynstr; const char *s; char appendstr[128], *result; - + dynstr = BLI_dynstr_new(); /* add .identifier */ @@ -4765,7 +4765,7 @@ char *RNA_path_back(const char *path) token = rna_path_token(¤t, fixedbuf, sizeof(fixedbuf), 1); if (token && token != fixedbuf) MEM_freeN(token); - + if (!*current) break; @@ -4936,7 +4936,7 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr) if (!ptr->id.data || !ptr->data) return NULL; - + if (!RNA_struct_is_ID(ptr->type)) { if (ptr->type->path) { /* if type has a path to some ID, use it */ @@ -4945,13 +4945,13 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr) else if (ptr->type->nested && RNA_struct_is_ID(ptr->type->nested)) { PointerRNA parentptr; PropertyRNA *userprop; - + /* find the property in the struct we're nested in that references this struct, and * use its identifier as the first part of the path used... */ RNA_id_pointer_create(ptr->id.data, &parentptr); userprop = RNA_struct_find_nested(&parentptr, ptr->type); - + if (userprop) ptrpath = BLI_strdup(RNA_property_identifier(userprop)); else @@ -4964,7 +4964,7 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr) else return NULL; } - + return ptrpath; } @@ -5016,7 +5016,7 @@ char *RNA_path_from_ID_to_property_index(PointerRNA *ptr, PropertyRNA *prop, int if (!ptr->id.data || !ptr->data) return NULL; - + /* path from ID to the struct holding this property */ ptrpath = RNA_path_from_ID_to_struct(ptr); @@ -5746,23 +5746,23 @@ char *RNA_pointer_as_string_id(bContext *C, PointerRNA *ptr) { DynStr *dynstr = BLI_dynstr_new(); char *cstring; - + const char *propname; int first_time = 1; - + BLI_dynstr_append(dynstr, "{"); - + RNA_STRUCT_BEGIN (ptr, prop) { propname = RNA_property_identifier(prop); - + if (STREQ(propname, "rna_type")) continue; - + if (first_time == 0) BLI_dynstr_append(dynstr, ", "); first_time = 0; - + cstring = RNA_property_as_string(C, ptr, prop, -1, INT_MAX); BLI_dynstr_appendf(dynstr, "\"%s\":%s", propname, cstring); MEM_freeN(cstring); @@ -5770,8 +5770,8 @@ char *RNA_pointer_as_string_id(bContext *C, PointerRNA *ptr) RNA_STRUCT_END; BLI_dynstr_append(dynstr, "}"); - - + + cstring = BLI_dynstr_get_cstring(dynstr); BLI_dynstr_free(dynstr); return cstring; @@ -5924,7 +5924,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop, in DynStr *dynstr = BLI_dynstr_new(); char *cstring; - + /* see if we can coerce into a python type - PropertyType */ switch (type) { @@ -6095,7 +6095,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop, in BLI_dynstr_append(dynstr, cstring); MEM_freeN(cstring); } - + RNA_property_collection_end(&collect_iter); BLI_dynstr_append(dynstr, "]"); break; @@ -6201,7 +6201,7 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE data_alloc->array_tot = 0; data_alloc->array = NULL; } - + if (!(parm->flag_parameter & PARM_REQUIRED) && !(parm->flag & PROP_DYNAMIC)) { switch (parm->type) { case PROP_BOOLEAN: @@ -6630,7 +6630,7 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop *((PointerRNA *)dest) = *((PointerRNA *)src); break; } - + if (ptype != srna && !RNA_struct_is_a(srna, ptype)) { fprintf(stderr, "%s.%s: wrong type for parameter %s, " "an object of type %s was expected, passed an object of type %s\n", @@ -6657,7 +6657,7 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop lb = (ListBase *)src; clb = (ListBase *)dest; ptype = RNA_property_pointer_type(ptr, prop); - + if (ptype != srna && !RNA_struct_is_a(srna, ptype)) { fprintf(stderr, "%s.%s: wrong type for parameter %s, " "a collection of objects of type %s was expected, " @@ -6903,17 +6903,17 @@ bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) /* get the length of the array to work with */ len = RNA_property_array_length(ptr, prop); - + /* get and set the default values as appropriate for the various types */ switch (RNA_property_type(prop)) { case PROP_BOOLEAN: if (len) { if (index == -1) { int *tmparray = MEM_callocN(sizeof(int) * len, "reset_defaults - boolean"); - + RNA_property_boolean_get_default_array(ptr, prop, tmparray); RNA_property_boolean_set_array(ptr, prop, tmparray); - + MEM_freeN(tmparray); } else { @@ -6930,10 +6930,10 @@ bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) if (len) { if (index == -1) { int *tmparray = MEM_callocN(sizeof(int) * len, "reset_defaults - int"); - + RNA_property_int_get_default_array(ptr, prop, tmparray); RNA_property_int_set_array(ptr, prop, tmparray); - + MEM_freeN(tmparray); } else { @@ -6950,10 +6950,10 @@ bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) if (len) { if (index == -1) { float *tmparray = MEM_callocN(sizeof(float) * len, "reset_defaults - float"); - + RNA_property_float_get_default_array(ptr, prop, tmparray); RNA_property_float_set_array(ptr, prop, tmparray); - + MEM_freeN(tmparray); } else { @@ -6972,7 +6972,7 @@ bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) RNA_property_enum_set(ptr, prop, value); return true; } - + case PROP_STRING: { char *value = RNA_property_string_get_default_alloc(ptr, prop, NULL, 0); @@ -6980,14 +6980,14 @@ bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) MEM_freeN(value); return true; } - + case PROP_POINTER: { PointerRNA value = RNA_property_pointer_get_default(ptr, prop); RNA_property_pointer_set(ptr, prop, value); return true; } - + default: /* FIXME: are there still any cases that haven't been handled? comment out "default" block to check :) */ return false; @@ -7028,10 +7028,10 @@ bool RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, if (len) { if (index == -1) { int *tmparray = MEM_callocN(sizeof(int) * len, "copy - boolean"); - + RNA_property_boolean_get_array(fromptr, fromprop, tmparray); RNA_property_boolean_set_array(ptr, prop, tmparray); - + MEM_freeN(tmparray); } else { @@ -7048,10 +7048,10 @@ bool RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, if (len) { if (index == -1) { int *tmparray = MEM_callocN(sizeof(int) * len, "copy - int"); - + RNA_property_int_get_array(fromptr, fromprop, tmparray); RNA_property_int_set_array(ptr, prop, tmparray); - + MEM_freeN(tmparray); } else { @@ -7068,10 +7068,10 @@ bool RNA_property_copy(PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, if (len) { if (index == -1) { float *tmparray = MEM_callocN(sizeof(float) * len, "copy - float"); - + RNA_property_float_get_array(fromptr, fromprop, tmparray); RNA_property_float_set_array(ptr, prop, tmparray); - + MEM_freeN(tmparray); } else { diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index d398ce95a52..6985cb54359 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -61,13 +61,13 @@ static void rna_ActionGroup_channels_next(CollectionPropertyIterator *iter) ListBaseIterator *internal = &iter->internal.listbase; FCurve *fcu = (FCurve *)internal->link; bActionGroup *grp = fcu->grp; - + /* only continue if the next F-Curve (if existent) belongs in the same group */ if ((fcu->next) && (fcu->next->grp == grp)) internal->link = (Link *)fcu->next; else internal->link = NULL; - + iter->valid = (internal->link != NULL); } @@ -80,7 +80,7 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, PointerR { bActionGroup *agrp = agrp_ptr->data; FCurve *fcu, *fcn; - + /* try to remove the F-Curve from the action */ if (BLI_remlink_safe(&act->groups, agrp) == false) { BKE_reportf(reports, RPT_ERROR, "Action group '%s' not found in action '%s'", agrp->name, act->id.name + 2); @@ -141,7 +141,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, PointerR fcu->grp->name, act->id.name + 2); return; } - + action_groups_remove_channel(act, fcu); free_fcurve(fcu); RNA_POINTER_INVALIDATE(fcu_ptr); @@ -151,7 +151,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, PointerR BKE_reportf(reports, RPT_ERROR, "F-Curve not found in action '%s'", act->id.name + 2); return; } - + BLI_remlink(&act->curves, fcu); free_fcurve(fcu); RNA_POINTER_INVALIDATE(fcu_ptr); @@ -227,7 +227,7 @@ int rna_Action_id_poll(PointerRNA *ptr, PointerRNA value) { ID *srcId = (ID *)ptr->id.data; bAction *act = (bAction *)value.id.data; - + if (act) { /* there can still be actions that will have undefined id-root * (i.e. floating "action-library" members) which we will not @@ -238,7 +238,7 @@ int rna_Action_id_poll(PointerRNA *ptr, PointerRNA value) else if (srcId) return GS(srcId->name) == act->idroot; } - + return 0; } @@ -247,7 +247,7 @@ int rna_Action_actedit_assign_poll(PointerRNA *ptr, PointerRNA value) { SpaceAction *saction = (SpaceAction *)ptr->data; bAction *act = (bAction *)value.id.data; - + if (act) { /* there can still be actions that will have undefined id-root * (i.e. floating "action-library" members) which we will not @@ -255,7 +255,7 @@ int rna_Action_actedit_assign_poll(PointerRNA *ptr, PointerRNA value) */ if (act->idroot == 0) return 1; - + if (saction) { if (saction->mode == SACTCONT_ACTION) { /* this is only Object-level for now... */ @@ -267,7 +267,7 @@ int rna_Action_actedit_assign_poll(PointerRNA *ptr, PointerRNA value) } } } - + return 0; } @@ -281,14 +281,14 @@ static void rna_def_dopesheet(BlenderRNA *brna) srna = RNA_def_struct(brna, "DopeSheet", NULL); RNA_def_struct_sdna(srna, "bDopeSheet"); RNA_def_struct_ui_text(srna, "Dope Sheet", "Settings for filtering the channels shown in animation editors"); - + /* Source of DopeSheet data */ /* XXX: make this obsolete? */ prop = RNA_def_property(srna, "source", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); RNA_def_property_ui_text(prop, "Source", "ID-Block representing source data, usually ID_SCE (i.e. Scene)"); - + /* Show data-block filters */ prop = RNA_def_property(srna, "show_datablock_filters", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_SHOW_DBFILTERS); @@ -296,20 +296,20 @@ static void rna_def_dopesheet(BlenderRNA *brna) "Show options for whether channels related to certain types of data are included"); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN, NULL); - + /* General Filtering Settings */ prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYSEL); RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_INCL_HIDDEN); RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that are not visible"); RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "use_datablock_sort", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADS_FLAG_NO_DB_SORT); RNA_def_property_ui_text(prop, "Sort Data-Blocks", @@ -317,14 +317,14 @@ static void rna_def_dopesheet(BlenderRNA *brna) "(disable to increase viewport speed)"); RNA_def_property_ui_icon(prop, ICON_SORTALPHA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* Debug Filtering Settings */ prop = RNA_def_property(srna, "show_only_errors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLY_ERRORS); RNA_def_property_ui_text(prop, "Show Errors", "Only include F-Curves and drivers that are disabled or have errors"); RNA_def_property_ui_icon(prop, ICON_HELP, 0); /* XXX: this doesn't quite fit */ RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* Object Group Filtering Settings */ prop = RNA_def_property(srna, "show_only_group_objects", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP); @@ -332,13 +332,13 @@ static void rna_def_dopesheet(BlenderRNA *brna) "Only include channels from objects in the specified group"); RNA_def_property_ui_icon(prop, ICON_GROUP, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "filter_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "filter_grp"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Filtering Group", "Group that included object should be a member of"); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* FCurve Display Name Search Settings */ prop = RNA_def_property(srna, "show_only_matching_fcurves", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_BY_FCU_NAME); @@ -346,13 +346,13 @@ static void rna_def_dopesheet(BlenderRNA *brna) "Only include F-Curves with names containing search text"); RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "filter_fcurve_name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "searchstr"); RNA_def_property_ui_text(prop, "F-Curve Name Filter", "F-Curve live filtering string"); RNA_def_property_flag(prop, PROP_TEXTEDIT_UPDATE); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* NLA Name Search Settings (Shared with FCurve setting, but with different labels) */ prop = RNA_def_property(srna, "use_filter_text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_BY_FCU_NAME); @@ -360,13 +360,13 @@ static void rna_def_dopesheet(BlenderRNA *brna) "Only include channels with names containing search text"); RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "searchstr"); RNA_def_property_ui_text(prop, "Name Filter", "Live filtering string"); RNA_def_property_flag(prop, PROP_TEXTEDIT_UPDATE); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* Multi-word fuzzy search option for name/text filters */ prop = RNA_def_property(srna, "use_multi_word_filter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_FUZZY_NAMES); @@ -374,7 +374,7 @@ static void rna_def_dopesheet(BlenderRNA *brna) "Perform fuzzy/multi-word matching (WARNING: May be slow)"); RNA_def_property_ui_icon(prop, ICON_SORTALPHA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* NLA Specific Settings */ prop = RNA_def_property(srna, "show_missing_nla", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NLA_NOACT); @@ -382,21 +382,21 @@ static void rna_def_dopesheet(BlenderRNA *brna) "Include animation data-blocks with no NLA data (NLA editor only)"); RNA_def_property_ui_icon(prop, ICON_ACTION, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* Summary Settings (DopeSheet editors only) */ prop = RNA_def_property(srna, "show_summary", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_SUMMARY); RNA_def_property_ui_text(prop, "Display Summary", "Display an additional 'summary' line (Dope Sheet editors only)"); RNA_def_property_ui_icon(prop, ICON_BORDERMOVE, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_expanded_summary", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADS_FLAG_SUMMARY_COLLAPSED); RNA_def_property_ui_text(prop, "Collapse Summary", "Collapse summary when shown, so all other channels get hidden (Dope Sheet editors only)"); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - - + + /* General DataType Filtering Settings */ prop = RNA_def_property(srna, "show_transforms", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOOBJ); @@ -404,98 +404,98 @@ static void rna_def_dopesheet(BlenderRNA *brna) "Include visualization of object-level animation data (mostly transforms)"); RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); /* XXX? */ RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_shapekeys", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS); RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of shape key related animation data"); RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_modifiers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMODIFIERS); RNA_def_property_ui_text(prop, "Display Modifier Data", "Include visualization of animation data related to data-blocks linked to modifiers"); RNA_def_property_ui_icon(prop, ICON_MODIFIER, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_meshes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMESH); RNA_def_property_ui_text(prop, "Display Meshes", "Include visualization of mesh related animation data"); RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_lattices", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAT); RNA_def_property_ui_text(prop, "Display Lattices", "Include visualization of lattice related animation data"); RNA_def_property_ui_icon(prop, ICON_LATTICE_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_cameras", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCAM); RNA_def_property_ui_text(prop, "Display Camera", "Include visualization of camera related animation data"); RNA_def_property_ui_icon(prop, ICON_CAMERA_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_materials", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMAT); RNA_def_property_ui_text(prop, "Display Material", "Include visualization of material related animation data"); RNA_def_property_ui_icon(prop, ICON_MATERIAL_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_lamps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAM); RNA_def_property_ui_text(prop, "Display Lamp", "Include visualization of lamp related animation data"); RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_linestyles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLINESTYLE); RNA_def_property_ui_text(prop, "Display Line Style", "Include visualization of Line Style related Animation data"); RNA_def_property_ui_icon(prop, ICON_LINE_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX); RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of texture related animation data"); RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_curves", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCUR); RNA_def_property_ui_text(prop, "Display Curve", "Include visualization of curve related animation data"); RNA_def_property_ui_icon(prop, ICON_CURVE_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_worlds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOWOR); RNA_def_property_ui_text(prop, "Display World", "Include visualization of world related animation data"); RNA_def_property_ui_icon(prop, ICON_WORLD_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_scenes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSCE); RNA_def_property_ui_text(prop, "Display Scene", "Include visualization of scene related animation data"); RNA_def_property_ui_icon(prop, ICON_SCENE_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOPART); RNA_def_property_ui_text(prop, "Display Particle", "Include visualization of particle related animation data"); RNA_def_property_ui_icon(prop, ICON_PARTICLE_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_metaballs", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMBA); RNA_def_property_ui_text(prop, "Display Metaball", "Include visualization of metaball related animation data"); RNA_def_property_ui_icon(prop, ICON_META_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_armatures", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOARM); RNA_def_property_ui_text(prop, "Display Armature", "Include visualization of armature related animation data"); RNA_def_property_ui_icon(prop, ICON_ARMATURE_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_nodes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NONTREE); RNA_def_property_ui_text(prop, "Display Node", "Include visualization of node related animation data"); @@ -507,17 +507,17 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Display Speaker", "Include visualization of speaker related animation data"); RNA_def_property_ui_icon(prop, ICON_SPEAKER, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_gpencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOGPENCIL); RNA_def_property_ui_text(prop, "Display Grease Pencil", "Include visualization of Grease Pencil related animation data and frames"); RNA_def_property_ui_icon(prop, ICON_GREASEPENCIL, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* GPencil Mode Settings */ prop = RNA_def_property(srna, "show_gpencil_3d_only", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_GP_3DONLY); - RNA_def_property_ui_text(prop, "Active Scene Only", + RNA_def_property_ui_text(prop, "Active Scene Only", "Only show Grease Pencil data-blocks used as part of the active scene"); RNA_def_property_ui_icon(prop, ICON_SCENE_DATA, 0); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); @@ -527,16 +527,16 @@ static void rna_def_action_group(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "ActionGroup", NULL); RNA_def_struct_sdna(srna, "bActionGroup"); RNA_def_struct_ui_text(srna, "Action Group", "Groups of F-Curves"); - + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* WARNING: be very careful when working with this list, since the endpoint is not * defined like a standard ListBase. Adding/removing channels from this list needs * extreme care, otherwise the F-Curve list running through adjacent groups does @@ -552,22 +552,22 @@ static void rna_def_action_group(BlenderRNA *brna) RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_collection_funcs(prop, NULL, "rna_ActionGroup_channels_next", NULL, NULL, NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group"); - + prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED); RNA_def_property_ui_text(prop, "Select", "Action group is selected"); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL); - + prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED); RNA_def_property_ui_text(prop, "Lock", "Action group is locked"); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED); RNA_def_property_ui_text(prop, "Expanded", "Action group is expanded"); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + /* color set */ rna_def_actionbone_group_common(srna, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); } @@ -672,14 +672,14 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0); - + prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "TimelineMarker"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_LIB_EXCEPTION); RNA_def_property_pointer_funcs(prop, "rna_Action_active_pose_marker_get", "rna_Action_active_pose_marker_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Pose Marker", "Active pose marker for this action"); - + prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "active_marker"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); @@ -692,25 +692,25 @@ static void rna_def_action(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "Action", "ID"); RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation"); RNA_def_struct_ui_icon(srna, ICON_ACTION); - + /* collections */ prop = RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "curves", NULL); RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the action"); rna_def_action_fcurves(brna, prop); - + prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "groups", NULL); RNA_def_property_struct_type(prop, "ActionGroup"); RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves"); rna_def_action_groups(brna, prop); - + prop = RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "markers", NULL); RNA_def_property_struct_type(prop, "TimelineMarker"); @@ -718,13 +718,13 @@ static void rna_def_action(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_ui_text(prop, "Pose Markers", "Markers specific to this action, for labeling poses"); rna_def_action_pose_markers(brna, prop); - + /* properties */ prop = RNA_def_float_vector(srna, "frame_range", 2, NULL, 0, 0, "Frame Range", "The final frame range of all F-Curves within this action", 0, 0); RNA_def_property_float_funcs(prop, "rna_Action_frame_range_get", NULL, NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + /* special "type" limiter - should not really be edited in general, * but is still available/editable in 'emergencies' */ prop = RNA_def_property(srna, "id_root", PROP_ENUM, PROP_NONE); @@ -734,7 +734,7 @@ static void rna_def_action(BlenderRNA *brna) "Type of ID block that action can be used on - " "DO NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ID); - + /* API calls */ RNA_api_action(srna); } diff --git a/source/blender/makesrna/intern/rna_action_api.c b/source/blender/makesrna/intern/rna_action_api.c index fe429d8698b..3d5252b8cdc 100644 --- a/source/blender/makesrna/intern/rna_action_api.c +++ b/source/blender/makesrna/intern/rna_action_api.c @@ -53,7 +53,7 @@ void RNA_api_action(StructRNA *UNUSED(srna)) { - + } #endif diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 26ec813a14f..174318249ac 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -405,7 +405,7 @@ static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, f { bActuator *act = (bActuator *)ptr->data; bObjectActuator *oa = act->data; - + oa->forcerot[1] = value; oa->forcerot[0] = 60.0f * oa->forcerot[1]; } @@ -421,7 +421,7 @@ static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values) for (i = 0; i < OB_MAX_STATES; i++) if (values[i]) tot++; - + if (tot == 0) return; @@ -437,7 +437,7 @@ const EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Pr EnumPropertyItem *item = NULL; Object *ob = NULL; int totitem = 0; - + if (ptr->type == &RNA_Actuator || RNA_struct_is_a(ptr->type, &RNA_Actuator)) { ob = (Object *)ptr->id.data; } @@ -445,13 +445,13 @@ const EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Pr /* can't use ob from ptr->id.data because that enum is also used by operators */ ob = CTX_data_active_object(C); } - + if (ob != NULL) { if (ob->type == OB_ARMATURE) { RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE); } } - + RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CAMERA); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CONSTRAINT); @@ -470,10 +470,10 @@ const EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Pr RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_SOUND); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_STATE); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_VISIBILITY); - + RNA_enum_item_end(&item, &totitem); *r_free = true; - + return item; } @@ -620,7 +620,7 @@ static void rna_def_action_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Property", "Use this property to define the Action position"); @@ -683,7 +683,7 @@ static void rna_def_action_actuator(BlenderRNA *brna) "Apply Action as a global or local force depending on the local option " "(dynamic objects only)"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "use_local", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_IPOLOCAL); RNA_def_property_ui_text(prop, "L", "Let the Action act in local coordinates, used in Force and Add mode"); @@ -732,7 +732,7 @@ static void rna_def_object_actuator(BlenderRNA *brna) RNA_def_property_enum_funcs(prop, NULL, "rna_ObjectActuator_type_set", NULL); RNA_def_property_ui_text(prop, "Motion Type", "Specify the motion system"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "reference_object", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_pointer_sdna(prop, NULL, "reference"); @@ -740,7 +740,7 @@ static void rna_def_object_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Reference Object", "Reference object for velocity calculation, leave empty for world reference"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "damping", PROP_INT, PROP_NONE); RNA_def_property_ui_range(prop, 0, 1000, 1, 1); RNA_def_property_ui_text(prop, "Damping Frames", "Number of frames to reach the target velocity"); @@ -847,7 +847,7 @@ static void rna_def_object_actuator(BlenderRNA *brna) RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 2); RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + /* booleans */ prop = RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_DLOC_LOCAL); @@ -922,7 +922,7 @@ static void rna_def_camera_actuator(BlenderRNA *brna) {OB_NEGY, "NEG_Y", 0, "-Y", "Camera tries to get behind the -Y axis"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "CameraActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Camera Actuator", ""); RNA_def_struct_sdna_from(srna, "bCameraActuator", "data"); @@ -979,7 +979,7 @@ static void rna_def_sound_actuator(BlenderRNA *brna) {ACT_SND_LOOP_BIDIRECTIONAL_STOP_SOUND, "LOOPBIDIRECTIONALSTOP", 0, "Loop Bidirectional Stop", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "SoundActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Sound Actuator", "Actuator to handle sound"); RNA_def_struct_sdna_from(srna, "bSoundActuator", "data"); @@ -1008,7 +1008,7 @@ static void rna_def_sound_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pitch", "Pitch of the sound"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SOUND); RNA_def_property_update(prop, NC_LOGIC, NULL); - + /* floats - 3D Parameters */ prop = RNA_def_property(srna, "gain_3d_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sound3D.min_gain"); @@ -1027,7 +1027,7 @@ static void rna_def_sound_actuator(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2); RNA_def_property_ui_text(prop, "Reference Distance", "The distance where the sound has a gain of 1.0"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "distance_3d_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sound3D.max_distance"); RNA_def_property_ui_range(prop, 0.0, FLT_MAX, 1, 2); @@ -1059,7 +1059,7 @@ static void rna_def_sound_actuator(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0, DEG2RADF(360.0f), 1, 2); RNA_def_property_ui_text(prop, "Cone Inner Angle", "The angle of the inner cone"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + /* booleans */ prop = RNA_def_property(srna, "use_sound_3d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SND_3D_SOUND); @@ -1415,7 +1415,7 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "Track to this Object"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "mesh", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Mesh"); RNA_def_property_pointer_sdna(prop, NULL, "me"); @@ -1495,7 +1495,7 @@ static void rna_def_scene_actuator(BlenderRNA *brna) {ACT_SCENE_RESUME, "RESUME", 0, "Resume Scene", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "SceneActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Scene Actuator", ""); RNA_def_struct_sdna_from(srna, "bSceneActuator", "data"); @@ -1560,7 +1560,7 @@ static void rna_def_random_actuator(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_distribution_items); RNA_def_property_ui_text(prop, "Distribution", "Choose the type of distribution"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + /* arguments for the distribution */ /* int_arg_1, int_arg_2, float_arg_1, float_arg_2 */ @@ -1683,7 +1683,7 @@ static void rna_def_message_actuator(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "body"); RNA_def_property_ui_text(prop, "Body", "Optional, message body Text"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + /* ACT_MESG_PROP */ prop = RNA_def_property(srna, "body_property", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "body"); @@ -1710,7 +1710,7 @@ static void rna_def_game_actuator(BlenderRNA *brna) {ACT_GAME_SCREENSHOT, "SCREENSHOT", 0, "Screenshot", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "GameActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Game Actuator", ""); RNA_def_struct_sdna_from(srna, "bGameActuator", "data"); @@ -1734,7 +1734,7 @@ static void rna_def_visibility_actuator(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "VisibilityActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Visibility Actuator", "Actuator to set visibility and occlusion of the object"); RNA_def_struct_sdna_from(srna, "bVisibilityActuator", "data"); @@ -1813,7 +1813,7 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Value", "Motion blur factor"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_update(prop, NC_LOGIC, NULL); - + /* booleans */ prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 1); @@ -1825,7 +1825,7 @@ static void rna_def_parent_actuator(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_type_items[] = { {ACT_PARENT_SET, "SETPARENT", 0, "Set Parent", ""}, {ACT_PARENT_REMOVE, "REMOVEPARENT", 0, "Remove Parent", ""}, @@ -1841,7 +1841,7 @@ static void rna_def_parent_actuator(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Scene", ""); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_pointer_sdna(prop, NULL, "ob"); @@ -1875,7 +1875,7 @@ static void rna_def_state_actuator(BlenderRNA *brna) {ACT_STATE_CHANGE, "CHANGE", 0, "Change State", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "StateActuator", "Actuator"); RNA_def_struct_ui_text(srna, "State Actuator", "Actuator to handle states"); RNA_def_struct_sdna_from(srna, "bStateActuator", "data"); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 3f8a7bc96e8..23071288c0a 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -84,9 +84,9 @@ const EnumPropertyItem rna_enum_keying_flag_items[] = { static void rna_AnimData_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = ptr->id.data; - - /* tag for refresh so that scheduled updates (e.g. action changed) will - * get computed and reflected in the scene [#34869] + + /* tag for refresh so that scheduled updates (e.g. action changed) will + * get computed and reflected in the scene [#34869] */ DAG_id_tag_update(id, OB_RECALC_OB | OB_RECALC_DATA); } @@ -94,7 +94,7 @@ static void rna_AnimData_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point static int rna_AnimData_action_editable(PointerRNA *ptr, const char **UNUSED(r_info)) { AnimData *adt = (AnimData *)ptr->data; - + /* active action is only editable when it is not a tweaking strip */ if ((adt->flag & ADT_NLA_EDIT_ON) || (adt->actstrip) || (adt->tmpact)) return 0; @@ -106,10 +106,10 @@ static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value) { ID *ownerId = (ID *)ptr->id.data; AnimData *adt; - + /* set action */ BKE_animdata_set_action(NULL, ownerId, value.data); - + /* force action to get evaluated [#34869] */ adt = BKE_animdata_from_id(ownerId); if (adt) { @@ -156,16 +156,16 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C) /* hook up arguments */ RNA_parameter_set_lookup(&list, "ksi", &ksi); RNA_parameter_set_lookup(&list, "context", &C); - + /* execute the function */ ksi->ext.call(C, &ptr, func, &list); - + /* read the result */ RNA_parameter_get_lookup(&list, "ok", &ret); ok = *(int *)ret; } RNA_parameter_list_free(&list); - + return ok; } @@ -187,7 +187,7 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks RNA_parameter_set_lookup(&list, "ksi", &ksi); RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "ks", &ks); - + /* execute the function */ ksi->ext.call(C, &ptr, func, &list); } @@ -213,7 +213,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "ks", &ks); RNA_parameter_set_lookup(&list, "data", data); - + /* execute the function */ ksi->ext.call(C, &ptr, func, &list); } @@ -235,11 +235,11 @@ static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type) if (ksi == NULL) return; - + /* free RNA data referencing this */ RNA_struct_free_extension(type, &ksi->ext); RNA_struct_free(&BLENDER_RNA, type); - + WM_main_add_notifier(NC_WINDOW, NULL); /* unlink Blender-side data */ @@ -258,17 +258,17 @@ static StructRNA *rna_KeyingSetInfo_register( /* setup dummy type info to store static properties in */ /* TODO: perhaps we want to get users to register as if they're using 'KeyingSet' directly instead? */ RNA_pointer_create(NULL, &RNA_KeyingSetInfo, &dummyksi, &dummyptr); - + /* validate the python class */ if (validate(&dummyptr, data, have_function) != 0) return NULL; - + if (strlen(identifier) >= sizeof(dummyksi.idname)) { BKE_reportf(reports, RPT_ERROR, "Registering keying set info class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(dummyksi.idname)); return NULL; } - + /* check if we have registered this info before, and remove it */ ksi = ANIM_keyingset_info_find_name(dummyksi.idname); if (ksi && ksi->ext.srna) { @@ -278,23 +278,23 @@ static StructRNA *rna_KeyingSetInfo_register( /* create a new KeyingSetInfo type */ ksi = MEM_callocN(sizeof(KeyingSetInfo), "python keying set info"); memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo)); - + /* set RNA-extensions info */ ksi->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ksi->idname, &RNA_KeyingSetInfo); ksi->ext.data = data; ksi->ext.call = call; ksi->ext.free = free; RNA_struct_blender_type_set(ksi->ext.srna, ksi); - + /* set callbacks */ /* NOTE: we really should have all of these... */ ksi->poll = (have_function[0]) ? RKS_POLL_rna_internal : NULL; ksi->iter = (have_function[1]) ? RKS_ITER_rna_internal : NULL; ksi->generate = (have_function[2]) ? RKS_GEN_rna_internal : NULL; - + /* add and register with other info as needed */ ANIM_keyingset_info_register(ksi); - + WM_main_add_notifier(NC_WINDOW, NULL); /* return the struct-rna added */ @@ -318,7 +318,7 @@ static int rna_ksPath_id_editable(PointerRNA *ptr, const char **UNUSED(r_info)) static void rna_ksPath_id_type_set(PointerRNA *ptr, int value) { KS_Path *data = (KS_Path *)(ptr->data); - + /* set the driver type, then clear the id-block if the type is invalid */ data->idtype = value; if ((data->id) && (GS(data->id->name) != data->idtype)) @@ -338,7 +338,7 @@ static void rna_ksPath_RnaPath_get(PointerRNA *ptr, char *value) static int rna_ksPath_RnaPath_length(PointerRNA *ptr) { KS_Path *ksp = (KS_Path *)ptr->data; - + if (ksp->rna_path) return strlen(ksp->rna_path); else @@ -351,7 +351,7 @@ static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value) if (ksp->rna_path) MEM_freeN(ksp->rna_path); - + if (value[0]) ksp->rna_path = BLI_strdup(value); else @@ -363,20 +363,20 @@ static void rna_ksPath_RnaPath_set(PointerRNA *ptr, const char *value) static void rna_KeyingSet_name_set(PointerRNA *ptr, const char *value) { KeyingSet *ks = (KeyingSet *)ptr->data; - + /* update names of corresponding groups if name changes */ if (!STREQ(ks->name, value)) { KS_Path *ksp; - + for (ksp = ks->paths.first; ksp; ksp = ksp->next) { if ((ksp->groupmode == KSP_GROUP_KSNAME) && (ksp->id)) { AnimData *adt = BKE_animdata_from_id(ksp->id); - + /* TODO: NLA strips? */ if (adt && adt->action) { bActionGroup *agrp; - - /* lazy check - should really find the F-Curve for the affected path and check its group + + /* lazy check - should really find the F-Curve for the affected path and check its group * but this way should be faster and work well for most cases, as long as there are no * conflicts */ @@ -391,7 +391,7 @@ static void rna_KeyingSet_name_set(PointerRNA *ptr, const char *value) } } } - + /* finally, update name to new value */ BLI_strncpy(ks->name, value, sizeof(ks->name)); } @@ -400,7 +400,7 @@ static void rna_KeyingSet_name_set(PointerRNA *ptr, const char *value) static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr, const char **UNUSED(r_info)) { KeyingSet *ks = (KeyingSet *)ptr->data; - + /* only editable if there are some paths to change to */ return (BLI_listbase_is_empty(&ks->paths) == false) ? PROP_EDITABLE : 0; } @@ -443,7 +443,7 @@ static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr) { KeyingSet *ks = (KeyingSet *)ptr->data; KeyingSetInfo *ksi = NULL; - + /* keying set info is only for builtin Keying Sets */ if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) ksi = ANIM_keyingset_info_find_name(ks->typeinfo); @@ -457,13 +457,13 @@ static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *report { KS_Path *ksp = NULL; short flag = 0; - + /* special case when index = -1, we key the whole array (as with other places where index is used) */ if (index == -1) { flag |= KSP_FLAG_WHOLE_ARRAY; index = 0; } - + /* if data is valid, call the API function for this */ if (keyingset) { ksp = BKE_keyingset_add_path(keyingset, id, group_name, rna_path, index, flag, group_method); @@ -472,7 +472,7 @@ static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *report else { BKE_report(reports, RPT_ERROR, "Keying set path could not be added"); } - + /* return added path */ return ksp; } @@ -501,13 +501,13 @@ static void rna_KeyingSet_paths_clear(KeyingSet *keyingset, ReportList *reports) /* if data is valid, call the API function for this */ if (keyingset) { KS_Path *ksp, *kspn; - + /* free each path as we go to avoid looping twice */ for (ksp = keyingset->paths.first; ksp; ksp = kspn) { kspn = ksp->next; BKE_keyingset_free_path(keyingset, ksp); } - + /* reset the active path, since there aren't any left */ keyingset->active_path = 0; } @@ -566,7 +566,7 @@ static FCurve *rna_Driver_from_existing(AnimData *adt, bContext *C, FCurve *src_ else { /* just make a copy of the existing one and add to self */ FCurve *new_fcu = copy_fcurve(src_driver); - + /* XXX: if we impose any ordering on these someday, this will be problematic */ BLI_addtail(&adt->drivers, new_fcu); return new_fcu; @@ -590,39 +590,39 @@ static FCurve *rna_Driver_find(AnimData *adt, ReportList *reports, const char *d static void rna_def_common_keying_flags(StructRNA *srna, short reg) { PropertyRNA *prop; - + /* override scene/userpref defaults? */ prop = RNA_def_property(srna, "use_insertkey_override_needed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "keyingoverride", INSERTKEY_NEEDED); - RNA_def_property_ui_text(prop, "Override Insert Keyframes Default- Only Needed", + RNA_def_property_ui_text(prop, "Override Insert Keyframes Default- Only Needed", "Override default setting to only insert keyframes where they're needed in the relevant F-Curves"); if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - + prop = RNA_def_property(srna, "use_insertkey_override_visual", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "keyingoverride", INSERTKEY_MATRIX); - RNA_def_property_ui_text(prop, "Override Insert Keyframes Default - Visual", + RNA_def_property_ui_text(prop, "Override Insert Keyframes Default - Visual", "Override default setting to insert keyframes based on 'visual transforms'"); if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - + prop = RNA_def_property(srna, "use_insertkey_override_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "keyingoverride", INSERTKEY_XYZ2RGB); RNA_def_property_ui_text(prop, "Override F-Curve Colors - XYZ to RGB", "Override default setting to set color for newly added transformation F-Curves " "(Location, Rotation, Scale) to be based on the transform axis"); if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - - + + /* value to override defaults with */ prop = RNA_def_property(srna, "use_insertkey_needed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_NEEDED); RNA_def_property_ui_text(prop, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves"); if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - + prop = RNA_def_property(srna, "use_insertkey_visual", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_MATRIX); RNA_def_property_ui_text(prop, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'"); if (reg) RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - + prop = RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_XYZ2RGB); RNA_def_property_ui_text(prop, "F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) is based on the transform axis"); @@ -645,36 +645,36 @@ static void rna_def_keyingset_info(BlenderRNA *brna) PropertyRNA *prop; FunctionRNA *func; PropertyRNA *parm; - + srna = RNA_def_struct(brna, "KeyingSetInfo", NULL); RNA_def_struct_sdna(srna, "KeyingSetInfo"); RNA_def_struct_ui_text(srna, "Keying Set Info", "Callback function defines for builtin Keying Sets"); RNA_def_struct_refine_func(srna, "rna_KeyingSetInfo_refine"); RNA_def_struct_register_funcs(srna, "rna_KeyingSetInfo_register", "rna_KeyingSetInfo_unregister", NULL); - + /* Properties --------------------- */ - + RNA_define_verify_sdna(0); /* not in sdna */ - + prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "idname"); RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_ui_text(prop, "ID Name", KEYINGSET_IDNAME_DOC); - + prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "UI Name", ""); RNA_def_struct_name_property(srna, prop); RNA_def_property_flag(prop, PROP_REGISTER); - + prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "description"); RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); RNA_def_property_ui_text(prop, "Description", "A short description of the keying set"); - + /* Regarding why we don't use rna_def_common_keying_flags() here: - * - Using it would keep this case in sync with the other places + * - Using it would keep this case in sync with the other places * where these options are exposed (which are optimized for being * used in the UI). * - Unlike all the other places, this case is used for defining @@ -687,9 +687,9 @@ static void rna_def_keyingset_info(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_keying_flag_items); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG); RNA_def_property_ui_text(prop, "Options", "Keying Set options to use when inserting keyframes"); - + RNA_define_verify_sdna(1); - + /* Function Callbacks ------------- */ /* poll */ func = RNA_def_function(srna, "poll", NULL); @@ -698,7 +698,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", "")); parm = RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - + /* iterator */ func = RNA_def_function(srna, "iterator", NULL); RNA_def_function_ui_description(func, "Call generate() on the structs which have properties to be keyframed"); @@ -707,7 +707,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_pointer(func, "ks", "KeyingSet", "", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - + /* generate */ func = RNA_def_function(srna, "generate", NULL); RNA_def_function_ui_description(func, "Add Paths to the Keying Set to keyframe the properties of the given data"); @@ -724,11 +724,11 @@ static void rna_def_keyingset_path(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "KeyingSetPath", NULL); RNA_def_struct_sdna(srna, "KS_Path"); RNA_def_struct_ui_text(srna, "Keying Set Path", "Path to a setting for use in a Keying Set"); - + /* ID */ prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); @@ -739,7 +739,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna) "ID-Block that keyframes for Keying Set should be added to " "(for Absolute Keying Sets only)"); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ - + prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "idtype"); RNA_def_property_enum_items(prop, rna_enum_id_type_items); @@ -748,19 +748,19 @@ static void rna_def_keyingset_path(BlenderRNA *brna) RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ID); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ - + /* Group */ prop = RNA_def_property(srna, "group", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Group Name", "Name of Action Group to assign setting(s) for this path to"); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ - + /* Grouping */ prop = RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "groupmode"); RNA_def_property_enum_items(prop, rna_enum_keyingset_path_grouping_items); RNA_def_property_ui_text(prop, "Grouping Method", "Method used to define which Group-name to use"); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ - + /* Path + Array Index */ prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ksPath_RnaPath_get", "rna_ksPath_RnaPath_length", @@ -773,7 +773,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna) prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable"); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ - + /* Flags */ prop = RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KSP_FLAG_WHOLE_ARRAY); @@ -781,7 +781,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna) "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), " "entire array is to be used"); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ - + /* Keyframing Settings */ rna_def_common_keying_flags(srna, 0); } @@ -794,7 +794,7 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) FunctionRNA *func; PropertyRNA *parm; - + PropertyRNA *prop; RNA_def_property_srna(cprop, "KeyingSetPaths"); @@ -802,7 +802,7 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "KeyingSet"); RNA_def_struct_ui_text(srna, "Keying set paths", "Collection of keying set paths"); - + /* Add Path */ func = RNA_def_function(srna, "add", "rna_KeyingSet_paths_add"); RNA_def_function_ui_description(func, "Add a new path for the Keying Set"); @@ -842,7 +842,7 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "clear", "rna_KeyingSet_paths_clear"); RNA_def_function_ui_description(func, "Remove all the paths from the Keying Set"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - + prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "KeyingSetPath"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -862,17 +862,17 @@ static void rna_def_keyingset(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "KeyingSet", NULL); RNA_def_struct_ui_text(srna, "Keying Set", "Settings that should be keyframed together"); - + /* Id/Label */ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "idname"); RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_ui_text(prop, "ID Name", KEYINGSET_IDNAME_DOC); /* RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_RENAME, NULL); */ /* NOTE: disabled, as ID name shouldn't be editable */ - + prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_KeyingSet_name_set"); @@ -880,19 +880,19 @@ static void rna_def_keyingset(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_KEYINGSET); RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_RENAME, NULL); - + prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "description"); RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); RNA_def_property_ui_text(prop, "Description", "A short description of the keying set"); - + /* KeyingSetInfo (Type Info) for Builtin Sets only */ prop = RNA_def_property(srna, "type_info", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "KeyingSetInfo"); RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Type Info", "Callback function defines for built-in Keying Sets"); - + /* Paths */ prop = RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "paths", NULL); @@ -907,11 +907,11 @@ static void rna_def_keyingset(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed " "(i.e. is not reliant on context info)"); - + /* Keyframing Flags */ rna_def_common_keying_flags(srna, 0); - - + + /* Keying Set API */ RNA_api_keyingset(srna); } @@ -926,12 +926,12 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) FunctionRNA *func; PropertyRNA *prop; - + RNA_def_property_srna(cprop, "NlaTracks"); srna = RNA_def_struct(brna, "NlaTracks", NULL); RNA_def_struct_sdna(srna, "AnimData"); RNA_def_struct_ui_text(srna, "NLA Tracks", "Collection of NLA Tracks"); - + func = RNA_def_function(srna, "new", "rna_NlaTrack_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Add a new NLA Track"); @@ -939,7 +939,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) /* return type */ parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track"); RNA_def_function_return(func, parm); - + func = RNA_def_function(srna, "remove", "rna_NlaTrack_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Remove a NLA Track"); @@ -963,12 +963,12 @@ static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop) FunctionRNA *func; /* PropertyRNA *prop; */ - + RNA_def_property_srna(cprop, "AnimDataDrivers"); srna = RNA_def_struct(brna, "AnimDataDrivers", NULL); RNA_def_struct_sdna(srna, "AnimData"); RNA_def_struct_ui_text(srna, "Drivers", "Collection of Driver F-Curves"); - + /* AnimData.drivers.from_existing(...) */ func = RNA_def_function(srna, "from_existing", "rna_Driver_from_existing"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); @@ -977,7 +977,7 @@ static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop) /* return type */ parm = RNA_def_pointer(func, "driver", "FCurve", "", "New Driver F-Curve"); RNA_def_function_return(func, parm); - + /* AnimData.drivers.find(...) */ func = RNA_def_function(srna, "find", "rna_Driver_find"); RNA_def_function_ui_description(func, "Find a driver F-Curve. Note that this function performs a linear scan " @@ -994,7 +994,7 @@ static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop) void rna_def_animdata_common(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "animation_data", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "adt"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1005,11 +1005,11 @@ static void rna_def_animdata(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "AnimData", NULL); RNA_def_struct_ui_text(srna, "Animation Data", "Animation data for data-block"); RNA_def_struct_ui_icon(srna, ICON_ANIM_DATA); - + /* NLA */ prop = RNA_def_property(srna, "nla_tracks", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "nla_tracks", NULL); @@ -1017,7 +1017,7 @@ static void rna_def_animdata(BlenderRNA *brna) RNA_def_property_ui_text(prop, "NLA Tracks", "NLA Tracks (i.e. Animation Layers)"); rna_api_animdata_nla_tracks(brna, prop); - + /* Active Action */ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); /* this flag as well as the dynamic test must be defined for this to be editable... */ @@ -1034,30 +1034,30 @@ static void rna_def_animdata(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Action Extrapolation", "Action to take for gaps past the Active Action's range (when evaluating with NLA)"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); - + prop = RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "act_blendmode"); RNA_def_property_enum_items(prop, rna_enum_nla_mode_blend_items); RNA_def_property_ui_text(prop, "Action Blending", "Method used for combining Active Action's result with result of NLA stack"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ - - prop = RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_FACTOR); + + prop = RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "act_influence"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Action Influence", "Amount the Active Action contributes to the result of the NLA stack"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ - + /* Drivers */ prop = RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "drivers", NULL); RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this data-block"); - + rna_api_animdata_drivers(brna, prop); - + /* General Settings */ prop = RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF); @@ -1076,7 +1076,7 @@ static void rna_def_animdata(BlenderRNA *brna) void RNA_def_animation(BlenderRNA *brna) { rna_def_animdata(brna); - + rna_def_keyingset(brna); rna_def_keyingset_path(brna); rna_def_keyingset_info(brna); diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c index 492659fdc2e..0b8f1acbd74 100644 --- a/source/blender/makesrna/intern/rna_animation_api.c +++ b/source/blender/makesrna/intern/rna_animation_api.c @@ -52,13 +52,13 @@ static void rna_KeyingSet_context_refresh(KeyingSet *ks, bContext *C, ReportList { /* TODO: enable access to providing a list of overrides (dsources)? */ int success = ANIM_validate_keyingset(C, NULL, ks); - + if (success != 0) { switch (success) { case MODIFYKEY_INVALID_CONTEXT: BKE_report(reports, RPT_ERROR, "Invalid context for keying set"); break; - + case MODIFYKEY_MISSING_TYPEINFO: BKE_report(reports, RPT_ERROR, "Incomplete built-in keying set, appears to be missing type info"); break; @@ -72,7 +72,7 @@ void RNA_api_keyingset(StructRNA *srna) { FunctionRNA *func; /*PropertyRNA *parm; */ - + /* validate relative Keying Set (used to ensure paths are ok for context) */ func = RNA_def_function(srna, "refresh", "rna_KeyingSet_context_refresh"); RNA_def_function_ui_description(func, diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c index 2ba067629a9..94b4d60ca25 100644 --- a/source/blender/makesrna/intern/rna_animviz.c +++ b/source/blender/makesrna/intern/rna_animviz.c @@ -65,7 +65,7 @@ static PointerRNA rna_AnimViz_motion_paths_get(PointerRNA *ptr) static void rna_AnimViz_ghost_start_frame_set(PointerRNA *ptr, int value) { bAnimVizSettings *data = (bAnimVizSettings *)ptr->data; - + data->ghost_sf = value; CLAMP(data->ghost_ef, data->ghost_sf, MAXFRAME / 2); } @@ -73,7 +73,7 @@ static void rna_AnimViz_ghost_start_frame_set(PointerRNA *ptr, int value) static void rna_AnimViz_ghost_end_frame_set(PointerRNA *ptr, int value) { bAnimVizSettings *data = (bAnimVizSettings *)ptr->data; - + data->ghost_ef = value; CLAMP(data->ghost_sf, 1, data->ghost_ef); } @@ -81,7 +81,7 @@ static void rna_AnimViz_ghost_end_frame_set(PointerRNA *ptr, int value) static void rna_AnimViz_path_start_frame_set(PointerRNA *ptr, int value) { bAnimVizSettings *data = (bAnimVizSettings *)ptr->data; - + /* XXX: watchit! Path Start > MAXFRAME/2 could be a problem... */ data->path_sf = value; CLAMP(data->path_ef, data->path_sf + 1, MAXFRAME / 2); @@ -90,7 +90,7 @@ static void rna_AnimViz_path_start_frame_set(PointerRNA *ptr, int value) static void rna_AnimViz_path_end_frame_set(PointerRNA *ptr, int value) { bAnimVizSettings *data = (bAnimVizSettings *)ptr->data; - + data->path_ef = value; CLAMP(data->path_sf, 1, data->path_ef - 1); } @@ -100,7 +100,7 @@ static void rna_AnimViz_path_end_frame_set(PointerRNA *ptr, int value) void rna_def_motionpath_common(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mpath"); RNA_def_property_ui_text(prop, "Motion Path", "Motion Path for this element"); @@ -110,15 +110,15 @@ static void rna_def_animviz_motionpath_vert(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "MotionPathVert", NULL); RNA_def_struct_sdna(srna, "bMotionPathVert"); RNA_def_struct_ui_text(srna, "Motion Path Cache Point", "Cached location on path"); - + prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Coordinates", ""); - + prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_VERT_SEL); RNA_def_property_ui_text(prop, "Select", "Path point is selected for editing"); @@ -128,28 +128,28 @@ static void rna_def_animviz_motion_path(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "MotionPath", NULL); RNA_def_struct_sdna(srna, "bMotionPath"); RNA_def_struct_ui_text(srna, "Motion Path", "Cache of the worldspace positions of an element over a frame range"); - + /* Collections */ prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "points", "length"); RNA_def_property_struct_type(prop, "MotionPathVert"); RNA_def_property_ui_text(prop, "Motion Path Points", "Cached positions per frame"); - + /* Playback Ranges */ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "start_frame"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of the stored range"); - + prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "end_frame"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "End Frame", "End frame of the stored range"); - + prop = RNA_def_property(srna, "length", PROP_INT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Length", "Number of frames cached"); @@ -173,7 +173,7 @@ static void rna_def_animviz_motion_path(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* xxx */ RNA_def_property_ui_text(prop, "Use Bone Heads", "For PoseBone paths, use the bone head location when calculating this path"); - + /* FIXME: Motion Paths are not currently editable... */ prop = RNA_def_property(srna, "is_modified", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOTIONPATH_FLAG_EDIT); @@ -199,7 +199,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_type_items[] = { {GHOST_TYPE_NONE, "NONE", 0, "No Ghosts", "Do not show any ghosts"}, {GHOST_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Current Frame", "Show ghosts from around the current frame"}, @@ -207,8 +207,8 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) {GHOST_TYPE_KEYS, "KEYS", 0, "On Keyframes", "Show ghosts on keyframes"}, {0, NULL, 0, NULL, NULL} }; - - + + srna = RNA_def_struct(brna, "AnimVizOnionSkinning", NULL); RNA_def_struct_sdna(srna, "bAnimVizSettings"); RNA_def_struct_nested(brna, srna, "AnimViz"); @@ -220,21 +220,21 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Method used for determining what ghosts get drawn"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + /* Settings */ prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ghost_flag", GHOST_FLAG_ONLYSEL); RNA_def_property_ui_text(prop, "On Selected Bones Only", "For Pose-Mode drawing, only draw ghosts for selected bones"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghost_step"); RNA_def_property_range(prop, 1, 20); RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between ghosts shown (not for 'On Keyframes' Onion-skinning method)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + /* Playback Ranges */ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghost_sf"); @@ -243,7 +243,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) "Starting frame of range of Ghosts to display " "(not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghost_ef"); RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_ghost_end_frame_set", NULL); @@ -251,7 +251,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) "End frame of range of Ghosts to display " "(not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + /* Around Current Ranges */ prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghost_bc"); @@ -260,7 +260,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) "Number of frames to show before the current frame " "(only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghost_ac"); RNA_def_property_range(prop, 0, 30); @@ -274,63 +274,63 @@ static void rna_def_animviz_paths(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_type_items[] = { {MOTIONPATH_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Frame", "Display Paths of poses within a fixed number of frames around the current frame"}, {MOTIONPATH_TYPE_RANGE, "RANGE", 0, "In Range", "Display Paths of poses within specified range"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "AnimVizMotionPaths", NULL); RNA_def_struct_sdna(srna, "bAnimVizSettings"); RNA_def_struct_nested(brna, srna, "AnimViz"); RNA_def_struct_ui_text(srna, "Motion Path Settings", "Motion Path settings for animation visualization"); - + /* Enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "path_type"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Motion Paths"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "bake_location", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "path_bakeflag"); RNA_def_property_enum_items(prop, rna_enum_motionpath_bake_location_items); RNA_def_property_ui_text(prop, "Bake Location", "When calculating Bone Paths, use Head or Tips"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + /* Settings */ prop = RNA_def_property(srna, "show_frame_numbers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_FNUMS); RNA_def_property_ui_text(prop, "Show Frame Numbers", "Show frame numbers on Motion Paths"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "show_keyframe_highlight", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFRAS); RNA_def_property_ui_text(prop, "Highlight Keyframes", "Emphasize position of keyframes on Motion Paths"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFNOS); RNA_def_property_ui_text(prop, "Show Keyframe Numbers", "Show frame numbers of Keyframes on Motion Paths"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "show_keyframe_action_all", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFACT); RNA_def_property_ui_text(prop, "All Action Keyframes", "For bone motion paths, search whole Action for keyframes instead of in group" " with matching name only (is slower)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "path_step"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - - + + /* Playback Ranges */ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "path_sf"); @@ -339,7 +339,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna) "Starting frame of range of paths to display/calculate " "(not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "path_ef"); RNA_def_property_int_funcs(prop, NULL, "rna_AnimViz_path_end_frame_set", NULL); @@ -347,7 +347,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna) "End frame of range of paths to display/calculate " "(not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + /* Around Current Ranges */ prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "path_bc"); @@ -356,7 +356,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna) "Number of frames to show before the current frame " "(only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + prop = RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "path_ac"); RNA_def_property_range(prop, 1, MAXFRAMEF / 2); @@ -365,7 +365,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna) "(only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ - + /* Readonly Property - Do any motion paths exist/need updating? (Mainly for bone paths) */ prop = RNA_def_property(srna, "has_motion_paths", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "path_bakeflag", MOTIONPATH_BAKE_HAS_PATHS); @@ -378,7 +378,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna) void rna_def_animviz_common(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "animation_visualization", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "avs"); @@ -389,18 +389,18 @@ static void rna_def_animviz(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "AnimViz", NULL); RNA_def_struct_sdna(srna, "bAnimVizSettings"); RNA_def_struct_ui_text(srna, "Animation Visualization", "Settings for the visualization of motion"); - + /* onion-skinning settings (nested struct) */ prop = RNA_def_property(srna, "onion_skin_frames", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "AnimVizOnionSkinning"); RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Onion Skinning", "Onion Skinning (ghosting) settings for visualization"); - + /* motion path settings (nested struct) */ prop = RNA_def_property(srna, "motion_path", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -416,7 +416,7 @@ void RNA_def_animviz(BlenderRNA *brna) rna_def_animviz(brna); rna_def_animviz_ghosts(brna); rna_def_animviz_paths(brna); - + rna_def_animviz_motion_path(brna); rna_def_animviz_motionpath_vert(brna); } diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 4d26c8a8be4..b3b69e9c58a 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -72,13 +72,13 @@ static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value) else { if (value.id.data != arm) { Object *ob = (Object *)value.id.data; - + if (GS(ob->id.name) != ID_OB || (ob->data != arm)) { printf("ERROR: armature set active bone - new active doesn't come from this armature\n"); return; } } - + arm->act_bone = value.data; arm->act_bone->flag |= BONE_SELECTED; } @@ -146,7 +146,7 @@ static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), Pointe static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = ptr->id.data; - + WM_main_add_notifier(NC_GEOM | ND_DATA, id); } @@ -154,10 +154,10 @@ static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_Bone_update_renamed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = ptr->id.data; - + /* redraw view */ WM_main_add_notifier(NC_GEOM | ND_DATA, id); - + /* update animation channels */ WM_main_add_notifier(NC_ANIMATION | ND_ANIMCHAN, id); } @@ -165,14 +165,14 @@ static void rna_Bone_update_renamed(Main *UNUSED(bmain), Scene *UNUSED(scene), P static void rna_Bone_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = ptr->id.data; - - /* special updates for cases where rigs try to hook into armature drawing stuff + + /* special updates for cases where rigs try to hook into armature drawing stuff * e.g. Mask Modifier - 'Armature' option */ if (id) { if (GS(id->name) == ID_AR) { bArmature *arm = (bArmature *)id; - + if (arm->flag & ARM_HAS_VIZ_DEPS) { DAG_id_tag_update(id, OB_RECALC_DATA); } @@ -180,13 +180,13 @@ static void rna_Bone_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po else if (GS(id->name) == ID_OB) { Object *ob = (Object *)id; bArmature *arm = (bArmature *)ob->data; - + if (arm->flag & ARM_HAS_VIZ_DEPS) { DAG_id_tag_update(id, OB_RECALC_DATA); } } } - + WM_main_add_notifier(NC_GEOM | ND_DATA, id); /* spaces that show animation data of the selected bone need updating */ @@ -198,7 +198,7 @@ static char *rna_Bone_path(PointerRNA *ptr) ID *id = ptr->id.data; Bone *bone = (Bone *)ptr->data; char name_esc[sizeof(bone->name) * 2]; - + BLI_strescape(name_esc, bone->name, sizeof(name_esc)); /* special exception for trying to get the path where ID-block is Object @@ -209,7 +209,7 @@ static char *rna_Bone_path(PointerRNA *ptr) return BLI_sprintfN("pose.bones[\"%s\"].bone", name_esc); } } - + /* from armature... */ return BLI_sprintfN("bones[\"%s\"]", name_esc); } @@ -246,7 +246,7 @@ static void rna_bone_layer_set(int *layer, const int *values) for (i = 0; i < 32; i++) if (values[i]) tot++; - + if (tot == 0) return; @@ -271,7 +271,7 @@ static void rna_Armature_layer_set(PointerRNA *ptr, const int *values) for (i = 0; i < 32; i++) if (values[i]) tot++; - + if (tot == 0) return; @@ -310,11 +310,11 @@ static void rna_EditBone_name_set(PointerRNA *ptr, const char *value) bArmature *arm = (bArmature *)ptr->id.data; EditBone *ebone = (EditBone *)ptr->data; char oldname[sizeof(ebone->name)], newname[sizeof(ebone->name)]; - + /* need to be on the stack */ BLI_strncpy_utf8(newname, value, sizeof(ebone->name)); BLI_strncpy(oldname, ebone->name, sizeof(ebone->name)); - + ED_armature_bone_rename(G.main, arm, oldname, newname); } @@ -323,7 +323,7 @@ static void rna_Bone_name_set(PointerRNA *ptr, const char *value) bArmature *arm = (bArmature *)ptr->id.data; Bone *bone = (Bone *)ptr->data; char oldname[sizeof(bone->name)], newname[sizeof(bone->name)]; - + /* need to be on the stack */ BLI_strncpy_utf8(newname, value, sizeof(bone->name)); BLI_strncpy(oldname, bone->name, sizeof(bone->name)); @@ -389,7 +389,7 @@ static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value) /* make sure this is a valid child */ if (parbone == ebone) return; - + for (pbone = parbone->parent; pbone; pbone = pbone->parent) if (pbone == ebone) return; @@ -416,7 +416,7 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po bArmature *arm = (bArmature *)ptr->id.data; EditBone *ebone = (EditBone *)ptr->data; EditBone *child, *eboflip; - + /* update our parent */ if (ebone->parent && ebone->flag & BONE_CONNECTED) copy_v3_v3(ebone->parent->tail, ebone->head); @@ -434,11 +434,11 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po eboflip->head[0] = -ebone->head[0]; eboflip->tail[0] = -ebone->tail[0]; - + /* update our parent */ if (eboflip->parent && eboflip->flag & BONE_CONNECTED) copy_v3_v3(eboflip->parent->tail, eboflip->head); - + /* update our children if necessary */ for (child = arm->edbo->first; child; child = child->next) if (child->parent == eboflip && (child->flag & BONE_CONNECTED)) @@ -496,48 +496,48 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) else \ RNA_def_property_update(prop, 0, "rna_Armature_update_data"); \ } (void)0; - + PropertyRNA *prop; - + /* Roll In/Out */ prop = RNA_def_property(srna, "bbone_rollin", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "roll1"); RNA_def_property_range(prop, -M_PI * 2.0, M_PI * 2.0); RNA_def_property_ui_text(prop, "Roll In", "Roll offset for the start of the B-Bone, adjusts twist"); RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); - + prop = RNA_def_property(srna, "bbone_rollout", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "roll2"); RNA_def_property_range(prop, -M_PI * 2.0, M_PI * 2.0); RNA_def_property_ui_text(prop, "Roll Out", "Roll offset for the end of the B-Bone, adjusts twist"); RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); - + if (is_posebone == false) { prop = RNA_def_property(srna, "use_endroll_as_inroll", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Inherit End Roll", "Use Roll Out of parent bone as Roll In of its children"); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ADD_PARENT_END_ROLL); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); } - + /* Curve X/Y Offsets */ prop = RNA_def_property(srna, "bbone_curveinx", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "curveInX"); RNA_def_property_range(prop, -5.0f, 5.0f); RNA_def_property_ui_text(prop, "In X", "X-axis handle offset for start of the B-Bone's curve, adjusts curvature"); RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); - + prop = RNA_def_property(srna, "bbone_curveiny", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "curveInY"); RNA_def_property_range(prop, -5.0f, 5.0f); RNA_def_property_ui_text(prop, "In Y", "Y-axis handle offset for start of the B-Bone's curve, adjusts curvature"); RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); - + prop = RNA_def_property(srna, "bbone_curveoutx", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "curveOutX"); RNA_def_property_range(prop, -5.0f, 5.0f); RNA_def_property_ui_text(prop, "Out X", "X-axis handle offset for end of the B-Bone's curve, adjusts curvature"); RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); - + prop = RNA_def_property(srna, "bbone_curveouty", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "curveOutY"); RNA_def_property_range(prop, -5.0f, 5.0f); @@ -551,7 +551,7 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Ease In", "Length of first Bezier Handle (for B-Bones only)"); RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); - + prop = RNA_def_property(srna, "bbone_easeout", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ease2"); RNA_def_property_range(prop, -5.0f, 5.0f); @@ -566,14 +566,14 @@ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Scale In", "Scale factor for start of the B-Bone, adjusts thickness (for tapering effects)"); RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); - + prop = RNA_def_property(srna, "bbone_scaleout", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scaleOut"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Scale Out", "Scale factor for end of the B-Bone, adjusts thickness (for tapering effects)"); RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone); - + #undef RNA_DEF_CURVEBONE_UPDATE } @@ -605,23 +605,23 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) else RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is stuck to the parent's tail"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "use_inherit_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_HINGE); RNA_def_property_ui_text(prop, "Inherit Rotation", "Bone inherits rotation or scale from parent bone"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "use_envelope_multiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV); RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope", "When deforming bone, multiply effects of Vertex Group weights with Envelope influence"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "use_deform", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_DEFORM); RNA_def_property_ui_text(prop, "Deform", "Enable Bone to deform geometry"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "use_inherit_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Inherit Scale", "Bone inherits scaling from parent bone"); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_SCALE); @@ -631,19 +631,19 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_ui_text(prop, "Local Location", "Bone location is set in local space"); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_LOCAL_LOCATION); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "use_relative_parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Relative Parenting", "Object children will use relative transform, like deform"); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_RELATIVE_PARENTING); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE); RNA_def_property_ui_text(prop, "Draw Wire", "Bone is always drawn as Wireframe regardless of viewport draw mode " "(useful for non-obstructive custom bone shapes)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - + /* XXX: use_cyclic_offset is deprecated in 2.5. May/may not return */ prop = RNA_def_property(srna, "use_cyclic_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_CYCLICOFFSET); @@ -651,7 +651,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) "When bone doesn't have a parent, it receives cyclic offset effects (Deprecated)"); // "When bone doesn't have a parent, it receives cyclic offset effects"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_UNSELECTABLE); RNA_def_property_ui_text(prop, "Selectable", "Bone is able to be selected"); @@ -664,13 +664,13 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Envelope Deform Distance", "Bone deformation distance (for Envelope deform only)"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "envelope_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "weight"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Envelope Deform Weight", "Bone deformation weight (for Envelope deform only)"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "head_radius", PROP_FLOAT, PROP_UNSIGNED); if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); @@ -679,7 +679,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) /*RNA_def_property_range(prop, 0, 1000); */ RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Envelope Head Radius", "Radius of head of bone (for Envelope deform only)"); - + prop = RNA_def_property(srna, "tail_radius", PROP_FLOAT, PROP_UNSIGNED); if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); @@ -688,20 +688,20 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) /*RNA_def_property_range(prop, 0, 1000); */ RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Envelope Tail Radius", "Radius of tail of bone (for Envelope deform only)"); - + /* b-bones deform settings */ prop = RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "segments"); RNA_def_property_range(prop, 1, 32); RNA_def_property_ui_text(prop, "B-Bone Segments", "Number of subdivisions of bone (for B-Bones only)"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "bbone_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xwidth"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "B-Bone Display X Width", "B-Bone X size"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "bbone_z", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "zwidth"); RNA_def_property_range(prop, 0.0f, 1000.0f); @@ -714,13 +714,13 @@ static void rna_def_bone(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "Bone", NULL); RNA_def_struct_ui_text(srna, "Bone", "Bone in an Armature data-block"); RNA_def_struct_ui_icon(srna, ICON_BONE_DATA); RNA_def_struct_path_func(srna, "rna_Bone_path"); RNA_def_struct_idprops_func(srna, "rna_Bone_idprops"); - + /* pointers/collections */ /* parent (pointer) */ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); @@ -728,7 +728,7 @@ static void rna_def_bone(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "parent"); RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - + /* children (collection) */ prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL); @@ -751,13 +751,13 @@ static void rna_def_bone(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Select", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* XXX: review whether this could be used for interesting effects... */ RNA_def_property_update(prop, 0, "rna_Bone_select_update"); - + prop = RNA_def_property(srna, "select_head", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ROOTSEL); RNA_def_property_ui_text(prop, "Select Head", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - + prop = RNA_def_property(srna, "select_tail", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_TIPSEL); RNA_def_property_ui_text(prop, "Select Tail", ""); @@ -812,13 +812,13 @@ static void rna_def_edit_bone(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "EditBone", NULL); RNA_def_struct_sdna(srna, "EditBone"); RNA_def_struct_idprops_func(srna, "rna_EditBone_idprops"); RNA_def_struct_ui_text(srna, "Edit Bone", "Editmode bone in an Armature data-block"); RNA_def_struct_ui_icon(srna, ICON_BONE_DATA); - + RNA_define_verify_sdna(0); /* not in sdna */ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); @@ -827,7 +827,7 @@ static void rna_def_edit_bone(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent", "Parent edit bone (in same Armature)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - + prop = RNA_def_property(srna, "roll", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "roll"); RNA_def_property_ui_range(prop, -M_PI * 2, M_PI * 2, 10, 2); @@ -875,7 +875,7 @@ static void rna_def_edit_bone(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Head Select", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - + prop = RNA_def_property(srna, "select_tail", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_TIPSEL); RNA_def_property_ui_text(prop, "Tail Select", ""); @@ -1004,7 +1004,7 @@ static void rna_def_armature(BlenderRNA *brna) {ARM_RESTPOS, "REST", 0, "Rest Position", "Show Armature in binding pose state (no posing possible)"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "Armature", "ID"); RNA_def_struct_ui_text(srna, "Armature", "Armature data-block containing a hierarchy of bones, usually used for rigging characters"); @@ -1019,7 +1019,7 @@ static void rna_def_armature(BlenderRNA *brna) /* Animation Data */ rna_def_animdata_common(srna); - + /* Collections */ prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL); @@ -1041,7 +1041,7 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pose Position", "Show armature in binding pose or final posed state"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + prop = RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "drawtype"); RNA_def_property_enum_items(prop, prop_drawtype_items); @@ -1055,7 +1055,7 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Vertex Deformer", "Vertex Deformer Method (Game Engine only)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + /* XXX deprecated ....... old animviz for armatures only */ prop = RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ghosttype"); @@ -1074,7 +1074,7 @@ static void rna_def_armature(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Armature_update_layers"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + /* layer protection */ prop = RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1); @@ -1083,47 +1083,47 @@ static void rna_def_armature(BlenderRNA *brna) "Protected layers in Proxy Instances are restored to Proxy settings " "on file reload and undo"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - + /* flag */ prop = RNA_def_property(srna, "show_axes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES); RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES); RNA_def_property_ui_text(prop, "Draw Names", "Draw bone names"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + prop = RNA_def_property(srna, "use_deform_delay", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DELAYDEFORM); RNA_def_property_ui_text(prop, "Delay Deform", "Don't deform children when manipulating bones in Pose Mode"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); - + prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_MIRROR_EDIT); RNA_def_property_ui_text(prop, "X-Axis Mirror", "Apply changes to matching bone on opposite side of X-Axis"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + prop = RNA_def_property(srna, "use_auto_ik", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_AUTO_IK); RNA_def_property_ui_text(prop, "Auto IK", "Add temporary IK constraints while grabbing bones in Pose Mode"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + prop = RNA_def_property(srna, "show_bone_custom_shapes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_NO_CUSTOM); RNA_def_property_ui_text(prop, "Draw Custom Bone Shapes", "Draw bones with their custom shapes"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - + prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_COL_CUSTOM); RNA_def_property_ui_text(prop, "Draw Bone Group Colors", "Draw bone group colors"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - + /* XXX deprecated ....... old animviz for armatures only */ prop = RNA_def_property(srna, "show_only_ghost_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL); @@ -1143,7 +1143,7 @@ static void rna_def_armature(BlenderRNA *brna) "(only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + prop = RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghostsize"); RNA_def_property_range(prop, 1, 20); @@ -1151,7 +1151,7 @@ static void rna_def_armature(BlenderRNA *brna) "Frame step for Ghosts (not for 'On Keyframes' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + prop = RNA_def_property(srna, "ghost_frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghostsf"); RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_start_frame_set", NULL); @@ -1160,7 +1160,7 @@ static void rna_def_armature(BlenderRNA *brna) "'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - + prop = RNA_def_property(srna, "ghost_frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghostef"); RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL); diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index fd3694e7c45..8b0623a867c 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -94,7 +94,7 @@ static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN { if (ptr->type == &RNA_ParticleSystem) { ParticleSystem *psys = (ParticleSystem *)ptr->data; - + psys->recalc = PSYS_RECALC_RESET; DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); @@ -108,7 +108,7 @@ static void rna_Boids_reset_deps(Main *bmain, Scene *UNUSED(scene), PointerRNA * { if (ptr->type == &RNA_ParticleSystem) { ParticleSystem *psys = (ParticleSystem *)ptr->data; - + psys->recalc = PSYS_RECALC_RESET; DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); @@ -209,10 +209,10 @@ static int particle_id_check(PointerRNA *ptr) static char *rna_BoidSettings_path(PointerRNA *ptr) { BoidSettings *boids = (BoidSettings *)ptr->data; - + if (particle_id_check(ptr)) { ParticleSettings *part = (ParticleSettings *)ptr->id.data; - + if (part->boids == boids) return BLI_sprintfN("boids"); } @@ -416,36 +416,36 @@ static void rna_def_boidrule(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + /* data */ srna = RNA_def_struct(brna, "BoidRule", NULL); RNA_def_struct_ui_text(srna, "Boid Rule", ""); RNA_def_struct_refine_func(srna, "rna_BoidRule_refine"); RNA_def_struct_path_func(srna, "rna_BoidRule_path"); - + /* strings */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Boid rule name"); RNA_def_struct_name_property(srna, prop); - + /* enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, rna_enum_boidrule_type_items); RNA_def_property_ui_text(prop, "Type", ""); - + /* flags */ prop = RNA_def_property(srna, "use_in_air", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_IN_AIR); RNA_def_property_ui_text(prop, "In Air", "Use rule when boid is flying"); RNA_def_property_update(prop, 0, "rna_Boids_reset"); - + prop = RNA_def_property(srna, "use_on_land", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_ON_LAND); RNA_def_property_ui_text(prop, "On Land", "Use rule when boid is on land"); RNA_def_property_update(prop, 0, "rna_Boids_reset"); - + /*prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); */ /*RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); */ /*RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface"); */ diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 1fd17afdc60..71cdb24ffdc 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -111,7 +111,7 @@ const EnumPropertyItem rna_enum_brush_vertex_tool_items[] = { {0, NULL, 0, NULL, NULL} }; - + const EnumPropertyItem rna_enum_brush_image_tool_items[] = { {PAINT_TOOL_DRAW, "DRAW", ICON_BRUSH_TEXDRAW, "Draw", ""}, {PAINT_TOOL_SOFTEN, "SOFTEN", ICON_BRUSH_SOFTEN, "Soften", ""}, @@ -397,14 +397,14 @@ static void rna_Brush_sculpt_tool_update(Main *bmain, Scene *scene, PointerRNA * rna_Brush_reset_icon(br, "sculpt"); rna_Brush_update(bmain, scene, ptr); } - + static void rna_Brush_vertex_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Brush *br = (Brush *)ptr->data; rna_Brush_reset_icon(br, "vertex_paint"); rna_Brush_update(bmain, scene, ptr); } - + static void rna_Brush_imagepaint_tool_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Brush *br = (Brush *)ptr->data; @@ -647,8 +647,8 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_TextureCapabilities_" \ #prop_name_ "_get", NULL); \ RNA_def_property_ui_text(prop, ui_name_, NULL) - - + + srna = RNA_def_struct(brna, "BrushTextureSlot", "TextureSlot"); RNA_def_struct_sdna(srna, "MTex"); RNA_def_struct_ui_text(srna, "Brush Texture Slot", "Texture slot for textures in a Brush data-block"); @@ -691,10 +691,10 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna) RNA_def_property_range(prop, 0, M_PI * 2); RNA_def_property_ui_text(prop, "Random Angle", "Brush texture random angle"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); - + TEXTURE_CAPABILITY(has_texture_angle_source, "Has Texture Angle Source"); TEXTURE_CAPABILITY(has_random_texture_angle, "Has Random Texture Angle"); - TEXTURE_CAPABILITY(has_texture_angle, "Has Texture Angle Source"); + TEXTURE_CAPABILITY(has_texture_angle, "Has Texture Angle Source"); } static void rna_def_sculpt_capabilities(BlenderRNA *brna) @@ -797,7 +797,7 @@ static void rna_def_brush(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_blend_items[] = { {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting"}, {IMB_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting"}, @@ -825,7 +825,7 @@ static void rna_def_brush(BlenderRNA *brna) {IMB_BLEND_COLOR, "COLOR", 0, "Color", "Use color blending mode while painting"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem brush_sculpt_plane_items[] = { {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""}, {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""}, @@ -887,7 +887,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_brush_vertex_tool_items); RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode"); RNA_def_property_update(prop, 0, "rna_Brush_vertex_tool_update"); - + prop = RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "imagepaint_tool"); RNA_def_property_enum_items(prop, rna_enum_brush_image_tool_items); @@ -917,7 +917,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_enum_items(prop, brush_mask_tool_items); RNA_def_property_ui_text(prop, "Mask Tool", ""); RNA_def_property_update(prop, 0, "rna_Brush_update"); - + /* number values */ prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL); RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL); @@ -925,7 +925,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, -1); RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); RNA_def_property_update(prop, 0, "rna_Brush_size_update"); - + prop = RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_funcs(prop, NULL, "rna_Brush_set_unprojected_radius", NULL); RNA_def_property_range(prop, 0.001, FLT_MAX); @@ -969,14 +969,14 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_range(prop, 0.5, 0.99); RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - + prop = RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rate"); RNA_def_property_range(prop, 0.0001f, 10000.0f); RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3); RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - + prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_float_sdna(prop, NULL, "rgb"); @@ -1133,20 +1133,20 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH); RNA_def_property_ui_text(prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - + prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_NORMAL); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true); RNA_def_property_ui_text(prop, "Original Normal", "When locked keep using normal of surface where stroke was initiated"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - + prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - + prop = RNA_def_property(srna, "use_offset_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_OFFSET_PRESSURE); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); @@ -1188,7 +1188,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - + prop = RNA_def_property(srna, "use_relative_jitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_ABSOLUTE_JITTER); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true); @@ -1244,7 +1244,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ACCUMULATE); RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke daubs on top of each other"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - + prop = RNA_def_property(srna, "use_space_attenuation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE_ATTEN); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true); @@ -1363,7 +1363,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "mtex"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Texture Slot", ""); - + prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mtex.tex"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -1428,7 +1428,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Clone Image", "Image for clone tool"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_Brush_update"); - + prop = RNA_def_property(srna, "clone_alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clone.alpha"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1508,7 +1508,7 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna) prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_ui_text(prop, "Time", ""); - + /* used for Grease Pencil sketching sessions */ prop = RNA_def_property(srna, "is_start", PROP_BOOLEAN, PROP_NONE); RNA_def_property_flag(prop, PROP_IDPROPERTY); diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 0ac5bf899a3..ef2241e269b 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -88,11 +88,11 @@ static void rna_ClothSettings_bending_set(struct PointerRNA *ptr, float value) static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value) { ClothSimSettings *settings = (ClothSimSettings *)ptr->data; - + /* check for clipping */ if (value < settings->bending) value = settings->bending; - + settings->max_bend = value; } @@ -110,11 +110,11 @@ static void rna_ClothSettings_structural_set(struct PointerRNA *ptr, float value static void rna_ClothSettings_max_struct_set(struct PointerRNA *ptr, float value) { ClothSimSettings *settings = (ClothSimSettings *)ptr->data; - + /* check for clipping */ if (value < settings->structural) value = settings->structural; - + settings->max_struct = value; } @@ -290,7 +290,7 @@ static void rna_def_cloth_solver_result(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem status_items[] = { {BPH_SOLVER_SUCCESS, "SUCCESS", 0, "Success", "Computation was successful"}, {BPH_SOLVER_NUMERICAL_ISSUE, "NUMERICAL_ISSUE", 0, "Numerical Issue", "The provided data did not satisfy the prerequisites"}, @@ -298,49 +298,49 @@ static void rna_def_cloth_solver_result(BlenderRNA *brna) {BPH_SOLVER_INVALID_INPUT, "INVALID_INPUT", 0, "Invalid Input", "The inputs are invalid, or the algorithm has been improperly called"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "ClothSolverResult", NULL); RNA_def_struct_ui_text(srna, "Solver Result", "Result of cloth solver iteration"); - + RNA_define_verify_sdna(0); - + prop = RNA_def_property(srna, "status", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, status_items); RNA_def_property_enum_sdna(prop, NULL, "status"); RNA_def_property_flag(prop, PROP_ENUM_FLAG); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Status", "Status of the solver iteration"); - + prop = RNA_def_property(srna, "max_error", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_error"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Maximum Error", "Maximum error during substeps"); - + prop = RNA_def_property(srna, "min_error", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min_error"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Minimum Error", "Minimum error during substeps"); - + prop = RNA_def_property(srna, "avg_error", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "avg_error"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Average Error", "Average error during substeps"); - + prop = RNA_def_property(srna, "max_iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "max_iterations"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Maximum Iterations", "Maximum iterations during substeps"); - + prop = RNA_def_property(srna, "min_iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "min_iterations"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Minimum Iterations", "Minimum iterations during substeps"); - + prop = RNA_def_property(srna, "avg_iterations", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "avg_iterations"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Average Iterations", "Average iterations during substeps"); - + RNA_define_verify_sdna(1); } @@ -348,14 +348,14 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "ClothSettings", NULL); RNA_def_struct_ui_text(srna, "Cloth Settings", "Cloth simulation settings for an object"); RNA_def_struct_sdna(srna, "ClothSimSettings"); RNA_def_struct_path_func(srna, "rna_ClothSettings_path"); - + /* goal */ - + prop = RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -376,13 +376,13 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used"); RNA_def_property_update(prop, 0, "rna_cloth_update"); - + prop = RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness"); RNA_def_property_update(prop, 0, "rna_cloth_update"); - + prop = RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_range(prop, 0.0f, 50.0f); @@ -425,7 +425,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) "rna_ClothSettings_mass_vgroup_set"); RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices"); RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed"); - + prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -100.0, 100.0); @@ -509,14 +509,14 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) "If enabled, stiffness can be scaled along a weight painted vertex group"); RNA_def_property_update(prop, 0, "rna_cloth_update"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - + prop = RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "Cdis"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity (higher = more smooth, less jiggling)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); - + prop = RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "structural"); RNA_def_property_range(prop, 0.0f, 10000.0f); @@ -649,7 +649,7 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "ClothCollisionSettings", NULL); RNA_def_struct_ui_text(srna, "Cloth Collision Settings", "Cloth simulation settings for self collision and collision with other objects"); @@ -677,7 +677,7 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Repulsion Distance", "Maximum distance to apply repulsion force, must be greater than minimum distance"); RNA_def_property_update(prop, 0, "rna_cloth_update"); - + prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "epsilon"); RNA_def_property_range(prop, 0.001f, 1.0f); @@ -711,13 +711,13 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_SELF); RNA_def_property_ui_text(prop, "Enable Self Collision", "Enable self collisions"); RNA_def_property_update(prop, 0, "rna_cloth_update"); - + prop = RNA_def_property(srna, "self_distance_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "selfepsilon"); RNA_def_property_range(prop, 0.5f, 1.0f); RNA_def_property_ui_text(prop, "Self Minimum Distance", "0.5 means no distance at all, 1.0 is maximum distance"); RNA_def_property_update(prop, 0, "rna_cloth_update"); - + prop = RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_ui_text(prop, "Self Friction", "Friction/damping with self contact"); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 8f3160e84d2..dbd61cf6450 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -74,7 +74,7 @@ static int rna_CurveMapping_curves_length(PointerRNA *ptr) for (len = 0; len < CM_TOT; len++) if (!cumap->cm[len].curve) break; - + return len; } @@ -153,30 +153,30 @@ static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float * static char *rna_ColorRamp_path(PointerRNA *ptr) { char *path = NULL; - + /* handle the cases where a single data-block may have 2 ramp types */ if (ptr->id.data) { ID *id = ptr->id.data; - + switch (GS(id->name)) { case ID_MA: /* material has 2 cases - diffuse and specular */ { Material *ma = (Material *)id; - + if (ptr->data == ma->ramp_col) path = BLI_strdup("diffuse_ramp"); else if (ptr->data == ma->ramp_spec) path = BLI_strdup("specular_ramp"); break; } - + case ID_NT: { bNodeTree *ntree = (bNodeTree *)id; bNode *node; PointerRNA node_ptr; char *node_path; - + for (node = ntree->nodes.first; node; node = node->next) { if (ELEM(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) { if (node->storage == ptr->data) { @@ -192,14 +192,14 @@ static char *rna_ColorRamp_path(PointerRNA *ptr) } break; } - + case ID_LS: { /* may be NULL */ path = BKE_linestyle_path_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data); break; } - + default: /* everything else just uses 'color_ramp' */ path = BLI_strdup("color_ramp"); @@ -210,7 +210,7 @@ static char *rna_ColorRamp_path(PointerRNA *ptr) /* everything else just uses 'color_ramp' */ path = BLI_strdup("color_ramp"); } - + return path; } @@ -220,7 +220,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) PropertyRNA *prop; char *path = NULL; int index; - + /* helper macro for use here to try and get the path * - this calls the standard code for getting a path to a texture... */ @@ -242,12 +242,12 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) /* FIXME: this is a very slow way to do it, but it will have to suffice... */ if (ptr->id.data) { ID *id = ptr->id.data; - + switch (GS(id->name)) { case ID_MA: /* 2 cases for material - diffuse and spec */ { Material *ma = (Material *)id; - + /* try diffuse first */ if (ma->ramp_col) { RNA_pointer_create(id, &RNA_ColorRamp, ma->ramp_col, &ramp_ptr); @@ -264,7 +264,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) { bNodeTree *ntree = (bNodeTree *)id; bNode *node; - + for (node = ntree->nodes.first; node; node = node->next) { if (ELEM(node->type, SH_NODE_VALTORGB, CMP_NODE_VALTORGB, TEX_NODE_VALTORGB)) { RNA_pointer_create(id, &RNA_ColorRamp, node->storage, &ramp_ptr); @@ -298,10 +298,10 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) } } } - + /* cleanup the macro we defined */ #undef COLRAMP_GETPATH - + return path; } @@ -309,12 +309,12 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * { if (ptr->id.data) { ID *id = ptr->id.data; - + switch (GS(id->name)) { case ID_MA: { Material *ma = ptr->id.data; - + DAG_id_tag_update(&ma->id, 0); WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma); break; @@ -349,7 +349,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * case ID_PA: { ParticleSettings *part = ptr->id.data; - + DAG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_REDO); WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, part); } @@ -787,7 +787,7 @@ static void rna_def_curvemapping(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "CurveMapping", "Curve mapping to map color, vector and scalar values to other values using " "a user defined curve"); - + prop = RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_DO_CLIP); RNA_def_property_ui_text(prop, "Clip", "Force the curve view to fit a defined boundary"); @@ -854,7 +854,7 @@ static void rna_def_color_ramp_element(BlenderRNA *brna) RNA_def_struct_sdna(srna, "CBData"); RNA_def_struct_path_func(srna, "rna_ColorRampElement_path"); RNA_def_struct_ui_text(srna, "Color Ramp Element", "Element defining a color at a position in the color ramp"); - + prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 4); @@ -919,7 +919,7 @@ static void rna_def_color_ramp(BlenderRNA *brna) {COLBAND_INTERP_CONSTANT, "CONSTANT", 0, "Constant", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_mode_items[] = { {COLBAND_BLEND_RGB, "RGB", 0, "RGB", ""}, {COLBAND_BLEND_HSV, "HSV", 0, "HSV", ""}, @@ -939,7 +939,7 @@ static void rna_def_color_ramp(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ColorBand"); RNA_def_struct_path_func(srna, "rna_ColorRamp_path"); RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color"); - + prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR); RNA_def_property_collection_sdna(prop, NULL, "data", "tot"); RNA_def_property_struct_type(prop, "ColorRampElement"); @@ -974,7 +974,7 @@ static void rna_def_color_ramp(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Total", "Total number of elements"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); #endif - + func = RNA_def_function(srna, "evaluate", "rna_ColorRamp_eval"); RNA_def_function_ui_description(func, "Evaluate ColorRamp"); parm = RNA_def_float(func, "position", 1.0f, 0.0f, 1.0f, "Position", "Evaluate ColorRamp at position", 0.0f, 1.0f); @@ -990,7 +990,7 @@ static void rna_def_histogram(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_mode_items[] = { {HISTO_MODE_LUMA, "LUMA", 0, "Luma", "Luma"}, {HISTO_MODE_RGB, "RGB", 0, "RGB", "Red Green Blue"}, @@ -1003,7 +1003,7 @@ static void rna_def_histogram(BlenderRNA *brna) srna = RNA_def_struct(brna, "Histogram", NULL); RNA_def_struct_ui_text(srna, "Histogram", "Statistical view of the levels of color in an image"); - + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, prop_mode_items); @@ -1032,12 +1032,12 @@ static void rna_def_scopes(BlenderRNA *brna) srna = RNA_def_struct(brna, "Scopes", NULL); RNA_def_struct_ui_text(srna, "Scopes", "Scopes for statistical view of an image"); - + prop = RNA_def_property(srna, "use_full_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, "Scopes", "sample_full", 1); RNA_def_property_ui_text(prop, "Full Sample", "Sample every pixel of the image"); RNA_def_property_update(prop, 0, "rna_Scopes_update"); - + prop = RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, "Scopes", "accuracy"); RNA_def_property_range(prop, 0.0, 100.0); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 55153c294b5..d8389093593 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -52,59 +52,59 @@ const EnumPropertyItem rna_enum_constraint_type_items[] = { {CONSTRAINT_TYPE_FOLLOWTRACK, "FOLLOW_TRACK", ICON_CONSTRAINT_DATA, "Follow Track", ""}, {CONSTRAINT_TYPE_OBJECTSOLVER, "OBJECT_SOLVER", ICON_CONSTRAINT_DATA, "Object Solver", ""}, {0, "", 0, N_("Transform"), ""}, - {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", ICON_CONSTRAINT_DATA, "Copy Location", + {CONSTRAINT_TYPE_LOCLIKE, "COPY_LOCATION", ICON_CONSTRAINT_DATA, "Copy Location", "Copy the location of a target (with an optional offset), so that they move together"}, - {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", ICON_CONSTRAINT_DATA, "Copy Rotation", + {CONSTRAINT_TYPE_ROTLIKE, "COPY_ROTATION", ICON_CONSTRAINT_DATA, "Copy Rotation", "Copy the rotation of a target (with an optional offset), so that they rotate together"}, - {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", ICON_CONSTRAINT_DATA, "Copy Scale", + {CONSTRAINT_TYPE_SIZELIKE, "COPY_SCALE", ICON_CONSTRAINT_DATA, "Copy Scale", "Copy the scale factors of a target (with an optional offset), so that they are scaled by the same amount"}, - {CONSTRAINT_TYPE_TRANSLIKE, "COPY_TRANSFORMS", ICON_CONSTRAINT_DATA, "Copy Transforms", + {CONSTRAINT_TYPE_TRANSLIKE, "COPY_TRANSFORMS", ICON_CONSTRAINT_DATA, "Copy Transforms", "Copy all the transformations of a target, so that they move together"}, - {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", ICON_CONSTRAINT_DATA, "Limit Distance", + {CONSTRAINT_TYPE_DISTLIMIT, "LIMIT_DISTANCE", ICON_CONSTRAINT_DATA, "Limit Distance", "Restrict movements to within a certain distance of a target (at the time of constraint evaluation only)"}, - {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", ICON_CONSTRAINT_DATA, "Limit Location", + {CONSTRAINT_TYPE_LOCLIMIT, "LIMIT_LOCATION", ICON_CONSTRAINT_DATA, "Limit Location", "Restrict movement along each axis within given ranges"}, - {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", ICON_CONSTRAINT_DATA, "Limit Rotation", + {CONSTRAINT_TYPE_ROTLIMIT, "LIMIT_ROTATION", ICON_CONSTRAINT_DATA, "Limit Rotation", "Restrict rotation along each axis within given ranges"}, - {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", ICON_CONSTRAINT_DATA, "Limit Scale", + {CONSTRAINT_TYPE_SIZELIMIT, "LIMIT_SCALE", ICON_CONSTRAINT_DATA, "Limit Scale", "Restrict scaling along each axis with given ranges"}, - {CONSTRAINT_TYPE_SAMEVOL, "MAINTAIN_VOLUME", ICON_CONSTRAINT_DATA, "Maintain Volume", + {CONSTRAINT_TYPE_SAMEVOL, "MAINTAIN_VOLUME", ICON_CONSTRAINT_DATA, "Maintain Volume", "Compensate for scaling one axis by applying suitable scaling to the other two axes"}, - {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", ICON_CONSTRAINT_DATA, "Transformation", + {CONSTRAINT_TYPE_TRANSFORM, "TRANSFORM", ICON_CONSTRAINT_DATA, "Transformation", "Use one transform property from target to control another (or same) property on owner"}, {CONSTRAINT_TYPE_TRANSFORM_CACHE, "TRANSFORM_CACHE", ICON_CONSTRAINT_DATA, "Transform Cache", "Look up the transformation matrix from an external file"}, {0, "", 0, N_("Tracking"), ""}, - {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", ICON_CONSTRAINT_DATA, "Clamp To", + {CONSTRAINT_TYPE_CLAMPTO, "CLAMP_TO", ICON_CONSTRAINT_DATA, "Clamp To", "Restrict movements to lie along a curve by remapping location along curve's longest axis"}, {CONSTRAINT_TYPE_DAMPTRACK, "DAMPED_TRACK", ICON_CONSTRAINT_DATA, "Damped Track", "Point towards a target by performing the smallest rotation necessary"}, - {CONSTRAINT_TYPE_KINEMATIC, "IK", ICON_CONSTRAINT_DATA, "Inverse Kinematics", + {CONSTRAINT_TYPE_KINEMATIC, "IK", ICON_CONSTRAINT_DATA, "Inverse Kinematics", "Control a chain of bones by specifying the endpoint target (Bones only)"}, {CONSTRAINT_TYPE_LOCKTRACK, "LOCKED_TRACK", ICON_CONSTRAINT_DATA, "Locked Track", "Rotate around the specified ('locked') axis to point towards a target"}, - {CONSTRAINT_TYPE_SPLINEIK, "SPLINE_IK", ICON_CONSTRAINT_DATA, "Spline IK", + {CONSTRAINT_TYPE_SPLINEIK, "SPLINE_IK", ICON_CONSTRAINT_DATA, "Spline IK", "Align chain of bones along a curve (Bones only)"}, - {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", ICON_CONSTRAINT_DATA, "Stretch To", + {CONSTRAINT_TYPE_STRETCHTO, "STRETCH_TO", ICON_CONSTRAINT_DATA, "Stretch To", "Stretch along Y-Axis to point towards a target"}, {CONSTRAINT_TYPE_TRACKTO, "TRACK_TO", ICON_CONSTRAINT_DATA, "Track To", "Legacy tracking constraint prone to twisting artifacts"}, {0, "", 0, N_("Relationship"), ""}, - {CONSTRAINT_TYPE_ACTION, "ACTION", ICON_CONSTRAINT_DATA, "Action", + {CONSTRAINT_TYPE_ACTION, "ACTION", ICON_CONSTRAINT_DATA, "Action", "Use transform property of target to look up pose for owner from an Action"}, - {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of", + {CONSTRAINT_TYPE_CHILDOF, "CHILD_OF", ICON_CONSTRAINT_DATA, "Child Of", "Make target the 'detachable' parent of owner"}, - {CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT_DATA, "Floor", + {CONSTRAINT_TYPE_MINMAX, "FLOOR", ICON_CONSTRAINT_DATA, "Floor", "Use position (and optionally rotation) of target to define a 'wall' or 'floor' that the owner can not cross"}, - {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT_DATA, "Follow Path", + {CONSTRAINT_TYPE_FOLLOWPATH, "FOLLOW_PATH", ICON_CONSTRAINT_DATA, "Follow Path", "Use to animate an object/bone following a path"}, - {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot", + {CONSTRAINT_TYPE_PIVOT, "PIVOT", ICON_CONSTRAINT_DATA, "Pivot", "Change pivot point for transforms (buggy)"}, - {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", + {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", "Use to define a Rigid Body Constraint (for Game Engine use only)"}, - /* {CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", + /* {CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", "Custom constraint(s) written in Python (Not yet implemented)"}, */ - {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", + {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", "Restrict movements to surface of target mesh"}, {0, NULL, 0, NULL, NULL} }; @@ -232,23 +232,23 @@ static void rna_Constraint_name_set(PointerRNA *ptr, const char *value) { bConstraint *con = ptr->data; char oldname[sizeof(con->name)]; - + /* make a copy of the old name first */ BLI_strncpy(oldname, con->name, sizeof(con->name)); - + /* copy the new name into the name slot */ BLI_strncpy_utf8(con->name, value, sizeof(con->name)); - + /* make sure name is unique */ if (ptr->id.data) { Object *ob = ptr->id.data; ListBase *list = get_constraint_lb(ob, con, NULL); - + /* if we have the list, check for unique name, otherwise give up */ if (list) BKE_constraint_unique_name(con, list); } - + /* fix all the animation data which may link to this */ BKE_animdata_fix_paths_rename_all(NULL, "constraints", oldname, con->name); } @@ -294,7 +294,7 @@ static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRN if (ob->pose) ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK); - + rna_Constraint_update(bmain, scene, ptr); } @@ -321,7 +321,7 @@ static const EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED { Object *ob = (Object *)ptr->id.data; bConstraint *con = (bConstraint *)ptr->data; - + if (BLI_findindex(&ob->constraints, con) == -1) return owner_space_pchan_items; else /* object */ @@ -335,14 +335,14 @@ static const EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSE const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; - + if (cti && cti->get_constraint_targets) { cti->get_constraint_targets(con, &targets); - + for (ct = targets.first; ct; ct = ct->next) if (ct->tar && ct->tar->type == OB_ARMATURE) break; - + if (cti->flush_constraint_targets) cti->flush_constraint_targets(con, &targets, 1); @@ -387,7 +387,7 @@ static void rna_SplineIKConstraint_joint_bindings_get(PointerRNA *ptr, float *va { bConstraint *con = (bConstraint *)ptr->data; bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data; - + memcpy(values, ikData->points, ikData->numpoints * sizeof(float)); } @@ -395,7 +395,7 @@ static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const flo { bConstraint *con = (bConstraint *)ptr->data; bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data; - + memcpy(ikData->points, values, ikData->numpoints * sizeof(float)); } @@ -511,12 +511,12 @@ static const EnumPropertyItem constraint_distance_items[] = { static void rna_def_constraint_headtail_common(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_bbone_shape", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, "bConstraint", "flag", CONSTRAINT_BBONE_SHAPE); RNA_def_property_ui_text(prop, "Follow B-Bone", "Follow shape of B-Bone segments when calculating Head/Tail position"); @@ -607,13 +607,13 @@ static void rna_def_constraint_childof(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEZ); RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "invmat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Inverse Matrix", "Transformation matrix to apply before"); - + } static void rna_def_constraint_python(BlenderRNA *brna) @@ -1004,7 +1004,7 @@ static void rna_def_constraint_transform_like(BlenderRNA *brna) srna = RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Copy Transforms Constraint", "Copy all the transforms of the target"); - + rna_def_constraint_headtail_common(srna); RNA_def_struct_sdna_from(srna, "bTransLikeConstraint", "data"); @@ -1152,9 +1152,9 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) srna = RNA_def_struct(brna, "LockedTrackConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Locked Track Constraint", "Point toward the target along the track axis, while locking the other axis"); - + rna_def_constraint_headtail_common(srna); - + RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data"); rna_def_constraint_target_common(srna); @@ -1209,7 +1209,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "offset_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "offset_fac"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1232,7 +1232,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_FOLLOW); RNA_def_property_ui_text(prop, "Follow Curve", "Object will follow the heading and banking of the curve"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_fixed_location", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_STATIC); RNA_def_property_ui_text(prop, "Fixed Position", @@ -1405,8 +1405,8 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DRAW_PIVOT); RNA_def_property_ui_text(prop, "Draw Pivot", "Display the pivot point and rotation in 3D view"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - - + + /* Limits */ /* Limit Min/Max */ prop = RNA_def_property(srna, "limit_min_x", PROP_FLOAT, PROP_NONE); @@ -1453,7 +1453,7 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "maxLimit[3]"); RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Maximum Angular Limit X", ""); - + prop = RNA_def_property(srna, "limit_angle_max_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "maxLimit[4]"); RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); @@ -1469,12 +1469,12 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); RNA_def_property_ui_text(prop, "Limit X", "Use minimum/maximum X limit"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 2); RNA_def_property_ui_text(prop, "Limit Y", "Use minimum/maximum y limit"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 4); RNA_def_property_ui_text(prop, "Limit Z", "Use minimum/maximum z limit"); @@ -1484,12 +1484,12 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", 8); RNA_def_property_ui_text(prop, "Angular X Limit", "Use minimum/maximum X angular limit"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_angular_limit_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 16); RNA_def_property_ui_text(prop, "Angular Y Limit", "Use minimum/maximum Y angular limit"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_angular_limit_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 32); RNA_def_property_ui_text(prop, "Angular Z Limit", "Use minimum/maximum Z angular limit"); @@ -2041,9 +2041,9 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) srna = RNA_def_struct(brna, "LimitDistanceConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Limit Distance Constraint", "Limit the distance from target object"); - + rna_def_constraint_headtail_common(srna); - + RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data"); rna_def_constraint_target_common(srna); @@ -2059,7 +2059,7 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) RNA_def_property_enum_items(prop, constraint_distance_items); RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMITDIST_TRANSFORM); RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well"); @@ -2070,7 +2070,7 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem type_items[] = { {MOD_SHRINKWRAP_NEAREST_SURFACE, "NEAREST_SURFACE", 0, "Nearest Surface Point", "Shrink the location to the nearest target surface"}, @@ -2080,24 +2080,24 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) "Shrink the location to the nearest target vertex"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Shrinkwrap Constraint", "Create constraint-based shrinkwrap relationship"); RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data"); - + prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "target"); /* TODO, mesh type */ RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll"); RNA_def_property_ui_text(prop, "Target", "Target Mesh object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - + prop = RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "shrinkType"); RNA_def_property_enum_items(prop, type_items); RNA_def_property_ui_text(prop, "Shrinkwrap Type", "Select type of shrinkwrap algorithm for target position"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0f, FLT_MAX); @@ -2143,9 +2143,9 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna) srna = RNA_def_struct(brna, "DampedTrackConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Damped Track Constraint", "Point toward target by taking the shortest rotation path"); - + rna_def_constraint_headtail_common(srna); - + RNA_def_struct_sdna_from(srna, "bDampTrackConstraint", "data"); rna_def_constraint_target_common(srna); @@ -2161,7 +2161,7 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem splineik_xz_scale_mode[] = { {CONSTRAINT_SPLINEIK_XZS_NONE, "NONE", 0, "None", "Don't scale the X and Z axes (Default)"}, {CONSTRAINT_SPLINEIK_XZS_ORIGINAL, "BONE_ORIGINAL", 0, "Bone Original", @@ -2176,7 +2176,7 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) srna = RNA_def_struct(brna, "SplineIKConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Spline IK Constraint", "Align 'n' bones along a curve"); RNA_def_struct_sdna_from(srna, "bSplineIKConstraint", "data"); - + /* target chain */ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); @@ -2184,7 +2184,7 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Target", "Curve that controls this relationship"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - + prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "chainlen"); /* TODO: this should really check the max length of the chain the constraint is attached to */ @@ -2192,7 +2192,7 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain"); /* XXX: this update goes wrong... needs extra flush? */ RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - + /* direct access to bindings */ /* NOTE: only to be used by experienced users */ prop = RNA_def_property(srna, "joint_bindings", PROP_FLOAT, PROP_FACTOR); @@ -2205,31 +2205,31 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) "(EXPERIENCED USERS ONLY) The relative positions of the joints along the chain, " "as percentages"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + /* settings */ prop = RNA_def_property(srna, "use_chain_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_NO_ROOT); RNA_def_property_ui_text(prop, "Chain Offset", "Offset the entire chain relative to the root joint"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_even_divisions", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_EVENSPLITS); RNA_def_property_ui_text(prop, "Even Divisions", "Ignore the relative lengths of the bones when fitting to the curve"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_y_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_SCALE_LIMITED); RNA_def_property_ui_text(prop, "Y Stretch", "Stretch the Y axis of the bones to fit the curve"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_NO_CURVERAD); RNA_def_property_ui_text(prop, "Use Curve Radius", "Average radius of the endpoints is used to tweak the X and Z Scaling of the bones, " "on top of XZ Scale mode"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + /* xz scaling mode */ prop = RNA_def_property(srna, "xz_scale_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "xzScaleMode"); @@ -2237,33 +2237,33 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) RNA_def_property_ui_text(prop, "XZ Scale Mode", "Method used for determining the scaling of the X and Z axes of the bones"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + /* volume presevation for "volumetric" scale mode */ prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.f); RNA_def_property_ui_text(prop, "Volume Variation", "Factor between volume variation and stretching"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_bulge_min", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_USE_BULGE_MIN); RNA_def_property_ui_text(prop, "Use Volume Variation Minimum", "Use lower limit for volume variation"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "use_bulge_max", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_USE_BULGE_MAX); RNA_def_property_ui_text(prop, "Use Volume Variation Maximum", "Use upper limit for volume variation"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "bulge_min", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_text(prop, "Volume Variation Minimum", "Minimum volume stretching factor"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "bulge_max", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 1.0, 100.0f); RNA_def_property_ui_text(prop, "Volume Variation Maximum", "Maximum volume stretching factor"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "bulge_smooth", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_text(prop, "Volume Variation Smoothness", "Strength of volume stretching clamping"); @@ -2291,37 +2291,37 @@ static void rna_def_constraint_pivot(BlenderRNA *brna) srna = RNA_def_struct(brna, "PivotConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Pivot Constraint", "Rotate around a different point"); - + rna_def_constraint_headtail_common(srna); - + RNA_def_struct_sdna_from(srna, "bPivotConstraint", "data"); - + /* target-defined pivot */ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object, defining the position of the pivot when defined"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - + prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - + /* pivot offset */ prop = RNA_def_property(srna, "use_relative_location", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PIVOTCON_FLAG_OFFSET_ABS); RNA_def_property_ui_text(prop, "Use Relative Offset", "Offset will be an absolute point in space instead of relative to the target"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_ui_text(prop, "Offset", "Offset of pivot from target (when set), or from owner's location " "(when Fixed Position is off), or the absolute pivot point"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); - + /* rotation-based activation */ prop = RNA_def_property(srna, "rotation_range", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotAxis"); @@ -2499,21 +2499,21 @@ void RNA_def_constraint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + /* data */ srna = RNA_def_struct(brna, "Constraint", NULL); RNA_def_struct_ui_text(srna, "Constraint", "Constraint modifying the transformation of objects and bones"); RNA_def_struct_refine_func(srna, "rna_ConstraintType_refine"); RNA_def_struct_path_func(srna, "rna_Constraint_path"); RNA_def_struct_sdna(srna, "bConstraint"); - + /* strings */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constraint_name_set"); RNA_def_property_ui_text(prop, "Name", "Constraint name"); RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT | NA_RENAME, NULL); - + /* enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -2537,7 +2537,7 @@ void RNA_def_constraint(BlenderRNA *brna) prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_OFF); RNA_def_property_ui_text(prop, "Disable", "Enable/Disable Constraint"); - + prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND); RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI"); @@ -2548,17 +2548,17 @@ void RNA_def_constraint(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE); RNA_def_property_ui_text(prop, "Valid", "Constraint has valid settings and can be evaluated"); - + /* TODO: setting this to true must ensure that all others in stack are turned off too... */ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_ACTIVE); RNA_def_property_ui_text(prop, "Active", "Constraint is the one being edited "); - + prop = RNA_def_property(srna, "is_proxy_local", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_PROXY_LOCAL); RNA_def_property_ui_text(prop, "Proxy Local", "Constraint was added in this proxy instance (i.e. did not belong to source Armature)"); - + /* values */ prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "enforce"); diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index bdb3daedebb..96e8878b938 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -168,7 +168,7 @@ static void rna_Controller_state_set(PointerRNA *ptr, const int *values) for (i = 0; i < OB_MAX_STATES; i++) if (values[i]) tot++; - + if (tot == 0) return; @@ -246,7 +246,7 @@ void RNA_def_controller(BlenderRNA *brna) "rna_Controller_actuators_length", NULL, NULL, NULL); /* State */ - + /* array of OB_MAX_STATES */ /*prop = RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER); */ /*RNA_def_property_array(prop, OB_MAX_STATES); */ @@ -307,19 +307,19 @@ void RNA_def_controller(BlenderRNA *brna) /* Other Controllers */ srna = RNA_def_struct(brna, "AndController", "Controller"); RNA_def_struct_ui_text(srna, "And Controller", "Controller passing on events based on a logical AND operation"); - + srna = RNA_def_struct(brna, "OrController", "Controller"); RNA_def_struct_ui_text(srna, "Or Controller", "Controller passing on events based on a logical OR operation"); - + srna = RNA_def_struct(brna, "NorController", "Controller"); RNA_def_struct_ui_text(srna, "Nor Controller", "Controller passing on events based on a logical NOR operation"); - + srna = RNA_def_struct(brna, "NandController", "Controller"); RNA_def_struct_ui_text(srna, "Nand Controller", "Controller passing on events based on a logical NAND operation"); - + srna = RNA_def_struct(brna, "XorController", "Controller"); RNA_def_struct_ui_text(srna, "Xor Controller", "Controller passing on events based on a logical XOR operation"); - + srna = RNA_def_struct(brna, "XnorController", "Controller"); RNA_def_struct_ui_text(srna, "Xnor Controller", "Controller passing on events based on a logical XNOR operation"); } diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 45b312a742d..50abf00714b 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -55,7 +55,7 @@ static const EnumPropertyItem beztriple_handle_type_items[] = { {0, NULL, 0, NULL, NULL} }; #endif - + const EnumPropertyItem rna_enum_keyframe_handle_type_items[] = { {HD_FREE, "FREE", 0, "Free", ""}, {HD_VECT, "VECTOR", 0, "Vector", ""}, @@ -71,7 +71,7 @@ const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[] = { {BEZT_IPO_CONST, "CONSTANT", ICON_IPO_CONSTANT, "Constant", "No interpolation, value of A gets held until B is encountered"}, {BEZT_IPO_LIN, "LINEAR", ICON_IPO_LINEAR, "Linear", "Straight-line interpolation between A and B (i.e. no ease in/out)"}, {BEZT_IPO_BEZ, "BEZIER", ICON_IPO_BEZIER, "Bezier", "Smooth interpolation between A and B, with some control over curve shape"}, - + /* easing */ {0, "", 0, N_("Easing (by strength)"), "Predefined inertial transitions, useful for motion graphics (from least to most ''dramatic'')"}, {BEZT_IPO_SINE, "SINE", ICON_IPO_SINE, "Sinusoidal", "Sinusoidal easing (weakest, almost linear but with a slight curvature)"}, @@ -81,12 +81,12 @@ const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[] = { {BEZT_IPO_QUINT, "QUINT", ICON_IPO_QUINT, "Quintic", "Quintic easing"}, {BEZT_IPO_EXPO, "EXPO", ICON_IPO_EXPO, "Exponential", "Exponential easing (dramatic)"}, {BEZT_IPO_CIRC, "CIRC", ICON_IPO_CIRC, "Circular", "Circular easing (strongest and most dynamic)"}, - + {0, "", 0, N_("Dynamic Effects"), "Simple physics-inspired easing effects"}, {BEZT_IPO_BACK, "BACK", ICON_IPO_BACK, "Back", "Cubic easing with overshoot and settle"}, {BEZT_IPO_BOUNCE, "BOUNCE", ICON_IPO_BOUNCE, "Bounce", "Exponentially decaying parabolic bounce, like when objects collide"}, {BEZT_IPO_ELASTIC, "ELASTIC", ICON_IPO_ELASTIC, "Elastic", "Exponentially decaying sine wave, like an elastic band"}, - + {0, NULL, 0, NULL, NULL} }; @@ -157,7 +157,7 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index, if (nu_index) { *nu_index = i; } - + if (pt_index) { if (nu->type == CU_BEZIER) *pt_index = (int)((BezTriple *)point - nu->bezt); else *pt_index = (int)((BPoint *)point - nu->bp); @@ -171,7 +171,7 @@ static StructRNA *rna_Curve_refine(PointerRNA *ptr) { Curve *cu = (Curve *)ptr->data; short obtype = BKE_curve_type_get(cu); - + if (obtype == OB_FONT) return &RNA_TextCurve; else if (obtype == OB_SURF) return &RNA_SurfaceCurve; else return &RNA_Curve; @@ -216,7 +216,7 @@ static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values) static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Curve *cu = (Curve *)ptr->data; - + if (cu->texflag & CU_AUTOSPACE) BKE_curve_texspace_calc(cu); } @@ -230,34 +230,34 @@ static int rna_Curve_texspace_editable(PointerRNA *ptr, const char **UNUSED(r_in static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values) { Curve *cu = (Curve *)ptr->data; - + if (!cu->bb) BKE_curve_texspace_calc(cu); - + copy_v3_v3(values, cu->loc); } static void rna_Curve_texspace_loc_set(PointerRNA *ptr, const float *values) { Curve *cu = (Curve *)ptr->data; - + copy_v3_v3(cu->loc, values); } static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values) { Curve *cu = (Curve *)ptr->data; - + if (!cu->bb) BKE_curve_texspace_calc(cu); - + copy_v3_v3(values, cu->size); } static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values) { Curve *cu = (Curve *)ptr->data; - + copy_v3_v3(cu->size, values); } @@ -446,7 +446,7 @@ static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, Pointe nu->resolu = cu->resolu; nu = nu->next; } - + rna_Curve_update_data(bmain, scene, ptr); } @@ -898,7 +898,7 @@ static void rna_def_beztriple(BlenderRNA *brna) static void rna_def_path(BlenderRNA *UNUSED(brna), StructRNA *srna) { PropertyRNA *prop; - + /* number values */ prop = RNA_def_property(srna, "path_duration", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pathlen"); @@ -907,18 +907,18 @@ static void rna_def_path(BlenderRNA *UNUSED(brna), StructRNA *srna) "The number of frames that are needed to traverse the path, " "defining the maximum value for the 'Evaluation Time' setting"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + /* flags */ prop = RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_PATH); RNA_def_property_ui_text(prop, "Path", "Enable the curve to become a translation path"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "use_path_follow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FOLLOW); RNA_def_property_ui_text(prop, "Follow", "Make curve path children to rotate along the path"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STRETCH); RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: " @@ -941,7 +941,7 @@ static void rna_def_path(BlenderRNA *UNUSED(brna), StructRNA *srna) static void rna_def_nurbs(BlenderRNA *UNUSED(brna), StructRNA *srna) { PropertyRNA *prop; - + /* flags */ prop = RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO); @@ -990,7 +990,7 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) RNA_def_property_ui_range(prop, 0.01, 10, 1, 3); RNA_def_property_ui_text(prop, "Font size", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "small_caps_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "smallcaps_scale"); RNA_def_property_ui_range(prop, 0, 1.0, 1, 2); @@ -1002,51 +1002,51 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Distance between lines of text", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "space_word", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "wordspace"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Spacing between words", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "space_character", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spacing"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Global spacing between characters", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shear"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Shear", "Italic angle of the characters"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object origin"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object origin"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "underline_position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ulpos"); RNA_def_property_range(prop, -0.2f, 0.8f); RNA_def_property_ui_text(prop, "Underline Position", "Vertical position of underline"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "underline_height", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ulheight"); RNA_def_property_range(prop, 0.0f, 0.8f); RNA_def_property_ui_text(prop, "Underline Thickness", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "text_boxes", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "tb", "totbox"); RNA_def_property_struct_type(prop, "TextBox"); @@ -1056,7 +1056,7 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) RNA_def_property_int_sdna(prop, NULL, "actbox"); RNA_def_property_ui_text(prop, "The active text box", ""); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_active_textbox_index_range"); - + /* strings */ prop = RNA_def_property(srna, "family", PROP_STRING, PROP_NONE); RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2); @@ -1065,7 +1065,7 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) "followed by the character they represent, eg. 'family-a', 'family-b', etc, " "set this setting to 'family-', and turn on Vertex Duplication)"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "str"); RNA_def_property_ui_text(prop, "Body Text", "Content of this text object"); @@ -1077,7 +1077,7 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) RNA_def_property_collection_sdna(prop, NULL, "strinfo", "len_wchar"); RNA_def_property_struct_type(prop, "TextCharacterFormat"); RNA_def_property_ui_text(prop, "Character Info", "Stores the style of each character"); - + /* pointers */ prop = RNA_def_property(srna, "follow_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "textoncurve"); @@ -1085,7 +1085,7 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object"); RNA_def_property_update(prop, 0, "rna_Curve_update_deps"); - + prop = RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "vfont"); RNA_def_property_ui_text(prop, "Font", ""); @@ -1126,10 +1126,10 @@ static void rna_def_textbox(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "TextBox", NULL); RNA_def_struct_ui_text(srna, "Text Box", "Text bounding box for layout"); - + /* number values */ prop = RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "x"); @@ -1137,7 +1137,7 @@ static void rna_def_textbox(BlenderRNA *brna) RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox X Offset", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "y"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); @@ -1158,7 +1158,7 @@ static void rna_def_textbox(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox Height", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + RNA_def_struct_path_func(srna, "rna_TextBox_path"); } @@ -1166,27 +1166,27 @@ static void rna_def_charinfo(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "TextCharacterFormat", NULL); RNA_def_struct_sdna(srna, "CharInfo"); RNA_def_struct_ui_text(srna, "Text Character Format", "Text character formatting settings"); - + /* flags */ prop = RNA_def_property(srna, "use_bold", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_BOLD); RNA_def_property_ui_text(prop, "Bold", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "use_italic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_ITALIC); RNA_def_property_ui_text(prop, "Italic", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "use_underline", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_UNDERLINE); RNA_def_property_ui_text(prop, "Underline", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + /* probably there is no reason to expose this */ #if 0 prop = RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE); @@ -1210,7 +1210,7 @@ static void rna_def_charinfo(BlenderRNA *brna) static void rna_def_surface(BlenderRNA *brna) { StructRNA *srna; - + srna = RNA_def_struct(brna, "SurfaceCurve", "Curve"); RNA_def_struct_sdna(srna, "Curve"); RNA_def_struct_ui_text(srna, "Surface Curve", "Curve data-block used for storing surfaces"); @@ -1222,7 +1222,7 @@ static void rna_def_surface(BlenderRNA *brna) static void rna_def_text(BlenderRNA *brna) { StructRNA *srna; - + srna = RNA_def_struct(brna, "TextCurve", "Curve"); RNA_def_struct_sdna(srna, "Curve"); RNA_def_struct_ui_text(srna, "Text Curve", "Curve data-block used for storing text"); @@ -1333,7 +1333,7 @@ static void rna_def_curve(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem curve_twist_mode_items[] = { {CU_TWIST_Z_UP, "Z_UP", 0, "Z-Up", "Use Z-Up axis to calculate the curve twist at each point"}, {CU_TWIST_MINIMUM, "MINIMUM", 0, "Minimum", "Use the least twist over the entire curve"}, @@ -1390,7 +1390,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL); rna_def_path(brna, srna); - + /* Number values */ prop = RNA_def_property(srna, "bevel_resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "bevresol"); @@ -1399,63 +1399,63 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Bevel Resolution", "Bevel resolution when depth is non-zero and no specific bevel object has been defined"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "width"); RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3); RNA_def_property_float_funcs(prop, "rna_Curve_offset_get", "rna_Curve_offset_set", NULL); RNA_def_property_ui_text(prop, "Offset", "Offset the curve to adjust the width of a text"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "ext1"); RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3); RNA_def_property_range(prop, 0.0, FLT_MAX); RNA_def_property_ui_text(prop, "Extrude", "Amount of curve extrusion when not using a bevel object"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "ext2"); RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3); RNA_def_property_ui_text(prop, "Bevel Depth", "Bevel depth when not using a bevel object"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolu"); RNA_def_property_range(prop, 1, 1024); RNA_def_property_ui_range(prop, 1, 64, 1, -1); RNA_def_property_ui_text(prop, "Resolution U", "Surface resolution in U direction"); RNA_def_property_update(prop, 0, "rna_Curve_resolution_u_update_data"); - + prop = RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolv"); RNA_def_property_ui_range(prop, 1, 64, 1, -1); RNA_def_property_range(prop, 1, 1024); RNA_def_property_ui_text(prop, "Resolution V", "Surface resolution in V direction"); RNA_def_property_update(prop, 0, "rna_Curve_resolution_v_update_data"); - + prop = RNA_def_property(srna, "render_resolution_u", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolu_ren"); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_range(prop, 0, 64, 1, -1); RNA_def_property_ui_text(prop, "Render Resolution U", "Surface resolution in U direction used while rendering (zero uses preview resolution)"); - + prop = RNA_def_property(srna, "render_resolution_v", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolv_ren"); RNA_def_property_ui_range(prop, 0, 64, 1, -1); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_text(prop, "Render Resolution V", "Surface resolution in V direction used while rendering (zero uses preview resolution)"); - - + + prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ctime"); RNA_def_property_ui_text(prop, "Evaluation Time", "Parametric position along the length of the curve that Objects 'following' it should be " "at (position is evaluated by dividing by the 'Path Length' value)"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + /* pointers */ prop = RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); @@ -1483,7 +1483,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_enum_funcs(prop, NULL, "rna_Curve_dimension_set", NULL); RNA_def_property_ui_text(prop, "Dimensions", "Select 2D or 3D curve type"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "fill_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, curve3d_fill_mode_items); @@ -1545,7 +1545,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_editable_func(prop, "rna_Curve_texspace_editable"); RNA_def_property_float_funcs(prop, "rna_Curve_texspace_loc_get", "rna_Curve_texspace_loc_set", NULL); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 3); RNA_def_property_flag(prop, PROP_PROPORTIONAL); @@ -1553,7 +1553,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_editable_func(prop, "rna_Curve_texspace_editable"); RNA_def_property_float_funcs(prop, "rna_Curve_texspace_size_get", "rna_Curve_texspace_size_set", NULL); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + /* not supported yet */ #if 0 prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); @@ -1562,12 +1562,12 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_editable_func(prop, texspace_editable); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); #endif - + prop = RNA_def_property(srna, "use_uv_as_generated", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO); RNA_def_property_ui_text(prop, "Use UV for mapping", "Uses the UV values as Generated textured coordinates"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + /* materials */ prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); @@ -1631,7 +1631,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points for Bezier curves only"); rna_def_curve_spline_bezpoints(brna, prop); - + prop = RNA_def_property(srna, "tilt_interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "tilt_interp"); RNA_def_property_enum_items(prop, spline_interpolation_items); @@ -1750,7 +1750,7 @@ static void rna_def_curve_nurb(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Material Index", ""); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_material_index_range"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + prop = RNA_def_property(srna, "character_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "charidx"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* editing this needs knot recalc*/ diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index c8a6a503fd9..2177c7b980a 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -128,12 +128,12 @@ void rna_freelinkN(ListBase *listbase, void *vlink) void rna_freelistN(ListBase *listbase) { Link *link, *next; - + for (link = listbase->first; link; link = next) { next = link->next; MEM_freeN(link); } - + listbase->first = listbase->last = NULL; } @@ -335,13 +335,13 @@ typedef struct DNAStructMember { static int rna_member_cmp(const char *name, const char *oname) { int a = 0; - + /* compare without pointer or array part */ while (name[0] == '*') name++; while (oname[0] == '*') oname++; - + while (1) { if (name[a] == '[' && oname[a] == 0) return 1; if (name[a] == '[' && oname[a] == '[') return 1; @@ -419,7 +419,7 @@ static int rna_find_sdna_member(SDNA *sdna, const char *structname, const char * static int rna_validate_identifier(const char *identifier, char *error, bool property) { int a = 0; - + /* list is from... * ", ".join(['"%s"' % kw for kw in __import__("keyword").kwlist if kw not in {"False", "None", "True"}]) */ @@ -431,13 +431,13 @@ static int rna_validate_identifier(const char *identifier, char *error, bool pro "is", "lambda", "nonlocal", "not", "or", "pass", "raise", "return", "try", "while", "with", "yield", NULL }; - - + + if (!isalpha(identifier[0])) { strcpy(error, "first character failed isalpha() check"); return 0; } - + for (a = 0; identifier[a]; a++) { if (DefRNA.preprocess && property) { if (isalpha(identifier[a]) && isupper(identifier[a])) { @@ -445,7 +445,7 @@ static int rna_validate_identifier(const char *identifier, char *error, bool pro return 0; } } - + if (identifier[a] == '_') { continue; } @@ -460,7 +460,7 @@ static int rna_validate_identifier(const char *identifier, char *error, bool pro return 0; } } - + for (a = 0; kwlist[a]; a++) { if (STREQ(identifier, kwlist[a])) { strcpy(error, "this keyword is reserved by python"); @@ -482,14 +482,14 @@ static int rna_validate_identifier(const char *identifier, char *error, bool pro } } } - + return 1; } void RNA_identifier_sanitize(char *identifier, int property) { int a = 0; - + /* list from http://docs.python.org/py3k/reference/lexical_analysis.html#keywords */ static const char *kwlist[] = { /* "False", "None", "True", */ @@ -499,13 +499,13 @@ void RNA_identifier_sanitize(char *identifier, int property) "is", "lambda", "nonlocal", "not", "or", "pass", "raise", "return", "try", "while", "with", "yield", NULL }; - - + + if (!isalpha(identifier[0])) { /* first character failed isalpha() check */ identifier[0] = '_'; } - + for (a = 0; identifier[a]; a++) { if (DefRNA.preprocess && property) { if (isalpha(identifier[a]) && isupper(identifier[a])) { @@ -513,7 +513,7 @@ void RNA_identifier_sanitize(char *identifier, int property) identifier[a] = tolower(identifier[a]); } } - + if (identifier[a] == '_') { continue; } @@ -528,7 +528,7 @@ void RNA_identifier_sanitize(char *identifier, int property) identifier[a] = '_'; } } - + for (a = 0; kwlist[a]; a++) { if (STREQ(identifier, kwlist[a])) { /* this keyword is reserved by python. @@ -703,7 +703,7 @@ void RNA_free(BlenderRNA *brna) } rna_freelistN(&brna->structs); - + MEM_freeN(brna); } else { @@ -1078,13 +1078,13 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier if (DefRNA.preprocess) { char error[512]; - + if (rna_validate_identifier(identifier, error, true) == 0) { fprintf(stderr, "%s: property identifier \"%s.%s\" - %s\n", __func__, CONTAINER_RNA_ID(cont), identifier, error); DefRNA.error = 1; } - + dcont = rna_find_container_def(cont); /* XXX - toto, detect supertype collisions */ @@ -1198,7 +1198,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier if (type != PROP_COLLECTION && type != PROP_POINTER) { prop->flag = PROP_EDITABLE; - + if (type != PROP_STRING) { #ifdef RNA_RUNTIME prop->flag |= PROP_ANIMATABLE; @@ -1364,7 +1364,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le { StructRNA *srna = DefRNA.laststruct; int i; - + if (dimension < 1 || dimension > RNA_MAX_ARRAY_DIMENSION) { fprintf(stderr, "%s: \"%s.%s\", array dimension must be between 1 and %d.\n", __func__, srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION); @@ -1876,7 +1876,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru prop->arraydimension = 0; prop->totarraylength = 0; } - + dp->dnastructname = structname; dp->dnastructfromname = ds->dnafromname; dp->dnastructfromprop = ds->dnafromprop; @@ -1892,7 +1892,7 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, co { PropertyDefRNA *dp; StructRNA *srna = DefRNA.laststruct; - + if (!DefRNA.preprocess) { fprintf(stderr, "%s: only during preprocessing.\n", __func__); return; @@ -1938,7 +1938,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const PropertyDefRNA *dp; IntPropertyRNA *iprop = (IntPropertyRNA *)prop; StructRNA *srna = DefRNA.laststruct; - + if (!DefRNA.preprocess) { fprintf(stderr, "%s: only during preprocessing.\n", __func__); return; @@ -2028,7 +2028,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const { /* PropertyDefRNA *dp; */ StructRNA *srna = DefRNA.laststruct; - + if (!DefRNA.preprocess) { fprintf(stderr, "%s: only during preprocessing.\n", __func__); return; @@ -2096,7 +2096,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co { /* PropertyDefRNA *dp; */ StructRNA *srna = DefRNA.laststruct; - + if (!DefRNA.preprocess) { fprintf(stderr, "%s: only during preprocessing.\n", __func__); return; @@ -2629,7 +2629,7 @@ PropertyRNA *RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, { ContainerRNA *cont = cont_; PropertyRNA *prop; - + prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_default(prop, default_value); RNA_def_property_ui_text(prop, ui_name, ui_description); @@ -2642,7 +2642,7 @@ PropertyRNA *RNA_def_boolean_array(StructOrFunctionRNA *cont_, const char *ident { ContainerRNA *cont = cont_; PropertyRNA *prop; - + prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_NONE); if (len != 0) RNA_def_property_array(prop, len); if (default_value) RNA_def_property_boolean_array_default(prop, default_value); @@ -2656,7 +2656,7 @@ PropertyRNA *RNA_def_boolean_layer(StructOrFunctionRNA *cont_, const char *ident { ContainerRNA *cont = cont_; PropertyRNA *prop; - + prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_LAYER); if (len != 0) RNA_def_property_array(prop, len); if (default_value) RNA_def_property_boolean_array_default(prop, default_value); @@ -2670,7 +2670,7 @@ PropertyRNA *RNA_def_boolean_layer_member(StructOrFunctionRNA *cont_, const char { ContainerRNA *cont = cont_; PropertyRNA *prop; - + prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_LAYER_MEMBER); if (len != 0) RNA_def_property_array(prop, len); if (default_value) RNA_def_property_boolean_array_default(prop, default_value); @@ -2684,7 +2684,7 @@ PropertyRNA *RNA_def_boolean_vector(StructOrFunctionRNA *cont_, const char *iden { ContainerRNA *cont = cont_; PropertyRNA *prop; - + prop = RNA_def_property(cont, identifier, PROP_BOOLEAN, PROP_XYZ); /* XXX */ if (len != 0) RNA_def_property_array(prop, len); if (default_value) RNA_def_property_boolean_array_default(prop, default_value); @@ -2699,7 +2699,7 @@ PropertyRNA *RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int { ContainerRNA *cont = cont_; PropertyRNA *prop; - + ASSERT_SOFT_HARD_LIMITS; prop = RNA_def_property(cont, identifier, PROP_INT, PROP_NONE); @@ -2717,7 +2717,7 @@ PropertyRNA *RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifi { ContainerRNA *cont = cont_; PropertyRNA *prop; - + ASSERT_SOFT_HARD_LIMITS; prop = RNA_def_property(cont, identifier, PROP_INT, PROP_XYZ); /* XXX */ @@ -2736,7 +2736,7 @@ PropertyRNA *RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifie { ContainerRNA *cont = cont_; PropertyRNA *prop; - + ASSERT_SOFT_HARD_LIMITS; prop = RNA_def_property(cont, identifier, PROP_INT, PROP_NONE); @@ -2823,7 +2823,7 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, co printf("%s: items not allowed to be NULL.\n", __func__); return NULL; } - + prop = RNA_def_property(cont, identifier, PROP_ENUM, PROP_NONE); if (items) RNA_def_property_enum_items(prop, items); RNA_def_property_enum_default(prop, default_value); @@ -2865,7 +2865,7 @@ PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, f { ContainerRNA *cont = cont_; PropertyRNA *prop; - + ASSERT_SOFT_HARD_LIMITS; prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_NONE); @@ -2883,7 +2883,7 @@ PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identi { ContainerRNA *cont = cont_; PropertyRNA *prop; - + ASSERT_SOFT_HARD_LIMITS; prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_XYZ); @@ -2901,7 +2901,7 @@ PropertyRNA *RNA_def_float_vector_xyz(StructOrFunctionRNA *cont_, const char *id const char *ui_description, float softmin, float softmax) { PropertyRNA *prop; - + prop = RNA_def_float_vector(cont_, identifier, len, default_value, hardmin, hardmax, ui_name, ui_description, softmin, softmax); prop->subtype = PROP_XYZ_LENGTH; @@ -2915,7 +2915,7 @@ PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identif { ContainerRNA *cont = cont_; PropertyRNA *prop; - + ASSERT_SOFT_HARD_LIMITS; prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_COLOR); @@ -2992,7 +2992,7 @@ PropertyRNA *RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identif { ContainerRNA *cont = cont_; PropertyRNA *prop; - + ASSERT_SOFT_HARD_LIMITS; prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_NONE); @@ -3011,7 +3011,7 @@ PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont_, const char *id { ContainerRNA *cont = cont_; PropertyRNA *prop; - + ASSERT_SOFT_HARD_LIMITS; prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_PERCENTAGE); @@ -3029,7 +3029,7 @@ PropertyRNA *RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identi { ContainerRNA *cont = cont_; PropertyRNA *prop; - + ASSERT_SOFT_HARD_LIMITS; prop = RNA_def_property(cont, identifier, PROP_FLOAT, PROP_FACTOR); @@ -3046,7 +3046,7 @@ PropertyRNA *RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, { ContainerRNA *cont = cont_; PropertyRNA *prop; - + prop = RNA_def_property(cont, identifier, PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, type); RNA_def_property_ui_text(prop, ui_name, ui_description); @@ -3059,7 +3059,7 @@ PropertyRNA *RNA_def_pointer_runtime(StructOrFunctionRNA *cont_, const char *ide { ContainerRNA *cont = cont_; PropertyRNA *prop; - + prop = RNA_def_property(cont, identifier, PROP_POINTER, PROP_NONE); RNA_def_property_struct_runtime(prop, type); if ((type->flag & STRUCT_ID) != 0) { @@ -3075,7 +3075,7 @@ PropertyRNA *RNA_def_collection(StructOrFunctionRNA *cont_, const char *identifi { ContainerRNA *cont = cont_; PropertyRNA *prop; - + prop = RNA_def_property(cont, identifier, PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, type); RNA_def_property_ui_text(prop, ui_name, ui_description); @@ -3088,7 +3088,7 @@ PropertyRNA *RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char * { ContainerRNA *cont = cont_; PropertyRNA *prop; - + prop = RNA_def_property(cont, identifier, PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_runtime(prop, type); RNA_def_property_ui_text(prop, ui_name, ui_description); @@ -3545,7 +3545,7 @@ void RNA_def_property_free_pointers(PropertyRNA *prop) static void rna_def_property_free(StructOrFunctionRNA *cont_, PropertyRNA *prop) { ContainerRNA *cont = cont_; - + if (prop->flag_internal & PROP_INTERN_RUNTIME) { if (cont->prophash) BLI_ghash_remove(cont->prophash, prop->identifier, NULL, NULL); @@ -3563,7 +3563,7 @@ int RNA_def_property_free_identifier(StructOrFunctionRNA *cont_, const char *ide { ContainerRNA *cont = cont_; PropertyRNA *prop; - + for (prop = cont->properties.first; prop; prop = prop->next) { if (STREQ(prop->identifier, identifier)) { if (prop->flag_internal & PROP_INTERN_RUNTIME) { diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c index 94fda7097ee..99090d9d184 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -437,7 +437,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) prop = RNA_def_property(srna, "use_dissolve", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE); RNA_def_property_ui_text(prop, "Dissolve", "Enable to make surface changes disappear over time"); - + prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "diss_speed"); RNA_def_property_range(prop, 1.0, 10000.0); @@ -447,12 +447,12 @@ static void rna_def_canvas_surface(BlenderRNA *brna) prop = RNA_def_property(srna, "use_drying", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_DRYING); RNA_def_property_ui_text(prop, "Dry", "Enable to make surface wetness dry over time"); - + prop = RNA_def_property(srna, "dry_speed", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1.0, 10000.0); RNA_def_property_ui_range(prop, 1.0, 10000.0, 5, -1); RNA_def_property_ui_text(prop, "Dry Speed", "Approximately in how many frames should drying happen"); - + /* * Simulation settings */ @@ -461,12 +461,12 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_range(prop, 16.0, 4096.0); RNA_def_property_ui_range(prop, 16.0, 4096.0, 1, -1); RNA_def_property_ui_text(prop, "Resolution", "Output image resolution"); - + prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); RNA_def_property_ui_text(prop, "UV Map", "UV map name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DynamicPaint_uvlayer_set"); - + prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "start_frame"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -474,7 +474,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1.0, 9999, 1, -1); RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); - + prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "end_frame"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -482,13 +482,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1.0, 9999.0, 1, -1); RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); - + prop = RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "substeps"); RNA_def_property_range(prop, 0.0, 20.0); RNA_def_property_ui_range(prop, 0.0, 10, 1, -1); RNA_def_property_ui_text(prop, "Sub-Steps", "Do extra frames between scene frames to ensure smooth motion"); - + prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ANTIALIAS); @@ -541,7 +541,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, prop_dynamicpaint_effecttype); RNA_def_property_ui_text(prop, "Effect Type", ""); - + prop = RNA_def_property(srna, "use_dry_log", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DRY_LOG); RNA_def_property_ui_text(prop, "Slow", "Use logarithmic drying (makes high values to dry faster than low values)"); @@ -550,13 +550,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISSOLVE_LOG); RNA_def_property_ui_text(prop, "Slow", "Use logarithmic dissolve (makes high values to fade faster than low values)"); - + prop = RNA_def_property(srna, "use_spread", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SPREAD); RNA_def_property_ui_text(prop, "Use Spread", "Process spread effect (spread wet paint around surface)"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); - + prop = RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spread_speed"); RNA_def_property_range(prop, 0.001, 10.0); @@ -574,19 +574,19 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_ui_range(prop, 0.0, 2.0, 1, 2); RNA_def_property_ui_text(prop, "Color Spread", "How fast colors get mixed within wet paint"); - + prop = RNA_def_property(srna, "use_drip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_DRIP); RNA_def_property_ui_text(prop, "Use Drip", "Process drip effect (drip wet paint to gravity direction)"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); - + prop = RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SHRINK); RNA_def_property_ui_text(prop, "Use Shrink", "Process shrink effect (shrink paint areas)"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); - + prop = RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shrink_speed"); RNA_def_property_range(prop, 0.001, 10.0); @@ -617,7 +617,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_MULALPHA); RNA_def_property_ui_text(prop, "Premultiply alpha", "Multiply color by alpha (recommended for Blender input)"); - + prop = RNA_def_property(srna, "image_output_path", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "image_output_path"); RNA_def_property_ui_text(prop, "Output Path", "Directory to save the textures"); @@ -657,7 +657,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) /* return type */ parm = RNA_def_boolean(func, "exists", 0, "", ""); RNA_def_function_return(func, parm); - + prop = RNA_def_property(srna, "depth_clamp", PROP_FLOAT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.00, 50.0); @@ -673,12 +673,12 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_ui_range(prop, -5.0, 5.0, 1, 2); RNA_def_property_ui_text(prop, "Displace Factor", "Strength of displace when applied to the mesh"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + prop = RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, prop_dynamicpaint_image_fileformat); RNA_def_property_ui_text(prop, "File Format", ""); - + prop = RNA_def_property(srna, "displace_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "disp_type"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -823,7 +823,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_MATERIAL); RNA_def_property_ui_text(prop, "Use object material", "Use object material to define color and influence"); @@ -835,12 +835,12 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) "Material to use (if not defined, material linked to the mesh is used)"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + prop = RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA); RNA_def_property_ui_text(prop, "Absolute Alpha", "Only increase alpha value if paint alpha is higher than existing"); - + prop = RNA_def_property(srna, "paint_wetness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "wetness"); RNA_def_property_range(prop, 0.0, 1.0); @@ -848,7 +848,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness, visible in wetmap (some effects only affect wet paint)"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + prop = RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE); RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it"); @@ -901,7 +901,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR); RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + /* * Paint Area / Collision */ @@ -911,7 +911,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype); RNA_def_property_ui_text(prop, "Paint Source", ""); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + prop = RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "paint_distance"); RNA_def_property_range(prop, 0.0, 500.0); @@ -919,19 +919,19 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + prop = RNA_def_property(srna, "use_proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_RAMP_ALPHA); RNA_def_property_ui_text(prop, "Only Use Alpha", "Only read color ramp alpha"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + prop = RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff"); RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff); RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + prop = RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT); RNA_def_property_ui_text(prop, "Project", @@ -955,7 +955,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_NEGATE_VOLUME); RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + /* * Particle @@ -967,12 +967,12 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Particle Systems", "The particle system to paint with"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_reset_dependency"); - + prop = RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PART_RAD); RNA_def_property_ui_text(prop, "Use Particle Radius", "Use radius from particle settings"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + prop = RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "particle_radius"); RNA_def_property_range(prop, 0.01, 10.0); @@ -986,7 +986,7 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0, 1.0, 5, -1); RNA_def_property_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid radius"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); - + /* * Color ramps diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index c8ee6e15689..6c1d67b404c 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -85,7 +85,7 @@ const EnumPropertyItem rna_enum_beztriple_interpolation_easing_items[] = { {BEZT_IPO_EASE_AUTO, "AUTO", ICON_IPO_EASE_IN_OUT, "Automatic Easing", "Easing type is chosen automatically based on what the type of interpolation used " "(e.g. 'Ease In' for transitional types, and 'Ease Out' for dynamic effects)"}, - + {BEZT_IPO_EASE_IN, "EASE_IN", ICON_IPO_EASE_IN, "Ease In", "Only on the end closest to the next keyframe"}, {BEZT_IPO_EASE_OUT, "EASE_OUT", ICON_IPO_EASE_OUT, "Ease Out", "Only on the end closest to the first keyframe"}, {BEZT_IPO_EASE_IN_OUT, "EASE_IN_OUT", ICON_IPO_EASE_IN_OUT, "Ease In and Out", "Segment between both keyframes"}, @@ -136,21 +136,21 @@ static void rna_ChannelDriver_update_data(Main *bmain, Scene *scene, PointerRNA ChannelDriver *driver = ptr->data; driver->flag &= ~DRIVER_FLAG_INVALID; - + /* TODO: this really needs an update guard... */ DAG_relations_tag_update(bmain); DAG_id_tag_update(id, OB_RECALC_OB | OB_RECALC_DATA); - + WM_main_add_notifier(NC_SCENE | ND_FRAME, scene); } static void rna_ChannelDriver_update_expr(Main *bmain, Scene *scene, PointerRNA *ptr) { ChannelDriver *driver = ptr->data; - + /* tag driver as needing to be recompiled */ driver->flag |= DRIVER_FLAG_RECOMPILE; - + /* update_data() clears invalid flag and schedules for updates */ rna_ChannelDriver_update_data(bmain, scene, ptr); } @@ -166,7 +166,7 @@ static void rna_DriverTarget_update_data(Main *bmain, Scene *scene, PointerRNA * for (fcu = adt->drivers.first; fcu; fcu = fcu->next) { driver = fcu->driver; fcu->flag &= ~FCURVE_DISABLED; - + if (driver) { /* FIXME: need to be able to search targets for required one... */ /*BLI_findindex(&driver->targets, ptr->data) != -1) */ @@ -210,7 +210,7 @@ static int rna_DriverTarget_id_editable(PointerRNA *ptr, const char **UNUSED(r_i static int rna_DriverTarget_id_type_editable(PointerRNA *ptr, const char **UNUSED(r_info)) { DriverTarget *dtar = (DriverTarget *)ptr->data; - + /* when the id-type can only be object, don't allow editing * otherwise, there may be strange crashes */ @@ -220,7 +220,7 @@ static int rna_DriverTarget_id_type_editable(PointerRNA *ptr, const char **UNUSE static void rna_DriverTarget_id_type_set(PointerRNA *ptr, int value) { DriverTarget *data = (DriverTarget *)(ptr->data); - + /* check if ID-type is settable */ if ((data->flag & DTAR_FLAG_ID_OB_ONLY) == 0) { /* change ID-type to the new type */ @@ -230,7 +230,7 @@ static void rna_DriverTarget_id_type_set(PointerRNA *ptr, int value) /* make sure ID-type is Object */ data->idtype = ID_OB; } - + /* clear the id-block if the type is invalid */ if ((data->id) && (GS(data->id->name) != data->idtype)) data->id = NULL; @@ -249,7 +249,7 @@ static void rna_DriverTarget_RnaPath_get(PointerRNA *ptr, char *value) static int rna_DriverTarget_RnaPath_length(PointerRNA *ptr) { DriverTarget *dtar = (DriverTarget *)ptr->data; - + if (dtar->rna_path) return strlen(dtar->rna_path); else @@ -259,11 +259,11 @@ static int rna_DriverTarget_RnaPath_length(PointerRNA *ptr) static void rna_DriverTarget_RnaPath_set(PointerRNA *ptr, const char *value) { DriverTarget *dtar = (DriverTarget *)ptr->data; - + /* XXX in this case we need to be very careful, as this will require some new dependencies to be added! */ if (dtar->rna_path) MEM_freeN(dtar->rna_path); - + if (value[0]) dtar->rna_path = BLI_strdup(value); else @@ -273,7 +273,7 @@ static void rna_DriverTarget_RnaPath_set(PointerRNA *ptr, const char *value) static void rna_DriverVariable_type_set(PointerRNA *ptr, int value) { DriverVar *dvar = (DriverVar *)ptr->data; - + /* call the API function for this */ driver_change_variable_type(dvar, value); } @@ -281,7 +281,7 @@ static void rna_DriverVariable_type_set(PointerRNA *ptr, int value) void rna_DriverVariable_name_set(PointerRNA *ptr, const char *value) { DriverVar *data = (DriverVar *)(ptr->data); - + BLI_strncpy_utf8(data->name, value, 64); driver_variable_name_validate(data); } @@ -312,7 +312,7 @@ static void rna_Driver_remove_variable(ChannelDriver *driver, ReportList *report static void rna_FKeyframe_handle1_get(PointerRNA *ptr, float *values) { BezTriple *bezt = (BezTriple *)ptr->data; - + values[0] = bezt->vec[0][0]; values[1] = bezt->vec[0][1]; } @@ -320,7 +320,7 @@ static void rna_FKeyframe_handle1_get(PointerRNA *ptr, float *values) static void rna_FKeyframe_handle1_set(PointerRNA *ptr, const float *values) { BezTriple *bezt = (BezTriple *)ptr->data; - + bezt->vec[0][0] = values[0]; bezt->vec[0][1] = values[1]; } @@ -328,7 +328,7 @@ static void rna_FKeyframe_handle1_set(PointerRNA *ptr, const float *values) static void rna_FKeyframe_handle2_get(PointerRNA *ptr, float *values) { BezTriple *bezt = (BezTriple *)ptr->data; - + values[0] = bezt->vec[2][0]; values[1] = bezt->vec[2][1]; } @@ -336,7 +336,7 @@ static void rna_FKeyframe_handle2_get(PointerRNA *ptr, float *values) static void rna_FKeyframe_handle2_set(PointerRNA *ptr, const float *values) { BezTriple *bezt = (BezTriple *)ptr->data; - + bezt->vec[2][0] = values[0]; bezt->vec[2][1] = values[1]; } @@ -344,7 +344,7 @@ static void rna_FKeyframe_handle2_set(PointerRNA *ptr, const float *values) static void rna_FKeyframe_ctrlpoint_get(PointerRNA *ptr, float *values) { BezTriple *bezt = (BezTriple *)ptr->data; - + values[0] = bezt->vec[1][0]; values[1] = bezt->vec[1][1]; } @@ -352,7 +352,7 @@ static void rna_FKeyframe_ctrlpoint_get(PointerRNA *ptr, float *values) static void rna_FKeyframe_ctrlpoint_set(PointerRNA *ptr, const float *values) { BezTriple *bezt = (BezTriple *)ptr->data; - + bezt->vec[1][0] = values[0]; bezt->vec[1][1] = values[1]; } @@ -372,7 +372,7 @@ static void rna_FCurve_RnaPath_get(PointerRNA *ptr, char *value) static int rna_FCurve_RnaPath_length(PointerRNA *ptr) { FCurve *fcu = (FCurve *)ptr->data; - + if (fcu->rna_path) return strlen(fcu->rna_path); else @@ -385,7 +385,7 @@ static void rna_FCurve_RnaPath_set(PointerRNA *ptr, const char *value) if (fcu->rna_path) MEM_freeN(fcu->rna_path); - + if (value[0]) { fcu->rna_path = BLI_strdup(value); fcu->flag &= ~FCURVE_DISABLED; @@ -400,7 +400,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value) ID *vid = (ID *)value.id.data; FCurve *fcu = ptr->data; bAction *act = NULL; - + /* get action */ if (ELEM(NULL, pid, vid)) { printf("ERROR: one of the ID's for the groups to assign to is invalid (ptr=%p, val=%p)\n", pid, vid); @@ -411,7 +411,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value) printf("ERROR: ID's differ - ptr=%p vs value=%p\n", pid, vid); return; } - + if (GS(pid->name) == ID_AC && GS(vid->name) == ID_AC) { /* the ID given is the action already - usually when F-Curve is obtained from an action's pointer */ act = (bAction *)pid; @@ -421,14 +421,14 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value) AnimData *adt = BKE_animdata_from_id(ptr->id.data); act = (adt) ? adt->action : NULL; } - + /* already belongs to group? */ if (fcu->grp == value.data) { /* nothing to do */ printf("ERROR: F-Curve already belongs to this group\n"); return; } - + /* can only change group if we have info about the action the F-Curve is in * (i.e. for drivers or random F-Curves, this cannot be done) */ @@ -442,10 +442,10 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value) printf("ERROR: F-Curve (%p) doesn't exist in action '%s'\n", fcu, act->id.name); return; } - + /* try to remove F-Curve from action (including from any existing groups) */ action_groups_remove_channel(act, fcu); - + /* add the F-Curve back to the action now in the right place */ /* TODO: make the api function handle the case where there isn't any group to assign to */ if (value.data) { @@ -521,10 +521,10 @@ static void rna_FModifier_active_set(PointerRNA *ptr, int UNUSED(value)) static void rna_FModifier_start_frame_set(PointerRNA *ptr, float value) { FModifier *fcm = (FModifier *)ptr->data; - + CLAMP(value, MINAFRAMEF, MAXFRAMEF); fcm->sfra = value; - + /* XXX: maintain old offset? */ if (fcm->sfra >= fcm->efra) { fcm->efra = fcm->sfra; @@ -534,10 +534,10 @@ static void rna_FModifier_start_frame_set(PointerRNA *ptr, float value) static void rna_FModifer_end_frame_set(PointerRNA *ptr, float value) { FModifier *fcm = (FModifier *)ptr->data; - + CLAMP(value, MINAFRAMEF, MAXFRAMEF); fcm->efra = value; - + /* XXX: maintain old offset? */ if (fcm->efra <= fcm->sfra) { fcm->sfra = fcm->efra; @@ -548,11 +548,11 @@ static void rna_FModifier_start_frame_range(PointerRNA *UNUSED(ptr), float *min, float *UNUSED(softmin), float *UNUSED(softmax)) { // FModifier *fcm = (FModifier *)ptr->data; - - /* Technically, "sfra <= efra" must hold; however, we can't strictly enforce that, - * or else it becomes tricky to adjust the range... [#36844] - * - * NOTE: we do not set soft-limits on lower bounds, as it's too confusing when you + + /* Technically, "sfra <= efra" must hold; however, we can't strictly enforce that, + * or else it becomes tricky to adjust the range... [#36844] + * + * NOTE: we do not set soft-limits on lower bounds, as it's too confusing when you * can't easily use the slider to set things here */ *min = MINAFRAMEF; @@ -563,13 +563,13 @@ static void rna_FModifier_end_frame_range(PointerRNA *ptr, float *min, float *ma float *softmin, float *softmax) { FModifier *fcm = (FModifier *)ptr->data; - - /* Technically, "sfra <= efra" must hold; however, we can't strictly enforce that, - * or else it becomes tricky to adjust the range... [#36844] + + /* Technically, "sfra <= efra" must hold; however, we can't strictly enforce that, + * or else it becomes tricky to adjust the range... [#36844] */ *min = MINAFRAMEF; *softmin = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT) ? fcm->sfra : MINAFRAMEF; - + *softmax = MAXFRAMEF; *max = MAXFRAMEF; } @@ -656,9 +656,9 @@ static void rna_FModifierLimits_minx_set(PointerRNA *ptr, float value) { FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; - + data->rect.xmin = value; - + if (data->rect.xmin >= data->rect.xmax) { data->rect.xmax = data->rect.xmin; } @@ -668,9 +668,9 @@ static void rna_FModifierLimits_maxx_set(PointerRNA *ptr, float value) { FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; - + data->rect.xmax = value; - + if (data->rect.xmax <= data->rect.xmin) { data->rect.xmin = data->rect.xmax; } @@ -680,9 +680,9 @@ static void rna_FModifierLimits_miny_set(PointerRNA *ptr, float value) { FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; - + data->rect.ymin = value; - + if (data->rect.ymin >= data->rect.ymax) { data->rect.ymax = data->rect.ymin; } @@ -692,9 +692,9 @@ static void rna_FModifierLimits_maxy_set(PointerRNA *ptr, float value) { FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; - + data->rect.ymax = value; - + if (data->rect.ymax <= data->rect.ymin) { data->rect.ymin = data->rect.ymax; } @@ -705,7 +705,7 @@ static void rna_FModifierLimits_minx_range(PointerRNA *UNUSED(ptr), float *min, { // FModifier *fcm = (FModifier *)ptr->data; // FMod_Limits *data = fcm->data; - + /* no soft-limits on lower bound - it's too confusing when you can't easily use the slider to set things here */ *min = MINAFRAMEF; *max = MAXFRAMEF; @@ -716,10 +716,10 @@ static void rna_FModifierLimits_maxx_range(PointerRNA *ptr, float *min, float *m { FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; - + *min = MINAFRAMEF; *softmin = (data->flag & FCM_LIMIT_XMIN) ? data->rect.xmin : MINAFRAMEF; - + *softmax = MAXFRAMEF; *max = MAXFRAMEF; } @@ -729,7 +729,7 @@ static void rna_FModifierLimits_miny_range(PointerRNA *UNUSED(ptr), float *min, { // FModifier *fcm = (FModifier *)ptr->data; // FMod_Limits *data = fcm->data; - + /* no soft-limits on lower bound - it's too confusing when you can't easily use the slider to set things here */ *min = -FLT_MAX; *max = FLT_MAX; @@ -740,12 +740,12 @@ static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *m { FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; - + *min = -FLT_MAX; *softmin = (data->flag & FCM_LIMIT_YMIN) ? data->rect.ymin : -FLT_MAX; - + *softmax = FLT_MAX; - *max = FLT_MAX; + *max = FLT_MAX; } @@ -754,7 +754,7 @@ static void rna_FModifierStepped_start_frame_range(PointerRNA *ptr, float *min, { FModifier *fcm = (FModifier *)ptr->data; FMod_Stepped *data = fcm->data; - + *min = MINAFRAMEF; *max = (data->flag & FCM_STEPPED_NO_AFTER) ? data->end_frame : MAXFRAMEF; } @@ -773,12 +773,12 @@ static void rna_FModifierStepped_frame_start_set(PointerRNA *ptr, float value) { FModifier *fcm = (FModifier *)ptr->data; FMod_Stepped *data = fcm->data; - + float prop_clamp_min = -FLT_MAX, prop_clamp_max = FLT_MAX, prop_soft_min, prop_soft_max; rna_FModifierStepped_start_frame_range(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max); value = CLAMPIS(value, prop_clamp_min, prop_clamp_max); - - /* Need to set both step-data's start/end and the start/end on the base-data, + + /* Need to set both step-data's start/end and the start/end on the base-data, * or else Restrict-Range doesn't work due to RNA-property shadowing (T52009) */ data->start_frame = value; @@ -789,12 +789,12 @@ static void rna_FModifierStepped_frame_end_set(PointerRNA *ptr, float value) { FModifier *fcm = (FModifier *)ptr->data; FMod_Stepped *data = fcm->data; - + float prop_clamp_min = -FLT_MAX, prop_clamp_max = FLT_MAX, prop_soft_min, prop_soft_max; rna_FModifierStepped_end_frame_range(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max); value = CLAMPIS(value, prop_clamp_min, prop_clamp_max); - - /* Need to set both step-data's start/end and the start/end on the base-data, + + /* Need to set both step-data's start/end and the start/end on the base-data, * or else Restrict-Range doesn't work due to RNA-property shadowing (T52009) */ data->end_frame = value; @@ -813,10 +813,10 @@ static void rna_FKeyframe_points_add(FCurve *fcu, int tot) BezTriple *bezt; fcu->bezt = MEM_recallocN(fcu->bezt, sizeof(BezTriple) * (fcu->totvert + tot)); - + bezt = fcu->bezt + fcu->totvert; fcu->totvert += tot; - + while (tot--) { /* defaults, no userprefs gives predictable results for API */ bezt->f1 = bezt->f2 = bezt->f3 = SELECT; @@ -920,17 +920,17 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem generator_mode_items[] = { {FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""}, {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorized Polynomial", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "FModifierGenerator", "FModifier"); RNA_def_struct_ui_text(srna, "Generator F-Modifier", "Deterministically generate values for the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Generator", "data"); - + /* define common props */ prop = RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); @@ -938,19 +938,19 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) "Values generated by this modifier are applied on top of " "the existing values instead of overwriting them"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, generator_mode_items); RNA_def_property_ui_text(prop, "Mode", "Type of generator to use"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_verify_data_update"); - + /* order of the polynomial */ prop = RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial (number of coefficients - 1)"); RNA_def_property_range(prop, 1, 100); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_verify_data_update"); - + /* coefficients array */ prop = RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE); RNA_def_property_array(prop, 32); @@ -967,7 +967,7 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_type_items[] = { {0, "SIN", 0, "Sine", ""}, {1, "COS", 0, "Cosine", ""}, @@ -977,28 +977,28 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) {5, "SINC", 0, "Normalized Sine", "sin(x) / x"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier"); RNA_def_struct_ui_text(srna, "Built-In Function F-Modifier", "Generate values using a Built-In Function"); RNA_def_struct_sdna_from(srna, "FMod_FunctionGenerator", "data"); - + /* coefficients */ prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + /* flags */ prop = RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); @@ -1006,7 +1006,7 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) "Values generated by this modifier are applied on top of " "the existing values instead of overwriting them"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_type_items); @@ -1020,11 +1020,11 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "FModifierEnvelopeControlPoint", NULL); RNA_def_struct_ui_text(srna, "Envelope Control Point", "Control point for envelope F-Modifier"); RNA_def_struct_sdna(srna, "FCM_EnvelopeData"); - + /* min/max extents * - for now, these are allowed to go past each other, so that we can have inverted action * - technically, the range is limited by the settings in the envelope-modifier data, not here... @@ -1033,18 +1033,18 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + /* Frame */ prop = RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "time"); RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + /* TODO: */ /* - selection flags (not implemented in UI yet though) */ } @@ -1083,29 +1083,29 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "FModifierEnvelope", "FModifier"); RNA_def_struct_ui_text(srna, "Envelope F-Modifier", "Scale the values of the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Envelope", "data"); - + /* Collections */ prop = RNA_def_property(srna, "control_points", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "data", "totvert"); RNA_def_property_struct_type(prop, "FModifierEnvelopeControlPoint"); RNA_def_property_ui_text(prop, "Control Points", "Control points defining the shape of the envelope"); rna_def_fmodifier_envelope_control_points(brna, prop); - + /* Range Settings */ prop = RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "midval"); RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "default_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "default_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence"); @@ -1118,7 +1118,7 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_type_items[] = { {FCM_EXTRAPOLATE_NONE, "NONE", 0, "No Cycles", "Don't do anything"}, {FCM_EXTRAPOLATE_CYCLIC, "REPEAT", 0, "Repeat Motion", "Repeat keyframe range as-is"}, @@ -1129,31 +1129,31 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) "Alternate between forward and reverse playback of keyframe range"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "FModifierCycles", "FModifier"); RNA_def_struct_ui_text(srna, "Cycles F-Modifier", "Repeat the values of the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Cycles", "data"); - + /* before */ prop = RNA_def_property(srna, "mode_before", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "before_mode"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Before Mode", "Cycling mode to use before first keyframe"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "cycles_before", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "before_cycles"); RNA_def_property_ui_text(prop, "Before Cycles", "Maximum number of cycles to allow before first keyframe (0 = infinite)"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + /* after */ prop = RNA_def_property(srna, "mode_after", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "after_mode"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "After Mode", "Cycling mode to use after last keyframe"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "cycles_after", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "after_cycles"); RNA_def_property_ui_text(prop, "After Cycles", @@ -1167,7 +1167,7 @@ static void rna_def_fmodifier_python(BlenderRNA *brna) { StructRNA *srna; /*PropertyRNA *prop; */ - + srna = RNA_def_struct(brna, "FModifierPython", "FModifier"); RNA_def_struct_ui_text(srna, "Python F-Modifier", "Perform user-defined operation on the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Python", "data"); @@ -1179,49 +1179,49 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "FModifierLimits", "FModifier"); RNA_def_struct_ui_text(srna, "Limit F-Modifier", "Limit the time/value ranges of the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Limits", "data"); - + prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMIN); RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMIN); RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMAX); RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMAX); RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmin"); RNA_def_property_float_funcs(prop, NULL, "rna_FModifierLimits_minx_set", "rna_FModifierLimits_minx_range"); RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymin"); RNA_def_property_float_funcs(prop, NULL, "rna_FModifierLimits_miny_set", "rna_FModifierLimits_miny_range"); RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmax"); RNA_def_property_float_funcs(prop, NULL, "rna_FModifierLimits_maxx_set", "rna_FModifierLimits_maxx_range"); RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymax"); RNA_def_property_float_funcs(prop, NULL, "rna_FModifierLimits_maxy_set", "rna_FModifierLimits_maxy_range"); @@ -1235,7 +1235,7 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_modification_items[] = { {FCM_NOISE_MODIF_REPLACE, "REPLACE", 0, "Replace", ""}, {FCM_NOISE_MODIF_ADD, "ADD", 0, "Add", ""}, @@ -1243,28 +1243,28 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) {FCM_NOISE_MODIF_MULTIPLY, "MULTIPLY", 0, "Multiply", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "FModifierNoise", "FModifier"); RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Give randomness to the modified F-Curve"); RNA_def_struct_sdna_from(srna, "FMod_Noise", "data"); - + prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "modification"); RNA_def_property_enum_items(prop, prop_modification_items); RNA_def_property_ui_text(prop, "Blend Type", "Method of modifying the existing F-Curve"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Scale", "Scaling (in time) of the noise"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_ui_text(prop, "Strength", "Amplitude of the noise - the amount that it modifies the underlying curve"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "phase"); RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect"); @@ -1274,7 +1274,7 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_ui_text(prop, "Offset", "Time offset for the noise effect"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "depth"); RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise"); @@ -1288,42 +1288,42 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "FModifierStepped", "FModifier"); RNA_def_struct_ui_text(srna, "Stepped Interpolation F-Modifier", "Hold each interpolated value from the F-Curve for several frames without " "changing the timing"); RNA_def_struct_sdna_from(srna, "FMod_Stepped", "data"); - + /* properties */ prop = RNA_def_property(srna, "frame_step", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "step_size"); RNA_def_property_ui_text(prop, "Step Size", "Number of frames to hold each value"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "frame_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_ui_text(prop, "Offset", "Reference number of frames before frames get held " "(use to get hold for '1-3' vs '5-7' holding patterns)"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "use_frame_start", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_BEFORE); RNA_def_property_ui_text(prop, "Use Start Frame", "Restrict modifier to only act after its 'start' frame"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "use_frame_end", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_AFTER); RNA_def_property_ui_text(prop, "Use End Frame", "Restrict modifier to only act before its 'end' frame"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "start_frame"); RNA_def_property_float_funcs(prop, NULL, "rna_FModifierStepped_frame_start_set", "rna_FModifierStepped_start_frame_range"); RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if applicable)"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "end_frame"); RNA_def_property_float_funcs(prop, NULL, "rna_FModifierStepped_frame_end_set", "rna_FModifierStepped_end_frame_range"); @@ -1338,43 +1338,43 @@ static void rna_def_fmodifier(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + /* base struct definition */ srna = RNA_def_struct(brna, "FModifier", NULL); RNA_def_struct_refine_func(srna, "rna_FModifierType_refine"); RNA_def_struct_ui_text(srna, "F-Modifier", "Modifier for values of F-Curve"); - + #if 0 /* XXX not used yet */ /* name */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", "Short description of F-Curve Modifier"); #endif /* XXX not used yet */ - + /* type */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_enum_items(prop, rna_enum_fmodifier_type_items); RNA_def_property_ui_text(prop, "Type", "F-Curve Modifier Type"); - + /* settings */ prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_EXPANDED); RNA_def_property_ui_text(prop, "Expanded", "F-Curve Modifier's panel is expanded in UI"); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); - + prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_MUTED); RNA_def_property_ui_text(prop, "Muted", "F-Curve Modifier will not be evaluated"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_update"); RNA_def_property_ui_icon(prop, ICON_MUTE_IPO_OFF, 1); - + prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FMODIFIER_FLAG_DISABLED); RNA_def_property_ui_text(prop, "Disabled", "F-Curve Modifier has invalid settings and will not be evaluated"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_update"); - + /* TODO: setting this to true must ensure that all others in stack are turned off too... */ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_ACTIVE); @@ -1382,7 +1382,7 @@ static void rna_def_fmodifier(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, NULL, "rna_FModifier_active_set"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_active_update"); RNA_def_property_ui_icon(prop, ICON_RADIOBUT_OFF, 1); - + /* restricted range */ prop = RNA_def_property(srna, "use_restricted_range", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_RANGERESTRICT); @@ -1391,40 +1391,40 @@ static void rna_def_fmodifier(BlenderRNA *brna) "mask off effects in order to chain them"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_update"); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); /* XXX: depends on UI implementation */ - + prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sfra"); RNA_def_property_float_funcs(prop, NULL, "rna_FModifier_start_frame_set", "rna_FModifier_start_frame_range"); RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if Restrict Frame Range is in use)"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "efra"); RNA_def_property_float_funcs(prop, NULL, "rna_FModifer_end_frame_set", "rna_FModifier_end_frame_range"); RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if Restrict Frame Range is in use)"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blendin"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range"); RNA_def_property_ui_text(prop, "Blend In", "Number of frames from start frame for influence to take effect"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_update"); - + prop = RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blendout"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range"); RNA_def_property_ui_text(prop, "Blend Out", "Number of frames from end frame for influence to fade out"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_update"); - + /* influence */ prop = RNA_def_property(srna, "use_influence", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_USEINFLUENCE); RNA_def_property_ui_text(prop, "Use Influence", "F-Curve Modifier's effects will be tempered by a default factor"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_update"); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); /* XXX: depends on UI implementation */ - + prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "influence"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1440,7 +1440,7 @@ static void rna_def_drivertarget(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_trans_chan_items[] = { {DTAR_TRANSCHAN_LOCX, "LOC_X", 0, "X Location", ""}, {DTAR_TRANSCHAN_LOCY, "LOC_Y", 0, "Y Location", ""}, @@ -1453,7 +1453,7 @@ static void rna_def_drivertarget(BlenderRNA *brna) {DTAR_TRANSCHAN_SCALEZ, "SCALE_Z", 0, "Z Scale", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_local_space_items[] = { {0, "WORLD_SPACE", 0, "World Space", "Transforms include effects of parenting/restpose and constraints"}, {DTAR_FLAG_LOCALSPACE, "TRANSFORM_SPACE", 0, "Transform Space", @@ -1463,10 +1463,10 @@ static void rna_def_drivertarget(BlenderRNA *brna) "parenting/restpose"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "DriverTarget", NULL); RNA_def_struct_ui_text(srna, "Driver Target", "Source of input values for driver variables"); - + /* Target Properties - ID-block to Drive */ prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); @@ -1478,7 +1478,7 @@ static void rna_def_drivertarget(BlenderRNA *brna) "ID-block that the specific property used can be found from " "(id_type property must be set first)"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); - + prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "idtype"); RNA_def_property_enum_items(prop, rna_enum_id_type_items); @@ -1488,25 +1488,25 @@ static void rna_def_drivertarget(BlenderRNA *brna) RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_ID); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); - + /* Target Properties - Property to Drive */ prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_DriverTarget_RnaPath_get", "rna_DriverTarget_RnaPath_length", "rna_DriverTarget_RnaPath_set"); RNA_def_property_ui_text(prop, "Data Path", "RNA Path (from ID-block) to property used"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); - + prop = RNA_def_property(srna, "bone_target", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "pchan_name"); RNA_def_property_ui_text(prop, "Bone Name", "Name of PoseBone to use as target"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); - + prop = RNA_def_property(srna, "transform_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "transChan"); RNA_def_property_enum_items(prop, prop_trans_chan_items); RNA_def_property_ui_text(prop, "Type", "Driver variable type"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_data"); - + prop = RNA_def_property(srna, "transform_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_local_space_items); @@ -1518,7 +1518,7 @@ static void rna_def_drivervar(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_type_items[] = { {DVAR_TYPE_SINGLE_PROP, "SINGLE_PROP", ICON_RNA, "Single Property", "Use the value from some RNA property (Default)"}, {DVAR_TYPE_TRANSFORM_CHAN, "TRANSFORMS", ICON_MANIPUL, "Transform Channel", @@ -1527,12 +1527,12 @@ static void rna_def_drivervar(BlenderRNA *brna) {DVAR_TYPE_LOC_DIFF, "LOC_DIFF", ICON_FULLSCREEN_ENTER, "Distance", "Distance between two bones or objects"}, /* XXX: Icon... */ {0, NULL, 0, NULL, NULL} }; - - + + srna = RNA_def_struct(brna, "DriverVariable", NULL); RNA_def_struct_sdna(srna, "DriverVar"); RNA_def_struct_ui_text(srna, "Driver Variable", "Variable from some source/target for driver relationship"); - + /* Variable Name */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); @@ -1541,14 +1541,14 @@ static void rna_def_drivervar(BlenderRNA *brna) "Name to use in scripted expressions/functions (no spaces or dots are allowed, " "and must start with a letter)"); RNA_def_property_update(prop, 0, "rna_DriverTarget_update_name"); /* XXX */ - + /* Enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_enum_funcs(prop, NULL, "rna_DriverVariable_type_set", NULL); RNA_def_property_ui_text(prop, "Type", "Driver variable type"); RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); /* XXX */ - + /* Targets */ /* TODO: for nicer api, only expose the relevant props via subclassing, * instead of exposing the collection of targets */ @@ -1556,12 +1556,12 @@ static void rna_def_drivervar(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "targets", "num_targets"); RNA_def_property_struct_type(prop, "DriverTarget"); RNA_def_property_ui_text(prop, "Targets", "Sources of input data for evaluating this variable"); - + /* Name Validity Flags */ prop = RNA_def_property(srna, "is_name_valid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", DVAR_FLAG_INVALID_NAME); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Is Name Valid", "Is this a valid name for a driver variable"); + RNA_def_property_ui_text(prop, "Is Name Valid", "Is this a valid name for a driver variable"); } @@ -1570,16 +1570,16 @@ static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop { StructRNA *srna; /* PropertyRNA *prop; */ - + FunctionRNA *func; PropertyRNA *parm; - + RNA_def_property_srna(cprop, "ChannelDriverVariables"); srna = RNA_def_struct(brna, "ChannelDriverVariables", NULL); RNA_def_struct_sdna(srna, "ChannelDriver"); RNA_def_struct_ui_text(srna, "ChannelDriver Variables", "Collection of channel driver Variables"); - - + + /* add variable */ func = RNA_def_function(srna, "new", "rna_Driver_new_variable"); RNA_def_function_ui_description(func, "Add a new variable for the driver"); @@ -1601,7 +1601,7 @@ static void rna_def_channeldriver(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_type_items[] = { {DRIVER_TYPE_AVERAGE, "AVERAGE", 0, "Averaged Value", ""}, {DRIVER_TYPE_SUM, "SUM", 0, "Sum Values", ""}, @@ -1633,7 +1633,7 @@ static void rna_def_channeldriver(BlenderRNA *brna) RNA_def_property_struct_type(prop, "DriverVariable"); RNA_def_property_ui_text(prop, "Variables", "Properties acting as inputs for this driver"); rna_def_channeldriver_variables(brna, prop); - + /* Settings */ prop = RNA_def_property(srna, "show_debug_info", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", DRIVER_FLAG_SHOWDEBUG); @@ -1650,8 +1650,8 @@ static void rna_def_channeldriver(BlenderRNA *brna) prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", DRIVER_FLAG_INVALID); RNA_def_property_ui_text(prop, "Invalid", "Driver could not be evaluated in past, so should be skipped"); - - + + /* Functions */ RNA_api_drivers(srna); } @@ -1662,17 +1662,17 @@ static void rna_def_fpoint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "FCurveSample", NULL); RNA_def_struct_sdna(srna, "FPoint"); RNA_def_struct_ui_text(srna, "F-Curve Sample", "Sample point for F-Curve"); - + /* Boolean values */ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); RNA_def_property_ui_text(prop, "Select", "Selection status"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); - + /* Vector value */ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_float_sdna(prop, NULL, "vec"); @@ -1689,40 +1689,40 @@ static void rna_def_fkeyframe(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "Keyframe", NULL); RNA_def_struct_sdna(srna, "BezTriple"); RNA_def_struct_ui_text(srna, "Keyframe", "Bezier curve point with two handles defining a Keyframe on an F-Curve"); - + /* Boolean values */ prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "f1", 0); RNA_def_property_ui_text(prop, "Handle 1 selected", "Left handle selection status"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); - + prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "f3", 0); RNA_def_property_ui_text(prop, "Handle 2 selected", "Right handle selection status"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); - + prop = RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "f2", 0); RNA_def_property_ui_text(prop, "Select", "Control point selection status"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); - + /* Enums */ prop = RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "h1"); RNA_def_property_enum_items(prop, rna_enum_keyframe_handle_type_items); RNA_def_property_ui_text(prop, "Left Handle Type", "Handle types"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); - + prop = RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "h2"); RNA_def_property_enum_items(prop, rna_enum_keyframe_handle_type_items); RNA_def_property_ui_text(prop, "Right Handle Type", "Handle types"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); - + prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ipo"); RNA_def_property_enum_items(prop, rna_enum_beztriple_interpolation_mode_items); @@ -1730,18 +1730,18 @@ static void rna_def_fkeyframe(BlenderRNA *brna) "Interpolation method to use for segment of the F-Curve from " "this Keyframe until the next Keyframe"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); - + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "hide"); RNA_def_property_enum_items(prop, rna_enum_beztriple_keyframe_type_items); RNA_def_property_ui_text(prop, "Type", "Type of keyframe (for visual purposes only)"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); - - + + prop = RNA_def_property(srna, "easing", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "easing"); RNA_def_property_enum_items(prop, rna_enum_beztriple_interpolation_easing_items); - RNA_def_property_ui_text(prop, "Easing", + RNA_def_property_ui_text(prop, "Easing", "Which ends of the segment between this and the next keyframe easing " "interpolation is applied to"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); @@ -1761,20 +1761,20 @@ static void rna_def_fkeyframe(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "period"); RNA_def_property_ui_text(prop, "Period", "Time between bounces for elastic easing"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); - + /* Vector values */ prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle1_get", "rna_FKeyframe_handle1_set", NULL); RNA_def_property_ui_text(prop, "Left Handle", "Coordinates of the left handle (before the control point)"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_FKeyframe_ctrlpoint_get", "rna_FKeyframe_ctrlpoint_set", NULL); RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle2_get", "rna_FKeyframe_handle2_set", NULL); @@ -1909,7 +1909,7 @@ static void rna_def_fcurve(BlenderRNA *brna) prop = RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "extend"); RNA_def_property_enum_items(prop, prop_mode_extend_items); - RNA_def_property_ui_text(prop, "Extrapolation", + RNA_def_property_ui_text(prop, "Extrapolation", "Method used for evaluating value of F-Curve outside first and last keyframes"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, "rna_FCurve_update_data"); @@ -1917,7 +1917,7 @@ static void rna_def_fcurve(BlenderRNA *brna) prop = RNA_def_property(srna, "driver", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Driver", "Channel Driver (only set for Driver F-Curves)"); - + prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "grp"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -1939,35 +1939,35 @@ static void rna_def_fcurve(BlenderRNA *brna) "Index to the specific property affected by F-Curve if applicable"); /* XXX need an update callback for this so that animation gets evaluated */ RNA_def_property_update(prop, NC_ANIMATION, NULL); - + /* Color */ prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_color_items); RNA_def_property_ui_text(prop, "Color Mode", "Method used to determine color of F-Curve in Graph Editor"); RNA_def_property_update(prop, NC_ANIMATION, NULL); - + prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Color", "Color of the F-Curve in the Graph Editor"); RNA_def_property_update(prop, NC_ANIMATION, NULL); - + /* Flags */ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_SELECTED); RNA_def_property_ui_text(prop, "Select", "F-Curve is selected for editing"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); - + prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_PROTECTED); RNA_def_property_ui_text(prop, "Lock", "F-Curve's settings cannot be edited"); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_MUTED); RNA_def_property_ui_text(prop, "Muted", "F-Curve is not evaluated"); RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_VISIBLE); RNA_def_property_ui_text(prop, "Hide", "F-Curve and its keyframes are hidden in the Graph Editor graphs"); @@ -1985,7 +1985,7 @@ static void rna_def_fcurve(BlenderRNA *brna) "False when F-Curve could not be evaluated in past, so should be skipped " "when evaluating"); RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); - + /* Collections */ prop = RNA_def_property(srna, "sampled_points", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fpt", "totvert"); @@ -1997,7 +1997,7 @@ static void rna_def_fcurve(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Keyframe"); RNA_def_property_ui_text(prop, "Keyframes", "User-editable keyframes"); rna_def_fcurve_keyframe_points(brna, prop); - + prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "FModifier"); RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting the shape of the F-Curve"); @@ -2013,11 +2013,11 @@ static void rna_def_fcurve(BlenderRNA *brna) /* return value */ parm = RNA_def_float(func, "value", 0, -FLT_MAX, FLT_MAX, "Value", "Value of F-Curve specific frame", -FLT_MAX, FLT_MAX); RNA_def_function_return(func, parm); - + /* -- update / recalculate -- */ func = RNA_def_function(srna, "update", "rna_FCurve_update_data_ex"); RNA_def_function_ui_description(func, "Ensure keyframes are sorted in chronological order and handles are set correctly"); - + /* -- time extents/range -- */ func = RNA_def_function(srna, "range", "rna_FCurve_range"); RNA_def_function_ui_description(func, "Get the time extents for F-Curve"); @@ -2026,7 +2026,7 @@ static void rna_def_fcurve(BlenderRNA *brna) "Min/Max values", -FLT_MAX, FLT_MAX); RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); RNA_def_function_output(func, parm); - + /* -- auto-flag validity (ensures valid handling for data type) -- */ func = RNA_def_function(srna, "update_autoflags", "update_autoflags_fcurve"); /* calls the C/API direct */ RNA_def_function_ui_description(func, "Update FCurve flags set automatically from affected property " @@ -2048,13 +2048,13 @@ void RNA_def_fcurve(BlenderRNA *brna) rna_def_fcurve(brna); rna_def_fkeyframe(brna); rna_def_fpoint(brna); - + rna_def_drivertarget(brna); rna_def_drivervar(brna); rna_def_channeldriver(brna); - + rna_def_fmodifier(brna); - + rna_def_fmodifier_generator(brna); rna_def_fmodifier_function_generator(brna); diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index d1ba034d91a..54d89ec81ab 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -124,7 +124,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA ParticleSystemModifierData *psmd; ParticleSystem *psys, *next_psys; ParticleSettings *part; - + fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim); fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; /* clear flag */ @@ -242,7 +242,7 @@ static void rna_def_fluid_mesh_vertices(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "FluidVertexVelocity", NULL); RNA_def_struct_ui_text(srna, "Fluid Mesh Velocity", "Velocity of a simulated fluid mesh"); RNA_def_struct_ui_icon(srna, ICON_VERTEXSEL); @@ -278,7 +278,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "threads"); RNA_def_property_range(prop, 0, BLENDER_MAX_THREADS); RNA_def_property_ui_text(prop, "Simulation Threads", "Override number of threads for the simulation, 0 is automatic"); - + prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolutionxyz"); RNA_def_property_range(prop, 1, 1024); @@ -326,32 +326,32 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -1000.1, 1000.1); RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction"); - + prop = RNA_def_property(srna, "use_time_override", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_OVERRIDE_TIME); RNA_def_property_ui_text(prop, "Override Time", "Use a custom start and end time (in seconds) instead of the scene's timeline"); - + prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "animStart"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame (in seconds)"); - + prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "animEnd"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame (in seconds)"); - + prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frameOffset"); RNA_def_property_ui_text(prop, "Cache Offset", "Offset when reading baked cache"); RNA_def_property_update(prop, NC_OBJECT, "rna_fluid_update"); - + prop = RNA_def_property(srna, "simulation_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "realsize"); RNA_def_property_range(prop, 0.001, 10); RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in meters"); - + prop = RNA_def_property(srna, "simulation_rate", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "animRate"); RNA_def_property_range(prop, 0.0, 100.0); @@ -430,7 +430,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Generate Particles", "Amount of particles to generate (0=off, 1=normal, >1=more)"); - + /* simulated fluid mesh data */ prop = RNA_def_property(srna, "fluid_mesh_vertices", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "meshVelocities", "totvert"); @@ -470,7 +470,7 @@ static void rna_def_fluidsim_volume(StructRNA *srna) static void rna_def_fluidsim_active(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_ACTIVE); RNA_def_property_ui_text(prop, "Enabled", "Object contributes to the fluid simulation"); @@ -488,7 +488,7 @@ static void rna_def_fluidsim_fluid(BlenderRNA *brna) rna_def_fluidsim_active(srna); rna_def_fluidsim_volume(srna); - + prop = RNA_def_property(srna, "initial_velocity", PROP_FLOAT, PROP_VELOCITY); RNA_def_property_float_sdna(prop, NULL, "iniVelx"); RNA_def_property_array(prop, 3); @@ -614,12 +614,12 @@ static void rna_def_fluidsim_control(BlenderRNA *brna) "Fluid simulation settings for objects controlling the motion of fluid in the simulation"); rna_def_fluidsim_active(srna); - + prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "cpsTimeStart"); RNA_def_property_range(prop, 0.0, FLT_MAX); RNA_def_property_ui_text(prop, "Start Time", "Time when the control particles are activated"); - + prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "cpsTimeEnd"); RNA_def_property_range(prop, 0.0, FLT_MAX); @@ -635,7 +635,7 @@ static void rna_def_fluidsim_control(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "attractforceRadius"); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Attraction Radius", "Force field radius around the control object"); - + prop = RNA_def_property(srna, "velocity_strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "velocityforceStrength"); RNA_def_property_range(prop, 0.0, 10.0); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index b15f6dbccfa..51aed1ff296 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -82,7 +82,7 @@ static void rna_GPencil_onion_skinning_update(Main *bmain, Scene *scene, Pointer bGPdata *gpd = (bGPdata *)ptr->id.data; bGPDlayer *gpl; bool enabled = false; - + /* Ensure that the datablock's onionskinning toggle flag * stays in sync with the status of the actual layers */ @@ -91,13 +91,13 @@ static void rna_GPencil_onion_skinning_update(Main *bmain, Scene *scene, Pointer enabled = true; } } - + if (enabled) gpd->flag |= GP_DATA_SHOW_ONIONSKINS; else gpd->flag &= ~GP_DATA_SHOW_ONIONSKINS; - - + + /* Now do standard updates... */ rna_GPencil_update(bmain, scene, ptr); } @@ -116,9 +116,9 @@ static char *rna_GPencilLayer_path(PointerRNA *ptr) { bGPDlayer *gpl = (bGPDlayer *)ptr->data; char name_esc[sizeof(gpl->info) * 2]; - + BLI_strescape(name_esc, gpl->info, sizeof(name_esc)); - + return BLI_sprintfN("layers[\"%s\"]", name_esc); } @@ -137,7 +137,7 @@ static void rna_GPencilLayer_line_width_range(PointerRNA *ptr, int *min, int *ma int *softmin, int *softmax) { bGPDlayer *gpl = ptr->data; - + /* The restrictions on max width here are due to OpenGL on Windows not supporting * any widths greater than 10 (for driver-drawn) strokes/points. * @@ -150,14 +150,14 @@ static void rna_GPencilLayer_line_width_range(PointerRNA *ptr, int *min, int *ma if (gpl->flag & GP_LAYER_VOLUMETRIC) { *min = -300; *max = 300; - + *softmin = -100; *softmax = 100; } else { *min = -10; *max = 10; - + *softmin = -10; *softmax = 10; } @@ -196,7 +196,7 @@ static void set_parent(bGPDlayer *gpl, Object *par, const int type, const char * static void rna_GPencilLayer_parent_set(PointerRNA *ptr, PointerRNA value) { bGPDlayer *gpl = (bGPDlayer *)ptr->data; - Object *par = (Object *)value.data; + Object *par = (Object *)value.data; if (par != NULL) { set_parent(gpl, par, gpl->partype, gpl->parsubstr); @@ -317,7 +317,7 @@ static void rna_GPencil_active_layer_set(PointerRNA *ptr, PointerRNA value) gl->flag &= ~GP_LAYER_ACTIVE; } } - + WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL); } } @@ -326,7 +326,7 @@ static int rna_GPencil_active_layer_index_get(PointerRNA *ptr) { bGPdata *gpd = (bGPdata *)ptr->id.data; bGPDlayer *gpl = BKE_gpencil_layer_getactive(gpd); - + return BLI_findindex(&gpd->layers, gpl); } @@ -370,7 +370,7 @@ static void rna_GPencil_use_onion_skinning_set(PointerRNA *ptr, const int value) { bGPdata *gpd = ptr->id.data; bGPDlayer *gpl; - + /* set new value */ if (value) { /* enable on active layer (it's the one that's most likely to be of interest right now) */ @@ -378,7 +378,7 @@ static void rna_GPencil_use_onion_skinning_set(PointerRNA *ptr, const int value) if (gpl) { gpl->flag |= GP_LAYER_ONIONSKIN; } - + gpd->flag |= GP_DATA_SHOW_ONIONSKINS; } else { @@ -386,7 +386,7 @@ static void rna_GPencil_use_onion_skinning_set(PointerRNA *ptr, const int value) for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { gpl->flag &= ~GP_LAYER_ONIONSKIN; } - + gpd->flag &= ~GP_DATA_SHOW_ONIONSKINS; } } @@ -395,15 +395,15 @@ static bGPDstroke *rna_GPencil_stroke_point_find_stroke(const bGPdata *gpd, cons { bGPDlayer *gpl; bGPDstroke *gps; - + /* sanity checks */ if (ELEM(NULL, gpd, pt)) { return NULL; } - + if (r_gpl) *r_gpl = NULL; if (r_gpf) *r_gpf = NULL; - + /* there's no faster alternative than just looping over everything... */ for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { if (gpl->actframe) { @@ -412,13 +412,13 @@ static bGPDstroke *rna_GPencil_stroke_point_find_stroke(const bGPdata *gpd, cons /* found it */ if (r_gpl) *r_gpl = gpl; if (r_gpf) *r_gpf = gpl->actframe; - + return gps; } } } } - + /* didn't find it */ return NULL; } @@ -428,8 +428,8 @@ static void rna_GPencil_stroke_point_select_set(PointerRNA *ptr, const int value bGPdata *gpd = ptr->id.data; bGPDspoint *pt = ptr->data; bGPDstroke *gps = NULL; - - /* Ensure that corresponding stroke is set + + /* Ensure that corresponding stroke is set * - Since we don't have direct access, we're going to have to search * - We don't apply selection value unless we can find the corresponding * stroke, so that they don't get out of sync @@ -441,7 +441,7 @@ static void rna_GPencil_stroke_point_select_set(PointerRNA *ptr, const int value pt->flag |= GP_SPOINT_SELECT; else pt->flag &= ~GP_SPOINT_SELECT; - + /* Check if the stroke should be selected or not... */ BKE_gpencil_stroke_sync_selection(gps); } @@ -454,7 +454,7 @@ static void rna_GPencil_stroke_point_add(bGPDstroke *stroke, int count, float pr stroke->points = MEM_recallocN_id(stroke->points, sizeof(bGPDspoint) * (stroke->totpoints + count), "gp_stroke_points"); - + /* init the pressure and strength values so that old scripts won't need to * be modified to give these initial values... */ @@ -463,7 +463,7 @@ static void rna_GPencil_stroke_point_add(bGPDstroke *stroke, int count, float pr pt->pressure = pressure; pt->strength = strength; } - + stroke->totpoints += count; } } @@ -530,13 +530,13 @@ static void rna_GPencil_stroke_select_set(PointerRNA *ptr, const int value) bGPDstroke *gps = ptr->data; bGPDspoint *pt; int i; - + /* set new value */ if (value) gps->flag |= GP_STROKE_SELECT; else gps->flag &= ~GP_STROKE_SELECT; - + /* ensure that the stroke's points are selected in the same way */ for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { if (value) @@ -800,9 +800,9 @@ static char *rna_GPencilPalette_path(PointerRNA *ptr) { bGPDpalette *palette = ptr->data; char name_esc[sizeof(palette->info) * 2]; - + BLI_strescape(name_esc, palette->info, sizeof(name_esc)); - + return BLI_sprintfN("palettes[\"%s\"]", name_esc); } @@ -826,7 +826,7 @@ static void rna_GPencilPaletteColor_info_set(PointerRNA *ptr, const char *value) bGPdata *gpd = ptr->id.data; bGPDpalette *palette = BKE_gpencil_palette_getactive(gpd); bGPDpalettecolor *palcolor = ptr->data; - + char oldname[64] = ""; BLI_strncpy(oldname, palcolor->info, sizeof(oldname)); @@ -834,7 +834,7 @@ static void rna_GPencilPaletteColor_info_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(palcolor->info, value, sizeof(palcolor->info)); BLI_uniquename(&palette->colors, palcolor, DATA_("Color"), '.', offsetof(bGPDpalettecolor, info), sizeof(palcolor->info)); - + /* rename all strokes */ BKE_gpencil_palettecolor_changename(gpd, oldname, palcolor->info); @@ -895,23 +895,23 @@ static void rna_def_gpencil_stroke_point(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "GPencilStrokePoint", NULL); RNA_def_struct_sdna(srna, "bGPDspoint"); RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Point", "Data point for freehand stroke curve"); - + prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "x"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Coordinates", ""); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pressure"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -988,18 +988,18 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna) {GP_STROKE_2DIMAGE, "2DIMAGE", 0, "2D Image", "Stroke is in 2D-space (but with special 'image' scaling)"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "GPencilStroke", NULL); RNA_def_struct_sdna(srna, "bGPDstroke"); RNA_def_struct_ui_text(srna, "Grease Pencil Stroke", "Freehand curve defining part of a sketch"); - + /* Points */ prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints"); RNA_def_property_struct_type(prop, "GPencilStrokePoint"); RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points"); rna_def_gpencil_stroke_points_api(brna, prop); - + /* Triangles */ prop = RNA_def_property(srna, "triangles", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "triangles", "tot_triangles"); @@ -1019,7 +1019,7 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna) RNA_def_property_enum_items(prop, stroke_draw_mode_items); RNA_def_property_ui_text(prop, "Draw Mode", ""); RNA_def_property_update(prop, 0, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STROKE_SELECT); RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencil_stroke_select_set"); @@ -1080,11 +1080,11 @@ static void rna_def_gpencil_frame(BlenderRNA *brna) PropertyRNA *prop; FunctionRNA *func; - + srna = RNA_def_struct(brna, "GPencilFrame", NULL); RNA_def_struct_sdna(srna, "bGPDframe"); RNA_def_struct_ui_text(srna, "Grease Pencil Frame", "Collection of related sketches on a particular frame"); - + /* Strokes */ prop = RNA_def_property(srna, "strokes", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "strokes", NULL); @@ -1098,17 +1098,17 @@ static void rna_def_gpencil_frame(BlenderRNA *brna) /* XXX note: this cannot occur on the same frame as another sketch */ RNA_def_property_range(prop, -MAXFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears"); - + /* Flags */ prop = RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_PAINT); /* XXX should it be editable? */ RNA_def_property_ui_text(prop, "Paint Lock", "Frame is being edited (painted on)"); - + prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT); RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the Dope Sheet"); - - + + /* API */ func = RNA_def_function(srna, "clear", "rna_GPencil_frame_clear"); RNA_def_function_ui_description(func, "Remove all the grease pencil frame data"); @@ -1156,12 +1156,12 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) PropertyRNA *prop; FunctionRNA *func; - + srna = RNA_def_struct(brna, "GPencilLayer", NULL); RNA_def_struct_sdna(srna, "bGPDlayer"); RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches"); RNA_def_struct_path_func(srna, "rna_GPencilLayer_path"); - + /* Name */ prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Info", "Layer name"); @@ -1190,13 +1190,13 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Volumetric Strokes", "Draw strokes as a series of circular blobs, resulting in a volumetric effect"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "opacity"); RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + /* Tint Color */ prop = RNA_def_property(srna, "tint_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "tintcolor"); @@ -1204,14 +1204,14 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Tint Color", "Color for tinting stroke colors"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + /* Tint factor */ prop = RNA_def_property(srna, "tint_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tintcolor[3]"); RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_text(prop, "Tint Factor", "Factor of tinting color"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + /* Line Thickness change */ prop = RNA_def_property(srna, "line_change", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "thickness"); @@ -1219,13 +1219,13 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_int_funcs(prop, NULL, NULL, "rna_GPencilLayer_line_width_range"); RNA_def_property_ui_text(prop, "Thickness", "Thickness change to apply to current strokes (in pixels)"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + /* Onion-Skinning */ prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN); RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_onion_skinning_update"); - + prop = RNA_def_property(srna, "ghost_before_range", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gstep"); RNA_def_property_range(prop, -1, 120); @@ -1233,7 +1233,7 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) "Maximum number of frames to show before current frame " "(0 = show only the previous sketch, -1 = don't show any frames before current)"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "ghost_after_range", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gstep_next"); RNA_def_property_range(prop, -1, 120); @@ -1241,46 +1241,46 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) "Maximum number of frames to show after current frame " "(0 = show only the next sketch, -1 = don't show any frames after current)"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "use_ghost_custom_colors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_GHOST_PREVCOL | GP_LAYER_GHOST_NEXTCOL); RNA_def_property_ui_text(prop, "Use Custom Ghost Colors", "Use custom colors for ghost frames"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "before_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "gcolor_prev"); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Before Color", "Base color for ghosts before the active frame"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "after_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "gcolor_next"); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "After Color", "Base color for ghosts after the active frame"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "use_ghosts_always", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_GHOST_ALWAYS); RNA_def_property_ui_text(prop, "Always Show Ghosts", "Ghosts are shown in renders and animation playback. Useful for special effects (e.g. motion blur)"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - - + + /* Flags */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1); RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_ui_text(prop, "Locked", "Protect layer from further editing and/or frame changes"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + prop = RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); @@ -1309,23 +1309,23 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT); RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the Dope Sheet"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_SELECTED, "rna_GPencil_update"); - + /* XXX keep this option? */ prop = RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG); RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + /* X-Ray */ prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY); RNA_def_property_ui_text(prop, "X Ray", "Make the layer draw in front of objects"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - + /* Parent object */ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_funcs(prop, NULL, "rna_GPencilLayer_parent_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_ui_text(prop, "Parent", "Parent Object"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); @@ -1397,11 +1397,11 @@ static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL); - + prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_funcs(prop, - "rna_GPencil_active_layer_index_get", - "rna_GPencil_active_layer_index_set", + "rna_GPencil_active_layer_index_get", + "rna_GPencil_active_layer_index_set", "rna_GPencil_active_layer_index_range"); RNA_def_property_ui_text(prop, "Active Layer Index", "Index of active grease pencil layer"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL); @@ -1620,14 +1620,14 @@ static void rna_def_gpencil_data(BlenderRNA *brna) RNA_def_struct_sdna(srna, "bGPdata"); RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook"); RNA_def_struct_ui_icon(srna, ICON_GREASEPENCIL); - + /* Layers */ prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "layers", NULL); RNA_def_property_struct_type(prop, "GPencilLayer"); RNA_def_property_ui_text(prop, "Layers", ""); rna_def_gpencil_layers_api(brna, prop); - + /* Palettes */ prop = RNA_def_property(srna, "palettes", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "palettes", NULL); @@ -1637,20 +1637,20 @@ static void rna_def_gpencil_data(BlenderRNA *brna) /* Animation Data */ rna_def_animdata_common(srna); - + /* Flags */ prop = RNA_def_property(srna, "use_stroke_edit_mode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_STROKE_EDITMODE); RNA_def_property_ui_text(prop, "Stroke Edit Mode", "Edit Grease Pencil strokes instead of viewport data"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, "rna_GPencil_editmode_update"); - + prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_SHOW_ONIONSKINS); RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencil_use_onion_skinning_set"); - RNA_def_property_ui_text(prop, "Onion Skins", + RNA_def_property_ui_text(prop, "Onion Skins", "Show ghosts of the frames before and after the current frame, toggle to enable on active layer or disable all"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - + prop = RNA_def_property(srna, "show_stroke_direction", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_SHOW_DIRECTION); RNA_def_property_ui_text(prop, "Show Direction", "Show stroke drawing direction with a bigger green dot (start) " diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index aa02a3c159d..0ce0611fcc2 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -83,7 +83,7 @@ static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop) FunctionRNA *func; PropertyRNA *parm; - + RNA_def_property_srna(cprop, "GroupObjects"); srna = RNA_def_struct(brna, "GroupObjects", NULL); RNA_def_struct_sdna(srna, "Group"); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index eeb6160cc57..741e3dfae60 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -187,7 +187,7 @@ static char *rna_ImageUser_path(PointerRNA *ptr) { if (ptr->id.data) { /* ImageUser *iuser = ptr->data; */ - + switch (GS(((ID *)ptr->id.data)->name)) { case ID_OB: case ID_TE: @@ -202,7 +202,7 @@ static char *rna_ImageUser_path(PointerRNA *ptr) break; } } - + return BLI_strdup(""); } @@ -212,7 +212,7 @@ static const EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), Point Image *ima = (Image *)ptr->data; EnumPropertyItem *item = NULL; int totitem = 0; - + if (ima->source == IMA_SRC_VIEWER) { RNA_enum_items_add_value(&item, &totitem, image_source_items, IMA_SRC_VIEWER); } @@ -316,7 +316,7 @@ static int rna_Image_depth_get(PointerRNA *ptr) ImBuf *ibuf; void *lock; int planes; - + ibuf = BKE_image_acquire_ibuf(im, NULL, &lock); if (!ibuf) @@ -719,7 +719,7 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Fields", "Use fields of the image"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_fields_update"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - + prop = RNA_def_property(srna, "use_view_as_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_VIEW_AS_RENDER); @@ -763,7 +763,7 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Generated Type", "Generated image type"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - + prop = RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gen_x"); RNA_def_property_flag(prop, PROP_PROPORTIONAL); @@ -771,7 +771,7 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Generated Width", "Generated image width"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - + prop = RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gen_y"); RNA_def_property_flag(prop, PROP_PROPORTIONAL); @@ -779,7 +779,7 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Generated Height", "Generated image height"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - + prop = RNA_def_property(srna, "use_generated_float", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gen_flag", IMA_GEN_FLOAT); RNA_def_property_ui_text(prop, "Float Buffer", "Generate floating point buffer"); diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index e65011d34d7..9a22742e7b9 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -74,20 +74,20 @@ static void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value) { KeyBlock *kb = ptr->data; char oldname[sizeof(kb->name)]; - + /* make a copy of the old name first */ BLI_strncpy(oldname, kb->name, sizeof(kb->name)); - + /* copy the new name into the name slot */ BLI_strncpy_utf8(kb->name, value, sizeof(kb->name)); - + /* make sure the name is truly unique */ if (ptr->id.data) { Key *key = rna_ShapeKey_find_key(ptr->id.data); BLI_uniquename(&key->block, kb, CTX_DATA_(BLT_I18NCONTEXT_ID_SHAPEKEY, "Key"), '.', offsetof(KeyBlock, name), sizeof(kb->name)); } - + /* fix all the animation data which may link to this */ BKE_animdata_fix_paths_rename_all(NULL, "key_blocks", oldname, kb->name); } @@ -130,7 +130,7 @@ static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value) { KeyBlock *data = (KeyBlock *)ptr->data; float min, max, softmin, softmax; - + rna_ShapeKey_slider_min_range(ptr, &min, &max, &softmin, &softmax); CLAMP(value, min, max); data->slidermin = value; @@ -149,7 +149,7 @@ static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value) { KeyBlock *data = (KeyBlock *)ptr->data; float min, max, softmin, softmax; - + rna_ShapeKey_slider_max_range(ptr, &min, &max, &softmin, &softmax); CLAMP(value, min, max); data->slidermax = value; @@ -273,7 +273,7 @@ PointerRNA rna_object_shapekey_index_get(ID *id, int value) if (key && value < key->totkey) kb = BLI_findlink(&key->block, value); - + RNA_pointer_create(id, &RNA_ShapeKey, kb, &ptr); return ptr; @@ -287,7 +287,7 @@ int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current) int a = BLI_findindex(&key->block, value.data); if (a != -1) return a; } - + return current; } @@ -410,17 +410,17 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA Curve *cu; Nurb *nu; int tot = kb->totelem, size = key->elemsize; - + if (GS(key->from->name) == ID_CU) { cu = (Curve *)key->from; nu = cu->nurb.first; - + if (nu->bezt) { tot /= 3; size *= 3; } } - + rna_iterator_array_begin(iter, (void *)kb->data, size, tot, 0, NULL); } @@ -431,15 +431,15 @@ static int rna_ShapeKey_data_length(PointerRNA *ptr) Curve *cu; Nurb *nu; int tot = kb->totelem; - + if (GS(key->from->name) == ID_CU) { cu = (Curve *)key->from; nu = cu->nurb.first; - + if (nu->bezt) tot /= 3; } - + return tot; } @@ -449,11 +449,11 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) StructRNA *type; Curve *cu; Nurb *nu; - + if (GS(key->from->name) == ID_CU) { cu = (Curve *)key->from; nu = cu->nurb.first; - + if (nu->bezt) type = &RNA_ShapeKeyBezierPoint; else @@ -461,7 +461,7 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) } else type = &RNA_ShapeKeyPoint; - + return rna_pointer_inherit_refine(&iter->parent, type, rna_iterator_array_get(iter)); } @@ -495,11 +495,11 @@ static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *p static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point) { KeyBlock *kb; - + /* sanity checks */ if (ELEM(NULL, key, point)) return NULL; - + /* we'll need to manually search through the keyblocks and check * if the point is somewhere in the middle of each block's data */ @@ -507,7 +507,7 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point) if (kb->data) { float *start = (float *)kb->data; float *end; - + /* easy cases first */ if ((start == NULL) || (start > point)) { /* there's no chance point is in array */ @@ -517,12 +517,12 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point) /* exact match - point is first in array */ return kb; } - + /* determine where end of array is * - elemsize is in bytes, so use (char *) cast to get array in terms of bytes */ end = (float *)((char *)start + (key->elemsize * kb->totelem)); - + /* if point's address is less than the end, then it is somewhere between start and end, so in array */ if (end > point) { /* we've found the owner of the point data */ @@ -530,7 +530,7 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point) } } } - + return NULL; } @@ -542,18 +542,18 @@ static int rna_ShapeKeyPoint_get_index(Key *key, KeyBlock *kb, float *point) */ char *start = (char *)kb->data; char *pt = (char *)point; - + return (int)(pt - start) / key->elemsize; } static int rna_ShapeKeyBezierPoint_get_index(KeyBlock *kb, float *point) { float *start = (float *)kb->data; - + /* Unlike with rna_ShapeKeyPoint_get_index(), we cannot use key->elemsize here * since the default value for curves (16) is actually designed for BPoints * (i.e. NURBS Surfaces). The magic number "12" here was found by empirical - * testing on a 64-bit system, and is similar to what's used for meshes and + * testing on a 64-bit system, and is similar to what's used for meshes and * lattices. For more details, see T38013 */ return (int)(point - start) / 12; @@ -565,21 +565,21 @@ static char *rna_ShapeKeyPoint_path(PointerRNA *ptr) Key *key = rna_ShapeKey_find_key(ptr->id.data); KeyBlock *kb; float *point = (float *)ptr->data; - + /* if we can get a key block, we can construct a path */ kb = rna_ShapeKeyData_find_keyblock(key, point); - + if (kb) { char name_esc_kb[sizeof(kb->name) * 2]; int index; - + if (ptr->type == &RNA_ShapeKeyBezierPoint) index = rna_ShapeKeyBezierPoint_get_index(kb, point); else index = rna_ShapeKeyPoint_get_index(key, kb, point); BLI_strescape(name_esc_kb, kb->name, sizeof(name_esc_kb)); - + if (GS(id->name) == ID_KE) return BLI_sprintfN("key_blocks[\"%s\"].data[%d]", name_esc_kb, index); else @@ -689,7 +689,7 @@ static void rna_def_keyblock(BlenderRNA *brna) RNA_def_property_float_funcs(prop, "rna_ShapeKey_frame_get", NULL, NULL); RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys"); RNA_def_property_update(prop, 0, "rna_Key_update_data"); - + /* for now, this is editable directly, as users can set this even if they're not animating them * (to test results) */ prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_FACTOR); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index f29fa44d306..60b64b0795d 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -160,7 +160,7 @@ static void rna_Lamp_use_nodes_update(bContext *C, PointerRNA *ptr) if (la->use_nodes && la->nodetree == NULL) ED_node_shader_default(C, &la->id); - + rna_Lamp_update(CTX_data_main(C), CTX_data_scene(C), ptr); } @@ -236,12 +236,12 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna) {2, "CIE", 0, "CIE", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "LampSkySettings", NULL); RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_nested(brna, srna, "SunLamp"); RNA_def_struct_ui_text(srna, "Lamp Sky Settings", "Sky related settings for a sun lamp"); - + prop = RNA_def_property(srna, "sky_color_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sky_colorspace"); RNA_def_property_enum_items(prop, prop_skycolorspace_items); @@ -253,9 +253,9 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_ramp_blend_items); RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); - + /* Number values */ - + prop = RNA_def_property(srna, "horizon_brightness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_ui_text(prop, "Horizon Brightness", "Horizon brightness"); @@ -324,7 +324,7 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); /* boolean */ - + prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "sun_effect_type", LA_SUN_EFFECT_SKY); RNA_def_property_ui_text(prop, "Sky", "Apply sun effect on sky"); @@ -402,10 +402,10 @@ static void rna_def_lamp(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the lamp"); RNA_def_property_update(prop, 0, "rna_Lamp_use_nodes_update"); - + /* common */ rna_def_animdata_common(srna); - + /* textures */ rna_def_mtex_common(brna, srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get", "rna_Lamp_active_texture_set", NULL, "LampTextureSlot", "LampTextureSlots", @@ -430,7 +430,7 @@ static void rna_def_lamp_falloff(StructRNA *srna) RNA_def_property_enum_items(prop, prop_fallofftype_items); RNA_def_property_ui_text(prop, "Falloff Type", "Intensity Decay with distance"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); - + prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); @@ -497,7 +497,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) {LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_spot_ray_sampling_method_items[] = { {LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""}, {LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""}, diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 9424ddf7d0e..424c6f93f75 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -215,19 +215,19 @@ static char *rna_LatticePoint_path(PointerRNA *ptr) Lattice *lt = (Lattice *)ptr->id.data; void *point = ptr->data; BPoint *points = NULL; - + if (lt->editlatt && lt->editlatt->latt->def) points = lt->editlatt->latt->def; else points = lt->def; - + if (points && point) { int tot = lt->pntsu * lt->pntsv * lt->pntsw; - + /* only return index if in range */ if ((point >= (void *)points) && (point < (void *)(points + tot))) { int pt_index = (int)((BPoint *)point - points); - + return BLI_sprintfN("points[%d]", pt_index); } } @@ -344,7 +344,7 @@ static void rna_def_lattice(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_use_outside_set"); RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data_editlatt"); - + prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group to apply the influence of the lattice"); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 94687b6fd46..89e1ee47475 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -372,7 +372,7 @@ void RNA_def_main(BlenderRNA *brna) }; int i; - + srna = RNA_def_struct(brna, "BlendData", NULL); RNA_def_struct_ui_text(srna, "Blendfile Data", "Main data structure representing a .blend file and all its data-blocks"); @@ -383,7 +383,7 @@ void RNA_def_main(BlenderRNA *brna) RNA_def_property_string_funcs(prop, "rna_Main_filepath_get", "rna_Main_filepath_length", "rna_Main_filepath_set"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file"); - + prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Main_is_dirty_get", NULL); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 4e86e5c59af..a4b9f52464d 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -109,10 +109,10 @@ static void rna_Material_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point static void rna_Material_update_previews(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Material *ma = ptr->id.data; - + if (ma->nodetree) BKE_node_preview_clear_tree(ma->nodetree); - + WM_main_add_notifier(NC_MATERIAL | ND_SHADING_PREVIEW, ma); } @@ -205,7 +205,7 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain, Scene *s for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_IMAGE) { SpaceImage *sima = (SpaceImage *)sl; - + if (!sima->pin) ED_space_image_set(bmain, sima, scene, scene->obedit, image); } @@ -294,7 +294,7 @@ static int rna_MaterialTextureSlot_use_get(PointerRNA *ptr) for (a = 0; a < MAX_MTEX; a++) if (ma->mtex[a] == mtex) return (ma->septex & (1 << a)) == 0; - + return 0; } @@ -342,7 +342,7 @@ static void rna_Material_use_nodes_update(bContext *C, PointerRNA *ptr) if (ma->use_nodes && ma->nodetree == NULL) ED_node_shader_default(C, &ma->id); - + rna_Material_draw_update(CTX_data_main(C), CTX_data_scene(C), ptr); } @@ -352,11 +352,11 @@ static const EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext * Material *ma = (Material *)ptr->id.data; EnumPropertyItem *item = NULL; int totitem = 0; - + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_GLOB); RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_OBJECT); RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_ORCO); - + if (ma->material_type == MA_TYPE_VOLUME) { /* pass */ } @@ -369,10 +369,10 @@ static const EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext * RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STRESS); RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_TANGENT); } - + RNA_enum_item_end(&item, &totitem); *r_free = true; - + return item; } @@ -418,7 +418,7 @@ void rna_mtex_texture_slots_clear(ID *self_id, struct bContext *C, ReportList *r BKE_report(reports, RPT_ERROR, "Mtex not found for this type"); return; } - + if (index < 0 || index >= MAX_MTEX) { BKE_reportf(reports, RPT_ERROR, "Index %d is invalid", index); return; @@ -449,7 +449,7 @@ static void rna_def_material_mtex(BlenderRNA *brna) {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_x_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, @@ -457,7 +457,7 @@ static void rna_def_material_mtex(BlenderRNA *brna) {3, "Z", 0, "Z", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_y_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, @@ -465,7 +465,7 @@ static void rna_def_material_mtex(BlenderRNA *brna) {3, "Z", 0, "Z", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_z_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, @@ -499,7 +499,7 @@ static void rna_def_material_mtex(BlenderRNA *brna) {MTEX_BUMP_TEXTURESPACE, "BUMP_TEXTURESPACE", 0, "TextureSpace", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "MaterialTextureSlot", "TextureSlot"); RNA_def_struct_sdna(srna, "MTex"); RNA_def_struct_ui_text(srna, "Material Texture Slot", "Texture slot for textures in a Material data-block"); @@ -510,7 +510,7 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf"); RNA_def_property_ui_text(prop, "Texture Coordinates", ""); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_struct_type(prop, "Object"); @@ -546,67 +546,67 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COL); RNA_def_property_ui_text(prop, "Diffuse Color", "The texture affects basic color of the material"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_NORM); RNA_def_property_ui_text(prop, "Normal", "The texture affects the rendered normal"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_color_spec", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLSPEC); RNA_def_property_ui_text(prop, "Specular Color", "The texture affects the specularity color"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_mirror", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_COLMIR); RNA_def_property_ui_text(prop, "Mirror", "The texture affects the mirror color"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REF); RNA_def_property_ui_text(prop, "Diffuse", "The texture affects the value of diffuse reflectivity"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_specular", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SPEC); RNA_def_property_ui_text(prop, "Specular", "The texture affects the value of specular reflectivity"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_ambient", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_AMB); RNA_def_property_ui_text(prop, "Ambient", "The texture affects the value of ambient"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_hardness", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_HAR); RNA_def_property_ui_text(prop, "Hardness", "The texture affects the hardness value"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_raymir", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_RAYMIRR); RNA_def_property_ui_text(prop, "Ray-Mirror", "The texture affects the ray-mirror value"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ALPHA); RNA_def_property_ui_text(prop, "Alpha", "The texture affects the alpha value"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_emit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMIT); RNA_def_property_ui_text(prop, "Emit", "The texture affects the emit value"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_translucency", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSLU); RNA_def_property_ui_text(prop, "Translucency", "The texture affects the translucency value"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_displacement", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DISPLACE); RNA_def_property_ui_text(prop, "Displacement", "Let the texture displace the surface"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_warp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_WARP); RNA_def_property_ui_text(prop, "Warp", "Let the texture warp texture coordinates of next channels"); @@ -617,13 +617,13 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_x_mapping_items); RNA_def_property_ui_text(prop, "X Mapping", ""); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "projy"); RNA_def_property_enum_items(prop, prop_y_mapping_items); RNA_def_property_ui_text(prop, "Y Mapping", ""); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "projz"); RNA_def_property_enum_items(prop, prop_z_mapping_items); @@ -730,69 +730,69 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION_COL); RNA_def_property_ui_text(prop, "Emission Color", "The texture affects the color of emission"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_color_reflection", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION_COL); RNA_def_property_ui_text(prop, "Reflection Color", "The texture affects the color of scattered light"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_color_transmission", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_TRANSMISSION_COL); RNA_def_property_ui_text(prop, "Transmission Color", "The texture affects the result color after other light has been scattered/absorbed"); RNA_def_property_update(prop, NC_TEXTURE, NULL); - + prop = RNA_def_property(srna, "use_map_density", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DENSITY); RNA_def_property_ui_text(prop, "Density", "The texture affects the volume's density"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_emission", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION); RNA_def_property_ui_text(prop, "Emission", "The texture affects the volume's emission"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_scatter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SCATTERING); RNA_def_property_ui_text(prop, "Scattering", "The texture affects the volume's scattering"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_map_reflect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_REFLECTION); RNA_def_property_ui_text(prop, "Reflection", "The texture affects the reflected light's brightness"); RNA_def_property_update(prop, NC_TEXTURE, NULL); - + prop = RNA_def_property(srna, "emission_color_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colemitfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Emission Color Factor", "Amount texture affects emission color"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "reflection_color_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colreflfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Reflection Color Factor", "Amount texture affects color of out-scattered light"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "transmission_color_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "coltransfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Transmission Color Factor", "Amount texture affects result color after light has been scattered/absorbed"); RNA_def_property_update(prop, NC_TEXTURE, NULL); - + prop = RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "densfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects density"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "emission_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "emitfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Emission Factor", "Amount texture affects emission"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "scattering_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scatterfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); @@ -804,9 +804,9 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Reflection Factor", "Amount texture affects brightness of out-scattered light"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + /* end volume material */ - + prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_MaterialTextureSlot_use_get", "rna_MaterialTextureSlot_use_set"); RNA_def_property_ui_text(prop, "Enabled", "Enable this material texture slot"); @@ -817,7 +817,7 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_bump_method_items); RNA_def_property_ui_text(prop, "Bump Method", "Method to use for bump mapping"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "bump_objectspace", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "texflag"); RNA_def_property_enum_items(prop, prop_bump_space_items); @@ -850,12 +850,12 @@ static void rna_def_material_gamesettings(BlenderRNA *brna) {GEMAT_SHADOW, "SHADOW", 0, "Shadow", "Faces are used for shadow"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "MaterialGameSettings", NULL); RNA_def_struct_sdna(srna, "GameSettings"); RNA_def_struct_nested(brna, srna, "Material"); RNA_def_struct_ui_text(srna, "Material Game Settings", "Game Engine settings for a Material data-block"); - + prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GEMAT_BACKCULL); /* use bitflags */ RNA_def_property_ui_text(prop, "Backface Culling", "Hide Back of the face in Game Engine "); @@ -903,19 +903,19 @@ static void rna_def_material_colors(StructRNA *srna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Diffuse Color", "Diffuse color of the material"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - + prop = RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "specr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Specular Color", "Specular color of the material"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - + prop = RNA_def_property(srna, "mirror_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "mirr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Mirror Color", "Mirror color of the material"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Alpha", "Alpha transparency of the material"); @@ -926,7 +926,7 @@ static void rna_def_material_colors(StructRNA *srna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Specular Alpha", "Alpha transparency for specular areas"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + /* Color bands */ prop = RNA_def_property(srna, "use_diffuse_ramp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAMP_COL); @@ -951,13 +951,13 @@ static void rna_def_material_colors(StructRNA *srna) RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_ui_text(prop, "Specular Ramp", "Color ramp used to affect specular shading"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_col"); RNA_def_property_enum_items(prop, rna_enum_ramp_blend_items); RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", "Blending method of the ramp and the diffuse color"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec"); RNA_def_property_enum_items(prop, rna_enum_ramp_blend_items); @@ -969,7 +969,7 @@ static void rna_def_material_colors(StructRNA *srna) RNA_def_property_enum_items(prop, prop_ramp_input_items); RNA_def_property_ui_text(prop, "Diffuse Ramp Input", "How the ramp maps on the surface"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "specular_ramp_input", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampin_spec"); RNA_def_property_enum_items(prop, prop_ramp_input_items); @@ -1015,19 +1015,19 @@ static void rna_def_material_diffuse(StructRNA *srna) {MA_DIFF_FRESNEL, "FRESNEL", 0, "Fresnel", "Use a Fresnel shader"}, {0, NULL, 0, NULL, NULL} }; - + prop = RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "diff_shader"); RNA_def_property_enum_items(prop, prop_diff_shader_items); RNA_def_property_ui_text(prop, "Diffuse Shader Model", ""); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "ref"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - + prop = RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 3.14f); RNA_def_property_ui_text(prop, "Roughness", "Oren-Nayar Roughness"); @@ -1056,7 +1056,7 @@ static void rna_def_material_diffuse(StructRNA *srna) RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Diffuse Fresnel Factor", "Blending factor of Fresnel"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "darkness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Darkness", "Minnaert darkness"); @@ -1083,32 +1083,32 @@ static void rna_def_material_raymirror(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYMIRROR); /* use bitflags */ RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "ray_mirror"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Reflectivity", "Amount of mirror reflection for raytrace"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fresnel_mir"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for mirror reflection"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "fresnel_mir_i"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "gloss_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection (values < 1.0 give diffuse, blurry reflections)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "aniso_gloss_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1116,13 +1116,13 @@ static void rna_def_material_raymirror(BlenderRNA *brna) "The shape of the reflection, from 0.0 (circular) to 1.0 " "(fully stretched along the tangent"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samp_gloss_mir"); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry reflections"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1130,13 +1130,13 @@ static void rna_def_material_raymirror(BlenderRNA *brna) "Threshold for adaptive sampling (if a sample contributes less than " "this amount [as a percentage], sampling is stopped)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "ray_depth"); RNA_def_property_ui_range(prop, 0, 100, 1, 3); RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-reflections"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist_mir"); RNA_def_property_range(prop, 0.0f, 10000.0f); @@ -1144,7 +1144,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna) "Maximum distance of reflected rays (reflections further than this " "range fade to sky color or material color)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "fade_to", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir"); RNA_def_property_enum_items(prop, prop_fadeto_mir_items); @@ -1170,32 +1170,32 @@ static void rna_def_material_raytra(BlenderRNA *brna) RNA_def_property_range(prop, 0.25f, 4.0f); RNA_def_property_ui_text(prop, "IOR", "Angular index of refraction for raytraced refraction"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fresnel_tra"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for transparency (Ray or ZTransp)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "fresnel_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "fresnel_tra_i"); RNA_def_property_range(prop, 1.0f, 5.0f); RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "gloss_tra"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samp_gloss_tra"); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry refractions"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "gloss_threshold", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "adapt_thresh_tra"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1203,13 +1203,13 @@ static void rna_def_material_raytra(BlenderRNA *brna) "Threshold for adaptive sampling. If a sample contributes less than " "this amount (as a percentage), sampling is stopped"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "ray_depth_tra"); RNA_def_property_ui_range(prop, 0, 100, 1, 3); RNA_def_property_ui_text(prop, "Depth", "Maximum allowed number of light inter-refractions"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "filter", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "filter"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1217,7 +1217,7 @@ static void rna_def_material_raytra(BlenderRNA *brna) "Amount to blend in the material's diffuse color in raytraced " "transparency (simulating absorption)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "depth_max", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "tx_limit"); RNA_def_property_range(prop, 0.0f, 100.0f); @@ -1225,7 +1225,7 @@ static void rna_def_material_raytra(BlenderRNA *brna) "Maximum depth for light to travel through the transparent material " "before becoming fully filtered (0.0 is disabled)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tx_falloff"); RNA_def_property_range(prop, 0.1f, 10.0f); @@ -1253,44 +1253,44 @@ static void rna_def_material_volume(BlenderRNA *brna) /*{MA_VOL_STEP_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", ""}, */ {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "MaterialVolume", NULL); RNA_def_struct_sdna(srna, "VolumeSettings"); RNA_def_struct_nested(brna, srna, "Material"); RNA_def_struct_ui_text(srna, "Material Volume", "Volume rendering settings for a Material data-block"); - + prop = RNA_def_property(srna, "step_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stepsize_type"); RNA_def_property_enum_items(prop, prop_stepsize_items); RNA_def_property_ui_text(prop, "Step Calculation", "Method of calculating the steps through the volume"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stepsize"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.001f, 1.0f, 1, 3); RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "light_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "shade_type"); RNA_def_property_enum_items(prop, prop_lighting_items); RNA_def_property_ui_text(prop, "Lighting Mode", "Method of shading, attenuating, and scattering light through the volume"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_external_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_RECV_EXT_SHADOW); /* use bitflags */ RNA_def_property_ui_text(prop, "External Shadows", "Receive shadows from sources outside the volume (temporary)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_light_cache", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_PRECACHESHADING); /* use bitflags */ RNA_def_property_ui_text(prop, "Light Cache", "Pre-calculate the shading information into a voxel grid, " "speeds up shading at slightly less accuracy"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "cache_resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "precache_resolution"); RNA_def_property_range(prop, 1, 1024); @@ -1298,26 +1298,26 @@ static void rna_def_material_volume(BlenderRNA *brna) "Resolution of the voxel grid, low resolutions are faster, " "high resolutions use more memory"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "ms_diffusion", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ms_diff"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Diffusion", "Diffusion factor, the strength of the blurring effect"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "ms_spread", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ms_spread"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3); RNA_def_property_ui_text(prop, "Spread", "Proportional distance over which the light is diffused"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "ms_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ms_intensity"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Intensity", "Multiplier for multiple scattered light energy"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "depth_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "depth_cutoff"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1325,7 +1325,7 @@ static void rna_def_material_volume(BlenderRNA *brna) "Stop ray marching early if transmission drops below this luminance - " "higher values give speedups in dense volumes at the expense of accuracy"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "density"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1338,7 +1338,7 @@ static void rna_def_material_volume(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); RNA_def_property_ui_text(prop, "Density Scale", "Multiplier for the material's density"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scattering"); RNA_def_property_range(prop, 0.0f, FLT_MAX); @@ -1347,21 +1347,21 @@ static void rna_def_material_volume(BlenderRNA *brna) "Amount of light that gets scattered out by the volume - " "the more out-scattering, the shallower the light will penetrate"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "transmission_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "transmission_col"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Transmission Color", "Result color of the volume, after other light has been scattered/absorbed"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - + prop = RNA_def_property(srna, "reflection_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "reflection_col"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Reflection Color", "Color of light scattered out of the volume (does not affect transmission)"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - + prop = RNA_def_property(srna, "reflection", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "reflection"); RNA_def_property_range(prop, 0.0f, FLT_MAX); @@ -1369,20 +1369,20 @@ static void rna_def_material_volume(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Reflection", "Multiplier to make out-scattered light brighter or darker (non-physically correct)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "emission_col"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Emission Color", "Color of emitted light"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - + prop = RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "emission"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "asymmetry", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "asymmetry"); RNA_def_property_range(prop, -1.0f, 1.0f); @@ -1407,113 +1407,113 @@ static void rna_def_material_halo(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Size", "Dimension of the halo"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "hardness", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "har"); RNA_def_property_range(prop, 0, 127); RNA_def_property_ui_text(prop, "Hardness", "Hardness of the halo"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "add", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "add"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Add", "Strength of the add effect"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "ring_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ringc"); RNA_def_property_range(prop, 0, 24); RNA_def_property_ui_text(prop, "Rings", "Number of rings rendered over the halo"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "line_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "linec"); RNA_def_property_range(prop, 0, 250); RNA_def_property_ui_text(prop, "Line Number", "Number of star shaped lines rendered over the halo"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "star_tip_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "starc"); RNA_def_property_range(prop, 3, 50); RNA_def_property_ui_text(prop, "Star Tips", "Number of points on the star shaped halo"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "seed1"); RNA_def_property_range(prop, 0, 255); RNA_def_property_ui_text(prop, "Seed", "Randomize ring dimension and line location"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_flare_mode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_FLARE); /* use bitflags */ RNA_def_property_ui_text(prop, "Flare", "Render halo as a lens flare"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "flare_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "flaresize"); RNA_def_property_range(prop, 0.1f, 25.0f); RNA_def_property_ui_text(prop, "Flare Size", "Factor by which the flare is larger than the halo"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "flare_subflare_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "subsize"); RNA_def_property_range(prop, 0.1f, 25.0f); RNA_def_property_ui_text(prop, "Flare Subsize", "Dimension of the sub-flares, dots and circles"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "flare_boost", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "flareboost"); RNA_def_property_range(prop, 0.1f, 10.0f); RNA_def_property_ui_text(prop, "Flare Boost", "Give the flare extra strength"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "flare_seed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "seed2"); RNA_def_property_range(prop, 0, 255); RNA_def_property_ui_text(prop, "Flare Seed", "Offset in the flare seed table"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "flare_subflare_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "flarec"); RNA_def_property_range(prop, 1, 32); RNA_def_property_ui_text(prop, "Flares Sub", "Number of sub-flares"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_ring", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_RINGS); RNA_def_property_ui_text(prop, "Rings", "Render rings over halo"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_lines", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_LINES); RNA_def_property_ui_text(prop, "Lines", "Render star shaped lines over halo"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_star", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STAR); RNA_def_property_ui_text(prop, "Star", "Render halo as a star"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX); RNA_def_property_ui_text(prop, "Texture", "Give halo a texture"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_vertex_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO); RNA_def_property_ui_text(prop, "Vertex Normal", "Use the vertex normal to specify the dimension of the halo"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_extreme_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_XALPHA); RNA_def_property_ui_text(prop, "Extreme Alpha", "Use extreme alpha"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_shaded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SHADE); RNA_def_property_ui_text(prop, "Shaded", "Let halo receive light and shadows from external objects"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_soft", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALO_SOFT); RNA_def_property_ui_text(prop, "Soft", "Soften the edges of halos at intersections with other geometry"); @@ -1594,7 +1594,7 @@ static void rna_def_material_sss(BlenderRNA *brna) static void rna_def_material_specularity(StructRNA *srna) { PropertyRNA *prop; - + static const EnumPropertyItem prop_specular_shader_items[] = { {MA_SPEC_COOKTORR, "COOKTORR", 0, "CookTorr", "Use a Cook-Torrance shader"}, {MA_SPEC_PHONG, "PHONG", 0, "Phong", "Use a Phong shader"}, @@ -1603,13 +1603,13 @@ static void rna_def_material_specularity(StructRNA *srna) {MA_SPEC_WARDISO, "WARDISO", 0, "WardIso", "Use a Ward anisotropic shader"}, {0, NULL, 0, NULL, NULL} }; - + prop = RNA_def_property(srna, "specular_shader", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "spec_shader"); RNA_def_property_enum_items(prop, prop_specular_shader_items); RNA_def_property_ui_text(prop, "Specular Shader Model", ""); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_range(prop, 0, 1); @@ -1666,7 +1666,7 @@ static void rna_def_material_strand(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_STR); RNA_def_property_ui_text(prop, "Tangent Shading", "Use direction of strands as normal for tangent-shading"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + /* this flag is only set when rendering, not to be edited manually */ prop = RNA_def_property(srna, "use_surface_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_STR_SURFDIFF); @@ -1727,12 +1727,12 @@ static void rna_def_material_physics(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "MaterialPhysics", NULL); RNA_def_struct_sdna(srna, "Material"); RNA_def_struct_nested(brna, srna, "Material"); RNA_def_struct_ui_text(srna, "Material Physics", "Physics settings for a Material data-block"); - + prop = RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "friction"); RNA_def_property_range(prop, 0, 100); @@ -1755,12 +1755,12 @@ static void rna_def_material_physics(BlenderRNA *brna) RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2); RNA_def_property_ui_text(prop, "Force", "Upward spring force, when inside the physics distance area"); - + prop = RNA_def_property(srna, "fh_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fhdist"); RNA_def_property_range(prop, 0, 20); RNA_def_property_ui_text(prop, "Distance", "Distance of the physics area"); - + prop = RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xyfrict"); RNA_def_property_range(prop, 0, 1); @@ -1785,7 +1785,7 @@ void RNA_def_material(BlenderRNA *brna) {MA_RAYTRANSP, "RAYTRACE", 0, "Raytrace", "Use raytracing for transparent refraction rendering"}, {0, NULL, 0, NULL, NULL} }; - + /* Render Preview Types */ static const EnumPropertyItem preview_type_items[] = { {MA_FLAT, "FLAT", ICON_MATPLANE, "Flat", "Flat XY plane"}, @@ -1809,7 +1809,7 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Material", "Material data-block to define the appearance of geometric objects for rendering"); RNA_def_struct_ui_icon(srna, ICON_MATERIAL_DATA); - + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "material_type"); RNA_def_property_enum_items(prop, prop_type_items); @@ -1827,14 +1827,14 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_enum_items(prop, transparency_items); RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + /* For Preview Render */ prop = RNA_def_property(srna, "preview_render_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "pr_type"); RNA_def_property_enum_items(prop, preview_type_items); RNA_def_property_ui_text(prop, "Preview render type", "Type of preview render"); RNA_def_property_update(prop, 0, "rna_Material_update_previews"); - + prop = RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "amb"); RNA_def_property_range(prop, 0, 1); @@ -1851,13 +1851,13 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Translucency", "Amount of diffuse shading on the back side"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_cubic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_CUBIC); RNA_def_property_ui_text(prop, "Cubic Interpolation", "Use cubic interpolation for diffuse values, for smoother transitions"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_object_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shade_flag", MA_OBCOLOR); RNA_def_property_ui_text(prop, "Object Color", "Modulate the result with a per-object color"); @@ -1894,7 +1894,7 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT, "rna_Material_update"); /* flags */ - + prop = RNA_def_property(srna, "use_light_group_exclusive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_GROUP_NOLAY); RNA_def_property_ui_text(prop, "Light Group Exclusive", @@ -1912,17 +1912,17 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Traceable", "Include this material and geometry that uses it in raytracing calculations"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW); RNA_def_property_ui_text(prop, "Shadows", "Allow this material to receive shadows"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_shadeless", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHLESS); RNA_def_property_ui_text(prop, "Shadeless", "Make this material insensitive to light or shadow"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - + prop = RNA_def_property(srna, "use_vertex_color_light", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_VERTEXCOL); RNA_def_property_ui_text(prop, "Vertex Color Light", "Add vertex colors as additional lighting"); @@ -1934,7 +1934,7 @@ void RNA_def_material(BlenderRNA *brna) "Replace object base color with vertex colors (multiply with " "'texture face' face assigned textures)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ZINV); RNA_def_property_ui_text(prop, "Invert Z Depth", @@ -1945,13 +1945,13 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "zoffs"); RNA_def_property_ui_text(prop, "Z Offset", "Give faces an artificial offset in the Z buffer for Z transparency"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ENV); RNA_def_property_ui_text(prop, "Sky", "Render this material with zero alpha, with sky background in place (scanline only)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_only_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYSHADOW); RNA_def_property_ui_text(prop, "Only Shadow", @@ -1964,49 +1964,49 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_shadows_only_items); RNA_def_property_ui_text(prop, "Shadow Type", "How to draw shadows"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_face_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE); RNA_def_property_ui_text(prop, "Face Textures", "Replace the object's base color with color from UV map image textures"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_face_texture_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FACETEXTURE_ALPHA); RNA_def_property_ui_text(prop, "Face Textures Alpha", "Replace the object's base alpha value with alpha from UV map image textures"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_cast_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode2", MA_CASTSHADOW); RNA_def_property_ui_text(prop, "Cast Shadows", "Allow this material to cast shadows"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_cast_shadows_only", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_ONLYCAST); RNA_def_property_ui_text(prop, "Cast Shadows Only", "Make objects with this material appear invisible (not rendered), only casting shadows"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_mist", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", MA_NOMIST); RNA_def_property_ui_text(prop, "Use Mist", "Use mist with this material (in world settings)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_transparent_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA); RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows cast through other objects"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_ray_shadow_bias", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYBIAS); RNA_def_property_ui_text(prop, "Ray Shadow Bias", "Prevent raytraced shadow errors on surfaces with smooth shaded normals " "(terminator problem)"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_full_oversampling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_FULL_OSA); RNA_def_property_ui_text(prop, "Full Oversampling", @@ -2024,14 +2024,14 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Cast Approximate", "Allow this material to cast shadows when using approximate ambient occlusion"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_tangent_shading", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TANGENT_V); RNA_def_property_ui_text(prop, "Tangent Shading", "Use the material's tangent vector instead of the normal for shading " "- for anisotropic shading effects"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + prop = RNA_def_property(srna, "use_uv_project", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mapflag", MA_MAPFLAG_UVPROJECT); RNA_def_property_ui_text(prop, "UV Project", @@ -2074,7 +2074,7 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_struct_type(prop, "MaterialStrand"); RNA_def_property_pointer_funcs(prop, "rna_Material_strand_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Strand", "Strand settings for the material"); - + prop = RNA_def_property(srna, "physics", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "MaterialPhysics"); @@ -2160,14 +2160,14 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF | FUNC_USE_CONTEXT | FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex"); RNA_def_function_return(func, parm); - + func = RNA_def_function(srna, "create", "rna_mtex_texture_slots_create"); RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF | FUNC_USE_CONTEXT | FUNC_USE_REPORTS); parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize", 0, INT_MAX); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex"); RNA_def_function_return(func, parm); - + func = RNA_def_function(srna, "clear", "rna_mtex_texture_slots_clear"); RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF | FUNC_USE_CONTEXT | FUNC_USE_REPORTS); parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear", 0, INT_MAX); @@ -2218,7 +2218,7 @@ static void rna_def_tex_slot(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "uvname"); RNA_def_property_ui_text(prop, "UV Map", "Name of UV map"); RNA_def_property_update(prop, NC_GEOM | ND_DATA, "rna_Material_update"); - + prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Index", "Index of MTex slot in the material"); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index e115485b192..f09fd29889a 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -3222,7 +3222,7 @@ static void rna_def_skin_vertices(BlenderRNA *brna, PropertyRNA *UNUSED(cprop)) RNA_def_property_boolean_sdna(prop, NULL, "flag", MVERT_SKIN_ROOT); RNA_def_property_ui_text(prop, "Root", "Vertex is a root for rotation calculations and armature generation"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); - + prop = RNA_def_property(srna, "use_loose", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MVERT_SKIN_LOOSE); RNA_def_property_ui_text(prop, "Loose", "If vertex has multiple adjacent edges, it is hulled to them directly"); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index 9b0a25560f9..51cb96e5d42 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -54,10 +54,10 @@ static const char *rna_Mesh_unit_test_compare(struct Mesh *mesh, struct Mesh *mesh2) { const char *ret = BKE_mesh_cmp(mesh, mesh2, FLT_EPSILON * 60); - + if (!ret) ret = "Same"; - + return ret; } diff --git a/source/blender/makesrna/intern/rna_mesh_utils.h b/source/blender/makesrna/intern/rna_mesh_utils.h index 93b3fd6579e..2bcce9d2a00 100644 --- a/source/blender/makesrna/intern/rna_mesh_utils.h +++ b/source/blender/makesrna/intern/rna_mesh_utils.h @@ -23,7 +23,7 @@ /** \file blender/makesrna/intern/rna_mesh_utils.h * \ingroup RNA */ - + #ifndef __RNA_MESH_UTILS_H__ #define __RNA_MESH_UTILS_H__ diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index a2d35702cc3..999dab60bc0 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -62,32 +62,32 @@ static int rna_Meta_texspace_editable(PointerRNA *ptr, const char **UNUSED(r_inf static void rna_Meta_texspace_loc_get(PointerRNA *ptr, float *values) { MetaBall *mb = (MetaBall *)ptr->data; - + /* tex_space_mball() needs object.. ugh */ - + copy_v3_v3(values, mb->loc); } static void rna_Meta_texspace_loc_set(PointerRNA *ptr, const float *values) { MetaBall *mb = (MetaBall *)ptr->data; - + copy_v3_v3(mb->loc, values); } static void rna_Meta_texspace_size_get(PointerRNA *ptr, float *values) { MetaBall *mb = (MetaBall *)ptr->data; - + /* tex_space_mball() needs object.. ugh */ - + copy_v3_v3(values, mb->size); } static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values) { MetaBall *mb = (MetaBall *)ptr->data; - + copy_v3_v3(mb->size, values); } @@ -102,7 +102,7 @@ static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) for (ob = bmain->object.first; ob; ob = ob->id.next) if (ob->data == mb) BKE_mball_properties_copy(bmain->eval_ctx, scene, ob); - + DAG_id_tag_update(&mb->id, 0); WM_main_add_notifier(NC_GEOM | ND_DATA, mb); } @@ -198,7 +198,7 @@ static void rna_def_metaelement(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_metaelem_type_items); RNA_def_property_ui_text(prop, "Type", "Metaball types"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); - + /* number values */ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "x"); @@ -237,19 +237,19 @@ static void rna_def_metaelement(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_ui_text(prop, "Size Z", "Size of element, use of components depends on element type"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); - + prop = RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "s"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Stiffness", "Stiffness defines how much of the element to fill"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); - + /* flags */ prop = RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_NEGATIVE); RNA_def_property_ui_text(prop, "Negative", "Set metaball as negative one"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); - + prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_HIDE); RNA_def_property_ui_text(prop, "Hide", "Hide element"); @@ -302,7 +302,7 @@ static void rna_def_metaball(BlenderRNA *brna) {MB_UPDATE_NEVER, "NEVER", 0, "Never", "While editing, don't update metaball at all"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "MetaBall", "ID"); RNA_def_struct_ui_text(srna, "MetaBall", "Metaball data-block to defined blobby surfaces"); RNA_def_struct_ui_icon(srna, ICON_META_DATA); @@ -319,7 +319,7 @@ static void rna_def_metaball(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_update_items); RNA_def_property_ui_text(prop, "Update", "Metaball edit update behavior"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); - + /* number values */ prop = RNA_def_property(srna, "resolution", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "wiresize"); @@ -327,14 +327,14 @@ static void rna_def_metaball(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.05f, 1000.0f, 2.5f, 3); RNA_def_property_ui_text(prop, "Wire Size", "Polygonization resolution in the 3D viewport"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); - + prop = RNA_def_property(srna, "render_resolution", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "rendersize"); RNA_def_property_range(prop, 0.005f, 10000.0f); RNA_def_property_ui_range(prop, 0.025f, 1000.0f, 2.5f, 3); RNA_def_property_ui_text(prop, "Render Size", "Polygonization resolution in rendering"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); - + prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "thresh"); RNA_def_property_range(prop, 0.0f, 5.0f); @@ -346,14 +346,14 @@ static void rna_def_metaball(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "texflag", MB_AUTOSPACE); RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object"); - + prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location"); RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable"); RNA_def_property_float_funcs(prop, "rna_Meta_texspace_loc_get", "rna_Meta_texspace_loc_set", NULL); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); - + prop = RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 3); RNA_def_property_flag(prop, PROP_PROPORTIONAL); @@ -361,7 +361,7 @@ static void rna_def_metaball(BlenderRNA *brna) RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable"); RNA_def_property_float_funcs(prop, "rna_Meta_texspace_size_get", "rna_Meta_texspace_size_set", NULL); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); - + /* not supported yet */ #if 0 prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); @@ -370,7 +370,7 @@ static void rna_def_metaball(BlenderRNA *brna) RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); #endif - + /* materials */ prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); @@ -378,7 +378,7 @@ static void rna_def_metaball(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Materials", ""); RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int"); - + prop = RNA_def_property(srna, "is_editmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Meta_is_editmode_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 0ebd29b200c..c3ba1372a44 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -425,19 +425,19 @@ static void rna_Modifier_name_set(PointerRNA *ptr, const char *value) { ModifierData *md = ptr->data; char oldname[sizeof(md->name)]; - + /* make a copy of the old name first */ BLI_strncpy(oldname, md->name, sizeof(md->name)); - + /* copy the new name into the name slot */ BLI_strncpy_utf8(md->name, value, sizeof(md->name)); - + /* make sure the name is truly unique */ if (ptr->id.data) { Object *ob = ptr->id.data; modifier_unique_name(&ob->modifiers, md); } - + /* fix all the animation data which may link to this */ BKE_animdata_fix_paths_rename_all(NULL, "modifiers", oldname, md->name); } @@ -695,7 +695,7 @@ static int rna_ShrinkwrapModifier_face_cull_get(PointerRNA *ptr) static void rna_ShrinkwrapModifier_face_cull_set(struct PointerRNA *ptr, int value) { ShrinkwrapModifierData *swm = (ShrinkwrapModifierData *)ptr->data; - + swm->shrinkOpts = (swm->shrinkOpts & ~(MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE | MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)) | value; } @@ -736,27 +736,27 @@ static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value) static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA *ptr) { OceanModifierData *omd = (OceanModifierData *)ptr->data; - + omd->refresh |= (MOD_OCEAN_REFRESH_RESET | MOD_OCEAN_REFRESH_SIM | MOD_OCEAN_REFRESH_CLEAR_CACHE); - + rna_Modifier_update(bmain, scene, ptr); } static void rna_OceanModifier_sim_update(Main *bmain, Scene *scene, PointerRNA *ptr) { OceanModifierData *omd = (OceanModifierData *)ptr->data; - + omd->refresh |= MOD_OCEAN_REFRESH_SIM; - + rna_Modifier_update(bmain, scene, ptr); } static void rna_OceanModifier_topology_update(Main *bmain, Scene *scene, PointerRNA *ptr) { OceanModifierData *omd = (OceanModifierData *)ptr->data; - + omd->refresh |= MOD_OCEAN_REFRESH_TOPOLOGY; - + rna_Modifier_update(bmain, scene, ptr); } @@ -764,9 +764,9 @@ static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value) { OceanModifierData *omd = (OceanModifierData *)ptr->data; float old_value = omd->chop_amount; - + omd->chop_amount = value; - + if ((old_value == 0.0f && value > 0.0f) || (old_value > 0.0f && value == 0.0f)) { @@ -1241,7 +1241,7 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_ControlEdges); RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "use_subsurf_uv", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_SubsurfUv); RNA_def_property_ui_text(prop, "Subdivide UVs", "Use subsurf to subdivide UVs"); @@ -1427,7 +1427,7 @@ static void rna_def_modifier_lattice(BlenderRNA *brna) "Name of Vertex Group which determines influence of modifier per point"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_LatticeModifier_name_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, 0, 1, 10, 2); @@ -1501,7 +1501,7 @@ static void rna_def_modifier_build(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_BUILD_FLAG_REVERSE); RNA_def_property_ui_text(prop, "Reversed", "Deconstruct the mesh instead of building it"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "use_random_order", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_BUILD_FLAG_RANDOMIZE); RNA_def_property_ui_text(prop, "Randomize", "Randomize the faces or edges during build"); @@ -1547,7 +1547,7 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_VGROUP); RNA_def_property_ui_text(prop, "Mirror Vertex Groups", "Mirror vertex groups (e.g. .R->.L)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "use_mirror_merge", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MOD_MIR_NO_MERGE); RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices within the merge threshold"); @@ -1864,7 +1864,7 @@ static void rna_def_modifier_armature(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP); RNA_def_property_ui_text(prop, "Use Vertex Groups", "Bind vertex groups to armature modifier"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "use_deform_preserve_volume", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION); RNA_def_property_ui_text(prop, "Preserve Volume", "Deform rotation interpolation with quaternions"); @@ -1875,7 +1875,7 @@ static void rna_def_modifier_armature(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Multi Modifier", "Use same input as previous modifier, and mix results using overall vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", @@ -1939,7 +1939,7 @@ static void rna_def_modifier_hook(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_pointer_funcs(prop, NULL, "rna_HookModifier_object_set", NULL, NULL); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); - + prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", @@ -2085,7 +2085,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_CONST); RNA_def_property_ui_text(prop, "Constant Offset", "Add a constant offset"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "constant_offset_displace", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_ui_text(prop, "Constant Offset Displacement", "Value for the distance between arrayed items"); @@ -2135,7 +2135,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) "rotational change between arrayed items"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); - + /* Caps */ prop = RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap"); @@ -2148,7 +2148,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL, "rna_Mesh_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); - + prop = RNA_def_property(srna, "offset_u", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "uv_offset[0]"); RNA_def_property_range(prop, -1, 1); @@ -2302,7 +2302,7 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, 1000, 1, 3); RNA_def_property_ui_text(prop, "Vertical Aspect Ratio", ""); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scalex"); RNA_def_property_flag(prop, PROP_PROPORTIONAL); @@ -2372,7 +2372,7 @@ static void rna_def_modifier_smooth(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 30, 1, -1); RNA_def_property_ui_text(prop, "Repeat", ""); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", @@ -2494,7 +2494,7 @@ static void rna_def_modifier_laplaciansmooth(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_LAPLACIANSMOOTH_PRESERVE_VOLUME); RNA_def_property_ui_text(prop, "Preserve Volume", "Apply volume preservation after smooth"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "use_normalized", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_LAPLACIANSMOOTH_NORMALIZED); RNA_def_property_ui_text(prop, "Normalized", "Improve and stabilize the enhanced shape"); @@ -2519,7 +2519,7 @@ static void rna_def_modifier_laplaciansmooth(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 200, 1, -1); RNA_def_property_ui_text(prop, "Repeat", ""); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", @@ -2550,7 +2550,7 @@ static void rna_def_modifier_cast(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_cast_type_items); RNA_def_property_ui_text(prop, "Cast Type", "Target object shape"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect"); @@ -2572,17 +2572,17 @@ static void rna_def_modifier_cast(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Z); RNA_def_property_ui_text(prop, "Z", ""); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "use_radius_as_size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_SIZE_FROM_RADIUS); RNA_def_property_ui_text(prop, "From Radius", "Use radius as size of projection shape (0 = auto)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "use_transform", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_USE_OB_TRANSFORM); RNA_def_property_ui_text(prop, "Use transform", "Use object transform to control projection shape"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); @@ -2633,12 +2633,12 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL, "rna_Mesh_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); - + prop = RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_MeshDeformModifier_is_bound_get", NULL); RNA_def_property_ui_text(prop, "Bound", "Whether geometry has been bound to control cage"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); @@ -2680,7 +2680,7 @@ static void rna_def_modifier_particlesystem(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "ParticleSystem Modifier", "Particle system simulation modifier"); RNA_def_struct_sdna(srna, "ParticleSystemModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES); - + prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "psys"); @@ -2884,22 +2884,22 @@ static void rna_def_modifier_cloth(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Cloth Modifier", "Cloth simulation modifier"); RNA_def_struct_sdna(srna, "ClothModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_CLOTH); - + prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "sim_parms"); RNA_def_property_ui_text(prop, "Cloth Settings", ""); - + prop = RNA_def_property(srna, "collision_settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "coll_parms"); RNA_def_property_ui_text(prop, "Cloth Collision Settings", ""); - + prop = RNA_def_property(srna, "solver_result", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ClothSolverResult"); RNA_def_property_pointer_sdna(prop, NULL, "solver_result"); RNA_def_property_ui_text(prop, "Solver Result", ""); - + prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Point Cache", ""); @@ -2924,7 +2924,7 @@ static void rna_def_modifier_smoke(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem prop_smoke_type_items[] = { {0, "NONE", 0, "None", ""}, {MOD_SMOKE_TYPE_DOMAIN, "DOMAIN", 0, "Domain", ""}, @@ -2932,24 +2932,24 @@ static void rna_def_modifier_smoke(BlenderRNA *brna) {MOD_SMOKE_TYPE_COLL, "COLLISION", 0, "Collision", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "SmokeModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Smoke Modifier", "Smoke simulation modifier"); RNA_def_struct_sdna(srna, "SmokeModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SMOKE); - + prop = RNA_def_property(srna, "domain_settings", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "domain"); RNA_def_property_ui_text(prop, "Domain Settings", ""); - + prop = RNA_def_property(srna, "flow_settings", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "flow"); RNA_def_property_ui_text(prop, "Flow Settings", ""); - + prop = RNA_def_property(srna, "coll_settings", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "coll"); RNA_def_property_ui_text(prop, "Collision Settings", ""); - + prop = RNA_def_property(srna, "smoke_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_smoke_type_items); @@ -2962,16 +2962,16 @@ static void rna_def_modifier_dynamic_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "DynamicPaintModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Dynamic Paint Modifier", "Dynamic Paint modifier"); RNA_def_struct_sdna(srna, "DynamicPaintModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_DYNAMICPAINT); - + prop = RNA_def_property(srna, "canvas_settings", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "canvas"); RNA_def_property_ui_text(prop, "Canvas Settings", ""); - + prop = RNA_def_property(srna, "brush_settings", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "brush"); RNA_def_property_ui_text(prop, "Brush Settings", ""); @@ -3124,7 +3124,7 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) "Shrink the mesh to the nearest target vertex"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem shrink_face_cull_items[] = { {0, "OFF", 0, "Off", "No culling"}, {MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, "FRONT", 0, "Front", "No projection when in front of the face"}, @@ -3200,7 +3200,7 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS); RNA_def_property_ui_text(prop, "Z", ""); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "subsurfLevels"); RNA_def_property_range(prop, 0, 6); @@ -4043,7 +4043,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem geometry_items[] = { {MOD_OCEAN_GEOM_GENERATE, "GENERATE", 0, "Generate", "Generate ocean surface geometry at the specified resolution"}, @@ -4054,24 +4054,24 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) #endif {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "OceanModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Ocean Modifier", "Simulate an ocean surface"); RNA_def_struct_sdna(srna, "OceanModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_OCEAN); - + prop = RNA_def_property(srna, "geometry_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "geometry_mode"); RNA_def_property_enum_items(prop, geometry_items); RNA_def_property_ui_text(prop, "Geometry", "Method of modifying geometry"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Size", "Surface scale factor (does not affect the height of the waves)"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, -1); RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update"); - + prop = RNA_def_property(srna, "repeat_x", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "repeat_x"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -4079,7 +4079,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, 100, 1, -1); RNA_def_property_ui_text(prop, "Repeat X", "Repetitions of the generated surface in X"); RNA_def_property_update(prop, 0, "rna_OceanModifier_topology_update"); - + prop = RNA_def_property(srna, "repeat_y", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "repeat_y"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -4094,13 +4094,13 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Generate Normals", "Output normals for bump mapping - disabling can speed up performance if its not needed"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "use_foam", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_OCEAN_GENERATE_FOAM); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Generate Foam", "Generate foam mask as a vertex color channel"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "resolution"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -4108,7 +4108,7 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, 32, 1, -1); RNA_def_property_ui_text(prop, "Resolution", "Resolution of the generated surface"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "spatial_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "spatial_size"); RNA_def_property_ui_range(prop, 1, 512, 2, -1); @@ -4116,66 +4116,66 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Spatial Size", "Size of the simulation domain (in meters), and of the generated geometry (in BU)"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "wind_velocity", PROP_FLOAT, PROP_VELOCITY); RNA_def_property_float_sdna(prop, NULL, "wind_velocity"); RNA_def_property_ui_text(prop, "Wind Velocity", "Wind speed"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "damp"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Damping", "Damp reflected waves going in opposite direction to the wind"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "wave_scale_min", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "smallest_wave"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0, FLT_MAX); RNA_def_property_ui_text(prop, "Smallest Wave", "Shortest allowed wavelength"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "wave_alignment", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "wave_alignment"); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Wave Alignment", "How much the waves are aligned to each other"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "wave_direction", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "wave_direction"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Wave Direction", "Main direction of the waves when they are (partially) aligned"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "wave_scale", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "wave_scale"); RNA_def_property_ui_text(prop, "Wave Scale", "Scale of the displacement effect"); RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update"); - + prop = RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "depth"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Depth", "Depth of the solid ground below the water surface"); RNA_def_property_ui_range(prop, 0, 250, 1, -1); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "foam_coverage", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "foam_coverage"); RNA_def_property_ui_text(prop, "Foam Coverage", "Amount of generated foam"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "bake_foam_fade", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "foam_fade"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Foam Fade", "How much foam accumulates over time (baked ocean only)"); RNA_def_property_ui_range(prop, 0.0, 10.0, 1, -1); RNA_def_property_update(prop, 0, NULL); - + prop = RNA_def_property(srna, "foam_layer_name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "foamlayername"); RNA_def_property_ui_text(prop, "Foam Layer Name", "Name of the vertex color layer used for foam"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "choppiness", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "chop_amount"); RNA_def_property_ui_text(prop, "Choppiness", @@ -4183,31 +4183,31 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0, 4.0, 3, -1); RNA_def_property_float_funcs(prop, NULL, "rna_OceanModifier_ocean_chop_set", NULL); RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update"); - + prop = RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "time"); RNA_def_property_ui_text(prop, "Time", "Current time of the simulation"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, -1); RNA_def_property_update(prop, 0, "rna_OceanModifier_sim_update"); - + prop = RNA_def_property(srna, "random_seed", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "seed"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Random Seed", "Seed of the random generator"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "bakestart"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Bake Start", "Start frame of the ocean baking"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "bakeend"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Bake End", "End frame of the ocean baking"); RNA_def_property_update(prop, 0, "rna_OceanModifier_init_update"); - + prop = RNA_def_property(srna, "is_cached", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cached", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -4904,28 +4904,28 @@ void RNA_def_modifier(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + /* data */ srna = RNA_def_struct(brna, "Modifier", NULL); RNA_def_struct_ui_text(srna, "Modifier", "Modifier affecting the geometry data of an object"); RNA_def_struct_refine_func(srna, "rna_Modifier_refine"); RNA_def_struct_path_func(srna, "rna_Modifier_path"); RNA_def_struct_sdna(srna, "ModifierData"); - + /* strings */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Modifier_name_set"); RNA_def_property_ui_text(prop, "Name", "Modifier name"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER | NA_RENAME, NULL); RNA_def_struct_name_property(srna, prop); - + /* enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, rna_enum_object_modifier_type_items); RNA_def_property_ui_text(prop, "Type", ""); - + /* flags */ prop = RNA_def_property(srna, "show_viewport", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime); @@ -4933,25 +4933,25 @@ void RNA_def_modifier(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0); - + prop = RNA_def_property(srna, "show_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render); RNA_def_property_ui_text(prop, "Render", "Use modifier during render"); RNA_def_property_ui_icon(prop, ICON_SCENE, 0); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); - + prop = RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode); RNA_def_property_ui_text(prop, "Edit Mode", "Display modifier in Edit mode"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0); - + prop = RNA_def_property(srna, "show_on_cage", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_OnCage); RNA_def_property_ui_text(prop, "On Cage", "Adjust edit cage to modifier result"); RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - + prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface"); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index ce2fba37053..d76f2ccf443 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -64,10 +64,10 @@ static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) { NlaStrip *data = (NlaStrip *)ptr->data; - + /* copy the name first */ BLI_strncpy_utf8(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); @@ -79,12 +79,12 @@ static char *rna_NlaStrip_path(PointerRNA *ptr) { NlaStrip *strip = (NlaStrip *)ptr->data; AnimData *adt = BKE_animdata_from_id(ptr->id.data); - + /* if we're attached to AnimData, try to resolve path back to AnimData */ if (adt) { NlaTrack *nlt; NlaStrip *nls; - + for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) { for (nls = nlt->strips.first; nls; nls = nls->next) { if (nls == strip) { @@ -100,7 +100,7 @@ static char *rna_NlaStrip_path(PointerRNA *ptr) } } } - + /* no path */ return BLI_strdup(""); } @@ -134,7 +134,7 @@ static void rna_NlaStrip_transform_update(Main *bmain, Scene *scene, PointerRNA static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) { NlaStrip *data = (NlaStrip *)ptr->data; - + /* clamp value to lie within valid limits * - cannot start past the end of the strip + some flexibility threshold * - cannot start before the previous strip (if present) ends @@ -145,7 +145,7 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) if (data->prev) { if (data->prev->type == NLASTRIP_TYPE_TRANSITION) { CLAMP(value, data->prev->start + NLASTRIP_MIN_LEN_THRESH, data->end - NLASTRIP_MIN_LEN_THRESH); - + /* re-adjust the transition to stick to the endpoints of the action-clips */ data->prev->end = value; } @@ -162,7 +162,7 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) { NlaStrip *data = (NlaStrip *)ptr->data; - + /* clamp value to lie within valid limits * - must not have zero or negative length strip, so cannot start before the first frame * + some minimum-strip-length threshold @@ -173,7 +173,7 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) if (data->next) { if (data->next->type == NLASTRIP_TYPE_TRANSITION) { CLAMP(value, data->start + NLASTRIP_MIN_LEN_THRESH, data->next->end - NLASTRIP_MIN_LEN_THRESH); - + /* readjust the transition to stick to the endpoints of the action-clips */ data->next->start = value; } @@ -185,16 +185,16 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) CLAMP(value, data->start + NLASTRIP_MIN_LEN_THRESH, MAXFRAME); } data->end = value; - - + + /* calculate the lengths the strip and its action (if applicable) */ if (data->type == NLASTRIP_TYPE_CLIP) { float len, actlen; - + len = data->end - data->start; actlen = data->actend - data->actstart; if (IS_EQF(actlen, 0.0f)) actlen = 1.0f; - + /* now, adjust the 'scale' setting to reflect this (so that this change can be valid) */ data->scale = len / ((actlen) * data->repeat); } @@ -203,12 +203,12 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value) { NlaStrip *data = (NlaStrip *)ptr->data; - + /* set scale value */ /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */ CLAMP(value, 0.0001f, 1000.0f); data->scale = value; - + /* adjust the strip extents in response to this */ BKE_nlastrip_recalculate_bounds(data); } @@ -216,12 +216,12 @@ static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value) static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value) { NlaStrip *data = (NlaStrip *)ptr->data; - + /* set repeat value */ /* NOTE: these need to be synced with the values in the property definition in rna_def_nlastrip() */ CLAMP(value, 0.01f, 1000.0f); data->repeat = value; - + /* adjust the strip extents in response to this */ BKE_nlastrip_recalculate_bounds(data); } @@ -230,11 +230,11 @@ static void rna_NlaStrip_blend_in_set(PointerRNA *ptr, float value) { NlaStrip *data = (NlaStrip *)ptr->data; float len; - + /* blend-in is limited to the length of the strip, and also cannot overlap with blendout */ len = (data->end - data->start) - data->blendout; CLAMP(value, 0, len); - + data->blendin = value; } @@ -242,30 +242,30 @@ static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value) { NlaStrip *data = (NlaStrip *)ptr->data; float len; - + /* blend-out is limited to the length of the strip */ len = (data->end - data->start); CLAMP(value, 0, len); - + /* it also cannot overlap with blendin */ if ((len - value) < data->blendin) value = len - data->blendin; - + data->blendout = value; } static void rna_NlaStrip_use_auto_blend_set(PointerRNA *ptr, int value) { NlaStrip *data = (NlaStrip *)ptr->data; - + if (value) { /* set the flag */ data->flag |= NLASTRIP_FLAG_AUTO_BLENDS; - + /* validate state to ensure that auto-blend gets applied immediately */ if (ptr->id.data) { IdAdtTemplate *iat = (IdAdtTemplate *)ptr->id.data; - + if (iat->adt) { BKE_nla_validate_state(iat->adt); } @@ -274,7 +274,7 @@ static void rna_NlaStrip_use_auto_blend_set(PointerRNA *ptr, int value) else { /* clear the flag */ data->flag &= ~NLASTRIP_FLAG_AUTO_BLENDS; - + /* clear the values too, so that it's clear that there has been an effect */ /* TODO: it's somewhat debatable whether it's better to leave these in instead... */ data->blendin = 0.0f; @@ -285,22 +285,22 @@ static void rna_NlaStrip_use_auto_blend_set(PointerRNA *ptr, int value) static int rna_NlaStrip_action_editable(PointerRNA *ptr, const char **UNUSED(r_info)) { NlaStrip *strip = (NlaStrip *)ptr->data; - + /* strip actions shouldn't be editable if NLA tweakmode is on */ if (ptr->id.data) { AnimData *adt = BKE_animdata_from_id(ptr->id.data); - + if (adt) { /* active action is only editable when it is not a tweaking strip */ if ((adt->flag & ADT_NLA_EDIT_ON) || (adt->actstrip) || (adt->tmpact)) return 0; } } - + /* check for clues that strip probably shouldn't be used... */ if (strip->flag & NLASTRIP_FLAG_TWEAKUSER) return 0; - + /* should be ok, though we may still miss some cases */ return PROP_EDITABLE; } @@ -308,11 +308,11 @@ static int rna_NlaStrip_action_editable(PointerRNA *ptr, const char **UNUSED(r_i static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value) { NlaStrip *data = (NlaStrip *)ptr->data; - + /* prevent start frame from occurring after end of action */ CLAMP(value, MINAFRAME, data->actend); data->actstart = value; - + /* adjust the strip extents in response to this */ /* TODO: should the strip be moved backwards instead as a special case? */ BKE_nlastrip_recalculate_bounds(data); @@ -321,11 +321,11 @@ static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value) { NlaStrip *data = (NlaStrip *)ptr->data; - + /* prevent end frame from starting before start of action */ CLAMP(value, data->actstart, MAXFRAME); data->actend = value; - + /* adjust the strip extents in response to this */ BKE_nlastrip_recalculate_bounds(data); } @@ -333,7 +333,7 @@ static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value) { NlaStrip *data = (NlaStrip *)ptr->data; - + if (value) { /* set the flag, then make sure a curve for this exists */ data->flag |= NLASTRIP_FLAG_USR_INFLUENCE; @@ -346,7 +346,7 @@ static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value) static void rna_NlaStrip_animated_time_set(PointerRNA *ptr, int value) { NlaStrip *data = (NlaStrip *)ptr->data; - + if (value) { /* set the flag, then make sure a curve for this exists */ data->flag |= NLASTRIP_FLAG_USR_TIME; @@ -372,22 +372,22 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo int start, bAction *action) { NlaStrip *strip = BKE_nlastrip_new(action); - + if (strip == NULL) { BKE_report(reports, RPT_ERROR, "Unable to create new strip"); return NULL; } - + strip->end += (start - strip->start); strip->start = start; - + if (BKE_nlastrips_add_strip(&track->strips, strip) == 0) { BKE_report(reports, RPT_ERROR, "Unable to add strip (the track does not have any space to accommodate this new strip)"); BKE_nlastrip_free(NULL, strip); return NULL; } - + /* create dummy AnimData block so that BKE_nlastrip_validate_name() * can be used to ensure a valid name, as we don't have one here... * - only the nla_tracks list is needed there, which we aim to reverse engineer here... @@ -395,25 +395,25 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo { AnimData adt = {NULL}; NlaTrack *nlt, *nlt_p; - + /* 'first' NLA track is found by going back up chain of given track's parents until we fall off */ nlt_p = track; nlt = track; while ((nlt = nlt->prev) != NULL) nlt_p = nlt; adt.nla_tracks.first = nlt_p; - + /* do the same thing to find the last track */ nlt_p = track; nlt = track; while ((nlt = nlt->next) != NULL) nlt_p = nlt; adt.nla_tracks.last = nlt_p; - + /* now we can just auto-name as usual */ BKE_nlastrip_validate_name(&adt, strip); } - + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); - + return strip; } @@ -443,7 +443,7 @@ static void rna_NlaTrack_solo_set(PointerRNA *ptr, int value) if (data == NULL) { return; } - + /* firstly, make sure 'solo' flag for all tracks is disabled */ for (nt = data; nt; nt = nt->next) { nt->flag &= ~NLATRACK_SOLO; @@ -451,12 +451,12 @@ static void rna_NlaTrack_solo_set(PointerRNA *ptr, int value) for (nt = data; nt; nt = nt->prev) { nt->flag &= ~NLATRACK_SOLO; } - + /* now, enable 'solo' for the given track if appropriate */ if (value) { /* set solo status */ data->flag |= NLATRACK_SOLO; - + /* set solo-status on AnimData */ adt->flag |= ADT_NLA_SOLO_TRACK; } @@ -519,7 +519,7 @@ static void rna_def_nlastrip(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + /* enum defs */ static const EnumPropertyItem prop_type_items[] = { {NLASTRIP_TYPE_CLIP, "CLIP", 0, "Action Clip", "NLA Strip references some Action"}, @@ -528,20 +528,20 @@ static void rna_def_nlastrip(BlenderRNA *brna) {NLASTRIP_TYPE_SOUND, "SOUND", 0, "Sound Clip", "NLA Strip representing a sound event for speakers"}, {0, NULL, 0, NULL, NULL} }; - + /* struct definition */ srna = RNA_def_struct(brna, "NlaStrip", NULL); RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action"); RNA_def_struct_path_func(srna, "rna_NlaStrip_path"); 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); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ - + /* Enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); @@ -549,19 +549,19 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Type of NLA Strip"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + prop = RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "extendmode"); RNA_def_property_enum_items(prop, rna_enum_nla_mode_extend_items); RNA_def_property_ui_text(prop, "Extrapolation", "Action to take for gaps past the strip extents"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "blendmode"); RNA_def_property_enum_items(prop, rna_enum_nla_mode_blend_items); RNA_def_property_ui_text(prop, "Blending", "Method used for combining strip's result with accumulated result"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + /* Strip extents */ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "start"); @@ -574,20 +574,20 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_end_frame_set", NULL); RNA_def_property_ui_text(prop, "End Frame", ""); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update"); - + /* Blending */ prop = RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blendin"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_in_set", NULL); RNA_def_property_ui_text(prop, "Blend In", "Number of frames at start of strip to fade in influence"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + prop = RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blendout"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL); RNA_def_property_ui_text(prop, "Blend Out", ""); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + prop = RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS); RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_use_auto_blend_set"); @@ -595,7 +595,7 @@ static void rna_def_nlastrip(BlenderRNA *brna) "Number of frames for Blending In/Out is automatically determined from " "overlapping strips"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + /* Action */ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act"); @@ -604,20 +604,20 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_editable_func(prop, "rna_NlaStrip_action_editable"); RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + /* Action extents */ prop = RNA_def_property(srna, "action_frame_start", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "actstart"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_start_frame_set", NULL); RNA_def_property_ui_text(prop, "Action Start Frame", "First frame from action to use"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update"); - + prop = RNA_def_property(srna, "action_frame_end", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "actend"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_end_frame_set", NULL); RNA_def_property_ui_text(prop, "Action End Frame", "Last frame from action to use"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update"); - + /* Action Reuse */ prop = RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "repeat"); @@ -627,7 +627,7 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_range(prop, 0.1f, 1000.0f); RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the action range"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update"); - + prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_scale_set", NULL); @@ -636,7 +636,7 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_range(prop, 0.0001f, 1000.0f); RNA_def_property_ui_text(prop, "Scale", "Scaling factor for action"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update"); - + /* Strip's F-Curves */ prop = RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fcurves", NULL); @@ -648,13 +648,13 @@ static void rna_def_nlastrip(BlenderRNA *brna) prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "FModifier"); RNA_def_property_ui_text(prop, "Modifiers", "Modifiers affecting all the F-Curves in the referenced Action"); - + /* Strip's Sub-Strips (for Meta-Strips) */ prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "NlaStrip"); RNA_def_property_ui_text(prop, "NLA Strips", "NLA Strips that this strip acts as a container for (if it is of type Meta)"); - + /* Settings - Values necessary for evaluation */ prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -663,14 +663,14 @@ static void rna_def_nlastrip(BlenderRNA *brna) * Even autokey only applies after the curves have been re-evaluated, causing the unkeyed values to be lost */ RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, /*"rna_NlaStrip_update"*/ NULL); - + prop = RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_TIME); RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate"); /* XXX: Update temporarily disabled so that the property can be edited at all! * Even autokey only applies after the curves have been re-evaluated, causing the unkeyed values to be lost */ RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, /*"rna_NlaStrip_update"*/ NULL); - + /* TODO: should the animated_influence/time settings be animatable themselves? */ prop = RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE); @@ -678,19 +678,19 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Animated Influence", "Influence setting is controlled by an F-Curve rather than automatically determined"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + prop = RNA_def_property(srna, "use_animated_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME); RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set"); RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + prop = RNA_def_property(srna, "use_animated_time_cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC); RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_transform_update"); - + /* settings */ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); /* can be made editable by hooking it up to the necessary NLA API methods */ @@ -698,24 +698,24 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_ACTIVE); RNA_def_property_ui_text(prop, "Active", "NLA Strip is active"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ - + prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_SELECT); RNA_def_property_ui_text(prop, "Select", "NLA Strip is selected"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ - + prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_MUTED); RNA_def_property_ui_text(prop, "Muted", "NLA Strip is not evaluated"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + prop = RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_REVERSE); RNA_def_property_ui_text(prop, "Reversed", "NLA Strip is played back in reverse order (only when timing is " "automatically determined)"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); - + prop = RNA_def_property(srna, "use_sync_length", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_SYNC_LENGTH); RNA_def_property_ui_text(prop, "Sync Action Length", @@ -761,11 +761,11 @@ static void rna_def_nlatrack(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "NlaTrack", NULL); RNA_def_struct_ui_text(srna, "NLA Track", "A animation layer containing Actions referenced as NLA strips"); RNA_def_struct_ui_icon(srna, ICON_NLA); - + /* strips collection */ prop = RNA_def_property(srna, "strips", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "NlaStrip"); @@ -778,7 +778,7 @@ static void rna_def_nlatrack(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ - + /* settings */ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); /* can be made editable by hooking it up to the necessary NLA API methods */ @@ -786,7 +786,7 @@ static void rna_def_nlatrack(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_ACTIVE); RNA_def_property_ui_text(prop, "Active", "NLA Track is active"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ - + prop = RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE); /* can be made editable by hooking it up to the necessary NLA API methods */ RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SOLO); @@ -800,7 +800,7 @@ static void rna_def_nlatrack(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SELECTED); RNA_def_property_ui_text(prop, "Select", "NLA Track is selected"); RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ - + prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_MUTED); RNA_def_property_ui_text(prop, "Muted", "NLA Track is not evaluated"); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index f976c286ea9..e2a581821f3 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -256,15 +256,15 @@ const EnumPropertyItem *rna_node_tree_type_itemf(void *data, int (*poll)(void *d ++i; continue; } - + tmp.value = i; tmp.identifier = nt->idname; tmp.icon = nt->ui_icon; tmp.name = nt->ui_name; tmp.description = nt->ui_description; - + RNA_enum_item_add(&item, &totitem, &tmp); - + ++i; } NODE_TREE_TYPES_END; @@ -331,15 +331,15 @@ const EnumPropertyItem *rna_node_type_itemf(void *data, int (*poll)(void *data, ++i; continue; } - + tmp.value = i; tmp.identifier = ntype->idname; tmp.icon = ntype->ui_icon; tmp.name = ntype->ui_name; tmp.description = ntype->ui_description; - + RNA_enum_item_add(&item, &totitem, &tmp); - + ++i; NODE_TYPES_END @@ -407,16 +407,16 @@ const EnumPropertyItem *rna_node_socket_type_itemf( ++i; continue; } - + srna = stype->ext_socket.srna; tmp.value = i; tmp.identifier = stype->idname; tmp.icon = RNA_struct_ui_icon(srna); tmp.name = RNA_struct_ui_name(srna); tmp.description = RNA_struct_ui_description(srna); - + RNA_enum_item_add(&item, &totitem, &tmp); - + ++i; NODE_SOCKET_TYPES_END @@ -520,7 +520,7 @@ static const EnumPropertyItem *rna_node_static_type_itemf(bContext *UNUSED(C), P static StructRNA *rna_NodeTree_refine(struct PointerRNA *ptr) { bNodeTree *ntree = (bNodeTree *)ptr->data; - + if (ntree->typeinfo->ext.srna) return ntree->typeinfo->ext.srna; else @@ -585,7 +585,7 @@ static void rna_NodeTree_get_from_context(const bContext *C, bNodeTreeType *ntre RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "context", &C); ntreetype->ext.call((bContext *)C, &ptr, func, &list); - + RNA_parameter_get_lookup(&list, "result_1", &ret1); RNA_parameter_get_lookup(&list, "result_2", &ret2); RNA_parameter_get_lookup(&list, "result_3", &ret3); @@ -649,7 +649,7 @@ static StructRNA *rna_NodeTree_register( nt->type = NTREE_CUSTOM; - nt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, nt->idname, &RNA_NodeTree); + nt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, nt->idname, &RNA_NodeTree); nt->ext.data = data; nt->ext.call = call; nt->ext.free = free; @@ -666,7 +666,7 @@ static StructRNA *rna_NodeTree_register( /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); - + return nt->ext.srna; } @@ -675,7 +675,7 @@ static bool rna_NodeTree_check(bNodeTree *ntree, ReportList *reports) if (!ntreeIsRegistered(ntree)) { if (reports) BKE_reportf(reports, RPT_ERROR, "Node tree '%s' has undefined type %s", ntree->id.name + 2, ntree->idname); - + return false; } else @@ -697,28 +697,28 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *C, ReportList *r { bNodeType *ntype; bNode *node; - + if (!rna_NodeTree_check(ntree, reports)) return NULL; - + ntype = nodeTypeFind(type); if (!ntype) { BKE_reportf(reports, RPT_ERROR, "Node type %s undefined", type); return NULL; } - + if (ntype->poll && !ntype->poll(ntype, ntree)) { BKE_reportf(reports, RPT_ERROR, "Cannot add node of type %s to node tree '%s'", type, ntree->id.name + 2); return NULL; } - + node = nodeAddNode(C, ntree, type); BLI_assert(node && node->typeinfo); - + if (ntree->type == NTREE_TEXTURE) { ntreeTexCheckCyclics(ntree); } - + ntreeUpdateTree(CTX_data_main(C), ntree); nodeUpdate(ntree, node); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); @@ -729,10 +729,10 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *C, ReportList *r static void rna_NodeTree_node_remove(bNodeTree *ntree, Main *bmain, ReportList *reports, PointerRNA *node_ptr) { bNode *node = node_ptr->data; - + if (!rna_NodeTree_check(ntree, reports)) return; - + if (BLI_findindex(&ntree->nodes, node) == -1) { BKE_reportf(reports, RPT_ERROR, "Unable to locate node '%s' in node tree", node->name); return; @@ -780,7 +780,7 @@ static void rna_NodeTree_active_node_set(PointerRNA *ptr, const PointerRNA value { bNodeTree *ntree = (bNodeTree *)ptr->data; bNode *node = (bNode *)value.data; - + if (node && BLI_findindex(&ntree->nodes, node) != -1) nodeSetActive(ntree, node); else @@ -804,7 +804,7 @@ static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, Main *bmain, ReportLis */ if (!fromnode || !tonode) return NULL; - + if (&fromsock->in_out == &tosock->in_out) { BKE_report(reports, RPT_ERROR, "Same input/output direction of sockets"); return NULL; @@ -819,7 +819,7 @@ static bNodeLink *rna_NodeTree_link_new(bNodeTree *ntree, Main *bmain, ReportLis } ret = nodeAddLink(ntree, fromnode, fromsock, tonode, tosock); - + if (ret) { /* not an issue from the UI, clear hidden from API to keep valid state. */ @@ -892,7 +892,7 @@ static void rna_NodeTree_active_input_set(PointerRNA *ptr, int value) bNodeTree *ntree = (bNodeTree *)ptr->data; bNodeSocket *gsock; int index; - + for (gsock = ntree->inputs.first, index = 0; gsock; gsock = gsock->next, ++index) { if (index == value) gsock->flag |= SELECT; @@ -921,7 +921,7 @@ static void rna_NodeTree_active_output_set(PointerRNA *ptr, int value) bNodeTree *ntree = (bNodeTree *)ptr->data; bNodeSocket *gsock; int index; - + for (gsock = ntree->inputs.first; gsock; gsock = gsock->next) { gsock->flag &= ~SELECT; } @@ -936,30 +936,30 @@ static void rna_NodeTree_active_output_set(PointerRNA *ptr, int value) static bNodeSocket *rna_NodeTree_inputs_new(bNodeTree *ntree, Main *bmain, ReportList *reports, const char *type, const char *name) { bNodeSocket *sock; - + if (!rna_NodeTree_check(ntree, reports)) return NULL; - + sock = ntreeAddSocketInterface(ntree, SOCK_IN, type, name); - + ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); - + return sock; } static bNodeSocket *rna_NodeTree_outputs_new(bNodeTree *ntree, Main *bmain, ReportList *reports, const char *type, const char *name) { bNodeSocket *sock; - + if (!rna_NodeTree_check(ntree, reports)) return NULL; - + sock = ntreeAddSocketInterface(ntree, SOCK_OUT, type, name); - + ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); - + return sock; } @@ -967,13 +967,13 @@ static void rna_NodeTree_socket_remove(bNodeTree *ntree, Main *bmain, ReportList { if (!rna_NodeTree_check(ntree, reports)) return; - + if (BLI_findindex(&ntree->inputs, sock) == -1 && BLI_findindex(&ntree->outputs, sock) == -1) { BKE_reportf(reports, RPT_ERROR, "Unable to locate socket '%s' in node", sock->identifier); } else { ntreeRemoveSocketInterface(ntree, sock); - + ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); } @@ -982,10 +982,10 @@ static void rna_NodeTree_socket_remove(bNodeTree *ntree, Main *bmain, ReportList static void rna_NodeTree_inputs_clear(bNodeTree *ntree, Main *bmain, ReportList *reports) { bNodeSocket *sock, *nextsock; - + if (!rna_NodeTree_check(ntree, reports)) return; - + for (sock = ntree->inputs.first; sock; sock = nextsock) { nextsock = sock->next; ntreeRemoveSocketInterface(ntree, sock); @@ -998,10 +998,10 @@ static void rna_NodeTree_inputs_clear(bNodeTree *ntree, Main *bmain, ReportList static void rna_NodeTree_outputs_clear(bNodeTree *ntree, Main *bmain, ReportList *reports) { bNodeSocket *sock, *nextsock; - + if (!rna_NodeTree_check(ntree, reports)) return; - + for (sock = ntree->outputs.first; sock; sock = nextsock) { nextsock = sock->next; ntreeRemoveSocketInterface(ntree, sock); @@ -1014,12 +1014,12 @@ static void rna_NodeTree_outputs_clear(bNodeTree *ntree, Main *bmain, ReportList static void rna_NodeTree_inputs_move(bNodeTree *ntree, Main *bmain, int from_index, int to_index) { bNodeSocket *sock; - + if (from_index == to_index) return; if (from_index < 0 || to_index < 0) return; - + sock = BLI_findlink(&ntree->inputs, from_index); if (to_index < from_index) { bNodeSocket *nextsock = BLI_findlink(&ntree->inputs, to_index); @@ -1035,9 +1035,9 @@ static void rna_NodeTree_inputs_move(bNodeTree *ntree, Main *bmain, int from_ind BLI_insertlinkafter(&ntree->inputs, prevsock, sock); } } - + ntree->update |= NTREE_UPDATE_GROUP_IN; - + ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); } @@ -1045,12 +1045,12 @@ static void rna_NodeTree_inputs_move(bNodeTree *ntree, Main *bmain, int from_ind static void rna_NodeTree_outputs_move(bNodeTree *ntree, Main *bmain, int from_index, int to_index) { bNodeSocket *sock; - + if (from_index == to_index) return; if (from_index < 0 || to_index < 0) return; - + sock = BLI_findlink(&ntree->outputs, from_index); if (to_index < from_index) { bNodeSocket *nextsock = BLI_findlink(&ntree->outputs, to_index); @@ -1066,9 +1066,9 @@ static void rna_NodeTree_outputs_move(bNodeTree *ntree, Main *bmain, int from_in BLI_insertlinkafter(&ntree->outputs, prevsock, sock); } } - + ntree->update |= NTREE_UPDATE_GROUP_OUT; - + ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); } @@ -1079,7 +1079,7 @@ static void rna_NodeTree_interface_update(bNodeTree *ntree, bContext *C) ntree->update |= NTREE_UPDATE_GROUP; ntreeUpdateTree(bmain, ntree); - + ED_node_tag_update_nodetree(bmain, ntree, NULL); } @@ -1098,7 +1098,7 @@ static int rna_NodeLink_is_hidden_get(PointerRNA *ptr) static StructRNA *rna_Node_refine(struct PointerRNA *ptr) { bNode *node = (bNode *)ptr->data; - + if (node->typeinfo->ext.srna) return node->typeinfo->ext.srna; else @@ -1407,7 +1407,7 @@ static bNodeType *rna_Node_register_base(Main *bmain, ReportList *reports, Struc if (nt) { rna_Node_unregister(bmain, nt->ext.srna); } - + /* create a new node type */ nt = MEM_callocN(sizeof(bNodeType), "node type"); memcpy(nt, &dummynt, sizeof(dummynt)); @@ -1442,7 +1442,7 @@ static bNodeType *rna_Node_register_base(Main *bmain, ReportList *reports, Struc nt->draw_buttons = (have_function[7]) ? rna_Node_draw_buttons : NULL; nt->draw_buttons_ex = (have_function[8]) ? rna_Node_draw_buttons_ext : NULL; nt->labelfunc = (have_function[9]) ? rna_Node_draw_label : NULL; - + /* sanitize size values in case not all have been registered */ if (nt->maxwidth < nt->minwidth) nt->maxwidth = nt->minwidth; @@ -1450,7 +1450,7 @@ static bNodeType *rna_Node_register_base(Main *bmain, ReportList *reports, Struc nt->maxheight = nt->minheight; CLAMP(nt->width, nt->minwidth, nt->maxwidth); CLAMP(nt->height, nt->minheight, nt->maxheight); - + return nt; } @@ -1462,12 +1462,12 @@ static StructRNA *rna_Node_register( bNodeType *nt = rna_Node_register_base(bmain, reports, &RNA_Node, data, identifier, validate, call, free); if (!nt) return NULL; - + nodeRegisterType(nt); - + /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); - + return nt->ext.srna; } @@ -1479,12 +1479,12 @@ static StructRNA *rna_ShaderNode_register( bNodeType *nt = rna_Node_register_base(bmain, reports, &RNA_ShaderNode, data, identifier, validate, call, free); if (!nt) return NULL; - + nodeRegisterType(nt); - + /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); - + return nt->ext.srna; } @@ -1496,12 +1496,12 @@ static StructRNA *rna_CompositorNode_register( bNodeType *nt = rna_Node_register_base(bmain, reports, &RNA_CompositorNode, data, identifier, validate, call, free); if (!nt) return NULL; - + nodeRegisterType(nt); - + /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); - + return nt->ext.srna; } @@ -1513,24 +1513,24 @@ static StructRNA *rna_TextureNode_register( bNodeType *nt = rna_Node_register_base(bmain, reports, &RNA_TextureNode, data, identifier, validate, call, free); if (!nt) return NULL; - + nodeRegisterType(nt); - + /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); - + return nt->ext.srna; } static IDProperty *rna_Node_idprops(PointerRNA *ptr, bool create) { bNode *node = ptr->data; - + if (create && !node->prop) { IDPropertyTemplate val = {0}; node->prop = IDP_New(IDP_GROUP, &val, "RNA_Node ID properties"); } - + return node->prop; } @@ -1538,19 +1538,19 @@ static void rna_Node_parent_set(PointerRNA *ptr, PointerRNA value) { bNode *node = ptr->data; bNode *parent = value.data; - + if (parent) { /* XXX only Frame node allowed for now, * in the future should have a poll function or so to test possible attachment. */ if (parent->type != NODE_FRAME) return; - + /* make sure parent is not attached to the node */ if (nodeAttachNodeCheck(parent, node)) return; } - + nodeDetachNode(node); if (parent) { nodeAttachNode(node, parent); @@ -1561,17 +1561,17 @@ static int rna_Node_parent_poll(PointerRNA *ptr, PointerRNA value) { bNode *node = ptr->data; bNode *parent = value.data; - + /* XXX only Frame node allowed for now, * in the future should have a poll function or so to test possible attachment. */ if (parent->type != NODE_FRAME) return false; - + /* make sure parent is not attached to the node */ if (nodeAttachNodeCheck(parent, node)) return false; - + return true; } @@ -1598,14 +1598,14 @@ static void rna_Node_name_set(PointerRNA *ptr, const char *value) bNodeTree *ntree = (bNodeTree *)ptr->id.data; bNode *node = (bNode *)ptr->data; char oldname[sizeof(node->name)]; - + /* make a copy of the old name first */ BLI_strncpy(oldname, node->name, sizeof(node->name)); /* set new name */ BLI_strncpy_utf8(node->name, value, sizeof(node->name)); - + nodeUniqueName(ntree, node); - + /* fix all the animation data which may link to this */ BKE_animdata_fix_paths_rename_all(NULL, "nodes", oldname, node->name); } @@ -1614,9 +1614,9 @@ static bNodeSocket *rna_Node_inputs_new(ID *id, bNode *node, Main *bmain, Report { bNodeTree *ntree = (bNodeTree *)id; bNodeSocket *sock; - + sock = nodeAddSocket(ntree, node, SOCK_IN, type, identifier, name); - + if (sock == NULL) { BKE_report(reports, RPT_ERROR, "Unable to create socket"); } @@ -1624,7 +1624,7 @@ static bNodeSocket *rna_Node_inputs_new(ID *id, bNode *node, Main *bmain, Report ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); } - + return sock; } @@ -1632,9 +1632,9 @@ static bNodeSocket *rna_Node_outputs_new(ID *id, bNode *node, Main *bmain, Repor { bNodeTree *ntree = (bNodeTree *)id; bNodeSocket *sock; - + sock = nodeAddSocket(ntree, node, SOCK_OUT, type, identifier, name); - + if (sock == NULL) { BKE_report(reports, RPT_ERROR, "Unable to create socket"); } @@ -1642,20 +1642,20 @@ static bNodeSocket *rna_Node_outputs_new(ID *id, bNode *node, Main *bmain, Repor ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); } - + return sock; } static void rna_Node_socket_remove(ID *id, bNode *node, Main *bmain, ReportList *reports, bNodeSocket *sock) { bNodeTree *ntree = (bNodeTree *)id; - + if (BLI_findindex(&node->inputs, sock) == -1 && BLI_findindex(&node->outputs, sock) == -1) { BKE_reportf(reports, RPT_ERROR, "Unable to locate socket '%s' in node", sock->identifier); } else { nodeRemoveSocket(ntree, node, sock); - + ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); } @@ -1665,7 +1665,7 @@ static void rna_Node_inputs_clear(ID *id, bNode *node, Main *bmain) { bNodeTree *ntree = (bNodeTree *)id; bNodeSocket *sock, *nextsock; - + for (sock = node->inputs.first; sock; sock = nextsock) { nextsock = sock->next; nodeRemoveSocket(ntree, node, sock); @@ -1679,7 +1679,7 @@ static void rna_Node_outputs_clear(ID *id, bNode *node, Main *bmain) { bNodeTree *ntree = (bNodeTree *)id; bNodeSocket *sock, *nextsock; - + for (sock = node->outputs.first; sock; sock = nextsock) { nextsock = sock->next; nodeRemoveSocket(ntree, node, sock); @@ -1693,12 +1693,12 @@ static void rna_Node_inputs_move(ID *id, bNode *node, Main *bmain, int from_inde { bNodeTree *ntree = (bNodeTree *)id; bNodeSocket *sock; - + if (from_index == to_index) return; if (from_index < 0 || to_index < 0) return; - + sock = BLI_findlink(&node->inputs, from_index); if (to_index < from_index) { bNodeSocket *nextsock = BLI_findlink(&node->inputs, to_index); @@ -1714,7 +1714,7 @@ static void rna_Node_inputs_move(ID *id, bNode *node, Main *bmain, int from_inde BLI_insertlinkafter(&node->inputs, prevsock, sock); } } - + ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); } @@ -1723,12 +1723,12 @@ static void rna_Node_outputs_move(ID *id, bNode *node, Main *bmain, int from_ind { bNodeTree *ntree = (bNodeTree *)id; bNodeSocket *sock; - + if (from_index == to_index) return; if (from_index < 0 || to_index < 0) return; - + sock = BLI_findlink(&node->outputs, from_index); if (to_index < from_index) { bNodeSocket *nextsock = BLI_findlink(&node->outputs, to_index); @@ -1744,7 +1744,7 @@ static void rna_Node_outputs_move(ID *id, bNode *node, Main *bmain, int from_ind BLI_insertlinkafter(&node->outputs, prevsock, sock); } } - + ntreeUpdateTree(bmain, ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); } @@ -1820,7 +1820,7 @@ static void rna_NodeSocket_unregister(Main *UNUSED(bmain), StructRNA *type) bNodeSocketType *st = RNA_struct_blender_type_get(type); if (!st) return; - + RNA_struct_free_extension(type, &st->ext_socket); RNA_struct_free(&BLENDER_RNA, type); @@ -1842,7 +1842,7 @@ static StructRNA *rna_NodeSocket_register( /* setup dummy socket & socket type to store static properties in */ memset(&dummyst, 0, sizeof(bNodeSocketType)); - + memset(&dummysock, 0, sizeof(bNodeSocket)); dummysock.typeinfo = &dummyst; RNA_pointer_create(NULL, &RNA_NodeSocket, &dummysock, &dummyptr); @@ -1850,7 +1850,7 @@ static StructRNA *rna_NodeSocket_register( /* validate the python class */ if (validate(&dummyptr, data, have_function) != 0) return NULL; - + if (strlen(identifier) >= sizeof(dummyst.idname)) { BKE_reportf(reports, RPT_ERROR, "Registering node socket class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(dummyst.idname)); @@ -1863,22 +1863,22 @@ static StructRNA *rna_NodeSocket_register( /* create a new node socket type */ st = MEM_callocN(sizeof(bNodeSocketType), "node socket type"); memcpy(st, &dummyst, sizeof(dummyst)); - + nodeRegisterSocketType(st); } - + /* if RNA type is already registered, unregister first */ if (st->ext_socket.srna) { StructRNA *srna = st->ext_socket.srna; RNA_struct_free_extension(srna, &st->ext_socket); RNA_struct_free(&BLENDER_RNA, srna); } - st->ext_socket.srna = RNA_def_struct_ptr(&BLENDER_RNA, st->idname, &RNA_NodeSocket); + st->ext_socket.srna = RNA_def_struct_ptr(&BLENDER_RNA, st->idname, &RNA_NodeSocket); st->ext_socket.data = data; st->ext_socket.call = call; st->ext_socket.free = free; RNA_struct_blender_type_set(st->ext_socket.srna, st); - + /* XXX bad level call! needed to initialize the basic draw functions ... */ ED_init_custom_node_socket_type(st); @@ -1887,14 +1887,14 @@ static StructRNA *rna_NodeSocket_register( /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); - + return st->ext_socket.srna; } static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr) { bNodeSocket *sock = (bNodeSocket *)ptr->data; - + if (sock->typeinfo->ext_socket.srna) return sock->typeinfo->ext_socket.srna; else @@ -1908,10 +1908,10 @@ static char *rna_NodeSocket_path(PointerRNA *ptr) bNode *node; int socketindex; char name_esc[sizeof(node->name) * 2]; - + if (!nodeFindNode(ntree, sock, &node, &socketindex)) return NULL; - + BLI_strescape(name_esc, node->name, sizeof(name_esc)); if (sock->in_out == SOCK_IN) { @@ -1925,12 +1925,12 @@ static char *rna_NodeSocket_path(PointerRNA *ptr) static IDProperty *rna_NodeSocket_idprops(PointerRNA *ptr, bool create) { bNodeSocket *sock = ptr->data; - + if (create && !sock->prop) { IDPropertyTemplate val = {0}; sock->prop = IDP_New(IDP_GROUP, &val, "RNA_NodeSocket ID properties"); } - + return sock->prop; } @@ -1940,9 +1940,9 @@ static PointerRNA rna_NodeSocket_node_get(PointerRNA *ptr) bNodeSocket *sock = (bNodeSocket *)ptr->data; bNode *node; PointerRNA r_ptr; - + nodeFindNode(ntree, sock, &node, NULL); - + RNA_pointer_create((ID *)ntree, &RNA_Node, node, &r_ptr); return r_ptr; } @@ -1972,11 +1972,11 @@ static void rna_NodeSocket_link_limit_set(PointerRNA *ptr, int value) static void rna_NodeSocket_hide_set(PointerRNA *ptr, int value) { bNodeSocket *sock = (bNodeSocket *)ptr->data; - + /* don't hide linked sockets */ if (sock->flag & SOCK_IN_USE) return; - + if (value) sock->flag |= SOCK_HIDDEN; else @@ -2104,11 +2104,11 @@ static void rna_NodeSocketInterface_unregister(Main *UNUSED(bmain), StructRNA *t bNodeSocketType *st = RNA_struct_blender_type_get(type); if (!st) return; - + RNA_struct_free_extension(type, &st->ext_interface); - + RNA_struct_free(&BLENDER_RNA, type); - + /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); } @@ -2124,7 +2124,7 @@ static StructRNA *rna_NodeSocketInterface_register( /* setup dummy socket & socket type to store static properties in */ memset(&dummyst, 0, sizeof(bNodeSocketType)); - + memset(&dummysock, 0, sizeof(bNodeSocket)); dummysock.typeinfo = &dummyst; RNA_pointer_create(NULL, &RNA_NodeSocketInterface, &dummysock, &dummyptr); @@ -2142,38 +2142,38 @@ static StructRNA *rna_NodeSocketInterface_register( /* create a new node socket type */ st = MEM_callocN(sizeof(bNodeSocketType), "node socket type"); memcpy(st, &dummyst, sizeof(dummyst)); - + nodeRegisterSocketType(st); } - + /* if RNA type is already registered, unregister first */ if (st->ext_interface.srna) { StructRNA *srna = st->ext_interface.srna; RNA_struct_free_extension(srna, &st->ext_interface); RNA_struct_free(&BLENDER_RNA, srna); } - st->ext_interface.srna = RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_NodeSocketInterface); + st->ext_interface.srna = RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_NodeSocketInterface); st->ext_interface.data = data; st->ext_interface.call = call; st->ext_interface.free = free; RNA_struct_blender_type_set(st->ext_interface.srna, st); - + st->interface_draw = (have_function[0]) ? rna_NodeSocketInterface_draw : NULL; st->interface_draw_color = (have_function[1]) ? rna_NodeSocketInterface_draw_color : NULL; st->interface_register_properties = (have_function[2]) ? rna_NodeSocketInterface_register_properties : NULL; st->interface_init_socket = (have_function[3]) ? rna_NodeSocketInterface_init_socket : NULL; st->interface_from_socket = (have_function[4]) ? rna_NodeSocketInterface_from_socket : NULL; - + /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); - + return st->ext_interface.srna; } static StructRNA *rna_NodeSocketInterface_refine(PointerRNA *ptr) { bNodeSocket *sock = (bNodeSocket *)ptr->data; - + if (sock->typeinfo && sock->typeinfo->ext_interface.srna) return sock->typeinfo->ext_interface.srna; else @@ -2185,27 +2185,27 @@ static char *rna_NodeSocketInterface_path(PointerRNA *ptr) bNodeTree *ntree = (bNodeTree *)ptr->id.data; bNodeSocket *sock = (bNodeSocket *)ptr->data; int socketindex; - + socketindex = BLI_findindex(&ntree->inputs, sock); if (socketindex != -1) return BLI_sprintfN("inputs[%d]", socketindex); - + socketindex = BLI_findindex(&ntree->outputs, sock); if (socketindex != -1) return BLI_sprintfN("outputs[%d]", socketindex); - + return NULL; } static IDProperty *rna_NodeSocketInterface_idprops(PointerRNA *ptr, bool create) { bNodeSocket *sock = ptr->data; - + if (create && !sock->prop) { IDPropertyTemplate val = {0}; sock->prop = IDP_New(IDP_GROUP, &val, "RNA_NodeSocketInterface ID properties"); } - + return sock->prop; } @@ -2213,13 +2213,13 @@ static void rna_NodeSocketInterface_update(Main *bmain, Scene *UNUSED(scene), Po { bNodeTree *ntree = ptr->id.data; bNodeSocket *stemp = ptr->data; - + if (!stemp->typeinfo) return; - + ntree->update |= NTREE_UPDATE_GROUP; ntreeUpdateTree(bmain, ntree); - + ED_node_tag_update_nodetree(bmain, ntree, NULL); } @@ -2260,11 +2260,11 @@ static void rna_NodeSocketStandard_float_range(PointerRNA *ptr, float *min, floa bNodeSocket *sock = ptr->data; bNodeSocketValueFloat *dval = sock->default_value; int subtype = sock->typeinfo->subtype; - + if (dval->max < dval->min) { dval->max = dval->min; } - + *min = (subtype == PROP_UNSIGNED ? 0.0f : -FLT_MAX); *max = FLT_MAX; *softmin = dval->min; @@ -2276,11 +2276,11 @@ static void rna_NodeSocketStandard_int_range(PointerRNA *ptr, int *min, int *max bNodeSocket *sock = ptr->data; bNodeSocketValueInt *dval = sock->default_value; int subtype = sock->typeinfo->subtype; - + if (dval->max < dval->min) { dval->max = dval->min; } - + *min = (subtype == PROP_UNSIGNED ? 0 : INT_MIN); *max = INT_MAX; *softmin = dval->min; @@ -2291,11 +2291,11 @@ static void rna_NodeSocketStandard_vector_range(PointerRNA *ptr, float *min, flo { bNodeSocket *sock = ptr->data; bNodeSocketValueVector *dval = sock->default_value; - + if (dval->max < dval->min) { dval->max = dval->min; } - + *min = -FLT_MAX; *max = FLT_MAX; *softmin = dval->min; @@ -2306,20 +2306,20 @@ static void rna_NodeSocketStandard_vector_range(PointerRNA *ptr, float *min, flo static void rna_NodeSocketStandard_value_update(struct bContext *C, PointerRNA *ptr) { bNode *node; - + /* default update */ rna_NodeSocket_update(CTX_data_main(C), CTX_data_scene(C), ptr); - + /* try to use node from context, faster */ node = CTX_data_pointer_get(C, "node").data; if (!node) { bNodeTree *ntree = ptr->id.data; bNodeSocket *sock = ptr->data; - + /* fall back to searching node in the tree */ nodeFindNode(ntree, sock, &node, NULL); } - + if (node) { nodeSynchronizeID(node, true); @@ -2456,15 +2456,15 @@ static StructRNA *rna_NodeCustomGroup_register( bNodeType *nt = rna_Node_register_base(bmain, reports, &RNA_NodeCustomGroup, data, identifier, validate, call, free); if (!nt) return NULL; - + /* this updates the group node instance from the tree's interface */ nt->verifyfunc = node_group_verify; - + nodeRegisterType(nt); - + /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); - + return nt->ext.srna; } @@ -2497,10 +2497,10 @@ static void rna_NodeGroup_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * { bNodeTree *ntree = (bNodeTree *)ptr->id.data; bNode *node = (bNode *)ptr->data; - + if (node->id) ntreeUpdateTree(bmain, (bNodeTree *)node->id); - + ED_node_tag_update_nodetree(bmain, ntree, node); } @@ -2509,13 +2509,13 @@ static void rna_NodeGroup_node_tree_set(PointerRNA *ptr, const PointerRNA value) bNodeTree *ntree = ptr->id.data; bNode *node = ptr->data; bNodeTree *ngroup = value.data; - + if (nodeGroupPoll(ntree, ngroup)) { if (node->id) id_us_min(node->id); if (ngroup) id_us_plus(&ngroup->id); - + node->id = &ngroup->id; } } @@ -2524,11 +2524,11 @@ static int rna_NodeGroup_node_tree_poll(PointerRNA *ptr, const PointerRNA value) { bNodeTree *ntree = ptr->id.data; bNodeTree *ngroup = value.data; - + /* only allow node trees of the same type as the group node's tree */ if (ngroup->type != ntree->type) return false; - + return nodeGroupPoll(ntree, ngroup); } @@ -2549,7 +2549,7 @@ static StructRNA *rna_NodeGroup_interface_typef(PointerRNA *ptr) static StructRNA *rna_NodeGroupInputOutput_interface_typef(PointerRNA *ptr) { bNodeTree *ntree = ptr->id.data; - + if (ntree) { StructRNA *srna = ntreeInterfaceTypeGet(ntree, true); if (srna) @@ -2595,10 +2595,10 @@ static void rna_Matte_t1_set(PointerRNA *ptr, float value) { bNode *node = (bNode *)ptr->data; NodeChroma *chroma = node->storage; - + chroma->t1 = value; - - if (value < chroma->t2) + + if (value < chroma->t2) chroma->t2 = value; } @@ -2606,10 +2606,10 @@ static void rna_Matte_t2_set(PointerRNA *ptr, float value) { bNode *node = (bNode *)ptr->data; NodeChroma *chroma = node->storage; - - if (value > chroma->t1) + + if (value > chroma->t1) value = chroma->t1; - + chroma->t2 = value; } @@ -2632,10 +2632,10 @@ static void rna_Node_image_layer_update(Main *bmain, Scene *scene, PointerRNA *p bNode *node = (bNode *)ptr->data; Image *ima = (Image *)node->id; ImageUser *iuser = node->storage; - + BKE_image_multilayer_index(ima->rr, iuser); BKE_image_signal(ima, iuser, IMA_SIGNAL_SRC_CHANGE); - + rna_Node_update(bmain, scene, ptr); if (scene->nodetree != NULL) { @@ -2790,7 +2790,7 @@ static const EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), Point EnumPropertyItem *item = NULL; EnumPropertyItem tmp = {0}; int totitem = 0; - + switch (node->custom1) { case CMP_NODE_CHANNEL_MATTE_CS_RGB: tmp.identifier = "R"; tmp.name = "R"; tmp.value = 1; @@ -2830,7 +2830,7 @@ static const EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), Point RNA_enum_item_end(&item, &totitem); *r_free = true; - + return item; } @@ -2890,7 +2890,7 @@ static int rna_NodeOutputFileSocket_find_node(bNodeTree *ntree, NodeImageMultiFi { bNode *node; bNodeSocket *sock; - + for (node = ntree->nodes.first; node; node = node->next) { for (sock = node->inputs.first; sock; sock = sock->next) { NodeImageMultiFileSocket *sockdata = sock->storage; @@ -2901,7 +2901,7 @@ static int rna_NodeOutputFileSocket_find_node(bNodeTree *ntree, NodeImageMultiFi } } } - + *nodep = NULL; *sockp = NULL; return 0; @@ -2913,7 +2913,7 @@ static void rna_NodeOutputFileSlotFile_path_set(PointerRNA *ptr, const char *val NodeImageMultiFileSocket *sockdata = ptr->data; bNode *node; bNodeSocket *sock; - + if (rna_NodeOutputFileSocket_find_node(ntree, sockdata, &node, &sock)) { ntreeCompositOutputFileSetPath(node, sock, value); } @@ -2925,7 +2925,7 @@ static void rna_NodeOutputFileSlotLayer_name_set(PointerRNA *ptr, const char *va NodeImageMultiFileSocket *sockdata = ptr->data; bNode *node; bNodeSocket *sock; - + if (rna_NodeOutputFileSocket_find_node(ntree, sockdata, &node, &sock)) { ntreeCompositOutputFileSetLayer(node, sock, value); } @@ -2939,12 +2939,12 @@ static bNodeSocket *rna_NodeOutputFile_slots_new(ID *id, bNode *node, bContext * bNodeSocket *sock; if (scene) im_format = &scene->r.im_format; - + sock = ntreeCompositOutputFileAddSocket(ntree, node, name, im_format); - + ntreeUpdateTree(CTX_data_main(C), ntree); WM_main_add_notifier(NC_NODE | NA_EDITED, ntree); - + return sock; } @@ -3343,7 +3343,7 @@ static const EnumPropertyItem node_subsurface_method_items[] = { static void def_group_input(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "interface", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_NodeGroupInputOutput_interface_typef", NULL); RNA_def_property_struct_type(prop, "PropertyGroup"); @@ -3354,13 +3354,13 @@ static void def_group_input(StructRNA *srna) static void def_group_output(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "interface", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_NodeGroupInputOutput_interface_typef", NULL); RNA_def_property_struct_type(prop, "PropertyGroup"); RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_ui_text(prop, "Interface", "Interface socket data"); - + prop = RNA_def_property(srna, "is_active_output", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_DO_OUTPUT); RNA_def_property_ui_text(prop, "Active Output", "True if this node is used as the active group output"); @@ -3370,7 +3370,7 @@ static void def_group_output(StructRNA *srna) static void def_group(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "id"); RNA_def_property_struct_type(prop, "NodeTree"); @@ -3389,7 +3389,7 @@ static void def_group(StructRNA *srna) static void def_custom_group(BlenderRNA *brna) { StructRNA *srna; - + srna = RNA_def_struct(brna, "NodeCustomGroup", "Node"); RNA_def_struct_ui_text(srna, "Custom Group", "Base node type for custom registered node group types"); RNA_def_struct_sdna(srna, "bNode"); @@ -3401,8 +3401,8 @@ static void def_custom_group(BlenderRNA *brna) static void def_frame(StructRNA *srna) { - PropertyRNA *prop; - + PropertyRNA *prop; + prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "id"); RNA_def_property_struct_type(prop, "Text"); @@ -3412,7 +3412,7 @@ static void def_frame(StructRNA *srna) RNA_def_struct_sdna_from(srna, "NodeFrame", "storage"); RNA_def_struct_translation_context(srna, BLT_I18NCONTEXT_ID_NODETREE); - + prop = RNA_def_property(srna, "shrink", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_FRAME_SHRINK); RNA_def_property_ui_text(prop, "Shrink", "Shrink the frame to minimal bounding box"); @@ -3428,7 +3428,7 @@ static void def_frame(StructRNA *srna) static void def_math(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, rna_enum_node_math_items); @@ -3444,7 +3444,7 @@ static void def_math(StructRNA *srna) static void def_vector_math(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, rna_enum_node_vec_math_items); @@ -3455,7 +3455,7 @@ static void def_vector_math(StructRNA *srna) static void def_rgb_curve(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "storage"); RNA_def_property_struct_type(prop, "CurveMapping"); @@ -3466,7 +3466,7 @@ static void def_rgb_curve(StructRNA *srna) static void def_vector_curve(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "storage"); RNA_def_property_struct_type(prop, "CurveMapping"); @@ -3477,18 +3477,18 @@ static void def_vector_curve(StructRNA *srna) static void def_time(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "storage"); RNA_def_property_struct_type(prop, "CurveMapping"); RNA_def_property_ui_text(prop, "Curve", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom1"); RNA_def_property_ui_text(prop, "Start Frame", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom2"); RNA_def_property_ui_text(prop, "End Frame", ""); @@ -3498,7 +3498,7 @@ static void def_time(StructRNA *srna) static void def_colorramp(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "storage"); RNA_def_property_struct_type(prop, "ColorRamp"); @@ -3509,13 +3509,13 @@ static void def_colorramp(StructRNA *srna) static void def_mix_rgb(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, rna_enum_ramp_blend_items); RNA_def_property_ui_text(prop, "Blend Type", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom2", SHD_MIXRGB_USE_ALPHA); RNA_def_property_ui_text(prop, "Alpha", "Include alpha of second input in this operation"); @@ -3530,14 +3530,14 @@ static void def_mix_rgb(StructRNA *srna) static void def_texture(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "id"); RNA_def_property_struct_type(prop, "Texture"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Texture", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "node_output", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom1"); RNA_def_property_ui_text(prop, "Node Output", "For node-based textures, which output node to use"); @@ -3550,7 +3550,7 @@ static void def_texture(StructRNA *srna) static void def_sh_output(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "is_active_output", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_DO_OUTPUT); RNA_def_property_ui_text(prop, "Active Output", "True if this node is used as the active output"); @@ -3583,7 +3583,7 @@ static void def_sh_material(StructRNA *srna) RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_SPEC); RNA_def_property_ui_text(prop, "Specular", "Material Node outputs Specular"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "invert_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_NEG); RNA_def_property_ui_text(prop, "Invert Normal", "Material Node uses inverted normal"); @@ -3603,7 +3603,7 @@ static void def_sh_mapping(StructRNA *srna) static float default_1[3] = {1.f, 1.f, 1.f}; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "TexMapping", "storage"); prop = RNA_def_property(srna, "vector_type", PROP_ENUM, PROP_NONE); @@ -3616,36 +3616,36 @@ static void def_sh_mapping(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); - + /* Not PROP_XYZ, this is now in radians, no more degrees */ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Rotation", ""); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); - + prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_float_array_default(prop, default_1); RNA_def_property_flag(prop, PROP_PROPORTIONAL); RNA_def_property_ui_text(prop, "Scale", ""); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); - + prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); - + prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_float_array_default(prop, default_1); RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); - + prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN); RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value"); RNA_def_property_update(prop, 0, "rna_Mapping_Node_update"); - + prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX); RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value"); @@ -3655,14 +3655,14 @@ static void def_sh_mapping(StructRNA *srna) static void def_sh_geometry(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeGeometry", "storage"); - + prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "uvname"); RNA_def_property_ui_text(prop, "UV Map", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "color_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "colname"); RNA_def_property_ui_text(prop, "Vertex Color Layer", ""); @@ -3672,7 +3672,7 @@ static void def_sh_geometry(StructRNA *srna) static void def_sh_lamp(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "lamp_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "id"); RNA_def_property_struct_type(prop, "Object"); @@ -3685,9 +3685,9 @@ static void def_sh_lamp(StructRNA *srna) static void def_sh_attribute(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeShaderAttribute", "storage"); - + prop = RNA_def_property(srna, "attribute_name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Attribute Name", ""); @@ -3717,9 +3717,9 @@ static void def_sh_tex_sky(StructRNA *srna) {0, NULL, 0, NULL, NULL} }; static float default_dir[3] = {0.0f, 0.0f, 1.0f}; - + PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexSky", "storage"); def_sh_tex(srna); @@ -3728,19 +3728,19 @@ static void def_sh_tex_sky(StructRNA *srna) RNA_def_property_enum_items(prop, prop_sky_type); RNA_def_property_ui_text(prop, "Sky Type", ""); RNA_def_property_update(prop, 0, "rna_Node_update"); - + prop = RNA_def_property(srna, "sun_direction", PROP_FLOAT, PROP_DIRECTION); RNA_def_property_ui_text(prop, "Sun Direction", "Direction from where the sun is shining"); RNA_def_property_array(prop, 3); RNA_def_property_float_array_default(prop, default_dir); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "turbidity", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 1.0f, 10.0f); RNA_def_property_ui_range(prop, 1.0f, 10.0f, 10, 3); RNA_def_property_ui_text(prop, "Turbidity", "Atmospheric turbidity"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "ground_albedo", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Ground Albedo", "Ground color that is subtly reflected in the sky"); @@ -3895,7 +3895,7 @@ static void def_sh_tex_gradient(StructRNA *srna) }; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexGradient", "storage"); def_sh_tex(srna); @@ -3920,44 +3920,44 @@ static void def_sh_tex_checker(StructRNA *srna) static void def_sh_tex_brick(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexBrick", "storage"); def_sh_tex(srna); - + prop = RNA_def_property(srna, "offset_frequency", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "offset_freq"); RNA_def_property_int_default(prop, 2); RNA_def_property_range(prop, 1, 99); RNA_def_property_ui_text(prop, "Offset Frequency", ""); RNA_def_property_update(prop, 0, "rna_Node_update"); - + prop = RNA_def_property(srna, "squash_frequency", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "squash_freq"); RNA_def_property_int_default(prop, 2); RNA_def_property_range(prop, 1, 99); RNA_def_property_ui_text(prop, "Squash Frequency", ""); RNA_def_property_update(prop, 0, "rna_Node_update"); - + prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_float_default(prop, 0.5f); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Offset Amount", ""); RNA_def_property_update(prop, 0, "rna_Node_update"); - + prop = RNA_def_property(srna, "squash", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "squash"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0.0f, 99.0f); RNA_def_property_ui_text(prop, "Squash Amount", ""); RNA_def_property_update(prop, 0, "rna_Node_update"); - + } static void def_sh_tex_magic(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexMagic", "storage"); def_sh_tex(srna); @@ -3980,7 +3980,7 @@ static void def_sh_tex_musgrave(StructRNA *srna) }; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexMusgrave", "storage"); def_sh_tex(srna); @@ -4000,7 +4000,7 @@ static void def_sh_tex_voronoi(StructRNA *srna) }; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage"); def_sh_tex(srna); @@ -4026,7 +4026,7 @@ static void def_sh_tex_wave(StructRNA *srna) }; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexWave", "storage"); def_sh_tex(srna); @@ -4077,20 +4077,20 @@ static void def_sh_vect_transform(StructRNA *srna) }; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeShaderVectTransform", "storage"); - + prop = RNA_def_property(srna, "vector_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_vect_type_items); RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_update(prop, 0, "rna_Node_update"); - + prop = RNA_def_property(srna, "convert_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_vect_space_items); RNA_def_property_ui_text(prop, "Convert From", "Space to convert from"); RNA_def_property_update(prop, 0, "rna_Node_update"); - + prop = RNA_def_property(srna, "convert_to", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_vect_space_items); RNA_def_property_ui_text(prop, "Convert To", "Space to convert to"); @@ -4100,7 +4100,7 @@ static void def_sh_vect_transform(StructRNA *srna) static void def_sh_tex_wireframe(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "use_pixel_size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1); RNA_def_property_ui_text(prop, "Pixel Size", "Use screen pixel size instead of world units"); @@ -4253,7 +4253,7 @@ static void def_sh_tex_pointdensity(StructRNA *srna) static void def_glossy(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, node_glossy_items); @@ -4264,7 +4264,7 @@ static void def_glossy(StructRNA *srna) static void def_glass(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, node_glass_items); @@ -4292,7 +4292,7 @@ static void def_principled(StructRNA *srna) static void def_refraction(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, node_refraction_items); @@ -4303,7 +4303,7 @@ static void def_refraction(StructRNA *srna) static void def_anisotropic(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, node_anisotropic_items); @@ -4314,7 +4314,7 @@ static void def_anisotropic(StructRNA *srna) static void def_toon(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "component", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, node_toon_items); @@ -4325,7 +4325,7 @@ static void def_toon(StructRNA *srna) static void def_sh_bump(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1); RNA_def_property_ui_text(prop, "Invert", "Invert the bump mapping direction to push into the surface instead of out"); @@ -4335,7 +4335,7 @@ static void def_sh_bump(StructRNA *srna) static void def_hair(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "component", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, node_hair_items); @@ -4495,7 +4495,7 @@ static void def_sh_subsurface(StructRNA *srna) }; PropertyRNA *prop; - + prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, prop_subsurface_falloff_items); @@ -4539,9 +4539,9 @@ static void def_sh_script(StructRNA *srna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); RNA_def_property_ui_text(prop, "Script", "Internal shader script to define the shader"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNodeScript_update"); - + RNA_def_struct_sdna_from(srna, "NodeShaderScript", "storage"); - + prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_ui_text(prop, "File Path", "Shader script path"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNodeScript_update"); @@ -4556,7 +4556,7 @@ static void def_sh_script(StructRNA *srna) RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_SCRIPT_AUTO_UPDATE); RNA_def_property_ui_text(prop, "Auto Update", "Automatically update the shader when the .osl file changes (external scripts only)"); - + prop = RNA_def_property(srna, "bytecode", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ShaderNodeScript_bytecode_get", "rna_ShaderNodeScript_bytecode_length", "rna_ShaderNodeScript_bytecode_set"); @@ -4569,7 +4569,7 @@ static void def_sh_script(StructRNA *srna) /* needs to be reset to avoid bad pointer type in API functions below */ RNA_def_struct_sdna_from(srna, "bNode", NULL); - + /* API functions */ #if 0 /* XXX TODO use general node api for this */ @@ -4580,7 +4580,7 @@ static void def_sh_script(StructRNA *srna) /*parm =*/ RNA_def_boolean(func, "is_output", false, "Output", "Whether the socket is an output"); parm = RNA_def_pointer(func, "result", "NodeSocket", "", ""); RNA_def_function_return(func, parm); - + func = RNA_def_function(srna, "add_socket", "rna_ShaderNodeScript_add_socket"); RNA_def_function_ui_description(func, "Add a socket socket"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); @@ -4591,7 +4591,7 @@ static void def_sh_script(StructRNA *srna) /*parm =*/ RNA_def_boolean(func, "is_output", false, "Output", "Whether the socket is an output"); parm = RNA_def_pointer(func, "result", "NodeSocket", "", ""); RNA_def_function_return(func, parm); - + func = RNA_def_function(srna, "remove_socket", "rna_ShaderNodeScript_remove_socket"); RNA_def_function_ui_description(func, "Remove a socket socket"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); @@ -4605,15 +4605,15 @@ static void def_sh_script(StructRNA *srna) static void def_cmp_alpha_over(StructRNA *srna) { PropertyRNA *prop; - + /* XXX: Tooltip */ prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1); RNA_def_property_ui_text(prop, "Convert Premul", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + RNA_def_struct_sdna_from(srna, "NodeTwoFloats", "storage"); - + prop = RNA_def_property(srna, "premul", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "x"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -4624,7 +4624,7 @@ static void def_cmp_alpha_over(StructRNA *srna) static void def_cmp_blur(StructRNA *srna) { PropertyRNA *prop; - + static const EnumPropertyItem filter_type_items[] = { {R_FILTER_BOX, "FLAT", 0, "Flat", ""}, {R_FILTER_TENT, "TENT", 0, "Tent", ""}, @@ -4656,13 +4656,13 @@ static void def_cmp_blur(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); RNA_def_struct_sdna_from(srna, "NodeBlurData", "storage"); - + prop = RNA_def_property(srna, "size_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "sizex"); RNA_def_property_range(prop, 0, 2048); RNA_def_property_ui_text(prop, "Size X", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "size_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "sizey"); RNA_def_property_range(prop, 0, 2048); @@ -4673,7 +4673,7 @@ static void def_cmp_blur(StructRNA *srna) RNA_def_property_boolean_sdna(prop, NULL, "relative", 1); RNA_def_property_ui_text(prop, "Relative", "Use relative (percent) values to define blur radius"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "aspect_correction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "aspect"); RNA_def_property_enum_items(prop, aspect_correction_type_items); @@ -4685,30 +4685,30 @@ static void def_cmp_blur(StructRNA *srna) RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Factor", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "factor_x", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "percentx"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Relative Size X", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "factor_y", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "percenty"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Relative Size Y", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "filtertype"); RNA_def_property_enum_items(prop, filter_type_items); RNA_def_property_ui_text(prop, "Filter Type", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_bokeh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bokeh", 1); RNA_def_property_ui_text(prop, "Bokeh", "Use circular filter (slower)"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_gamma_correction", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gamma", 1); RNA_def_property_ui_text(prop, "Gamma", "Apply filter on gamma corrected values"); @@ -4729,40 +4729,40 @@ static void def_cmp_filter(StructRNA *srna) static void def_cmp_map_value(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "TexMapping", "storage"); - + prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_array(prop, 1); RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "Offset", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_array(prop, 1); RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "Size", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN); RNA_def_property_ui_text(prop, "Use Minimum", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX); RNA_def_property_ui_text(prop, "Use Maximum", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_array(prop, 1); RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_text(prop, "Minimum", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_array(prop, 1); @@ -4774,7 +4774,7 @@ static void def_cmp_map_value(StructRNA *srna) static void def_cmp_map_range(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "use_clamp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1); RNA_def_property_ui_text(prop, "Clamp", "Clamp result of the node to 0..1 range"); @@ -4784,28 +4784,28 @@ static void def_cmp_map_range(StructRNA *srna) static void def_cmp_vector_blur(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeBlurData", "storage"); - + prop = RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "samples"); RNA_def_property_range(prop, 1, 256); RNA_def_property_ui_text(prop, "Samples", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "speed_min", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "minspeed"); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_text(prop, "Min Speed", "Minimum speed for a pixel to be blurred (used to separate background from foreground)"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "speed_max", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxspeed"); RNA_def_property_range(prop, 0, 1024); RNA_def_property_ui_text(prop, "Max Speed", "Maximum speed, or zero for none"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); RNA_def_property_range(prop, 0.0, 20.0); @@ -4813,7 +4813,7 @@ static void def_cmp_vector_blur(StructRNA *srna) RNA_def_property_ui_text(prop, "Blur Factor", "Scaling factor for motion vectors (actually, 'shutter speed', in frames)"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_curved", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "curved", 1); RNA_def_property_ui_text(prop, "Curved", "Interpolate between frames in a Bezier curve, rather than linearly"); @@ -4823,7 +4823,7 @@ static void def_cmp_vector_blur(StructRNA *srna) static void def_cmp_levels(StructRNA *srna) { PropertyRNA *prop; - + static const EnumPropertyItem channel_items[] = { {1, "COMBINED_RGB", 0, "C", "Combined RGB"}, {2, "RED", 0, "R", "Red Channel"}, @@ -4832,7 +4832,7 @@ static void def_cmp_levels(StructRNA *srna) {5, "LUMINANCE", 0, "L", "Luminance Channel"}, {0, NULL, 0, NULL, NULL} }; - + prop = RNA_def_property(srna, "channel", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, channel_items); @@ -4849,7 +4849,7 @@ static void def_node_image_user(StructRNA *srna) RNA_def_property_range(prop, 0, MAXFRAMEF); RNA_def_property_ui_text(prop, "Frames", "Number of images of a movie to use"); /* copied from the rna_image.c */ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "sfra"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); @@ -4857,19 +4857,19 @@ static void def_node_image_user(StructRNA *srna) RNA_def_property_ui_text(prop, "Start Frame", "Global starting frame of the movie/sequence, assuming first picture has a #1"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "offset"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); /* copied from the rna_image.c */ RNA_def_property_ui_text(prop, "Offset", "Offset the number of the frame to use in the animation"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cycl", 1); RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie"); /* copied from the rna_image.c */ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_auto_refresh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS); /* copied from the rna_image.c */ @@ -4906,7 +4906,7 @@ static void def_node_image_user(StructRNA *srna) static void def_cmp_image(StructRNA *srna) { PropertyRNA *prop; - + #if 0 static const EnumPropertyItem type_items[] = { {IMA_SRC_FILE, "IMAGE", 0, "Image", ""}, @@ -4916,7 +4916,7 @@ static void def_cmp_image(StructRNA *srna) {0, NULL, 0, NULL, NULL} }; #endif - + prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "id"); RNA_def_property_struct_type(prop, "Image"); @@ -4940,7 +4940,7 @@ static void def_cmp_image(StructRNA *srna) static void def_cmp_render_layers(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "id"); RNA_def_property_pointer_funcs(prop, NULL, "rna_Node_scene_set", NULL, NULL); @@ -4948,7 +4948,7 @@ static void def_cmp_render_layers(StructRNA *srna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); RNA_def_property_ui_text(prop, "Scene", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_scene_layer_update"); - + prop = RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, prop_scene_layer_items); @@ -4962,19 +4962,19 @@ static void rna_def_cmp_output_file_slot_file(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "NodeOutputFileSlotFile", NULL); RNA_def_struct_sdna(srna, "NodeImageMultiFileSocket"); RNA_def_struct_ui_text(srna, "Output File Slot", "Single layer file slot of the file output node"); - + prop = RNA_def_property(srna, "use_node_format", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_node_format", 1); RNA_def_property_ui_text(prop, "Use Node Format", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, NULL); - + prop = RNA_def_property(srna, "format", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ImageFormatSettings"); - + prop = RNA_def_property(srna, "path", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "path"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NodeOutputFileSlotFile_path_set"); @@ -4986,11 +4986,11 @@ static void rna_def_cmp_output_file_slot_layer(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "NodeOutputFileSlotLayer", NULL); RNA_def_struct_sdna(srna, "NodeImageMultiFileSocket"); RNA_def_struct_ui_text(srna, "Output File Layer Slot", "Multilayer slot of the file output node"); - + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "layer"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NodeOutputFileSlotLayer_name_set"); @@ -5043,33 +5043,33 @@ static void rna_def_cmp_output_file_slots_api(BlenderRNA *brna, PropertyRNA *cpr static void def_cmp_output_file(BlenderRNA *brna, StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeImageMultiFile", "storage"); - + prop = RNA_def_property(srna, "base_path", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "base_path"); RNA_def_property_ui_text(prop, "Base Path", "Base output path for the image"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "active_input_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "active_input"); RNA_def_property_ui_text(prop, "Active Input Index", "Active input index in details view list"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "format", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ImageFormatSettings"); - + /* XXX using two different collections here for the same basic DNA list! * Details of the output slots depend on whether the node is in Multilayer EXR mode. */ - + prop = RNA_def_property(srna, "file_slots", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_NodeOutputFile_slots_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_NodeOutputFile_slot_file_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "NodeOutputFileSlotFile"); RNA_def_property_ui_text(prop, "File Slots", ""); rna_def_cmp_output_file_slots_api(brna, prop, "CompositorNodeOutputFileFileSlots"); - + prop = RNA_def_property(srna, "layer_slots", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_NodeOutputFile_slots_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_NodeOutputFile_slot_layer_get", NULL, NULL, NULL, NULL); @@ -5089,13 +5089,13 @@ static void def_cmp_dilate_erode(StructRNA *srna) {CMP_NODE_DILATEERODE_DISTANCE_FEATHER, "FEATHER", 0, "Feather", ""}, {0, NULL, 0, NULL, NULL} }; - + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, mode_items); RNA_def_property_ui_text(prop, "Mode", "Growing/shrinking mode"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "distance", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom2"); RNA_def_property_range(prop, -5000, 5000); @@ -5133,7 +5133,7 @@ static void def_cmp_inpaint(StructRNA *srna) RNA_def_property_ui_text(prop, "Type", "Type of inpaint algorithm"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); #endif - + prop = RNA_def_property(srna, "distance", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom2"); RNA_def_property_range(prop, 1, 10000); @@ -5169,7 +5169,7 @@ static void def_cmp_scale(StructRNA *srna) {CMP_SCALE_RENDERPERCENT, "RENDER_SIZE", 0, "Render Size", ""}, {0, NULL, 0, NULL, NULL} }; - + /* matching bgpic_camera_frame_items[] */ static const EnumPropertyItem space_frame_items[] = { {0, "STRETCH", 0, "Stretch", ""}, @@ -5205,7 +5205,7 @@ static void def_cmp_scale(StructRNA *srna) static void def_cmp_rotate(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, node_sampler_type_items); @@ -5218,14 +5218,14 @@ static void def_cmp_diff_matte(StructRNA *srna) PropertyRNA *prop; RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); - + prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); RNA_def_property_float_funcs(prop, NULL, "rna_difference_matte_t1_set", NULL); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Tolerance", "Color distances below this threshold are keyed"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t2"); RNA_def_property_float_funcs(prop, NULL, "rna_difference_matte_t2_set", NULL); @@ -5237,7 +5237,7 @@ static void def_cmp_diff_matte(StructRNA *srna) static void def_cmp_color_matte(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); prop = RNA_def_property(srna, "color_hue", PROP_FLOAT, PROP_NONE); @@ -5245,13 +5245,13 @@ static void def_cmp_color_matte(StructRNA *srna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "H", "Hue tolerance for colors to be considered a keying color"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "color_saturation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t2"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "S", "Saturation Tolerance for the color"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "color_value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t3"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -5262,7 +5262,7 @@ static void def_cmp_color_matte(StructRNA *srna) static void def_cmp_distance_matte(StructRNA *srna) { PropertyRNA *prop; - + static const EnumPropertyItem color_space_items[] = { {1, "RGB", 0, "RGB", "RGB color space"}, {2, "YCC", 0, "YCC", "YCbCr Suppression"}, @@ -5277,14 +5277,14 @@ static void def_cmp_distance_matte(StructRNA *srna) RNA_def_property_ui_text(prop, "Channel", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); RNA_def_property_float_funcs(prop, NULL, "rna_distance_matte_t1_set", NULL); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Tolerance", "Color distances below this threshold are keyed"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t2"); RNA_def_property_float_funcs(prop, NULL, "rna_distance_matte_t2_set", NULL); @@ -5316,13 +5316,13 @@ static void def_cmp_color_spill(StructRNA *srna) {1, "AVERAGE", 0, "Average", "Average Limit Algorithm"}, {0, NULL, 0, NULL, NULL} }; - + prop = RNA_def_property(srna, "channel", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, channel_items); RNA_def_property_ui_text(prop, "Channel", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom2"); RNA_def_property_enum_items(prop, algorithm_items); @@ -5370,16 +5370,16 @@ static void def_cmp_color_spill(StructRNA *srna) static void def_cmp_luma_matte(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); - + prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL); RNA_def_property_ui_range(prop, 0, 1, 0.1f, 3); RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t2"); RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL); @@ -5401,16 +5401,16 @@ static void def_cmp_brightcontrast(StructRNA *srna) static void def_cmp_chroma_matte(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeChroma", "storage"); - + prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "t1"); RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL); RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(80.0f)); RNA_def_property_ui_text(prop, "Acceptance", "Tolerance for a color to be considered a keying color"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "t2"); RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL); @@ -5423,13 +5423,13 @@ static void def_cmp_chroma_matte(StructRNA *srna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Lift", "Alpha lift"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fstrength"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Falloff", "Alpha falloff"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "shadow_adjust", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t3"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -5440,7 +5440,7 @@ static void def_cmp_chroma_matte(StructRNA *srna) static void def_cmp_channel_matte(StructRNA *srna) { PropertyRNA *prop; - + static const EnumPropertyItem color_space_items[] = { {CMP_NODE_CHANNEL_MATTE_CS_RGB, "RGB", 0, "RGB", "RGB Color Space"}, {CMP_NODE_CHANNEL_MATTE_CS_HSV, "HSV", 0, "HSV", "HSV Color Space"}, @@ -5454,13 +5454,13 @@ static void def_cmp_channel_matte(StructRNA *srna) {1, "MAX", 0, "Max", "Limit by max of other channels "}, {0, NULL, 0, NULL, NULL} }; - + prop = RNA_def_property(srna, "color_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, color_space_items); RNA_def_property_ui_text(prop, "Color Space", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "matte_channel", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom2"); RNA_def_property_enum_items(prop, prop_tri_channel_items); @@ -5482,14 +5482,14 @@ static void def_cmp_channel_matte(StructRNA *srna) RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf"); RNA_def_property_ui_text(prop, "Limit Channel", "Limit by this channel's value"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "limit_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t1"); RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL); RNA_def_property_ui_range(prop, 0, 1, 0.1f, 3); RNA_def_property_ui_text(prop, "High", "Values higher than this setting are 100% opaque"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "limit_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "t2"); RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL); @@ -5501,7 +5501,7 @@ static void def_cmp_channel_matte(StructRNA *srna) static void def_cmp_flip(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, node_flip_items); @@ -5512,7 +5512,7 @@ static void def_cmp_flip(StructRNA *srna) static void def_cmp_splitviewer(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom2"); RNA_def_property_enum_items(prop, rna_enum_axis_xy_items); @@ -5529,7 +5529,7 @@ static void def_cmp_splitviewer(StructRNA *srna) static void def_cmp_id_mask(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom1"); RNA_def_property_range(prop, 0, 32767); @@ -5619,7 +5619,7 @@ static void def_cmp_defocus(StructRNA *srna) RNA_def_property_range(prop, 0.0f, DEG2RADF(90.0f)); RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_gamma_correction", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gamco", 1); RNA_def_property_ui_text(prop, "Gamma Correction", "Enable gamma correction before and after main process"); @@ -5633,20 +5633,20 @@ static void def_cmp_defocus(StructRNA *srna) "Amount of focal blur, 128=infinity=perfect focus, half the value doubles " "the blur radius"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "blur_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxblur"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_ui_text(prop, "Max Blur", "Blur limit, maximum CoC radius"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bthresh"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Threshold", "CoC radius threshold, prevents background bleed on in-focus midground, 0=off"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "preview", 1); RNA_def_property_ui_text(prop, "Preview", "Enable low quality mode, useful for preview"); @@ -5658,7 +5658,7 @@ static void def_cmp_defocus(StructRNA *srna) "Disable when using an image as input instead of actual z-buffer " "(auto enabled if node not image based, eg. time node)"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "z_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_range(prop, 0.0f, 1000.0f); @@ -5671,12 +5671,12 @@ static void def_cmp_defocus(StructRNA *srna) static void def_cmp_invert(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "invert_rgb", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_CHAN_RGB); RNA_def_property_ui_text(prop, "RGB", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_CHAN_A); RNA_def_property_ui_text(prop, "Alpha", ""); @@ -5686,7 +5686,7 @@ static void def_cmp_invert(StructRNA *srna) static void def_cmp_crop(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "use_crop_size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1); RNA_def_property_ui_text(prop, "Crop Image Size", "Whether to crop the size of the input image"); @@ -5704,19 +5704,19 @@ static void def_cmp_crop(StructRNA *srna) RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "X1", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "max_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "x2"); RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "X2", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "min_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "y1"); RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "Y1", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "max_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "y2"); RNA_def_property_range(prop, 0, 10000); @@ -5751,50 +5751,50 @@ static void def_cmp_crop(StructRNA *srna) static void def_cmp_dblur(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeDBlurData", "storage"); - + prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "iter"); RNA_def_property_range(prop, 1, 32); RNA_def_property_ui_text(prop, "Iterations", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "wrap", 1); RNA_def_property_ui_text(prop, "Wrap", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "center_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "center_x"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Center X", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "center_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "center_y"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Center Y", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "distance"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Distance", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "angle"); RNA_def_property_range(prop, 0.0f, DEG2RADF(360.0f)); RNA_def_property_ui_text(prop, "Angle", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "spin"); RNA_def_property_range(prop, DEG2RADF(-360.0f), DEG2RADF(360.0f)); RNA_def_property_ui_text(prop, "Spin", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "zoom"); RNA_def_property_range(prop, 0.0f, 100.0f); @@ -5805,21 +5805,21 @@ static void def_cmp_dblur(StructRNA *srna) static void def_cmp_bilateral_blur(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeBilateralBlurData", "storage"); - + prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "iter"); RNA_def_property_range(prop, 1, 128); RNA_def_property_ui_text(prop, "Iterations", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "sigma_color", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sigma_color"); RNA_def_property_range(prop, 0.01f, 3.0f); RNA_def_property_ui_text(prop, "Color Sigma", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "sigma_space", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sigma_space"); RNA_def_property_range(prop, 0.01f, 30.0f); @@ -5830,25 +5830,25 @@ static void def_cmp_bilateral_blur(StructRNA *srna) static void def_cmp_premul_key(StructRNA *srna) { PropertyRNA *prop; - + static const EnumPropertyItem type_items[] = { {0, "STRAIGHT_TO_PREMUL", 0, "Straight to Premul", ""}, {1, "PREMUL_TO_STRAIGHT", 0, "Premul to Straight", ""}, {0, NULL, 0, NULL, NULL} }; - + prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, type_items); RNA_def_property_ui_text(prop, "Mapping", "Conversion between premultiplied alpha and key alpha"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + } static void def_cmp_glare(StructRNA *srna) { PropertyRNA *prop; - + static const EnumPropertyItem type_items[] = { {3, "GHOSTS", 0, "Ghosts", ""}, {2, "STREAKS", 0, "Streaks", ""}, @@ -5856,22 +5856,22 @@ static void def_cmp_glare(StructRNA *srna) {0, "SIMPLE_STAR", 0, "Simple Star", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem quality_items[] = { {0, "HIGH", 0, "High", ""}, {1, "MEDIUM", 0, "Medium", ""}, {2, "LOW", 0, "Low", ""}, {0, NULL, 0, NULL, NULL} }; - + RNA_def_struct_sdna_from(srna, "NodeGlare", "storage"); - + prop = RNA_def_property(srna, "glare_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, type_items); RNA_def_property_ui_text(prop, "Glare Type", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "quality", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "quality"); RNA_def_property_enum_items(prop, quality_items); @@ -5879,13 +5879,13 @@ static void def_cmp_glare(StructRNA *srna) "If not set to high quality, the effect will be applied to a low-res copy " "of the source image"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "iter"); RNA_def_property_range(prop, 2, 5); RNA_def_property_ui_text(prop, "Iterations", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "color_modulation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colmod"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -5893,109 +5893,109 @@ static void def_cmp_glare(StructRNA *srna) "Amount of Color Modulation, modulates colors of streaks and ghosts for " "a spectral dispersion effect"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "mix", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mix"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Mix", "-1 is original image only, 0 is exact 50/50 mix, 1 is processed image only"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "threshold"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Threshold", "The glare filter will only be applied to pixels brighter than this value"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "streaks", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "streaks"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Streaks", "Total number of streaks"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "angle_offset", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "angle_ofs"); RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f)); RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "fade", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fade"); RNA_def_property_range(prop, 0.75f, 1.0f); RNA_def_property_ui_text(prop, "Fade", "Streak fade-out factor"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_rotate_45", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "star_45", 0); RNA_def_property_ui_text(prop, "Rotate 45", "Simple star filter: add 45 degree rotation offset"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "size"); RNA_def_property_range(prop, 6, 9); RNA_def_property_ui_text(prop, "Size", "Glow/glare size (not actual size; relative to initial size of bright area of pixels)"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + /* TODO */ } static void def_cmp_tonemap(StructRNA *srna) { PropertyRNA *prop; - + static const EnumPropertyItem type_items[] = { {1, "RD_PHOTORECEPTOR", 0, "R/D Photoreceptor", ""}, {0, "RH_SIMPLE", 0, "Rh Simple", ""}, {0, NULL, 0, NULL, NULL} }; - + RNA_def_struct_sdna_from(srna, "NodeTonemap", "storage"); - + prop = RNA_def_property(srna, "tonemap_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, type_items); RNA_def_property_ui_text(prop, "Tonemap Type", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "key", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "key"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Key", "The value the average luminance is mapped to"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_range(prop, 0.001f, 10.0f); RNA_def_property_ui_text(prop, "Offset", "Normally always 1, but can be used as an extra control to alter the brightness curve"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "gamma"); RNA_def_property_range(prop, 0.001f, 3.0f); RNA_def_property_ui_text(prop, "Gamma", "If not used, set to 1"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f"); RNA_def_property_range(prop, -8.0f, 8.0f); RNA_def_property_ui_text(prop, "Intensity", "If less than zero, darkens image; otherwise, makes it brighter"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "m"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Contrast", "Set to 0 to use estimate from input image"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "adaptation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "a"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Adaptation", "If 0, global; if 1, based on pixel intensity"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "correction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "c"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -6006,20 +6006,20 @@ static void def_cmp_tonemap(StructRNA *srna) static void def_cmp_lensdist(StructRNA *srna) { PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeLensDist", "storage"); - + prop = RNA_def_property(srna, "use_projector", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "proj", 1); RNA_def_property_ui_text(prop, "Projector", "Enable/disable projector mode (the effect is applied in horizontal direction only)"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_jitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "jit", 1); RNA_def_property_ui_text(prop, "Jitter", "Enable/disable jittering (faster, but also noisier)"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "use_fit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "fit", 1); RNA_def_property_ui_text(prop, "Fit", @@ -6031,21 +6031,21 @@ static void def_cmp_colorbalance(StructRNA *srna) { PropertyRNA *prop; static float default_1[3] = {1.f, 1.f, 1.f}; - + static const EnumPropertyItem type_items[] = { {0, "LIFT_GAMMA_GAIN", 0, "Lift/Gamma/Gain", ""}, {1, "OFFSET_POWER_SLOPE", 0, "Offset/Power/Slope (ASC-CDL)", "ASC-CDL standard color correction"}, {0, NULL, 0, NULL, NULL} }; - + prop = RNA_def_property(srna, "correction_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, type_items); RNA_def_property_ui_text(prop, "Correction Formula", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + RNA_def_struct_sdna_from(srna, "NodeColorBalance", "storage"); - + prop = RNA_def_property(srna, "lift", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "lift"); RNA_def_property_array(prop, 3); @@ -6053,7 +6053,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Lift", "Correction for Shadows"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_lgg"); - + prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "gamma"); RNA_def_property_array(prop, 3); @@ -6061,7 +6061,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Gamma", "Correction for Midtones"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_lgg"); - + prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "gain"); RNA_def_property_array(prop, 3); @@ -6069,15 +6069,15 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Gain", "Correction for Highlights"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_lgg"); - - + + prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_array(prop, 3); RNA_def_property_ui_range(prop, 0, 1, 0.1, 3); RNA_def_property_ui_text(prop, "Offset", "Correction for Shadows"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_cdl"); - + prop = RNA_def_property(srna, "power", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "power"); RNA_def_property_array(prop, 3); @@ -6086,7 +6086,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Power", "Correction for Midtones"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeColorBalance_update_cdl"); - + prop = RNA_def_property(srna, "slope", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "slope"); RNA_def_property_array(prop, 3); @@ -6106,7 +6106,7 @@ static void def_cmp_colorbalance(StructRNA *srna) static void def_cmp_huecorrect(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "mapping", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "storage"); RNA_def_property_struct_type(prop, "CurveMapping"); @@ -6117,7 +6117,7 @@ static void def_cmp_huecorrect(StructRNA *srna) static void def_cmp_zcombine(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 0); RNA_def_property_ui_text(prop, "Use Alpha", "Take Alpha channel into account when doing the Z operation"); @@ -6132,7 +6132,7 @@ static void def_cmp_zcombine(StructRNA *srna) static void def_cmp_ycc(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, node_ycc_items); @@ -6287,7 +6287,7 @@ static const EnumPropertyItem node_masktype_items[] = { {0, NULL, 0, NULL, NULL} }; -static void def_cmp_boxmask(StructRNA *srna) +static void def_cmp_boxmask(StructRNA *srna) { PropertyRNA *prop; @@ -6413,7 +6413,7 @@ static void def_cmp_bokehblur(StructRNA *srna) RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_ui_text(prop, "Max Blur", "Blur limit, maximum CoC radius"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + } static void def_cmp_bokehimage(StructRNA *srna) @@ -6481,21 +6481,21 @@ static void def_cmp_colorcorrection(StructRNA *srna) RNA_def_property_boolean_default(prop, true); RNA_def_property_ui_text(prop, "Red", "Red channel active"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "green", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 2); RNA_def_property_boolean_default(prop, true); RNA_def_property_ui_text(prop, "Green", "Green channel active"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "blue", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "custom1", 4); RNA_def_property_boolean_default(prop, true); RNA_def_property_ui_text(prop, "Blue", "Blue channel active"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + RNA_def_struct_sdna_from(srna, "NodeColorCorrection", "storage"); - + prop = RNA_def_property(srna, "midtones_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "startmidtones"); RNA_def_property_float_default(prop, 0.2f); @@ -6509,35 +6509,35 @@ static void def_cmp_colorcorrection(StructRNA *srna) RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Midtones End", "End of midtones"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "master_saturation", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "master.saturation"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Master Saturation", "Master saturation"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "master_contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "master.contrast"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Master Contrast", "Master contrast"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "master_gamma", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "master.gamma"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Master Gamma", "Master gamma"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "master_gain", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "master.gain"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Master Gain", "Master gain"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "master_lift", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "master.lift"); RNA_def_property_float_default(prop, 0.0f); @@ -6552,28 +6552,28 @@ static void def_cmp_colorcorrection(StructRNA *srna) RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Shadows Saturation", "Shadows saturation"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "shadows_contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shadows.contrast"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Shadows Contrast", "Shadows contrast"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "shadows_gamma", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shadows.gamma"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Shadows Gamma", "Shadows gamma"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "shadows_gain", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shadows.gain"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Shadows Gain", "Shadows gain"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "shadows_lift", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shadows.lift"); RNA_def_property_float_default(prop, 0.0f); @@ -6587,28 +6587,28 @@ static void def_cmp_colorcorrection(StructRNA *srna) RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Midtones Saturation", "Midtones saturation"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "midtones_contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "midtones.contrast"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Midtones Contrast", "Midtones contrast"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "midtones_gamma", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "midtones.gamma"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Midtones Gamma", "Midtones gamma"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "midtones_gain", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "midtones.gain"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Midtones Gain", "Midtones gain"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "midtones_lift", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "midtones.lift"); RNA_def_property_float_default(prop, 0.0f); @@ -6622,28 +6622,28 @@ static void def_cmp_colorcorrection(StructRNA *srna) RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Highlights Saturation", "Highlights saturation"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "highlights_contrast", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "highlights.contrast"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Highlights Contrast", "Highlights contrast"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "highlights_gamma", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "highlights.gamma"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Highlights Gamma", "Highlights gamma"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "highlights_gain", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "highlights.gain"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0, 4); RNA_def_property_ui_text(prop, "Highlights Gain", "Highlights gain"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "highlights_lift", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "highlights.lift"); RNA_def_property_float_default(prop, 0.0f); @@ -6675,7 +6675,7 @@ static void def_cmp_viewer(StructRNA *srna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "X", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "center_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "custom4"); RNA_def_property_float_default(prop, 0.5f); @@ -6939,7 +6939,7 @@ static void def_tex_output(StructRNA *srna) PropertyRNA *prop; RNA_def_struct_sdna_from(srna, "TexNodeOutput", "storage"); - + prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Output Name", ""); @@ -6974,19 +6974,19 @@ static void def_tex_bricks(StructRNA *srna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Offset Amount", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "offset_frequency", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom1"); RNA_def_property_range(prop, 2, 99); RNA_def_property_ui_text(prop, "Offset Frequency", "Offset every N rows"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "squash", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "custom4"); RNA_def_property_range(prop, 0.0f, 99.0f); RNA_def_property_ui_text(prop, "Squash Amount", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "squash_frequency", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "custom2"); RNA_def_property_range(prop, 2, 99); @@ -6999,7 +6999,7 @@ static void def_tex_bricks(StructRNA *srna) static void rna_def_shader_node(BlenderRNA *brna) { StructRNA *srna; - + srna = RNA_def_struct(brna, "ShaderNode", "NodeInternal"); RNA_def_struct_ui_text(srna, "Shader Node", "Material shader node"); RNA_def_struct_sdna(srna, "bNode"); @@ -7010,12 +7010,12 @@ static void rna_def_compositor_node(BlenderRNA *brna) { StructRNA *srna; FunctionRNA *func; - + srna = RNA_def_struct(brna, "CompositorNode", "NodeInternal"); RNA_def_struct_ui_text(srna, "Compositor Node", ""); RNA_def_struct_sdna(srna, "bNode"); RNA_def_struct_register_funcs(srna, "rna_CompositorNode_register", "rna_Node_unregister", NULL); - + /* compositor node need_exec flag */ func = RNA_def_function(srna, "tag_need_exec", "rna_CompositorNode_tag_need_exec"); RNA_def_function_ui_description(func, "Tag the node for compositor update"); @@ -7024,7 +7024,7 @@ static void rna_def_compositor_node(BlenderRNA *brna) static void rna_def_texture_node(BlenderRNA *brna) { StructRNA *srna; - + srna = RNA_def_struct(brna, "TextureNode", "NodeInternal"); RNA_def_struct_ui_text(srna, "Texture Node", ""); RNA_def_struct_sdna(srna, "bNode"); @@ -7039,9 +7039,9 @@ static void rna_def_node_socket(BlenderRNA *brna) PropertyRNA *prop; PropertyRNA *parm; FunctionRNA *func; - + static float default_draw_color[] = { 0.0f, 0.0f, 0.0f, 1.0f }; - + srna = RNA_def_struct(brna, "NodeSocket", NULL); RNA_def_struct_ui_text(srna, "Node Socket", "Input or output socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); @@ -7168,9 +7168,9 @@ static void rna_def_node_socket_interface(BlenderRNA *brna) PropertyRNA *prop; PropertyRNA *parm; FunctionRNA *func; - + static float default_draw_color[] = { 0.0f, 0.0f, 0.0f, 1.0f }; - + srna = RNA_def_struct(brna, "NodeSocketInterface", NULL); RNA_def_struct_ui_text(srna, "Node Socket Template", "Parameters to define node sockets"); /* XXX Using bNodeSocket DNA for templates is a compatibility hack. @@ -7252,7 +7252,7 @@ static void rna_def_node_socket_float(BlenderRNA *brna, const char *idname, cons StructRNA *srna; PropertyRNA *prop; float value_default; - + /* choose sensible common default based on subtype */ switch (subtype) { case PROP_FACTOR: @@ -7265,46 +7265,46 @@ static void rna_def_node_socket_float(BlenderRNA *brna, const char *idname, cons value_default = 0.0f; break; } - + srna = RNA_def_struct(brna, idname, "NodeSocketStandard"); RNA_def_struct_ui_text(srna, "Float Node Socket", "Floating point number socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueFloat", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_FLOAT, subtype); RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_NodeSocketStandard_float_range"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketStandard_value_update"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); - + /* socket interface */ srna = RNA_def_struct(brna, interface_idname, "NodeSocketInterfaceStandard"); RNA_def_struct_ui_text(srna, "Float Node Socket Interface", "Floating point number socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueFloat", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_FLOAT, subtype); RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_float_default(prop, value_default); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_NodeSocketStandard_float_range"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + prop = RNA_def_property(srna, "min_value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum Value", "Minimum value"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + prop = RNA_def_property(srna, "max_value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Maximum Value", "Maximum value"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); } @@ -7313,7 +7313,7 @@ static void rna_def_node_socket_int(BlenderRNA *brna, const char *identifier, co StructRNA *srna; PropertyRNA *prop; int value_default; - + /* choose sensible common default based on subtype */ switch (subtype) { case PROP_FACTOR: @@ -7326,13 +7326,13 @@ static void rna_def_node_socket_int(BlenderRNA *brna, const char *identifier, co value_default = 0; break; } - + srna = RNA_def_struct(brna, identifier, "NodeSocketStandard"); RNA_def_struct_ui_text(srna, "Integer Node Socket", "Integer number socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueInt", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_INT, subtype); RNA_def_property_int_sdna(prop, NULL, "value"); RNA_def_property_int_default(prop, value_default); @@ -7340,32 +7340,32 @@ static void rna_def_node_socket_int(BlenderRNA *brna, const char *identifier, co RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketStandard_value_update"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); - + /* socket interface */ srna = RNA_def_struct(brna, interface_idname, "NodeSocketInterfaceStandard"); RNA_def_struct_ui_text(srna, "Integer Node Socket Interface", "Integer number socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); RNA_def_struct_sdna_from(srna, "bNodeSocketValueInt", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_INT, subtype); RNA_def_property_int_sdna(prop, NULL, "value"); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_NodeSocketStandard_int_range"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + prop = RNA_def_property(srna, "min_value", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum Value", "Minimum value"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + prop = RNA_def_property(srna, "max_value", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Maximum Value", "Maximum value"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); } @@ -7373,33 +7373,33 @@ static void rna_def_node_socket_bool(BlenderRNA *brna, const char *identifier, c { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, identifier, "NodeSocketStandard"); RNA_def_struct_ui_text(srna, "Boolean Node Socket", "Boolean value socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueBoolean", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "value", 1); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketStandard_value_update"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); - + /* socket interface */ srna = RNA_def_struct(brna, interface_idname, "NodeSocketInterfaceStandard"); RNA_def_struct_ui_text(srna, "Boolean Node Socket Interface", "Boolean value socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueBoolean", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "value", 1); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); } @@ -7408,7 +7408,7 @@ static void rna_def_node_socket_vector(BlenderRNA *brna, const char *identifier, StructRNA *srna; PropertyRNA *prop; const float *value_default; - + /* choose sensible common default based on subtype */ switch (subtype) { case PROP_DIRECTION: { @@ -7422,13 +7422,13 @@ static void rna_def_node_socket_vector(BlenderRNA *brna, const char *identifier, break; } } - + srna = RNA_def_struct(brna, identifier, "NodeSocketStandard"); RNA_def_struct_ui_text(srna, "Vector Node Socket", "3D vector socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueVector", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_FLOAT, subtype); RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_float_array_default(prop, value_default); @@ -7436,32 +7436,32 @@ static void rna_def_node_socket_vector(BlenderRNA *brna, const char *identifier, RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketStandard_value_update"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); - + /* socket interface */ srna = RNA_def_struct(brna, interface_idname, "NodeSocketInterfaceStandard"); RNA_def_struct_ui_text(srna, "Vector Node Socket Interface", "3D vector socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueVector", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_FLOAT, subtype); RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_NodeSocketStandard_vector_range"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + prop = RNA_def_property(srna, "min_value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum Value", "Minimum value"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + prop = RNA_def_property(srna, "max_value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Maximum Value", "Maximum value"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); } @@ -7469,33 +7469,33 @@ static void rna_def_node_socket_color(BlenderRNA *brna, const char *identifier, { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, identifier, "NodeSocketStandard"); RNA_def_struct_ui_text(srna, "Color Node Socket", "RGBA color socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueRGBA", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketStandard_value_update"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); - + /* socket interface */ srna = RNA_def_struct(brna, interface_idname, "NodeSocketInterfaceStandard"); RNA_def_struct_ui_text(srna, "Color Node Socket Interface", "RGBA color socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueRGBA", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); } @@ -7503,44 +7503,44 @@ static void rna_def_node_socket_string(BlenderRNA *brna, const char *identifier, { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, identifier, "NodeSocketStandard"); RNA_def_struct_ui_text(srna, "String Node Socket", "String socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueString", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "value"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketStandard_value_update"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); - + /* socket interface */ srna = RNA_def_struct(brna, interface_idname, "NodeSocketInterfaceStandard"); RNA_def_struct_ui_text(srna, "String Node Socket Interface", "String socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + RNA_def_struct_sdna_from(srna, "bNodeSocketValueString", "default_value"); - + prop = RNA_def_property(srna, "default_value", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "value"); RNA_def_property_ui_text(prop, "Default Value", "Input value used for unconnected socket"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); - + RNA_def_struct_sdna_from(srna, "bNodeSocket", NULL); } static void rna_def_node_socket_shader(BlenderRNA *brna, const char *identifier, const char *interface_idname) { StructRNA *srna; - + srna = RNA_def_struct(brna, identifier, "NodeSocketStandard"); RNA_def_struct_ui_text(srna, "Shader Node Socket", "Shader socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + /* socket interface */ srna = RNA_def_struct(brna, interface_idname, "NodeSocketInterfaceStandard"); RNA_def_struct_ui_text(srna, "Shader Node Socket Interface", "Shader socket of a node"); @@ -7550,7 +7550,7 @@ static void rna_def_node_socket_shader(BlenderRNA *brna, const char *identifier, static void rna_def_node_socket_virtual(BlenderRNA *brna, const char *identifier) { StructRNA *srna; - + srna = RNA_def_struct(brna, identifier, "NodeSocketStandard"); RNA_def_struct_ui_text(srna, "Virtual Node Socket", "Virtual socket of a node"); RNA_def_struct_sdna(srna, "bNodeSocket"); @@ -7564,16 +7564,16 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) * so in order to call them in py scripts we need to overload and replace them with plain C callbacks. * These types provide a usable basis for socket types defined in C. */ - + StructRNA *srna; PropertyRNA *parm, *prop; FunctionRNA *func; - + static float default_draw_color[] = { 0.0f, 0.0f, 0.0f, 1.0f }; - + srna = RNA_def_struct(brna, "NodeSocketStandard", "NodeSocket"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + /* draw socket */ func = RNA_def_function(srna, "draw", "rna_NodeSocketStandard_draw"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); @@ -7604,11 +7604,11 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); parm = RNA_def_float_array(func, "color", 4, default_draw_color, 0.0f, 1.0f, "Color", "", 0.0f, 1.0f); RNA_def_function_output(func, parm); - - + + srna = RNA_def_struct(brna, "NodeSocketInterfaceStandard", "NodeSocketInterface"); RNA_def_struct_sdna(srna, "bNodeSocket"); - + /* for easier type comparison in python */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typeinfo->type"); @@ -7616,7 +7616,7 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) RNA_def_property_enum_default(prop, SOCK_FLOAT); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Type", "Data type"); - + func = RNA_def_function(srna, "draw", "rna_NodeSocketInterfaceStandard_draw"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_ui_description(func, "Draw template settings"); @@ -7640,7 +7640,7 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) * Then use the nodeStaticSocketType and nodeStaticSocketInterfaceType functions * to get the idname strings from int type and subtype (see node_socket.c, register_standard_node_socket_types). */ - + rna_def_node_socket_float(brna, "NodeSocketFloat", "NodeSocketInterfaceFloat", PROP_NONE); rna_def_node_socket_float(brna, "NodeSocketFloatUnsigned", "NodeSocketInterfaceFloatUnsigned", PROP_UNSIGNED); rna_def_node_socket_float(brna, "NodeSocketFloatPercentage", "NodeSocketInterfaceFloatPercentage", PROP_PERCENTAGE); @@ -7677,36 +7677,36 @@ static void rna_def_internal_node(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop, *parm; FunctionRNA *func; - + srna = RNA_def_struct(brna, "NodeInternalSocketTemplate", NULL); RNA_def_struct_ui_text(srna, "Socket Template", "Type and default value of a node socket"); - + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_NodeInternalSocketTemplate_name_get", "rna_NodeInternalSocketTemplate_name_length", NULL); RNA_def_property_ui_text(prop, "Name", "Name of the socket"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + prop = RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_NodeInternalSocketTemplate_identifier_get", "rna_NodeInternalSocketTemplate_identifier_length", NULL); RNA_def_property_ui_text(prop, "Identifier", "Identifier of the socket"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_funcs(prop, "rna_NodeInternalSocketTemplate_type_get", NULL, NULL); RNA_def_property_enum_items(prop, node_socket_type_items); RNA_def_property_ui_text(prop, "Type", "Data type of the socket"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + /* XXX Workaround: Registered functions are not exposed in python by bpy, * it expects them to be registered from python and use the native implementation. * However, the standard node types are not registering these functions from python, * so in order to call them in py scripts we need to overload and replace them with plain C callbacks. * This type provides a usable basis for node types defined in C. */ - + srna = RNA_def_struct(brna, "NodeInternal", "Node"); RNA_def_struct_sdna(srna, "bNode"); - + /* poll */ func = RNA_def_function(srna, "poll", "rna_NodeInternal_poll"); RNA_def_function_ui_description(func, "If non-null output is returned, the node type can be added to the tree"); @@ -7714,18 +7714,18 @@ static void rna_def_internal_node(BlenderRNA *brna) RNA_def_function_return(func, RNA_def_boolean(func, "visible", false, "", "")); parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - + func = RNA_def_function(srna, "poll_instance", "rna_NodeInternal_poll_instance"); RNA_def_function_ui_description(func, "If non-null output is returned, the node can be added to the tree"); RNA_def_function_return(func, RNA_def_boolean(func, "visible", false, "", "")); parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - + /* update */ func = RNA_def_function(srna, "update", "rna_NodeInternal_update"); RNA_def_function_ui_description(func, "Update on editor changes"); RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_ALLOW_WRITE); - + /* draw buttons */ func = RNA_def_function(srna, "draw_buttons", "rna_NodeInternal_draw_buttons"); RNA_def_function_ui_description(func, "Draw node buttons"); @@ -7802,7 +7802,7 @@ static void rna_def_node(BlenderRNA *brna) PropertyRNA *prop; FunctionRNA *func; PropertyRNA *parm; - + static const EnumPropertyItem dummy_static_type_items[] = { {NODE_CUSTOM, "CUSTOM", 0, "Custom", "Custom Node"}, {0, NULL, 0, NULL, NULL}}; @@ -7821,7 +7821,7 @@ static void rna_def_node(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_Node_path"); RNA_def_struct_register_funcs(srna, "rna_Node_register", "rna_Node_unregister", NULL); RNA_def_struct_idprops_func(srna, "rna_Node_idprops"); - + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, dummy_static_type_items); @@ -7829,55 +7829,55 @@ static void rna_def_node(BlenderRNA *brna) RNA_def_property_enum_default(prop, NODE_CUSTOM); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Type", "Node type (deprecated, use bl_static_type or bl_idname for the actual identifier string)"); - + prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "locx"); RNA_def_property_array(prop, 2); RNA_def_property_range(prop, -100000.0f, 100000.0f); RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_update(prop, NC_NODE, "rna_Node_update"); - + prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "width"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_Node_width_range"); RNA_def_property_ui_text(prop, "Width", "Width of the node"); RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL); - + prop = RNA_def_property(srna, "width_hidden", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "miniwidth"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_Node_width_range"); RNA_def_property_ui_text(prop, "Width Hidden", "Width of the node in hidden state"); RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL); - + prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "height"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_Node_height_range"); RNA_def_property_ui_text(prop, "Height", "Height of the node"); RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL); - + prop = RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ_LENGTH); RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_Node_dimensions_get", NULL, NULL); RNA_def_property_ui_text(prop, "Dimensions", "Absolute bounding box dimensions of the node"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Unique node identifier"); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Node_name_set"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + prop = RNA_def_property(srna, "label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "label"); RNA_def_property_ui_text(prop, "Label", "Optional custom node label"); RNA_def_property_update(prop, NC_NODE | ND_DISPLAY, NULL); - + prop = RNA_def_property(srna, "inputs", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "inputs", NULL); RNA_def_property_struct_type(prop, "NodeSocket"); RNA_def_property_ui_text(prop, "Inputs", ""); rna_def_node_sockets_api(brna, prop, SOCK_IN); - + prop = RNA_def_property(srna, "outputs", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "outputs", NULL); RNA_def_property_struct_type(prop, "NodeSocket"); @@ -7895,7 +7895,7 @@ static void rna_def_node(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Node"); RNA_def_property_ui_text(prop, "Parent", "Parent this node is attached to"); - + prop = RNA_def_property(srna, "use_custom_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_CUSTOM_COLOR); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -7972,7 +7972,7 @@ static void rna_def_node(BlenderRNA *brna) prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATION); RNA_def_property_string_sdna(prop, NULL, "typeinfo->ui_description"); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - + prop = RNA_def_property(srna, "bl_icon", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typeinfo->ui_icon"); RNA_def_property_enum_items(prop, rna_enum_node_icon_items); @@ -8020,26 +8020,26 @@ static void rna_def_node(BlenderRNA *brna) RNA_def_function_return(func, RNA_def_boolean(func, "visible", false, "", "")); parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - + func = RNA_def_function(srna, "poll_instance", NULL); RNA_def_function_ui_description(func, "If non-null output is returned, the node can be added to the tree"); RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", false, "", "")); parm = RNA_def_pointer(func, "node_tree", "NodeTree", "Node Tree", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - + /* update */ func = RNA_def_function(srna, "update", NULL); RNA_def_function_ui_description(func, "Update on editor changes"); RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); - + /* insert_link */ func = RNA_def_function(srna, "insert_link", NULL); RNA_def_function_ui_description(func, "Handle creation of a link to or from the node"); RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); parm = RNA_def_pointer(func, "link", "NodeLink", "Link", "Node link that will be inserted"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); - + /* init */ func = RNA_def_function(srna, "init", NULL); RNA_def_function_ui_description(func, "Initialize a new instance of this node"); @@ -8284,7 +8284,7 @@ static void rna_def_nodetree(BlenderRNA *brna) RNA_def_property_array(prop, 2); RNA_def_property_float_sdna(prop, NULL, "view_center"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + /* AnimData */ rna_def_animdata_common(srna); @@ -8309,7 +8309,7 @@ static void rna_def_nodetree(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil data-block"); RNA_def_property_update(prop, NC_NODE, NULL); - + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_enum_items(prop, static_type_items); @@ -8359,7 +8359,7 @@ static void rna_def_nodetree(BlenderRNA *brna) prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_TRANSLATION); RNA_def_property_string_sdna(prop, NULL, "typeinfo->ui_description"); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - + prop = RNA_def_property(srna, "bl_icon", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typeinfo->ui_icon"); RNA_def_property_enum_items(prop, rna_enum_node_icon_items); @@ -8466,11 +8466,11 @@ static StructRNA *define_specific_node(BlenderRNA *brna, const char *struct_name StructRNA *srna; FunctionRNA *func; PropertyRNA *parm; - + /* XXX hack, want to avoid "NodeInternal" prefix, so use "Node" in NOD_static_types.h and replace here */ if (STREQ(base_name, "Node")) base_name = "NodeInternal"; - + srna = RNA_def_struct(brna, struct_name, base_name); RNA_def_struct_ui_text(srna, ui_name, ui_desc); RNA_def_struct_sdna(srna, "bNode"); @@ -8528,26 +8528,26 @@ static void rna_def_node_instance_hash(BlenderRNA *brna) void RNA_def_nodetree(BlenderRNA *brna) { StructRNA *srna; - + rna_def_node_socket(brna); rna_def_node_socket_interface(brna); - + rna_def_node(brna); rna_def_node_link(brna); - + rna_def_internal_node(brna); rna_def_shader_node(brna); rna_def_compositor_node(brna); rna_def_texture_node(brna); - + rna_def_nodetree(brna); - + rna_def_node_socket_standard_types(brna); - + rna_def_composite_nodetree(brna); rna_def_shader_nodetree(brna); rna_def_texture_nodetree(brna); - + #define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \ { \ srna = define_specific_node(brna, #Category #StructName, #Category, UIName, UIDesc, DefFunc); \ @@ -8556,12 +8556,12 @@ void RNA_def_nodetree(BlenderRNA *brna) def_cmp_output_file(brna, srna); \ } \ } - + /* hack, don't want to add include path to RNA just for this, since in the future RNA types * for nodes should be defined locally at runtime anyway ... */ #include "../../nodes/NOD_static_types.h" - + /* Node group types need to be defined for shader, compositor, texture nodes individually. * Cannot use the static types header for this, since they share the same int id. */ @@ -8569,11 +8569,11 @@ void RNA_def_nodetree(BlenderRNA *brna) define_specific_node(brna, "CompositorNodeGroup", "CompositorNode", "Group", "", def_group); define_specific_node(brna, "TextureNodeGroup", "TextureNode", "Group", "", def_group); def_custom_group(brna); - + /* special socket types */ rna_def_cmp_output_file_slot_file(brna); rna_def_cmp_output_file_slot_layer(brna); - + rna_def_node_instance_hash(brna); } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 6939f7d59a1..107b3f6ad57 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -347,7 +347,7 @@ static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) base = scene ? BKE_scene_base_find(scene, ob) : NULL; if (!base) return; - + SWAP(unsigned int, base->lay, ob->lay); rna_Object_layer_update__internal(bmain, scene, base, ob); @@ -463,7 +463,7 @@ static const EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), if (ob->parent) { Object *par = ob->parent; - + if (par->type == OB_LATTICE) { /* special hack: prevents this overriding others */ RNA_enum_items_add_value(&item, &totitem, &parent_type_items[2], PARSKEL); @@ -530,7 +530,7 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value) { Object *ob = (Object *)ptr->data; Group *grp = (Group *)value.data; - + /* must not let this be set if the object belongs in this group already, * thus causing a cycle/infinite-recursion leading to crashes on load [#25298] */ @@ -703,7 +703,7 @@ static PointerRNA rna_Object_active_material_get(PointerRNA *ptr) { Object *ob = (Object *)ptr->id.data; Material *ma; - + ma = (ob->totcol) ? give_current_material(ob, ob->actcol) : NULL; return rna_pointer_inherit_refine(ptr, &RNA_Material, ma); } @@ -763,7 +763,7 @@ static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, Pointe static void rna_Object_rotation_axis_angle_get(PointerRNA *ptr, float *value) { Object *ob = ptr->data; - + /* for now, assume that rotation mode is axis-angle */ value[0] = ob->rotAngle; copy_v3_v3(&value[1], ob->rotAxis); @@ -773,21 +773,21 @@ static void rna_Object_rotation_axis_angle_get(PointerRNA *ptr, float *value) static void rna_Object_rotation_axis_angle_set(PointerRNA *ptr, const float *value) { Object *ob = ptr->data; - + /* for now, assume that rotation mode is axis-angle */ ob->rotAngle = value[0]; copy_v3_v3(ob->rotAxis, &value[1]); - + /* TODO: validate axis? */ } static void rna_Object_rotation_mode_set(PointerRNA *ptr, int value) { Object *ob = ptr->data; - + /* use API Method for conversions... */ BKE_rotMode_change_values(ob->quat, ob->rot, ob->rotAxis, &ob->rotAngle, ob->rotmode, (short)value); - + /* finally, set the new rotation type */ ob->rotmode = value; } @@ -807,7 +807,7 @@ static void rna_Object_dimensions_set(PointerRNA *ptr, const float *value) static int rna_Object_location_editable(PointerRNA *ptr, int index) { Object *ob = (Object *)ptr->data; - + /* only if the axis in question is locked, not editable... */ if ((index == 0) && (ob->protectflag & OB_LOCK_LOCX)) return 0; @@ -822,7 +822,7 @@ static int rna_Object_location_editable(PointerRNA *ptr, int index) static int rna_Object_scale_editable(PointerRNA *ptr, int index) { Object *ob = (Object *)ptr->data; - + /* only if the axis in question is locked, not editable... */ if ((index == 0) && (ob->protectflag & OB_LOCK_SCALEX)) return 0; @@ -837,7 +837,7 @@ static int rna_Object_scale_editable(PointerRNA *ptr, int index) static int rna_Object_rotation_euler_editable(PointerRNA *ptr, int index) { Object *ob = (Object *)ptr->data; - + /* only if the axis in question is locked, not editable... */ if ((index == 0) && (ob->protectflag & OB_LOCK_ROTX)) return 0; @@ -852,7 +852,7 @@ static int rna_Object_rotation_euler_editable(PointerRNA *ptr, int index) static int rna_Object_rotation_4d_editable(PointerRNA *ptr, int index) { Object *ob = (Object *)ptr->data; - + /* only consider locks if locking components individually... */ if (ob->protectflag & OB_LOCK_ROT4D) { /* only if the axis in question is locked, not editable... */ @@ -865,7 +865,7 @@ static int rna_Object_rotation_4d_editable(PointerRNA *ptr, int index) else if ((index == 3) && (ob->protectflag & OB_LOCK_ROTZ)) return 0; } - + return PROP_EDITABLE; } @@ -900,7 +900,7 @@ static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value) { Object *ob = (Object *)ptr->id.data; int index = (Material **)ptr->data - ob->mat; - + if (value) { ob->matbits[index] = 1; /* ob->colbits |= (1 << index); */ /* DEPRECATED */ @@ -921,7 +921,7 @@ static int rna_MaterialSlot_name_length(PointerRNA *ptr) if (ma) return strlen(ma->id.name + 2); - + return 0; } @@ -1155,7 +1155,7 @@ static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values) for (i = 0; i < OB_MAX_STATES; i++) if (values[i]) tot++; - + if (tot == 0) return; @@ -1279,7 +1279,7 @@ static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr) if (key == NULL) return PointerRNA_NULL; - + kb = BLI_findlink(&key->block, ob->shapenr - 1); RNA_pointer_create((ID *)key, &RNA_ShapeKey, kb, &keyptr); return keyptr; @@ -1292,7 +1292,7 @@ static PointerRNA rna_Object_field_get(PointerRNA *ptr) /* weak */ if (!ob->pd) ob->pd = object_add_collision_fields(0); - + return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, ob->pd); } @@ -1306,7 +1306,7 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr) /* weak */ if (!ob->pd) ob->pd = object_add_collision_fields(0); - + return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd); } @@ -1549,7 +1549,7 @@ static void rna_def_vertex_group(BlenderRNA *brna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_VertexGroup_name_set"); /* update data because modifiers may use [#24761] */ RNA_def_property_update(prop, NC_GEOM | ND_DATA | NA_RENAME, "rna_Object_internal_update_data"); - + prop = RNA_def_property(srna, "lock_weight", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "", "Maintain the relative weights for the group"); RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); @@ -1598,7 +1598,7 @@ static void rna_def_material_slot(BlenderRNA *brna) {0, "DATA", 0, "Data", ""}, {0, NULL, 0, NULL, NULL} }; - + /* NOTE: there is no MaterialSlot equivalent in DNA, so the internal * pointer data points to ob->mat + index, and we manually implement * get/set for the properties. */ @@ -1751,7 +1751,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_ui_text(prop, "Velocity Max", "Clamp velocity to this maximum speed, " "in distance per second"); - + prop = RNA_def_property(srna, "angular_velocity_min", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "min_angvel"); RNA_def_property_range(prop, 0.0, 1000.0); @@ -1809,34 +1809,34 @@ static void rna_def_object_game_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_AXIS); RNA_def_property_ui_text(prop, "Lock X Axis", "Disable simulation of linear motion along the X axis"); - + prop = RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_AXIS); RNA_def_property_ui_text(prop, "Lock Y Axis", "Disable simulation of linear motion along the Y axis"); - + prop = RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_AXIS); RNA_def_property_ui_text(prop, "Lock Z Axis", "Disable simulation of linear motion along the Z axis"); - - + + /* lock rotation */ prop = RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_X_ROT_AXIS); RNA_def_property_ui_text(prop, "Lock X Rotation Axis", "Disable simulation of angular motion along the X axis"); - + prop = RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Y_ROT_AXIS); RNA_def_property_ui_text(prop, "Lock Y Rotation Axis", "Disable simulation of angular motion along the Y axis"); - + prop = RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag2", OB_LOCK_RIGID_BODY_Z_ROT_AXIS); RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis"); - + /* is this used anywhere ? */ prop = RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflag2", OB_NEVER_DO_ACTIVITY_CULLING); RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular motion along the Z axis"); - + prop = RNA_def_property(srna, "use_material_physics_fh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH); @@ -1901,7 +1901,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Obstacle Radius", "Radius of object representation in obstacle simulation"); - + /* state */ prop = RNA_def_property(srna, "states_visible", PROP_BOOLEAN, PROP_LAYER_MEMBER); @@ -1915,7 +1915,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Used State", "States which are being used by controllers"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_GameObjectSettings_used_state_get", NULL); - + prop = RNA_def_property(srna, "states_initial", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "init_state", 1); RNA_def_property_array(prop, OB_MAX_STATES); @@ -2041,7 +2041,7 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; - + PropertyRNA *prop; /* FunctionRNA *func; */ @@ -2057,7 +2057,7 @@ static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - + prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", @@ -2072,7 +2072,7 @@ static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; - + PropertyRNA *prop; FunctionRNA *func; @@ -2098,7 +2098,7 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) "rna_Object_active_vertex_group_index_range"); RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array"); RNA_def_property_update(prop, NC_GEOM | ND_DATA, "rna_Object_internal_update_data"); - + /* vertex groups */ /* add_vertex_group */ func = RNA_def_function(srna, "new", "rna_Object_vgroup_new"); RNA_def_function_ui_description(func, "Add vertex group to object"); @@ -2196,7 +2196,7 @@ static void rna_def_object(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - + /* XXX: this RNA enum define is currently duplicated for objects, * since there is some text here which is not applicable */ static const EnumPropertyItem prop_rotmode_items[] = { @@ -2211,7 +2211,7 @@ static void rna_def_object(BlenderRNA *brna) "Axis Angle (W+XYZ), defines a rotation around some axis defined by 3D-Vector"}, {0, NULL, 0, NULL, NULL} }; - + static float default_quat[4] = {1, 0, 0, 0}; /* default quaternion values */ static float default_axisAngle[4] = {0, 0, 1, 0}; /* default axis-angle rotation values */ static float default_scale[3] = {1, 1, 1}; /* default scale values */ @@ -2276,7 +2276,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_ui_text(prop, "Parent", "Parent Object"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); - + prop = RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "partype"); RNA_def_property_enum_items(prop, parent_type_items); @@ -2295,7 +2295,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Object_parent_bone_set"); RNA_def_property_ui_text(prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); - + /* Track and Up flags */ /* XXX: these have been saved here for a bit longer (after old track was removed), * since some other tools still refer to this */ @@ -2314,7 +2314,7 @@ static void rna_def_object(BlenderRNA *brna) "Axis that points in the upward direction (applies to DupliFrame when " "parent 'Follow' is enabled)"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); - + /* proxy */ prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Proxy", "Library object this proxy object controls"); @@ -2346,7 +2346,7 @@ static void rna_def_object(BlenderRNA *brna) "rna_Object_active_material_index_range"); RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot"); RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_LINKS, NULL); - + /* transform */ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "loc"); @@ -2354,14 +2354,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Location", "Location of the object"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "quat"); RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); RNA_def_property_float_array_default(prop, default_quat); RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but * having a single one is better for Keyframing and other property-management situations... */ @@ -2373,20 +2373,20 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_float_array_default(prop, default_axisAngle); RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable"); RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_enum_items(prop, prop_rotmode_items); /* XXX move to using a single define of this someday */ RNA_def_property_enum_funcs(prop, NULL, "rna_Object_rotation_mode_set", NULL); RNA_def_property_ui_text(prop, "Rotation Mode", ""); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_flag(prop, PROP_PROPORTIONAL); @@ -2404,7 +2404,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0f, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_ui_text(prop, "Dimensions", "Absolute bounding box dimensions of the object"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + /* delta transforms */ prop = RNA_def_property(srna, "delta_location", PROP_FLOAT, PROP_TRANSLATION); @@ -2412,20 +2412,20 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Delta Location", "Extra translation added to the location of the object"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + prop = RNA_def_property(srna, "delta_rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "drot"); RNA_def_property_ui_text(prop, "Delta Rotation (Euler)", "Extra rotation added to the rotation of the object (when using Euler rotations)"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + prop = RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "dquat"); RNA_def_property_float_array_default(prop, default_quat); RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)", "Extra rotation added to the rotation of the object (when using Quaternion rotations)"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + #if 0 /* XXX not supported well yet... */ prop = RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE); /* FIXME: this is not a single field any more! (drotAxis and drotAngle) */ @@ -2443,7 +2443,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_float_array_default(prop, default_scale); RNA_def_property_ui_text(prop, "Delta Scale", "Extra scaling added to the scale of the object"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + /* transform locks */ prop = RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX); @@ -2458,7 +2458,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface"); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + /* XXX this is sub-optimal - it really should be included above, * but due to technical reasons we can't do this! */ prop = RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE); @@ -2572,7 +2572,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "index"); RNA_def_property_ui_text(prop, "Pass Index", "Index number for the \"Object Index\" render pass"); RNA_def_property_update(prop, NC_OBJECT, "rna_Object_internal_update_draw"); - + prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "col"); RNA_def_property_ui_text(prop, "Color", "Object color and alpha, used when faces have the ObColor mode enabled"); @@ -2603,7 +2603,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object"); rna_def_object_particle_systems(brna, prop); - + prop = RNA_def_property(srna, "rigid_body", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "rigidbody_object"); RNA_def_property_struct_type(prop, "RigidBodyObject"); @@ -2613,7 +2613,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "rigidbody_constraint"); RNA_def_property_struct_type(prop, "RigidBodyConstraint"); RNA_def_property_ui_text(prop, "Rigid Body Constraint", "Constraint constraining rigid bodies"); - + /* restrict */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW); @@ -2635,10 +2635,10 @@ static void rna_def_object(BlenderRNA *brna) /* anim */ rna_def_animdata_common(srna); - + rna_def_animviz_common(srna); rna_def_motionpath_common(srna); - + /* slow parenting */ /* XXX: evil old crap */ prop = RNA_def_property(srna, "use_slow_parent", PROP_BOOLEAN, PROP_NONE); @@ -2647,22 +2647,22 @@ static void rna_def_object(BlenderRNA *brna) "Create a delay in the parent relationship (beware: this isn't renderfarm " "safe and may be invalid after jumping around the timeline)"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); - + prop = RNA_def_property(srna, "slow_parent_offset", PROP_FLOAT, PROP_NONE | PROP_UNIT_TIME); RNA_def_property_float_sdna(prop, NULL, "sf"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Slow Parent Offset", "Delay in the parent relationship"); RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - + /* depsgraph hack */ prop = RNA_def_property(srna, "use_extra_recalc_object", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "depsflag", OB_DEPS_EXTRA_OB_RECALC); RNA_def_property_ui_text(prop, "Extra Object Update", "Refresh this object again on frame changes, dependency graph hack"); - + prop = RNA_def_property(srna, "use_extra_recalc_data", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "depsflag", OB_DEPS_EXTRA_DATA_RECALC); RNA_def_property_ui_text(prop, "Extra Data Update", "Refresh this object's data again on frame changes, dependency graph hack"); - + /* duplicates */ prop = RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag"); @@ -2733,7 +2733,7 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "is_duplicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLI); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + /* drawing */ prop = RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt"); @@ -2751,22 +2751,22 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_enum_items(prop, boundtype_items); RNA_def_property_ui_text(prop, "Draw Bounds Type", "Object boundary display type"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - + prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWNAME); RNA_def_property_ui_text(prop, "Draw Name", "Display the object's name"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - + prop = RNA_def_property(srna, "show_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_AXIS); RNA_def_property_ui_text(prop, "Draw Axes", "Display the object's origin and axes"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - + prop = RNA_def_property(srna, "show_texture_space", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_TEXSPACE); RNA_def_property_ui_text(prop, "Draw Texture Space", "Display the object's texture space"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - + prop = RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE); RNA_def_property_ui_text(prop, "Draw Wire", "Add the object's wireframe over solid drawing"); @@ -2782,13 +2782,13 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Draw Transparent", "Display material transparency in the object (unsupported for duplicator drawing)"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - + prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY); RNA_def_property_ui_text(prop, "X-Ray", "Make the object draw in front of others (unsupported for duplicator drawing)"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - + /* Grease Pencil */ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "gpd"); @@ -2796,7 +2796,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil data-block"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); - + /* pose */ prop = RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "poselib"); @@ -2936,12 +2936,12 @@ static void rna_def_object_base(BlenderRNA *brna) RNA_def_property_array(prop, 8); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Local View Layers", "3D local view layers the object base is on"); - + prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_SELECT); RNA_def_property_ui_text(prop, "Select", "Object base selection state"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Base_select_update"); - + RNA_api_object_base(srna); } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 7571194b2fd..d3a1f2a14e7 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -161,7 +161,7 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e if (level >= MAX_DUPLI_RECUR) return; - + if (ob->transflag & OB_DUPLIPARTS) { for (psys = ob->particlesystem.first; psys; psys = psys->next) { if (ELEM(psys->part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) { @@ -235,7 +235,7 @@ static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList * RNA_pointer_create((ID *)ob->data, &RNA_ShapeKey, kb, &keyptr); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); - + return keyptr; } else { @@ -377,7 +377,7 @@ static void rna_Object_closest_point_on_mesh( int *r_success, float r_location[3], float r_normal[3], int *r_index) { BVHTreeFromMesh treeData = {NULL}; - + if (ob->derivedFinal == NULL) { BKE_reportf(reports, RPT_ERROR, "Object '%s' has no mesh data to be used for finding nearest point", ob->id.name + 2); @@ -611,7 +611,7 @@ void RNA_api_object(StructRNA *srna) func = RNA_def_function(srna, "ray_cast", "rna_Object_ray_cast"); RNA_def_function_ui_description(func, "Cast a ray onto in object space"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - + /* ray start and end */ parm = RNA_def_float_vector(func, "origin", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index c9c3372000f..2b0740bff6f 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -240,7 +240,7 @@ static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, ListBase pidlist; BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0); - + *min = 0; *max = 0; @@ -263,7 +263,7 @@ static int rna_Cache_active_point_cache_index_get(PointerRNA *ptr) int num = 0; BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0); - + for (pid = pidlist.first; pid; pid = pid->next) { if (pid->cache == cache) { num = BLI_findindex(pid->ptcaches, cache); @@ -284,7 +284,7 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v ListBase pidlist; BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0); - + for (pid = pidlist.first; pid; pid = pid->next) { if (pid->cache == cache) { *(pid->cache_ptr) = BLI_findlink(pid->ptcaches, value); @@ -307,7 +307,7 @@ static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max, *max = 20; BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0); - + for (pid = pidlist.first; pid; pid = pid->next) { if (pid->cache == cache) { *max = pid->max_step; @@ -577,13 +577,13 @@ static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, Point static char *rna_FieldSettings_path(PointerRNA *ptr) { PartDeflect *pd = (PartDeflect *)ptr->data; - + /* Check through all possible places the settings can be to find the right one */ - + if (particle_id_check(ptr)) { /* particle system force field */ ParticleSettings *part = (ParticleSettings *)ptr->id.data; - + if (part->pd == pd) return BLI_sprintfN("force_field_1"); else if (part->pd2 == pd) @@ -592,7 +592,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr) else { /* object force field */ Object *ob = (Object *)ptr->id.data; - + if (ob->pd == pd) return BLI_sprintfN("field"); } @@ -630,11 +630,11 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr) { EffectorWeights *ew = (EffectorWeights *)ptr->data; /* Check through all possible places the settings can be to find the right one */ - + if (particle_id_check(ptr)) { /* particle effector weights */ ParticleSettings *part = (ParticleSettings *)ptr->id.data; - + if (part->effector_weights == ew) return BLI_sprintfN("effector_weights"); } @@ -652,7 +652,7 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr) return BLI_sprintfN("modifiers[\"%s\"].settings.effector_weights", name_esc); } } - + /* check cloth modifier */ md = (ModifierData *)modifiers_findByType(ob, eModifierType_Cloth); if (md) { @@ -663,7 +663,7 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr) return BLI_sprintfN("modifiers[\"%s\"].settings.effector_weights", name_esc); } } - + /* check smoke modifier */ md = (ModifierData *)modifiers_findByType(ob, eModifierType_Smoke); if (md) { @@ -743,9 +743,9 @@ static const EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), Poi if (particle_id_check(ptr)) return empty_shape_items; - + ob = (Object *)ptr->id.data; - + if (ob->type == OB_CURVE) { if (ob->pd->forcefield == PFIELD_VORTEX) return curve_vortex_shape_items; @@ -930,44 +930,44 @@ static void rna_def_collision(BlenderRNA *brna) RNA_def_struct_sdna(srna, "PartDeflect"); RNA_def_struct_path_func(srna, "rna_CollisionSettings_path"); RNA_def_struct_ui_text(srna, "Collision Settings", "Collision settings for object in physics simulation"); - + prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deflect", 1); RNA_def_property_ui_text(prop, "Enabled", "Enable this objects as a collider for physics systems"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_dependency_update"); - + /* Particle Interaction */ - + prop = RNA_def_property(srna, "damping_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_damp"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Damping Factor", "Amount of damping during particle collision"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); - + prop = RNA_def_property(srna, "damping_random", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_rdamp"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Damping", "Random variation of damping"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); - + prop = RNA_def_property(srna, "friction_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_frict"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Friction Factor", "Amount of friction during particle collision"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); - + prop = RNA_def_property(srna, "friction_random", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_rfrict"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Friction", "Random variation of friction"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); - + prop = RNA_def_property(srna, "permeability", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_perm"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Permeability", "Chance that the particle will pass through the mesh"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); - + prop = RNA_def_property(srna, "use_particle_kill", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PDEFLE_KILL_PART); RNA_def_property_ui_text(prop, "Kill Particles", "Kill collided particles"); @@ -978,21 +978,21 @@ static void rna_def_collision(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Stickiness", "Amount of stickiness to surface collision"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); - + /* Soft Body and Cloth Interaction */ - + prop = RNA_def_property(srna, "thickness_inner", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_sbift"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Inner Thickness", "Inner face thickness (only used by softbodies)"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); - + prop = RNA_def_property(srna, "thickness_outer", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_sboft"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Outer Thickness", "Outer face thickness"); RNA_def_property_update(prop, 0, "rna_CollisionSettings_update"); - + prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pdef_sbdamp"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1023,7 +1023,7 @@ static void rna_def_effector_weight(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", EFF_WEIGHT_DO_HAIR); RNA_def_property_ui_text(prop, "Use For Growing Hair", "Use force fields when growing hair"); RNA_def_property_update(prop, 0, "rna_EffectorWeight_update"); - + /* General */ prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -1141,7 +1141,7 @@ static void rna_def_field(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem field_type_items[] = { {0, "NONE", 0, "None", ""}, {PFIELD_FORCE, "FORCE", ICON_FORCE_FORCE, "Force", "Radial field toward the center of object"}, @@ -1171,7 +1171,7 @@ static void rna_def_field(BlenderRNA *brna) {PFIELD_FALL_CONE, "CONE", 0, "Cone", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem texture_items[] = { {PFIELD_TEX_RGB, "RGB", 0, "RGB", ""}, {PFIELD_TEX_GRAD, "GRADIENT", 0, "Gradient", ""}, @@ -1185,7 +1185,7 @@ static void rna_def_field(BlenderRNA *brna) {PFIELD_Z_NEG, "NEGATIVE", 0, "-Z", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem guide_kink_items[] = { {0, "NONE", 0, "Nothing", ""}, {1, "CURL", 0, "Curl", ""}, @@ -1202,9 +1202,9 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_FieldSettings_path"); RNA_def_struct_ui_text(srna, "Field Settings", "Field settings for an object in physics simulation"); RNA_def_struct_ui_icon(srna, ICON_PHYSICS); - + /* Enums */ - + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "forcefield"); RNA_def_property_enum_items(prop, field_type_items); @@ -1217,13 +1217,13 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Effector_shape_itemf"); RNA_def_property_ui_text(prop, "Shape", "Which direction is used to calculate the effector force"); RNA_def_property_update(prop, 0, "rna_FieldSettings_shape_update"); - + prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "falloff"); RNA_def_property_enum_items(prop, falloff_items); RNA_def_property_ui_text(prop, "Fall-Off", ""); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "texture_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "tex_mode"); RNA_def_property_enum_items(prop, texture_items); @@ -1237,9 +1237,9 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_enum_items(prop, zdirection_items); RNA_def_property_ui_text(prop, "Z Direction", "Effect in full or only positive/negative Z direction"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + /* Float */ - + prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_strength"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); @@ -1291,38 +1291,38 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Rest Length", "Rest length of the harmonic force"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "falloff_power", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_power"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Falloff Power", ""); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mindist"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance for the field's fall-off"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "distance_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxdist"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 1.0f, 3); RNA_def_property_ui_text(prop, "Maximum Distance", "Maximum distance for the field to work"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "radial_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "minrad"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Minimum Radial Distance", "Minimum radial distance for the field's fall-off"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "radial_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxrad"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Maximum Radial Distance", "Maximum radial distance for the field to work"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "radial_falloff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_power_r"); RNA_def_property_range(prop, 0.0f, 10.0f); @@ -1335,7 +1335,7 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Nabla", "Defines size of derivative offset used for calculating gradient and curl"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "noise", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_noise"); RNA_def_property_range(prop, 0.0f, 10.0f); @@ -1348,23 +1348,23 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); /* Boolean */ - + prop = RNA_def_property(srna, "use_min_distance", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMIN); RNA_def_property_ui_text(prop, "Use Min", "Use a minimum distance for the field's fall-off"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "use_max_distance", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMAX); RNA_def_property_ui_text(prop, "Use Max", "Use a maximum distance for the field to work"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "use_radial_min", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMINR); RNA_def_property_ui_text(prop, "Use Min", "Use a minimum radial distance for the field's fall-off"); /* "Use a minimum angle for the field's fall-off" */ RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "use_radial_max", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_USEMAXR); RNA_def_property_ui_text(prop, "Use Max", "Use a maximum radial distance for the field to work"); @@ -1380,12 +1380,12 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GLOBAL_CO); RNA_def_property_ui_text(prop, "Use Global Coordinates", "Use effector/global coordinates for turbulence"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "use_2d_force", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_2D); RNA_def_property_ui_text(prop, "2D", "Apply force only in 2D"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "use_root_coords", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_TEX_ROOTCO); RNA_def_property_ui_text(prop, "Root Texture Coordinates", "Texture coordinates from root particle locations"); @@ -1420,9 +1420,9 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Gravity Falloff", "Multiply force by 1/distance²"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + /* Pointer */ - + prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tex"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -1434,9 +1434,9 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Domain Object", "Select domain object of the smoke simulation"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + /********** Curve Guide Field Settings **********/ - + prop = RNA_def_property(srna, "guide_minimum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f_strength"); RNA_def_property_range(prop, 0.0f, 1000.0f); @@ -1458,29 +1458,29 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PFIELD_GUIDE_PATH_WEIGHT); RNA_def_property_ui_text(prop, "Weights", "Use curve weights to influence the particle influence along the curve"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + /* Clump Settings */ - + prop = RNA_def_property(srna, "guide_clump_amount", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clump_fac"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Amount", "Amount of clumping"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "guide_clump_shape", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clump_pow"); RNA_def_property_range(prop, -0.999f, 0.999f); RNA_def_property_ui_text(prop, "Shape", "Shape of clumping"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + /* Kink Settings */ - + prop = RNA_def_property(srna, "guide_kink_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "kink"); RNA_def_property_enum_items(prop, guide_kink_items); RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the curve"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "guide_kink_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "kink_axis"); RNA_def_property_enum_items(prop, rna_enum_axis_xyz_items); @@ -1492,13 +1492,13 @@ static void rna_def_field(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "guide_kink_shape", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "kink_shape"); RNA_def_property_range(prop, -0.999f, 0.999f); RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end"); RNA_def_property_update(prop, 0, "rna_FieldSettings_update"); - + prop = RNA_def_property(srna, "guide_kink_amplitude", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "kink_amp"); RNA_def_property_range(prop, 0.0f, 10.0f); @@ -1518,30 +1518,30 @@ static void rna_def_game_softbody(BlenderRNA *brna) RNA_def_struct_sdna(srna, "BulletSoftBody"); RNA_def_struct_ui_text(srna, "Game Soft Body Settings", "Soft body simulation settings for an object in the game engine"); - + /* Floats */ - + prop = RNA_def_property(srna, "linear_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "linStiff"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Linear Stiffness", "Linear stiffness of the soft body links"); - + prop = RNA_def_property(srna, "dynamic_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "kDF"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Friction", "Dynamic Friction"); - + prop = RNA_def_property(srna, "shape_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "kMT"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Shape matching threshold"); - + prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "margin"); RNA_def_property_range(prop, 0.01f, 1.0f); RNA_def_property_ui_text(prop, "Margin", "Collision margin for soft body. Small value makes the algorithm unstable"); - + prop = RNA_def_property(srna, "weld_threshold", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "welding"); RNA_def_property_range(prop, 0.0f, 0.01f); @@ -1551,31 +1551,31 @@ static void rna_def_game_softbody(BlenderRNA *brna) "(ok if the mesh has no duplicates)"); /* Integers */ - + prop = RNA_def_property(srna, "location_iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "piterations"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Position Iterations", "Position solver iterations"); - + prop = RNA_def_property(srna, "cluster_iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "numclusteriterations"); RNA_def_property_range(prop, 1, 128); RNA_def_property_ui_text(prop, "Cluster Iterations", "Number of cluster iterations"); - + /* Booleans */ - + prop = RNA_def_property(srna, "use_shape_match", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_SHAPE_MATCHING); RNA_def_property_ui_text(prop, "Shape Match", "Enable soft body shape matching goal"); - + prop = RNA_def_property(srna, "use_bending_constraints", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_BSB_BENDING_CONSTRAINTS); RNA_def_property_ui_text(prop, "Bending Const", "Enable bending constraints"); - + prop = RNA_def_property(srna, "use_cluster_rigid_to_softbody", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_RS); RNA_def_property_ui_text(prop, "Rigid to Soft Body", "Enable cluster collision between soft and rigid body"); - + prop = RNA_def_property(srna, "use_cluster_soft_to_softbody", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "collisionflags", OB_BSB_COL_CL_SS); RNA_def_property_ui_text(prop, "Soft to Soft Body", "Enable cluster collision between soft and soft body"); @@ -1585,7 +1585,7 @@ static void rna_def_softbody(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem collision_type_items[] = { {SBC_MODE_MANUAL, "MANUAL", 0, "Manual", "Manual adjust"}, {SBC_MODE_AVG, "AVERAGE", 0, "Average", "Average Spring length * Ball Size"}, @@ -1594,7 +1594,7 @@ static void rna_def_softbody(BlenderRNA *brna) {SBC_MODE_AVGMINMAX, "MINMAX", 0, "AvMinMax", "(Min+Max)/2 * Ball Size"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem aerodynamics_type[] = { {0, "SIMPLE", 0, "Simple", "Edges receive a drag force from surrounding media"}, {1, "LIFT_FORCE", 0, "Lift Force", "Edges receive a lift force when passing through surrounding media"}, @@ -1605,42 +1605,42 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SoftBody"); RNA_def_struct_path_func(srna, "rna_SoftBodySettings_path"); RNA_def_struct_ui_text(srna, "Soft Body Settings", "Soft body simulation settings for an object"); - + /* General Settings */ - + prop = RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mediafrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Friction", "General media friction for point movements"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "nodemass"); RNA_def_property_range(prop, 0.0f, 50000.0f); RNA_def_property_ui_text(prop, "Mass", "General Mass value"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "namedVG_Mass"); RNA_def_property_ui_text(prop, "Mass Vertex Group", "Control point mass values"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoftBodySettings_mass_vgroup_set"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + /* no longer used */ prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_float_sdna(prop, NULL, "grav"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Gravitation", "Apply gravitation to point movement"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "physics_speed"); RNA_def_property_range(prop, 0.01f, 100.0f); RNA_def_property_ui_text(prop, "Speed", "Tweak timing for physics to control frequency and speed"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + /* Goal */ - + prop = RNA_def_property(srna, "vertex_group_goal", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vertgroup"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not impossible .. but not supported yet */ @@ -1648,7 +1648,7 @@ static void rna_def_softbody(BlenderRNA *brna) "rna_SoftBodySettings_goal_vgroup_length", "rna_SoftBodySettings_goal_vgroup_set"); RNA_def_property_ui_text(prop, "Goal Vertex Group", "Control point weight values"); - + prop = RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1668,104 +1668,104 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + /* Edge Spring Settings */ - + prop = RNA_def_property(srna, "pull", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "inspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Pull", "Edge spring stiffness when longer than rest length"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "push", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "inpush"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Push", "Edge spring stiffness when shorter than rest length"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "infrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Damp", "Edge spring friction"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "spring_length", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "springpreload"); RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_text(prop, "SL", "Alter spring length to shrink/blow up (unit %) 0 to disable"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "aero", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "aeroedge"); RNA_def_property_range(prop, 0.0f, 30000.0f); RNA_def_property_ui_text(prop, "Aero", "Make edges 'sail'"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "plastic", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "plastic"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Plastic", "Permanent deform"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "bend", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "secondspring"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Bending", "Bending Stiffness"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shearstiff"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shear", "Shear Stiffness"); - + prop = RNA_def_property(srna, "vertex_group_spring", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "namedVG_Spring_K"); RNA_def_property_ui_text(prop, "Spring Vertex Group", "Control point spring strength values"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SoftBodySettings_spring_vgroup_set"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + /* Collision */ - + prop = RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sbc_mode"); RNA_def_property_enum_items(prop, collision_type_items); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Collision Type", "Choose Collision Type"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "ball_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colball"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* code is not ready for that yet */ RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Ball Size", "Absolute ball size or factor if not manually adjusted"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "ball_stiff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ballstiff"); RNA_def_property_range(prop, 0.001f, 100.0f); RNA_def_property_ui_text(prop, "Ball Size", "Ball inflating pressure"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "ball_damp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "balldamp"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Ball Size", "Blending to inelastic collision"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + /* Solver */ - + prop = RNA_def_property(srna, "error_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rklimit"); RNA_def_property_range(prop, 0.001f, 10.0f); @@ -1773,25 +1773,25 @@ static void rna_def_softbody(BlenderRNA *brna) "The Runge-Kutta ODE solver error limit, low value gives more precision, " "high values speed"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "step_min", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "minloops"); RNA_def_property_range(prop, 0, 30000); RNA_def_property_ui_text(prop, "Min Step", "Minimal # solver steps/frame"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "step_max", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxloops"); RNA_def_property_range(prop, 0, 30000); RNA_def_property_ui_text(prop, "Max Step", "Maximal # solver steps/frame"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "choke", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "choke"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Choke", "'Viscosity' inside collision target"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "fuzzyness"); RNA_def_property_range(prop, 1, 100); @@ -1799,16 +1799,16 @@ static void rna_def_softbody(BlenderRNA *brna) "Fuzziness while on collision, high values make collision handling faster " "but less stable"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_OLDERR); RNA_def_property_ui_text(prop, "V", "Use velocities for automagic step sizes"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "use_diagnose", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_MONITOR); RNA_def_property_ui_text(prop, "Print Performance to Console", "Turn on SB diagnose console prints"); - + prop = RNA_def_property(srna, "use_estimate_matrix", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_ESTIMATEIPO); RNA_def_property_ui_text(prop, "Estimate matrix", "Estimate matrix... split to COM, ROT, SCALE"); @@ -1838,44 +1838,44 @@ static void rna_def_softbody(BlenderRNA *brna) /* Flags */ - + prop = RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_goal_get", "rna_SoftBodySettings_use_goal_set"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use Goal", "Define forces for vertices to stick to animated position"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_edges_get", "rna_SoftBodySettings_use_edges_set"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "use_stiff_quads", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Stiff Quads", "Add diagonal springs on 4-gons"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "use_edge_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_edge_collision_get", "rna_SoftBodySettings_edge_collision_set"); RNA_def_property_ui_text(prop, "Edge Collision", "Edges collide too"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "use_face_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set"); RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, can be very slow"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "aerodynamics_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, aerodynamics_type); RNA_def_property_enum_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set", NULL); RNA_def_property_ui_text(prop, "Aerodynamics Type", "Method of calculating aerodynamic interaction"); RNA_def_property_update(prop, 0, "rna_softbody_update"); - + prop = RNA_def_property(srna, "use_self_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set"); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 5b0b718fc28..5d35342d7ed 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -297,7 +297,7 @@ static void rna_Particle_uv_on_emitter(ParticleData *particle, ReportList *repor /* get uvco */ if (r_uv && ELEM(from, PART_FROM_FACE, PART_FROM_VOLUME)) { - + if (num != DMCACHE_NOTFOUND) { MFace *mface; MTFace *mtface; @@ -346,7 +346,7 @@ static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *o if (part == NULL || pars == NULL || !psys_check_enabled(object, particlesystem, particlesystem->renderdata != NULL)) return; - + if (part->ren_as == PART_DRAW_OB || part->ren_as == PART_DRAW_GR || part->ren_as == PART_DRAW_NOT) return; @@ -628,11 +628,11 @@ static void rna_ParticleSystem_set_resolution( } else { ParticleSystemModifierData *psmd = psys_get_modifier(object, particlesystem); - + if (particlesystem->renderdata) { psys_render_restore(object, particlesystem); } - + psmd->flag &= ~eParticleSystemFlag_psys_updated; particle_system_update(bmain, scene, object, particlesystem, false); } @@ -642,7 +642,7 @@ static void particle_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRN { if (ptr->type == &RNA_ParticleSystem) { ParticleSystem *psys = (ParticleSystem *)ptr->data; - + psys->recalc = flag; DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); @@ -683,7 +683,7 @@ static void rna_Particle_change_type(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Particle_change_physics_type(Main *bmain, Scene *scene, PointerRNA *ptr) { particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET | PSYS_RECALC_PHYS); - + ParticleSettings *part = (ParticleSettings *)ptr->data; if (part->phystype == PART_PHYS_BOIDS && part->boids == NULL) { @@ -730,7 +730,7 @@ static ParticleSystem *rna_particle_system_for_target(Object *ob, ParticleTarget for (pt = psys->targets.first; pt; pt = pt->next) if (pt == target) return psys; - + return NULL; } @@ -758,7 +758,7 @@ static void rna_Particle_target_reset(Main *bmain, Scene *UNUSED(scene), Pointer else pt->flag &= ~PTARGET_VALID; } - + psys->recalc = PSYS_RECALC_RESET; DAG_id_tag_update(&ob->id, OB_RECALC_DATA); @@ -774,7 +774,7 @@ static void rna_Particle_target_redo(Main *UNUSED(bmain), Scene *UNUSED(scene), Object *ob = (Object *)ptr->id.data; ParticleTarget *pt = (ParticleTarget *)ptr->data; ParticleSystem *psys = rna_particle_system_for_target(ob, pt); - + psys->recalc = PSYS_RECALC_REDO; DAG_id_tag_update(&ob->id, OB_RECALC_DATA); @@ -786,7 +786,7 @@ static void rna_Particle_hair_dynamics_update(Main *bmain, Scene *scene, Pointer { Object *ob = (Object *)ptr->id.data; ParticleSystem *psys = (ParticleSystem *)ptr->data; - + if (psys && !psys->clmd) { psys->clmd = (ClothModifierData *)modifier_new(eModifierType_Cloth); psys->clmd->sim_parms->goalspring = 0.0f; @@ -945,26 +945,26 @@ static int rna_PartSettings_is_fluid_get(PointerRNA *ptr) static void rna_ParticleSettings_use_clump_curve_update(Main *bmain, Scene *scene, PointerRNA *ptr) { ParticleSettings *part = ptr->data; - + if (part->child_flag & PART_CHILD_USE_CLUMP_CURVE) { if (!part->clumpcurve) { BKE_particlesettings_clump_curve_init(part); } } - + rna_Particle_redo_child(bmain, scene, ptr); } static void rna_ParticleSettings_use_roughness_curve_update(Main *bmain, Scene *scene, PointerRNA *ptr) { ParticleSettings *part = ptr->data; - + if (part->child_flag & PART_CHILD_USE_ROUGH_CURVE) { if (!part->roughcurve) { BKE_particlesettings_rough_curve_init(part); } } - + rna_Particle_redo_child(bmain, scene, ptr); } @@ -1052,7 +1052,7 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str) Object *ob = (Object *) ptr->id.data; psys = BLI_findlink(&ob->particlesystem, pt->psys - 1); } - + if (psys) { if (pt->ob) sprintf(str, "%s: %s", pt->ob->id.name + 2, psys->name); @@ -1085,10 +1085,10 @@ static int particle_id_check(PointerRNA *ptr) static char *rna_SPHFluidSettings_path(PointerRNA *ptr) { SPHFluidSettings *fluid = (SPHFluidSettings *)ptr->data; - + if (particle_id_check(ptr)) { ParticleSettings *part = (ParticleSettings *)ptr->id.data; - + if (part->fluid == fluid) return BLI_sprintfN("fluid"); } @@ -1230,7 +1230,7 @@ static PointerRNA rna_Particle_field1_get(PointerRNA *ptr) /* weak */ if (!part->pd) part->pd = object_add_collision_fields(0); - + return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd); } @@ -1241,7 +1241,7 @@ static PointerRNA rna_Particle_field2_get(PointerRNA *ptr) /* weak */ if (!part->pd2) part->pd2 = object_add_collision_fields(0); - + return rna_pointer_inherit_refine(ptr, &RNA_FieldSettings, part->pd2); } @@ -1394,7 +1394,7 @@ static void rna_def_particle_hair_key(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Location (Object Space)", "Location of the hair key in object space"); RNA_def_property_float_funcs(prop, "rna_ParticleHairKey_location_object_get", "rna_ParticleHairKey_location_object_set", NULL); - + prop = RNA_def_property(srna, "co_local", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "co"); RNA_def_property_ui_text(prop, "Location", @@ -1780,7 +1780,7 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_x_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, @@ -1788,7 +1788,7 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) {3, "Z", 0, "Z", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_y_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, @@ -1796,7 +1796,7 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) {3, "Z", 0, "Z", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_z_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, @@ -1834,19 +1834,19 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_x_mapping_items); RNA_def_property_ui_text(prop, "X Mapping", ""); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - + prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "projy"); RNA_def_property_enum_items(prop, prop_y_mapping_items); RNA_def_property_ui_text(prop, "Y Mapping", ""); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - + prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "projz"); RNA_def_property_enum_items(prop, prop_z_mapping_items); RNA_def_property_ui_text(prop, "Z Mapping", ""); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - + prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mapping_items); RNA_def_property_ui_text(prop, "Mapping", ""); @@ -3142,7 +3142,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1.0f, 100.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Loop count", "Number of times the keys are looped"); RNA_def_property_update(prop, 0, "rna_Particle_redo"); - + /* modified dm support */ prop = RNA_def_property(srna, "use_modifier_stack", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_modifier_stack", 0); @@ -3193,7 +3193,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_struct_type(prop, "BoidSettings"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Boid Settings", ""); - + /* Fluid particles */ prop = RNA_def_property(srna, "fluid", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "SPHFluidSettings"); @@ -3205,7 +3205,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_struct_type(prop, "EffectorWeights"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Weights", ""); - + /* animation here? */ rna_def_animdata_common(srna); @@ -3683,7 +3683,7 @@ void RNA_def_particle(BlenderRNA *brna) rna_def_fluid_settings(brna); rna_def_particle_hair_key(brna); rna_def_particle_key(brna); - + rna_def_child_particle(brna); rna_def_particle(brna); rna_def_particle_dupliweight(brna); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 0e93c130dbd..746bb0ceacd 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -171,11 +171,11 @@ static void rna_bone_group_remove(ID *id, bPose *pose, ReportList *reports, Poin void rna_ActionGroup_colorset_set(PointerRNA *ptr, int value) { bActionGroup *grp = ptr->data; - + /* ensure only valid values get set */ if ((value >= -1) && (value < 21)) { grp->customCol = value; - + /* sync colors stored with theme colors based on the index specified */ action_group_colors_sync(grp, NULL); } @@ -184,7 +184,7 @@ void rna_ActionGroup_colorset_set(PointerRNA *ptr, int value) int rna_ActionGroup_is_custom_colorset_get(PointerRNA *ptr) { bActionGroup *grp = ptr->data; - + return (grp->customCol < 0); } @@ -235,9 +235,9 @@ static void rna_Pose_ik_solver_update(Main *bmain, Scene *UNUSED(scene), Pointer BKE_pose_tag_recalc(bmain, pose); /* checks & sorts pose channels */ DAG_relations_tag_update(bmain); - + BKE_pose_update_constraint_flags(pose); - + object_test_constraints(bmain, ob); DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); @@ -247,7 +247,7 @@ static void rna_Pose_ik_solver_update(Main *bmain, Scene *UNUSED(scene), Pointer static void rna_PoseChannel_rotation_axis_angle_get(PointerRNA *ptr, float *value) { bPoseChannel *pchan = ptr->data; - + /* for now, assume that rotation mode is axis-angle */ value[0] = pchan->rotAngle; copy_v3_v3(&value[1], pchan->rotAxis); @@ -257,22 +257,22 @@ static void rna_PoseChannel_rotation_axis_angle_get(PointerRNA *ptr, float *valu static void rna_PoseChannel_rotation_axis_angle_set(PointerRNA *ptr, const float *value) { bPoseChannel *pchan = ptr->data; - + /* for now, assume that rotation mode is axis-angle */ pchan->rotAngle = value[0]; copy_v3_v3(pchan->rotAxis, &value[1]); - + /* TODO: validate axis? */ } static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value) { bPoseChannel *pchan = ptr->data; - + /* use API Method for conversions... */ BKE_rotMode_change_values(pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, (short)value); - + /* finally, set the new rotation type */ pchan->rotmode = value; } @@ -383,12 +383,12 @@ static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr) bPose *pose = (ob) ? ob->pose : NULL; bPoseChannel *pchan = (bPoseChannel *)ptr->data; bActionGroup *grp; - + if (pose) grp = BLI_findlink(&pose->agroups, pchan->agrp_index - 1); else grp = NULL; - + return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, grp); } @@ -397,7 +397,7 @@ static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value) Object *ob = (Object *)ptr->id.data; bPose *pose = (ob) ? ob->pose : NULL; bPoseChannel *pchan = (bPoseChannel *)ptr->data; - + if (pose) pchan->agrp_index = BLI_findindex(&pose->agroups, value.data) + 1; else @@ -421,7 +421,7 @@ static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, in { Object *ob = (Object *)ptr->id.data; bPose *pose = (ob) ? ob->pose : NULL; - + *min = 0; *max = pose ? max_ii(0, BLI_listbase_count(&pose->agroups) - 1) : 0; } @@ -485,14 +485,14 @@ static void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, s bPose *pose = (bPose *)ptr->data; bActionGroup *grp; int a; - + for (a = 1, grp = pose->agroups.first; grp; grp = grp->next, a++) { if (STREQ(grp->name, value)) { *index = a; return; } } - + *index = 0; } @@ -500,14 +500,14 @@ static void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *r { bPose *pose = (bPose *)ptr->data; bActionGroup *grp; - + for (grp = pose->agroups.first; grp; grp = grp->next) { if (STREQ(grp->name, value)) { BLI_strncpy(result, value, maxlen); return; } } - + result[0] = '\0'; } #endif @@ -567,12 +567,12 @@ static int rna_PoseChannel_proxy_editable(PointerRNA *ptr, const char **r_info) Object *ob = (Object *)ptr->id.data; bArmature *arm = ob->data; bPoseChannel *pchan = (bPoseChannel *)ptr->data; - + if (ob->proxy && pchan->bone && (pchan->bone->layer & arm->layer_protected)) { *r_info = "Can't edit property of a proxy on a protected layer"; return 0; } - + return PROP_EDITABLE; } @@ -594,7 +594,7 @@ static int rna_PoseChannel_location_editable(PointerRNA *ptr, int index) static int rna_PoseChannel_scale_editable(PointerRNA *ptr, int index) { bPoseChannel *pchan = (bPoseChannel *)ptr->data; - + /* only if the axis in question is locked, not editable... */ if ((index == 0) && (pchan->protectflag & OB_LOCK_SCALEX)) return 0; @@ -609,7 +609,7 @@ static int rna_PoseChannel_scale_editable(PointerRNA *ptr, int index) static int rna_PoseChannel_rotation_euler_editable(PointerRNA *ptr, int index) { bPoseChannel *pchan = (bPoseChannel *)ptr->data; - + /* only if the axis in question is locked, not editable... */ if ((index == 0) && (pchan->protectflag & OB_LOCK_ROTX)) return 0; @@ -624,7 +624,7 @@ static int rna_PoseChannel_rotation_euler_editable(PointerRNA *ptr, int index) static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index) { bPoseChannel *pchan = (bPoseChannel *)ptr->data; - + /* only consider locks if locking components individually... */ if (pchan->protectflag & OB_LOCK_ROT4D) { /* only if the axis in question is locked, not editable... */ @@ -637,7 +637,7 @@ static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index) else if ((index == 3) && (pchan->protectflag & OB_LOCK_ROTZ)) return 0; } - + return PROP_EDITABLE; } @@ -684,7 +684,7 @@ static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values) void rna_def_actionbone_group_common(StructRNA *srna, int update_flag, const char *update_cb) { PropertyRNA *prop; - + /* color set + colors */ prop = RNA_def_property(srna, "color_set", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "customCol"); @@ -692,12 +692,12 @@ void rna_def_actionbone_group_common(StructRNA *srna, int update_flag, const cha RNA_def_property_enum_funcs(prop, NULL, "rna_ActionGroup_colorset_set", NULL); RNA_def_property_ui_text(prop, "Color Set", "Custom color set to use"); RNA_def_property_update(prop, update_flag, update_cb); - + prop = RNA_def_property(srna, "is_custom_color_set", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_ActionGroup_is_custom_colorset_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Custom Color Set", "Color set is user-defined instead of a fixed theme color set"); - + /* TODO: editing the colors for this should result in changes to the color type... */ prop = RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -712,21 +712,21 @@ static void rna_def_bone_group(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + /* struct */ srna = RNA_def_struct(brna, "BoneGroup", NULL); RNA_def_struct_sdna(srna, "bActionGroup"); RNA_def_struct_ui_text(srna, "Bone Group", "Groups of Pose Channels (Bones)"); RNA_def_struct_ui_icon(srna, ICON_GROUP_BONE); - + /* name */ 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_BoneGroup_name_set"); RNA_def_struct_name_property(srna, prop); - + /* TODO: add some runtime-collections stuff to access grouped bones */ - + /* color set */ rna_def_actionbone_group_common(srna, NC_OBJECT | ND_POSE, "rna_Pose_update"); } @@ -801,7 +801,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_PoseBone_path"); RNA_def_struct_idprops_func(srna, "rna_PoseBone_idprops"); RNA_def_struct_ui_icon(srna, ICON_BONE_DATA); - + /* Bone Constraints */ prop = RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "Constraint"); @@ -818,7 +818,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) /* Baked Bone Path cache data */ rna_def_motionpath_common(srna); - + /* Relationships to other bones */ prop = RNA_def_property(srna, "bone", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -835,7 +835,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_struct_type(prop, "PoseBone"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Child", "Child of this pose bone"); - + /* Transformation settings */ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "loc"); @@ -858,7 +858,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_float_array_default(prop, default_quat); RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but * having a single one is better for Keyframing and other property-management situations... */ @@ -870,13 +870,13 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_float_array_default(prop, default_axisAngle); RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "eul"); RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_euler_editable"); RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_enum_items(prop, rna_enum_posebone_rotmode_items); /* XXX move to using a single define of this someday */ @@ -885,19 +885,19 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_ui_text(prop, "Rotation Mode", ""); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + /* Curved bones settings - Applied on top of restpose values */ rna_def_bone_curved_common(srna, true); - + /* Custom BBone next/prev sources */ prop = RNA_def_property(srna, "use_bbone_custom_handles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bboneflag", PCHAN_BBONE_CUSTOM_HANDLES); - RNA_def_property_ui_text(prop, "Use Custom Handle References", + RNA_def_property_ui_text(prop, "Use Custom Handle References", "Use custom reference bones as handles for B-Bones instead of next/previous bones, " "leave these blank to use only B-Bone offset properties to control the shape"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "bbone_custom_handle_start", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "bbone_prev"); RNA_def_property_struct_type(prop, "PoseBone"); @@ -906,14 +906,14 @@ static void rna_def_pose_channel(BlenderRNA *brna) "Bone that serves as the start handle for the B-Bone curve"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "use_bbone_relative_start_handle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bboneflag", PCHAN_BBONE_CUSTOM_START_REL); - RNA_def_property_ui_text(prop, "Relative B-Bone Start Handle", + RNA_def_property_ui_text(prop, "Relative B-Bone Start Handle", "Treat custom start handle position as a relative value"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "bbone_custom_handle_end", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "bbone_next"); RNA_def_property_struct_type(prop, "PoseBone"); @@ -922,14 +922,14 @@ static void rna_def_pose_channel(BlenderRNA *brna) "Bone that serves as the end handle for the B-Bone curve"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "use_bbone_relative_end_handle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bboneflag", PCHAN_BBONE_CUSTOM_END_REL); - RNA_def_property_ui_text(prop, "Relative B-Bone End Handle", + RNA_def_property_ui_text(prop, "Relative B-Bone End Handle", "Treat custom end handle position as a relative value"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + /* transform matrices - should be read-only since these are set directly by AnimSys evaluation */ prop = RNA_def_property(srna, "matrix_channel", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "chan_mat"); @@ -967,7 +967,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); - + /* IK Settings */ prop = RNA_def_property(srna, "is_in_ik_chain", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL); @@ -1013,19 +1013,19 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); - + prop = RNA_def_property(srna, "use_ik_rotation_control", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ROTCTL); RNA_def_property_ui_text(prop, "IK rot control", "Apply channel rotation as IK constraint"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); - + prop = RNA_def_property(srna, "use_ik_linear_control", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_LINCTL); RNA_def_property_ui_text(prop, "IK rot control", "Apply channel size as IK constraint if stretching is enabled"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); - + prop = RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmin[0]"); RNA_def_property_range(prop, -M_PI, 0.0f); @@ -1095,21 +1095,21 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); - + prop = RNA_def_property(srna, "ik_rotation_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ikrotweight"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "IK Rot Weight", "Weight of rotation constraint for IK"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "ik_linear_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "iklinweight"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "IK Lin Weight", "Weight of scale constraint for IK"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + /* custom bone shapes */ prop = RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "custom"); @@ -1119,7 +1119,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Custom Object", "Object that defines custom draw type for this bone"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "custom_shape_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "custom_scale"); RNA_def_property_range(prop, 0.0f, 1000.0f); @@ -1139,7 +1139,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) "Bone that defines the display transform of this custom shape"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + /* bone groups */ prop = RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "agrp_index"); @@ -1150,7 +1150,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group)"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "BoneGroup"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -1159,7 +1159,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + /* transform locks */ prop = RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX); @@ -1176,7 +1176,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + /* XXX this is sub-optimal - it really should be included above, but due to technical reasons * we can't do this! */ prop = RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE); @@ -1376,7 +1376,7 @@ static void rna_def_bone_groups(BlenderRNA *brna, PropertyRNA *cprop) "rna_Pose_active_bone_group_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - + prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "active_group"); RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set", @@ -1389,7 +1389,7 @@ static void rna_def_pose(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + /* struct definition */ srna = RNA_def_struct(brna, "Pose", NULL); RNA_def_struct_sdna(srna, "bPose"); @@ -1409,7 +1409,7 @@ static void rna_def_pose(BlenderRNA *brna) RNA_def_property_struct_type(prop, "BoneGroup"); RNA_def_property_ui_text(prop, "Bone Groups", "Groups of the bones"); rna_def_bone_groups(brna, prop); - + /* ik solvers */ prop = RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "iksolver"); @@ -1423,10 +1423,10 @@ static void rna_def_pose(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_Pose_ikparam_get", NULL, "rna_Pose_ikparam_typef", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "IK Param", "Parameters for IK solver"); - + /* animviz */ rna_def_animviz_common(srna); - + RNA_api_pose(srna); } diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 98ae6eb0480..010bdb4a6fa 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -287,7 +287,7 @@ static void rna_RenderEngine_unregister(Main *bmain, StructRNA *type) if (!et) return; - + RNA_struct_free_extension(type, &et->ext); RNA_struct_free(&BLENDER_RNA, type); BLI_freelinkN(&R_engines, et); @@ -328,7 +328,7 @@ static StructRNA *rna_RenderEngine_register( break; } } - + /* create a new engine type */ et = MEM_callocN(sizeof(RenderEngineType), "python render engine"); memcpy(et, &dummyet, sizeof(dummyet)); @@ -784,7 +784,7 @@ static void rna_def_render_result(BlenderRNA *brna) FunctionRNA *func; PropertyRNA *parm; - + srna = RNA_def_struct(brna, "RenderResult", NULL); RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes"); @@ -884,7 +884,7 @@ static void rna_def_render_layer(BlenderRNA *brna) FunctionRNA *func; PropertyRNA *parm; - + srna = RNA_def_struct(brna, "RenderLayer", NULL); RNA_def_struct_ui_text(srna, "Render Layer", ""); diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c index 4c3301d5f9e..25aac09efda 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -109,19 +109,19 @@ static const EnumPropertyItem rigidbody_mesh_source_items[] = { static void rna_RigidBodyWorld_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data; - + BKE_rigidbody_cache_reset(rbw); } static char *rna_RigidBodyWorld_path(PointerRNA *UNUSED(ptr)) -{ +{ return BLI_sprintfN("rigidbody_world"); } static void rna_RigidBodyWorld_num_solver_iterations_set(PointerRNA *ptr, int value) { RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data; - + rbw->num_solver_iterations = value; #ifdef WITH_BULLET @@ -134,7 +134,7 @@ static void rna_RigidBodyWorld_num_solver_iterations_set(PointerRNA *ptr, int va static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, int value) { RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data; - + RB_FLAG_SET(rbw->flag, value, RBW_FLAG_USE_SPLIT_IMPULSE); #ifdef WITH_BULLET @@ -149,16 +149,16 @@ static void rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, int value) static void rna_RigidBodyOb_reset(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { RigidBodyWorld *rbw = scene->rigidbody_world; - + BKE_rigidbody_cache_reset(rbw); } static void rna_RigidBodyOb_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Object *ob = ptr->id.data; - + rna_RigidBodyOb_reset(bmain, scene, ptr); - + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); } @@ -166,7 +166,7 @@ static void rna_RigidBodyOb_shape_reset(Main *UNUSED(bmain), Scene *scene, Point { RigidBodyWorld *rbw = scene->rigidbody_world; RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + BKE_rigidbody_cache_reset(rbw); if (rbo->physics_shape) rbo->flag |= RBO_FLAG_NEEDS_RESHAPE; @@ -181,7 +181,7 @@ static char *rna_RigidBodyOb_path(PointerRNA *UNUSED(ptr)) static void rna_RigidBodyOb_type_set(PointerRNA *ptr, int value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + rbo->type = value; rbo->flag |= RBO_FLAG_NEEDS_VALIDATE; } @@ -197,7 +197,7 @@ static void rna_RigidBodyOb_shape_set(PointerRNA *ptr, int value) static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, int value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + RB_FLAG_SET(rbo->flag, !value, RBO_FLAG_DISABLED); #ifdef WITH_BULLET @@ -213,7 +213,7 @@ static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, int value) static void rna_RigidBodyOb_mass_set(PointerRNA *ptr, float value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + rbo->mass = value; #ifdef WITH_BULLET @@ -227,7 +227,7 @@ static void rna_RigidBodyOb_mass_set(PointerRNA *ptr, float value) static void rna_RigidBodyOb_friction_set(PointerRNA *ptr, float value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + rbo->friction = value; #ifdef WITH_BULLET @@ -240,7 +240,7 @@ static void rna_RigidBodyOb_friction_set(PointerRNA *ptr, float value) static void rna_RigidBodyOb_restitution_set(PointerRNA *ptr, float value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + rbo->restitution = value; #ifdef WITH_BULLET if (rbo->physics_object) { @@ -252,7 +252,7 @@ static void rna_RigidBodyOb_restitution_set(PointerRNA *ptr, float value) static void rna_RigidBodyOb_collision_margin_set(PointerRNA *ptr, float value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + rbo->margin = value; #ifdef WITH_BULLET @@ -279,7 +279,7 @@ static void rna_RigidBodyOb_collision_groups_set(PointerRNA *ptr, const int *val static void rna_RigidBodyOb_kinematic_state_set(PointerRNA *ptr, int value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + RB_FLAG_SET(rbo->flag, value, RBO_FLAG_KINEMATIC); #ifdef WITH_BULLET @@ -295,7 +295,7 @@ static void rna_RigidBodyOb_kinematic_state_set(PointerRNA *ptr, int value) static void rna_RigidBodyOb_activation_state_set(PointerRNA *ptr, int value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + RB_FLAG_SET(rbo->flag, value, RBO_FLAG_USE_DEACTIVATION); #ifdef WITH_BULLET @@ -309,7 +309,7 @@ static void rna_RigidBodyOb_activation_state_set(PointerRNA *ptr, int value) static void rna_RigidBodyOb_linear_sleepThresh_set(PointerRNA *ptr, float value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + rbo->lin_sleep_thresh = value; #ifdef WITH_BULLET @@ -323,7 +323,7 @@ static void rna_RigidBodyOb_linear_sleepThresh_set(PointerRNA *ptr, float value) static void rna_RigidBodyOb_angular_sleepThresh_set(PointerRNA *ptr, float value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + rbo->ang_sleep_thresh = value; #ifdef WITH_BULLET @@ -337,7 +337,7 @@ static void rna_RigidBodyOb_angular_sleepThresh_set(PointerRNA *ptr, float value static void rna_RigidBodyOb_linear_damping_set(PointerRNA *ptr, float value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + rbo->lin_damping = value; #ifdef WITH_BULLET @@ -351,7 +351,7 @@ static void rna_RigidBodyOb_linear_damping_set(PointerRNA *ptr, float value) static void rna_RigidBodyOb_angular_damping_set(PointerRNA *ptr, float value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - + rbo->ang_damping = value; #ifdef WITH_BULLET @@ -738,7 +738,7 @@ static void rna_def_rigidbody_world(BlenderRNA *brna) RNA_def_struct_sdna(srna, "RigidBodyWorld"); RNA_def_struct_ui_text(srna, "Rigid Body World", "Self-contained rigid body simulation environment and settings"); RNA_def_struct_path_func(srna, "rna_RigidBodyWorld_path"); - + /* groups */ prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Group"); @@ -751,13 +751,13 @@ static void rna_def_rigidbody_world(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_ui_text(prop, "Constraints", "Group containing rigid body constraint objects"); RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset"); - + /* booleans */ prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", RBW_FLAG_MUTED); RNA_def_property_ui_text(prop, "Enabled", "Simulation will be evaluated"); RNA_def_property_update(prop, NC_SCENE, NULL); - + /* time scale */ prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "time_scale"); @@ -766,7 +766,7 @@ static void rna_def_rigidbody_world(BlenderRNA *brna) RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Time Scale", "Change the speed of the simulation"); RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset"); - + /* timestep */ prop = RNA_def_property(srna, "steps_per_second", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "steps_per_second"); @@ -777,7 +777,7 @@ static void rna_def_rigidbody_world(BlenderRNA *brna) "Number of simulation steps taken per second (higher values are more accurate " "but slower)"); RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset"); - + /* constraint solver iterations */ prop = RNA_def_property(srna, "solver_iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "num_solver_iterations"); @@ -789,7 +789,7 @@ static void rna_def_rigidbody_world(BlenderRNA *brna) "Number of constraint solver iterations made per simulation step (higher values are more " "accurate but slower)"); RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset"); - + /* split impulse */ prop = RNA_def_property(srna, "use_split_impulse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", RBW_FLAG_USE_SPLIT_IMPULSE); @@ -844,13 +844,13 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - - + + srna = RNA_def_struct(brna, "RigidBodyObject", NULL); RNA_def_struct_sdna(srna, "RigidBodyOb"); RNA_def_struct_ui_text(srna, "Rigid Body Object", "Settings for object participating in Rigid Body Simulation"); RNA_def_struct_path_func(srna, "rna_RigidBodyOb_path"); - + /* Enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); @@ -859,21 +859,21 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Type", "Role of object in Rigid Body Simulations"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + prop = RNA_def_property(srna, "mesh_source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mesh_source"); RNA_def_property_enum_items(prop, rigidbody_mesh_source_items); RNA_def_property_ui_text(prop, "Mesh Source", "Source of the mesh used to create collision shape"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + /* booleans */ prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", RBO_FLAG_DISABLED); RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyOb_disabled_set"); RNA_def_property_ui_text(prop, "Enabled", "Rigid Body actively participates to the simulation"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + prop = RNA_def_property(srna, "collision_shape", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "shape"); RNA_def_property_enum_items(prop, rna_enum_rigidbody_object_shape_items); @@ -881,18 +881,18 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Collision Shape", "Collision Shape of object in Rigid Body Simulations"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_shape_update"); - + prop = RNA_def_property(srna, "kinematic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_KINEMATIC); RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyOb_kinematic_state_set"); RNA_def_property_ui_text(prop, "Kinematic", "Allow rigid body to be controlled by the animation system"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + prop = RNA_def_property(srna, "use_deform", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_USE_DEFORM); RNA_def_property_ui_text(prop, "Deforming", "Rigid body deforms during simulation"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + /* Physics Parameters */ prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_UNIT_MASS); RNA_def_property_float_sdna(prop, NULL, "mass"); @@ -901,10 +901,10 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_mass_set", NULL); RNA_def_property_ui_text(prop, "Mass", "How much the object 'weighs' irrespective of gravity"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + /* Dynamics Parameters - Activation */ // TODO: define and figure out how to implement these - + /* Dynamics Parameters - Deactivation */ prop = RNA_def_property(srna, "use_deactivation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_USE_DEACTIVATION); @@ -914,13 +914,13 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) "Enable deactivation of resting rigid bodies (increases performance and stability " "but can cause glitches)"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + prop = RNA_def_property(srna, "use_start_deactivated", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_START_DEACTIVATED); RNA_def_property_ui_text(prop, "Start Deactivated", "Deactivate rigid body at the start of the simulation"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + prop = RNA_def_property(srna, "deactivate_linear_velocity", PROP_FLOAT, PROP_UNIT_VELOCITY); RNA_def_property_float_sdna(prop, NULL, "lin_sleep_thresh"); RNA_def_property_range(prop, FLT_MIN, FLT_MAX); // range must always be positive (and non-zero) @@ -929,7 +929,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Linear Velocity Deactivation Threshold", "Linear Velocity below which simulation stops simulating object"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + prop = RNA_def_property(srna, "deactivate_angular_velocity", PROP_FLOAT, PROP_UNIT_VELOCITY); RNA_def_property_float_sdna(prop, NULL, "ang_sleep_thresh"); RNA_def_property_range(prop, FLT_MIN, FLT_MAX); // range must always be positive (and non-zero) @@ -938,7 +938,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Angular Velocity Deactivation Threshold", "Angular Velocity below which simulation stops simulating object"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + /* Dynamics Parameters - Damping Parameters */ prop = RNA_def_property(srna, "linear_damping", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "lin_damping"); @@ -947,7 +947,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_linear_damping_set", NULL); RNA_def_property_ui_text(prop, "Linear Damping", "Amount of linear velocity that is lost over time"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + prop = RNA_def_property(srna, "angular_damping", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "ang_damping"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -955,7 +955,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_angular_damping_set", NULL); RNA_def_property_ui_text(prop, "Angular Damping", "Amount of angular velocity that is lost over time"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + /* Collision Parameters - Surface Parameters */ prop = RNA_def_property(srna, "friction", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "friction"); @@ -965,7 +965,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_friction_set", NULL); RNA_def_property_ui_text(prop, "Friction", "Resistance of object to movement"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + prop = RNA_def_property(srna, "restitution", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "restitution"); RNA_def_property_range(prop, 0.0f, FLT_MAX); @@ -976,7 +976,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) "Tendency of object to bounce after colliding with another " "(0 = stays still, 1 = perfectly elastic)"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); - + /* Collision Parameters - Sensitivity */ prop = RNA_def_property(srna, "use_margin", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_USE_MARGIN); @@ -984,7 +984,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Collision Margin", "Use custom collision margin (some shapes will have a visible gap around them)"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_shape_reset"); - + prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "margin"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -995,7 +995,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) "Threshold of distance near surface where collisions are still considered " "(best results when non-zero)"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_shape_reset"); - + prop = RNA_def_property(srna, "collision_groups", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "col_groups", 1); RNA_def_property_array(prop, 20); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 5b55d149b24..80aa5eff44a 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -935,10 +935,10 @@ static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, Point const EnumPropertyItem *item = NULL; int totitem; bool free; - + rna_idproperty_check(&prop, ptr); /* eprop = (EnumPropertyRNA *)prop; */ - + RNA_property_enum_items_ex( NULL, ptr, prop, STREQ(iter->prop->identifier, "enum_items_static"), &item, &totitem, &free); rna_iterator_array_begin(iter, (void *)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator); @@ -1128,18 +1128,18 @@ static void rna_def_struct(BlenderRNA *brna) RNA_def_property_string_funcs(prop, "rna_Struct_identifier_get", "rna_Struct_identifier_length", NULL); RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting"); RNA_def_struct_name_property(srna, prop); - + prop = RNA_def_property(srna, "description", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Struct_description_get", "rna_Struct_description_length", NULL); RNA_def_property_ui_text(prop, "Description", "Description of the Struct's purpose"); - + prop = RNA_def_property(srna, "translation_context", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Struct_translation_context_get", "rna_Struct_translation_context_length", NULL); RNA_def_property_ui_text(prop, "Translation Context", "Translation context of the struct's name"); - + prop = RNA_def_property(srna, "base", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Struct"); @@ -1231,7 +1231,7 @@ static void rna_def_property(BlenderRNA *brna) RNA_def_property_string_funcs(prop, "rna_Property_identifier_get", "rna_Property_identifier_length", NULL); RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting"); RNA_def_struct_name_property(srna, prop); - + prop = RNA_def_property(srna, "description", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Property_description_get", "rna_Property_description_length", NULL); @@ -1324,7 +1324,7 @@ static void rna_def_property(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Property_is_registered_optional_get", NULL); RNA_def_property_ui_text(prop, "Registered Optionally", "Property is optionally registered as part of type registration"); - + prop = RNA_def_property(srna, "is_runtime", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Property_is_runtime_get", NULL); @@ -1392,7 +1392,7 @@ static void rna_def_function(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Function_no_self_get", NULL); RNA_def_property_ui_text(prop, "No Self", "Function does not pass its self as an argument (becomes a static method in python)"); - + prop = RNA_def_property(srna, "use_self_type", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Function_use_self_type_get", NULL); @@ -1651,7 +1651,7 @@ void RNA_def_rna(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Collection Definition", "RNA collection property to define lists, arrays and mappings"); rna_def_pointer_property(srna, PROP_COLLECTION); - + /* Function */ rna_def_function(brna); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index c8fa35886e4..2ce84d82b1c 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -112,7 +112,7 @@ const EnumPropertyItem rna_enum_snap_target_items[] = { {SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target"}, {0, NULL, 0, NULL, NULL} }; - + const EnumPropertyItem rna_enum_proportional_falloff_items[] = { {PROP_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "Smooth falloff"}, {PROP_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", "Spherical falloff"}, @@ -412,7 +412,7 @@ static const EnumPropertyItem rna_enum_gpencil_interpolation_mode_items[] = { {0, "", 0, N_("Interpolation"), "Standard transitions between keyframes"}, {GP_IPO_LINEAR, "LINEAR", ICON_IPO_LINEAR, "Linear", "Straight-line interpolation between A and B (i.e. no ease in/out)"}, {GP_IPO_CURVEMAP, "CUSTOM", ICON_IPO_BEZIER, "Custom", "Custom interpolation defined using a curve map"}, - + /* easing */ {0, "", 0, N_("Easing (by strength)"), "Predefined inertial transitions, useful for motion graphics (from least to most ''dramatic'')"}, {GP_IPO_SINE, "SINE", ICON_IPO_SINE, "Sinusoidal", "Sinusoidal easing (weakest, almost linear but with a slight curvature)"}, @@ -422,12 +422,12 @@ static const EnumPropertyItem rna_enum_gpencil_interpolation_mode_items[] = { {GP_IPO_QUINT, "QUINT", ICON_IPO_QUINT, "Quintic", "Quintic easing"}, {GP_IPO_EXPO, "EXPO", ICON_IPO_EXPO, "Exponential", "Exponential easing (dramatic)"}, {GP_IPO_CIRC, "CIRC", ICON_IPO_CIRC, "Circular", "Circular easing (strongest and most dynamic)"}, - + {0, "", 0, N_("Dynamic Effects"), "Simple physics-inspired easing effects"}, {GP_IPO_BACK, "BACK", ICON_IPO_BACK, "Back", "Cubic easing with overshoot and settle"}, {GP_IPO_BOUNCE, "BOUNCE", ICON_IPO_BOUNCE, "Bounce", "Exponentially decaying parabolic bounce, like when objects collide"}, {GP_IPO_ELASTIC, "ELASTIC", ICON_IPO_ELASTIC, "Elastic", "Exponentially decaying sine wave, like an elastic band"}, - + {0, NULL, 0, NULL, NULL} }; #endif @@ -484,12 +484,12 @@ static char *rna_GPencilInterpolateSettings_path(PointerRNA *UNUSED(ptr)) static void rna_GPencilInterpolateSettings_type_set(PointerRNA *ptr, int value) { GP_Interpolate_Settings *settings = (GP_Interpolate_Settings *)ptr->data; - + /* NOTE: This cast should be fine, as we have a small + finite set of values (eGP_Interpolate_Type) * that should fit well within a char */ settings->type = (char)value; - + /* init custom interpolation curve here now the first time it's used */ if ((settings->type == GP_IPO_CURVEMAP) && (settings->custom_ipo == NULL)) @@ -788,7 +788,7 @@ static void rna_Scene_framelen_update(Main *UNUSED(bmain), Scene *scene, Pointer static void rna_Scene_frame_current_set(PointerRNA *ptr, int value) { Scene *data = (Scene *)ptr->data; - + /* if negative frames aren't allowed, then we can't use them */ FRAMENUMBER_MIN_CLAMP(value); data->r.cfra = value; @@ -842,14 +842,14 @@ static void rna_Scene_end_frame_set(PointerRNA *ptr, int value) static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value) { Scene *data = (Scene *)ptr->data; - + if (value) { /* copy range from scene if not set before */ if ((data->r.psfra == data->r.pefra) && (data->r.psfra == 0)) { data->r.psfra = data->r.sfra; data->r.pefra = data->r.efra; } - + data->r.flag |= SCER_PRV_RANGE; } else @@ -860,14 +860,14 @@ static void rna_Scene_use_preview_range_set(PointerRNA *ptr, int value) static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value) { Scene *data = (Scene *)ptr->data; - + /* check if enabled already */ if ((data->r.flag & SCER_PRV_RANGE) == 0) { /* set end of preview range to end frame, then clamp as per normal */ /* TODO: or just refuse to set instead? */ data->r.pefra = data->r.efra; } - + /* now set normally */ CLAMP(value, MINAFRAME, data->r.pefra); data->r.psfra = value; @@ -876,14 +876,14 @@ static void rna_Scene_preview_range_start_frame_set(PointerRNA *ptr, int value) static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value) { Scene *data = (Scene *)ptr->data; - + /* check if enabled already */ if ((data->r.flag & SCER_PRV_RANGE) == 0) { /* set start of preview range to start frame, then clamp as per normal */ /* TODO: or just refuse to set instead? */ data->r.psfra = data->r.sfra; } - + /* now set normally */ CLAMP(value, data->r.psfra, MAXFRAME); data->r.pefra = value; @@ -911,7 +911,7 @@ static void rna_Scene_active_keying_set_set(PointerRNA *ptr, PointerRNA value) { Scene *scene = (Scene *)ptr->data; KeyingSet *ks = (KeyingSet *)value.data; - + scene->active_keyingset = ANIM_scene_get_keyingset_index(scene, ks); } @@ -941,7 +941,7 @@ extern ListBase builtin_keyingsets; static void rna_Scene_all_keyingsets_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Scene *scene = (Scene *)ptr->data; - + /* start going over the scene KeyingSets first, while we still have pointer to it * but only if we have any Keying Sets to use... */ @@ -955,13 +955,13 @@ static void rna_Scene_all_keyingsets_next(CollectionPropertyIterator *iter) { ListBaseIterator *internal = &iter->internal.listbase; KeyingSet *ks = (KeyingSet *)internal->link; - + /* if we've run out of links in Scene list, jump over to the builtins list unless we're there already */ if ((ks->next == NULL) && (ks != builtin_keyingsets.last)) internal->link = (Link *)builtin_keyingsets.first; else internal->link = (Link *)ks->next; - + iter->valid = (internal->link != NULL); } @@ -1069,10 +1069,10 @@ static int rna_RenderSettings_save_buffers_get(PointerRNA *ptr) { RenderData *rd = (RenderData *)ptr->data; Scene *scene = (Scene *)ptr->id.data; - + if (!BKE_scene_use_new_shading_nodes(scene)) return (rd->scemode & (R_EXR_TILE_FILE | R_FULL_SAMPLE)) != 0; - else + else return (rd->scemode & R_EXR_TILE_FILE) != 0; } @@ -1360,7 +1360,7 @@ static PointerRNA rna_RenderSettings_active_layer_get(PointerRNA *ptr) { RenderData *rd = (RenderData *)ptr->data; SceneRenderLayer *srl = BLI_findlink(&rd->layers, rd->actlay); - + return rna_pointer_inherit_refine(ptr, &RNA_SceneRenderLayer, srl); } @@ -1488,7 +1488,7 @@ static const EnumPropertyItem *rna_RenderSettings_engine_itemf( tmp.name = type->name; RNA_enum_item_add(&item, &totitem, &tmp); } - + RNA_enum_item_end(&item, &totitem); *r_free = true; @@ -1504,7 +1504,7 @@ static int rna_RenderSettings_engine_get(PointerRNA *ptr) for (type = R_engines.first; type; type = type->next, a++) if (STREQ(type->idname, rd->engine)) return a; - + return 0; } @@ -1635,7 +1635,7 @@ static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr) for (type = R_engines.first; type; type = type->next) if (STREQ(type->idname, rd->engine)) return (type->flag & RE_GAME) != 0; - + return 0; } @@ -1731,7 +1731,7 @@ static void object_simplify_update(Object *ob) for (psys = ob->particlesystem.first; psys; psys = psys->next) psys->recalc |= PSYS_RECALC_CHILD; - + if (ob->dup_group) { GroupObject *gob; @@ -1749,7 +1749,7 @@ static void rna_Scene_use_simplify_update(Main *bmain, Scene *scene, PointerRNA BKE_main_id_tag_listbase(&bmain->object, LIB_TAG_DOIT, true); for (SETLOOPER(sce, sce_iter, base)) object_simplify_update(base->object); - + WM_main_add_notifier(NC_GEOM | ND_DATA, NULL); DAG_id_tag_update(&scene->id, 0); } @@ -1885,7 +1885,7 @@ static KeyingSet *rna_Scene_keying_set_new(Scene *sce, ReportList *reports, cons /* call the API func, and set the active keyingset index */ ks = BKE_keyingset_add(&sce->keyingsets, idname, name, KEYINGSET_ABSOLUTE, 0); - + if (ks) { sce->active_keyingset = BLI_listbase_count(&sce->keyingsets); return ks; @@ -2174,13 +2174,13 @@ static void rna_def_gpencil_interpolate(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "GPencilInterpolateSettings", NULL); RNA_def_struct_sdna(srna, "GP_Interpolate_Settings"); RNA_def_struct_path_func(srna, "rna_GPencilInterpolateSettings_path"); RNA_def_struct_ui_text(srna, "Grease Pencil Interpolate Settings", "Settings for Grease Pencil interpolation tools"); - + /* flags */ prop = RNA_def_property(srna, "interpolate_all_layers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TOOLFLAG_INTERPOLATE_ALL_LAYERS); @@ -2191,7 +2191,7 @@ static void rna_def_gpencil_interpolate(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED); RNA_def_property_ui_text(prop, "Interpolate Selected Strokes", "Interpolate only selected strokes in the original frame"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + /* interpolation type */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); @@ -2200,38 +2200,38 @@ static void rna_def_gpencil_interpolate(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Type", "Interpolation method to use the next time 'Interpolate Sequence' is run"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + /* easing */ prop = RNA_def_property(srna, "easing", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "easing"); RNA_def_property_enum_items(prop, rna_enum_beztriple_interpolation_easing_items); - RNA_def_property_ui_text(prop, "Easing", + RNA_def_property_ui_text(prop, "Easing", "Which ends of the segment between the preceding and following grease pencil frames " "easing interpolation is applied to"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + /* easing options */ prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "back"); RNA_def_property_ui_text(prop, "Back", "Amount of overshoot for 'back' easing"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "amplitude"); RNA_def_property_range(prop, 0.0f, FLT_MAX); /* only positive values... */ RNA_def_property_ui_text(prop, "Amplitude", "Amount to boost elastic bounces for 'elastic' easing"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "period"); RNA_def_property_ui_text(prop, "Period", "Time between bounces for elastic easing"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + /* custom curvemap */ prop = RNA_def_property(srna, "interpolation_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "custom_ipo"); RNA_def_property_struct_type(prop, "CurveMapping"); - RNA_def_property_ui_text(prop, "Interpolation Curve", + RNA_def_property_ui_text(prop, "Interpolation Curve", "Custom curve to control 'sequence' interpolation between Grease Pencil frames"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); } @@ -2439,14 +2439,14 @@ static void rna_def_transform_orientation(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "TransformOrientation", NULL); - + prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "mat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_3x3); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", "Name of the custom transform orientation"); @@ -2465,7 +2465,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) {UV_SELECT_ISLAND, "ISLAND", ICON_UV_ISLANDSEL, "Island", "Island selection mode"}, {0, NULL, 0, NULL, NULL} }; - + /* the construction of this enum is quite special - everything is stored as bitflags, * with 1st position only for for on/off (and exposed as boolean), while others are mutually * exclusive options but which will only have any effect when autokey is enabled @@ -2482,7 +2482,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) {SK_RETARGET_ROLL_JOINT, "JOINT", 0, "Joint", "Roll bone to original joint plane offset"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem sketch_convert_items[] = { {SK_CONVERT_CUT_FIXED, "FIXED", 0, "Fixed", "Subdivide stroke in fixed number of bones"}, {SK_CONVERT_CUT_LENGTH, "LENGTH", 0, "Length", "Subdivide stroke in bones of specific length"}, @@ -2515,7 +2515,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) {WT_VGROUP_BONE_DEFORM_OFF, "OTHER_DEFORM", 0, "Other", "Vertex Groups assigned to non Deform Bones"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem gpencil_source_3d_items[] = { {GP_TOOL_SOURCE_SCENE, "SCENE", 0, "Scene", "Grease Pencil data attached to the current scene is used, " @@ -2525,7 +2525,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) "(required when using pre 2.73 add-ons, e.g. BSurfaces)"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem gpencil_stroke_placement_items[] = { {GP_PROJECT_VIEWSPACE, "CURSOR", 0, "Cursor", "Draw stroke at the 3D cursor"}, {0, "VIEW", 0, "View", "Stick stroke to the view "}, /* weird, GP_PROJECT_VIEWALIGN is inverted */ @@ -2533,16 +2533,16 @@ static void rna_def_tool_settings(BlenderRNA *brna) {GP_PROJECT_VIEWSPACE | GP_PROJECT_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"}, {0, NULL, 0, NULL, NULL} }; - - + + srna = RNA_def_struct(brna, "ToolSettings", NULL); RNA_def_struct_path_func(srna, "rna_ToolSettings_path"); RNA_def_struct_ui_text(srna, "Tool Settings", ""); - + prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Sculpt"); RNA_def_property_ui_text(prop, "Sculpt", ""); - + prop = RNA_def_property(srna, "use_auto_normalize", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1); RNA_def_property_ui_text(prop, "WPaint Auto-Normalize", @@ -2658,7 +2658,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "proportional_size"); RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle"); RNA_def_property_range(prop, 0.00001, 5000.0); - + prop = RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "normalsize"); RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view"); @@ -2701,14 +2701,14 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_snap_element_items); RNA_def_property_ui_text(prop, "Snap Element", "Type of element to snap to"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ - + /* node editor uses own set of snap modes */ prop = RNA_def_property(srna, "snap_node_element", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "snap_node_mode"); RNA_def_property_enum_items(prop, rna_enum_snap_node_element_items); RNA_def_property_ui_text(prop, "Snap Node Element", "Type of element to snap to"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ - + /* image editor uses own set of snap modes */ prop = RNA_def_property(srna, "snap_uv_element", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "snap_uv_mode"); @@ -2727,7 +2727,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center"); RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */ - + prop = RNA_def_property(srna, "use_snap_project", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PROJECT); RNA_def_property_ui_text(prop, "Project Individual Elements", @@ -2747,14 +2747,14 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Use Continuous Drawing", "Allow drawing multiple strokes at a time with Grease Pencil"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* xxx: need toolbar to be redrawn... */ - + prop = RNA_def_property(srna, "use_gpencil_additive_drawing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_RETAIN_LAST); RNA_def_property_ui_text(prop, "Use Additive Drawing", "When creating new frames, the strokes from the previous/active frame " "are included as the basis for the new one"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "use_gpencil_draw_onback", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_PAINT_ONBACK); RNA_def_property_ui_text(prop, "Draw Strokes on Back", @@ -2767,17 +2767,17 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Grease Pencil Source", "Data-block where active Grease Pencil data is found from"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - + prop = RNA_def_property(srna, "gpencil_sculpt", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "gp_sculpt"); RNA_def_property_struct_type(prop, "GPencilSculptSettings"); RNA_def_property_ui_text(prop, "Grease Pencil Sculpt", "Settings for stroke sculpting tools and brushes"); - + prop = RNA_def_property(srna, "gpencil_interpolate", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "gp_interpolate"); RNA_def_property_struct_type(prop, "GPencilInterpolateSettings"); - RNA_def_property_ui_text(prop, "Grease Pencil Interpolate", + RNA_def_property_ui_text(prop, "Grease Pencil Interpolate", "Settings for Grease Pencil Interpolation tools"); /* Grease Pencil - Drawing brushes */ @@ -2793,12 +2793,12 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, gpencil_stroke_placement_items); RNA_def_property_ui_text(prop, "Stroke Placement (3D View)", ""); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - + prop = RNA_def_property(srna, "use_gpencil_stroke_endpoints", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gpencil_v3d_align", GP_PROJECT_DEPTH_STROKE_ENDPOINTS); RNA_def_property_ui_text(prop, "Only Endpoints", "Only use the first and last parts of the stroke for snapping"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - + /* Grease Pencil - 2D Views Stroke Placement */ prop = RNA_def_property(srna, "gpencil_stroke_placement_view2d", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_v2d_align"); @@ -2812,7 +2812,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, gpencil_stroke_placement_items); RNA_def_property_ui_text(prop, "Stroke Placement (Sequencer Preview)", ""); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - + /* Grease Pencil - Image Editor Stroke Placement */ prop = RNA_def_property(srna, "gpencil_stroke_placement_image_editor", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_ima_align"); @@ -2820,36 +2820,36 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Stroke Placement (Image Editor)", ""); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - + /* Auto Keying */ prop = RNA_def_property(srna, "use_keyframe_insert_auto", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON); RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones"); RNA_def_property_ui_icon(prop, ICON_REC, 0); - + prop = RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "autokey_mode"); RNA_def_property_enum_items(prop, auto_key_items); RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones"); - + prop = RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA); RNA_def_property_ui_text(prop, "Layered", "Add a new NLA Track + Strip for every loop/pass made over the animation " "to allow non-destructive tweaking"); - + prop = RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET); RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set only"); RNA_def_property_ui_icon(prop, ICON_KEYINGSET, 0); - + /* Keyframing */ prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "keyframe_type"); RNA_def_property_enum_items(prop, rna_enum_beztriple_keyframe_type_items); RNA_def_property_ui_text(prop, "New Keyframe Type", "Type of keyframes to create when inserting keyframes"); - + /* UV */ prop = RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode"); @@ -2904,7 +2904,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST); RNA_def_property_ui_text(prop, "Overdraw Sketching", "Adjust strokes by drawing near them"); - + prop = RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME); RNA_def_property_ui_text(prop, "Autoname Bones", @@ -2949,7 +2949,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_bitflag_sdna(prop, NULL, "skgen_retarget_roll"); RNA_def_property_enum_items(prop, retarget_roll_items); RNA_def_property_ui_text(prop, "Retarget roll mode", "Method used to adjust the roll of bones when retargeting"); - + prop = RNA_def_property(srna, "etch_convert_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "bone_sketching_convert"); RNA_def_property_enum_items(prop, sketch_convert_items); @@ -3281,7 +3281,7 @@ static void rna_def_unit_settings(BlenderRNA *brna) {USER_UNIT_IMPERIAL, "IMPERIAL", 0, "Imperial", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem rotation_units[] = { {0, "DEGREES", 0, "Degrees", "Use degrees for measuring angles and rotations"}, {USER_UNIT_ROT_RADIANS, "RADIANS", 0, "Radians", ""}, @@ -3296,7 +3296,7 @@ static void rna_def_unit_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, unit_systems); RNA_def_property_ui_text(prop, "Unit System", "The unit system to use for button display"); RNA_def_property_update(prop, NC_WINDOW, NULL); - + prop = RNA_def_property(srna, "system_rotation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rotation_units); RNA_def_property_ui_text(prop, "Rotation Units", "Unit to use for displaying/editing rotation values"); @@ -3468,7 +3468,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) RNA_def_property_ui_text(prop, "Z", "Deliver Z values pass"); if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + prop = RNA_def_property(srna, "use_pass_vector", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_VECTOR); RNA_def_property_ui_text(prop, "Vector", "Deliver speed vector pass"); @@ -3534,7 +3534,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) RNA_def_property_ui_text(prop, "AO", "Deliver AO pass"); if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + prop = RNA_def_property(srna, "use_pass_reflection", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_REFLECT); RNA_def_property_ui_text(prop, "Reflection", "Deliver raytraced reflection pass"); @@ -3585,7 +3585,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1); if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + prop = RNA_def_property(srna, "exclude_reflection", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "pass_xor", SCE_PASS_REFLECT); RNA_def_property_ui_text(prop, "Reflection Exclude", "Exclude raytraced reflection pass from combined"); @@ -3674,7 +3674,7 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) RNA_def_property_ui_text(prop, "Transmission Color", "Deliver transmission color pass"); if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + prop = RNA_def_property(srna, "use_pass_subsurface_direct", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_SUBSURFACE_DIRECT); RNA_def_property_ui_text(prop, "Subsurface Direct", "Deliver subsurface direct pass"); @@ -4443,7 +4443,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna) {DOME_PANORAM_SPH, "PANORAM_SPH", 0, "Spherical Panoramic", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem stereo_modes_items[] = { {STEREO_QUADBUFFERED, "QUADBUFFERED", 0, "Quad-Buffer", ""}, {STEREO_ABOVEBELOW, "ABOVEBELOW", 0, "Above-Below", ""}, @@ -4454,7 +4454,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna) {STEREO_3DTVTOPBOTTOM, "3DTVTOPBOTTOM", 0, "3DTV Top-Bottom", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem stereo_items[] = { {STEREO_NOSTEREO, "NONE", 0, "None", "Disable Stereo and Dome environments"}, {STEREO_ENABLED, "STEREO", 0, "Stereo", "Enable Stereo environment"}, @@ -4499,14 +4499,14 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_struct_sdna(srna, "GameData"); RNA_def_struct_nested(brna, srna, "Scene"); RNA_def_struct_ui_text(srna, "Game Data", "Game data for a Scene data-block"); - + prop = RNA_def_property(srna, "resolution_x", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "xplay"); RNA_def_property_range(prop, 4, 10000); RNA_def_property_int_default(prop, 640); RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the screen"); RNA_def_property_update(prop, NC_SCENE, NULL); - + prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "yplay"); RNA_def_property_range(prop, 4, 10000); @@ -4518,12 +4518,12 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "vsync"); RNA_def_property_enum_items(prop, vsync_items); RNA_def_property_ui_text(prop, "Vsync", "Change vsync settings"); - + prop = RNA_def_property(srna, "samples", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "aasamples"); RNA_def_property_enum_items(prop, aasamples_items); RNA_def_property_ui_text(prop, "AA Samples", "The number of AA Samples to use for MSAA"); - + prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "depth"); RNA_def_property_range(prop, 8, 32); @@ -4539,13 +4539,13 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_enum_funcs(prop, NULL, "rna_GameSettings_exit_key_set", NULL); RNA_def_property_ui_text(prop, "Exit Key", "The key that exits the Game Engine"); RNA_def_property_update(prop, NC_SCENE, NULL); - + prop = RNA_def_property(srna, "raster_storage", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "raster_storage"); RNA_def_property_enum_items(prop, storage_items); RNA_def_property_ui_text(prop, "Storage", "Set the storage mode used by the rasterizer"); RNA_def_property_update(prop, NC_SCENE, NULL); - + /* Do we need it here ? (since we already have it in World */ prop = RNA_def_property(srna, "frequency", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "freqplay"); @@ -4553,7 +4553,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_int_default(prop, 60); RNA_def_property_ui_text(prop, "Freq", "Display clock frequency of fullscreen display"); RNA_def_property_update(prop, NC_SCENE, NULL); - + prop = RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "playerflag", GAME_PLAYER_FULLSCREEN); RNA_def_property_ui_text(prop, "Fullscreen", "Start player in a new fullscreen display"); @@ -4577,7 +4577,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Framing Color", "Set color of the bars"); RNA_def_property_update(prop, NC_SCENE, NULL); - + /* Stereo */ prop = RNA_def_property(srna, "stereo", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stereoflag"); @@ -4599,48 +4599,48 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Eye Separation", "Set the distance between the eyes - the camera focal distance/30 should be fine"); RNA_def_property_update(prop, NC_SCENE, NULL); - + /* Dome */ prop = RNA_def_property(srna, "dome_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dome.mode"); RNA_def_property_enum_items(prop, dome_modes_items); RNA_def_property_ui_text(prop, "Dome Mode", "Dome physical configurations"); RNA_def_property_update(prop, NC_SCENE, NULL); - + prop = RNA_def_property(srna, "dome_tessellation", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dome.res"); RNA_def_property_ui_range(prop, 1, 8, 1, 1); RNA_def_property_int_default(prop, 4); RNA_def_property_ui_text(prop, "Tessellation", "Tessellation level - check the generated mesh in wireframe mode"); RNA_def_property_update(prop, NC_SCENE, NULL); - + prop = RNA_def_property(srna, "dome_buffer_resolution", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dome.resbuf"); RNA_def_property_ui_range(prop, 0.1, 1.0, 0.1, 2); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Buffer Resolution", "Buffer Resolution - decrease it to increase speed"); RNA_def_property_update(prop, NC_SCENE, NULL); - + prop = RNA_def_property(srna, "dome_angle", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dome.angle"); RNA_def_property_ui_range(prop, 90, 250, 1, 1); RNA_def_property_int_default(prop, 180); RNA_def_property_ui_text(prop, "Angle", "Field of View of the Dome - it only works in mode Fisheye and Truncated"); RNA_def_property_update(prop, NC_SCENE, NULL); - + prop = RNA_def_property(srna, "dome_tilt", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dome.tilt"); RNA_def_property_ui_range(prop, -180, 180, 1, 1); RNA_def_property_ui_text(prop, "Tilt", "Camera rotation in horizontal axis"); RNA_def_property_update(prop, NC_SCENE, NULL); - + prop = RNA_def_property(srna, "dome_text", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "dome.warptext"); RNA_def_property_struct_type(prop, "Text"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Warp Data", "Custom Warp Mesh data file"); RNA_def_property_update(prop, NC_SCENE, NULL); - + /* physics */ prop = RNA_def_property(srna, "physics_engine", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "physicsEngine"); @@ -4740,7 +4740,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "DBVT Culling", "Use optimized Bullet DBVT tree for view frustum and occlusion culling (more efficient, " "but it can waste unnecessary CPU if the scene doesn't have occluder objects)"); - + /* not used *//* deprecated !!!!!!!!!!!!! */ prop = RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_ACTIVITY_CULLING); @@ -4803,7 +4803,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Restrict Animation Updates", "Restrict the number of animation updates to the animation FPS (this is " "better for performance, but can cause issues with smooth playback)"); - + /* materials */ prop = RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "matmode"); @@ -5079,7 +5079,7 @@ static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop) "rna_RenderSettings_active_layer_index_range"); RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "SceneRenderLayer"); RNA_def_property_pointer_funcs(prop, "rna_RenderSettings_active_layer_get", @@ -5664,7 +5664,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem pixel_filter_items[] = { {R_FILTER_BOX, "BOX", 0, "Box", "Use a box filter for anti-aliasing"}, {R_FILTER_TENT, "TENT", 0, "Tent", "Use a tent filter for anti-aliasing"}, @@ -5675,7 +5675,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {R_FILTER_MITCH, "MITCHELL", 0, "Mitchell-Netravali", "Use a Mitchell-Netravali filter for anti-aliasing"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem alpha_mode_items[] = { {R_ADDSKY, "SKY", 0, "Sky", "Transparent pixels are filled with sky color"}, {R_ALPHAPREMUL, "TRANSPARENT", 0, "Transparent", "World background is transparent with premultiplied alpha"}, @@ -5689,7 +5689,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes"}, {0, NULL, 0, NULL, NULL} }; - + /* Bake */ static const EnumPropertyItem bake_mode_items[] = { {RE_BAKE_ALL, "FULL", 0, "Full Render", "Bake everything"}, @@ -5723,7 +5723,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {2, "FIXED_ALT", 0, "Fixed Alternate", "Split quads predictably (1,2,3) (1,3,0)"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem pixel_size_items[] = { {0, "AUTO", 0, "Automatic", "Automatic pixel size, depends on the UI scale"}, {1, "1", 0, "1x", "Render at full resolution"}, @@ -5757,13 +5757,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {16, "16", 0, "16", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem field_order_items[] = { {0, "EVEN_FIRST", 0, "Upper First", "Upper field first"}, {R_ODDFIELD, "ODD_FIRST", 0, "Lower First", "Lower field first"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem threads_mode_items[] = { {0, "AUTO", 0, "Auto-detect", "Automatically determine the number of threads, based on CPUs"}, {R_FIXED_THREADS, "FIXED", 0, "Fixed", "Manually determine the number of threads"}, @@ -5814,7 +5814,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_range(prop, 4, 65536); RNA_def_property_ui_text(prop, "Resolution X", "Number of horizontal pixels in the rendered image"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update"); - + prop = RNA_def_property(srna, "resolution_y", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "ysch"); RNA_def_property_flag(prop, PROP_PROPORTIONAL); @@ -5822,7 +5822,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_range(prop, 4, 65536); RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the rendered image"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update"); - + prop = RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE); RNA_def_property_int_sdna(prop, NULL, "size"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -5830,14 +5830,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, 100, 10, 1); RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "tile_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tilex"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 8, 65536); RNA_def_property_ui_text(prop, "Tile X", "Horizontal tile size to use while rendering"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "tile_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tiley"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -5867,7 +5867,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pixel Aspect X", "Horizontal aspect ratio - for anamorphic or non-square pixel output"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update"); - + prop = RNA_def_property(srna, "pixel_aspect_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yasp"); RNA_def_property_flag(prop, PROP_PROPORTIONAL); @@ -5890,7 +5890,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, 120, 1, -1); RNA_def_property_ui_text(prop, "FPS", "Framerate, expressed in frames per second"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update"); - + prop = RNA_def_property(srna, "fps_base", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "frs_sec_base"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -5898,7 +5898,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.1f, 120.0f, 2, -1); RNA_def_property_ui_text(prop, "FPS Base", "Framerate base"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_fps_update"); - + /* frame mapping */ prop = RNA_def_property(srna, "frame_map_old", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "framapto"); @@ -5906,7 +5906,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_range(prop, 1, 900); RNA_def_property_ui_text(prop, "Frame Map Old", "Old mapping value in frames"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update"); - + prop = RNA_def_property(srna, "frame_map_new", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "images"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -5914,32 +5914,32 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Frame Map New", "How many frames the Map Old will last"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_framelen_update"); - + prop = RNA_def_property(srna, "dither_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dither_intensity"); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Dither Intensity", "Amount of dithering noise added to the rendered image to break up banding"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "pixel_filter_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "filtertype"); RNA_def_property_enum_items(prop, pixel_filter_items); RNA_def_property_ui_text(prop, "Pixel Filter", "Reconstruction filter used for combining anti-aliasing samples"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_PIXEL); RNA_def_property_float_sdna(prop, NULL, "gauss"); RNA_def_property_range(prop, 0.5f, 1.5f); RNA_def_property_ui_text(prop, "Filter Size", "Width over which the reconstruction filter combines samples"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "alpha_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "alphamode"); RNA_def_property_enum_items(prop, alpha_mode_items); RNA_def_property_ui_text(prop, "Alpha Mode", "Representation of alpha information in the RGBA pixels"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "octree_resolution", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ocres"); RNA_def_property_enum_items(prop, octree_resolution_items); @@ -5971,18 +5971,18 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Anti-Aliasing", "Render and combine multiple samples per pixel to prevent jagged edges"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "antialiasing_samples", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "osa"); RNA_def_property_enum_items(prop, fixed_oversample_items); RNA_def_property_ui_text(prop, "Anti-Aliasing Samples", "Amount of anti-aliasing samples per pixel"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDS); RNA_def_property_ui_text(prop, "Fields", "Render image to two fields per frame, for interlaced TV output"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, field_order_items); @@ -5990,23 +5990,23 @@ static void rna_def_scene_render_data(BlenderRNA *brna) "Order of video fields (select which lines get rendered first, " "to create smooth motion for TV output)"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_fields_still", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_FIELDSTILL); RNA_def_property_ui_text(prop, "Fields Still", "Disable the time difference between fields"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + /* rendering features */ prop = RNA_def_property(srna, "use_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SHADOW); RNA_def_property_ui_text(prop, "Shadows", "Calculate shadows while rendering"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "use_envmaps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_ENVMAP); RNA_def_property_ui_text(prop, "Environment Maps", "Calculate environment maps while rendering"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "use_sss", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_SSS); RNA_def_property_ui_text(prop, "Subsurface Scattering", "Calculate sub-surface scattering in materials rendering"); @@ -6016,35 +6016,35 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "mode", R_USE_WS_SHADING); RNA_def_property_ui_text(prop, "World Space Shading", "Use world space interpretation of lighting data for node materials"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "use_raytrace", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_RAYTRACE); RNA_def_property_ui_text(prop, "Raytracing", "Pre-calculate the raytrace accelerator and render raytracing effects"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "scemode", R_NO_TEX); RNA_def_property_ui_text(prop, "Textures", "Use textures to affect material properties"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE); RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "edgeint"); RNA_def_property_range(prop, 0, 255); RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "edgeR"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Edge Color", "Edge color"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE_FRS); @@ -6060,28 +6060,28 @@ static void rna_def_scene_render_data(BlenderRNA *brna) "Number of CPU threads to use simultaneously while rendering " "(for multi-core/CPU systems)"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "threads_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, threads_mode_items); RNA_def_property_enum_funcs(prop, "rna_RenderSettings_threads_mode_get", NULL, NULL); RNA_def_property_ui_text(prop, "Threads Mode", "Determine the amount of render threads used"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + /* motion blur */ prop = RNA_def_property(srna, "use_motion_blur", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR); RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "mblur_samples"); RNA_def_property_range(prop, 1, 32); RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); - + prop = RNA_def_property(srna, "motion_blur_shutter", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "blurfac"); RNA_def_property_ui_range(prop, 0.01f, 2.0f, 1, 2); @@ -6093,7 +6093,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "mblur_shutter_curve"); RNA_def_property_struct_type(prop, "CurveMapping"); RNA_def_property_ui_text(prop, "Shutter Curve", "Curve defining the shutter's openness over time"); - + /* border */ prop = RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER); @@ -6103,8 +6103,8 @@ static void rna_def_scene_render_data(BlenderRNA *brna) "(note that this disables save_buffers and full_sample)"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - - + + prop = RNA_def_property(srna, "border_min_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "border.xmin"); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -6132,24 +6132,24 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Border Maximum Y", "Maximum Y value for the render border"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_crop_to_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_CROP); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH); RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE); RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOCOMP); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -6157,7 +6157,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) "Process the render result through the compositing pipeline, " "if compositing nodes are enabled"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_sequencer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_DOSEQ); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -6165,7 +6165,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) "Process the render (and composited) result through the video sequence " "editor pipeline, if sequencer strips exist"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION); RNA_def_property_ui_text(prop, "File Extensions", @@ -6204,7 +6204,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) "Save tiles for all RenderLayers and SceneNodes to files in the temp directory " "(saves memory, required for Full Sample)"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_full_sample", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FULL_SAMPLE); RNA_def_property_ui_text(prop, "Full Sample", @@ -6240,7 +6240,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); /* Bake */ - + prop = RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode"); RNA_def_property_enum_items(prop, bake_mode_items); @@ -6343,23 +6343,23 @@ static void rna_def_scene_render_data(BlenderRNA *brna) "apply a user scale to the derivative map"); /* stamp */ - + prop = RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_TIME); RNA_def_property_ui_text(prop, "Stamp Time", "Include the rendered frame timecode as HH:MM:SS.FF in image metadata"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_stamp_date", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_DATE); RNA_def_property_ui_text(prop, "Stamp Date", "Include the current date in image/video metadata"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_stamp_frame", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME); RNA_def_property_ui_text(prop, "Stamp Frame", "Include the frame number in image metadata"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_stamp_frame_range", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FRAME_RANGE); RNA_def_property_ui_text(prop, "Stamp Frame", "Include the rendered frame range in image/video metadata"); @@ -6374,27 +6374,27 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_CAMERALENS); RNA_def_property_ui_text(prop, "Stamp Lens", "Include the active camera's lens in image metadata"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_stamp_scene", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SCENE); RNA_def_property_ui_text(prop, "Stamp Scene", "Include the name of the active scene in image/video metadata"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_stamp_note", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_NOTE); RNA_def_property_ui_text(prop, "Stamp Note", "Include a custom note in image/video metadata"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_stamp_marker", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_MARKER); RNA_def_property_ui_text(prop, "Stamp Marker", "Include the name of the last marker in image metadata"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_stamp_filename", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_FILENAME); RNA_def_property_ui_text(prop, "Stamp Filename", "Include the .blend filename in image/video metadata"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "use_stamp_sequencer_strip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_SEQSTRIP); RNA_def_property_ui_text(prop, "Stamp Sequence Strip", @@ -6405,7 +6405,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "stamp", R_STAMP_RENDERTIME); RNA_def_property_ui_text(prop, "Stamp Render Time", "Include the render time in image metadata"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "stamp_note_text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "stamp_udata"); RNA_def_property_ui_text(prop, "Stamp Note Text", "Custom text to appear in the stamp note"); @@ -6443,7 +6443,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Text Color", "Color to use for stamp text"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + prop = RNA_def_property(srna, "stamp_background", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "bg_stamp"); RNA_def_property_array(prop, 4); @@ -6641,7 +6641,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop) FunctionRNA *func; PropertyRNA *parm; - + RNA_def_property_srna(cprop, "SceneObjects"); srna = RNA_def_struct(brna, "SceneObjects", NULL); RNA_def_struct_sdna(srna, "Scene"); @@ -6759,7 +6759,7 @@ static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop) "rna_Scene_active_keying_set_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes"); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET, NULL); - + prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "active_keyingset"); RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", @@ -6773,14 +6773,14 @@ static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; - + RNA_def_property_srna(cprop, "KeyingSetsAll"); srna = RNA_def_struct(brna, "KeyingSetsAll", NULL); RNA_def_struct_sdna(srna, "Scene"); RNA_def_struct_ui_text(srna, "Keying Sets All", "All available keying sets"); - + /* NOTE: no add/remove available here, without screwing up this amalgamated list... */ - + prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "KeyingSet"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -6788,7 +6788,7 @@ static void rna_def_scene_keying_sets_all(BlenderRNA *brna, PropertyRNA *cprop) "rna_Scene_active_keying_set_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes"); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET, NULL); - + prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "active_keyingset"); RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", @@ -6875,7 +6875,7 @@ void RNA_def_scene(BlenderRNA *brna) FunctionRNA *func; PropertyRNA *parm; - + static const EnumPropertyItem audio_distance_model_items[] = { {0, "NONE", 0, "None", "No distance attenuation"}, {1, "INVERSE", 0, "Inverse", "Inverse distance model"}, @@ -6900,7 +6900,7 @@ void RNA_def_scene(BlenderRNA *brna) "defining time and render related settings"); RNA_def_struct_ui_icon(srna, ICON_SCENE_DATA); RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); - + /* Global Settings */ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -6926,7 +6926,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Cursor Location", "3D cursor location"); RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4); RNA_def_property_update(prop, NC_WINDOW, NULL); - + /* Bases/Objects */ prop = RNA_def_property(srna, "object_bases", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "base", NULL); @@ -6968,7 +6968,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Current Frame", "Current Frame, to update animation data from python frame_set() instead"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME, "rna_Scene_frame_update"); - + prop = RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "r.subframe"); RNA_def_property_ui_text(prop, "Current Sub-Frame", ""); @@ -6992,7 +6992,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_range(prop, MINFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Start Frame", "First frame of the playback/rendering range"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME_RANGE, NULL); - + prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "r.efra"); @@ -7000,7 +7000,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_range(prop, MINFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "End Frame", "Final frame of the playback/rendering range"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME_RANGE, NULL); - + prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "r.frame_step"); @@ -7009,7 +7009,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Frame Step", "Number of frames to skip forward while rendering/playing back each frame"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME, NULL); - + prop = RNA_def_property(srna, "frame_current_final", PROP_FLOAT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); @@ -7035,14 +7035,14 @@ void RNA_def_scene(BlenderRNA *brna) "OpenGL renders instead of the Render properties start/end frame range"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME, NULL); RNA_def_property_ui_icon(prop, ICON_PREVIEW_RANGE, 0); - + prop = RNA_def_property(srna, "frame_preview_start", PROP_INT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "r.psfra"); RNA_def_property_int_funcs(prop, NULL, "rna_Scene_preview_range_start_frame_set", NULL); RNA_def_property_ui_text(prop, "Preview Range Start Frame", "Alternative start frame for UI playback"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME, NULL); - + prop = RNA_def_property(srna, "frame_preview_end", PROP_INT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_sdna(prop, NULL, "r.pefra"); @@ -7065,16 +7065,16 @@ void RNA_def_scene(BlenderRNA *brna) "Consider keyframes for active Object and/or its selected bones only " "(in timeline and when jumping between keyframes)"); RNA_def_property_update(prop, NC_SCENE | ND_FRAME, NULL); - + /* Stamp */ prop = RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata"); RNA_def_property_ui_text(prop, "Stamp Note", "User defined note for the render stamping"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); - + /* Animation Data (for Scene) */ rna_def_animdata_common(srna); - + /* Readonly Properties */ prop = RNA_def_property(srna, "is_nla_tweakmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_NLA_EDIT_ON); @@ -7082,7 +7082,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "NLA TweakMode", "Whether there is any action referenced by NLA being edited (strictly read-only)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - + /* Frame dropping flag for playback and sync enum */ prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SCE_FRAME_DROP); @@ -7106,13 +7106,13 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_use_nodes_update"); - + /* Sequencer */ prop = RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ed"); RNA_def_property_struct_type(prop, "SequenceEditor"); RNA_def_property_ui_text(prop, "Sequence Editor", ""); - + /* Keying Sets */ prop = RNA_def_property(srna, "keying_sets", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "keyingsets", NULL); @@ -7120,7 +7120,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Absolute Keying Sets", "Absolute Keying Sets for this Scene"); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET, NULL); rna_def_scene_keying_sets(brna, prop); - + prop = RNA_def_property(srna, "keying_sets_all", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_Scene_all_keyingsets_begin", "rna_Scene_all_keyingsets_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", @@ -7130,14 +7130,14 @@ void RNA_def_scene(BlenderRNA *brna) "All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)"); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET, NULL); rna_def_scene_keying_sets_all(brna, prop); - + /* Rigid Body Simulation */ prop = RNA_def_property(srna, "rigidbody_world", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "rigidbody_world"); RNA_def_property_struct_type(prop, "RigidBodyWorld"); RNA_def_property_ui_text(prop, "Rigid Body World", ""); RNA_def_property_update(prop, NC_SCENE, NULL); - + /* Tool Settings */ prop = RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -7164,14 +7164,14 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "physics_settings.flag", PHYS_GLOBAL_GRAVITY); RNA_def_property_ui_text(prop, "Global Gravity", "Use global gravity for all dynamics"); RNA_def_property_update(prop, 0, "rna_Physics_update"); - + /* Render Data */ prop = RNA_def_property(srna, "render", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "r"); RNA_def_property_struct_type(prop, "RenderSettings"); RNA_def_property_ui_text(prop, "Render Data", ""); - + /* Safe Areas */ prop = RNA_def_property(srna, "safe_areas", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "safe_areas"); @@ -7243,7 +7243,7 @@ void RNA_def_scene(BlenderRNA *brna) func = RNA_def_function(srna, "statistics", "ED_info_stats_string"); parm = RNA_def_string(func, "statistics", NULL, 0, "Statistics", ""); RNA_def_function_return(func, parm); - + /* Grease Pencil */ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "gpd"); @@ -7251,7 +7251,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil data-block"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); - + /* Transform Orientations */ prop = RNA_def_property(srna, "orientations", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "transform_spaces", NULL); diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 70023679e3c..fe2f4fe0dca 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -101,7 +101,7 @@ static void rna_Scene_frame_set(Scene *scene, Main *bmain, int frame, float subf /* cant use NC_SCENE|ND_FRAME because this causes wm_event_do_notifiers to call * BKE_scene_update_for_newframe which will loose any un-keyed changes [#24690] */ /* WM_main_add_notifier(NC_SCENE|ND_FRAME, scene); */ - + /* instead just redraw the views */ WM_main_add_notifier(NC_WINDOW, NULL); } @@ -294,7 +294,7 @@ void RNA_api_scene(StructRNA *srna) parm = RNA_def_float_vector(func, "result", 2, NULL, 0.0f, FLT_MAX, "", "aspect", 0.0f, FLT_MAX); RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0); RNA_def_function_output(func, parm); - + /* Ray Cast */ func = RNA_def_function(srna, "ray_cast", "rna_Scene_ray_cast"); RNA_def_function_flag(func, FUNC_USE_MAIN); diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index ce6d60a4ae7..2e86ceb2617 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -278,10 +278,10 @@ static void rna_def_view2d_api(StructRNA *srna) { FunctionRNA *func; PropertyRNA *parm; - + static const float view_default[2] = {0.0f, 0.0f}; static const int region_default[2] = {0.0f, 0.0f}; - + func = RNA_def_function(srna, "region_to_view", "rna_View2D_region_to_view"); RNA_def_function_ui_description(func, "Transform region coordinates to 2D view"); parm = RNA_def_int(func, "x", 0, INT_MIN, INT_MAX, "x", "Region x coordinate", -10000, 10000); @@ -312,9 +312,9 @@ static void rna_def_view2d(BlenderRNA *brna) srna = RNA_def_struct(brna, "View2D", NULL); RNA_def_struct_ui_text(srna, "View2D", "Scroll and zoom for a 2D region"); RNA_def_struct_sdna(srna, "View2D"); - + /* TODO more View2D properties could be exposed here (read-only) */ - + rna_def_view2d_api(srna); } diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 140349ac003..2bc188212fe 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -172,7 +172,7 @@ static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *scene, PointerRN static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value) { ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data; - + /* redraw hair completely if weight brush is/was used */ if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->scene) { Object *ob = (pset->scene->basact) ? pset->scene->basact->object : NULL; @@ -226,7 +226,7 @@ static int rna_ParticleEdit_hair_get(PointerRNA *ptr) return (edit && edit->psys); } - + return 0; } @@ -378,7 +378,7 @@ static void rna_ImaPaint_canvas_update(Main *bmain, Scene *scene, PointerRNA *UN Object *ob = OBACT; bScreen *sc; Image *ima = scene->toolsettings->imapaint.canvas; - + for (sc = bmain->screen.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { @@ -386,14 +386,14 @@ static void rna_ImaPaint_canvas_update(Main *bmain, Scene *scene, PointerRNA *UN for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_IMAGE) { SpaceImage *sima = (SpaceImage *)sl; - + if (!sima->pin) ED_space_image_set(bmain, sima, scene, scene->obedit, ima); } } } } - + if (ob && ob->type == OB_MESH) { GPU_drawobject_free(ob->derivedFinal); BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); @@ -411,7 +411,7 @@ static PointerRNA rna_GPencilSculptSettings_brush_get(PointerRNA *ptr) { GP_BrushEdit_Settings *gset = (GP_BrushEdit_Settings *)ptr->data; GP_EditBrush_Data *brush = NULL; - + if ((gset->brushtype >= 0) && (gset->brushtype < TOT_GP_EDITBRUSH_TYPES)) brush = &gset->brush[gset->brushtype]; @@ -720,35 +720,35 @@ static void rna_def_image_paint(BlenderRNA *brna) "Image", "Set image for texture painting directly"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "ImagePaint", "Paint"); RNA_def_struct_sdna(srna, "ImagePaintSettings"); RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path"); RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode"); - /* functions */ + /* functions */ func = RNA_def_function(srna, "detect_data", "rna_ImaPaint_detect_data"); RNA_def_function_ui_description(func, "Check if required texpaint data exist"); /* return type */ RNA_def_function_return(func, RNA_def_boolean(func, "ok", 1, "", "")); - - /* booleans */ + + /* booleans */ prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY); RNA_def_property_ui_text(prop, "Occlude", "Only paint onto the faces directly under the brush (slower)"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE); RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_FLAT); RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL); RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons"); @@ -769,13 +769,13 @@ static void rna_def_image_paint(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update"); - + prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "clone"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_float_sdna(prop, NULL, "stencil_col"); @@ -786,15 +786,15 @@ static void rna_def_image_paint(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_ui_text(prop, "Dither", "Amount of dithering when painting on byte images"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE); RNA_def_property_ui_text(prop, "Clone Map", "Use another UV map as clone source, otherwise use the 3D cursor as the source"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update"); - + /* integers */ - + prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL); RNA_def_property_ui_range(prop, 0, 8, 0, -1); RNA_def_property_ui_text(prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)"); @@ -806,36 +806,36 @@ static void rna_def_image_paint(BlenderRNA *brna) prop = RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size", "Size to capture the image for re-projecting", 0, 0); RNA_def_property_range(prop, 512, 16384); - + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, paint_type_items); RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update"); - + /* Missing data */ prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_UVS); RNA_def_property_ui_text(prop, "Missing UVs", "A UV layer is missing on the mesh"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop = RNA_def_property(srna, "missing_materials", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_MATERIAL); RNA_def_property_ui_text(prop, "Missing Materials", "The mesh is missing materials"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "missing_stencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_STENCIL); RNA_def_property_ui_text(prop, "Missing Stencil", "Image Painting does not have a stencil"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "missing_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_TEX); RNA_def_property_ui_text(prop, "Missing Texture", "Image Painting does not have a texture to paint on"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); } static void rna_def_particle_edit(BlenderRNA *brna) @@ -1026,10 +1026,10 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna) {0, "ADD", 0, "Add", "Add effect of brush"}, {GP_EDITBRUSH_FLAG_INVERT, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL}}; - + StructRNA *srna; PropertyRNA *prop; - + /* == Settings == */ srna = RNA_def_struct(brna, "GPencilSculptSettings", NULL); RNA_def_struct_sdna(srna, "GP_BrushEdit_Settings"); @@ -1041,18 +1041,18 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_gpencil_sculpt_brush_items); RNA_def_property_ui_text(prop, "Tool", ""); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "GPencilSculptBrush"); RNA_def_property_pointer_funcs(prop, "rna_GPencilSculptSettings_brush_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Brush", ""); - + prop = RNA_def_property(srna, "use_select_mask", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSHEDIT_FLAG_SELECT_MASK); RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points"); RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0); // FIXME: this needs a custom icon RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "affect_position", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSHEDIT_FLAG_APPLY_POSITION); RNA_def_property_ui_text(prop, "Affect Position", "The brush affects the position of the point"); @@ -1098,23 +1098,23 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna) RNA_def_property_range(prop, 0.001, 1.0); RNA_def_property_ui_text(prop, "Strength", "Brush strength"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_USE_PRESSURE); RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "use_falloff", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_USE_FALLOFF); RNA_def_property_ui_text(prop, "Use Falloff", "Strength of brush decays with distance from cursor"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "affect_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE); RNA_def_property_ui_text(prop, "Affect Pressure", "Affect pressure values as well when smoothing strokes"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - + prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_direction_items); diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 735df471721..c992f4dd57d 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -150,7 +150,7 @@ const EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, Prop /* can't use ob from ptr->id.data because that enum is also used by operators */ ob = CTX_data_active_object(C); } - + RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ACTUATOR); RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_ALWAYS); @@ -171,10 +171,10 @@ const EnumPropertyItem *rna_Sensor_type_itemf(bContext *C, PointerRNA *ptr, Prop RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_RANDOM); RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_RAY); RNA_enum_items_add_value(&item, &totitem, sensor_type_items, SENS_TOUCH); - + RNA_enum_item_end(&item, &totitem); *r_free = true; - + return item; } @@ -182,7 +182,7 @@ static void rna_Sensor_keyboard_key_set(struct PointerRNA *ptr, int value) { bSensor *sens = (bSensor *)ptr->data; bKeyboardSensor *ks = (bKeyboardSensor *)sens->data; - + if (ISKEYBOARD(value)) ks->key = value; else @@ -193,18 +193,18 @@ static void rna_Sensor_keyboard_modifier_set(struct PointerRNA *ptr, int value) { bSensor *sens = (bSensor *)ptr->data; bKeyboardSensor *ks = (bKeyboardSensor *)sens->data; - + if (ISKEYBOARD(value)) ks->qual = value; else ks->qual = 0; } - + static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value) { bSensor *sens = (bSensor *)ptr->data; bKeyboardSensor *ks = (bKeyboardSensor *)sens->data; - + if (ISKEYBOARD(value)) ks->qual2 = value; else @@ -325,7 +325,7 @@ static void rna_def_sensor(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "pulse", SENS_NEG_PULSE_MODE); RNA_def_property_ui_text(prop, "Pulse False Level", "Activate FALSE level triggering (pulse mode)"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "tick_skip", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "freq"); RNA_def_property_ui_text(prop, "Skip", @@ -424,7 +424,7 @@ static void rna_def_mouse_sensor(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_MOUSE_FOCUS_PULSE); RNA_def_property_ui_text(prop, "Pulse", "Moving the mouse over a different object generates a pulse"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "use_material", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, prop_mouse_type_items); @@ -439,7 +439,7 @@ static void rna_def_mouse_sensor(BlenderRNA *brna) prop = RNA_def_property(srna, "material", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "matname"); RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); - RNA_def_property_update(prop, NC_LOGIC, NULL); + RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "use_x_ray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SENS_RAY_XRAY); @@ -464,7 +464,7 @@ static void rna_def_keyboard_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Key", ""); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_WINDOWMANAGER); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "modifier_key_1", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "qual"); RNA_def_property_enum_items(prop, rna_enum_event_type_items); @@ -472,7 +472,7 @@ static void rna_def_keyboard_sensor(BlenderRNA *brna) RNA_def_property_enum_funcs(prop, NULL, "rna_Sensor_keyboard_modifier_set", NULL); RNA_def_property_ui_text(prop, "Modifier Key", "Modifier key code"); RNA_def_property_update(prop, NC_LOGIC, NULL); - + prop = RNA_def_property(srna, "modifier_key_2", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "qual2"); RNA_def_property_enum_items(prop, rna_enum_event_type_items); @@ -740,7 +740,7 @@ static void rna_def_ray_sensor(BlenderRNA *brna) {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_ray_type_items[] = { {SENS_COLLISION_PROPERTY, "PROPERTY", ICON_LOGIC, "Property", "Use a property for ray intersections"}, {SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a material for ray intersections"}, @@ -751,7 +751,7 @@ static void rna_def_ray_sensor(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object"); RNA_def_struct_sdna_from(srna, "bRaySensor", "data"); - + prop = RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, prop_ray_type_items); @@ -849,7 +849,7 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) srna = RNA_def_struct(brna, "JoystickSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Joystick Sensor", "Sensor to detect joystick events"); RNA_def_struct_sdna_from(srna, "bJoystickSensor", "data"); - + prop = RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "joyindex"); RNA_def_property_ui_text(prop, "Index", "Which joystick to use"); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 33621af69af..fb6953904b3 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -177,7 +177,7 @@ static int rna_SequenceEditor_elements_length(PointerRNA *ptr) /* Hack? copied from sequencer.c::reload_sequence_new_file() */ size_t olen = MEM_allocN_len(seq->strip->stripdata) / sizeof(struct StripElem); - + /* the problem with seq->strip->len and seq->len is that it's discounted from the offset (hard cut trim) */ return (int) olen; } @@ -232,7 +232,7 @@ static void rna_Sequence_start_frame_set(PointerRNA *ptr, int value) { Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->id.data; - + BKE_sequence_translate(scene, seq, value - seq->start); do_sequence_frame_change_update(scene, seq); } @@ -283,7 +283,7 @@ static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value) { Sequence *seq = (Sequence *)ptr->data; Scene *scene = (Scene *)ptr->id.data; - + BKE_sequence_tx_set_final_right(seq, BKE_sequence_tx_get_final_left(seq, false) + value); do_sequence_frame_change_update(scene, seq); } @@ -307,7 +307,7 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value) Scene *scene = (Scene *)ptr->id.data; Editing *ed = BKE_sequencer_editing_get(scene, false); ListBase *seqbase = BKE_sequence_seqbase(&ed->seqbase, seq); - + /* check channel increment or decrement */ const int channel_delta = (value >= seq->machine) ? 1 : -1; seq->machine = value; @@ -480,16 +480,16 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value) Sequence *seq = (Sequence *)ptr->data; char oldname[sizeof(seq->name)]; AnimData *adt; - + /* make a copy of the old name first */ BLI_strncpy(oldname, seq->name + 2, sizeof(seq->name) - 2); - + /* copy the new name into the name slot */ BLI_strncpy_utf8(seq->name + 2, value, sizeof(seq->name) - 2); - + /* make sure the name is unique */ BKE_sequence_base_unique_name_recursive(&scene->ed->seqbase, seq); - + /* fix all the animation data which may link to this */ /* don't rename everywhere because these are per scene */ @@ -562,7 +562,7 @@ static StructRNA *rna_Sequence_refine(struct PointerRNA *ptr) static char *rna_Sequence_path(PointerRNA *ptr) { Sequence *seq = (Sequence *)ptr->data; - + /* sequencer data comes from scene... * TODO: would be nice to make SequenceEditor data a data-block of its own (for shorter paths) */ @@ -1121,11 +1121,11 @@ static void rna_def_strip_element(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "SequenceElement", NULL); RNA_def_struct_ui_text(srna, "Sequence Element", "Sequence strip data for a single frame"); RNA_def_struct_sdna(srna, "StripElem"); - + prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Filename", "Name of the source file"); @@ -1146,7 +1146,7 @@ static void rna_def_strip_crop(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "SequenceCrop", NULL); RNA_def_struct_ui_text(srna, "Sequence Crop", "Cropping parameters for a sequence strip"); RNA_def_struct_sdna(srna, "StripCrop"); @@ -1156,13 +1156,13 @@ static void rna_def_strip_crop(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Top", "Number of pixels to crop from the top"); RNA_def_property_ui_range(prop, 0, 4096, 1, -1); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update"); - + prop = RNA_def_property(srna, "min_y", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "bottom"); RNA_def_property_ui_text(prop, "Bottom", "Number of pixels to crop from the bottom"); RNA_def_property_ui_range(prop, 0, 4096, 1, -1); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceCrop_update"); - + prop = RNA_def_property(srna, "min_x", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "left"); RNA_def_property_ui_text(prop, "Left", "Number of pixels to crop from the left side"); @@ -1182,7 +1182,7 @@ static void rna_def_strip_transform(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "SequenceTransform", NULL); RNA_def_struct_ui_text(srna, "Sequence Transform", "Transform parameters for a sequence strip"); RNA_def_struct_sdna(srna, "StripTransform"); @@ -1222,16 +1222,16 @@ static void rna_def_strip_proxy(BlenderRNA *brna) "changes in framerate or dropouts"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "SequenceProxy", NULL); RNA_def_struct_ui_text(srna, "Sequence Proxy", "Proxy parameters for a sequence strip"); RNA_def_struct_sdna(srna, "StripProxy"); - + prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "dir"); RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceProxy_update"); - + prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_ui_text(prop, "Path", "Location of custom proxy file"); RNA_def_property_string_funcs(prop, "rna_Sequence_proxy_filepath_get", "rna_Sequence_proxy_filepath_length", @@ -1464,7 +1464,7 @@ static void rna_def_sequence(BlenderRNA *brna) {SEQ_TYPE_COLORMIX, "COLORMIX", 0, "Color Mix", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "Sequence", NULL); RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor"); RNA_def_struct_refine_func(srna, "rna_Sequence_refine"); @@ -1529,7 +1529,7 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_range(prop, 1, MAXFRAME); RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied"); - + prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "start"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -1537,7 +1537,7 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_start_frame_set", NULL); /* overlap tests and calc_seq_disp */ RNA_def_property_editable_func(prop, "rna_Sequence_frame_editable"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "frame_final_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "startdisp"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -1579,14 +1579,14 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "Start Still", ""); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); - + prop = RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "endstill"); // RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */ RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "End Still", ""); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update"); - + prop = RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "machine"); RNA_def_property_range(prop, 1, MAXSEQ); @@ -1606,14 +1606,14 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_enum_items(prop, blend_mode_items); RNA_def_property_ui_text(prop, "Blend Mode", "Method for controlling how the strip combines with other strips"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "blend_alpha", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Blend Opacity", "Percentage of how much the strip's colors affect other strips"); /* stupid 0-100 -> 0-1 */ RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); @@ -1627,7 +1627,7 @@ static void rna_def_sequence(BlenderRNA *brna) "Fade effect using the built-in default (usually make transition as long as " "effect strip)"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "speed_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "speed_fader"); @@ -1679,7 +1679,7 @@ static void rna_def_editor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Meta Stack", "Meta strip stack, last is currently edited meta strip"); RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_SequenceEditor_meta_stack_get", NULL, NULL, NULL, NULL); - + prop = RNA_def_property(srna, "active_strip", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act_seq"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -1884,7 +1884,7 @@ static void rna_def_image(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "ImageSequence", "Sequence"); RNA_def_struct_ui_text(srna, "Image Sequence", "Sequence strip to load one or more images"); RNA_def_struct_sdna(srna, "Sequence"); @@ -1931,7 +1931,7 @@ static void rna_def_meta(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "MetaSequence", "Sequence"); RNA_def_struct_ui_text(srna, "Meta Sequence", "Sequence strip to group other strips as a single sequence strip"); RNA_def_struct_sdna(srna, "Sequence"); @@ -1950,7 +1950,7 @@ static void rna_def_scene(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "SceneSequence", "Sequence"); RNA_def_struct_ui_text(srna, "Scene Sequence", "Sequence strip to used the rendered image of a scene"); RNA_def_struct_sdna(srna, "Sequence"); @@ -2057,7 +2057,7 @@ static void rna_def_movieclip(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "MovieClipSequence", "Sequence"); RNA_def_struct_ui_text(srna, "MovieClip Sequence", "Sequence strip to load a video from the clip editor"); RNA_def_struct_sdna(srna, "Sequence"); @@ -2101,7 +2101,7 @@ static void rna_def_sound(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "SoundSequence", "Sequence"); RNA_def_struct_ui_text(srna, "Sound Sequence", "Sequence strip defining a sound to be played over a period of time"); @@ -2140,7 +2140,7 @@ static void rna_def_sound(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_AUDIO_DRAW_WAVEFORM); RNA_def_property_ui_text(prop, "Draw Waveform", "Whether to draw the sound's waveform"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL); - + rna_def_input(srna); } @@ -2160,7 +2160,7 @@ static void rna_def_effect(BlenderRNA *brna) static void rna_def_multicam(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "multicam_source", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "multicam_source"); RNA_def_property_range(prop, 0, MAXSEQ - 1); @@ -2173,7 +2173,7 @@ static void rna_def_multicam(StructRNA *srna) static void rna_def_wipe(StructRNA *srna) { PropertyRNA *prop; - + static const EnumPropertyItem wipe_type_items[] = { {0, "SINGLE", 0, "Single", ""}, {1, "DOUBLE", 0, "Double", ""}, @@ -2209,7 +2209,7 @@ static void rna_def_wipe(StructRNA *srna) RNA_def_property_enum_items(prop, wipe_direction_items); RNA_def_property_ui_text(prop, "Direction", "Wipe direction"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "wipetype"); RNA_def_property_enum_items(prop, wipe_type_items); @@ -2223,37 +2223,37 @@ static void rna_def_glow(StructRNA *srna) PropertyRNA *prop; RNA_def_struct_sdna_from(srna, "GlowVars", "effectdata"); - + prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fMini"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fClamp"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Clamp", "Brightness limit of intensity"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fBoost"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "blur_radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dDist"); RNA_def_property_range(prop, 0.5f, 20.0f); RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dQuality"); RNA_def_property_range(prop, 1, 5); RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "use_only_boost", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0); RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only"); @@ -2284,43 +2284,43 @@ static void rna_def_transform(StructRNA *srna) RNA_def_property_ui_text(prop, "Scale X", "Amount to scale the input in the X axis"); RNA_def_property_ui_range(prop, 0, 10, 3, 6); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "ScaleyIni"); RNA_def_property_ui_text(prop, "Scale Y", "Amount to scale the input in the Y axis"); RNA_def_property_ui_range(prop, 0, 10, 3, 6); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "use_uniform_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uniform_scale", 0); RNA_def_property_ui_text(prop, "Uniform Scale", "Scale uniformly, preserving aspect ratio"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xIni"); RNA_def_property_ui_text(prop, "Translate X", "Amount to move the input on the X axis"); RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yIni"); RNA_def_property_ui_text(prop, "Translate Y", "Amount to move the input on the Y axis"); RNA_def_property_ui_range(prop, -4000.0f, 4000.0f, 3, 6); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rotIni"); RNA_def_property_range(prop, -360.0f, 360.0f); RNA_def_property_ui_text(prop, "Rotation", "Degrees to rotate the input"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "percent"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */ RNA_def_property_enum_items(prop, translation_unit_items); RNA_def_property_ui_text(prop, "Translation Unit", "Unit of measure to translate the input"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, interpolation_items); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); /* not meant to be animated */ @@ -2352,7 +2352,7 @@ static void rna_def_speed_control(StructRNA *srna) RNA_def_property_ui_text(prop, "Multiply Speed", "Multiply the resulting speed after the speed factor"); RNA_def_property_ui_range(prop, 0.0f, 100.0f, 1, -1); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - + prop = RNA_def_property(srna, "use_as_speed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SEQ_SPEED_INTEGRATE); RNA_def_property_ui_text(prop, "Use as speed", "Interpret the value as speed instead of a frame number"); diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index d447d2972f6..da8b19a1ff6 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -74,7 +74,7 @@ static void rna_Sequence_update_rnafunc(ID *id, Sequence *self, int do_data) static void rna_Sequence_swap_internal(Sequence *seq_self, ReportList *reports, Sequence *seq_other) { const char *error_msg; - + if (BKE_sequence_swap(seq_self, seq_other, &error_msg) == 0) BKE_report(reports, RPT_ERROR, error_msg); } diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index b860ad303f0..52550a9b8cc 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -241,7 +241,7 @@ static void rna_SmokeModifier_density_grid_get(PointerRNA *ptr, float *values) float *density; BLI_rw_mutex_lock(sds->fluid_mutex, THREAD_LOCK_READ); - + if (sds->flags & MOD_SMOKE_HIGHRES && sds->wt) density = smoke_turbulence_get_density(sds->wt); else @@ -324,12 +324,12 @@ static void rna_SmokeModifier_flame_grid_get(PointerRNA *ptr, float *values) float *flame; BLI_rw_mutex_lock(sds->fluid_mutex, THREAD_LOCK_READ); - + if (sds->flags & MOD_SMOKE_HIGHRES && sds->wt) flame = smoke_turbulence_get_flame(sds->wt); else flame = smoke_get_flame(sds->fluid); - + if (flame) memcpy(values, flame, size * sizeof(float)); else @@ -971,7 +971,7 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, -10, 10, 1, 1); RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); - + prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "psys"); RNA_def_property_struct_type(prop, "ParticleSystem"); diff --git a/source/blender/makesrna/intern/rna_test.c b/source/blender/makesrna/intern/rna_test.c index 46299799966..f6d38c309f3 100644 --- a/source/blender/makesrna/intern/rna_test.c +++ b/source/blender/makesrna/intern/rna_test.c @@ -150,7 +150,7 @@ void RNA_def_test(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idarr_get_length", "rna_Test_idarr_set_length"); RNA_def_property_int_funcs(prop, "rna_Test_idarr_get", "rna_Test_idarr_set", NULL); - + prop = RNA_def_boolean_array(srna, "bdarr", DYNAMIC_ARRAY_SIZE, NULL, "bdarr", "boolean array"); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdarr_get_length", "rna_Test_bdarr_set_length"); diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index 474fc3e5dc7..1035a3f7f55 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -131,10 +131,10 @@ static void rna_def_text_line(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "TextLine", NULL); RNA_def_struct_ui_text(srna, "Text Line", "Line of text in a Text data-block"); - + prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_TextLine_body_get", "rna_TextLine_body_length", "rna_TextLine_body_set"); RNA_def_property_ui_text(prop, "Line", "Text in the line"); @@ -146,12 +146,12 @@ static void rna_def_text(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "Text", "ID"); RNA_def_struct_ui_text(srna, "Text", "Text data-block referencing an external or packed text file"); RNA_def_struct_ui_icon(srna, ICON_TEXT); RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); - + prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_Text_filename_get", "rna_Text_filename_length", "rna_Text_filename_set"); RNA_def_property_ui_text(prop, "File Path", "Filename of the text file"); @@ -170,7 +170,7 @@ static void rna_def_text(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISMEM); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Memory", "Text file is in memory, without a corresponding file on disk"); - + prop = RNA_def_property(srna, "use_module", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", TXT_ISSCRIPT); RNA_def_property_ui_text(prop, "Register", @@ -183,7 +183,7 @@ static void rna_def_text(BlenderRNA *brna) prop = RNA_def_property(srna, "lines", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "TextLine"); RNA_def_property_ui_text(prop, "Lines", "Lines of text"); - + prop = RNA_def_property(srna, "current_line", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "curl"); @@ -197,7 +197,7 @@ static void rna_def_text(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Current Character", "Index of current character in current line, and also start index of " "character in selection if one exists"); - + prop = RNA_def_property(srna, "current_line_index", PROP_INT, PROP_NONE); RNA_def_property_int_funcs(prop, "rna_Text_current_line_index_get", "rna_Text_current_line_index_set", NULL); RNA_def_property_ui_text(prop, "Current Line Index", "Index of current TextLine in TextLine collection"); @@ -209,13 +209,13 @@ static void rna_def_text(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "TextLine"); RNA_def_property_ui_text(prop, "Selection End Line", "End line of selection"); - + prop = RNA_def_property(srna, "select_end_character", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "selc"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Selection End Character", "Index of character after end of selection in the selection end line"); - + RNA_api_text(srna); } diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 39674724889..b20f489af55 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -194,7 +194,7 @@ static void rna_Color_mapping_update(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Tex *tex = ptr->id.data; - + tex->vd->ok = 0; rna_Texture_update(bmain, scene, ptr); } @@ -202,7 +202,7 @@ static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA * static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Tex *tex = ptr->id.data; - + if (tex->ima) { /* may be getting cleared too */ tex->ima->source = IMA_SRC_SEQUENCE; } @@ -222,7 +222,7 @@ static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_Texture_type_set(PointerRNA *ptr, int value) { Tex *tex = (Tex *)ptr->data; - + BKE_texture_type_set(tex, value); } @@ -276,7 +276,7 @@ void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) char *rna_TextureSlot_path(PointerRNA *ptr) { MTex *mtex = ptr->data; - + /* 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 @@ -303,7 +303,7 @@ char *rna_TextureSlot_path(PointerRNA *ptr) } } } - + /* this is a compromise for the remaining cases... */ if (mtex->tex) { char name_esc[(sizeof(mtex->tex->id.name) - 2) * 2]; @@ -322,7 +322,7 @@ static int rna_TextureSlot_name_length(PointerRNA *ptr) if (mtex->tex) return strlen(mtex->tex->id.name + 2); - + return 0; } @@ -341,7 +341,7 @@ static int rna_TextureSlot_output_node_get(PointerRNA *ptr) MTex *mtex = ptr->data; Tex *tex = mtex->tex; int cur = mtex->which_output; - + if (tex) { bNodeTree *ntree = tex->nodetree; bNode *node; @@ -354,7 +354,7 @@ static int rna_TextureSlot_output_node_get(PointerRNA *ptr) } } } - + mtex->which_output = 0; return 0; } @@ -368,18 +368,18 @@ static const EnumPropertyItem *rna_TextureSlot_output_node_itemf( Tex *tex = mtex->tex; EnumPropertyItem *item = NULL; int totitem = 0; - + if (tex) { bNodeTree *ntree = tex->nodetree; if (ntree) { EnumPropertyItem tmp = {0, "", 0, "", ""}; bNode *node; - + tmp.value = 0; tmp.name = "Not Specified"; tmp.identifier = "NOT_SPECIFIED"; RNA_enum_item_add(&item, &totitem, &tmp); - + for (node = ntree->nodes.first; node; node = node->next) { if (node->type == TEX_NODE_OUTPUT) { tmp.value = node->custom1; @@ -390,7 +390,7 @@ static const EnumPropertyItem *rna_TextureSlot_output_node_itemf( } } } - + RNA_enum_item_end(&item, &totitem); *r_free = true; @@ -411,14 +411,14 @@ static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value) static void rna_Texture_use_nodes_update(bContext *C, PointerRNA *ptr) { Tex *tex = (Tex *)ptr->data; - + if (tex->use_nodes) { tex->type = 0; - + if (tex->nodetree == NULL) ED_node_texture_default(C, tex); } - + rna_Texture_nodes_update(CTX_data_main(C), CTX_data_scene(C), ptr); } @@ -489,7 +489,7 @@ static void rna_def_texmapping(BlenderRNA *brna) {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_vect_type_items[] = { {TEXMAP_TYPE_TEXTURE, "TEXTURE", 0, "Texture", "Transform a texture by inverse mapping the texture coordinate"}, {TEXMAP_TYPE_POINT, "POINT", 0, "Point", "Transform a point"}, @@ -508,7 +508,7 @@ static void rna_def_texmapping(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "TexMapping", NULL); RNA_def_struct_ui_text(srna, "Texture Mapping", "Texture coordinate mapping settings"); @@ -523,34 +523,34 @@ static void rna_def_texmapping(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); - + /* Not PROP_XYZ, this is now in radians, no more degrees */ prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Rotation", ""); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); - + prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_flag(prop, PROP_PROPORTIONAL); RNA_def_property_ui_text(prop, "Scale", ""); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); - + prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping"); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); - + prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping"); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); - + prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN); RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value"); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); - + prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX); RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value"); @@ -561,13 +561,13 @@ static void rna_def_texmapping(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_xyz_mapping_items); RNA_def_property_ui_text(prop, "X Mapping", ""); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); - + prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "projy"); RNA_def_property_enum_items(prop, prop_xyz_mapping_items); RNA_def_property_ui_text(prop, "Y Mapping", ""); RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); - + prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "projz"); RNA_def_property_enum_items(prop, prop_xyz_mapping_items); @@ -584,7 +584,7 @@ static void rna_def_colormapping(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "ColorMapping", NULL); RNA_def_struct_ui_text(srna, "Color Mapping", "Color mapping settings"); @@ -639,7 +639,7 @@ static void rna_def_mtex(BlenderRNA *brna) {0, "DUMMY", 0, "Dummy", ""}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "TextureSlot", NULL); RNA_def_struct_sdna(srna, "MTex"); RNA_def_struct_ui_text(srna, "Texture Slot", "Texture slot defining the mapping and influence of a texture"); @@ -708,7 +708,7 @@ static void rna_def_mtex(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Default Value", "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard"); RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); - + prop = RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "which_output"); RNA_def_property_enum_items(prop, output_node_items); @@ -720,24 +720,24 @@ static void rna_def_mtex(BlenderRNA *brna) static void rna_def_filter_common(StructRNA *srna) { PropertyRNA *prop; - + prop = RNA_def_property(srna, "use_mipmap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP); RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set"); RNA_def_property_ui_text(prop, "MIP Map", "Use auto-generated MIP maps for the image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "use_mipmap_gauss", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP); RNA_def_property_ui_text(prop, "MIP Map Gaussian filter", "Use Gauss filter to sample down MIP maps"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texfilter"); RNA_def_property_enum_items(prop, texture_filter_items); RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "afmax"); RNA_def_property_range(prop, 1, 256); @@ -745,7 +745,7 @@ static void rna_def_filter_common(StructRNA *srna) "Maximum number of samples (higher gives less blur at distant/oblique angles, " "but is also slower)"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "afmax"); RNA_def_property_range(prop, 1, 256); @@ -778,7 +778,7 @@ static void rna_def_environment_map(BlenderRNA *brna) {ENV_LOAD, "IMAGE_FILE", 0, "Image File", "Load a saved environment map image from disk"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem prop_mapping_items[] = { {ENV_CUBE, "CUBE", 0, "Cube", "Use environment map with six cube sides"}, {ENV_PLANE, "PLANE", 0, "Plane", "Only one side is rendered, with Z axis pointing in direction of image"}, @@ -789,7 +789,7 @@ static void rna_def_environment_map(BlenderRNA *brna) RNA_def_struct_sdna(srna, "EnvMap"); RNA_def_struct_ui_text(srna, "EnvironmentMap", "Environment map created by the renderer and cached for subsequent renders"); - + prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "stype"); RNA_def_property_enum_items(prop, prop_source_items); @@ -801,7 +801,7 @@ static void rna_def_environment_map(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Viewpoint Object", "Object to use as the environment map's viewpoint location"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_mapping_items); @@ -835,7 +835,7 @@ static void rna_def_environment_map(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Ignore Layers", "Hide objects on these layers when generating the Environment Map"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "cuberes"); RNA_def_property_range(prop, 50, 4096); @@ -1064,7 +1064,7 @@ static void rna_def_texture_marble(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_marble_stype); RNA_def_property_ui_text(prop, "Pattern", ""); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); - + prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); @@ -1172,7 +1172,7 @@ static void rna_def_texture_stucci(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); @@ -1383,7 +1383,7 @@ static void rna_def_texture_environment_map(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", "Source image file to read the environment map from"); RNA_def_property_update(prop, 0, "rna_Envmap_update_generic"); - + prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", @@ -1391,7 +1391,7 @@ static void rna_def_texture_environment_map(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Texture_update"); rna_def_filter_common(srna); - + prop = RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "env"); RNA_def_property_struct_type(prop, "EnvironmentMap"); @@ -1522,19 +1522,19 @@ static void rna_def_texture_voronoi(BlenderRNA *brna) RNA_def_property_range(prop, -2, 2); RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vn_w2"); RNA_def_property_range(prop, -2, 2); RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vn_w3"); RNA_def_property_range(prop, -2, 2); RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vn_w4"); RNA_def_property_range(prop, -2, 2); @@ -1625,21 +1625,21 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem point_source_items[] = { {TEX_PD_PSYS, "PARTICLE_SYSTEM", 0, "Particle System", "Generate point density from a particle system"}, {TEX_PD_OBJECT, "OBJECT", 0, "Object Vertices", "Generate point density from an object's vertices"}, /*{TEX_PD_FILE, "FILE", 0, "File", ""}, */ {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem particle_cache_items[] = { {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Emit Object Location", ""}, {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Emit Object Space", ""}, {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0, "Global Space", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem vertex_cache_items[] = { {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Object Location", ""}, {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Object Space", ""}, @@ -1657,7 +1657,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) {TEX_PD_FALLOFF_PARTICLE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem particle_color_source_items[] = { {TEX_PD_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""}, {TEX_PD_COLOR_PARTAGE, "PARTICLE_AGE", 0, "Particle Age", "Lifetime mapped as 0.0 - 1.0 intensity"}, @@ -1666,7 +1666,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) {TEX_PD_COLOR_PARTVEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "XYZ velocity mapped to RGB colors"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem vertex_color_source_items[] = { {TEX_PD_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""}, {TEX_PD_COLOR_VERTCOL, "VERTEX_COLOR", 0, "Vertex Color", "Vertex color layer"}, @@ -1674,7 +1674,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) {TEX_PD_COLOR_VERTNOR, "VERTEX_NORMAL", 0, "Vertex Normal", "XYZ normal vector mapped to RGB colors"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem turbulence_influence_items[] = { {TEX_PD_NOISE_STATIC, "STATIC", 0, "Static", "Noise patterns will remain unchanged, faster and suitable for stills"}, @@ -1685,90 +1685,90 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) {TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "PointDensity", NULL); RNA_def_struct_sdna(srna, "PointDensity"); RNA_def_struct_ui_text(srna, "PointDensity", "Point density settings"); RNA_def_struct_path_func(srna, "rna_PointDensity_path"); - + prop = RNA_def_property(srna, "point_source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "source"); RNA_def_property_enum_items(prop, point_source_items); RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_ui_text(prop, "Object", "Object to take point data from"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points"); RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_pointer_funcs(prop, "rna_PointDensity_psys_get", "rna_PointDensity_psys_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "particle_cache_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space"); RNA_def_property_enum_items(prop, particle_cache_items); RNA_def_property_ui_text(prop, "Particle Cache", "Coordinate system to cache particles in"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "vertex_cache_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space"); RNA_def_property_enum_items(prop, vertex_cache_items); RNA_def_property_ui_text(prop, "Vertices Cache", "Coordinate system to cache vertices in"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "radius"); RNA_def_property_range(prop, 0.001, FLT_MAX); RNA_def_property_ui_text(prop, "Radius", "Radius from the shaded sample to look for points within"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "falloff_type"); RNA_def_property_enum_items(prop, falloff_items); RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "falloff_soft", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "falloff_softness"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_text(prop, "Softness", "Softness of the 'soft' falloff option"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "particle_color_source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "color_source"); RNA_def_property_enum_items(prop, particle_color_source_items); RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "vertex_color_source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ob_color_source"); RNA_def_property_enum_items(prop, vertex_color_source_items); RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "vertex_attribute_name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Vertex Attribute Name", "Vertex attribute to use for color"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "speed_scale"); RNA_def_property_range(prop, 0.001, 100.0); RNA_def_property_ui_text(prop, "Scale", "Multiplier to bring particle speed within an acceptable range"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "falloff_speed_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "falloff_speed_scale"); RNA_def_property_range(prop, 0.001, 100.0); RNA_def_property_ui_text(prop, "Velocity Scale", "Multiplier to bring particle speed within an acceptable range"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "coba"); RNA_def_property_struct_type(prop, "ColorRamp"); @@ -1780,7 +1780,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_struct_type(prop, "CurveMapping"); RNA_def_property_ui_text(prop, "Falloff Curve", ""); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "use_falloff_curve", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_FALLOFF_CURVE); RNA_def_property_ui_text(prop, "Falloff Curve", "Use a custom falloff curve"); @@ -1791,31 +1791,31 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE); RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "turbulence_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noise_size"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "noise_fac"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_text(prop, "Turbulence Strength", "Strength of the added turbulent noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noise_depth"); RNA_def_property_range(prop, 0, 30); RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noise_influence"); RNA_def_property_enum_items(prop, turbulence_influence_items); RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noise_basis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); @@ -1826,7 +1826,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) srna = RNA_def_struct(brna, "PointDensityTexture", "Texture"); RNA_def_struct_sdna(srna, "Tex"); RNA_def_struct_ui_text(srna, "Point Density", "Settings for the Point Density texture"); - + prop = RNA_def_property(srna, "point_density", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pd"); RNA_def_property_struct_type(prop, "PointDensity"); @@ -1838,7 +1838,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem interpolation_type_items[] = { {TEX_VD_NEARESTNEIGHBOR, "NEREASTNEIGHBOR", 0, "Nearest Neighbor", "No interpolation, fast but blocky and low quality"}, @@ -1860,7 +1860,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) {TEX_VD_HAIR, "HAIR", 0, "Hair", "Render voxels from a Blender hair simulation"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem voxeldata_extension[] = { {TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"}, {TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and set exterior pixels as transparent"}, @@ -1888,7 +1888,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) RNA_def_struct_sdna(srna, "VoxelData"); RNA_def_struct_ui_text(srna, "VoxelData", "Voxel data settings"); RNA_def_struct_path_func(srna, "rna_VoxelData_path"); - + prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "interp_type"); RNA_def_property_enum_items(prop, interpolation_type_items); @@ -1900,77 +1900,77 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) RNA_def_property_enum_items(prop, smoked_type_items); RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture"); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - + prop = RNA_def_property(srna, "hair_data_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "hair_type"); RNA_def_property_enum_items(prop, hair_type_items); RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture"); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - + prop = RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "extend"); RNA_def_property_enum_items(prop, voxeldata_extension); RNA_def_property_ui_text(prop, "Extension", "How the texture is extrapolated past its original bounds"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "int_multiplier"); RNA_def_property_range(prop, 0.01, FLT_MAX); RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "file_format"); RNA_def_property_enum_items(prop, file_format_items); RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render"); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - + prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "source_path"); RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use"); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - + prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resol"); RNA_def_property_range(prop, 1, 100000); RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid"); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - + prop = RNA_def_property(srna, "use_still_frame", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL); RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence"); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - + prop = RNA_def_property(srna, "still_frame", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "still_frame"); RNA_def_property_range(prop, -MAXFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use"); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - + prop = RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - + srna = RNA_def_struct(brna, "VoxelDataTexture", "Texture"); RNA_def_struct_sdna(srna, "Tex"); RNA_def_struct_ui_text(srna, "Voxel Data", "Settings for the Voxel Data texture"); - + prop = RNA_def_property(srna, "voxel_data", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "vd"); RNA_def_property_struct_type(prop, "VoxelData"); RNA_def_property_ui_text(prop, "Voxel Data", "The voxel data associated with this texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ima"); RNA_def_property_struct_type(prop, "Image"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", ""); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_image_update"); - + prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", @@ -1982,7 +1982,7 @@ static void rna_def_texture_ocean(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem ocean_output_items[] = { {TEX_OCN_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Output XYZ displacement in RGB channels"}, /*{TEX_OCN_NORMALS, "NORMALS", 0, "Normals", "Outputs wave normals"}, *//* these are in nor channel now */ @@ -1992,12 +1992,12 @@ static void rna_def_texture_ocean(BlenderRNA *brna) {TEX_OCN_EPLUS, "EPLUS", 0, "Eigenvectors (+)", "Positive Eigenvectors"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "OceanTexData", NULL); RNA_def_struct_sdna(srna, "OceanTex"); RNA_def_struct_ui_text(srna, "Ocean", "Ocean Texture settings"); RNA_def_struct_path_func(srna, "rna_OceanTex_path"); - + prop = RNA_def_property(srna, "output", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "output"); RNA_def_property_enum_items(prop, ocean_output_items); @@ -2010,11 +2010,11 @@ static void rna_def_texture_ocean(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Modifier Object", "Object containing the ocean modifier"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + srna = RNA_def_struct(brna, "OceanTexture", "Texture"); RNA_def_struct_sdna(srna, "Tex"); RNA_def_struct_ui_text(srna, "Ocean", "Settings for the Ocean texture"); - + prop = RNA_def_property(srna, "ocean", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ot"); RNA_def_property_struct_type(prop, "OceanTexData"); @@ -2045,7 +2045,7 @@ static void rna_def_texture(BlenderRNA *brna) RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TEX_NO_CLAMP); RNA_def_property_ui_text(prop, "Clamp", "Set negative texture RGB and intensity values to zero, for some uses like displacement this option can be disabled to get the full range"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND); RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set"); @@ -2073,44 +2073,44 @@ static void rna_def_texture(BlenderRNA *brna) RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "Saturation", "Adjust the saturation of colors in the texture"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + /* RGB Factor */ prop = RNA_def_property(srna, "factor_red", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rfac"); RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "Factor Red", ""); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "factor_green", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "gfac"); RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "Factor Green", ""); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + prop = RNA_def_property(srna, "factor_blue", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bfac"); RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "Factor Blue", ""); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + /* Alpha for preview render */ prop = RNA_def_property(srna, "use_preview_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PRV_ALPHA); RNA_def_property_ui_text(prop, "Show Alpha", "Show Alpha in Preview Render"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - + /* nodetree */ prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture"); RNA_def_property_update(prop, 0, "rna_Texture_use_nodes_update"); - + prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures"); RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); - + rna_def_animdata_common(srna); /* specific types */ diff --git a/source/blender/makesrna/intern/rna_texture_api.c b/source/blender/makesrna/intern/rna_texture_api.c index a8fcf0ca3b6..615d435f72e 100644 --- a/source/blender/makesrna/intern/rna_texture_api.c +++ b/source/blender/makesrna/intern/rna_texture_api.c @@ -61,7 +61,7 @@ static void clear_envmap(struct EnvMap *env, bContext *C) Tex *tex; BKE_texture_envmap_free_data(env); - + for (tex = bmain->tex.first; tex; tex = tex->id.next) if (tex->env == env) { WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, tex); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index f0b6f8d5423..7f9a63cc6d1 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -93,7 +93,7 @@ static ARegionType *region_type_find(ReportList *reports, int space_type, int re if (art->regionid == region_type) break; } - + /* region type not found? abort */ if (art == NULL) { BKE_report(reports, RPT_ERROR, "Region not found in space type"); @@ -175,7 +175,7 @@ static void rna_Panel_unregister(Main *UNUSED(bmain), StructRNA *type) return; if (!(art = region_type_find(NULL, pt->space_type, pt->region_type))) return; - + RNA_struct_free_extension(type, &pt->ext); RNA_struct_free(&BLENDER_RNA, type); @@ -205,7 +205,7 @@ static StructRNA *rna_Panel_register( /* validate the python class */ if (validate(&dummyptr, data, have_function) != 0) return NULL; - + if (strlen(identifier) >= sizeof(dummypt.idname)) { BKE_reportf(reports, RPT_ERROR, "Registering panel class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(dummypt.idname)); @@ -236,7 +236,7 @@ static StructRNA *rna_Panel_register( if (!RNA_struct_bl_idname_ok_or_report(reports, dummypt.idname, "_PT_")) { return NULL; } - + /* create a new panel type */ pt = MEM_callocN(sizeof(PanelType), "python buttons panel"); memcpy(pt, &dummypt, sizeof(dummypt)); @@ -269,7 +269,7 @@ static StructRNA *rna_Panel_register( /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); - + return pt->ext.srna; } @@ -563,7 +563,7 @@ static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type) return; if (!(art = region_type_find(NULL, ht->space_type, RGN_TYPE_HEADER))) return; - + RNA_struct_free_extension(type, &ht->ext); RNA_struct_free(&BLENDER_RNA, type); @@ -614,7 +614,7 @@ static StructRNA *rna_Header_register( if (!RNA_struct_bl_idname_ok_or_report(reports, dummyht.idname, "_HT_")) { return NULL; } - + /* create a new header type */ ht = MEM_callocN(sizeof(HeaderType), "python buttons header"); memcpy(ht, &dummyht, sizeof(dummyht)); @@ -631,7 +631,7 @@ static StructRNA *rna_Header_register( /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); - + return ht->ext.srna; } @@ -692,7 +692,7 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type) if (!mt) return; - + RNA_struct_free_extension(type, &mt->ext); RNA_struct_free(&BLENDER_RNA, type); @@ -726,7 +726,7 @@ static StructRNA *rna_Menu_register( /* validate the python class */ if (validate(&dummymtr, data, have_function) != 0) return NULL; - + if (strlen(identifier) >= sizeof(dummymt.idname)) { BKE_reportf(reports, RPT_ERROR, "Registering menu class: '%s' is too long, maximum length is %d", identifier, (int)sizeof(dummymt.idname)); @@ -744,7 +744,7 @@ static StructRNA *rna_Menu_register( if (!RNA_struct_bl_idname_ok_or_report(reports, dummymt.idname, "_MT_")) { return NULL; } - + /* create a new menu type */ if (_menu_descr[0]) { description_size = strlen(_menu_descr) + 1; @@ -777,7 +777,7 @@ static StructRNA *rna_Menu_register( /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); - + return mt->ext.srna; } @@ -903,7 +903,7 @@ static void rna_def_ui_layout(BlenderRNA *brna) {UI_LAYOUT_ALIGN_RIGHT, "RIGHT", 0, "Right", ""}, {0, NULL, 0, NULL, NULL} }; - + /* layout */ srna = RNA_def_struct(brna, "UILayout", NULL); @@ -912,15 +912,15 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_active_get", "rna_UILayout_active_set"); - + prop = RNA_def_property(srna, "operator_context", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_operator_context_items); RNA_def_property_enum_funcs(prop, "rna_UILayout_op_context_get", "rna_UILayout_op_context_set", NULL); - + prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set"); RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is grayed out"); - + prop = RNA_def_property(srna, "alert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_alert_get", "rna_UILayout_alert_set"); @@ -936,7 +936,7 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL); RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout"); - + prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL); RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout"); @@ -949,7 +949,7 @@ static void rna_def_panel(BlenderRNA *brna) PropertyRNA *prop; PropertyRNA *parm; FunctionRNA *func; - + static const EnumPropertyItem panel_flag_items[] = { {PNL_DEFAULT_CLOSED, "DEFAULT_CLOSED", 0, "Default Closed", "Defines if the panel has to be open or collapsed at the time of its creation"}, @@ -958,7 +958,7 @@ static void rna_def_panel(BlenderRNA *brna) "arrow to collapse the panel and the label (see bl_label)"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "Panel", NULL); RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements"); RNA_def_struct_sdna(srna, "Panel"); @@ -991,11 +991,11 @@ static void rna_def_panel(BlenderRNA *brna) prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "UILayout"); RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI"); - + prop = RNA_def_property(srna, "text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "drawname"); RNA_def_property_ui_text(prop, "Text", "XXX todo"); - + /* registration */ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); @@ -1028,7 +1028,7 @@ static void rna_def_panel(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_space_type_items); RNA_def_property_flag(prop, PROP_REGISTER); RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in"); - + prop = RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->region_type"); RNA_def_property_enum_items(prop, rna_enum_region_type_items); @@ -1041,7 +1041,7 @@ static void rna_def_panel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Context", "The context in which the panel belongs to. (TODO: explain the " "possible combinations bl_context/bl_region_type/bl_space_type)"); - + prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->flag"); RNA_def_property_enum_items(prop, panel_flag_items); @@ -1184,7 +1184,7 @@ static void rna_def_header(BlenderRNA *brna) PropertyRNA *prop; PropertyRNA *parm; FunctionRNA *func; - + srna = RNA_def_struct(brna, "Header", NULL); RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements"); RNA_def_struct_sdna(srna, "Header"); @@ -1231,7 +1231,7 @@ static void rna_def_menu(BlenderRNA *brna) PropertyRNA *prop; PropertyRNA *parm; FunctionRNA *func; - + srna = RNA_def_struct(brna, "Menu", NULL); RNA_def_struct_ui_text(srna, "Menu", "Editor menu containing buttons"); RNA_def_struct_sdna(srna, "Menu"); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index d416e5d755d..35e64805e57 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -480,7 +480,7 @@ void RNA_api_ui_layout(StructRNA *srna) "Sub-layout. Items placed in this sublayout are placed next to each other " "in a row"); RNA_def_boolean(func, "align", false, "", "Align buttons to each other"); - + func = RNA_def_function(srna, "column", "uiLayoutColumn"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); RNA_def_function_return(func, parm); @@ -501,7 +501,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_return(func, parm); RNA_def_function_ui_description(func, "Sublayout (items placed in this sublayout are placed " "under each other in a column and are surrounded by a box)"); - + /* split layout */ func = RNA_def_function(srna, "split", "uiLayoutSplit"); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in"); @@ -689,7 +689,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_pointer(func, "data", "AnyType", "", "Pointer to put in context"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR); - + /* templates */ func = RNA_def_function(srna, "template_header", "uiTemplateHeader"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); @@ -724,7 +724,7 @@ void RNA_api_ui_layout(StructRNA *srna) "Identifier of property in data giving the type of the ID-blocks to use"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); api_ui_item_common_text(func); - + func = RNA_def_function(srna, "template_path_builder", "rna_uiTemplatePathBuilder"); parm = RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); @@ -733,7 +733,7 @@ void RNA_api_ui_layout(StructRNA *srna) parm = RNA_def_pointer(func, "root", "ID", "", "ID-block from which path is evaluated from"); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED | PARM_RNAPTR); api_ui_item_common_text(func); - + func = RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Generates the UI layout for modifiers"); @@ -783,15 +783,15 @@ void RNA_api_ui_layout(StructRNA *srna) func = RNA_def_function(srna, "template_histogram", "uiTemplateHistogram"); RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data"); api_ui_item_rna_common(func); - + func = RNA_def_function(srna, "template_waveform", "uiTemplateWaveform"); RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data"); api_ui_item_rna_common(func); - + func = RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope"); RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data"); api_ui_item_rna_common(func); - + func = RNA_def_function(srna, "template_layers", "uiTemplateLayers"); api_ui_item_rna_common(func); parm = RNA_def_pointer(func, "used_layers_data", "AnyType", "", "Data from which to take property"); @@ -800,7 +800,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_int(func, "active_layer", 0, 0, INT_MAX, "Active Layer", "", 0, INT_MAX); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - + func = RNA_def_function(srna, "template_color_picker", "uiTemplateColorPicker"); RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors"); api_ui_item_rna_common(func); @@ -913,7 +913,7 @@ void RNA_api_ui_layout(StructRNA *srna) func = RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Inserts common 3DView Edit modes header UI (selector for selection mode)"); - + func = RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d813c095589..15ebbd02018 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -191,7 +191,7 @@ static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, Point } } } - + rna_userdef_update(bmain, scene, ptr); } @@ -264,7 +264,7 @@ static int rna_userdef_autokeymode_get(PointerRNA *ptr) { UserDef *userdef = (UserDef *)ptr->data; short retval = userdef->autokey_mode; - + if (!(userdef->autokey_mode & AUTOKEY_ON)) retval |= AUTOKEY_ON; @@ -297,10 +297,10 @@ static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value) { UserDef *userdef = (UserDef *)ptr->data; int required_size = userdef->v2d_min_gridsize; - + /* set the timecode style */ userdef->timecode_style = value; - + /* adjust the v2d gridsize if needed so that timecodes don't overlap * NOTE: most of these have been hand-picked to avoid overlaps while still keeping * things from getting too blown out @@ -322,7 +322,7 @@ static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value) required_size = 45; break; } - + if (U.v2d_min_gridsize < required_size) U.v2d_min_gridsize = required_size; } @@ -706,7 +706,7 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem font_kerning_style[] = { {0, "UNFITTED", 0, "Unfitted", "Use scaled but un-grid-fitted kerning distances"}, {1, "FITTED", 0, "Fitted", "Use scaled and grid-fitted kerning distances"}, @@ -717,7 +717,7 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) RNA_def_struct_sdna(srna, "uiFontStyle"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font"); - + prop = RNA_def_property(srna, "points", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 6, 48); RNA_def_property_ui_text(prop, "Points", ""); @@ -733,13 +733,13 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size (0, 3 and 5 supported)"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "shadx"); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "shady"); RNA_def_property_range(prop, -10, 10); @@ -763,14 +763,14 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + rna_def_userdef_theme_ui_font_style(brna); - + srna = RNA_def_struct(brna, "ThemeStyle", NULL); RNA_def_struct_sdna(srna, "uiStyle"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets"); - + prop = RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -785,66 +785,66 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Widget Label Style", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widget"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Widget Style", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + } static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "ThemeWidgetColors", NULL); RNA_def_struct_sdna(srna, "uiWidgetColors"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets"); - + prop = RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Outline", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Inner", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Inner Selected", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Item", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text Selected", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1); RNA_def_property_ui_text(prop, "Shaded", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Top", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Down", ""); @@ -855,12 +855,12 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "ThemeWidgetStateColors", NULL); RNA_def_struct_sdna(srna, "uiWidgetStateColors"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors"); - + prop = RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Animated", ""); @@ -870,7 +870,7 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Animated Selected", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe", ""); @@ -900,20 +900,20 @@ static void rna_def_userdef_theme_ui_panel(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "ThemePanelColors", NULL); RNA_def_struct_sdna(srna, "uiPanelColors"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Panel Color", "Theme settings for panel colors"); - + prop = RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_ui_text(prop, "Header", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_ui_text(prop, "Background", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "show_header", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Show Header", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); @@ -968,22 +968,22 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Regular Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Tool Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Radio Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Text Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Option Widget Colors", ""); @@ -993,32 +993,32 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Toggle Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Number Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Slider Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Box Backdrop Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Menu Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Pulldown Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Menu Backdrop Colors", ""); @@ -1033,7 +1033,7 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Tooltip Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Menu Item Colors", ""); @@ -1043,7 +1043,7 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Scroll Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", ""); @@ -1063,12 +1063,12 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Menu Shadow Strength", "Blending factor for menu shadows"); RNA_def_property_range(prop, 0.01f, 1.0f); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "menu_shadow_width", PROP_INT, PROP_PIXEL); RNA_def_property_ui_text(prop, "Menu Shadow Width", "Width of menu shadows, set to zero to disable"); RNA_def_property_range(prop, 0.0f, 24.0f); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "iconfile"); RNA_def_property_ui_text(prop, "Icon File", ""); @@ -1077,7 +1077,7 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) prop = RNA_def_property(srna, "icon_alpha", PROP_FLOAT, PROP_FACTOR); RNA_def_property_ui_text(prop, "Icon Alpha", "Transparency of icons in the interface, to reduce contrast"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "widget_emboss", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "widget_emboss"); RNA_def_property_array(prop, 4); @@ -1090,13 +1090,13 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "X Axis", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "yaxis"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Y Axis", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "zaxis"); RNA_def_property_array(prop, 3); @@ -1338,7 +1338,7 @@ static void rna_def_userdef_theme_spaces_edge(StructRNA *srna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Edge Sharp", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "edge_crease", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Edge Crease", ""); @@ -1409,7 +1409,7 @@ static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, bool incl_nurbs bool incl_vector, bool incl_verthandle) { PropertyRNA *prop; - + if (incl_nurbs) { prop = RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "nurb_uline"); @@ -1499,7 +1499,7 @@ static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, bool incl_nurbs RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Auto-Clamped handle color", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "handle_sel_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto_clamped"); RNA_def_property_array(prop, 3); @@ -1588,7 +1588,7 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Wire Edit", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + /* Grease Pencil */ @@ -1791,7 +1791,7 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); @@ -1803,19 +1803,19 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channels Region", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "ds_channel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Dope Sheet Channel", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "ds_subchannel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Dope Sheet Sub-Channel", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "group"); RNA_def_property_array(prop, 3); @@ -1827,7 +1827,7 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active Channel Group", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + rna_def_userdef_theme_spaces_vertex(srna); rna_def_userdef_theme_spaces_curves(srna, false, true, true, true); } @@ -1903,33 +1903,33 @@ static void rna_def_userdef_theme_space_console(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ThemeSpace"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console"); - + rna_def_userdef_theme_spaces_main(srna); - + prop = RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "console_output"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Line Output", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "console_input"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Line Input", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "console_info"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Line Info", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "console_error"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Line Error", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "console_cursor"); RNA_def_property_array(prop, 3); @@ -2060,13 +2060,13 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Cursor", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxb"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Built-in", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "syntax_symbols", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxs"); RNA_def_property_array(prop, 3); @@ -2096,7 +2096,7 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Comment", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxl"); RNA_def_property_array(prop, 3); @@ -2124,7 +2124,7 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) rna_def_userdef_theme_spaces_main(srna); rna_def_userdef_theme_spaces_list_main(srna); - + rna_def_userdef_theme_spaces_gpencil(srna); prop = RNA_def_property(srna, "node_selected", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -2168,13 +2168,13 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Node Backdrop", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxv"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Converter Node", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "color_node", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxb"); RNA_def_property_array(prop, 3); @@ -2198,7 +2198,7 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Frame Node", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "matte_node", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "syntaxs"); RNA_def_property_array(prop, 3); @@ -2277,16 +2277,16 @@ static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) { StructRNA *srna; // PropertyRNA *prop; - + /* space_logic */ - + srna = RNA_def_struct(brna, "ThemeLogicEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor"); - + rna_def_userdef_theme_spaces_main(srna); - + } @@ -2330,13 +2330,13 @@ static void rna_def_userdef_theme_space_time(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "time_keyframe", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "time_keyframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe", "Base color for keyframe indicator lines"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "time_grease_pencil", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "time_gp_keyframe"); RNA_def_property_array(prop, 3); @@ -2360,7 +2360,7 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna) rna_def_userdef_theme_spaces_gpencil(srna); rna_def_userdef_theme_spaces_vertex(srna); rna_def_userdef_theme_spaces_face(srna); - + prop = RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 4); @@ -2550,7 +2550,7 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Draw Action", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "preview_back", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "preview_back"); RNA_def_property_array(prop, 3); @@ -2589,13 +2589,13 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "face"); RNA_def_property_array(prop, 3); @@ -2607,21 +2607,21 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "View Sliders", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - - + + prop = RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "ds_channel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Dope Sheet Channel", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "ds_subchannel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Dope Sheet Sub-Channel", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - - + + prop = RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); @@ -2645,8 +2645,8 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active Channel Group", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - - + + prop = RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "strip"); RNA_def_property_array(prop, 3); @@ -2659,76 +2659,76 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Long Key Selected", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - - + + prop = RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keytype_keyframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe", "Color of Keyframe"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keytype_keyframe_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe Selected", "Color of selected keyframe"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_extreme", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keytype_extreme"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Extreme Keyframe", "Color of extreme keyframe"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_extreme_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keytype_extreme_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Extreme Keyframe Selected", "Color of selected extreme keyframe"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_breakdown", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keytype_breakdown"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Breakdown Keyframe", "Color of breakdown keyframe"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_breakdown_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keytype_breakdown_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Breakdown Keyframe Selected", "Color of selected breakdown keyframe"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_jitter", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keytype_jitter"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Jitter Keyframe", "Color of jitter keyframe"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_jitter_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keytype_jitter_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Jitter Keyframe Selected", "Color of selected jitter keyframe"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_border", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keyborder"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Keyframe Border", "Color of keyframe border"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_border_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keyborder_select"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Keyframe Border Selected", "Color of selected keyframe border"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_scale_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "keyframe_scale_fac"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Keyframe Scale Factor", "Scale factor for adjusting the height of keyframes"); RNA_def_property_range(prop, 0.8f, 5.0f); /* Note: These limits prevent buttons overlapping (min), and excessive size... (max) */ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_userdef_update"); - - + + prop = RNA_def_property(srna, "summary", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "anim_active"); RNA_def_property_array(prop, 4); @@ -2760,94 +2760,94 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "View Sliders", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "active_action", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "anim_active"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Active Action", "Animation data-block has active action"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "active_action_unset", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "anim_non_active"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "No Active Action", "Animation data-block doesn't have active action"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "strip"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Strips", "Action-Clip Strip - Unselected"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "strip_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Strips Selected", "Action-Clip Strip - Selected"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "transition_strips", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "nla_transition"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Transitions", "Transition Strip - Unselected"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "transition_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "nla_transition_sel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Transitions Selected", "Transition Strip - Selected"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "meta_strips", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "nla_meta"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Meta Strips", "Meta Strip - Unselected (for grouping related strips)"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "meta_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "nla_meta_sel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Meta Strips Selected", "Meta Strip - Selected (for grouping related strips)"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "sound_strips", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "nla_sound"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Sound Strips", + RNA_def_property_ui_text(prop, "Sound Strips", "Sound Strip - Unselected (for timing speaker sounds)"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "sound_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "nla_sound_sel"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Sound Strips Selected", + RNA_def_property_ui_text(prop, "Sound Strips Selected", "Sound Strip - Selected (for timing speaker sounds)"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "tweak", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "nla_tweaking"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Tweak", "Color for strip/action being 'tweaked' or edited"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "tweak_duplicate", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "nla_tweakdupli"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Tweak Duplicate Flag", + RNA_def_property_ui_text(prop, "Tweak Duplicate Flag", "Warning/error indicator color for strips referencing the strip being tweaked"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_border", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keyborder"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Keyframe Border", "Color of keyframe border"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "keyframe_border_selected", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "keyborder_select"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Keyframe Border Selected", "Color of selected keyframe border"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); @@ -2903,7 +2903,7 @@ static void rna_def_userdef_theme_space_clip(BlenderRNA *brna) rna_def_userdef_theme_spaces_main(srna); rna_def_userdef_theme_spaces_list_main(srna); - + rna_def_userdef_theme_spaces_gpencil(srna); prop = RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -2979,7 +2979,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem active_theme_area[] = { {0, "USER_INTERFACE", ICON_UI, "User Interface", ""}, {19, "STYLE", ICON_FONTPREVIEW, "Text Style", ""}, @@ -3098,7 +3098,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tlogic"); RNA_def_property_struct_type(prop, "ThemeLogicEditor"); RNA_def_property_ui_text(prop, "Logic Editor", ""); - + prop = RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "toops"); @@ -3116,7 +3116,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tuserpref"); RNA_def_property_struct_type(prop, "ThemeUserPreferences"); RNA_def_property_ui_text(prop, "User Preferences", ""); - + prop = RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "tconsole"); @@ -3200,14 +3200,14 @@ static void rna_def_userdef_addon_pref(BlenderRNA *brna) static void rna_def_userdef_dothemes(BlenderRNA *brna) { - + rna_def_userdef_theme_ui_style(brna); rna_def_userdef_theme_ui(brna); rna_def_userdef_theme_space_generic(brna); rna_def_userdef_theme_space_gradient(brna); rna_def_userdef_theme_space_list_generic(brna); - + rna_def_userdef_theme_space_view3d(brna); rna_def_userdef_theme_space_graph(brna); rna_def_userdef_theme_space_file(brna); @@ -3239,7 +3239,7 @@ static void rna_def_userdef_solidlight(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SolidLight"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode"); - + prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode"); @@ -3344,7 +3344,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) PropertyRNA *prop; StructRNA *srna; - + srna = RNA_def_struct(brna, "UserPreferencesView", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); @@ -3421,7 +3421,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO); RNA_def_property_ui_text(prop, "Open On Mouse Over", "Open menu buttons and pulldowns automatically when the mouse is hovering"); - + prop = RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "menuthreshold1"); RNA_def_property_range(prop, 1, 40); @@ -3529,7 +3529,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop = RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION); RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point"); - + /* mini axis */ prop = RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON); @@ -3590,7 +3590,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_range(prop, 4, 10); RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + /* View2D Grid Displays */ prop = RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize"); @@ -3598,7 +3598,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", "Minimum number of pixels between each gridline in 2D Viewports"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + /* TODO: add a setter for this, so that we can bump up the minimum size as necessary... */ prop = RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, timecode_styles); @@ -3635,14 +3635,14 @@ static void rna_def_userdef_edit(BlenderRNA *brna) {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem material_link_items[] = { {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"}, {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem object_align_items[] = { {0, "WORLD", 0, "World", "Align newly added objects to the world coordinate system"}, {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"}, @@ -3654,15 +3654,15 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_struct_nested(brna, srna, "UserPreferences"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data"); - + /* Edit Methods */ - + prop = RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, material_link_items); RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block"); - + prop = RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, object_align_items); @@ -3678,7 +3678,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELEASECONFIRM); RNA_def_property_ui_text(prop, "Release confirms", "Moving things with a mouse drag confirms when releasing the button"); - + /* Undo */ prop = RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "undosteps"); @@ -3721,7 +3721,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_boolean_negative_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_NOWARNING); RNA_def_property_ui_text(prop, "Show Auto Keying Warning", "Show warning indicators when transforming objects and bones if auto keying is enabled"); - + /* keyframing settings */ prop = RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED); @@ -3730,13 +3730,13 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY); RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects"); - + prop = RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB); RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) " "and also Color is based on the transform axis"); - + prop = RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_beztriple_interpolation_mode_items); RNA_def_property_enum_sdna(prop, NULL, "ipo_new"); @@ -3748,7 +3748,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_keyframe_handle_type_items); RNA_def_property_enum_sdna(prop, NULL, "keyhandles_new"); RNA_def_property_ui_text(prop, "New Handles Type", "Handle type for handles of new keyframes"); - + /* frame numbers */ prop = RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES); @@ -3762,7 +3762,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Unselected F-Curve Visibility", "Amount that unselected F-Curves stand out from the background (Graph Editor)"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); - + /* grease pencil */ prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "gp_manhattendist"); @@ -3784,13 +3784,13 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "gp_eraser"); RNA_def_property_range(prop, 1, 500); RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'"); - - + + prop = RNA_def_property(srna, "grease_pencil_default_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "gpencil_new_layer_col"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Grease Pencil Default Color", "Color of new Grease Pencil layers"); - + /* sculpt and paint */ prop = RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -3806,7 +3806,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF); RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object"); - + prop = RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE); RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object"); @@ -3818,7 +3818,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL); RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object"); - + prop = RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM); RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object"); @@ -3834,7 +3834,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX); RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object"); - + /* xxx */ prop = RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO); @@ -3843,7 +3843,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT); RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object"); - + prop = RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS); RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object"); @@ -3939,7 +3939,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) "Do a full redraw each time, slow, only use for reference or when everything else fails"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem color_picker_types[] = { {USER_CP_CIRCLE_HSV, "CIRCLE_HSV", 0, "Circle (HSV)", "A circular Hue/Saturation color wheel, with Value slider"}, {USER_CP_CIRCLE_HSL, "CIRCLE_HSL", 0, "Circle (HSL)", "A circular Hue/Saturation color wheel, with Lightness slider"}, @@ -3948,7 +3948,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) {USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem multi_sample_levels[] = { {USER_MULTISAMPLE_NONE, "NONE", 0, "No MultiSample", "Do not use OpenGL MultiSample"}, {USER_MULTISAMPLE_2, "2", 0, "MultiSample: 2", "Use 2x OpenGL MultiSample (requires restart)"}, @@ -3979,7 +3979,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings"); /* Language */ - + prop = RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE); RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts"); @@ -4072,7 +4072,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "color_picker_type"); RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS); RNA_def_property_ui_text(prop, "Enable All Codecs", @@ -4112,7 +4112,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop = RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP); RNA_def_property_ui_text(prop, "Mipmaps", @@ -4144,7 +4144,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) "Quality of the anisotropic filtering (values greater than 1.0 enable anisotropic " "filtering)"); RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update"); - + prop = RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "glreslimit"); RNA_def_property_enum_items(prop, gl_texture_clamp_items); @@ -4238,7 +4238,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_REGION_OVERLAP); RNA_def_property_ui_text(prop, "Region Overlap", "Draw tool/property regions over the main region, when using Triple Buffer"); - RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); + RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); #ifdef WITH_OPENSUBDIV prop = RNA_def_property(srna, "opensubdiv_compute_type", PROP_ENUM, PROP_NONE); @@ -4297,44 +4297,44 @@ static void rna_def_userdef_input(BlenderRNA *brna) "Zoom in and out like scaling the view, mouse movements relative to center"}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem view_zoom_axes[] = { {0, "VERTICAL", 0, "Vertical", "Zoom in and out based on vertical mouse movement"}, {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zoom in and out based on horizontal mouse movement"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "UserPreferencesInput", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "Input", "Settings for input devices"); - + prop = RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, select_mouse_items); RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL); RNA_def_property_ui_text(prop, "Select Mouse", "Mouse button used for selection"); - + prop = RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "viewzoom"); RNA_def_property_enum_items(prop, view_zoom_styles); RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling"); - + prop = RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag"); RNA_def_property_enum_items(prop, view_zoom_axes); RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on"); - + prop = RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT); RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming"); - + prop = RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, view_rotation_items); RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport"); - + prop = RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE); RNA_def_property_ui_text(prop, "Continuous Grab", @@ -4372,7 +4372,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) prop = RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01f, 40.0f); RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse for panning"); - + prop = RNA_def_property(srna, "ndof_orbit_sensitivity", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01f, 40.0f); RNA_def_property_ui_text(prop, "Orbit Sensitivity", "Overall sensitivity of the 3D Mouse for orbiting"); @@ -4396,7 +4396,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE); RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation"); /* TODO: update description when fly-mode visuals are in place ("projected position in fly mode")*/ - + /* 3D view */ prop = RNA_def_property(srna, "ndof_view_navigate_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "ndof_flag"); @@ -4468,13 +4468,13 @@ static void rna_def_userdef_input(BlenderRNA *brna) prop = RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD); RNA_def_property_ui_text(prop, "Emulate Numpad", "Main 1 to 0 keys act as the numpad ones (useful for laptops)"); - + /* middle mouse button */ prop = RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE); RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning"); - + prop = RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR); RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction"); @@ -4483,7 +4483,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "wheellinescroll"); RNA_def_property_range(prop, 0, 32); RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "Number of lines scrolled at a time with the mouse wheel"); - + prop = RNA_def_property(srna, "use_trackpad_natural", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_TRACKPAD_NATURAL); RNA_def_property_ui_text(prop, "Trackpad Natural", @@ -4498,7 +4498,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) { PropertyRNA *prop; StructRNA *srna; - + static const EnumPropertyItem anim_player_presets[] = { {0, "INTERNAL", 0, "Internal", "Built-in animation player"}, {2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"}, @@ -4508,22 +4508,22 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"}, {0, NULL, 0, NULL, NULL} }; - + srna = RNA_def_struct(brna, "UserPreferencesFilePaths", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files"); - + prop = RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT); RNA_def_property_ui_text(prop, "Hide Dot Files/Data-Blocks", "Hide files/data-blocks that start with a dot (.*)"); - + prop = RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS); RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window"); - + prop = RNA_def_property(srna, "hide_recent_locations", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_RECENT); RNA_def_property_ui_text(prop, "Hide Recent Locations", "Hide recent locations in the file selector"); @@ -4539,7 +4539,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) prop = RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS); RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector"); - + prop = RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS); RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files"); @@ -4591,7 +4591,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) prop = RNA_def_property(srna, "image_editor", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "image_editor"); RNA_def_property_ui_text(prop, "Image Editor", "Path to an image editor"); - + prop = RNA_def_property(srna, "animation_player", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "anim_player"); RNA_def_property_ui_text(prop, "Animation Player", "Path to a custom animation/frame sequence player"); @@ -4600,7 +4600,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "anim_player_preset"); RNA_def_property_enum_items(prop, anim_player_presets); RNA_def_property_ui_text(prop, "Animation Player Preset", "Preset configs for external animation players"); - + /* Autosave */ prop = RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE); @@ -4626,7 +4626,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_KEEP_SESSION); RNA_def_property_ui_text(prop, "Keep Session", "Always load session recovery and save it after quitting Blender"); - + prop = RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 30); RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember"); @@ -4735,7 +4735,7 @@ void RNA_def_userdef(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "uistyles", NULL); RNA_def_property_struct_type(prop, "ThemeStyle"); RNA_def_property_ui_text(prop, "Styles", ""); - + prop = RNA_def_property(srna, "addons", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "addons", NULL); RNA_def_property_struct_type(prop, "Addon"); @@ -4760,25 +4760,25 @@ void RNA_def_userdef(BlenderRNA *brna) RNA_def_property_struct_type(prop, "UserPreferencesEdit"); RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data"); - + prop = RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "UserPreferencesInput"); RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices"); - + prop = RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "UserPreferencesFilePaths"); RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files"); - + prop = RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "UserPreferencesSystem"); RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings"); - + prop = RNA_def_int_vector(srna, "version", 3, NULL, 0, INT_MAX, "Version", "Version of Blender the userpref.blend was saved with", 0, INT_MAX); RNA_def_property_int_funcs(prop, "rna_userdef_version_get", NULL, NULL); @@ -4793,7 +4793,7 @@ void RNA_def_userdef(BlenderRNA *brna) rna_def_userdef_addon(brna); rna_def_userdef_addon_pref(brna); rna_def_userdef_pathcompare(brna); - + } #endif diff --git a/source/blender/makesrna/intern/rna_vfont.c b/source/blender/makesrna/intern/rna_vfont.c index c743751649c..5c42a86c52e 100644 --- a/source/blender/makesrna/intern/rna_vfont.c +++ b/source/blender/makesrna/intern/rna_vfont.c @@ -69,7 +69,7 @@ void RNA_def_vfont(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "VectorFont", "ID"); RNA_def_struct_ui_text(srna, "Vector Font", "Vector font for Text objects"); RNA_def_struct_sdna(srna, "VFont"); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 71e3a0493a3..7c3674c8343 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -482,7 +482,7 @@ static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr) } } } - + return NULL; } @@ -666,7 +666,7 @@ static PointerRNA rna_KeyMapItem_properties_get(PointerRNA *ptr) if (kmi->ptr) return *(kmi->ptr); - + /*return rna_pointer_inherit_refine(ptr, &RNA_OperatorProperties, op->properties); */ return PointerRNA_NULL; } @@ -718,7 +718,7 @@ static void rna_wmKeyMapItem_map_type_set(PointerRNA *ptr, int value) static void rna_wmKeyMapItem_keymodifier_set(PointerRNA *ptr, int value) { wmKeyMapItem *kmi = ptr->data; - + /* XXX, this should really be managed in an _itemf function, * giving a list of valid enums, then silently changing them when they are set is not * a good precedent, don't do this unless you have a good reason! */ @@ -846,7 +846,7 @@ static PointerRNA rna_WindowManager_active_keyconfig_get(PointerRNA *ptr) if (!kc) kc = wm->defaultconf; - + return rna_pointer_inherit_refine(ptr, &RNA_KeyConfig, kc); } @@ -1480,13 +1480,13 @@ static void rna_def_operator(BlenderRNA *brna) RNA_def_property_struct_type(prop, "OperatorProperties"); RNA_def_property_ui_text(prop, "Properties", ""); RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL, NULL); - + prop = RNA_def_property(srna, "has_reports", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* this is 'virtual' property */ RNA_def_property_boolean_funcs(prop, "rna_Operator_has_reports_get", NULL); RNA_def_property_ui_text(prop, "Has Reports", "Operator has a set of reports (warnings and errors) from last execution"); - + prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "UILayout"); @@ -1687,12 +1687,12 @@ static void rna_def_operator_filelist_element(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_ui_text(prop, "Name", "Name of a file or directory within a file list"); } - + static void rna_def_event(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna = RNA_def_struct(brna, "Event", NULL); RNA_def_struct_ui_text(srna, "Event", "Window Manager Event"); RNA_def_struct_sdna(srna, "wmEvent"); @@ -1717,7 +1717,7 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_event_value_items); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Value", "The type of event, only applies to some"); - + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, rna_enum_event_type_items); @@ -1731,7 +1731,7 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "x"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Mouse X Position", "The window relative horizontal location of the mouse"); - + prop = RNA_def_property(srna, "mouse_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "y"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1746,12 +1746,12 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "mval[1]"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Mouse Y Position", "The region relative vertical location of the mouse"); - + prop = RNA_def_property(srna, "mouse_prev_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "prevx"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Mouse Previous X Position", "The window relative horizontal location of the mouse"); - + prop = RNA_def_property(srna, "mouse_prev_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "prevy"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1783,17 +1783,17 @@ static void rna_def_event(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "shift", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Shift", "True when the Shift key is held"); - + prop = RNA_def_property(srna, "ctrl", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ctrl", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Ctrl", "True when the Ctrl key is held"); - + prop = RNA_def_property(srna, "alt", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "alt", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Alt", "True when the Alt/Option key is held"); - + prop = RNA_def_property(srna, "oskey", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "oskey", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1961,7 +1961,7 @@ static void rna_def_wm_keyconfigs(BlenderRNA *brna, PropertyRNA *cprop) "rna_WindowManager_active_keyconfig_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active KeyConfig", "Active key configuration (preset)"); - + prop = RNA_def_property(srna, "default", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "defaultconf"); RNA_def_property_struct_type(prop, "KeyConfig"); @@ -1980,7 +1980,7 @@ static void rna_def_wm_keyconfigs(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_ui_text(prop, "User Key Configuration", "Final key configuration that combines keymaps from the active and add-on configurations, " "and can be edited by the user"); - + RNA_api_keyconfigs(srna); } @@ -2019,7 +2019,7 @@ static void rna_def_windowmanager(BlenderRNA *brna) static void rna_def_keymap_items(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; - + RNA_def_property_srna(cprop, "KeyMapItems"); srna = RNA_def_struct(brna, "KeyMapItems", NULL); RNA_def_struct_sdna(srna, "wmKeyMap"); @@ -2120,7 +2120,7 @@ static void rna_def_keyconfig(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_EXPANDED); RNA_def_property_ui_text(prop, "Items Expanded", "Expanded in the user interface"); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); - + prop = RNA_def_property(srna, "show_expanded_children", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYMAP_CHILDREN_EXPANDED); RNA_def_property_ui_text(prop, "Children Expanded", "Children expanded in the user interface"); @@ -2148,7 +2148,7 @@ static void rna_def_keyconfig(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Name", "Name of operator (translated) to call on input event"); RNA_def_property_string_funcs(prop, "rna_wmKeyMapItem_name_get", "rna_wmKeyMapItem_name_length", NULL); - + prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "OperatorProperties"); RNA_def_property_pointer_funcs(prop, "rna_KeyMapItem_properties_get", NULL, NULL, NULL); diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index c8125615402..8e4e1053af0 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -96,7 +96,7 @@ static int rna_Operator_is_repeat(wmOperator *op, bContext *C) static void rna_Operator_enum_search_invoke(bContext *C, wmOperator *op) { WM_enum_search_invoke(C, op, NULL); - + } static int rna_event_modal_handler_add(struct bContext *C, struct wmOperator *operator) @@ -169,8 +169,9 @@ static int rna_Operator_props_popup(bContext *C, wmOperator *op, wmEvent *event) return WM_operator_props_popup(C, op, event); } -static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, - int any, int shift, int ctrl, int alt, int oskey, int keymodifier, int head) +static wmKeyMapItem *rna_KeyMap_item_new( + wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, + int any, int shift, int ctrl, int alt, int oskey, int keymodifier, int head) { /* wmWindowManager *wm = CTX_wm_manager(C); */ wmKeyMapItem *kmi = NULL; @@ -191,24 +192,25 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons if (oskey) modifier |= KM_OSKEY; if (any) modifier = KM_ANY; - + /* create keymap item */ kmi = WM_keymap_add_item(km, idname_bl, type, value, modifier, keymodifier); - - /* [#32437] allow scripts to define hotkeys that get added to start of keymap + + /* [#32437] allow scripts to define hotkeys that get added to start of keymap * so that they stand a chance against catch-all defines later on */ if (head) { BLI_remlink(&km->items, kmi); BLI_addhead(&km->items, kmi); } - + return kmi; } -static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, ReportList *reports, const char *propvalue_str, - int type, int value, int any, int shift, int ctrl, int alt, - int oskey, int keymodifier) +static wmKeyMapItem *rna_KeyMap_item_new_modal( + wmKeyMap *km, ReportList *reports, const char *propvalue_str, + int type, int value, int any, int shift, int ctrl, int alt, + int oskey, int keymodifier) { int modifier = 0; int propvalue = 0; @@ -591,7 +593,7 @@ void RNA_api_operator(StructRNA *srna) parm = RNA_def_boolean(func, "result", 0, "result", ""); /* better name? */ RNA_def_function_return(func, parm); - + /* invoke */ func = RNA_def_function(srna, "invoke", NULL); RNA_def_function_ui_description(func, "Invoke the operator"); @@ -719,7 +721,7 @@ void RNA_api_keymapitems(StructRNA *srna) RNA_def_boolean(func, "alt", 0, "Alt", ""); RNA_def_boolean(func, "oskey", 0, "OS Key", ""); RNA_def_enum(func, "key_modifier", rna_enum_event_type_items, 0, "Key Modifier", ""); - RNA_def_boolean(func, "head", 0, "At Head", + RNA_def_boolean(func, "head", 0, "At Head", "Force item to be added at start (not end) of key map so that " "it doesn't get blocked by an existing key map item"); parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item"); @@ -741,7 +743,7 @@ void RNA_api_keymapitems(StructRNA *srna) RNA_def_enum(func, "key_modifier", rna_enum_event_type_items, 0, "Key Modifier", ""); parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item"); RNA_def_function_return(func, parm); - + func = RNA_def_function(srna, "remove", "rna_KeyMap_item_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 925bc52d06f..08287308e08 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -117,7 +117,7 @@ static void rna_World_use_nodes_update(bContext *C, PointerRNA *ptr) if (wrld->use_nodes && wrld->nodetree == NULL) ED_node_shader_default(C, &wrld->id); - + rna_World_update(CTX_data_main(C), CTX_data_scene(C), ptr); } @@ -388,7 +388,7 @@ static void rna_def_world_mist(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem falloff_items[] = { {0, "QUADRATIC", 0, "Quadratic", "Use quadratic progression"}, {1, "LINEAR", 0, "Linear", "Use linear progression"}, @@ -431,7 +431,7 @@ static void rna_def_world_mist(BlenderRNA *brna) RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Height", "Control how much mist density decreases with height"); RNA_def_property_update(prop, 0, "rna_World_update"); - + prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mistype"); RNA_def_property_enum_items(prop, falloff_items); @@ -462,7 +462,7 @@ void RNA_def_world(BlenderRNA *brna) /* RNA_def_property_update(prop, 0, "rna_World_update"); */ /* render-only uses this */ RNA_def_property_update(prop, 0, "rna_World_draw_update"); - + prop = RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "zenr"); RNA_def_property_array(prop, 3); diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py index 8b4b10c490e..0b80a711c3b 100755 --- a/source/blender/makesrna/rna_cleanup/rna_cleaner.py +++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py @@ -19,7 +19,7 @@ def font_bold(mystring): font_bold = "\033[1m" font_reset = "\033[0;0m" return font_bold + mystring + font_reset - + def usage(): """ @@ -102,30 +102,30 @@ def get_props_from_txt(input_filename): """ If the file is *.txt, the script assumes it is formatted as outlined in this script docstring """ - + file=open(input_filename,'r') file_lines=file.readlines() file.close() props_list=[] props_length_max=[0,0,0,0,0,0,0,0] - + done_text = "+" done = 0 tot = 0 - + for iii, line in enumerate(file_lines): - + # debug #print(line) line_strip = line.strip() # empty line or comment if not line_strip: continue - + if line_strip == "EOF": break - + if line.startswith("#"): line = line[1:] @@ -162,18 +162,18 @@ def get_props_from_txt(input_filename): # changed changed = check_if_changed(bfrom, bto) - + # lists formatting props=[comment, changed, bclass, bfrom, bto, kwcheck, btype, description] props_list.append(props) props_length_max=list(map(max,zip(props_length_max,list(map(len,props))))) - + if done_text in comment: done += 1 tot += 1 - + print("Total done %.2f" % (done / tot * 100.0) ) - + return (props_list,props_length_max) @@ -181,7 +181,7 @@ def get_props_from_py(input_filename): """ If the file is *.py, the script assumes it contains a python list (as "rna_api=[...]") This means that this script executes the text in the py file with an exec(text). - """ + """ # adds the list "rna_api" to this function's scope rna_api = __import__(input_filename[:-3]).rna_api @@ -205,7 +205,7 @@ def get_props(input_filename): props_list,props_length_max = get_props_from_py(input_filename) return (props_list,props_length_max) - + def sort(props_list, sort_priority): """ reminder @@ -221,7 +221,7 @@ def sort(props_list, sort_priority): props_list = sorted(props_list, key=lambda p: p[i], reverse=True) else: props_list = sorted(props_list, key=lambda p: p[i]) - + print ('\nSorted by %s.' % font_bold(sort_priority)) return props_list @@ -260,11 +260,11 @@ def write_files(basename, props_list, props_length_max): props_list = [['NOTE', 'CHANGED', 'CLASS', 'FROM', 'TO', 'KEYWORD-CHECK', 'TYPE', 'DESCRIPTION']] + props_list for props in props_list: #txt - + # quick way we can tell if it changed if props[3] == props[4]: txt += "#" else: txt += " " - + if props[0] != '': txt += '%s * ' % props[0] # comment txt += '%s.%s -> %s: %s "%s"\n' % tuple(props[2:5] + props[6:]) # skipping keyword-check # rna_api @@ -279,7 +279,7 @@ def write_files(basename, props_list, props_length_max): f_txt.write(txt) f_py.write("rna_api = [\n%s]\n" % py) f_rna.write("rna_api = [\n%s]\n" % rna) - + # write useful py script, wont hurt f_py.write("\n'''\n") f_py.write("for p_note, p_changed, p_class, p_from, p_to, p_check, p_type, p_desc in rna_api:\n") diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py b/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py index 17ea5f9b0bd..a5d5cebcbb7 100755 --- a/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py +++ b/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py @@ -7,38 +7,38 @@ Example usage: python3 rna_cleaner_merge.py out_work.py rna_booleans_work.py ''' def main(): - + def work_line_id(line): return line[2].split("|")[-1], line[3] # class/from - - + + if not (sys.argv[-1].endswith(".py") and sys.argv[-2].endswith(".py")): print("Only accepts 2 py files as arguments.") - + sys.path.insert(0, ".") mod_from = __import__(sys.argv[-1][:-3]) mod_to = __import__(sys.argv[-2][:-3]) - + mod_to_dict = dict([(work_line_id(line), line) for line in mod_to.rna_api]) mod_from_dict = dict([(work_line_id(line), line) for line in mod_from.rna_api]) - + rna_api_new = [] - + for key, val_orig in mod_to_dict.items(): try: val_new = mod_from_dict.pop(key) except: # print("not found", key) val_new = val_orig - + # always take the class from the base val = list(val_orig) val[0] = val_new[0] # comment val[4] = val_new[4] # -> to val = tuple(val) rna_api_new.append(val) - + def write_work_file(file_path, rna_api): rna_api = list(rna_api) rna_api.sort(key=work_line_id) @@ -51,7 +51,7 @@ def main(): file_path = sys.argv[-2][:-3] + "_merged.py" write_work_file(file_path, rna_api_new) - + if mod_from_dict: file_path = sys.argv[-2][:-3] + "_lost.py" write_work_file(file_path, list(mod_from_dict.values())) -- cgit v1.2.3