diff options
Diffstat (limited to 'source/blender/makesrna')
62 files changed, 2653 insertions, 2641 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 4d5a644faa2..fe063a8e335 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); @@ -2886,7 +2886,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); @@ -3441,7 +3441,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" @@ -3940,7 +3940,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 603f4dbc44f..11e45bc688d 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -156,13 +156,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; } @@ -333,7 +333,7 @@ static ID *rna_ID_copy(ID *id, Main *bmain) if (newid) id_us_min(newid); return newid; } - + return NULL; } @@ -817,7 +817,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); @@ -903,7 +903,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"); @@ -1244,7 +1244,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 df09e5c68b5..0532aac1bc3 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -107,9 +107,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); @@ -137,7 +137,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); @@ -147,7 +147,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; @@ -289,7 +289,7 @@ IDProperty *RNA_struct_idprops(PointerRNA *ptr, bool create) if (type && type->idproperties) { return type->idproperties(ptr, create); } - + return NULL; } @@ -380,7 +380,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) @@ -693,7 +693,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; } @@ -718,7 +718,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; } @@ -1180,7 +1180,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); @@ -1693,7 +1693,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; @@ -1710,7 +1710,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; @@ -1718,7 +1718,7 @@ bool RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, con if (free) { MEM_freeN((void *)item); } - + return result; } return false; @@ -1932,7 +1932,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)) @@ -2147,7 +2147,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<RnaUpdateFuncRef>) */ } tRnaUpdateCacheElem; @@ -2163,18 +2163,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 */ @@ -2187,11 +2187,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 */ @@ -2205,13 +2205,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); @@ -2222,13 +2222,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); } @@ -2429,7 +2429,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); @@ -2684,7 +2684,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); @@ -2971,7 +2971,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); @@ -3407,7 +3407,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); } @@ -3688,7 +3688,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); @@ -3697,7 +3697,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; @@ -3890,7 +3890,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; } @@ -3943,7 +3943,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; @@ -4301,7 +4301,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)) @@ -4342,7 +4342,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; @@ -4397,7 +4397,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++; @@ -4414,11 +4414,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; @@ -4464,22 +4464,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)) { @@ -4502,7 +4502,7 @@ static bool rna_path_parse_collection_key(const char **path, PointerRNA *ptr, Pr r_nextptr->data = NULL; } } - + if (token != fixedbuf) { MEM_freeN(token); } @@ -4516,7 +4516,7 @@ static bool rna_path_parse_collection_key(const char **path, PointerRNA *ptr, Pr r_nextptr->data = NULL; } } - + return true; } @@ -4527,21 +4527,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; @@ -4553,12 +4553,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; } } @@ -4576,33 +4576,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; @@ -4678,7 +4678,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; @@ -4695,7 +4695,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; @@ -4812,7 +4812,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 */ @@ -4887,7 +4887,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; @@ -5058,7 +5058,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 */ @@ -5067,13 +5067,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 @@ -5086,7 +5086,7 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr) else return NULL; } - + return ptrpath; } @@ -5138,7 +5138,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); @@ -5868,23 +5868,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); @@ -5892,8 +5892,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; @@ -6046,7 +6046,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) { @@ -6217,7 +6217,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; @@ -6323,7 +6323,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: @@ -6752,7 +6752,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", @@ -6779,7 +6779,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, " @@ -7025,17 +7025,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 { @@ -7052,10 +7052,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 { @@ -7072,10 +7072,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 { @@ -7094,7 +7094,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); @@ -7102,14 +7102,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; diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index b06038a50e4..5b225b18a78 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 Collection Filtering Settings */ prop = RNA_def_property(srna, "show_only_collection_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 collection"); 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_collection", 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 Collection", "Collection 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_animation.c b/source/blender/makesrna/intern/rna_animation.c index d2c719ac5d1..d89e3e68492 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -85,9 +85,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] */ DEG_id_tag_update(id, OB_RECALC_OB | OB_RECALC_DATA); } @@ -95,7 +95,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; @@ -107,10 +107,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) { @@ -157,16 +157,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; } @@ -188,7 +188,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); } @@ -214,7 +214,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); } @@ -236,11 +236,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 */ @@ -259,17 +259,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) { @@ -279,23 +279,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 */ @@ -319,7 +319,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)) @@ -339,7 +339,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 @@ -352,7 +352,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 @@ -364,20 +364,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 */ @@ -392,7 +392,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)); } @@ -401,7 +401,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; } @@ -444,7 +444,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); @@ -458,13 +458,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); @@ -473,7 +473,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; } @@ -502,13 +502,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; } @@ -567,7 +567,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; @@ -619,39 +619,39 @@ bool rna_AnimaData_override_apply( 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"); @@ -674,36 +674,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 @@ -716,9 +716,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); @@ -727,7 +727,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"); @@ -736,7 +736,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"); @@ -753,11 +753,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"); @@ -768,7 +768,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); @@ -777,19 +777,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", @@ -802,7 +802,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); @@ -810,7 +810,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); } @@ -823,7 +823,7 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) FunctionRNA *func; PropertyRNA *parm; - + PropertyRNA *prop; RNA_def_property_srna(cprop, "KeyingSetPaths"); @@ -831,7 +831,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"); @@ -871,7 +871,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); @@ -891,17 +891,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"); @@ -909,19 +909,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); @@ -936,11 +936,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); } @@ -955,12 +955,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"); @@ -968,7 +968,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"); @@ -992,12 +992,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); @@ -1006,7 +1006,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 " @@ -1023,7 +1023,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); @@ -1036,11 +1036,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); @@ -1048,7 +1048,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... */ @@ -1066,31 +1066,31 @@ 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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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); @@ -1109,7 +1109,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 69a5cc2d6b1..44a21e797f1 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -73,13 +73,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; } @@ -148,7 +148,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; - + DEG_id_tag_update(id, DEG_TAG_COPY_ON_WRITE); WM_main_add_notifier(NC_GEOM | ND_DATA, id); } @@ -157,10 +157,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); } @@ -168,7 +168,7 @@ 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; - + /* 1) special updates for cases where rigs try to hook into armature drawing stuff * e.g. Mask Modifier - 'Armature' option * 2) tag armature for copy-on-write, so that selection status (set by addons) @@ -177,25 +177,25 @@ static void rna_Bone_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po if (id) { if (GS(id->name) == ID_AR) { bArmature *arm = (bArmature *)id; - + if (arm->flag & ARM_HAS_VIZ_DEPS) { DEG_id_tag_update(id, OB_RECALC_DATA); } - + DEG_id_tag_update(id, DEG_TAG_COPY_ON_WRITE); } else if (GS(id->name) == ID_OB) { Object *ob = (Object *)id; bArmature *arm = (bArmature *)ob->data; - + if (arm->flag & ARM_HAS_VIZ_DEPS) { DEG_id_tag_update(id, OB_RECALC_DATA); } - + DEG_id_tag_update(&arm->id, DEG_TAG_COPY_ON_WRITE); } } - + WM_main_add_notifier(NC_GEOM | ND_DATA, id); /* spaces that show animation data of the selected bone need updating */ @@ -207,7 +207,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 @@ -218,7 +218,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); } @@ -267,7 +267,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; @@ -281,9 +281,9 @@ static void rna_Bone_layer_set(PointerRNA *ptr, const int *values) { bArmature *arm = (bArmature *)ptr->id.data; Bone *bone = (Bone *)ptr->data; - + rna_bone_layer_set(&bone->layer, values); - + arm->layer_used = 0; rna_Armature_layer_used_refresh(arm, &arm->bonebase); } @@ -297,7 +297,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; @@ -336,11 +336,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); } @@ -349,7 +349,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)); @@ -415,7 +415,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; @@ -442,7 +442,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); @@ -460,11 +460,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)) @@ -522,48 +522,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); @@ -577,7 +577,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); @@ -592,14 +592,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 } @@ -631,23 +631,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); @@ -657,19 +657,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); @@ -677,7 +677,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"); @@ -690,13 +690,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"); @@ -705,7 +705,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"); @@ -714,20 +714,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); @@ -740,13 +740,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); @@ -755,7 +755,7 @@ static void rna_def_bone(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_PTR_NO_OWNERSHIP); 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); @@ -779,13 +779,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", ""); @@ -840,13 +840,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); @@ -855,7 +855,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); @@ -903,7 +903,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", ""); @@ -1027,7 +1027,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"); @@ -1042,7 +1042,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); @@ -1064,7 +1064,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); @@ -1090,7 +1090,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); @@ -1099,47 +1099,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); @@ -1159,7 +1159,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); @@ -1167,7 +1167,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); @@ -1176,7 +1176,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 98ca58e0edd..413cb10422a 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -96,7 +96,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; DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA); @@ -110,7 +110,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; DEG_id_tag_update(ptr->id.data, OB_RECALC_DATA); @@ -211,10 +211,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"); } @@ -418,36 +418,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 d227d7a3dbe..75d05115006 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", ""}, @@ -403,14 +403,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; @@ -656,8 +656,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"); @@ -707,10 +707,10 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Random Angle", "Brush texture random angle"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); 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) @@ -813,7 +813,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"}, @@ -841,7 +841,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", ""}, @@ -903,7 +903,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); @@ -933,7 +933,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); @@ -941,7 +941,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); @@ -985,14 +985,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"); @@ -1149,20 +1149,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); @@ -1204,7 +1204,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); @@ -1260,7 +1260,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); @@ -1379,7 +1379,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 | PROP_CONTEXT_UPDATE); @@ -1444,7 +1444,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); @@ -1524,7 +1524,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 3d1a1458102..0958011a7f0 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -89,11 +89,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; } @@ -111,11 +111,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; } @@ -291,7 +291,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"}, @@ -299,49 +299,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); } @@ -349,14 +349,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); @@ -377,13 +377,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); @@ -426,7 +426,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); @@ -510,14 +510,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); @@ -650,7 +650,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"); @@ -678,7 +678,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); @@ -712,13 +712,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 8e090937605..67fb58b6208 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -75,7 +75,7 @@ static int rna_CurveMapping_curves_length(PointerRNA *ptr) for (len = 0; len < CM_TOT; len++) if (!cumap->cm[len].curve) break; - + return len; } @@ -154,11 +154,11 @@ 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_NT: { @@ -166,7 +166,7 @@ static char *rna_ColorRamp_path(PointerRNA *ptr) 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) { @@ -182,14 +182,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"); @@ -200,7 +200,7 @@ static char *rna_ColorRamp_path(PointerRNA *ptr) /* everything else just uses 'color_ramp' */ path = BLI_strdup("color_ramp"); } - + return path; } @@ -210,7 +210,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... */ @@ -232,13 +232,13 @@ 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_NT: { 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); @@ -272,10 +272,10 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) } } } - + /* cleanup the macro we defined */ #undef COLRAMP_GETPATH - + return path; } @@ -283,12 +283,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; - + DEG_id_tag_update(&ma->id, 0); WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma); break; @@ -323,7 +323,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * case ID_PA: { ParticleSettings *part = ptr->id.data; - + DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_REDO); WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, part); } @@ -761,7 +761,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"); @@ -828,7 +828,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); @@ -893,7 +893,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", ""}, @@ -913,7 +913,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"); @@ -948,7 +948,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); @@ -964,7 +964,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"}, @@ -977,7 +977,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); @@ -1006,12 +1006,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 e01ca97dfac..a01f2afa26e 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", "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} }; @@ -229,23 +229,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); } @@ -291,7 +291,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); } @@ -318,7 +318,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 */ @@ -332,14 +332,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); @@ -384,7 +384,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)); } @@ -392,7 +392,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)); } @@ -508,12 +508,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"); @@ -604,13 +604,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) @@ -1001,7 +1001,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"); @@ -1149,9 +1149,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); @@ -1206,7 +1206,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); @@ -1229,7 +1229,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", @@ -1866,9 +1866,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); @@ -1884,7 +1884,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"); @@ -1895,7 +1895,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"}, @@ -1905,24 +1905,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); @@ -1968,9 +1968,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); @@ -1986,7 +1986,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", @@ -2001,7 +2001,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"); @@ -2009,7 +2009,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 */ @@ -2017,7 +2017,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); @@ -2030,31 +2030,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"); @@ -2062,33 +2062,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"); @@ -2116,37 +2116,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"); @@ -2324,21 +2324,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); @@ -2363,7 +2363,7 @@ void RNA_def_constraint(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_OFF); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); @@ -2375,17 +2375,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_curve.c b/source/blender/makesrna/intern/rna_curve.c index 894af338c12..0681a449aa2 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} }; @@ -159,7 +159,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); @@ -173,7 +173,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; @@ -218,7 +218,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); } @@ -232,34 +232,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); } @@ -448,7 +448,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); } @@ -900,7 +900,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"); @@ -909,18 +909,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: " @@ -943,7 +943,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); @@ -992,7 +992,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); @@ -1004,51 +1004,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"); @@ -1058,7 +1058,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); @@ -1067,7 +1067,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"); @@ -1079,7 +1079,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"); @@ -1087,7 +1087,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", ""); @@ -1128,10 +1128,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"); @@ -1139,7 +1139,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); @@ -1160,7 +1160,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"); } @@ -1168,27 +1168,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); @@ -1212,7 +1212,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"); @@ -1224,7 +1224,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"); @@ -1335,7 +1335,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"}, @@ -1392,7 +1392,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"); @@ -1401,63 +1401,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"); @@ -1485,7 +1485,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); @@ -1547,7 +1547,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); @@ -1555,7 +1555,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); @@ -1564,12 +1564,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"); @@ -1633,7 +1633,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); @@ -1752,7 +1752,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 b8387263932..5b91a3e43d2 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; @@ -1382,7 +1382,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); @@ -1894,7 +1894,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; @@ -1910,7 +1910,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; @@ -1956,7 +1956,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; @@ -2046,7 +2046,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; @@ -2114,7 +2114,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; @@ -2670,7 +2670,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); @@ -2683,7 +2683,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); @@ -2697,7 +2697,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); @@ -2711,7 +2711,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); @@ -2725,7 +2725,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); @@ -2740,7 +2740,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); @@ -2758,7 +2758,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 */ @@ -2777,7 +2777,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); @@ -2864,7 +2864,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); @@ -2906,7 +2906,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); @@ -2924,7 +2924,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); @@ -2942,7 +2942,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; @@ -2956,7 +2956,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); @@ -3033,7 +3033,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); @@ -3052,7 +3052,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); @@ -3070,7 +3070,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); @@ -3087,7 +3087,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); @@ -3100,7 +3100,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) { @@ -3116,7 +3116,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); @@ -3129,7 +3129,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); @@ -3586,7 +3586,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); @@ -3604,7 +3604,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 0358efff266..509265c04df 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -438,7 +438,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); @@ -448,12 +448,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 */ @@ -462,12 +462,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); @@ -475,7 +475,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); @@ -483,13 +483,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); @@ -542,7 +542,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)"); @@ -551,13 +551,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); @@ -575,19 +575,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); @@ -618,7 +618,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"); @@ -658,7 +658,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); @@ -674,12 +674,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); @@ -824,12 +824,12 @@ 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_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); @@ -837,7 +837,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"); @@ -890,7 +890,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 */ @@ -900,7 +900,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); @@ -908,19 +908,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", @@ -944,7 +944,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 @@ -956,12 +956,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); @@ -975,7 +975,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 0e382248542..64d6960d0ff 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"}, @@ -138,21 +138,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... */ DEG_relations_tag_update(bmain); DEG_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); } @@ -168,7 +168,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) */ @@ -212,7 +212,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 */ @@ -222,7 +222,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 */ @@ -232,7 +232,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; @@ -251,7 +251,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 @@ -261,11 +261,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 @@ -275,7 +275,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); } @@ -283,7 +283,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); } @@ -314,7 +314,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]; } @@ -322,7 +322,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]; } @@ -330,7 +330,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]; } @@ -338,7 +338,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]; } @@ -346,7 +346,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]; } @@ -354,7 +354,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]; } @@ -374,7 +374,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 @@ -387,7 +387,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; @@ -402,7 +402,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); @@ -413,7 +413,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; @@ -423,14 +423,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) */ @@ -444,10 +444,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) { @@ -535,10 +535,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; @@ -548,10 +548,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; @@ -562,11 +562,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; @@ -577,13 +577,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; } @@ -602,22 +602,22 @@ static void rna_FModifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poin ID *id = ptr->id.data; FModifier *fcm = (FModifier *)ptr->data; AnimData *adt = BKE_animdata_from_id(id); - + DEG_id_tag_update(id, (GS(id->name) == ID_OB) ? OB_RECALC_OB : OB_RECALC_DATA); - + /* tag datablock for time update so that animation is recalculated, * as FModifiers affect how animation plays... */ DEG_id_tag_update(id, DEG_TAG_TIME); if (adt != NULL) { adt->recalc |= ADT_RECALC_ANIM; - + if (adt->action != NULL) { /* action is separate datablock, needs separate tag */ DEG_id_tag_update(&adt->action->id, DEG_TAG_COPY_ON_WRITE); } } - + if (fcm->curve && fcm->type == FMODIFIER_TYPE_CYCLES) { calchandles_fcurve(fcm->curve); } @@ -682,9 +682,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; } @@ -694,9 +694,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; } @@ -706,9 +706,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; } @@ -718,9 +718,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; } @@ -731,7 +731,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; @@ -742,10 +742,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; } @@ -755,7 +755,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; @@ -766,12 +766,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; } @@ -780,7 +780,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; } @@ -799,12 +799,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; @@ -815,12 +815,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; @@ -839,10 +839,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; @@ -946,17 +946,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); @@ -964,19 +964,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); @@ -993,7 +993,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", ""}, @@ -1003,28 +1003,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); @@ -1032,7 +1032,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); @@ -1046,11 +1046,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... @@ -1059,18 +1059,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) */ } @@ -1109,29 +1109,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"); @@ -1144,7 +1144,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"}, @@ -1155,31 +1155,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", @@ -1193,7 +1193,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"); @@ -1205,49 +1205,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"); @@ -1261,7 +1261,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", ""}, @@ -1269,28 +1269,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"); @@ -1300,7 +1300,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"); @@ -1314,42 +1314,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"); @@ -1364,43 +1364,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); @@ -1408,7 +1408,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); @@ -1417,40 +1417,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); @@ -1466,7 +1466,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", ""}, @@ -1479,7 +1479,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", @@ -1489,10 +1489,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"); @@ -1505,7 +1505,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); @@ -1515,25 +1515,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); @@ -1545,7 +1545,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", @@ -1554,12 +1554,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); @@ -1568,14 +1568,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 */ @@ -1584,12 +1584,12 @@ static void rna_def_drivervar(BlenderRNA *brna) RNA_def_property_struct_type(prop, "DriverTarget"); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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"); } @@ -1598,16 +1598,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"); @@ -1629,7 +1629,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", ""}, @@ -1662,7 +1662,7 @@ static void rna_def_channeldriver(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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, "use_self", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", DRIVER_FLAG_USE_SELF); @@ -1674,8 +1674,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); } @@ -1686,17 +1686,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"); @@ -1713,40 +1713,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); @@ -1754,18 +1754,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); @@ -1785,20 +1785,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); @@ -1933,7 +1933,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"); @@ -1942,7 +1942,7 @@ static void rna_def_fcurve(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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); @@ -1964,35 +1964,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, "rna_FCurve_update_eval"); - + 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"); @@ -2010,7 +2010,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"); @@ -2022,7 +2022,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"); @@ -2038,11 +2038,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"); @@ -2051,7 +2051,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 " @@ -2073,13 +2073,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 16b672ada49..23d9155fccd 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -125,7 +125,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 */ @@ -243,7 +243,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); @@ -279,7 +279,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); @@ -327,32 +327,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); @@ -431,7 +431,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"); @@ -471,7 +471,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"); @@ -489,7 +489,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); @@ -615,12 +615,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); @@ -636,7 +636,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 f064e3eb630..de6c6883977 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -158,7 +158,7 @@ static void rna_def_collection_objects(BlenderRNA *brna, PropertyRNA *cprop) StructRNA *srna; FunctionRNA *func; PropertyRNA *parm; - + RNA_def_property_srna(cprop, "CollectionObjects"); srna = RNA_def_struct(brna, "CollectionObjects", NULL); RNA_def_struct_sdna(srna, "Collection"); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index cd0824733b9..47e78b8e2a6 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -175,7 +175,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: @@ -190,7 +190,7 @@ static char *rna_ImageUser_path(PointerRNA *ptr) break; } } - + return BLI_strdup(""); } @@ -200,7 +200,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); } @@ -304,7 +304,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) @@ -705,7 +705,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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); @@ -756,7 +756,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); @@ -764,7 +764,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); @@ -772,7 +772,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 472298a3053..11fb5f7f94b 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -75,20 +75,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); } @@ -131,7 +131,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; @@ -150,7 +150,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; @@ -274,7 +274,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; @@ -288,7 +288,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; } @@ -411,17 +411,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); } @@ -432,15 +432,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; } @@ -450,11 +450,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 @@ -462,7 +462,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)); } @@ -496,11 +496,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 */ @@ -508,7 +508,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 */ @@ -518,12 +518,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 */ @@ -531,7 +531,7 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point) } } } - + return NULL; } @@ -543,18 +543,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; @@ -566,21 +566,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 @@ -690,7 +690,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 fb27c91959e..dff27e1c625 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -105,7 +105,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); } @@ -173,7 +173,7 @@ 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); } @@ -196,7 +196,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"); diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 904a6289fc1..ace7ac30408 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -216,19 +216,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); } } @@ -345,7 +345,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 d727b896223..7b9184eb5df 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -386,7 +386,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"); @@ -397,7 +397,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 9f5b72ff13e..e1eadda3696 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -97,10 +97,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); } @@ -226,7 +226,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; @@ -254,7 +254,7 @@ static void rna_def_material_display(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); @@ -267,7 +267,7 @@ static void rna_def_material_display(StructRNA *srna) RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Roughness", "Roughness of the material"); RNA_def_property_update(prop, 0, "rna_Material_draw_update"); - + prop = RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_float_default(prop, 0.5f); @@ -334,7 +334,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); - + /* Blending (only Eevee for now) */ prop = RNA_def_property(srna, "blend_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_eevee_blend_items); @@ -386,7 +386,7 @@ void RNA_def_material(BlenderRNA *brna) 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, "pass_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "index"); RNA_def_property_ui_text(prop, "Pass Index", "Index number for the \"Material Index\" render pass"); @@ -432,14 +432,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); @@ -490,7 +490,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, "is_valid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "valid", 1); RNA_def_property_clear_flag(prop, PROP_EDITABLE); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 9ec196034f3..d664415b8ad 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -3142,7 +3142,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 f1f7c9a3b99..ed19877ec0f 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -55,10 +55,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 a85e2095121..b16a7254a86 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 124f3a2fbe2..cdecba0760c 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -64,32 +64,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); } @@ -104,7 +104,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(scene, ob); - + DEG_id_tag_update(&mb->id, 0); WM_main_add_notifier(NC_GEOM | ND_DATA, mb); } @@ -200,7 +200,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"); @@ -239,19 +239,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"); @@ -304,7 +304,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); @@ -321,7 +321,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"); @@ -329,14 +329,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); @@ -348,14 +348,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); @@ -363,7 +363,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); @@ -372,7 +372,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"); @@ -380,7 +380,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 d709ec11040..bfc90557374 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -427,19 +427,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); } @@ -697,7 +697,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; } @@ -738,27 +738,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); } @@ -766,9 +766,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)) { @@ -1243,7 +1243,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"); @@ -1429,7 +1429,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); @@ -1503,7 +1503,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"); @@ -1549,7 +1549,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"); @@ -1867,7 +1867,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"); @@ -1878,7 +1878,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", @@ -1942,7 +1942,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", @@ -2088,7 +2088,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"); @@ -2138,7 +2138,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"); @@ -2151,7 +2151,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); @@ -2300,7 +2300,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); @@ -2365,7 +2365,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", @@ -2487,7 +2487,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"); @@ -2512,7 +2512,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", @@ -2543,7 +2543,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"); @@ -2565,17 +2565,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); @@ -2626,12 +2626,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"); @@ -2673,7 +2673,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"); @@ -2877,22 +2877,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", ""); @@ -2917,7 +2917,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", ""}, @@ -2925,24 +2925,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); @@ -2955,16 +2955,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", ""); @@ -3117,7 +3117,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"}, @@ -3193,7 +3193,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); @@ -4036,7 +4036,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"}, @@ -4047,24 +4047,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); @@ -4072,7 +4072,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); @@ -4087,13 +4087,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); @@ -4101,7 +4101,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); @@ -4109,66 +4109,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", @@ -4176,31 +4176,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); @@ -4897,28 +4897,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); @@ -4927,26 +4927,26 @@ void RNA_def_modifier(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 38086a47c51..404d9089cd9 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -63,10 +63,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); @@ -78,12 +78,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) { @@ -99,7 +99,7 @@ static char *rna_NlaStrip_path(PointerRNA *ptr) } } } - + /* no path */ return BLI_strdup(""); } @@ -133,7 +133,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 @@ -144,7 +144,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; } @@ -161,7 +161,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 @@ -172,7 +172,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; } @@ -184,16 +184,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); } @@ -202,12 +202,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); } @@ -215,12 +215,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); } @@ -229,11 +229,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; } @@ -241,30 +241,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); } @@ -273,7 +273,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; @@ -284,22 +284,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; } @@ -307,11 +307,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); @@ -320,11 +320,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); } @@ -332,7 +332,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; @@ -345,7 +345,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; @@ -371,22 +371,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... @@ -394,25 +394,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; } @@ -442,7 +442,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; @@ -450,12 +450,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; } @@ -518,7 +518,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"}, @@ -527,20 +527,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"); @@ -548,19 +548,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"); @@ -573,20 +573,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"); @@ -594,7 +594,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"); @@ -603,20 +603,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"); @@ -626,7 +626,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); @@ -635,7 +635,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); @@ -647,13 +647,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); @@ -662,14 +662,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); @@ -677,19 +677,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 */ @@ -697,24 +697,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", @@ -760,11 +760,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"); @@ -777,7 +777,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 */ @@ -785,7 +785,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); @@ -799,7 +799,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 4f928a9a831..f9e288b348e 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -261,15 +261,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; @@ -336,15 +336,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 @@ -412,16 +412,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 @@ -525,7 +525,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 @@ -590,7 +590,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); @@ -654,7 +654,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; @@ -671,7 +671,7 @@ static StructRNA *rna_NodeTree_register( /* update while blender is running */ WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); - + return nt->ext.srna; } @@ -680,7 +680,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 @@ -702,28 +702,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); @@ -734,10 +734,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; @@ -785,7 +785,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 @@ -809,7 +809,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; @@ -824,7 +824,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. */ @@ -897,7 +897,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; @@ -926,7 +926,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; } @@ -941,30 +941,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; } @@ -972,13 +972,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); } @@ -987,10 +987,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); @@ -1003,10 +1003,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); @@ -1019,12 +1019,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); @@ -1040,9 +1040,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); } @@ -1050,12 +1050,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); @@ -1071,9 +1071,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); } @@ -1084,7 +1084,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); } @@ -1103,7 +1103,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 @@ -1412,7 +1412,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)); @@ -1447,7 +1447,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; @@ -1455,7 +1455,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; } @@ -1467,12 +1467,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; } @@ -1484,12 +1484,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; } @@ -1501,12 +1501,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; } @@ -1518,24 +1518,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; } @@ -1543,19 +1543,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); @@ -1566,17 +1566,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; } @@ -1603,14 +1603,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); } @@ -1619,9 +1619,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"); } @@ -1629,7 +1629,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; } @@ -1637,9 +1637,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"); } @@ -1647,20 +1647,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); } @@ -1670,7 +1670,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); @@ -1684,7 +1684,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); @@ -1698,12 +1698,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); @@ -1719,7 +1719,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); } @@ -1728,12 +1728,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); @@ -1749,7 +1749,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); } @@ -1825,7 +1825,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); @@ -1847,7 +1847,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); @@ -1855,7 +1855,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)); @@ -1868,22 +1868,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); @@ -1892,14 +1892,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 @@ -1913,10 +1913,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) { @@ -1930,12 +1930,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; } @@ -1945,9 +1945,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; } @@ -1977,11 +1977,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 @@ -2109,11 +2109,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); } @@ -2129,7 +2129,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); @@ -2147,38 +2147,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 @@ -2190,27 +2190,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; } @@ -2218,13 +2218,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); } @@ -2265,11 +2265,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; @@ -2281,11 +2281,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; @@ -2296,11 +2296,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; @@ -2311,16 +2311,16 @@ 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); } @@ -2453,15 +2453,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; } @@ -2483,10 +2483,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); } @@ -2495,13 +2495,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; } } @@ -2510,11 +2510,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); } @@ -2535,7 +2535,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) @@ -2581,10 +2581,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; } @@ -2592,10 +2592,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; } @@ -2618,10 +2618,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) { @@ -2776,7 +2776,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; @@ -2816,7 +2816,7 @@ static const EnumPropertyItem *rna_Node_channel_itemf(bContext *UNUSED(C), Point RNA_enum_item_end(&item, &totitem); *r_free = true; - + return item; } @@ -2876,7 +2876,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; @@ -2887,7 +2887,7 @@ static int rna_NodeOutputFileSocket_find_node(bNodeTree *ntree, NodeImageMultiFi } } } - + *nodep = NULL; *sockp = NULL; return 0; @@ -2899,7 +2899,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); } @@ -2911,7 +2911,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); } @@ -2925,12 +2925,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; } @@ -3324,7 +3324,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"); @@ -3335,13 +3335,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"); @@ -3351,7 +3351,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"); @@ -3370,7 +3370,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"); @@ -3382,8 +3382,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"); @@ -3393,7 +3393,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"); @@ -3409,7 +3409,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); @@ -3425,7 +3425,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); @@ -3436,7 +3436,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"); @@ -3447,7 +3447,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"); @@ -3458,18 +3458,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", ""); @@ -3479,7 +3479,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"); @@ -3490,13 +3490,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"); @@ -3511,14 +3511,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"); @@ -3531,7 +3531,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"); @@ -3557,7 +3557,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); @@ -3570,36 +3570,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"); @@ -3609,9 +3609,9 @@ static void def_sh_mapping(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", ""); @@ -3641,9 +3641,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); @@ -3652,19 +3652,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"); @@ -3819,7 +3819,7 @@ static void def_sh_tex_gradient(StructRNA *srna) }; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexGradient", "storage"); def_sh_tex(srna); @@ -3844,44 +3844,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); @@ -3904,7 +3904,7 @@ static void def_sh_tex_musgrave(StructRNA *srna) }; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexMusgrave", "storage"); def_sh_tex(srna); @@ -3924,7 +3924,7 @@ static void def_sh_tex_voronoi(StructRNA *srna) }; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexVoronoi", "storage"); def_sh_tex(srna); @@ -3950,7 +3950,7 @@ static void def_sh_tex_wave(StructRNA *srna) }; PropertyRNA *prop; - + RNA_def_struct_sdna_from(srna, "NodeTexWave", "storage"); def_sh_tex(srna); @@ -4001,20 +4001,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"); @@ -4024,7 +4024,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"); @@ -4167,7 +4167,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); @@ -4178,7 +4178,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); @@ -4206,7 +4206,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); @@ -4217,7 +4217,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); @@ -4228,7 +4228,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); @@ -4239,7 +4239,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"); @@ -4249,7 +4249,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); @@ -4409,7 +4409,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); @@ -4453,9 +4453,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"); @@ -4470,7 +4470,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"); @@ -4483,7 +4483,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 */ @@ -4494,7 +4494,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); @@ -4505,7 +4505,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); @@ -4519,15 +4519,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); @@ -4538,7 +4538,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", ""}, @@ -4570,13 +4570,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); @@ -4587,7 +4587,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); @@ -4599,30 +4599,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"); @@ -4643,40 +4643,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); @@ -4688,7 +4688,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"); @@ -4698,28 +4698,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); @@ -4727,7 +4727,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"); @@ -4737,7 +4737,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"}, @@ -4746,7 +4746,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); @@ -4763,7 +4763,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); @@ -4771,19 +4771,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 */ @@ -4820,7 +4820,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", ""}, @@ -4830,7 +4830,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"); @@ -4854,7 +4854,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); @@ -4862,7 +4862,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_view_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_view_layer_items); @@ -4876,19 +4876,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"); @@ -4900,11 +4900,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"); @@ -4957,33 +4957,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); @@ -5003,13 +5003,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); @@ -5047,7 +5047,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); @@ -5083,7 +5083,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", ""}, @@ -5119,7 +5119,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); @@ -5132,14 +5132,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); @@ -5151,7 +5151,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); @@ -5159,13 +5159,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); @@ -5176,7 +5176,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"}, @@ -5191,14 +5191,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); @@ -5230,13 +5230,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); @@ -5284,16 +5284,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); @@ -5315,16 +5315,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); @@ -5337,13 +5337,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); @@ -5354,7 +5354,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"}, @@ -5368,13 +5368,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); @@ -5396,14 +5396,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); @@ -5415,7 +5415,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); @@ -5426,7 +5426,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); @@ -5443,7 +5443,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); @@ -5533,7 +5533,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"); @@ -5547,20 +5547,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"); @@ -5572,7 +5572,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); @@ -5585,12 +5585,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", ""); @@ -5600,7 +5600,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"); @@ -5618,19 +5618,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); @@ -5665,50 +5665,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); @@ -5719,21 +5719,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); @@ -5744,25 +5744,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", ""}, @@ -5770,22 +5770,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); @@ -5793,13 +5793,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); @@ -5807,109 +5807,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); @@ -5920,20 +5920,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", @@ -5945,21 +5945,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); @@ -5967,7 +5967,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); @@ -5975,7 +5975,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); @@ -5983,15 +5983,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); @@ -6000,7 +6000,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); @@ -6020,7 +6020,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"); @@ -6031,7 +6031,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"); @@ -6046,7 +6046,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); @@ -6201,7 +6201,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; @@ -6327,7 +6327,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) @@ -6395,21 +6395,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); @@ -6423,35 +6423,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); @@ -6466,28 +6466,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); @@ -6501,28 +6501,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); @@ -6536,28 +6536,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); @@ -6589,7 +6589,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); @@ -6853,7 +6853,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", ""); @@ -6888,19 +6888,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); @@ -6913,7 +6913,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"); @@ -6924,12 +6924,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"); @@ -6938,7 +6938,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"); @@ -6953,9 +6953,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"); @@ -7082,9 +7082,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. @@ -7166,7 +7166,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: @@ -7179,46 +7179,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); } @@ -7227,7 +7227,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: @@ -7240,13 +7240,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); @@ -7254,32 +7254,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); } @@ -7287,33 +7287,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); } @@ -7322,7 +7322,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: { @@ -7336,13 +7336,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); @@ -7350,32 +7350,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); } @@ -7383,33 +7383,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); } @@ -7417,44 +7417,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"); @@ -7464,7 +7464,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"); @@ -7478,16 +7478,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); @@ -7518,11 +7518,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"); @@ -7530,7 +7530,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"); @@ -7554,7 +7554,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); @@ -7591,36 +7591,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"); @@ -7628,18 +7628,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"); @@ -7716,7 +7716,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}}; @@ -7735,7 +7735,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); @@ -7743,55 +7743,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"); @@ -7809,7 +7809,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); @@ -7886,7 +7886,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); @@ -7934,26 +7934,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"); @@ -8198,7 +8198,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); @@ -8223,7 +8223,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); @@ -8273,7 +8273,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); @@ -8380,11 +8380,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"); @@ -8442,26 +8442,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); \ @@ -8470,12 +8470,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. */ @@ -8483,11 +8483,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 53dfb5faf98..22a32586ff1 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -417,7 +417,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); @@ -475,7 +475,7 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value) { Object *ob = (Object *)ptr->data; Collection *grp = (Collection *)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] */ @@ -735,7 +735,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); } @@ -800,7 +800,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); @@ -810,21 +810,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; } @@ -844,7 +844,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; @@ -859,7 +859,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; @@ -874,7 +874,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; @@ -889,7 +889,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... */ @@ -902,7 +902,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; } @@ -937,7 +937,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 */ @@ -958,7 +958,7 @@ static int rna_MaterialSlot_name_length(PointerRNA *ptr) if (ma) return strlen(ma->id.name + 2); - + return 0; } @@ -1051,7 +1051,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; @@ -1064,7 +1064,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); } @@ -1078,7 +1078,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); } @@ -1465,7 +1465,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); @@ -1521,7 +1521,7 @@ static void rna_def_face_map(BlenderRNA *brna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_FaceMap_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, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); RNA_def_property_ui_text(prop, "Select", "Face-map selection state (for tools to use)"); @@ -1557,7 +1557,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. */ @@ -1697,7 +1697,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; */ @@ -1713,7 +1713,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", @@ -1728,7 +1728,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; @@ -1754,7 +1754,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"); @@ -1777,7 +1777,7 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) static void rna_def_object_face_maps(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; - + PropertyRNA *prop; FunctionRNA *func; @@ -1803,7 +1803,7 @@ static void rna_def_object_face_maps(BlenderRNA *brna, PropertyRNA *cprop) "rna_Object_active_face_map_index_range"); RNA_def_property_ui_text(prop, "Active Face Map Index", "Active index in face map array"); RNA_def_property_update(prop, NC_GEOM | ND_DATA, "rna_Object_internal_update_data"); - + /* face maps */ /* add_face_map */ func = RNA_def_function(srna, "new", "rna_Object_fmap_new"); RNA_def_function_ui_description(func, "Add face map to object"); @@ -1869,7 +1869,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[] = { @@ -1884,7 +1884,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 */ @@ -1937,7 +1937,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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); @@ -1956,7 +1956,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 */ @@ -1975,7 +1975,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"); @@ -2009,7 +2009,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"); @@ -2018,7 +2018,7 @@ 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"); @@ -2026,7 +2026,7 @@ static void rna_def_object(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_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... */ @@ -2039,21 +2039,21 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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); @@ -2072,7 +2072,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); @@ -2080,20 +2080,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) */ @@ -2111,7 +2111,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); @@ -2126,7 +2126,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); @@ -2204,14 +2204,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Vertex Groups", "Vertex groups of the object"); rna_def_object_vertex_groups(brna, prop); - + /* face maps */ prop = RNA_def_property(srna, "face_maps", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fmaps", NULL); RNA_def_property_struct_type(prop, "FaceMap"); RNA_def_property_ui_text(prop, "Face Maps", "Maps of faces of the object"); rna_def_object_face_maps(brna, prop); - + /* empty */ prop = RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "empty_drawtype"); @@ -2245,7 +2245,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"); @@ -2276,7 +2276,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"); @@ -2286,7 +2286,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_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER); @@ -2309,10 +2309,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); @@ -2321,7 +2321,7 @@ 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); @@ -2395,7 +2395,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"); @@ -2413,22 +2413,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"); @@ -2444,13 +2444,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"); @@ -2458,7 +2458,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"); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index a837a2ff032..fb27af7c464 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -218,7 +218,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 { @@ -355,7 +355,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); @@ -591,7 +591,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 4c09f7cf4cf..b79dee63136 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -219,7 +219,7 @@ static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, Object *ob = ptr->id.data; PointCache *cache = ptr->data; PTCacheID pid = BKE_ptcache_id_find(ob, NULL, cache); - + *min = 0; *max = 0; @@ -247,7 +247,7 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v Object *ob = ptr->id.data; PointCache *cache = ptr->data; PTCacheID pid = BKE_ptcache_id_find(ob, NULL, cache); - + if (pid.cache) { *(pid.cache_ptr) = BLI_findlink(pid.ptcaches, value); } @@ -527,13 +527,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) @@ -542,7 +542,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"); } @@ -580,11 +580,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"); } @@ -602,7 +602,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) { @@ -613,7 +613,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) { @@ -693,9 +693,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; @@ -880,44 +880,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"); @@ -928,21 +928,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); @@ -973,7 +973,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_struct_type(prop, "Collection"); @@ -1092,7 +1092,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"}, @@ -1122,7 +1122,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", ""}, @@ -1136,7 +1136,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", ""}, @@ -1153,9 +1153,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); @@ -1168,13 +1168,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); @@ -1188,9 +1188,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); @@ -1242,38 +1242,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); @@ -1286,7 +1286,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); @@ -1299,23 +1299,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"); @@ -1331,12 +1331,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"); @@ -1371,9 +1371,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); @@ -1385,9 +1385,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); @@ -1409,29 +1409,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); @@ -1443,13 +1443,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); @@ -1464,7 +1464,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"}, @@ -1473,7 +1473,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"}, @@ -1484,42 +1484,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 */ @@ -1527,7 +1527,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); @@ -1547,104 +1547,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, "view_layer", "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); @@ -1652,25 +1652,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); @@ -1678,16 +1678,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"); @@ -1717,44 +1717,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 844e61966bb..573bbb5345b 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -302,7 +302,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; @@ -342,7 +342,7 @@ static void rna_ParticleSystem_co_hair(ParticleSystem *particlesystem, Object *o if (part == NULL || pars == NULL) return; - + if (part->ren_as == PART_DRAW_OB || part->ren_as == PART_DRAW_GR || part->ren_as == PART_DRAW_NOT) return; @@ -689,7 +689,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; } @@ -717,7 +717,7 @@ static void rna_Particle_target_reset(Main *bmain, Scene *UNUSED(scene), Pointer else pt->flag &= ~PTARGET_VALID; } - + psys->recalc = PSYS_RECALC_RESET; DEG_id_tag_update(&ob->id, OB_RECALC_DATA); @@ -733,7 +733,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; DEG_id_tag_update(&ob->id, OB_RECALC_DATA); @@ -745,7 +745,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; @@ -907,26 +907,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); } @@ -1014,7 +1014,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); @@ -1047,10 +1047,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"); } @@ -1192,7 +1192,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); } @@ -1203,7 +1203,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); } @@ -1356,7 +1356,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", @@ -1742,7 +1742,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", ""}, @@ -1750,7 +1750,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", ""}, @@ -1758,7 +1758,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", ""}, @@ -1796,19 +1796,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", ""); @@ -3073,7 +3073,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); @@ -3124,7 +3124,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"); @@ -3136,7 +3136,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); @@ -3634,7 +3634,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 fb0f59a7977..6a5f6485029 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -176,11 +176,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); } @@ -189,7 +189,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); } @@ -240,9 +240,9 @@ static void rna_Pose_ik_solver_update(Main *bmain, Scene *UNUSED(scene), Pointer BKE_pose_tag_recalc(bmain, pose); /* checks & sorts pose channels */ DEG_relations_tag_update(bmain); - + BKE_pose_update_constraint_flags(pose); - + object_test_constraints(bmain, ob); DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); @@ -252,7 +252,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); @@ -262,22 +262,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; } @@ -388,12 +388,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); } @@ -402,7 +402,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 @@ -426,7 +426,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; } @@ -490,14 +490,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; } @@ -505,14 +505,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 @@ -620,12 +620,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; } @@ -647,7 +647,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; @@ -662,7 +662,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; @@ -677,7 +677,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... */ @@ -690,7 +690,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; } @@ -737,7 +737,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"); @@ -745,12 +745,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); @@ -765,21 +765,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"); } @@ -854,7 +854,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"); @@ -873,7 +873,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); @@ -893,7 +893,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_PTR_NO_OWNERSHIP); 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"); @@ -919,7 +919,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... */ @@ -932,14 +932,14 @@ 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_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); 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 */ @@ -948,19 +948,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"); @@ -969,14 +969,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"); @@ -985,14 +985,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"); @@ -1030,7 +1030,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); @@ -1076,19 +1076,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); @@ -1158,21 +1158,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"); @@ -1182,7 +1182,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); @@ -1202,7 +1202,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"); @@ -1213,7 +1213,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); @@ -1222,7 +1222,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); @@ -1239,7 +1239,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); @@ -1439,7 +1439,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", @@ -1452,7 +1452,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"); @@ -1473,7 +1473,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"); @@ -1487,10 +1487,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 fe12e1cd528..0dd33944dda 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -291,7 +291,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); @@ -332,7 +332,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)); @@ -790,7 +790,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"); @@ -890,7 +890,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 0a8a99d779a..60a1783f118 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -108,19 +108,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 @@ -133,7 +133,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 @@ -148,16 +148,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); } @@ -165,7 +165,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; @@ -180,7 +180,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; } @@ -196,7 +196,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 @@ -212,7 +212,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 @@ -226,7 +226,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 @@ -239,7 +239,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) { @@ -251,7 +251,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 @@ -278,7 +278,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 @@ -294,7 +294,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 @@ -308,7 +308,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 @@ -322,7 +322,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 @@ -336,7 +336,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 @@ -350,7 +350,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 @@ -737,7 +737,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, "Collection"); @@ -750,13 +750,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", "Collection 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"); @@ -765,7 +765,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"); @@ -776,7 +776,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"); @@ -788,7 +788,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); @@ -843,13 +843,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"); @@ -858,21 +858,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); @@ -880,18 +880,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"); @@ -900,10 +900,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); @@ -913,13 +913,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) @@ -928,7 +928,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) @@ -937,7 +937,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"); @@ -946,7 +946,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); @@ -954,7 +954,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"); @@ -964,7 +964,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); @@ -975,7 +975,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); @@ -983,7 +983,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); @@ -994,7 +994,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 1a66174d8ce..53b98928c31 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -945,10 +945,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); @@ -2253,18 +2253,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"); @@ -2356,7 +2356,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); @@ -2454,7 +2454,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); @@ -2522,7 +2522,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); @@ -2781,7 +2781,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 8055c8fe4d6..bec70cd6cf3 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -122,7 +122,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"}, @@ -419,7 +419,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)"}, @@ -429,12 +429,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} }; @@ -524,12 +524,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)) @@ -772,7 +772,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; @@ -826,14 +826,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 @@ -844,14 +844,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; @@ -860,14 +860,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; @@ -896,7 +896,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); } @@ -926,7 +926,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... */ @@ -940,13 +940,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); } @@ -1416,7 +1416,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; @@ -1432,7 +1432,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; } @@ -1592,7 +1592,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) { CollectionObject *cob; @@ -1617,7 +1617,7 @@ static void rna_Scene_use_simplify_update(Main *bmain, Scene *UNUSED(scene), Poi for (SETLOOPER_SET_ONLY(sce, sce_iter, base)) { object_simplify_update(base->object); } - + WM_main_add_notifier(NC_GEOM | ND_DATA, NULL); DEG_id_tag_update(&sce->id, 0); } @@ -1727,7 +1727,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; @@ -2103,13 +2103,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); @@ -2120,7 +2120,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"); @@ -2129,38 +2129,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); } @@ -2368,14 +2368,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"); @@ -2394,7 +2394,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 @@ -2428,7 +2428,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, " @@ -2438,7 +2438,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 */ @@ -2446,16 +2446,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_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_boolean_sdna(prop, NULL, "auto_normalize", 1); @@ -2575,7 +2575,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, "double_threshold", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "doublimit"); RNA_def_property_ui_text(prop, "Double Threshold", "Limit for removing duplicates and 'Auto Merge'"); @@ -2625,14 +2625,14 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_ENUM_FLAG); 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_bitflag_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_bitflag_sdna(prop, NULL, "snap_uv_mode"); @@ -2651,7 +2651,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", @@ -2671,14 +2671,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", @@ -2691,17 +2691,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 */ @@ -2717,12 +2717,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"); @@ -2736,7 +2736,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"); @@ -2744,36 +2744,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"); @@ -3157,7 +3157,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", ""}, @@ -3172,7 +3172,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"); @@ -3284,7 +3284,7 @@ void rna_def_view_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_ViewLayer_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"); @@ -3338,7 +3338,7 @@ void rna_def_view_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_ViewLayer_pass_update"); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + prop = RNA_def_property(srna, "use_pass_emit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_EMIT); RNA_def_property_ui_text(prop, "Emit", "Deliver emission pass"); @@ -3410,7 +3410,7 @@ void rna_def_view_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_ViewLayer_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"); @@ -4751,7 +4751,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + 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"}, @@ -4845,7 +4845,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); @@ -4853,7 +4853,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); @@ -4861,14 +4861,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); @@ -4898,7 +4898,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); @@ -4921,7 +4921,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); @@ -4929,7 +4929,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"); @@ -4937,7 +4937,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); @@ -4945,7 +4945,7 @@ 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); @@ -4971,14 +4971,14 @@ 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_freestyle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_EDGE_FRS); @@ -4994,21 +4994,21 @@ 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_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); @@ -5038,7 +5038,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size "); 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); @@ -5066,24 +5066,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); @@ -5091,7 +5091,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); @@ -5099,7 +5099,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", @@ -5131,7 +5131,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", @@ -5167,7 +5167,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); @@ -5228,23 +5228,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"); @@ -5259,27 +5259,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", @@ -5290,7 +5290,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"); @@ -5328,7 +5328,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); @@ -5560,7 +5560,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", @@ -5574,14 +5574,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); @@ -5589,7 +5589,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", @@ -6177,7 +6177,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"}, @@ -6202,7 +6202,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); @@ -6270,7 +6270,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", ""); @@ -6295,7 +6295,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_int_default(prop, 1); 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"); @@ -6304,7 +6304,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_int_default(prop, 250); 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"); @@ -6313,7 +6313,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); @@ -6338,14 +6338,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"); @@ -6368,16 +6368,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); @@ -6385,7 +6385,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 */ #if 0 /* XXX: Is this actually needed? */ prop = RNA_def_property(srna, "use_frame_drop", PROP_BOOLEAN, PROP_NONE); @@ -6412,13 +6412,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); @@ -6426,7 +6426,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", @@ -6436,14 +6436,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); @@ -6470,7 +6470,7 @@ 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); @@ -6505,7 +6505,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_struct_type(prop, "TransformOrientation"); RNA_def_property_pointer_funcs(prop, "rna_Scene_current_orientation_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current transformation orientation"); - + /* Audio Settings */ prop = RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set"); @@ -6560,7 +6560,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); 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"); diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index ba03472d8d5..003e2561a22 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -105,7 +105,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_graph_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); } @@ -305,7 +305,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 731333bd18a..e30b75b27bd 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -394,10 +394,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); @@ -428,9 +428,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 a26aceda3b9..1d6d7c49523 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -183,7 +183,7 @@ static void rna_ParticleEdit_update(bContext *C, PointerRNA *UNUSED(ptr)) 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->object) { Object *ob = pset->object; @@ -238,7 +238,7 @@ static int rna_ParticleEdit_hair_get(PointerRNA *ptr) return (edit && edit->psys); } - + return 0; } @@ -402,7 +402,7 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr)) Object *obedit = OBEDIT_FROM_OBACT(ob); 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) { @@ -410,14 +410,14 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr)) for (slink = sa->spacedata.first; slink; slink = slink->next) { if (slink->spacetype == SPACE_IMAGE) { SpaceImage *sima = (SpaceImage *)slink; - + if (!sima->pin) ED_space_image_set(sima, scene, obedit, ima); } } } } - + if (ob && ob->type == OB_MESH) { BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); @@ -434,7 +434,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]; @@ -747,35 +747,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"); @@ -796,13 +796,13 @@ static void rna_def_image_paint(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE); 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"); @@ -813,15 +813,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)"); @@ -833,37 +833,37 @@ 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_flag(prop, PROP_CONTEXT_UPDATE); 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) @@ -1060,10 +1060,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"); @@ -1075,18 +1075,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"); @@ -1132,23 +1132,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_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 832d5b28bd1..b4c9e7ba3a2 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -243,7 +243,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 @@ -326,12 +326,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 @@ -973,7 +973,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_space.c b/source/blender/makesrna/intern/rna_space.c index 3daf4ca6fe0..489f2b73bf3 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1447,12 +1447,12 @@ static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr) else saction->action = NULL; } - + /* Collapse summary channel and hide channel list for timeline */ if (saction->mode == SACTCONT_TIMELINE) { saction->ads.flag |= ADS_FLAG_SUMMARY_COLLAPSED; } - + if (sa && sa->spacedata.first == saction) { ARegion *channels_region = BKE_area_find_region_type(sa, RGN_TYPE_CHANNELS); if (channels_region) { @@ -1465,7 +1465,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr) ED_region_visibility_change_update(C, channels_region); } } - + /* recalculate extents of channel list */ saction->flag |= SACTION_TEMP_NEEDCHANSYNC; } @@ -3637,7 +3637,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) RNA_def_property_enum_items(prop, autosnap_items); RNA_def_property_ui_text(prop, "Auto Snap", "Automatic time snapping settings for transformations"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, NULL); - + /* displaying cache status */ prop = RNA_def_property(srna, "show_cache", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cache_display", TIME_CACHE_DISPLAY); 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 5449b67c040..b848bb96392 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -191,7 +191,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); } @@ -247,7 +247,7 @@ void rna_TextureSlot_update(bContext *C, 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 @@ -274,7 +274,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]; @@ -293,7 +293,7 @@ static int rna_TextureSlot_name_length(PointerRNA *ptr) if (mtex->tex) return strlen(mtex->tex->id.name + 2); - + return 0; } @@ -312,7 +312,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; @@ -325,7 +325,7 @@ static int rna_TextureSlot_output_node_get(PointerRNA *ptr) } } } - + mtex->which_output = 0; return 0; } @@ -339,18 +339,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; @@ -361,7 +361,7 @@ static const EnumPropertyItem *rna_TextureSlot_output_node_itemf( } } } - + RNA_enum_item_end(&item, &totitem); *r_free = true; @@ -382,14 +382,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); } @@ -412,7 +412,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"}, @@ -431,7 +431,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"); @@ -446,34 +446,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"); @@ -484,13 +484,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); @@ -507,7 +507,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"); @@ -562,7 +562,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"); @@ -639,7 +639,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); @@ -652,24 +652,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_lightprobes", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "afmax"); RNA_def_property_range(prop, 1, 256); @@ -677,7 +677,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); @@ -908,7 +908,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); @@ -1016,7 +1016,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); @@ -1329,19 +1329,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); @@ -1451,7 +1451,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"); @@ -1479,44 +1479,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_ui.c b/source/blender/makesrna/intern/rna_ui.c index ce1f9efcf63..e02421b9270 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); @@ -211,7 +211,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)); @@ -251,7 +251,7 @@ static StructRNA *rna_Panel_register( dummypt.parent_id, dummypt.idname); return NULL; } - + /* create a new panel type */ pt = MEM_callocN(sizeof(PanelType), "python buttons panel"); memcpy(pt, &dummypt, sizeof(dummypt)); @@ -296,7 +296,7 @@ static StructRNA *rna_Panel_register( /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); - + return pt->ext.srna; } @@ -590,7 +590,7 @@ static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type) return; if (!(art = region_type_find(NULL, ht->space_type, ht->region_type))) return; - + RNA_struct_free_extension(type, &ht->ext); RNA_struct_free(&BLENDER_RNA, type); @@ -642,7 +642,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)); @@ -659,7 +659,7 @@ static StructRNA *rna_Header_register( /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); - + return ht->ext.srna; } @@ -720,7 +720,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); @@ -754,7 +754,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)); @@ -772,7 +772,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; @@ -812,7 +812,7 @@ static StructRNA *rna_Menu_register( /* update while blender is running */ WM_main_add_notifier(NC_WINDOW, NULL); - + return mt->ext.srna; } @@ -958,7 +958,7 @@ static void rna_def_ui_layout(BlenderRNA *brna) {UI_LAYOUT_ALIGN_RIGHT, "RIGHT", 0, "Right", ""}, {0, NULL, 0, NULL, NULL} }; - + static const EnumPropertyItem emboss_items[] = { {UI_EMBOSS, "NORMAL", 0, "Normal", "Draw standard button emboss style"}, {UI_EMBOSS_NONE, "NONE", 0, "None", "Draw only text and icons"}, @@ -975,15 +975,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"); @@ -999,7 +999,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"); @@ -1008,7 +1008,7 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop = RNA_def_property(srna, "emboss", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, emboss_items); RNA_def_property_enum_funcs(prop, "rna_UILayout_emboss_get", "rna_UILayout_emboss_set", NULL); - + prop = RNA_def_property(srna, "use_property_split", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_property_split_get", "rna_UILayout_property_split_set"); } @@ -1019,7 +1019,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"}, @@ -1028,7 +1028,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"); @@ -1061,11 +1061,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"); @@ -1102,7 +1102,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); @@ -1115,7 +1115,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); @@ -1263,7 +1263,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"); @@ -1318,7 +1318,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 d61f6166889..3a7a2edd660 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); @@ -291,8 +298,9 @@ static void rna_uiItemPopoverPanelFromGroup( uiItemPopoverPanelFromGroup(layout, C, space_id, region_id, context, category); } -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); @@ -308,8 +316,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); @@ -360,8 +369,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; @@ -493,7 +503,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); @@ -514,7 +524,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"); @@ -725,7 +735,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); @@ -802,7 +812,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"); @@ -852,15 +862,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"); @@ -869,7 +879,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); @@ -985,7 +995,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 1cd3a8b83d7..74f01c0a1a4 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); } @@ -258,7 +258,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; @@ -291,10 +291,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 @@ -316,7 +316,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; } @@ -751,7 +751,7 @@ static int rna_UserDef_studiolight_show_expanded_get(PointerRNA *ptr) } static void rna_UserDef_studiolight_show_expanded_set(PointerRNA *ptr, const bool value) -{ +{ StudioLight *sl = (StudioLight *)ptr->data; sl->flag ^= STUDIOLIGHT_UI_EXPANDED; sl->flag |= value?STUDIOLIGHT_UI_EXPANDED: 0; @@ -798,7 +798,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"}, @@ -809,7 +809,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", ""); @@ -825,13 +825,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); @@ -855,14 +855,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); @@ -877,66 +877,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", ""); @@ -952,12 +952,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", ""); @@ -967,7 +967,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", ""); @@ -1007,16 +1007,16 @@ 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"); @@ -1024,7 +1024,7 @@ static void rna_def_userdef_theme_ui_panel(BlenderRNA *brna) prop = RNA_def_property(srna, "sub_back", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_ui_text(prop, "Sub 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"); @@ -1079,7 +1079,7 @@ 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", ""); @@ -1089,17 +1089,17 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Toolbar Item 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", ""); @@ -1109,32 +1109,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", ""); @@ -1149,7 +1149,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", ""); @@ -1159,7 +1159,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", ""); @@ -1184,12 +1184,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", ""); @@ -1202,7 +1202,7 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) prop = RNA_def_property(srna, "icon_saturation", PROP_FLOAT, PROP_FACTOR); RNA_def_property_ui_text(prop, "Icon Saturation", "Saturation of icons in the interface"); 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); @@ -1221,13 +1221,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); @@ -1500,7 +1500,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", ""); @@ -1571,7 +1571,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"); @@ -1661,7 +1661,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); @@ -1750,7 +1750,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 */ @@ -1941,7 +1941,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); @@ -1953,19 +1953,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); @@ -1977,7 +1977,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); } @@ -2053,33 +2053,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); @@ -2210,13 +2210,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); @@ -2246,7 +2246,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); @@ -2274,7 +2274,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); @@ -2318,13 +2318,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); @@ -2348,7 +2348,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); @@ -2455,7 +2455,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); @@ -2645,7 +2645,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); @@ -2684,13 +2684,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); @@ -2702,21 +2702,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); @@ -2740,8 +2740,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); @@ -2754,76 +2754,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); @@ -2855,94 +2855,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); @@ -2998,7 +2998,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); @@ -3102,7 +3102,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", ""}, @@ -3227,7 +3227,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"); @@ -3380,14 +3380,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); @@ -3419,7 +3419,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"); @@ -3524,7 +3524,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"); @@ -3596,7 +3596,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); @@ -3700,7 +3700,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); @@ -3740,7 +3740,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_DRAW_NAVIGATE); RNA_def_property_ui_text(prop, "Navigate Manipulator", "Use 3D navigation manipulator"); RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update"); - + /* TODO, expose once it's working. */ #if 0 prop = RNA_def_property(srna, "show_manipulator_shaded", PROP_BOOLEAN, PROP_NONE); @@ -3761,7 +3761,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"); @@ -3769,7 +3769,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); @@ -3806,14 +3806,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"}, @@ -3825,15 +3825,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); @@ -3849,7 +3849,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"); @@ -3892,7 +3892,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); @@ -3901,13 +3901,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"); @@ -3919,7 +3919,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); @@ -3933,7 +3933,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"); @@ -3955,13 +3955,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); @@ -3977,7 +3977,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"); @@ -3989,7 +3989,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"); @@ -4005,7 +4005,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); @@ -4014,7 +4014,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"); @@ -4105,7 +4105,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)"}, @@ -4136,7 +4136,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"); @@ -4236,7 +4236,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", @@ -4296,7 +4296,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); @@ -4385,7 +4385,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); @@ -4444,44 +4444,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", @@ -4519,7 +4519,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"); @@ -4543,7 +4543,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"); @@ -4615,13 +4615,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"); @@ -4630,7 +4630,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", @@ -4645,7 +4645,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"}, @@ -4655,22 +4655,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"); @@ -4686,7 +4686,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"); @@ -4738,7 +4738,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"); @@ -4747,7 +4747,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); @@ -4773,7 +4773,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"); @@ -4884,7 +4884,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"); @@ -4909,25 +4909,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); @@ -4954,7 +4954,7 @@ void RNA_def_userdef(BlenderRNA *brna) rna_def_userdef_addon_pref(brna); rna_def_userdef_studiolight(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 78d46d35246..487b5220c86 100644 --- a/source/blender/makesrna/intern/rna_vfont.c +++ b/source/blender/makesrna/intern/rna_vfont.c @@ -70,7 +70,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 3aa59ca564f..c4e15174c88 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -500,7 +500,7 @@ static wmOperator *rna_OperatorProperties_find_operator(PointerRNA *ptr) } } } - + return NULL; } @@ -796,7 +796,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; } @@ -848,7 +848,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! */ @@ -976,7 +976,7 @@ static PointerRNA rna_WindowManager_active_keyconfig_get(PointerRNA *ptr) if (!kc) kc = wm->defaultconf; - + return rna_pointer_inherit_refine(ptr, &RNA_KeyConfig, kc); } @@ -1611,13 +1611,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"); @@ -1819,12 +1819,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"); @@ -1849,7 +1849,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); @@ -1863,7 +1863,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); @@ -1878,12 +1878,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); @@ -1915,17 +1915,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); @@ -2119,7 +2119,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"); @@ -2138,7 +2138,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); } @@ -2177,7 +2177,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"); @@ -2282,7 +2282,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"); @@ -2310,7 +2310,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 ab534159a9e..aff696696af 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -98,7 +98,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) @@ -202,8 +202,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; @@ -224,24 +225,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; @@ -694,7 +696,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"); @@ -822,7 +824,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"); @@ -844,7 +846,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 92fbbd61898..ead67814f01 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -143,7 +143,7 @@ static void rna_def_world_mist(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + static const EnumPropertyItem falloff_items[] = { {WO_MIST_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Use quadratic progression"}, {WO_MIST_LINEAR, "LINEAR", 0, "Linear", "Use linear progression"}, @@ -186,7 +186,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); @@ -214,7 +214,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"); - + /* nested structs */ prop = RNA_def_property(srna, "light_settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); 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())) |