diff options
Diffstat (limited to 'source/blender')
44 files changed, 475 insertions, 260 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 33ff3f43c07..a7b111d49da 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -1409,7 +1409,8 @@ void _RNA_warning(const char *format, ...) ATTR_PRINTF_FORMAT(1, 2); /* Equals test. */ -/* Note: In practice, EQ_STRICT and EQ_COMPARE have same behavior currently, and will yield same result. */ +/* Note: In practice, EQ_STRICT and EQ_COMPARE have same behavior currently, + * and will yield same result. */ typedef enum eRNACompareMode { /* Only care about equality, not full comparison. */ RNA_EQ_STRICT, /* set/unset ignored */ @@ -1445,7 +1446,8 @@ typedef enum eRNAOverrideMatch { } eRNAOverrideMatch; typedef enum eRNAOverrideMatchResult { - /* Some new property overrides were created to take into account differences between local and reference. */ + /* Some new property overrides were created to take into account + * differences between local and reference. */ RNA_OVERRIDE_MATCH_RESULT_CREATED = 1 << 0, /* Some properties were reset to reference values. */ RNA_OVERRIDE_MATCH_RESULT_RESTORED = 1 << 1, diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 706f1ca9e84..59c03cf34b3 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -262,8 +262,18 @@ PropertyRNA *RNA_def_float_array(StructOrFunctionRNA *cont, float softmin, float softmax); -//PropertyRNA *RNA_def_float_dynamic_array(StructOrFunctionRNA *cont, const char *identifier, float hardmin, float hardmax, -// const char *ui_name, const char *ui_description, float softmin, float softmax, unsigned int dimension, unsigned short dim_size[]); +#if 0 +PropertyRNA *RNA_def_float_dynamic_array(StructOrFunctionRNA *cont, + const char *identifier, + float hardmin, + float hardmax, + const char *ui_name, + const char *ui_description, + float softmin, + float softmax, + unsigned int dimension, + unsigned short dim_size[]); +#endif PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont, const char *identifier, diff --git a/source/blender/makesrna/RNA_documentation.h b/source/blender/makesrna/RNA_documentation.h index 7999c45f758..cf1cf5fa50e 100644 --- a/source/blender/makesrna/RNA_documentation.h +++ b/source/blender/makesrna/RNA_documentation.h @@ -18,5 +18,6 @@ * \ingroup RNA * \page makesrna makesrna * \section aboutmakesrna About RNA - * The \ref RNA module defines and provides the access API to the data, thus encapsulating \ref DNA + * The \ref RNA module defines and provides the access API to the data, + * thus encapsulating \ref DNA */ diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 95d3aee634f..463d612094e 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -248,7 +248,12 @@ const EnumPropertyItem *RNA_action_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free); -// EnumPropertyItem *RNA_action_local_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, bool *r_free); +#if 0 +EnumPropertyItem *RNA_action_local_itemf(struct bContext *C, + struct PointerRNA *ptr, + struct PropertyRNA *prop, + bool *r_free); +#endif const EnumPropertyItem *RNA_collection_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 961b4b23073..1cc7d772ecc 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -201,19 +201,25 @@ typedef enum PropertyFlag { * only apply this to types that are derived from an ID ()*/ PROP_ID_SELF_CHECK = (1 << 20), /* use for... - * - pointers: in the UI and python so unsetting or setting to None won't work - * - strings: so our internal generated get/length/set functions know to do NULL checks before access [#30865] */ + * - pointers: in the UI and python so unsetting or setting to None won't work. + * - strings: so our internal generated get/length/set + * functions know to do NULL checks before access T30865. + */ PROP_NEVER_NULL = (1 << 18), /* currently only used for UI, this is similar to PROP_NEVER_NULL * except that the value may be NULL at times, used for ObData, where an Empty's will be NULL - * but setting NULL on a mesh object is not possible. So, if its not NULL, setting NULL cant be done! */ + * but setting NULL on a mesh object is not possible. + * So, if its not NULL, setting NULL cant be done! + */ PROP_NEVER_UNLINK = (1 << 25), /* Pointers to data that is not owned by the struct. * Typical example: Bone.parent, Bone.child, etc., and nearly all ID pointers. - * This is crucial information for processes that walk the whole data of an ID e.g. (like static override). - * Note that all ID pointers are enforced to this by default, this probably will need to be rechecked - * (see ugly infamous NodeTrees of mat/tex/scene/etc.). */ + * This is crucial information for processes that walk the whole data of an ID e.g. + * (like static override). + * Note that all ID pointers are enforced to this by default, + * this probably will need to be rechecked (see ugly infamous NodeTrees of mat/tex/scene/etc.). + */ PROP_PTR_NO_OWNERSHIP = (1 << 7), /* flag contains multiple enums. @@ -248,7 +254,8 @@ typedef enum PropertyFlag { PROP_NO_DEG_UPDATE = (1 << 30), } PropertyFlag; -/* Flags related to comparing and overriding RNA properties. Make sure enums are updated with these */ +/* Flags related to comparing and overriding RNA properties. + * Make sure enums are updated with these */ /* FREE FLAGS: 2, 3, 4, 5, 6, 7, 8, 9, 12 and above. */ typedef enum PropertyOverrideFlag { /* Means the property can be overridden by a local 'proxy' of some linked datablock. */ @@ -275,7 +282,8 @@ typedef enum ParameterFlag { PARM_REQUIRED = (1 << 0), PARM_OUTPUT = (1 << 1), PARM_RNAPTR = (1 << 2), - /* This allows for non-breaking API updates, when adding non-critical new parameter to a callback function. + /* This allows for non-breaking API updates, + * when adding non-critical new parameter to a callback function. * This way, old py code defining funcs without that parameter would still work. * WARNING: any parameter after the first PYFUNC_OPTIONAL one will be considered as optional! * NOTE: only for input parameters! @@ -295,16 +303,20 @@ typedef struct ListBaseIterator { typedef struct ArrayIterator { char *ptr; - char *endptr; /* past the last valid pointer, only for comparisons, ignores skipped values */ - void *free_ptr; /* will be freed if set */ + /* Past the last valid pointer, only for comparisons, ignores skipped values. */ + char *endptr; + /* Will be freed if set. */ + void *free_ptr; int itemsize; - /* array length with no skip functions applied, take care not to compare against index from animsys - * or python indices */ + /* Array length with no skip functions applied, + * take care not to compare against index from animsys or python indices. */ int length; - /* optional skip function, when set the array as viewed by rna can contain only a subset of the members. - * this changes indices so quick array index lookups are not possible when skip function is used. */ + /* Optional skip function, + * when set the array as viewed by rna can contain only a subset of the members. + * this changes indices so quick array index lookups are not possible when skip function is used. + */ IteratorSkipFunc skip; } ArrayIterator; @@ -476,10 +488,12 @@ typedef enum FunctionFlag { * [ReportList *reports], * <other RNA-defined parameters>); */ - /* Pass ID owning 'self' data (i.e. ptr->id.data, might be same as self in case data is an ID...). */ + /* Pass ID owning 'self' data + * (i.e. ptr->id.data, might be same as self in case data is an ID...). */ FUNC_USE_SELF_ID = (1 << 11), - /* Do not pass the object (DNA struct pointer) from which it is called, used to define static or class functions. */ + /* Do not pass the object (DNA struct pointer) from which it is called, + * used to define static or class functions. */ FUNC_NO_SELF = (1 << 0), /* Pass RNA type, used to define class functions, only valid when FUNC_NO_SELF is set. */ FUNC_USE_SELF_TYPE = (1 << 1), @@ -490,11 +504,13 @@ typedef enum FunctionFlag { FUNC_USE_REPORTS = (1 << 4), /***** Registering of python subclasses. *****/ - /* This function is part of the registerable class' interface, and can be implemented/redefined in python. */ + /* This function is part of the registerable class' interface, + * and can be implemented/redefined in python. */ FUNC_REGISTER = (1 << 5), /* Subclasses can choose not to implement this function. */ FUNC_REGISTER_OPTIONAL = FUNC_REGISTER | (1 << 6), - /* If not set, the python function implementing this call is not allowed to write into data-blocks. + /* If not set, the python function implementing this call + * is not allowed to write into data-blocks. * Except for WindowManager and Screen currently, see rna_id_write_error() in bpy_rna.c */ FUNC_ALLOW_WRITE = (1 << 12), @@ -505,7 +521,8 @@ typedef enum FunctionFlag { FUNC_EXPORT = (1 << 8), /* Function has been defined at runtime, not statically in RNA source code. */ FUNC_RUNTIME = (1 << 9), - /* UNUSED CURRENTLY? Function owns its identifier and description strings, and has to free them when deleted. */ + /* UNUSED CURRENTLY? Function owns its identifier and description strings, + * and has to free them when deleted. */ FUNC_FREE_POINTERS = (1 << 10), } FunctionFlag; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 168df3285b2..2e7277606da 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -2580,7 +2580,8 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA /* XXX only arrays and strings are allowed to be dynamic, is this checked anywhere? */ else if (cptr || (flag & PROP_DYNAMIC)) ptrstr = pout ? "**" : "*"; - /* fixed size arrays and RNA pointers are pre-allocated on the ParameterList stack, pass a pointer to it */ + /* Fixed size arrays and RNA pointers are pre-allocated on the ParameterList stack, + * pass a pointer to it. */ else if (type == PROP_POINTER || dparm->prop->arraydimension) ptrstr = "*"; else if ((type == PROP_POINTER) && (flag_parameter & PARM_RNAPTR) && !(flag & PROP_THICK_WRAP)) @@ -2666,8 +2667,8 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA valstr = "*"; } - /* this must be kept in sync with RNA_parameter_dynamic_length_get_data and RNA_parameter_get, - * we could just call the function directly, but this is faster */ + /* This must be kept in sync with RNA_parameter_dynamic_length_get_data and + * RNA_parameter_get, we could just call the function directly, but this is faster. */ if (flag & PROP_DYNAMIC) { fprintf(f, "\t%s_len = %s((ParameterDynAlloc *)_data)->array_tot;\n", @@ -3466,7 +3467,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr case PROP_POINTER: { PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; - /* XXX This systematically enforces that flag on ID pointers... we'll probably have to revisit. :/ */ + /* XXX This systematically enforces that flag on ID pointers... + * we'll probably have to revisit. :/ */ StructRNA *type = rna_find_struct((const char *)pprop->type); if (type && (type->flag & STRUCT_ID)) { prop->flag |= PROP_PTR_NO_OWNERSHIP; @@ -3476,7 +3478,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr case PROP_COLLECTION: { CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; - /* XXX This systematically enforces that flag on ID pointers... we'll probably have to revisit. :/ */ + /* XXX This systematically enforces that flag on ID pointers... + * we'll probably have to revisit. :/ */ StructRNA *type = rna_find_struct((const char *)cprop->item_type); if (type && (type->flag & STRUCT_ID)) { prop->flag |= PROP_PTR_NO_OWNERSHIP; diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 8a3cf3be55e..149cd7caf84 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -904,7 +904,8 @@ static void rna_ImagePreview_icon_pixels_float_set(PointerRNA *ptr, const float static int rna_ImagePreview_icon_id_get(PointerRNA *ptr) { - /* Using a callback here allows us to only generate icon matching that preview when icon_id is requested. */ + /* Using a callback here allows us to only generate icon matching + * that preview when icon_id is requested. */ return BKE_icon_preview_ensure(ptr->id.data, (PreviewImage *)(ptr->data)); } static void rna_ImagePreview_icon_reload(PreviewImage *prv) @@ -1299,7 +1300,8 @@ static void rna_def_ID_override_static_property(BlenderRNA *brna) RNA_def_struct_ui_text( srna, "ID Static Override Property", "Description of an overridden property"); - /* String pointer, we *should* add get/set/etc. But NULL rna_path would be a nasty bug anyway... */ + /* String pointer, we *should* add get/set/etc. + * But NULL rna_path would be a nasty bug anyway. */ prop = RNA_def_string(srna, "rna_path", NULL, diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 541c2184a94..99a6247da79 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -398,7 +398,10 @@ static IDProperty *rna_idproperty_find(PointerRNA *ptr, const char *name) else { /* Not sure why that happens sometimes, with nested properties... */ /* Seems to be actually array prop, name is usually "0"... To be sorted out later. */ - // printf("Got unexpected IDProp container when trying to retrieve %s: %d\n", name, group->type); +#if 0 + printf( + "Got unexpected IDProp container when trying to retrieve %s: %d\n", name, group->type); +#endif } } @@ -585,7 +588,8 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr) return rna_idproperty_check_ex(prop, ptr, false); } -/* This function always return the valid, real data pointer, be it a regular RNA property one, or an IDProperty one. */ +/* This function always return the valid, real data pointer, be it a regular RNA property one, + * or an IDProperty one. */ PropertyRNA *rna_ensure_property_realdata(PropertyRNA **prop, PointerRNA *ptr) { return rna_idproperty_check_ex(prop, ptr, true); @@ -754,7 +758,8 @@ bool RNA_struct_idprops_datablock_allowed(const StructRNA *type) /** * Whether given type implies datablock usage by IDProperties. - * This is used to prevent classes allowed to have IDProperties, but not datablock ones, to indirectly use some + * This is used to prevent classes allowed to have IDProperties, + * but not datablock ones, to indirectly use some * (e.g. by assigning an IDP_GROUP containing some IDP_ID pointers...). */ bool RNA_struct_idprops_contains_datablock(const StructRNA *type) @@ -875,7 +880,8 @@ unsigned int RNA_struct_count_properties(StructRNA *srna) return counter; } -/* low level direct access to type->properties, note this ignores parent classes so should be used with care */ +/* Low level direct access to type->properties, + * note this ignores parent classes so should be used with care. */ const struct ListBase *RNA_struct_type_properties(StructRNA *srna) { return &srna->cont.properties; @@ -1677,7 +1683,8 @@ void RNA_property_enum_items_gettexted_all(bContext *C, bool exists = false; int i_fixed; - /* items that do not exist on list are returned, but have their names/identifiers NULLed out */ + /* Items that do not exist on list are returned, + * but have their names/identifiers NULL'ed out. */ for (i_fixed = 0; item[i_fixed].identifier; i_fixed++) { if (STREQ(item[i_fixed].identifier, item_array[i].identifier)) { exists = true; @@ -1995,7 +2002,8 @@ bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop) } /** - * Version of #RNA_property_editable that tries to return additional info in \a r_info that can be exposed in UI. + * Version of #RNA_property_editable that tries to return additional info in \a r_info + * that can be exposed in UI. */ bool RNA_property_editable_info(PointerRNA *ptr, PropertyRNA *prop, const char **r_info) { @@ -2109,8 +2117,10 @@ bool RNA_property_overridable_get(PointerRNA *ptr, PropertyRNA *prop) { if (prop->magic == RNA_MAGIC) { /* Special handling for insertions of constraints or modifiers... */ - /* TODO Note We may want to add a more generic system to RNA (like a special property in struct of items) - * if we get more overrideable collections, for now we can live with those special-cases handling I think. */ + /* TODO Note We may want to add a more generic system to RNA + * (like a special property in struct of items) + * if we get more overrideable collections, + * for now we can live with those special-cases handling I think. */ if (RNA_struct_is_a(ptr->type, &RNA_Constraint)) { bConstraint *con = ptr->data; if (con->flag & CONSTRAINT_STATICOVERRIDE_LOCAL) { @@ -2123,7 +2133,8 @@ bool RNA_property_overridable_get(PointerRNA *ptr, PropertyRNA *prop) return true; } } - /* If this is a RNA-defined property (real or 'virtual' IDProp), we want to use RNA prop flag. */ + /* If this is a RNA-defined property (real or 'virtual' IDProp), + * we want to use RNA prop flag. */ return !(prop->flag_override & PROPOVERRIDE_NO_COMPARISON) && (prop->flag_override & PROPOVERRIDE_OVERRIDABLE_STATIC); } @@ -2320,7 +2331,8 @@ void RNA_property_update_cache_add(PointerRNA *ptr, PropertyRNA *prop) /* 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 */ + /* Just match by id only for now, + * since most update calls that we'll encounter only really care about this. */ /* TODO: later, the cache might need to have some nesting on L1 to cope better * with these problems + some tagging to indicate we need this */ if (uce->ptr.id.data == ptr->id.data) @@ -3798,7 +3810,8 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA item = IDP_New(IDP_GROUP, &val, ""); IDP_AppendArray(idprop, item); - /* IDP_FreeProperty(item); */ /* IDP_AppendArray does a shallow copy (memcpy), only free memory */ + /* IDP_AppendArray does a shallow copy (memcpy), only free memory */ + /* IDP_FreeProperty(item); */ MEM_freeN(item); rna_idproperty_touch(idprop); } @@ -3813,7 +3826,8 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA item = IDP_New(IDP_GROUP, &val, ""); IDP_AppendArray(idprop, item); - /* IDP_FreeProperty(item); */ /* IDP_AppendArray does a shallow copy (memcpy), only free memory */ + /* IDP_AppendArray does a shallow copy (memcpy), only free memory */ + /* IDP_FreeProperty(item); */ MEM_freeN(item); } } @@ -3830,7 +3844,10 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA } # if 0 else { - printf("%s %s.%s: not implemented for this property.\n", __func__, ptr->type->identifier, prop->identifier); + printf("%s %s.%s: not implemented for this property.\n", + __func__, + ptr->type->identifier, + prop->identifier); } # endif #endif @@ -3893,7 +3910,10 @@ bool RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) } # if 0 else { - printf("%s %s.%s: only supported for id properties.\n", __func__, ptr->type->identifier, prop->identifier); + printf("%s %s.%s: only supported for id properties.\n", + __func__, + ptr->type->identifier, + prop->identifier); } # endif #endif @@ -4508,7 +4528,8 @@ static int rna_raw_access(ReportList *reports, RawPropertyType RNA_property_raw_type(PropertyRNA *prop) { if (prop->rawtype == PROP_RAW_UNSET) { - /* this property has no raw access, yet we try to provide a raw type to help building the array */ + /* this property has no raw access, + * yet we try to provide a raw type to help building the array. */ switch (prop->type) { case PROP_BOOLEAN: return PROP_RAW_BOOLEAN; @@ -4954,13 +4975,15 @@ static bool rna_path_parse_array_index(const char **path, * \param r_ptr: The final RNA data holding the last property in \a path. * \param r_prop: The final property of \a r_ptr, from \a path. * \param r_index: The final index in the \a r_prop, if defined by \a path. - * \param r_item_ptr: Only valid for Pointer and Collection, return the actual value of the pointer, - * or of the collection item. Mutually exclusive with \a eval_pointer option. + * \param r_item_ptr: Only valid for Pointer and Collection, + * return the actual value of the pointer, or of the collection item. + * Mutually exclusive with \a eval_pointer option. * \param r_elements: A list of \a PropertyElemRNA items - * (pairs of \a PointerRNA, \a PropertyRNA that represent the whole given \a path). - * \param eval_pointer: If \a true, and \a path leads to a Pointer property, or an item in a Collection property, - * \a r_ptr will be set to the value of that property, and \a r_prop will be NULL. - * Mutually exclusive with \a r_item_ptr. + * (pairs of \a PointerRNA, \a PropertyRNA that represent the whole given \a path). + * \param eval_pointer: If \a true, and \a path leads to a Pointer property, + * or an item in a Collection property, + * \a r_ptr will be set to the value of that property, and \a r_prop will be NULL. + * Mutually exclusive with \a r_item_ptr. * \return \a true on success, \a false if the path is somehow invalid. */ static bool rna_path_parse(PointerRNA *ptr, @@ -5118,7 +5141,8 @@ static bool rna_path_parse(PointerRNA *ptr, } /** - * Resolve the given RNA Path to find the pointer and/or property indicated by fully resolving the path. + * Resolve the given RNA Path to find the pointer and/or property + * indicated by fully resolving the path. * * \note Assumes all pointers provided are valid * \return True if path can be resolved to a valid "pointer + property" OR "pointer only" @@ -5132,7 +5156,8 @@ bool RNA_path_resolve(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, Prop } /** - * Resolve the given RNA Path to find the pointer and/or property + array index indicated by fully resolving the path. + * Resolve the given RNA Path to find the pointer and/or property + array index + * indicated by fully resolving the path. * * \note Assumes all pointers provided are valid. * \return True if path can be resolved to a valid "pointer + property" OR "pointer only" @@ -5147,7 +5172,8 @@ bool RNA_path_resolve_full( } /** - * Resolve the given RNA Path to find both the pointer AND property indicated by fully resolving the path. + * Resolve the given RNA Path to find both the pointer AND property + * indicated by fully resolving the path. * * This is a convenience method to avoid logic errors and ugly syntax. * \note Assumes all pointers provided are valid @@ -5183,13 +5209,15 @@ bool RNA_path_resolve_property_full( } /** - * Resolve the given RNA Path to find both the pointer AND property indicated by fully resolving the path, - * and get the value of the Pointer property (or item of the collection). + * Resolve the given RNA Path to find both the pointer AND property + * indicated by fully resolving the path, and get the value of the Pointer property + * (or item of the collection). * - * This is a convenience method to avoid logic errors and ugly syntax, it combines both \a RNA_path_resolve and - * \a RNA_path_resolve_property in a single call. + * This is a convenience method to avoid logic errors and ugly syntax, + * it combines both \a RNA_path_resolve and #RNA_path_resolve_property in a single call. * \note Assumes all pointers provided are valid. - * \param r_item_pointer: The final Pointer or Collection item value. You must check for its validity before use! + * \param r_item_pointer: The final Pointer or Collection item value. + * You must check for its validity before use! * \return True only if both a valid pointer and property are found after resolving the path */ bool RNA_path_resolve_property_and_item_pointer(PointerRNA *ptr, @@ -5207,12 +5235,15 @@ bool RNA_path_resolve_property_and_item_pointer(PointerRNA *ptr, /** * Resolve the given RNA Path to find both the pointer AND property (as well as the array index) - * indicated by fully resolving the path, and get the value of the Pointer property (or item of the collection). + * indicated by fully resolving the path, + * and get the value of the Pointer property (or item of the collection). * - * This is a convenience method to avoid logic errors and ugly syntax, it combines both \a RNA_path_resolve_full and + * This is a convenience method to avoid logic errors and ugly syntax, + * it combines both \a RNA_path_resolve_full and * \a RNA_path_resolve_property_full in a single call. * \note Assumes all pointers provided are valid. - * \param r_item_pointer: The final Pointer or Collection item value. You must check for its validity before use! + * \param r_item_pointer: The final Pointer or Collection item value. + * You must check for its validity before use! * \return True only if both a valid pointer and property are found after resolving the path */ bool RNA_path_resolve_property_and_item_pointer_full(PointerRNA *ptr, @@ -5230,8 +5261,8 @@ bool RNA_path_resolve_property_and_item_pointer_full(PointerRNA *ptr, /** * Resolve the given RNA Path into a linked list of PropertyElemRNA's. * - * To be used when complex operations over path are needed, like e.g. get relative paths, to avoid too much - * string operations. + * To be used when complex operations over path are needed, like e.g. get relative paths, + * to avoid too much string operations. * * \return True if there was no error while resolving the path * \note Assumes all pointers provided are valid @@ -5476,9 +5507,11 @@ static char *rna_path_from_ID_to_idpgroup(PointerRNA *ptr) BLI_assert(ptr->id.data != NULL); - /* TODO, Support Bones/PoseBones. no pointers stored to the bones from here, only the ID. See example in [#25746] - * Unless this is added only way to find this is to also search all bones and pose bones - * of an armature or object */ + /* TODO, Support Bones/PoseBones. no pointers stored to the bones from here, only the ID. + * See example in T25746. + * Unless this is added only way to find this is to also search + * all bones and pose bones of an armature or object. + */ RNA_id_pointer_create(ptr->id.data, &id_ptr); haystack = RNA_struct_idprops(&id_ptr, false); @@ -5635,7 +5668,8 @@ char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop) } /** - * \return the path to given ptr/prop from the closest ancestor of given type, if any (else return NULL). + * \return the path to given ptr/prop from the closest ancestor of given type, + * if any (else return NULL). */ char *RNA_path_resolve_from_type_to_property(PointerRNA *ptr, PropertyRNA *prop, @@ -5708,7 +5742,8 @@ char *RNA_path_full_struct_py(struct PointerRNA *ptr) data_path = RNA_path_from_ID_to_struct(ptr); - /* XXX data_path may be NULL (see #36788), do we want to get the 'bpy.data.foo["bar"].(null)' stuff? */ + /* XXX data_path may be NULL (see T36788), + * do we want to get the 'bpy.data.foo["bar"].(null)' stuff? */ ret = BLI_sprintfN("%s.%s", id_path, data_path); if (data_path) { @@ -7657,7 +7692,8 @@ bool RNA_property_reset(PointerRNA *ptr, PropertyRNA *prop, int index) } default: - /* FIXME: are there still any cases that haven't been handled? comment out "default" block to check :) */ + /* FIXME: are there still any cases that haven't been handled? + * comment out "default" block to check :) */ return false; } } @@ -7707,13 +7743,14 @@ bool RNA_property_copy( PropertyRNA *prop_dst = prop; PropertyRNA *prop_src = prop; - /* Ensure we get real property data, be it an actual RNA property, or an IDProperty in disguise. */ + /* Ensure we get real property data, + * be it an actual RNA property, or an IDProperty in disguise. */ prop_dst = rna_ensure_property_realdata(&prop_dst, ptr); prop_src = rna_ensure_property_realdata(&prop_src, fromptr); /* IDprops: destination may not exist, if source does and is set, try to create it. */ - /* Note: this is sort of quick hack/bandage to fix the issue, we need to rethink how IDProps are handled - * in 'diff' RNA code completely, imho... */ + /* Note: this is sort of quick hack/bandage to fix the issue, + * we need to rethink how IDProps are handled in 'diff' RNA code completely, imho... */ if (prop_src != NULL && prop_dst == NULL && RNA_property_is_set(fromptr, prop)) { BLI_assert(prop_src->magic != RNA_MAGIC); IDProperty *idp_dst = RNA_struct_idprops(ptr, true); @@ -7813,13 +7850,16 @@ bool RNA_struct_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, eRNACo /** Generic RNA property diff function. * - * \note about \a prop and \a prop_a/prop_b parameters: the former is exptected to be an 'un-resolved' one, - * while the two laters are expected to be fully resolved ones (i.e. to be the IDProps when they should be, etc.). + * \note about \a prop and \a prop_a/prop_b parameters: + * the former is exptected to be an 'un-resolved' one, + * while the two laters are expected to be fully resolved ones + * (i.e. to be the IDProps when they should be, etc.). * When \a prop is given, \a prop_a and \a prop_b should always be NULL, and vice-versa. * This is necessary, because we cannot perform 'set/unset' checks on resolved properties * (unset IDProps would merely be NULL then). * - * \note When there is no equality, but we cannot determine an order (greater than/lesser than), we return 1. + * \note When there is no equality, + * but we cannot determine an order (greater than/lesser than), we return 1. */ static int rna_property_override_diff(Main *bmain, PointerRNA *ptr_a, @@ -7861,7 +7901,8 @@ static int rna_property_override_diff(Main *bmain, } if (prop != NULL) { - /* Ensure we get real property data, be it an actual RNA property, or an IDProperty in disguise. */ + /* Ensure we get real property data, be it an actual RNA property, + * or an IDProperty in disguise. */ prop_a = rna_ensure_property_realdata(&prop_a, ptr_a); prop_b = rna_ensure_property_realdata(&prop_b, ptr_b); @@ -7885,7 +7926,8 @@ static int rna_property_override_diff(Main *bmain, const int len_b = RNA_property_array_length(ptr_b, prop_b); if (len_a != len_b) { - /* Do not handle override in that case, we do not support insertion/deletion from arrays for now. */ + /* Do not handle override in that case, + * we do not support insertion/deletion from arrays for now. */ return len_a > len_b ? 1 : -1; } @@ -7949,7 +7991,8 @@ static int rna_property_override_diff(Main *bmain, return diff; } -/* Modify local data-block to make it ready for override application (only needed for diff operations, where we use +/* Modify local data-block to make it ready for override application + * (only needed for diff operations, where we use * the local data-block's data as second operand). */ static bool rna_property_override_operation_store(Main *bmain, PointerRNA *ptr_local, @@ -7975,7 +8018,8 @@ static bool rna_property_override_operation_store(Main *bmain, } if (len_local != len_reference || len_local != len_storage) { - /* Do not handle override in that case, we do not support insertion/deletion from arrays for now. */ + /* Do not handle override in that case, + * we do not support insertion/deletion from arrays for now. */ return changed; } @@ -8093,7 +8137,8 @@ static bool rna_property_override_operation_apply(Main *bmain, } if (len_local != len_reference || (ptr_storage && len_local != len_storage)) { - /* Do not handle override in that case, we do not support insertion/deletion from arrays for now. */ + /* Do not handle override in that case, + * we do not support insertion/deletion from arrays for now. */ return false; } @@ -8119,7 +8164,8 @@ static bool rna_property_override_operation_apply(Main *bmain, * with respect to given restrictive sets of properties. * If requested, will generate needed new property overrides, and/or restore values from reference. * - * \param r_report_flags: If given, will be set with flags matching actions taken by the function on \a ptr_local. + * \param r_report_flags: If given, + * will be set with flags matching actions taken by the function on \a ptr_local. * * \return True if _resulting_ \a ptr_local does match \a ptr_reference. */ @@ -8168,7 +8214,8 @@ bool RNA_struct_override_matches(Main *bmain, PropertyRNA *prop_local = iter.ptr.data; PropertyRNA *prop_reference = iter.ptr.data; - /* Ensure we get real property data, be it an actual RNA property, or an IDProperty in disguise. */ + /* Ensure we get real property data, be it an actual RNA property, + * or an IDProperty in disguise. */ prop_local = rna_ensure_property_realdata(&prop_local, ptr_local); prop_reference = rna_ensure_property_realdata(&prop_reference, ptr_reference); @@ -8290,7 +8337,10 @@ bool RNA_struct_override_matches(Main *bmain, } else { /* Too noisy for now, this triggers on runtime props like transform matrices etc. */ - /* BLI_assert(!"We have differences between reference and overriding data on non-editable property."); */ +#if 0 + BLI_assert(!"We have differences between reference and " + "overriding data on non-editable property."); +#endif matching = false; } } @@ -8343,7 +8393,8 @@ bool RNA_struct_override_matches(Main *bmain, return matching; } -/** Store needed second operands into \a storage data-block for differential override operations. */ +/** Store needed second operands into \a storage data-block + * for differential override operations. */ bool RNA_struct_override_store(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, @@ -8365,7 +8416,8 @@ bool RNA_struct_override_store(Main *bmain, PointerRNA data_storage; PropertyRNA *prop_storage = NULL; - /* It is totally OK if this does not success, only a subset of override operations actually need storage. */ + /* It is totally OK if this does not success, + * only a subset of override operations actually need storage. */ if (ptr_storage && (ptr_storage->id.data != NULL)) { RNA_path_resolve_property(ptr_storage, op->rna_path, &data_storage, &prop_storage); } @@ -8441,7 +8493,8 @@ void RNA_struct_override_apply(Main *bmain, TIMEIT_START_AVERAGED(RNA_struct_override_apply); #endif /* Note: Applying insert operations in a separate pass is mandatory. - * We could optimize this later, but for now, as inneficient as it is, don't think this is a critical point. + * We could optimize this later, but for now, as inneficient as it is, + * don't think this is a critical point. */ bool do_insert = false; for (int i = 0; i < 2; i++, do_insert = true) { @@ -8458,7 +8511,8 @@ void RNA_struct_override_apply(Main *bmain, PointerRNA data_storage, data_item_storage; PropertyRNA *prop_storage = NULL; - /* It is totally OK if this does not success, only a subset of override operations actually need storage. */ + /* It is totally OK if this does not success, + * only a subset of override operations actually need storage. */ if (ptr_storage && (ptr_storage->id.data != NULL)) { RNA_path_resolve_property_and_item_pointer( ptr_storage, op->rna_path, &data_storage, &prop_storage, &data_item_storage); diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 36e9fde9a7a..c9c831e6700 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -247,7 +247,8 @@ static void rna_Action_frame_range_get(PointerRNA *ptr, float *values) calc_action_range(ptr->id.data, values, values + 1, false); } -/* used to check if an action (value pointer) is suitable to be assigned to the ID-block that is ptr */ +/* Used to check if an action (value pointer) + * is suitable to be assigned to the ID-block that is ptr. */ bool rna_Action_id_poll(PointerRNA *ptr, PointerRNA value) { ID *srcId = (ID *)ptr->id.data; @@ -267,7 +268,8 @@ bool rna_Action_id_poll(PointerRNA *ptr, PointerRNA value) return 0; } -/* used to check if an action (value pointer) can be assigned to Action Editor given current mode */ +/* Used to check if an action (value pointer) + * can be assigned to Action Editor given current mode. */ bool rna_Action_actedit_assign_poll(PointerRNA *ptr, PointerRNA value) { SpaceAction *saction = (SpaceAction *)ptr->data; @@ -769,7 +771,8 @@ static void rna_def_action(BlenderRNA *brna) 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"); - /* Use lib exception so the list isn't grayed out; adding/removing is still banned though, see T45689 */ + /* Use lib exception so the list isn't grayed out; + * adding/removing is still banned though, see T45689. */ RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_ui_text( prop, "Pose Markers", "Markers specific to this action, for labeling poses"); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 3f92d6f1210..45df6f8d0b2 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -48,7 +48,8 @@ const EnumPropertyItem rna_enum_keyingset_path_grouping_items[] = { {0, NULL, 0, NULL, NULL}, }; -/* It would be cool to get rid of this 'INSERTKEY_' prefix in 'py strings' values, but it would break existing +/* It would be cool to get rid of this 'INSERTKEY_' prefix in 'py strings' values, + * but it would break existing * exported keyingset... :/ */ const EnumPropertyItem rna_enum_keying_flag_items[] = { @@ -225,7 +226,8 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, /* ------ */ -/* XXX: the exact purpose of this is not too clear... maybe we want to revise this at some point? */ +/* XXX: the exact purpose of this is not too clear... + * maybe we want to revise this at some point? */ static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr) { KeyingSetInfo *ksi = (KeyingSetInfo *)ptr->data; @@ -263,7 +265,8 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, int have_function[3]; /* 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? */ + /* 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 */ @@ -471,7 +474,8 @@ static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, 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) */ + /* 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; @@ -507,7 +511,8 @@ static void rna_KeyingSet_paths_remove(KeyingSet *keyingset, RNA_POINTER_INVALIDATE(ksp_ptr); /* the active path number will most likely have changed */ - /* TODO: we should get more fancy and actually check if it was removed, but this will do for now */ + /* TODO: we should get more fancy and actually check if it was removed, + * but this will do for now */ keyingset->active_path = 0; } @@ -1010,7 +1015,10 @@ static void rna_def_keyingset(BlenderRNA *brna) 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 */ + /* NOTE: disabled, as ID name shouldn't be editable */ +# if 0 + RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_RENAME, NULL); +# endif prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c index 7d034068311..17a58a61fb5 100644 --- a/source/blender/makesrna/intern/rna_animviz.c +++ b/source/blender/makesrna/intern/rna_animviz.c @@ -40,7 +40,13 @@ const EnumPropertyItem rna_enum_motionpath_bake_location_items[] = { {MOTIONPATH_BAKE_HEADS, "HEADS", 0, "Heads", "Calculate bone paths from heads"}, {0, "TAILS", 0, "Tails", "Calculate bone paths from tails"}, - //{MOTIONPATH_BAKE_CENTERS, "CENTROID", 0, "Centers", "Calculate bone paths from center of mass"}, +#if 0 + {MOTIONPATH_BAKE_CENTERS, + "CENTROID", + 0, + "Centers", + "Calculate bone paths from center of mass"}, +#endif {0, NULL, 0, NULL, NULL}, }; @@ -296,9 +302,8 @@ static void rna_def_animviz_paths(BlenderRNA *brna) /* 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); - RNA_def_property_clear_flag( - prop, - PROP_EDITABLE); /* NOTE: This is really an internal state var for convenience, so don't allow edits! */ + /* NOTE: This is really an internal state var for convenience, so don't allow edits! */ + RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text( prop, "Has Motion Paths", "Are there any bone paths that will need updating (read-only)"); } diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 0c8c887d882..5c1d639ac57 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -588,7 +588,8 @@ static void rna_Armature_transform(struct bArmature *arm, Main *bmain, float *ma #else -/* Settings for curved bbone settings - The posemode values get applied over the top of the editmode ones */ +/* Settings for curved bbone settings - + * The posemode values get applied over the top of the editmode ones. */ void rna_def_bone_curved_common(StructRNA *srna, bool is_posebone) { # define RNA_DEF_CURVEBONE_UPDATE(prop, is_posebone) \ diff --git a/source/blender/makesrna/intern/rna_collection.c b/source/blender/makesrna/intern/rna_collection.c index 0a1dc503cac..501895eefc8 100644 --- a/source/blender/makesrna/intern/rna_collection.c +++ b/source/blender/makesrna/intern/rna_collection.c @@ -152,8 +152,8 @@ static bool rna_Collection_objects_override_apply(Main *bmain, return false; } - /* XXX TODO We most certainly rather want to have a 'swap object pointer in collection' util in BKE_collection... - * This is only temp auick dirty test! */ + /* XXX TODO We most certainly rather want to have a 'swap object pointer in collection' + * util in BKE_collection. This is only temp quick dirty test! */ id_us_min(&cob_dst->ob->id); cob_dst->ob = ob_src; id_us_plus(&cob_dst->ob->id); @@ -255,8 +255,8 @@ static bool rna_Collection_children_override_apply(Main *bmain, return false; } - /* XXX TODO We most certainly rather want to have a 'swap object pointer in collection' util in BKE_collection... - * This is only temp auick dirty test! */ + /* XXX TODO We most certainly rather want to have a 'swap object pointer in collection' + * util in BKE_collection. This is only temp quick dirty test! */ id_us_min(&collchild_dst->collection->id); collchild_dst->collection = subcoll_src; id_us_plus(&collchild_dst->collection->id); @@ -342,7 +342,8 @@ void RNA_def_collections(BlenderRNA *brna) srna = RNA_def_struct(brna, "Collection", "ID"); RNA_def_struct_ui_text(srna, "Collection", "Collection of Object data-blocks"); RNA_def_struct_ui_icon(srna, ICON_GROUP); - /* this is done on save/load in readfile.c, removed if no objects are in the collection and not in a scene */ + /* This is done on save/load in readfile.c, + * removed if no objects are in the collection and not in a scene. */ RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); prop = RNA_def_property(srna, "instance_offset", PROP_FLOAT, PROP_TRANSLATION); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 89dd6a308ce..44445181402 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -2961,7 +2961,8 @@ void RNA_def_constraint(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI"); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); - /* XXX this is really an internal flag, but it may be useful for some tools to be able to access this... */ + /* XXX this is really an internal flag, + * but it may be useful for some tools to be able to access this... */ 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", CONSTRAINT_DISABLE); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index e73f5841da9..9c7ad60f378 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -720,7 +720,8 @@ static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr) Nurb *nu; ListBase *nurbs = BKE_curve_nurbs_get(cu); - /* for curve outside editmode will set to -1, should be changed to be allowed outside of editmode. */ + /* For curve outside editmode will set to -1, + * should be changed to be allowed outside of editmode. */ nu = BLI_findlink(nurbs, cu->actnu); if (nu) diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 9972bbaa829..3e56307ed1d 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -457,8 +457,13 @@ static int rna_validate_identifier(const char *identifier, char *error, bool pro { int a = 0; - /* list is from... - * ", ".join(['"%s"' % kw for kw in __import__("keyword").kwlist if kw not in {"False", "None", "True"}]) + /** List is from: + * \code{.py} + * ", ".join([ + * '"%s"' % kw for kw in __import__("keyword").kwlist + * if kw not in {"False", "None", "True"} + * ]) + * \endcode */ static const char *kwlist[] = { /* "False", "None", "True", */ @@ -954,8 +959,9 @@ void RNA_def_struct_sdna(StructRNA *srna, const char *structname) ds = rna_find_def_struct(srna); - /* there are far too many structs which initialize without valid DNA struct names, - * this can't be checked without adding an option to disable (tested this and it means changes all over - Campbell) */ + /* There are far too many structs which initialize without valid DNA struct names, + * this can't be checked without adding an option to disable + * (tested this and it means changes all over - Campbell) */ #if 0 if (DNA_struct_find_nr_wrapper(DefRNA.sdna, structname) == -1) { if (!DefRNA.silent) { diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index 3df4feba024..447318da744 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -297,8 +297,8 @@ static PointerRNA rna_Depsgraph_objects_get(CollectionPropertyIterator *iter) */ /* XXX Ugly python seems to query next item of an iterator before using current one (see T57558). - * This forces us to use that nasty ping-pong game between two sets of iterator data, so that previous one remains - * valid memory for python to access to. Yuck. + * This forces us to use that nasty ping-pong game between two sets of iterator data, + * so that previous one remains valid memory for python to access to. Yuck. */ typedef struct RNA_Depsgraph_Instances_Iterator { BLI_Iterator iterators[2]; @@ -335,8 +335,10 @@ static void rna_Depsgraph_object_instances_next(CollectionPropertyIterator *iter di_it->iterators[di_it->counter % 2].data = &di_it->deg_data[di_it->counter % 2]; DEG_iterator_objects_next(&di_it->iterators[di_it->counter % 2]); /* Dupli_object_current is also temp memory generated during the iterations, - * it may be freed when last item has been iterated, so we have same issue as with the iterator itself: - * we need to keep a local copy, which memory remains valid a bit longer, for python accesses to work. */ + * it may be freed when last item has been iterated, + * so we have same issue as with the iterator itself: + * we need to keep a local copy, which memory remains valid a bit longer, + * for Python accesses to work. */ if (di_it->deg_data[di_it->counter % 2].dupli_object_current != NULL) { di_it->dupli_object_current[di_it->counter % 2] = *di_it->deg_data[di_it->counter % 2].dupli_object_current; diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c index 85764dec682..215c513c003 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -185,7 +185,10 @@ static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr) static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data; - /*rna_iterator_array_begin(iter, (void *)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); */ +# if 0 + rna_iterator_array_begin( + iter, (void *)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); +# endif rna_iterator_listbase_begin(iter, &canvas->surfaces, NULL); } diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 1e1883a4a39..c8df01a7dc7 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -310,7 +310,8 @@ 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! */ + /* 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); @@ -466,7 +467,8 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value) } 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 */ + /* The ID given is the action already - + * usually when F-Curve is obtained from an action's pointer. */ act = (bAction *)pid; } else { @@ -506,7 +508,8 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value) action_groups_add_channel(act, value.data, fcu); } else { - /* need to add this back, but it can only go at the end of the list (or else will corrupt groups) */ + /* Need to add this back, but it can only go at the end of the list + * (or else will corrupt groups). */ BLI_addtail(&act->curves, fcu); } } @@ -538,8 +541,8 @@ static void rna_FCurve_update_data_relations(Main *bmain, DEG_relations_tag_update(bmain); } -/* RNA update callback for F-Curves to indicate that there are copy-on-write tagging/flushing needed - * (e.g. for properties that affect how animation gets evaluated) +/* RNA update callback for F-Curves to indicate that there are copy-on-write tagging/flushing + * needed (e.g. for properties that affect how animation gets evaluated). */ static void rna_FCurve_update_eval(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { @@ -792,7 +795,8 @@ static void rna_FModifierLimits_minx_range(PointerRNA *UNUSED(ptr), // 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 */ + /* 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; } @@ -819,7 +823,8 @@ static void rna_FModifierLimits_miny_range(PointerRNA *UNUSED(ptr), // 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 */ + /* 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; } diff --git a/source/blender/makesrna/intern/rna_fcurve_api.c b/source/blender/makesrna/intern/rna_fcurve_api.c index ea3ad074452..873b3cfa502 100644 --- a/source/blender/makesrna/intern/rna_fcurve_api.c +++ b/source/blender/makesrna/intern/rna_fcurve_api.c @@ -46,7 +46,8 @@ static void rna_FCurve_convert_to_samples(FCurve *fcu, ReportList *reports, int start, int end) { - /* XXX fcurve_store_samples uses end frame included, which is not consistent with usual behavior in Blender, + /* XXX fcurve_store_samples uses end frame included, + * which is not consistent with usual behavior in Blender, * nor python slices, etc. Let have public py API be consistent here at least. */ end--; if (start > end) { diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 6c91b69fbd8..49b0a344734 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -771,8 +771,10 @@ void RNA_def_fluidsim(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Type", "Type of participation in the fluid simulation"); RNA_def_property_update(prop, 0, "rna_FluidSettings_update_type"); - /*prop = RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); */ - /*RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by fluid simulation settings"); */ +# if 0 + prop = RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); + RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by fluid simulation settings"); +# endif /* types */ diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 05cc12636ef..f87bb69a94f 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -1044,7 +1044,8 @@ static void rna_def_gpencil_stroke(BlenderRNA *brna) RNA_def_property_ui_text(prop, "End Cap", "Stroke end extreme cap style"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); - /* No fill: The stroke never must fill area and must use fill color as stroke color (this is a special flag for fill brush) */ + /* No fill: The stroke never must fill area and must use fill color as stroke color + * (this is a special flag for fill brush). */ prop = RNA_def_property(srna, "is_nofill_stroke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STROKE_NOFILL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index b0ead024748..92c895bd854 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -156,8 +156,9 @@ typedef void (*PropEnumSetFuncEx)(struct PointerRNA *ptr, struct PropertyRNA *pr /** * If \a override is NULL, merely do comparison between prop_a from ptr_a and prop_b from ptr_b, * following comparison mode given. - * If \a override and \a rna_path are not NULL, it will add a new override operation for overridable properties - * that differ and have not yet been overridden (and set accordingly \a r_override_changed if given). + * If \a override and \a rna_path are not NULL, it will add a new override operation for + * overridable properties that differ and have not yet been overridden + * (and set accordingly \a r_override_changed if given). * * \note Given PropertyRNA are final (in case of IDProps...). * \note In non-array cases, \a len values are 0. @@ -182,8 +183,9 @@ typedef int (*RNAPropOverrideDiff)(struct Main *bmain, * * \note Given PropertyRNA are final (in case of IDProps...). * \note In non-array cases, \a len values are 0. - * \note Might change given override operation (e.g. change 'add' one into 'sub'), in case computed storage value - * is out of range (or even change it to basic 'set' operation if nothing else works). + * \note Might change given override operation (e.g. change 'add' one into 'sub'), + * in case computed storage value is out of range + * (or even change it to basic 'set' operation if nothing else works). */ typedef bool (*RNAPropOverrideStore)(struct Main *bmain, struct PointerRNA *ptr_local, @@ -460,8 +462,8 @@ struct StructRNA { /* unique identifier, keep after 'cont' */ const char *identifier; - /* python type, this is a subtype of pyrna_struct_Type but used so each struct can have its own type - * which is useful for subclassing RNA */ + /** Python type, this is a subtype of #pyrna_struct_Type + * but used so each struct can have its own type which is useful for subclassing RNA. */ void *py_type; void *blender_type; diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index b0760b3377d..1985099e060 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -167,8 +167,9 @@ static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value) # undef SHAPEKEY_SLIDER_TOL /* ***** Normals accessors for shapekeys. ***** */ -/* Note: with this we may recompute several times the same data, should we want to access verts, then polys, then loops - * normals... However, such case looks rather unlikely - and not worth adding some kind of caching in KeyBlocks. +/* Note: with this we may recompute several times the same data, should we want to access verts, + * then polys, then loops normals... However, + * such case looks rather unlikely - and not worth adding some kind of caching in KeyBlocks. */ static Mesh *rna_KeyBlock_normals_get_mesh(PointerRNA *ptr, ID *id) @@ -722,7 +723,8 @@ static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point) */ 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 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 */ return kb; @@ -964,8 +966,8 @@ static void rna_def_keyblock(BlenderRNA *brna) NULL, NULL); - /* XXX multi-dim dynamic arrays are very badly supported by (py)rna currently, those are defined for the day - * it works better, for now user will get a 1D tuple... + /* XXX multi-dim dynamic arrays are very badly supported by (py)rna currently, + * those are defined for the day it works better, for now user will get a 1D tuple. */ func = RNA_def_function(srna, "normals_vertex_get", "rna_KeyBlock_normals_vert_calc"); RNA_def_function_ui_description(func, diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 7fb89ff6c7d..3716a8d1404 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1002,7 +1002,8 @@ static void rna_Mesh_face_map_remove(struct Mesh *me, static int rna_MeshPoly_vertices_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { MPoly *mp = (MPoly *)ptr->data; - /* note, raw access uses dummy item, this _could_ crash, watch out for this, mface uses it but it cant work here */ + /* note, raw access uses dummy item, this _could_ crash, + * watch out for this, mface uses it but it cant work here. */ return (length[0] = mp->totloop); } diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 7573d2cdc05..c3192b4f850 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -138,12 +138,13 @@ 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 - * -> but if it was a transition, we could go up to the start of the strip + some flexibility threshold - * as long as we re-adjust the transition afterwards - * - minimum frame is -MAXFRAME so that we don't get clipping on frame 0 + /* 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. + * -> But if it was a transition, + * we could go up to the start of the strip + some flexibility threshold. + * as long as we re-adjust the transition afterwards. + * - Minimum frame is -MAXFRAME so that we don't get clipping on frame 0. */ if (data->prev) { if (data->prev->type == NLASTRIP_TYPE_TRANSITION) { @@ -171,7 +172,8 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) * - must not have zero or negative length strip, so cannot start before the first frame * + some minimum-strip-length threshold * - cannot end later than the start of the next strip (if present) - * -> but if it was a transition, we could go up to the start of the end - some flexibility threshold + * -> but if it was a transition, + * we could go up to the start of the end - some flexibility threshold * as long as we re-adjust the transition afterwards */ if (data->next) { @@ -210,7 +212,8 @@ 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() */ + /* 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; @@ -223,7 +226,8 @@ 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() */ + /* 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; @@ -411,7 +415,8 @@ static NlaStrip *rna_NlaStrip_new(ID *id, 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 */ + /* '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) @@ -736,15 +741,15 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Influence", "Amount the strip contributes to the current result"); /* 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 - */ + * 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 - */ + * 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? */ diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 8a064bd065d..3f96c0c1d0e 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -599,8 +599,8 @@ static void rna_NodeTree_get_from_context( void *ret1, *ret2, *ret3; RNA_pointer_create(NULL, ntreetype->ext.srna, NULL, &ptr); /* dummy */ - func = - &rna_NodeTree_get_from_context_func; /* RNA_struct_find_function(&ptr, "get_from_context"); */ + /* RNA_struct_find_function(&ptr, "get_from_context"); */ + func = &rna_NodeTree_get_from_context_func; RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "context", &C); @@ -1692,7 +1692,8 @@ static bNodeSocket *rna_Node_inputs_new(ID *id, const char *name, const char *identifier) { - /* Adding an input to a group node is not working, simpler to add it to its underlying nodetree. */ + /* Adding an input to a group node is not working, + * simpler to add it to its underlying nodetree. */ if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP) && node->id != NULL) { return rna_NodeTree_inputs_new((bNodeTree *)node->id, bmain, reports, type, name); } @@ -1721,7 +1722,8 @@ static bNodeSocket *rna_Node_outputs_new(ID *id, const char *name, const char *identifier) { - /* Adding an output to a group node is not working, simpler to add it to its underlying nodetree. */ + /* Adding an output to a group node is not working, + * simpler to add it to its underlying nodetree. */ if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP) && node->id != NULL) { return rna_NodeTree_outputs_new((bNodeTree *)node->id, bmain, reports, type, name); } @@ -2151,8 +2153,8 @@ static void rna_NodeSocketInterface_register_properties(bNodeTree *ntree, return; RNA_pointer_create((ID *)ntree, &RNA_NodeSocketInterface, stemp, &ptr); - func = - &rna_NodeSocketInterface_register_properties_func; /* RNA_struct_find_function(&ptr, "register_properties"); */ + /* RNA_struct_find_function(&ptr, "register_properties"); */ + func = &rna_NodeSocketInterface_register_properties_func; RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "data_rna_type", &data_srna); @@ -2176,8 +2178,8 @@ static void rna_NodeSocketInterface_init_socket( RNA_pointer_create((ID *)ntree, &RNA_NodeSocketInterface, stemp, &ptr); RNA_pointer_create((ID *)ntree, &RNA_Node, node, &node_ptr); RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, sock, &sock_ptr); - func = - &rna_NodeSocketInterface_init_socket_func; /* RNA_struct_find_function(&ptr, "init_socket"); */ + /* RNA_struct_find_function(&ptr, "init_socket"); */ + func = &rna_NodeSocketInterface_init_socket_func; RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "node", &node_ptr); @@ -2205,8 +2207,8 @@ static void rna_NodeSocketInterface_from_socket(bNodeTree *ntree, RNA_pointer_create((ID *)ntree, &RNA_NodeSocketInterface, stemp, &ptr); RNA_pointer_create((ID *)ntree, &RNA_Node, node, &node_ptr); RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, sock, &sock_ptr); - func = - &rna_NodeSocketInterface_from_socket_func; /* RNA_struct_find_function(&ptr, "from_socket"); */ + /* RNA_struct_find_function(&ptr, "from_socket"); */ + func = &rna_NodeSocketInterface_from_socket_func; RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "node", &node_ptr); @@ -2827,7 +2829,8 @@ static const EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl) while (rl) { tmp.identifier = rl->name; - /* little trick: using space char instead empty string makes the item selectable in the dropdown */ + /* Little trick: using space char instead empty string + * makes the item selectable in the dropdown. */ if (rl->name[0] == '\0') tmp.name = " "; else @@ -2898,7 +2901,8 @@ static const EnumPropertyItem *renderresult_views_add_enum(RenderView *rv) while (rv) { tmp.identifier = rv->name; - /* little trick: using space char instead empty string makes the item selectable in the dropdown */ + /* Little trick: using space char instead empty string + * makes the item selectable in the dropdown. */ if (rv->name[0] == '\0') tmp.name = " "; else @@ -8142,7 +8146,8 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) /* 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 socket types below 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. + * 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. */ @@ -8219,7 +8224,8 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) /* XXX These types should eventually be registered at runtime. * 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). + * 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); @@ -8304,8 +8310,10 @@ static void rna_def_internal_node(BlenderRNA *brna) /* 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. + * 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. */ @@ -9124,7 +9132,8 @@ static StructRNA *define_specific_node(BlenderRNA *brna, FunctionRNA *func; PropertyRNA *parm; - /* XXX hack, want to avoid "NodeInternal" prefix, so use "Node" in NOD_static_types.h and replace here */ + /* 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"; @@ -9139,8 +9148,8 @@ static StructRNA *define_specific_node(BlenderRNA *brna, RNA_def_function_return(func, parm); /* Exposes the socket template type lists in RNA for use in scripts - * Only used in the C nodes and not exposed in the base class to keep the namespace clean for pynodes. - */ + * Only used in the C nodes and not exposed in the base class to + * keep the namespace clean for py-nodes. */ func = RNA_def_function(srna, "input_template", "rna_NodeInternal_input_template"); RNA_def_function_ui_description(func, "Input socket template"); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_SELF_TYPE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 047887644c8..aed7b83e34f 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -346,8 +346,9 @@ static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) Object *ob = ptr->id.data; float local_mat[4][4]; - /* localspace matrix is truly relative to the parent, but parameters stored in object are - * relative to parentinv matrix. Undo the parent inverse part before applying it as local matrix. */ + /* Localspace matrix is truly relative to the parent, + * but parameters stored in object are relative to parentinv matrix. + * Undo the parent inverse part before applying it as local matrix. */ if (ob->parent) { float invmat[4][4]; invert_m4_m4(invmat, ob->parentinv); @@ -357,7 +358,8 @@ static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) copy_m4_m4(local_mat, (float(*)[4])values); } - /* don't use compat so we get predictable rotation, and do not use parenting either, because it's a local matrix! */ + /* Don't use compat so we get predictable rotation, and do not use parenting either, + * because it's a local matrix! */ BKE_object_apply_mat4(ob, local_mat, false, false); } @@ -1369,8 +1371,8 @@ bool rna_Object_constraints_override_apply(Main *UNUSED(bmain), /* This handles NULL anchor as expected by adding at head of list. */ BLI_insertlinkafter(&ob_dst->constraints, con_anchor, con_dst); - /* This should actually *not* be needed in typical cases. However, if overridden source was edited, - * we *may* have some new conflicting names. */ + /* This should actually *not* be needed in typical cases. + * However, if overridden source was edited, we *may* have some new conflicting names. */ BKE_constraint_unique_name(con_dst, &ob_dst->constraints); // printf("%s: We inserted a constraint...\n", __func__); @@ -1458,7 +1460,8 @@ bool rna_Object_modifiers_override_apply(Main *UNUSED(bmain), /* This handles NULL anchor as expected by adding at head of list. */ BLI_insertlinkafter(&ob_dst->modifiers, mod_anchor, mod_dst); - /* This should actually *not* be needed in typical cases. However, if overridden source was edited, + /* This should actually *not* be needed in typical cases. + * However, if overridden source was edited, * we *may* have some new conflicting names. */ modifier_unique_name(&ob_dst->modifiers, mod_dst); @@ -1860,7 +1863,8 @@ static void rna_def_material_slot(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_MATERIAL_DATA); /* WARNING! Order is crucial for override to work properly here... :/ - * 'link' must come before material pointer, since it defines where (in object or obdata) that one is set! */ + * 'link' must come before material pointer, + * since it defines where (in object or obdata) that one is set! */ prop = RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, link_items); RNA_def_property_enum_funcs( @@ -2640,7 +2644,10 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Constraints", "Constraints affecting the transformation of the object"); RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Object_constraints_override_apply"); - /* RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "constraints__add", "constraints__remove"); */ +# if 0 + RNA_def_property_collection_funcs( + prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "constraints__add", "constraints__remove"); +# endif rna_def_object_constraints(brna, prop); /* vertex groups */ diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 63ccc10afb2..02b700a03c1 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -534,7 +534,8 @@ static void rna_Object_ray_cast(Object *ob, distmin <= distance)) { BVHTreeFromMesh treeData = {NULL}; - /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */ + /* No need to managing allocation or freeing of the BVH data. + * This is generated and freed as needed. */ BKE_bvhtree_from_mesh_get(&treeData, ob->runtime.mesh_eval, BVHTREE_FROM_LOOPTRI, 4); /* may fail if the mesh has no faces, in that case the ray-cast misses */ @@ -591,7 +592,8 @@ static void rna_Object_closest_point_on_mesh(Object *ob, return; } - /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */ + /* No need to managing allocation or freeing of the BVH data. + * this is generated and freed as needed. */ BKE_bvhtree_from_mesh_get(&treeData, ob->runtime.mesh_eval, BVHTREE_FROM_LOOPTRI, 4); if (treeData.tree == NULL) { diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 4dea47eaf32..c4f0eb35627 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -894,8 +894,9 @@ static void rna_def_pointcache_active(BlenderRNA *brna) /* This first-level RNA pointer also has list of all caches from owning ID. * Those caches items have exact same content as 'active' one, except for that collection, * to prevent ugly recursive layout pattern. - * Note: This shall probably be redone from scratch in a proper way at some point, but for now that will do, - * and shall not break anything in the API. */ + * + * Note: This shall probably be redone from scratch in a proper way at some point, + * but for now that will do, and shall not break anything in the API. */ prop = RNA_def_property(srna, "point_caches", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index cb74055ae83..8c3d16f9c8c 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -281,7 +281,10 @@ static void rna_Particle_uv_on_emitter(ParticleData *particle, ParticleSystemModifierData *modifier, float r_uv[2]) { - /*psys_particle_on_emitter(psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, nor, 0, 0, sd.orco, 0);*/ +# if 0 + psys_particle_on_emitter( + psmd, part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co, nor, 0, 0, sd.orco, 0); +# endif /* get uvco & mcol */ int num = particle->num_dmcache; @@ -2279,7 +2282,8 @@ static void rna_def_particle_settings(BlenderRNA *brna) "rna_Particle_reset", NULL); - /* fluid particle type can't be checked from the type value in rna as it's not shown in the menu */ + /* Fluid particle type can't be checked from the type value in RNA + * as it's not shown in the menu. */ prop = RNA_def_property(srna, "is_fluid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_PartSettings_is_fluid_get", NULL); @@ -2790,7 +2794,8 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop = RNA_def_property(srna, "effector_amount", PROP_INT, PROP_UNSIGNED); - /* in theory PROP_ANIMATABLE perhaps should be cleared, but animating this can give some interesting results! */ + /* In theory PROP_ANIMATABLE perhaps should be cleared, + * but animating this can give some interesting results! */ RNA_def_property_range(prop, 0, 10000); /* 10000 effectors will bel SLOW, but who knows */ RNA_def_property_ui_range(prop, 0, 100, 1, -1); RNA_def_property_ui_text( diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 5f652777481..1b4a7efbdd8 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -614,7 +614,8 @@ bool rna_PoseChannel_constraints_override_apply(Main *UNUSED(bmain), /* This handles NULL anchor as expected by adding at head of list. */ BLI_insertlinkafter(&pchan_dst->constraints, con_anchor, con_dst); - /* This should actually *not* be needed in typical cases. However, if overridden source was edited, + /* This should actually *not* be needed in typical cases. + * However, if overridden source was edited, * we *may* have some new conflicting names. */ BKE_constraint_unique_name(con_dst, &pchan_dst->constraints); @@ -743,7 +744,8 @@ static bPoseChannel *rna_PoseChannel_ensure_own_pchan(Object *ob, bPoseChannel *ref_pchan) { if (ref_ob != ob) { - /* We are trying to set a pchan from another object! Forbidden, try to find by name, or abort. */ + /* We are trying to set a pchan from another object! Forbidden, + * try to find by name, or abort. */ if (ref_pchan != NULL) { ref_pchan = BKE_pose_channel_find_name(ob->pose, ref_pchan->name); } @@ -978,7 +980,8 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_enum_items(prop, rna_enum_object_rotation_mode_items); RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL); - /* XXX... disabled, since proxy-locked layers are currently used for ensuring proxy-syncing too */ + /* XXX... disabled, since proxy-locked layers are currently + * used for ensuring proxy-syncing too */ 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"); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 16897a2b4d6..e6ee70a342a 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -1165,7 +1165,8 @@ static bool rna_property_override_diff_propptr_validate_diffing(PointerRNA *prop /* We do a generic quick first comparison checking for "name" and/or "type" properties. * We assume that is any of those are false, then we are not handling the same data. - * This helps a lot in static override case, especially to detect inserted items in collections. */ + * This helps a lot in static override case, especially to detect inserted items in collections. + */ if (!no_prop_name && (is_valid_for_diffing || do_force_name)) { PropertyRNA *nameprop_a = RNA_struct_name_property(propptr_a->type); PropertyRNA *nameprop_b = (propptr_b != NULL) ? RNA_struct_name_property(propptr_b->type) : @@ -1238,7 +1239,8 @@ static int rna_property_override_diff_propptr(Main *bmain, bool is_id = false; bool is_null = false; bool is_type_diff = false; - /* If false, it means that the whole data itself is different, so no point in going inside of it at all! */ + /* If false, it means that the whole data itself is different, + * so no point in going inside of it at all! */ bool is_valid_for_diffing = rna_property_override_diff_propptr_validate_diffing(propptr_a, propptr_b, no_prop_name, @@ -1253,8 +1255,8 @@ static int rna_property_override_diff_propptr(Main *bmain, 0); if (is_id) { - BLI_assert( - no_ownership); /* For now, once we deal with nodetrees we'll want to get rid of that one. */ + /* For now, once we deal with nodetrees we'll want to get rid of that one. */ + BLI_assert(no_ownership); } if (override) { @@ -1319,7 +1321,8 @@ int rna_property_override_diff_default(Main *bmain, { BLI_assert(len_a == len_b); - /* Note: at this point, we are sure that when len_a is zero, we are not handling an (empty) array. */ + /* Note: at this point, we are sure that when len_a is zero, + * we are not handling an (empty) array. */ const bool do_create = override != NULL && (flags & RNA_OVERRIDE_COMPARE_CREATE) != 0 && rna_path != NULL; @@ -1543,9 +1546,14 @@ int rna_property_override_diff_default(Main *bmain, ptr_a, prop_a, fixed_a, sizeof(fixed_a), &len_str_a); char *value_b = RNA_property_string_get_alloc( ptr_b, prop_b, fixed_b, sizeof(fixed_b), &len_str_b); - /* TODO we could do a check on length too, but then we would not have a 'real' string comparison... + /* TODO we could do a check on length too, + * but then we would not have a 'real' string comparison... * Maybe behind a eRNAOverrideMatch flag? */ - // const int comp = len_str_a < len_str_b ? -1 : len_str_a > len_str_b ? 1 : strcmp(value_a, value_b); +# if 0 + const int comp = len_str_a < len_str_b ? + -1 : + len_str_a > len_str_b ? 1 : strcmp(value_a, value_b); +# endif const int comp = strcmp(value_a, value_b); if (do_create && comp != 0) { @@ -1643,7 +1651,8 @@ int rna_property_override_diff_default(Main *bmain, is_valid_for_insertion = use_insertion; - /* If false, it means that the whole data itself is different, so no point in going inside of it at all! */ + /* If false, it means that the whole data itself is different, + * so no point in going inside of it at all! */ if (iter_b.valid) { is_valid_for_diffing = rna_property_override_diff_propptr_validate_diffing( &iter_a.ptr, @@ -1725,7 +1734,8 @@ int rna_property_override_diff_default(Main *bmain, } else { /* Based on index... */ if (rna_path) { - /* In case of indices, we need _a one for insertion, but _b ones for in-depth diffing. + /* In case of indices, we need _a one for insertion, + * but _b ones for in-depth diffing. * Insertion always happen once all 'replace' operations have been done, * otherwise local and reference paths for those would have to be different! */ RNA_PATH_PRINTF("%s[%d]", rna_path, is_valid_for_insertion ? idx_a : idx_b); @@ -1733,8 +1743,8 @@ int rna_property_override_diff_default(Main *bmain, } } - /* Collections do not support replacement of their data (since they do not support removing), - * only in *some* cases, insertion. + /* Collections do not support replacement of their data + * (since they do not support removing), only in *some* cases, insertion. * We also assume then that _a data is the one where things are inserted. */ if (is_valid_for_insertion && use_insertion) { bool created; @@ -1742,8 +1752,8 @@ int rna_property_override_diff_default(Main *bmain, override, rna_path, &created); if (is_first_insert) { - /* We need to clean up all possible existing insertion operations, otherwise we'd end up - * with a mess of ops everytime something changes. */ + /* We need to clean up all possible existing insertion operations, + * otherwise we'd end up with a mess of ops everytime something changes. */ for (IDOverrideStaticPropertyOperation *opop = op->operations.first; opop != NULL;) { IDOverrideStaticPropertyOperation *opop_next = opop->next; if (ELEM(opop->operation, @@ -1765,7 +1775,12 @@ int rna_property_override_diff_default(Main *bmain, true, NULL, NULL); - // printf("%s: Adding insertion op override after '%s'/%d\n", rna_path, prev_propname_a, idx_a - 1); +# if 0 + printf("%s: Adding insertion op override after '%s'/%d\n", + rna_path, + prev_propname_a, + idx_a - 1); +# endif } else if (is_id || is_valid_for_diffing) { if (equals || do_create) { @@ -1878,8 +1893,8 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), /* XXX TODO About range limits. * Ideally, it would be great to get rid of RNA range in that specific case. - * However, this won't be that easy and will add yet another layer of complexity in generated code, - * not to mention that we could most likely *not* bypass custom setters anyway. + * However, this won't be that easy and will add yet another layer of complexity in + * generated code, not to mention that we could most likely *not* bypass custom setters anyway. * So for now, if needed second operand value is not in valid range, we simply fall back * to a mere REPLACE operation. * Time will say whether this is acceptable limitation or not. */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 857730beac7..7a0345795eb 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -713,8 +713,8 @@ 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 + /* 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; @@ -1009,7 +1009,8 @@ 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 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 diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 19dc16e1c9c..be76a8136c0 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -504,7 +504,8 @@ static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr)) /* of course we need to invalidate here */ BKE_texpaint_slots_refresh_object(scene, ob); - /* we assume that changing the current mode will invalidate the uv layers so we need to refresh display */ + /* We assume that changing the current mode will invalidate the uv layers + * so we need to refresh display. */ BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); } diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 01ea7471b29..504bfa79eb9 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -175,7 +175,8 @@ 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) */ + /* The problem with seq->strip->len and seq->len is that it's discounted from the offset + * (hard cut trim). */ return (int)olen; } @@ -508,8 +509,10 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value) /* fix all the animation data which may link to this */ - /* don't rename everywhere because these are per scene */ - /* BKE_animdata_fix_paths_rename_all(NULL, "sequence_editor.sequences_all", oldname, seq->name + 2); */ + /* Don't rename everywhere because these are per scene. */ +# if 0 + BKE_animdata_fix_paths_rename_all(NULL, "sequence_editor.sequences_all", oldname, seq->name + 2); +# endif adt = BKE_animdata_from_id(&scene->id); if (adt) BKE_animdata_fix_paths_rename( diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c index 6c610a92093..06c968534cc 100644 --- a/source/blender/makesrna/intern/rna_shader_fx.c +++ b/source/blender/makesrna/intern/rna_shader_fx.c @@ -532,7 +532,8 @@ static void rna_def_shader_fx_glow(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Threshold", "Limit to select color for glow effect"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_ShaderFx_update"); - /* use blur fields to make compatible with blur filter, but only makes public first array element */ + /* Use blur fields to make compatible with blur filter, + * but only makes public first array element. */ prop = RNA_def_property(srna, "radius", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "blur[0]"); RNA_def_property_range(prop, 0, INT_MAX); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index f2a79fba503..39baf8465b2 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -84,7 +84,13 @@ const EnumPropertyItem rna_enum_space_type_items[] = { /* Animation */ {0, "", ICON_NONE, "Animation", ""}, - //{SPACE_ACTION, "TIMELINE", ICON_TIME, "Timeline", "Timeline and playback controls (NOTE: Switch to 'Timeline' mode)"}, /* XXX */ +#if 0 + {SPACE_ACTION, + "TIMELINE", + ICON_TIME, + "Timeline", + "Timeline and playback controls (NOTE: Switch to 'Timeline' mode)"}, /* XXX */ +#endif {SPACE_ACTION, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", "Adjust timing of keyframes"}, {SPACE_GRAPH, "GRAPH_EDITOR", @@ -191,7 +197,8 @@ const EnumPropertyItem rna_enum_space_graph_mode_items[] = { } #ifndef RNA_RUNTIME -/* XXX: action-editor is currently for object-level only actions, so show that using object-icon hint */ +/* XXX: action-editor is currently for object-level only actions, + * so show that using object-icon hint */ static EnumPropertyItem rna_enum_space_action_mode_all_items[] = { SACT_ITEM_DOPESHEET, SACT_ITEM_TIMELINE, @@ -370,7 +377,8 @@ const EnumPropertyItem rna_enum_clip_editor_mode_items[] = { {0, NULL, 0, NULL, NULL}, }; -/* Actually populated dynamically trough a function, but helps for context-less access (e.g. doc, i18n...). */ +/* Actually populated dynamically trough a function, + * but helps for context-less access (e.g. doc, i18n...). */ static const EnumPropertyItem buttons_context_items[] = { {BCONTEXT_TOOL, "TOOL", ICON_TOOL_SETTINGS, "Tool", "Active Tool and Workspace settings"}, {BCONTEXT_SCENE, "SCENE", ICON_SCENE_DATA, "Scene", "Scene"}, @@ -1210,7 +1218,8 @@ static const EnumPropertyItem *rna_SpaceView3D_stereo3d_camera_itemf(bContext *C static int rna_SpaceView3D_icon_from_show_object_viewport_get(PointerRNA *ptr) { const View3D *v3d = (View3D *)ptr->data; - /* Ignore selection values when view is off, intent is to show if visible objects aren't selectable. */ + /* Ignore selection values when view is off, + * intent is to show if visible objects aren't selectable. */ const int view_value = (v3d->object_type_exclude_viewport != 0); const int select_value = (v3d->object_type_exclude_select & ~v3d->object_type_exclude_viewport) != 0; @@ -1798,7 +1807,8 @@ static void rna_SpaceDopeSheetEditor_action_update(bContext *C, PointerRNA *ptr) * EXCEPTION: * This callback runs when unlinking actions. In that case, we don't want to * stash the action, as the user is signalling that they want to detach it. - * This can be reviewed again later, but it could get annoying if we keep these instead. + * This can be reviewed again later, + * but it could get annoying if we keep these instead. */ if ((adt->action->id.us <= 0) && (saction->action != NULL)) { /* XXX: Things here get dodgy if this action is only partially completed, @@ -1881,7 +1891,8 @@ static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr) /* recalculate extents of channel list */ saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; - /* store current mode as "old mode", so that returning from other editors doesn't always reset to "Action Editor" */ + /* store current mode as "old mode", + * so that returning from other editors doesn't always reset to "Action Editor" */ if (saction->mode != SACTCONT_TIMELINE) { saction->mode_prev = saction->mode; } @@ -2479,7 +2490,8 @@ static void rna_def_space(BlenderRNA *brna) prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "spacetype"); RNA_def_property_enum_items(prop, rna_enum_space_type_items); - /* When making this editable, take care for the special case of global areas (see rna_Area_type_set). */ + /* When making this editable, take care for the special case of global areas + * (see rna_Area_type_set). */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Type", "Space data type"); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 17e01899e26..1271eef02af 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1148,7 +1148,8 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Interpolation", "Interpolate pixels using selected filter"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - /* XXX: I think flip_axis should be a generic Texture property, enabled for all the texture types */ + /* XXX: I think flip_axis should be a generic Texture property, + * enabled for all the texture types. */ prop = RNA_def_property(srna, "use_flip_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT); RNA_def_property_ui_text(prop, "Flip Axis", "Flip the texture's X and Y axis"); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index dd378c60c72..faa16f4f146 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -496,8 +496,8 @@ static void uilist_filter_items(uiList *ui_list, memcpy(flt_data->items_filter_flags, filter_flags, sizeof(int) * len); if (filter_neworder) { - /* For sake of simplicity, py filtering is expected to filter all items, but we actually only want - * reordering data for shown items! + /* For sake of simplicity, py filtering is expected to filter all items, + * but we actually only want reordering data for shown items! */ int items_shown, shown_idx; int t_idx, t_ni, prev_ni; @@ -1405,8 +1405,8 @@ static void rna_def_uilist(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "filter_flag", UILST_FLT_EXCLUDE); RNA_def_property_ui_text(prop, "Invert", "Invert filtering (show hidden items, and vice-versa)"); - /* WARNING: This is sort of an abuse, sort-by-alpha is actually a value, should even be an enum in full logic - * (of two values, sort by index and sort by name). + /* WARNING: This is sort of an abuse, sort-by-alpha is actually a value, + * should even be an enum in full logic (of two values, sort by index and sort by name). * But for default UIList, it's nicer (better UI-wise) to show this as a boolean bit-flag option, * avoids having to define custom setters/getters using UILST_FLT_SORT_MASK to mask out * actual bitflags on same var, etc. diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index c41e1623961..7ce9155e3d9 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -65,11 +65,12 @@ const char *rna_translate_ui_text( /* Else, if an RNA type or property is specified, use its context. */ # if 0 - /* XXX Disabled for now. Unfortunately, their is absolutely no way from py code to get the RNA struct corresponding - * to the 'data' (in functions like prop() & co), as this is pure runtime data. Hence, messages extraction - * script can't determine the correct context it should use for such 'text' messages... - * So for now, one have to explicitly specify the 'text_ctxt' when using prop() etc. functions, - * if default context is not suitable. + /* XXX Disabled for now. Unfortunately, their is absolutely no way from py code to get the RNA + * struct corresponding to the 'data' (in functions like prop() & co), + * as this is pure runtime data. Hence, messages extraction script can't determine the + * correct context it should use for such 'text' messages... + * So for now, one have to explicitly specify the 'text_ctxt' when using prop() etc. + * functions, if default context is not suitable. */ if (prop) { return BLT_pgettext(RNA_property_translation_context(prop), text); @@ -1473,7 +1474,13 @@ void RNA_api_ui_layout(StructRNA *srna) func, "Item. A widget to control color managed view settings settings."); RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); - /* RNA_def_boolean(func, "show_global_settings", false, "", "Show widgets to control global color management settings"); */ +# if 0 + RNA_def_boolean(func, + "show_global_settings", + false, + "", + "Show widgets to control global color management settings"); +# endif /* node socket icon */ func = RNA_def_function(srna, "template_node_socket", "uiTemplateNodeSocket"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index c704b296f75..0236820e4d9 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2949,10 +2949,8 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) 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) */ + /* Note: These limits prevent buttons overlapping (min), and excessive size... (max) */ + RNA_def_property_range(prop, 0.8f, 5.0f); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_DOPESHEET, "rna_userdef_theme_update"); prop = RNA_def_property(srna, "summary", PROP_FLOAT, PROP_COLOR_GAMMA); @@ -4474,7 +4472,8 @@ static void rna_def_userdef_edit(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object"); - /* currently only used for insert offset (aka auto-offset), maybe also be useful for later stuff though */ + /* Currently only used for insert offset (aka auto-offset), + * maybe also be useful for later stuff though. */ prop = RNA_def_property(srna, "node_margin", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "node_margin"); RNA_def_property_ui_text( @@ -4534,21 +4533,21 @@ static void rna_def_userdef_system(BlenderRNA *brna) }; static const EnumPropertyItem audio_rate_items[] = { - /* {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"}, */ - /* {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"}, */ - /* {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"}, */ - /* {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"}, */ - /* {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"}, */ - {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"}, - {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"}, - /* {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"}, */ - {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"}, - {192000, - "RATE_192000", - 0, - "192 kHz", - "Set audio sampling rate to 192000 samples per second"}, - {0, NULL, 0, NULL, NULL}, +# if 0 + {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"}, + {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"}, + {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"}, + {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"}, + {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"}, +# endif + {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"}, + {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"}, +# if 0 + {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"}, +# endif + {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"}, + {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"}, + {0, NULL, 0, NULL, NULL}, }; static const EnumPropertyItem audio_format_items[] = { @@ -5086,9 +5085,11 @@ static void rna_def_userdef_input(BlenderRNA *brna) /* 3D view */ prop = RNA_def_property(srna, "ndof_show_guide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE); + + /* TODO: update description when fly-mode visuals are in place + * ("projected position in fly mode"). */ 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); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index e3c2f9d5233..34faf13fa7e 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1532,7 +1532,8 @@ static void rna_Operator_unregister(struct Main *bmain, StructRNA *type) idname = ot->idname; WM_operatortype_remove_ptr(ot); - /* not to be confused with the RNA_struct_free that WM_operatortype_remove calls, they are 2 different srna's */ + /* Not to be confused with the RNA_struct_free that WM_operatortype_remove calls, + * they are 2 different srna's. */ RNA_struct_free(&BLENDER_RNA, type); MEM_freeN((void *)idname); @@ -1728,7 +1729,8 @@ static void rna_KeyMapItem_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi #else /* RNA_RUNTIME */ /** - * expose ``Operator.options`` as its own type so we can control each flags use (some are read-only). + * expose ``Operator.options`` as its own type so we can control each flags use + * (some are read-only). */ static void rna_def_operator_options_runtime(BlenderRNA *brna) { diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c index b5f9f6102de..a473f97d554 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo.c @@ -752,8 +752,8 @@ static void rna_gizmogroup_invoke_prepare_cb(const bContext *C, wmGizmoGroup *gz FunctionRNA *func; RNA_pointer_create(NULL, gzgroup->type->ext.srna, gzgroup, &gzgroup_ptr); - func = - &rna_GizmoGroup_invoke_prepare_func; /* RNA_struct_find_function(&wgroupr, "invoke_prepare"); */ + /* RNA_struct_find_function(&wgroupr, "invoke_prepare"); */ + func = &rna_GizmoGroup_invoke_prepare_func; RNA_parameter_list_create(&list, &gzgroup_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); |