From a9f6e5438443e6b35db1e22f6c595d31804af9b6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 12 May 2012 11:01:29 +0000 Subject: style cleanup: mostly whitespace in rna --- source/blender/avi/AVI_avi.h | 6 +- source/blender/editors/space_file/fsmenu.c | 142 ++- source/blender/makesrna/RNA_types.h | 96 +- source/blender/makesrna/intern/makesrna.c | 675 ++++++------- source/blender/makesrna/intern/rna_ID.c | 96 +- source/blender/makesrna/intern/rna_access.c | 1048 ++++++++++---------- source/blender/makesrna/intern/rna_action.c | 106 +- source/blender/makesrna/intern/rna_actuator.c | 247 ++--- source/blender/makesrna/intern/rna_animation.c | 143 +-- source/blender/makesrna/intern/rna_animation_api.c | 2 +- source/blender/makesrna/intern/rna_animviz.c | 69 +- source/blender/makesrna/intern/rna_armature.c | 126 +-- source/blender/makesrna/intern/rna_armature_api.c | 2 +- source/blender/makesrna/intern/rna_boid.c | 58 +- source/blender/makesrna/intern/rna_camera.c | 68 +- source/blender/makesrna/intern/rna_cloth.c | 95 +- source/blender/makesrna/intern/rna_color.c | 53 +- source/blender/makesrna/intern/rna_constraint.c | 627 ++++++------ source/blender/makesrna/intern/rna_context.c | 33 +- source/blender/makesrna/intern/rna_controller.c | 71 +- source/blender/makesrna/intern/rna_curve.c | 220 ++-- source/blender/makesrna/intern/rna_define.c | 239 ++--- source/blender/makesrna/intern/rna_dynamicpaint.c | 246 ++--- source/blender/makesrna/intern/rna_fcurve.c | 285 +++--- source/blender/makesrna/intern/rna_fluidsim.c | 40 +- source/blender/makesrna/intern/rna_gpencil.c | 39 +- source/blender/makesrna/intern/rna_group.c | 18 +- source/blender/makesrna/intern/rna_image.c | 117 +-- source/blender/makesrna/intern/rna_image_api.c | 20 +- source/blender/makesrna/intern/rna_key.c | 99 +- source/blender/makesrna/intern/rna_lamp.c | 101 +- source/blender/makesrna/intern/rna_lattice.c | 53 +- source/blender/makesrna/intern/rna_main.c | 97 +- source/blender/makesrna/intern/rna_main_api.c | 107 +- source/blender/makesrna/intern/rna_material.c | 203 ++-- source/blender/makesrna/intern/rna_mesh.c | 318 +++--- source/blender/makesrna/intern/rna_mesh_api.c | 4 +- source/blender/makesrna/intern/rna_meta.c | 31 +- source/blender/makesrna/intern/rna_modifier.c | 364 +++---- source/blender/makesrna/intern/rna_movieclip.c | 29 +- source/blender/makesrna/intern/rna_nla.c | 130 +-- source/blender/makesrna/intern/rna_object.c | 605 +++++------ source/blender/makesrna/intern/rna_object_api.c | 274 ++--- source/blender/makesrna/intern/rna_object_force.c | 141 +-- source/blender/makesrna/intern/rna_packedfile.c | 3 +- source/blender/makesrna/intern/rna_particle.c | 187 ++-- source/blender/makesrna/intern/rna_pose.c | 292 +++--- source/blender/makesrna/intern/rna_pose_api.c | 2 +- source/blender/makesrna/intern/rna_property.c | 19 +- source/blender/makesrna/intern/rna_render.c | 57 +- source/blender/makesrna/intern/rna_rna.c | 271 ++--- source/blender/makesrna/intern/rna_scene_api.c | 4 +- source/blender/makesrna/intern/rna_screen.c | 41 +- source/blender/makesrna/intern/rna_sculpt_paint.c | 58 +- source/blender/makesrna/intern/rna_sensor.c | 40 +- source/blender/makesrna/intern/rna_sequencer.c | 12 +- source/blender/makesrna/intern/rna_smoke.c | 80 +- source/blender/makesrna/intern/rna_sound.c | 8 +- source/blender/makesrna/intern/rna_space.c | 724 +++++++------- source/blender/makesrna/intern/rna_text.c | 18 +- source/blender/makesrna/intern/rna_text_api.c | 4 +- source/blender/makesrna/intern/rna_texture.c | 169 ++-- source/blender/makesrna/intern/rna_texture_api.c | 6 +- source/blender/makesrna/intern/rna_timeline.c | 6 +- source/blender/makesrna/intern/rna_ui.c | 93 +- source/blender/makesrna/intern/rna_ui_api.c | 95 +- source/blender/makesrna/intern/rna_userdef.c | 127 ++- source/blender/makesrna/intern/rna_wm.c | 256 ++--- source/blender/makesrna/intern/rna_wm_api.c | 58 +- source/blender/makesrna/intern/rna_world.c | 43 +- source/blender/modifiers/intern/MOD_util.c | 2 +- source/blender/windowmanager/wm_cursors.h | 10 +- source/creator/buildinfo.c | 26 +- 73 files changed, 5319 insertions(+), 4935 deletions(-) diff --git a/source/blender/avi/AVI_avi.h b/source/blender/avi/AVI_avi.h index 76e11ebad08..bdfdbc117ed 100644 --- a/source/blender/avi/AVI_avi.h +++ b/source/blender/avi/AVI_avi.h @@ -201,7 +201,7 @@ typedef struct _AviMovie { } AviMovie; typedef enum { - AVI_ERROR_NONE=0, + AVI_ERROR_NONE = 0, AVI_ERROR_COMPRESSION, AVI_ERROR_OPEN, AVI_ERROR_READING, @@ -214,7 +214,7 @@ typedef enum { /* belongs to the option-setting function. */ typedef enum { - AVI_OPTION_WIDTH=0, + AVI_OPTION_WIDTH = 0, AVI_OPTION_HEIGHT, AVI_OPTION_QUALITY, AVI_OPTION_FRAMERATE @@ -230,7 +230,7 @@ typedef enum { /** * This is a sort of MAKE_ID thing. Used in imbuf :( It is used * through options in the AVI header (AviStreamHeader). */ -#define FCC(ch4) (ch4[0] | ch4[1]<<8 | ch4[2]<<16 | ch4[3] << 24) +#define FCC(ch4) (ch4[0] | ch4[1] << 8 | ch4[2] << 16 | ch4[3] << 24) /** * Test whether this is an avi-format. diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 4f8da4a1069..50261175852 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -54,7 +54,7 @@ #endif #ifdef __APPLE__ - /* XXX BIG WARNING: carbon.h can not be included in blender code, it conflicts with struct ID */ +/* XXX BIG WARNING: carbon.h can not be included in blender code, it conflicts with struct ID */ # define ID ID_ # include #endif /* __APPLE__ */ @@ -68,7 +68,7 @@ /* FSMENU HANDLING */ - /* FSMenuEntry's without paths indicate seperators */ +/* FSMenuEntry's without paths indicate seperators */ typedef struct _FSMenuEntry FSMenuEntry; struct _FSMenuEntry { FSMenuEntry *next; @@ -77,8 +77,7 @@ struct _FSMenuEntry { short save; }; -typedef struct FSMenu -{ +typedef struct FSMenu { FSMenuEntry *fsmenu_system; FSMenuEntry *fsmenu_bookmarks; FSMenuEntry *fsmenu_recent; @@ -87,15 +86,15 @@ typedef struct FSMenu static FSMenu *g_fsmenu = NULL; -struct FSMenu* fsmenu_get(void) +FSMenu *fsmenu_get(void) { if (!g_fsmenu) { - g_fsmenu=MEM_callocN(sizeof(struct FSMenu), "fsmenu"); + g_fsmenu = MEM_callocN(sizeof(struct FSMenu), "fsmenu"); } return g_fsmenu; } -static FSMenuEntry *fsmenu_get_category(struct FSMenu* fsmenu, FSMenuCategory category) +static FSMenuEntry *fsmenu_get_category(struct FSMenu *fsmenu, FSMenuCategory category) { FSMenuEntry *fsms = NULL; @@ -113,7 +112,7 @@ static FSMenuEntry *fsmenu_get_category(struct FSMenu* fsmenu, FSMenuCategory ca return fsms; } -static void fsmenu_set_category(struct FSMenu* fsmenu, FSMenuCategory category, FSMenuEntry *fsms) +static void fsmenu_set_category(struct FSMenu *fsmenu, FSMenuCategory category, FSMenuEntry *fsms) { switch (category) { case FS_CATEGORY_SYSTEM: @@ -128,49 +127,49 @@ static void fsmenu_set_category(struct FSMenu* fsmenu, FSMenuCategory category, } } -int fsmenu_get_nentries(struct FSMenu* fsmenu, FSMenuCategory category) +int fsmenu_get_nentries(struct FSMenu *fsmenu, FSMenuCategory category) { FSMenuEntry *fsme; - int count= 0; + int count = 0; - for (fsme= fsmenu_get_category(fsmenu, category); fsme; fsme= fsme->next) + for (fsme = fsmenu_get_category(fsmenu, category); fsme; fsme = fsme->next) count++; return count; } -char *fsmenu_get_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx) +char *fsmenu_get_entry(struct FSMenu *fsmenu, FSMenuCategory category, int idx) { FSMenuEntry *fsme; - for (fsme= fsmenu_get_category(fsmenu, category); fsme && idx; fsme= fsme->next) + for (fsme = fsmenu_get_category(fsmenu, category); fsme && idx; fsme = fsme->next) idx--; - return fsme?fsme->path:NULL; + return fsme ? fsme->path : NULL; } -short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int idx) +short fsmenu_can_save(struct FSMenu *fsmenu, FSMenuCategory category, int idx) { FSMenuEntry *fsme; - for (fsme= fsmenu_get_category(fsmenu, category); fsme && idx; fsme= fsme->next) + for (fsme = fsmenu_get_category(fsmenu, category); fsme && idx; fsme = fsme->next) idx--; - return fsme?fsme->save:0; + return fsme ? fsme->save : 0; } -void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save) +void fsmenu_insert_entry(struct FSMenu *fsmenu, FSMenuCategory category, const char *path, int sorted, short save) { FSMenuEntry *prev; FSMenuEntry *fsme; FSMenuEntry *fsms; fsms = fsmenu_get_category(fsmenu, category); - prev= fsme= fsms; + prev = fsme = fsms; - for (; fsme; prev= fsme, fsme= fsme->next) { + for (; fsme; prev = fsme, fsme = fsme->next) { if (fsme->path) { - const int cmp_ret= BLI_path_cmp(path, fsme->path); + const int cmp_ret = BLI_path_cmp(path, fsme->path); if (cmp_ret == 0) { return; } @@ -188,26 +187,26 @@ void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const c } } - fsme= MEM_mallocN(sizeof(*fsme), "fsme"); - fsme->path= BLI_strdup(path); + fsme = MEM_mallocN(sizeof(*fsme), "fsme"); + fsme->path = BLI_strdup(path); fsme->save = save; if (prev) { - fsme->next= prev->next; - prev->next= fsme; + fsme->next = prev->next; + prev->next = fsme; } else { - fsme->next= fsms; + fsme->next = fsms; fsmenu_set_category(fsmenu, category, fsme); } } -void fsmenu_remove_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx) +void fsmenu_remove_entry(struct FSMenu *fsmenu, FSMenuCategory category, int idx) { - FSMenuEntry *prev= NULL, *fsme= NULL; + FSMenuEntry *prev = NULL, *fsme = NULL; FSMenuEntry *fsms = fsmenu_get_category(fsmenu, category); - for (fsme= fsms; fsme && idx; prev= fsme, fsme= fsme->next) + for (fsme = fsms; fsme && idx; prev = fsme, fsme = fsme->next) idx--; if (fsme) { @@ -218,10 +217,10 @@ void fsmenu_remove_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx /* remove fsme from list */ if (prev) { - prev->next= fsme->next; + prev->next = fsme->next; } else { - fsms= fsme->next; + fsms = fsme->next; fsmenu_set_category(fsmenu, category, fsms); } /* free entry */ @@ -231,16 +230,16 @@ void fsmenu_remove_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx } } -void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename) +void fsmenu_write_file(struct FSMenu *fsmenu, const char *filename) { - FSMenuEntry *fsme= NULL; - int nskip= 0; + FSMenuEntry *fsme = NULL; + int nskip = 0; FILE *fp = BLI_fopen(filename, "w"); if (!fp) return; fprintf(fp, "[Bookmarks]\n"); - for (fsme= fsmenu_get_category(fsmenu, FS_CATEGORY_BOOKMARKS); fsme; fsme= fsme->next) { + for (fsme = fsmenu_get_category(fsmenu, FS_CATEGORY_BOOKMARKS); fsme; fsme = fsme->next) { if (fsme->path && fsme->save) { fprintf(fp, "%s\n", fsme->path); } @@ -248,10 +247,10 @@ void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename) fprintf(fp, "[Recent]\n"); nskip = fsmenu_get_nentries(fsmenu, FS_CATEGORY_RECENT) - FSMENU_RECENT_MAX; // skip first entries if list too long - for (fsme= fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsme && (nskip>0); fsme= fsme->next, --nskip) { + for (fsme = fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsme && (nskip > 0); fsme = fsme->next, --nskip) { /* pass */ } - for (; fsme; fsme= fsme->next) { + for (; fsme; fsme = fsme->next) { if (fsme->path && fsme->save) { fprintf(fp, "%s\n", fsme->path); } @@ -259,7 +258,7 @@ void fsmenu_write_file(struct FSMenu* fsmenu, const char *filename) fclose(fp); } -void fsmenu_read_bookmarks(struct FSMenu* fsmenu, const char *filename) +void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename) { char line[256]; FSMenuCategory category = FS_CATEGORY_BOOKMARKS; @@ -268,11 +267,11 @@ void fsmenu_read_bookmarks(struct FSMenu* fsmenu, const char *filename) fp = BLI_fopen(filename, "r"); if (!fp) return; - while ( fgets ( line, 256, fp ) != NULL ) { /* read a line */ - if (strncmp(line, "[Bookmarks]", 11)==0) { + while (fgets(line, 256, fp) != NULL) { /* read a line */ + if (strncmp(line, "[Bookmarks]", 11) == 0) { category = FS_CATEGORY_BOOKMARKS; } - else if (strncmp(line, "[Recent]", 8)==0) { + else if (strncmp(line, "[Recent]", 8) == 0) { category = FS_CATEGORY_RECENT; } else { @@ -296,7 +295,7 @@ void fsmenu_read_bookmarks(struct FSMenu* fsmenu, const char *filename) fclose(fp); } -void fsmenu_read_system(struct FSMenu* fsmenu) +void fsmenu_read_system(struct FSMenu *fsmenu) { char line[256]; #ifdef WIN32 @@ -306,14 +305,14 @@ void fsmenu_read_system(struct FSMenu* fsmenu) char tmps[4]; int i; - tmp= GetLogicalDrives(); + tmp = GetLogicalDrives(); - for (i=0; i < 26; i++) { - if ((tmp>>i) & 1) { - tmps[0]='A'+i; - tmps[1]=':'; - tmps[2]='\\'; - tmps[3]=0; + for (i = 0; i < 26; i++) { + if ((tmp >> i) & 1) { + tmps[0] = 'A' + i; + tmps[1] = ':'; + tmps[2] = '\\'; + tmps[3] = 0; fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, tmps, 1, 0); } @@ -329,7 +328,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) #ifdef __APPLE__ { #if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4) - OSErr err=noErr; + OSErr err = noErr; int i; const char *home; @@ -343,7 +342,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) continue; FSRefMakePath(&dir, path, FILE_MAX); - if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net")) { + if (strcmp((char *)path, "/home") && strcmp((char *)path, "/net")) { /* /net and /home are meaningless on OSX, home folders are stored in /Users */ fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0); } @@ -393,13 +392,13 @@ void fsmenu_read_system(struct FSMenu* fsmenu) pathesArray = LSSharedFileListCopySnapshot(list, &seed); pathesCount = CFArrayGetCount(pathesArray); - for (i=0; imnt_fsname, "/dev", 4)) continue; - len= strlen(mnt->mnt_dir); - if (len && mnt->mnt_dir[len-1] != '/') { + len = strlen(mnt->mnt_dir); + if (len && mnt->mnt_dir[len - 1] != '/') { BLI_snprintf(line, FILE_MAXDIR, "%s/", mnt->mnt_dir); fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, line, 1, 0); } else fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, mnt->mnt_dir, 1, 0); - found= 1; + found = 1; } - if (endmntent (fp) == 0) { + if (endmntent(fp) == 0) { fprintf(stderr, "could not close the list of mounted filesystemts\n"); } } @@ -524,25 +523,24 @@ void fsmenu_read_system(struct FSMenu* fsmenu) } -static void fsmenu_free_category(struct FSMenu* fsmenu, FSMenuCategory category) +static void fsmenu_free_category(struct FSMenu *fsmenu, FSMenuCategory category) { - FSMenuEntry *fsme= fsmenu_get_category(fsmenu, category); + FSMenuEntry *fsme = fsmenu_get_category(fsmenu, category); while (fsme) { - FSMenuEntry *n= fsme->next; + FSMenuEntry *n = fsme->next; if (fsme->path) MEM_freeN(fsme->path); MEM_freeN(fsme); - fsme= n; + fsme = n; } } -void fsmenu_free(struct FSMenu* fsmenu) +void fsmenu_free(struct FSMenu *fsmenu) { fsmenu_free_category(fsmenu, FS_CATEGORY_SYSTEM); fsmenu_free_category(fsmenu, FS_CATEGORY_BOOKMARKS); fsmenu_free_category(fsmenu, FS_CATEGORY_RECENT); MEM_freeN(fsmenu); } - diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 47b25720373..348efaed8c6 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -80,15 +80,15 @@ typedef enum PropertyType { /* also update rna_property_subtype_unit when you change this */ typedef enum PropertyUnit { - PROP_UNIT_NONE = (0<<16), - PROP_UNIT_LENGTH = (1<<16), /* m */ - PROP_UNIT_AREA = (2<<16), /* m^2 */ - PROP_UNIT_VOLUME = (3<<16), /* m^3 */ - PROP_UNIT_MASS = (4<<16), /* kg */ - PROP_UNIT_ROTATION = (5<<16), /* radians */ - PROP_UNIT_TIME = (6<<16), /* frame */ - PROP_UNIT_VELOCITY = (7<<16), /* m/s */ - PROP_UNIT_ACCELERATION = (8<<16) /* m/(s^2) */ + PROP_UNIT_NONE = (0 << 16), + PROP_UNIT_LENGTH = (1 << 16), /* m */ + PROP_UNIT_AREA = (2 << 16), /* m^2 */ + PROP_UNIT_VOLUME = (3 << 16), /* m^3 */ + PROP_UNIT_MASS = (4 << 16), /* kg */ + PROP_UNIT_ROTATION = (5 << 16), /* radians */ + PROP_UNIT_TIME = (6 << 16), /* frame */ + PROP_UNIT_VELOCITY = (7 << 16), /* m/s */ + PROP_UNIT_ACCELERATION = (8 << 16) /* m/(s^2) */ } PropertyUnit; #define RNA_SUBTYPE_UNIT(subtype) ((subtype) & 0x00FF0000) @@ -118,22 +118,22 @@ typedef enum PropertySubType { PROP_UNSIGNED = 13, PROP_PERCENTAGE = 14, PROP_FACTOR = 15, - PROP_ANGLE = 16|PROP_UNIT_ROTATION, - PROP_TIME = 17|PROP_UNIT_TIME, - PROP_DISTANCE = 18|PROP_UNIT_LENGTH, + PROP_ANGLE = 16 | PROP_UNIT_ROTATION, + PROP_TIME = 17 | PROP_UNIT_TIME, + PROP_DISTANCE = 18 | PROP_UNIT_LENGTH, /* number arrays */ PROP_COLOR = 20, - PROP_TRANSLATION = 21|PROP_UNIT_LENGTH, + PROP_TRANSLATION = 21 | PROP_UNIT_LENGTH, PROP_DIRECTION = 22, - PROP_VELOCITY = 23|PROP_UNIT_VELOCITY, - PROP_ACCELERATION = 24|PROP_UNIT_ACCELERATION, + PROP_VELOCITY = 23 | PROP_UNIT_VELOCITY, + PROP_ACCELERATION = 24 | PROP_UNIT_ACCELERATION, PROP_MATRIX = 25, - PROP_EULER = 26|PROP_UNIT_ROTATION, + PROP_EULER = 26 | PROP_UNIT_ROTATION, PROP_QUATERNION = 27, PROP_AXISANGLE = 28, PROP_XYZ = 29, - PROP_XYZ_LENGTH = 29|PROP_UNIT_LENGTH, + PROP_XYZ_LENGTH = 29 | PROP_UNIT_LENGTH, PROP_COLOR_GAMMA = 30, PROP_COORDS = 31, /* generic array, no units applied, only that x/y/z/w are used (python vec) */ @@ -147,49 +147,49 @@ typedef enum PropertyFlag { /* editable means the property is editable in the user * interface, properties are editable by default except * for pointers and collections. */ - PROP_EDITABLE = (1<<0), + PROP_EDITABLE = (1 << 0), /* this property is editable even if it is lib linked, * meaning it will get lost on reload, but it's useful * for editing. */ - PROP_LIB_EXCEPTION = (1<<16), + PROP_LIB_EXCEPTION = (1 << 16), /* animatable means the property can be driven by some * other input, be it animation curves, expressions, .. * properties are animatable by default except for pointers * and collections */ - PROP_ANIMATABLE = (1<<1), + PROP_ANIMATABLE = (1 << 1), /* icon */ - PROP_ICONS_CONSECUTIVE = (1<<12), + PROP_ICONS_CONSECUTIVE = (1 << 12), /* hidden in the user interface */ - PROP_HIDDEN = (1<<19), + PROP_HIDDEN = (1 << 19), /* do not write in presets */ - PROP_SKIP_SAVE = (1<<28), + PROP_SKIP_SAVE = (1 << 28), /* function paramater flags */ - PROP_REQUIRED = (1<<2), - PROP_OUTPUT = (1<<3), - PROP_RNAPTR = (1<<11), + PROP_REQUIRED = (1 << 2), + PROP_OUTPUT = (1 << 3), + PROP_RNAPTR = (1 << 11), /* registering */ - PROP_REGISTER = (1<<4), - PROP_REGISTER_OPTIONAL = (1<<4)|(1<<5), + PROP_REGISTER = (1 << 4), + PROP_REGISTER_OPTIONAL = (1 << 4) | (1 << 5), /* pointers */ - PROP_ID_REFCOUNT = (1<<6), + PROP_ID_REFCOUNT = (1 << 6), /* disallow assigning a variable to its self, eg an object tracking its self * only apply this to types that are derived from an ID ()*/ - PROP_ID_SELF_CHECK = (1<<20), + 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] */ - PROP_NEVER_NULL = (1<<18), + 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! */ - PROP_NEVER_UNLINK = (1<<25), + PROP_NEVER_UNLINK = (1 << 25), /* flag contains multiple enums. * note: not to be confused with prop->enumbitflags @@ -197,32 +197,32 @@ typedef enum PropertyFlag { * * note: these can't be animated so use with care. */ - PROP_ENUM_FLAG = (1<<21), + PROP_ENUM_FLAG = (1 << 21), /* need context for update function */ - PROP_CONTEXT_UPDATE = (1<<22), - PROP_CONTEXT_PROPERTY_UPDATE = (1<<22)|(1<<27), + PROP_CONTEXT_UPDATE = (1 << 22), + PROP_CONTEXT_PROPERTY_UPDATE = (1 << 22) | (1 << 27), /* Use for arrays or for any data that should not have a referene kept * most common case is functions that return arrays where the array */ - PROP_THICK_WRAP = (1<<23), + PROP_THICK_WRAP = (1 << 23), /* Reject values outside limits, use for python api only so far * this is for use when silently clamping string length will give * bad behavior later. Could also enforce this for INT's and other types. * note: currently no support for function arguments or non utf8 paths (filepaths) */ - PROP_NEVER_CLAMP = (1<<26), + PROP_NEVER_CLAMP = (1 << 26), /* internal flags */ - PROP_BUILTIN = (1<<7), - PROP_EXPORT = (1<<8), - PROP_RUNTIME = (1<<9), - PROP_IDPROPERTY = (1<<10), - PROP_RAW_ACCESS = (1<<13), - PROP_RAW_ARRAY = (1<<14), - PROP_FREE_POINTERS = (1<<15), - PROP_DYNAMIC = (1<<17), /* for dynamic arrays, and retvals of type string */ - PROP_ENUM_NO_CONTEXT = (1<<24) /* for enum that shouldn't be contextual */ + PROP_BUILTIN = (1 << 7), + PROP_EXPORT = (1 << 8), + PROP_RUNTIME = (1 << 9), + PROP_IDPROPERTY = (1 << 10), + PROP_RAW_ACCESS = (1 << 13), + PROP_RAW_ARRAY = (1 << 14), + PROP_FREE_POINTERS = (1 << 15), + PROP_DYNAMIC = (1 << 17), /* for dynamic arrays, and retvals of type string */ + PROP_ENUM_NO_CONTEXT = (1 << 24) /* for enum that shouldn't be contextual */ } PropertyFlag; typedef struct CollectionPropertyIterator { @@ -245,7 +245,7 @@ typedef struct CollectionPointerLink { } CollectionPointerLink; typedef enum RawPropertyType { - PROP_RAW_UNSET=-1, + PROP_RAW_UNSET = -1, PROP_RAW_INT, // XXX - abused for types that are not set, eg. MFace.verts, needs fixing. PROP_RAW_SHORT, PROP_RAW_CHAR, @@ -315,7 +315,7 @@ typedef enum FunctionFlag { /* registering */ FUNC_REGISTER = 16, - FUNC_REGISTER_OPTIONAL = 16|32, + FUNC_REGISTER_OPTIONAL = 16 | 32, /* internal flags */ FUNC_BUILTIN = 128, diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 62957ac5de8..d148182cce7 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -139,7 +139,7 @@ static int replace_if_different(char *tmpfile, const char *dep_files[]) /* dir only */ p1 = strrchr(from_path, '/'); p2 = strrchr(from_path, '\\'); - strcpy((p1 > p2 ? p1 : p2)+1, dep_files[pass]); + strcpy((p1 > p2 ? p1 : p2) + 1, dep_files[pass]); /* account for build deps, if makesrna.c (this file) is newer */ if (file_older(orgfile, from_path)) { REN_IF_DIFF; @@ -170,8 +170,8 @@ static int replace_if_different(char *tmpfile, const char *dep_files[]) } /* now compare the files... */ - arr_new = MEM_mallocN(sizeof(char)*len_new, "rna_cmp_file_new"); - arr_org = MEM_mallocN(sizeof(char)*len_org, "rna_cmp_file_org"); + arr_new = MEM_mallocN(sizeof(char) * len_new, "rna_cmp_file_new"); + arr_org = MEM_mallocN(sizeof(char) * len_org, "rna_cmp_file_org"); if (fread(arr_new, sizeof(char), len_new, fp_new) != len_new) fprintf(stderr, "%s:%d, error reading file %s for comparison.\n", __FILE__, __LINE__, tmpfile); @@ -213,16 +213,16 @@ static const char *rna_safe_id(const char *id) static int cmp_struct(const void *a, const void *b) { - const StructRNA *structa = *(const StructRNA**)a; - const StructRNA *structb = *(const StructRNA**)b; + const StructRNA *structa = *(const StructRNA **)a; + const StructRNA *structb = *(const StructRNA **)b; return strcmp(structa->identifier, structb->identifier); } static int cmp_property(const void *a, const void *b) { - const PropertyRNA *propa = *(const PropertyRNA**)a; - const PropertyRNA *propb = *(const PropertyRNA**)b; + const PropertyRNA *propa = *(const PropertyRNA **)a; + const PropertyRNA *propb = *(const PropertyRNA **)b; if (strcmp(propa->identifier, "rna_type") == 0) return -1; else if (strcmp(propb->identifier, "rna_type") == 0) return 1; @@ -235,21 +235,21 @@ static int cmp_property(const void *a, const void *b) static int cmp_def_struct(const void *a, const void *b) { - const StructDefRNA *dsa = *(const StructDefRNA**)a; - const StructDefRNA *dsb = *(const StructDefRNA**)b; + const StructDefRNA *dsa = *(const StructDefRNA **)a; + const StructDefRNA *dsb = *(const StructDefRNA **)b; return cmp_struct(&dsa->srna, &dsb->srna); } static int cmp_def_property(const void *a, const void *b) { - const PropertyDefRNA *dpa = *(const PropertyDefRNA**)a; - const PropertyDefRNA *dpb = *(const PropertyDefRNA**)b; + const PropertyDefRNA *dpa = *(const PropertyDefRNA **)a; + const PropertyDefRNA *dpb = *(const PropertyDefRNA **)b; return cmp_property(&dpa->prop, &dpb->prop); } -static void rna_sortlist(ListBase *listbase, int(*cmp)(const void*, const void*)) +static void rna_sortlist(ListBase *listbase, int (*cmp)(const void *, const void *)) { Link *link; void **array; @@ -261,14 +261,14 @@ static void rna_sortlist(ListBase *listbase, int(*cmp)(const void*, const void*) for (size = 0, link = listbase->first; link; link = link->next) size++; - array = MEM_mallocN(sizeof(void*)*size, "rna_sortlist"); + array = MEM_mallocN(sizeof(void *) * size, "rna_sortlist"); for (a = 0, link = listbase->first; link; link = link->next, a++) array[a] = link; - qsort(array, size, sizeof(void*), cmp); + qsort(array, size, sizeof(void *), cmp); listbase->first = listbase->last = NULL; - for (a = 0; anext = link->prev = NULL; rna_addtail(listbase, link); @@ -322,7 +322,7 @@ static char *rna_alloc_function_name(const char *structname, const char *propnam char *result; snprintf(buffer, sizeof(buffer), "%s_%s_%s", structname, propname, type); - result = MEM_callocN(sizeof(char)*strlen(buffer)+1, "rna_alloc_function_name"); + result = MEM_callocN(sizeof(char) * strlen(buffer) + 1, "rna_alloc_function_name"); strcpy(result, buffer); alloc = MEM_callocN(sizeof(AllocDefRNA), "AllocDefRNA"); @@ -421,7 +421,7 @@ static const char *rna_parameter_type_name(PropertyRNA *parm) switch (parm->type) { case PROP_POINTER: { - PointerPropertyRNA *pparm = (PointerPropertyRNA*)parm; + PointerPropertyRNA *pparm = (PointerPropertyRNA *)parm; if (parm->flag & PROP_RNAPTR) return "PointerRNA"; @@ -438,11 +438,11 @@ static const char *rna_parameter_type_name(PropertyRNA *parm) static int rna_enum_bitmask(PropertyRNA *prop) { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; int a, mask = 0; if (eprop->item) { - for (a = 0; atotitem; a++) + for (a = 0; a < eprop->totitem; a++) if (eprop->item[a].identifier[0]) mask |= eprop->item[a].value; } @@ -459,7 +459,7 @@ static int rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp) static const char *rna_function_string(void *func) { - return (func)? (const char*)func: "NULL"; + return (func) ? (const char *)func : "NULL"; } static void rna_float_print(FILE *f, float num) @@ -524,7 +524,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr switch (prop->type) { case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; fprintf(f, "void %s(PointerRNA *ptr, char *value)\n", func); fprintf(f, "{\n"); if (manualfunc) { @@ -533,10 +533,10 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr else { const PropertySubType subtype = prop->subtype; const char *string_copy_func = (subtype == PROP_FILEPATH || - subtype == PROP_DIRPATH || - subtype == PROP_FILENAME || - subtype == PROP_BYTESTRING) ? - "BLI_strncpy" : "BLI_strncpy_utf8"; + subtype == PROP_DIRPATH || + subtype == PROP_FILENAME || + subtype == PROP_BYTESTRING) ? + "BLI_strncpy" : "BLI_strncpy_utf8"; rna_print_data_get(f, dp); @@ -563,20 +563,20 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr fprintf(f, " return %s(ptr);\n", manualfunc); } else { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; rna_print_data_get(f, dp); if (dp->dnapointerlevel == 0) fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, &data->%s);\n", - (const char*)pprop->type, dp->dnaname); + (const char *)pprop->type, dp->dnaname); else fprintf(f, " return rna_pointer_inherit_refine(ptr, &RNA_%s, data->%s);\n", - (const char*)pprop->type, dp->dnaname); + (const char *)pprop->type, dp->dnaname); } fprintf(f, "}\n\n"); break; } case PROP_COLLECTION: { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; fprintf(f, "static PointerRNA %s(CollectionPropertyIterator *iter)\n", func); fprintf(f, "{\n"); @@ -586,7 +586,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr strcmp(manualfunc, "rna_iterator_array_dereference_get") == 0) { fprintf(f, " return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n", - (cprop->item_type) ? (const char *)cprop->item_type: "UnknownType", manualfunc); + (cprop->item_type) ? (const char *)cprop->item_type : "UnknownType", manualfunc); } else { fprintf(f, " return %s(iter);\n", manualfunc); @@ -626,16 +626,16 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr if (dp->dnaarraylength == 1) { if (prop->type == PROP_BOOLEAN && dp->booleanbit) { fprintf(f, " values[i]= %s((data->%s & (%d<booleannegative)? "!": "", dp->dnaname, dp->booleanbit); + (dp->booleannegative) ? "!" : "", dp->dnaname, dp->booleanbit); } else { fprintf(f, " values[i]= (%s)%s((&data->%s)[i]);\n", - rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname); + rna_type_type(prop), (dp->booleannegative) ? "!" : "", dp->dnaname); } } else { if (prop->type == PROP_BOOLEAN && dp->booleanbit) { - fprintf(f, " values[i]= %s((data->%s[i] & ", (dp->booleannegative)? "!": "", + fprintf(f, " values[i]= %s((data->%s[i] & ", (dp->booleannegative) ? "!" : "", dp->dnaname); rna_int_print(f, dp->booleanbit); fprintf(f, ") != 0);\n"); @@ -646,11 +646,11 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr } else if (dp->dnatype) { fprintf(f, " values[i]= (%s)%s(((%s*)data->%s)[i]);\n", - rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnatype, dp->dnaname); + rna_type_type(prop), (dp->booleannegative) ? "!" : "", dp->dnatype, dp->dnaname); } else { fprintf(f, " values[i]= (%s)%s((data->%s)[i]);\n", - rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname); + rna_type_type(prop), (dp->booleannegative) ? "!" : "", dp->dnaname); } } fprintf(f, " }\n"); @@ -667,7 +667,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr else { rna_print_data_get(f, dp); if (prop->type == PROP_BOOLEAN && dp->booleanbit) { - fprintf(f, " return %s(((data->%s) & ", (dp->booleannegative)? "!": "", dp->dnaname); + fprintf(f, " return %s(((data->%s) & ", (dp->booleannegative) ? "!" : "", dp->dnaname); rna_int_print(f, dp->booleanbit); fprintf(f, ") != 0);\n"); } @@ -678,7 +678,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr } else fprintf(f, " return (%s)%s(data->%s);\n", rna_type_type(prop), - (dp->booleannegative)? "!": "", dp->dnaname); + (dp->booleannegative) ? "!" : "", dp->dnaname); } fprintf(f, "}\n\n"); @@ -693,7 +693,7 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr static void rna_clamp_value_range(FILE *f, PropertyRNA *prop) { if (prop->type == PROP_FLOAT) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (fprop->range) { fprintf(f, " float prop_clamp_min = -FLT_MAX, prop_clamp_max = FLT_MAX, prop_soft_min, prop_soft_max;\n"); @@ -702,7 +702,7 @@ static void rna_clamp_value_range(FILE *f, PropertyRNA *prop) } } else if (prop->type == PROP_INT) { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (iprop->range) { fprintf(f, " int prop_clamp_min = INT_MIN, prop_clamp_max = INT_MAX, prop_soft_min, prop_soft_max;\n"); fprintf(f, " %s(ptr, &prop_clamp_min, &prop_clamp_max, &prop_soft_min, &prop_soft_max);\n", @@ -714,7 +714,7 @@ static void rna_clamp_value_range(FILE *f, PropertyRNA *prop) static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array) { if (prop->type == PROP_INT) { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (iprop->hardmin != INT_MIN || iprop->hardmax != INT_MAX) { if (array) fprintf(f, "CLAMPIS(values[i], "); @@ -730,7 +730,7 @@ static void rna_clamp_value(FILE *f, PropertyRNA *prop, int array) } } else if (prop->type == PROP_FLOAT) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (fprop->hardmin != -FLT_MAX || fprop->hardmax != FLT_MAX) { if (array) fprintf(f, "CLAMPIS(values[i], "); @@ -777,7 +777,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr switch (prop->type) { case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; fprintf(f, "void %s(PointerRNA *ptr, const char *value)\n", func); fprintf(f, "{\n"); if (manualfunc) { @@ -786,10 +786,10 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr else { const PropertySubType subtype = prop->subtype; const char *string_copy_func = (subtype == PROP_FILEPATH || - subtype == PROP_DIRPATH || - subtype == PROP_FILENAME || - subtype == PROP_BYTESTRING) ? - "BLI_strncpy" : "BLI_strncpy_utf8"; + subtype == PROP_DIRPATH || + subtype == PROP_FILENAME || + subtype == PROP_BYTESTRING) ? + "BLI_strncpy" : "BLI_strncpy_utf8"; rna_print_data_get(f, dp); @@ -829,8 +829,8 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr fprintf(f, " id_us_plus((ID*)value.data);\n\n"); } else { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop; - StructRNA *type = rna_find_struct((const char*)pprop->type); + PointerPropertyRNA *pprop = (PointerPropertyRNA *)dp->prop; + StructRNA *type = rna_find_struct((const char *)pprop->type); if (type && (type->flag & STRUCT_ID)) { fprintf(f, " if (value.data)\n"); fprintf(f, " id_lib_extern((ID*)value.data);\n\n"); @@ -876,7 +876,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr if (dp->dnaarraylength == 1) { if (prop->type == PROP_BOOLEAN && dp->booleanbit) { fprintf(f, " if (%svalues[i]) data->%s |= (%d<booleannegative)? "!": "", dp->dnaname, dp->booleanbit); + (dp->booleannegative) ? "!" : "", dp->dnaname, dp->booleanbit); fprintf(f, " else data->%s &= ~(%d<dnaname, dp->booleanbit); } else { @@ -983,7 +983,7 @@ static char *rna_def_property_length_func(FILE *f, StructRNA *srna, PropertyRNA } else if (prop->type == PROP_COLLECTION) { if (!manualfunc) { - if (prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed)|| !dp->dnaname)) { + if (prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed) || !dp->dnaname)) { fprintf(stderr, "%s: %s.%s has no valid dna info.\n", __func__, srna->identifier, prop->identifier); DefRNA.error = 1; @@ -1088,8 +1088,8 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property return NULL; /* only supported in case of standard next functions */ - if (strcmp(nextfunc, "rna_iterator_array_next") == 0); - else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0); + if (strcmp(nextfunc, "rna_iterator_array_next") == 0) ; + else if (strcmp(nextfunc, "rna_iterator_listbase_next") == 0) ; else return NULL; } @@ -1153,7 +1153,7 @@ static char *rna_def_property_lookup_int_func(FILE *f, StructRNA *srna, Property #if 0 rna_print_data_get(f, dp); - item_type = (cprop->item_type)? (const char*)cprop->item_type: "UnknownType"; + item_type = (cprop->item_type) ? (const char *)cprop->item_type : "UnknownType"; if (dp->dnalengthname || dp->dnalengthfixed) { if (dp->dnalengthname) @@ -1267,79 +1267,79 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) switch (prop->type) { case PROP_BOOLEAN: { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; if (!prop->arraydimension) { if (!bprop->get && !bprop->set && !dp->booleanbit) rna_set_raw_property(dp, prop); - bprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->get); - bprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->set); + bprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)bprop->get); + bprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)bprop->set); } else { - bprop->getarray = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)bprop->getarray); - bprop->setarray = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)bprop->setarray); + bprop->getarray = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)bprop->getarray); + bprop->setarray = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)bprop->setarray); } break; } case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (!prop->arraydimension) { if (!iprop->get && !iprop->set) rna_set_raw_property(dp, prop); - iprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->get); - iprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->set); + iprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)iprop->get); + iprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)iprop->set); } else { if (!iprop->getarray && !iprop->setarray) rna_set_raw_property(dp, prop); - iprop->getarray = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)iprop->getarray); - iprop->setarray = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)iprop->setarray); + iprop->getarray = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)iprop->getarray); + iprop->setarray = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)iprop->setarray); } break; } case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (!prop->arraydimension) { if (!fprop->get && !fprop->set) rna_set_raw_property(dp, prop); - fprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->get); - fprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->set); + fprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)fprop->get); + fprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)fprop->set); } else { if (!fprop->getarray && !fprop->setarray) rna_set_raw_property(dp, prop); - fprop->getarray = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)fprop->getarray); - fprop->setarray = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)fprop->setarray); + fprop->getarray = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)fprop->getarray); + fprop->setarray = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)fprop->setarray); } break; } case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; - eprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)eprop->get); - eprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)eprop->set); + eprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)eprop->get); + eprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)eprop->set); break; } case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; - sprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)sprop->get); - sprop->length = (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)sprop->length); - sprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)sprop->set); + sprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)sprop->get); + sprop->length = (void *)rna_def_property_length_func(f, srna, prop, dp, (const char *)sprop->length); + sprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)sprop->set); break; } case PROP_POINTER: { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; - pprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)pprop->get); - pprop->set = (void*)rna_def_property_set_func(f, srna, prop, dp, (const char*)pprop->set); + pprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)pprop->get); + pprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)pprop->set); if (!pprop->type) { fprintf(stderr, "%s: %s.%s, pointer must have a struct type.\n", __func__, srna->identifier, prop->identifier); @@ -1348,28 +1348,28 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) break; } case PROP_COLLECTION: { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; - const char *nextfunc = (const char*)cprop->next; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; + const char *nextfunc = (const char *)cprop->next; - if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0); + if (dp->dnatype && strcmp(dp->dnatype, "ListBase") == 0) ; else if (dp->dnalengthname || dp->dnalengthfixed) - cprop->length = (void*)rna_def_property_length_func(f, srna, prop, dp, (const char*)cprop->length); + cprop->length = (void *)rna_def_property_length_func(f, srna, prop, dp, (const char *)cprop->length); /* test if we can allow raw array access, if it is using our standard * array get/next function, we can be sure it is an actual array */ if (cprop->next && cprop->get) - if (strcmp((const char*)cprop->next, "rna_iterator_array_next") == 0 && - strcmp((const char*)cprop->get, "rna_iterator_array_get") == 0) + if (strcmp((const char *)cprop->next, "rna_iterator_array_next") == 0 && + strcmp((const char *)cprop->get, "rna_iterator_array_get") == 0) { prop->flag |= PROP_RAW_ARRAY; } - cprop->get = (void*)rna_def_property_get_func(f, srna, prop, dp, (const char*)cprop->get); - cprop->begin = (void*)rna_def_property_begin_func(f, srna, prop, dp, (const char*)cprop->begin); - cprop->next = (void*)rna_def_property_next_func(f, srna, prop, dp, (const char*)cprop->next); - cprop->end = (void*)rna_def_property_end_func(f, srna, prop, dp, (const char*)cprop->end); - cprop->lookupint = (void*)rna_def_property_lookup_int_func(f, srna, prop, dp, - (const char*)cprop->lookupint, nextfunc); + cprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)cprop->get); + cprop->begin = (void *)rna_def_property_begin_func(f, srna, prop, dp, (const char *)cprop->begin); + cprop->next = (void *)rna_def_property_next_func(f, srna, prop, dp, (const char *)cprop->next); + cprop->end = (void *)rna_def_property_end_func(f, srna, prop, dp, (const char *)cprop->end); + cprop->lookupint = (void *)rna_def_property_lookup_int_func(f, srna, prop, dp, + (const char *)cprop->lookupint, nextfunc); if (!(prop->flag & PROP_IDPROPERTY)) { if (!cprop->begin) { @@ -1405,7 +1405,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR prop = dp->prop; - if (prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN)) + if (prop->flag & (PROP_IDPROPERTY | PROP_BUILTIN)) return; func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), ""); @@ -1443,13 +1443,13 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR break; } case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; int i; if (eprop->item) { fprintf(f, "enum {\n"); - for (i = 0; itotitem; i++) + for (i = 0; i < eprop->totitem; i++) if (eprop->item[i].identifier[0]) fprintf(f, "\t%s_%s_%s = %d,\n", srna->identifier, prop->identifier, eprop->item[i].identifier, eprop->item[i].value); @@ -1463,7 +1463,7 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR break; } case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; if (sprop->maxlength) { fprintf(f, "#define %s_%s_MAX %d\n\n", srna->identifier, prop->identifier, sprop->maxlength); @@ -1500,7 +1500,7 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property prop = dp->prop; - if (prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN)) + if (prop->flag & (PROP_IDPROPERTY | PROP_BUILTIN)) return; if (prop->name && prop->description && prop->description[0] != '\0') @@ -1533,13 +1533,13 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property break; } case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; int i; if (eprop->item) { fprintf(f, "\tenum %s_enum {\n", rna_safe_id(prop->identifier)); - for (i = 0; itotitem; i++) + for (i = 0; i < eprop->totitem; i++) if (eprop->item[i].identifier[0]) fprintf(f, "\t\t%s_%s = %d,\n", rna_safe_id(prop->identifier), eprop->item[i].identifier, eprop->item[i].value); @@ -1555,19 +1555,19 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property break; } case PROP_POINTER: { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)dp->prop; if (pprop->type) - fprintf(f, "\tinline %s %s(void);", (const char*)pprop->type, rna_safe_id(prop->identifier)); + fprintf(f, "\tinline %s %s(void);", (const char *)pprop->type, rna_safe_id(prop->identifier)); else fprintf(f, "\tinline %s %s(void);", "UnknownType", rna_safe_id(prop->identifier)); break; } case PROP_COLLECTION: { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)dp->prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop; if (cprop->item_type) - fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char*)cprop->item_type, srna->identifier, + fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char *)cprop->item_type, srna->identifier, rna_safe_id(prop->identifier)); else fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, @@ -1585,7 +1585,7 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe prop = dp->prop; - if (prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN)) + if (prop->flag & (PROP_IDPROPERTY | PROP_BUILTIN)) return; switch (prop->type) { @@ -1624,10 +1624,10 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe break; } case PROP_POINTER: { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)dp->prop; if (pprop->type) - fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (const char*)pprop->type, srna->identifier, + fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", (const char *)pprop->type, srna->identifier, rna_safe_id(prop->identifier)); else fprintf(f, "\tPOINTER_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, @@ -1636,10 +1636,10 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe } case PROP_COLLECTION: { #if 0 - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)dp->prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop; if (cprop->type) - fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char*)cprop->type, srna->identifier, + fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", (const char *)cprop->type, srna->identifier, prop->identifier); else fprintf(f, "\tCOLLECTION_PROPERTY(%s, %s, %s)", "UnknownType", srna->identifier, prop->identifier); @@ -1869,23 +1869,23 @@ static void rna_auto_types(void) if (dp->dnatype) { if (dp->prop->type == PROP_POINTER) { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)dp->prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)dp->prop; StructRNA *type; if (!pprop->type && !pprop->get) - pprop->type = (StructRNA*)rna_find_type(dp->dnatype); + pprop->type = (StructRNA *)rna_find_type(dp->dnatype); if (pprop->type) { - type = rna_find_struct((const char*)pprop->type); + type = rna_find_struct((const char *)pprop->type); if (type && (type->flag & STRUCT_ID_REFCOUNT)) pprop->property.flag |= PROP_ID_REFCOUNT; } } else if (dp->prop->type == PROP_COLLECTION) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)dp->prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop; if (!cprop->item_type && !cprop->get && strcmp(dp->dnatype, "ListBase") == 0) - cprop->item_type = (StructRNA*)rna_find_type(dp->dnatype); + cprop->item_type = (StructRNA *)rna_find_type(dp->dnatype); } } } @@ -1965,16 +1965,16 @@ static const char *rna_property_subtypename(PropertySubType type) static const char *rna_property_subtype_unit(PropertySubType type) { switch (RNA_SUBTYPE_UNIT(type)) { - case PROP_UNIT_NONE: return "PROP_UNIT_NONE"; - case PROP_UNIT_LENGTH: return "PROP_UNIT_LENGTH"; - case PROP_UNIT_AREA: return "PROP_UNIT_AREA"; - case PROP_UNIT_VOLUME: return "PROP_UNIT_VOLUME"; - case PROP_UNIT_MASS: return "PROP_UNIT_MASS"; - case PROP_UNIT_ROTATION: return "PROP_UNIT_ROTATION"; - case PROP_UNIT_TIME: return "PROP_UNIT_TIME"; - case PROP_UNIT_VELOCITY: return "PROP_UNIT_VELOCITY"; - case PROP_UNIT_ACCELERATION:return "PROP_UNIT_ACCELERATION"; - default: return "PROP_UNIT_UNKNOWN"; + case PROP_UNIT_NONE: return "PROP_UNIT_NONE"; + case PROP_UNIT_LENGTH: return "PROP_UNIT_LENGTH"; + case PROP_UNIT_AREA: return "PROP_UNIT_AREA"; + case PROP_UNIT_VOLUME: return "PROP_UNIT_VOLUME"; + case PROP_UNIT_MASS: return "PROP_UNIT_MASS"; + case PROP_UNIT_ROTATION: return "PROP_UNIT_ROTATION"; + case PROP_UNIT_TIME: return "PROP_UNIT_TIME"; + case PROP_UNIT_VELOCITY: return "PROP_UNIT_VELOCITY"; + case PROP_UNIT_ACCELERATION: return "PROP_UNIT_ACCELERATION"; + default: return "PROP_UNIT_UNKNOWN"; } } @@ -2022,7 +2022,7 @@ static void rna_generate_property_prototypes(BlenderRNA *brna, StructRNA *srna, fprintf(f, "\n"); for (prop = srna->cont.properties.first; prop; prop = prop->next) - fprintf(f, "%s%s rna_%s_%s;\n", (prop->flag & PROP_EXPORT)? "": "", rna_property_structname(prop->type), + fprintf(f, "%s%s rna_%s_%s;\n", (prop->flag & PROP_EXPORT) ? "" : "", rna_property_structname(prop->type), srna->identifier, prop->identifier); fprintf(f, "\n"); } @@ -2082,7 +2082,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA for (dparm = dfunc->cont.properties.first; dparm; dparm = dparm->next) { if (dparm->prop == func->c_ret) { if (dparm->prop->arraydimension) - fprintf(f, "XXX no array return types yet"); /* XXX not supported */ + fprintf(f, "XXX no array return types yet"); /* XXX not supported */ else if (dparm->prop->type == PROP_POINTER && !(dparm->prop->flag & PROP_RNAPTR)) fprintf(f, "%s%s *", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); else @@ -2199,8 +2199,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr if (nest != NULL) { len = strlen(nest); - strnest = MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> strnest"); - errnest = MEM_mallocN(sizeof(char)*(len+2), "rna_generate_property -> errnest"); + strnest = MEM_mallocN(sizeof(char) * (len + 2), "rna_generate_property -> strnest"); + errnest = MEM_mallocN(sizeof(char) * (len + 2), "rna_generate_property -> errnest"); strcpy(strnest, "_"); strcat(strnest, nest); strcpy(errnest, "."); strcat(errnest, nest); @@ -2209,127 +2209,127 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr } switch (prop->type) { - case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; - int i, defaultfound = 0, totflag = 0; - - if (eprop->item) { - fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {\n\t", srna->identifier, - strnest, prop->identifier, eprop->totitem+1); - - for (i = 0; itotitem; i++) { - fprintf(f, "{%d, ", eprop->item[i].value); - rna_print_c_string(f, eprop->item[i].identifier); fprintf(f, ", "); - fprintf(f, "%d, ", eprop->item[i].icon); - rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", "); - rna_print_c_string(f, eprop->item[i].description); fprintf(f, "},\n\t"); - - if (eprop->item[i].identifier[0]) { - if (prop->flag & PROP_ENUM_FLAG) { - totflag |= eprop->item[i].value; - } - else { - if (eprop->defaultvalue == eprop->item[i].value) { - defaultfound = 1; - } + case PROP_ENUM: { + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; + int i, defaultfound = 0, totflag = 0; + + if (eprop->item) { + fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {\n\t", srna->identifier, + strnest, prop->identifier, eprop->totitem + 1); + + for (i = 0; i < eprop->totitem; i++) { + fprintf(f, "{%d, ", eprop->item[i].value); + rna_print_c_string(f, eprop->item[i].identifier); fprintf(f, ", "); + fprintf(f, "%d, ", eprop->item[i].icon); + rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", "); + rna_print_c_string(f, eprop->item[i].description); fprintf(f, "},\n\t"); + + if (eprop->item[i].identifier[0]) { + if (prop->flag & PROP_ENUM_FLAG) { + totflag |= eprop->item[i].value; + } + else { + if (eprop->defaultvalue == eprop->item[i].value) { + defaultfound = 1; } } } + } - fprintf(f, "{0, NULL, 0, NULL, NULL}\n};\n\n"); + fprintf(f, "{0, NULL, 0, NULL, NULL}\n};\n\n"); - if (prop->flag & PROP_ENUM_FLAG) { - if (eprop->defaultvalue & ~totflag) { - fprintf(stderr, "%s: %s%s.%s, enum default includes unused bits (%d).\n", - __func__, srna->identifier, errnest, prop->identifier, - eprop->defaultvalue & ~totflag); - DefRNA.error = 1; - } - } - else { - if (!defaultfound) { - fprintf(stderr, "%s: %s%s.%s, enum default is not in items.\n", - __func__, srna->identifier, errnest, prop->identifier); - DefRNA.error = 1; - } + if (prop->flag & PROP_ENUM_FLAG) { + if (eprop->defaultvalue & ~totflag) { + fprintf(stderr, "%s: %s%s.%s, enum default includes unused bits (%d).\n", + __func__, srna->identifier, errnest, prop->identifier, + eprop->defaultvalue & ~totflag); + DefRNA.error = 1; } } else { - fprintf(stderr, "%s: %s%s.%s, enum must have items defined.\n", - __func__, srna->identifier, errnest, prop->identifier); - DefRNA.error = 1; + if (!defaultfound) { + fprintf(stderr, "%s: %s%s.%s, enum default is not in items.\n", + __func__, srna->identifier, errnest, prop->identifier); + DefRNA.error = 1; + } } - break; } - case PROP_BOOLEAN: { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; - unsigned int i; - - if (prop->arraydimension && prop->totarraylength) { - fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, - prop->identifier, prop->totarraylength); - - for (i = 0; itotarraylength; i++) { - if (bprop->defaultarray) - fprintf(f, "%d", bprop->defaultarray[i]); - else - fprintf(f, "%d", bprop->defaultvalue); - if (i != prop->totarraylength-1) - fprintf(f, ",\n\t"); - } + else { + fprintf(stderr, "%s: %s%s.%s, enum must have items defined.\n", + __func__, srna->identifier, errnest, prop->identifier); + DefRNA.error = 1; + } + break; + } + case PROP_BOOLEAN: { + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; + unsigned int i; - fprintf(f, "\n};\n\n"); + if (prop->arraydimension && prop->totarraylength) { + fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, + prop->identifier, prop->totarraylength); + + for (i = 0; i < prop->totarraylength; i++) { + if (bprop->defaultarray) + fprintf(f, "%d", bprop->defaultarray[i]); + else + fprintf(f, "%d", bprop->defaultvalue); + if (i != prop->totarraylength - 1) + fprintf(f, ",\n\t"); } - break; + + fprintf(f, "\n};\n\n"); } - case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; - unsigned int i; - - if (prop->arraydimension && prop->totarraylength) { - fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, - prop->identifier, prop->totarraylength); - - for (i = 0; itotarraylength; i++) { - if (iprop->defaultarray) - fprintf(f, "%d", iprop->defaultarray[i]); - else - fprintf(f, "%d", iprop->defaultvalue); - if (i != prop->totarraylength-1) - fprintf(f, ",\n\t"); - } + break; + } + case PROP_INT: { + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; + unsigned int i; + + if (prop->arraydimension && prop->totarraylength) { + fprintf(f, "static int rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, + prop->identifier, prop->totarraylength); - fprintf(f, "\n};\n\n"); + for (i = 0; i < prop->totarraylength; i++) { + if (iprop->defaultarray) + fprintf(f, "%d", iprop->defaultarray[i]); + else + fprintf(f, "%d", iprop->defaultvalue); + if (i != prop->totarraylength - 1) + fprintf(f, ",\n\t"); } - break; + + fprintf(f, "\n};\n\n"); } - case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; - unsigned int i; - - if (prop->arraydimension && prop->totarraylength) { - fprintf(f, "static float rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, - prop->identifier, prop->totarraylength); - - for (i = 0; itotarraylength; i++) { - if (fprop->defaultarray) - rna_float_print(f, fprop->defaultarray[i]); - else - rna_float_print(f, fprop->defaultvalue); - if (i != prop->totarraylength-1) - fprintf(f, ",\n\t"); - } + break; + } + case PROP_FLOAT: { + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; + unsigned int i; + + if (prop->arraydimension && prop->totarraylength) { + fprintf(f, "static float rna_%s%s_%s_default[%u] = {\n\t", srna->identifier, strnest, + prop->identifier, prop->totarraylength); - fprintf(f, "\n};\n\n"); + for (i = 0; i < prop->totarraylength; i++) { + if (fprop->defaultarray) + rna_float_print(f, fprop->defaultarray[i]); + else + rna_float_print(f, fprop->defaultvalue); + if (i != prop->totarraylength - 1) + fprintf(f, ",\n\t"); } - break; + + fprintf(f, "\n};\n\n"); } - default: - break; + break; + } + default: + break; } fprintf(f, "%s%s rna_%s%s_%s = {\n", - (prop->flag & PROP_EXPORT) ? "": "", + (prop->flag & PROP_EXPORT) ? "" : "", rna_property_structname(prop->type), srna->identifier, strnest, prop->identifier); @@ -2355,7 +2355,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr prop->arraylength[2], prop->totarraylength); fprintf(f, "\t%s%s, %d, %s, %s,\n", - (prop->flag & PROP_CONTEXT_UPDATE) ? "(UpdateFunc)": "", + (prop->flag & PROP_CONTEXT_UPDATE) ? "(UpdateFunc)" : "", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable), @@ -2365,112 +2365,112 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr else fprintf(f, "\t0, -1"); /* our own type - collections/arrays only */ - if (prop->srna) fprintf(f, ", &RNA_%s", (const char*)prop->srna); + if (prop->srna) fprintf(f, ", &RNA_%s", (const char *)prop->srna); else fprintf(f, ", NULL"); fprintf(f, "},\n"); switch (prop->type) { - case PROP_BOOLEAN: { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, %s, %d, ", - rna_function_string(bprop->get), - rna_function_string(bprop->set), - rna_function_string(bprop->getarray), - rna_function_string(bprop->setarray), - bprop->defaultvalue); - if (prop->arraydimension && prop->totarraylength) - fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); - else fprintf(f, "NULL\n"); - break; - } - case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, %s, %s,\n\t", - rna_function_string(iprop->get), - rna_function_string(iprop->set), - rna_function_string(iprop->getarray), - rna_function_string(iprop->setarray), - rna_function_string(iprop->range)); - rna_int_print(f, iprop->softmin); fprintf(f, ", "); - rna_int_print(f, iprop->softmax); fprintf(f, ", "); - rna_int_print(f, iprop->hardmin); fprintf(f, ", "); - rna_int_print(f, iprop->hardmax); fprintf(f, ", "); - rna_int_print(f, iprop->step); fprintf(f, ", "); - rna_int_print(f, iprop->defaultvalue); fprintf(f, ", "); - if (prop->arraydimension && prop->totarraylength) - fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); - else fprintf(f, "NULL\n"); - break; - } - case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, %s, %s, ", - rna_function_string(fprop->get), - rna_function_string(fprop->set), - rna_function_string(fprop->getarray), - rna_function_string(fprop->setarray), - rna_function_string(fprop->range)); - rna_float_print(f, fprop->softmin); fprintf(f, ", "); - rna_float_print(f, fprop->softmax); fprintf(f, ", "); - rna_float_print(f, fprop->hardmin); fprintf(f, ", "); - rna_float_print(f, fprop->hardmax); fprintf(f, ", "); - rna_float_print(f, fprop->step); fprintf(f, ", "); - rna_int_print(f, (int)fprop->precision); fprintf(f, ", "); - rna_float_print(f, fprop->defaultvalue); fprintf(f, ", "); - if (prop->arraydimension && prop->totarraylength) - fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); - else fprintf(f, "NULL\n"); - break; - } - case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, %d, ", - rna_function_string(sprop->get), - rna_function_string(sprop->length), - rna_function_string(sprop->set), - sprop->maxlength); - rna_print_c_string(f, sprop->defaultvalue); fprintf(f, "\n"); - break; - } - case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, NULL, ", - rna_function_string(eprop->get), - rna_function_string(eprop->set), - rna_function_string(eprop->itemf)); - if (eprop->item) - fprintf(f, "rna_%s%s_%s_items, ", srna->identifier, strnest, prop->identifier); - else - fprintf(f, "NULL, "); - fprintf(f, "%d, %d\n", eprop->totitem, eprop->defaultvalue); - break; - } - case PROP_POINTER: { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, %s,", rna_function_string(pprop->get), - rna_function_string(pprop->set), - rna_function_string(pprop->typef), - rna_function_string(pprop->poll)); - if (pprop->type) fprintf(f, "&RNA_%s\n", (const char*)pprop->type); - else fprintf(f, "NULL\n"); - break; - } - case PROP_COLLECTION: { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", - rna_function_string(cprop->begin), - rna_function_string(cprop->next), - rna_function_string(cprop->end), - rna_function_string(cprop->get), - rna_function_string(cprop->length), - rna_function_string(cprop->lookupint), - rna_function_string(cprop->lookupstring), - rna_function_string(cprop->assignint)); - if (cprop->item_type) fprintf(f, "&RNA_%s\n", (const char*)cprop->item_type); - else fprintf(f, "NULL\n"); - break; - } + case PROP_BOOLEAN: { + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; + fprintf(f, "\t%s, %s, %s, %s, %d, ", + rna_function_string(bprop->get), + rna_function_string(bprop->set), + rna_function_string(bprop->getarray), + rna_function_string(bprop->setarray), + bprop->defaultvalue); + if (prop->arraydimension && prop->totarraylength) + fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); + else fprintf(f, "NULL\n"); + break; + } + case PROP_INT: { + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; + fprintf(f, "\t%s, %s, %s, %s, %s,\n\t", + rna_function_string(iprop->get), + rna_function_string(iprop->set), + rna_function_string(iprop->getarray), + rna_function_string(iprop->setarray), + rna_function_string(iprop->range)); + rna_int_print(f, iprop->softmin); fprintf(f, ", "); + rna_int_print(f, iprop->softmax); fprintf(f, ", "); + rna_int_print(f, iprop->hardmin); fprintf(f, ", "); + rna_int_print(f, iprop->hardmax); fprintf(f, ", "); + rna_int_print(f, iprop->step); fprintf(f, ", "); + rna_int_print(f, iprop->defaultvalue); fprintf(f, ", "); + if (prop->arraydimension && prop->totarraylength) + fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); + else fprintf(f, "NULL\n"); + break; + } + case PROP_FLOAT: { + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; + fprintf(f, "\t%s, %s, %s, %s, %s, ", + rna_function_string(fprop->get), + rna_function_string(fprop->set), + rna_function_string(fprop->getarray), + rna_function_string(fprop->setarray), + rna_function_string(fprop->range)); + rna_float_print(f, fprop->softmin); fprintf(f, ", "); + rna_float_print(f, fprop->softmax); fprintf(f, ", "); + rna_float_print(f, fprop->hardmin); fprintf(f, ", "); + rna_float_print(f, fprop->hardmax); fprintf(f, ", "); + rna_float_print(f, fprop->step); fprintf(f, ", "); + rna_int_print(f, (int)fprop->precision); fprintf(f, ", "); + rna_float_print(f, fprop->defaultvalue); fprintf(f, ", "); + if (prop->arraydimension && prop->totarraylength) + fprintf(f, "rna_%s%s_%s_default\n", srna->identifier, strnest, prop->identifier); + else fprintf(f, "NULL\n"); + break; + } + case PROP_STRING: { + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; + fprintf(f, "\t%s, %s, %s, %d, ", + rna_function_string(sprop->get), + rna_function_string(sprop->length), + rna_function_string(sprop->set), + sprop->maxlength); + rna_print_c_string(f, sprop->defaultvalue); fprintf(f, "\n"); + break; + } + case PROP_ENUM: { + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; + fprintf(f, "\t%s, %s, %s, NULL, ", + rna_function_string(eprop->get), + rna_function_string(eprop->set), + rna_function_string(eprop->itemf)); + if (eprop->item) + fprintf(f, "rna_%s%s_%s_items, ", srna->identifier, strnest, prop->identifier); + else + fprintf(f, "NULL, "); + fprintf(f, "%d, %d\n", eprop->totitem, eprop->defaultvalue); + break; + } + case PROP_POINTER: { + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; + fprintf(f, "\t%s, %s, %s, %s,", rna_function_string(pprop->get), + rna_function_string(pprop->set), + rna_function_string(pprop->typef), + rna_function_string(pprop->poll)); + if (pprop->type) fprintf(f, "&RNA_%s\n", (const char *)pprop->type); + else fprintf(f, "NULL\n"); + break; + } + case PROP_COLLECTION: { + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; + fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", + rna_function_string(cprop->begin), + rna_function_string(cprop->next), + rna_function_string(cprop->end), + rna_function_string(cprop->get), + rna_function_string(cprop->length), + rna_function_string(cprop->lookupint), + rna_function_string(cprop->lookupstring), + rna_function_string(cprop->assignint)); + if (cprop->item_type) fprintf(f, "&RNA_%s\n", (const char *)cprop->item_type); + else fprintf(f, "NULL\n"); + break; + } } fprintf(f, "};\n\n"); @@ -2501,12 +2501,12 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f) if (func->cont.next) fprintf(f, "\t{(FunctionRNA*)&rna_%s_%s_func, ", srna->identifier, - ((FunctionRNA*)func->cont.next)->identifier); + ((FunctionRNA *)func->cont.next)->identifier); else fprintf(f, "\t{NULL, "); if (func->cont.prev) fprintf(f, "(FunctionRNA*)&rna_%s_%s_func,\n", srna->identifier, - ((FunctionRNA*)func->cont.prev)->identifier); + ((FunctionRNA *)func->cont.prev)->identifier); else fprintf(f, "NULL,\n"); @@ -2540,9 +2540,9 @@ static void rna_generate_struct(BlenderRNA *brna, StructRNA *srna, FILE *f) fprintf(f, "StructRNA RNA_%s = {\n", srna->identifier); - if (srna->cont.next) fprintf(f, "\t{(ContainerRNA *)&RNA_%s, ", ((StructRNA*)srna->cont.next)->identifier); + if (srna->cont.next) fprintf(f, "\t{(ContainerRNA *)&RNA_%s, ", ((StructRNA *)srna->cont.next)->identifier); else fprintf(f, "\t{NULL, "); - if (srna->cont.prev) fprintf(f, "(ContainerRNA *)&RNA_%s,\n", ((StructRNA*)srna->cont.prev)->identifier); + if (srna->cont.prev) fprintf(f, "(ContainerRNA *)&RNA_%s,\n", ((StructRNA *)srna->cont.prev)->identifier); else fprintf(f, "NULL,\n"); fprintf(f, "\tNULL,\n"); @@ -2679,7 +2679,8 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_world.c", NULL, RNA_def_world}, {"rna_movieclip.c", NULL, RNA_def_movieclip}, {"rna_tracking.c", NULL, RNA_def_tracking}, - {NULL, NULL}}; + {NULL, NULL} +}; static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const char *api_filename) { @@ -2778,7 +2779,7 @@ static void rna_generate_header(BlenderRNA *brna, FILE *f) fprintf(f, " { \\\n"); fprintf(f, " CollectionPropertyIterator rna_macro_iter; \\\n"); fprintf(f, " for (property##_begin(&rna_macro_iter, sptr); rna_macro_iter.valid; " - "property##_next(&rna_macro_iter)) { \\\n"); + "property##_next(&rna_macro_iter)) { \\\n"); fprintf(f, " itemptr= rna_macro_iter.ptr;\n\n"); fprintf(f, "#define FOREACH_END(property) \\\n"); @@ -2955,12 +2956,12 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f) fprintf(f, "/**************** %s ****************/\n\n", srna->name); - fprintf(f, "class %s : public %s {\n", srna->identifier, (srna->base)? srna->base->identifier: "Pointer"); + fprintf(f, "class %s : public %s {\n", srna->identifier, (srna->base) ? srna->base->identifier : "Pointer"); fprintf(f, "public:\n"); fprintf(f, "\t%s(const PointerRNA& ptr) :\n\t\t%s(ptr)", srna->identifier, - (srna->base)? srna->base->identifier: "Pointer"); + (srna->base) ? srna->base->identifier : "Pointer"); for (dp = ds->cont.properties.first; dp; dp = dp->next) - if (!(dp->prop->flag & (PROP_IDPROPERTY|PROP_BUILTIN))) + if (!(dp->prop->flag & (PROP_IDPROPERTY | PROP_BUILTIN))) if (dp->prop->type == PROP_COLLECTION) fprintf(f, ",\n\t\t%s(ptr)", dp->prop->identifier); fprintf(f, "\n\t\t{}\n\n"); @@ -3046,7 +3047,7 @@ static int rna_preprocess(const char *outfile) for (i = 0; PROCESS_ITEMS[i].filename; i++) { strcpy(deffile, outfile); strcat(deffile, PROCESS_ITEMS[i].filename); - deffile[strlen(deffile)-2] = '\0'; + deffile[strlen(deffile) - 2] = '\0'; strcat(deffile, "_gen.c" TMP_EXT); if (status) { @@ -3114,7 +3115,7 @@ int main(int argc, char **argv) { int totblock, return_status = 0; - if (argc<2) { + if (argc < 2) { fprintf(stderr, "Usage: %s outdirectory/\n", argv[0]); return_status = 1; } diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 74a55b97e1b..8832d92e42f 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -71,7 +71,8 @@ EnumPropertyItem id_type_items[] = { {ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""}, {ID_WO, "WORLD", ICON_WORLD_DATA, "World", ""}, {ID_WM, "WINDOWMANAGER", ICON_FULLSCREEN, "Window Manager", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -84,26 +85,26 @@ EnumPropertyItem id_type_items[] = { /* name functions that ignore the first two ID characters */ void rna_ID_name_get(PointerRNA *ptr, char *value) { - ID *id = (ID*)ptr->data; - BLI_strncpy(value, id->name+2, sizeof(id->name)-2); + ID *id = (ID *)ptr->data; + BLI_strncpy(value, id->name + 2, sizeof(id->name) - 2); } int rna_ID_name_length(PointerRNA *ptr) { - ID *id = (ID*)ptr->data; - return strlen(id->name+2); + ID *id = (ID *)ptr->data; + return strlen(id->name + 2); } void rna_ID_name_set(PointerRNA *ptr, const char *value) { - ID *id = (ID*)ptr->data; - BLI_strncpy_utf8(id->name+2, value, sizeof(id->name)-2); - test_idbutton(id->name+2); + ID *id = (ID *)ptr->data; + BLI_strncpy_utf8(id->name + 2, value, sizeof(id->name) - 2); + test_idbutton(id->name + 2); } static int rna_ID_name_editable(PointerRNA *ptr) { - ID *id = (ID*)ptr->data; + ID *id = (ID *)ptr->data; if (GS(id->name) == ID_VF) { VFont *vf = (VFont *)id; @@ -185,7 +186,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) StructRNA *rna_ID_refine(PointerRNA *ptr) { - ID *id = (ID*)ptr->data; + ID *id = (ID *)ptr->data; return ID_code_to_RNA_type(GS(id->name)); } @@ -197,7 +198,7 @@ IDProperty *rna_ID_idprops(PointerRNA *ptr, int create) void rna_ID_fake_user_set(PointerRNA *ptr, int value) { - ID *id = (ID*)ptr->data; + ID *id = (ID *)ptr->data; if (value && !(id->flag & LIB_FAKEUSER)) { id->flag |= LIB_FAKEUSER; @@ -238,14 +239,14 @@ StructRNA *rna_PropertyGroup_register(Main *UNUSED(bmain), ReportList *reports, * is running. */ if (BLI_strnlen(identifier, MAX_IDPROP_NAME) == MAX_IDPROP_NAME) { BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is " - STRINGIFY(MAX_IDPROP_NAME), identifier); + STRINGIFY(MAX_IDPROP_NAME), identifier); return NULL; } return RNA_def_struct(&BLENDER_RNA, identifier, "PropertyGroup"); /* XXX */ } -StructRNA* rna_PropertyGroup_refine(PointerRNA *ptr) +StructRNA *rna_PropertyGroup_refine(PointerRNA *ptr) { return ptr->type; } @@ -279,24 +280,24 @@ static void rna_ID_update_tag(ID *id, ReportList *reports, int flag) else { /* ensure flag us correct for the type */ switch (GS(id->name)) { - case ID_OB: - if (flag & ~(OB_RECALC_ALL)) { - BKE_report(reports, RPT_ERROR, "'refresh' incompatible with Object ID type"); - return; - } - break; - /* Could add particle updates later */ + case ID_OB: + if (flag & ~(OB_RECALC_ALL)) { + BKE_report(reports, RPT_ERROR, "'refresh' incompatible with Object ID type"); + return; + } + break; + /* Could add particle updates later */ #if 0 - case ID_PA: - if (flag & ~(OB_RECALC_ALL|PSYS_RECALC)) { - BKE_report(reports, RPT_ERROR, "'refresh' incompatible with ParticleSettings ID type"); - return; - } - break; + case ID_PA: + if (flag & ~(OB_RECALC_ALL | PSYS_RECALC)) { + BKE_report(reports, RPT_ERROR, "'refresh' incompatible with ParticleSettings ID type"); + return; + } + break; #endif - default: - BKE_report(reports, RPT_ERROR, "This ID type is not compatible with any 'refresh' options"); - return; + default: + BKE_report(reports, RPT_ERROR, "This ID type is not compatible with any 'refresh' options"); + return; } } @@ -337,7 +338,7 @@ int rna_IDMaterials_assign_int(PointerRNA *ptr, int key, const PointerRNA *assig void rna_Library_filepath_set(PointerRNA *ptr, const char *value) { - Library *lib = (Library*)ptr->data; + Library *lib = (Library *)ptr->data; BKE_library_filepath_set(lib, value); } @@ -356,52 +357,52 @@ static void rna_def_ID_properties(BlenderRNA *brna) /* IDP_STRING */ prop = RNA_def_property(srna, "string", PROP_STRING, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); /* IDP_INT */ prop = RNA_def_property(srna, "int", PROP_INT, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); prop = RNA_def_property(srna, "int_array", PROP_INT, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_array(prop, 1); /* IDP_FLOAT */ prop = RNA_def_property(srna, "float", PROP_FLOAT, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); prop = RNA_def_property(srna, "float_array", PROP_FLOAT, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_array(prop, 1); /* IDP_DOUBLE */ prop = RNA_def_property(srna, "double", PROP_FLOAT, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); prop = RNA_def_property(srna, "double_array", PROP_FLOAT, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_array(prop, 1); /* IDP_GROUP */ prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "PropertyGroup"); prop = RNA_def_property(srna, "collection", PROP_COLLECTION, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_struct_type(prop, "PropertyGroup"); prop = RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "PropertyGroup"); RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL, NULL); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); /* never tested, maybe its useful to have this? */ #if 0 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting"); RNA_def_struct_name_property(srna, prop); @@ -423,7 +424,7 @@ static void rna_def_ID_properties(BlenderRNA *brna) * however this isn't prefect because it overrides how python would set the name * when we only really want this so RNA_def_struct_name_property() is set to something useful */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); - RNA_def_property_flag(prop, PROP_EXPORT|PROP_IDPROPERTY); + RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting"); RNA_def_struct_name_property(srna, prop); @@ -465,22 +466,23 @@ static void rna_def_ID(BlenderRNA *brna) {OB_RECALC_OB, "OBJECT", 0, "Object", ""}, {OB_RECALC_DATA, "DATA", 0, "Data", ""}, {OB_RECALC_TIME, "TIME", 0, "Time", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ID", NULL); RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries " "and garbage collection"); - RNA_def_struct_flag(srna, STRUCT_ID|STRUCT_ID_REFCOUNT); + RNA_def_struct_flag(srna, STRUCT_ID | STRUCT_ID_REFCOUNT); RNA_def_struct_refine_func(srna, "rna_ID_refine"); RNA_def_struct_idprops_func(srna, "rna_ID_idprops"); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name"); RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set"); - RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2); + RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2); RNA_def_property_editable_func(prop, "rna_ID_name_editable"); - RNA_def_property_update(prop, NC_ID|NA_RENAME, NULL); + RNA_def_property_update(prop, NC_ID | NA_RENAME, NULL); RNA_def_struct_name_property(srna, prop); prop = RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED); @@ -521,7 +523,7 @@ static void rna_def_ID(BlenderRNA *brna) func = RNA_def_function(srna, "user_clear", "rna_ID_user_clear"); RNA_def_function_ui_description(func, "Clear the user count of a datablock so its not saved, " - "on reload the data will be removed"); + "on reload the data will be removed"); func = RNA_def_function(srna, "animation_data_create", "BKE_id_add_animdata"); RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this"); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 573d7216114..3079ba8c8d8 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -78,7 +78,7 @@ void RNA_init(void) for (prop = srna->cont.properties.first; prop; prop = prop->next) if (!(prop->flag & PROP_BUILTIN)) - BLI_ghash_insert(srna->cont.prophash, (void*)prop->identifier, prop); + BLI_ghash_insert(srna->cont.prophash, (void *)prop->identifier, prop); } } } @@ -285,10 +285,10 @@ static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop) { if (prop->magic == RNA_MAGIC) { int arraylen[RNA_MAX_ARRAY_DIMENSION]; - return (prop->getlength && ptr->data)? prop->getlength(ptr, arraylen): prop->totarraylength; + return (prop->getlength && ptr->data) ? prop->getlength(ptr, arraylen) : prop->totarraylength; } else { - IDProperty *idprop = (IDProperty*)prop; + IDProperty *idprop = (IDProperty *)prop; if (idprop->type == IDP_ARRAY) return idprop->len; @@ -300,12 +300,12 @@ static int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop) static int rna_ensure_property_array_check(PropertyRNA *prop) { if (prop->magic == RNA_MAGIC) { - return (prop->getlength || prop->totarraylength) ? 1:0; + return (prop->getlength || prop->totarraylength) ? 1 : 0; } else { - IDProperty *idprop = (IDProperty*)prop; + IDProperty *idprop = (IDProperty *)prop; - return idprop->type == IDP_ARRAY ? 1:0; + return idprop->type == IDP_ARRAY ? 1 : 0; } } @@ -315,10 +315,10 @@ static void rna_ensure_property_multi_array_length(PointerRNA *ptr, PropertyRNA if (prop->getlength) prop->getlength(ptr, length); else - memcpy(length, prop->arraylength, prop->arraydimension*sizeof(int)); + memcpy(length, prop->arraylength, prop->arraydimension * sizeof(int)); } else { - IDProperty *idprop = (IDProperty*)prop; + IDProperty *idprop = (IDProperty *)prop; if (idprop->type == IDP_ARRAY) length[0] = idprop->len; @@ -373,21 +373,23 @@ static int rna_idproperty_verify_valid(PointerRNA *ptr, PropertyRNA *prop, IDPro return 1; } -static PropertyRNA *typemap[IDP_NUMTYPES] = - {(PropertyRNA*)&rna_PropertyGroupItem_string, - (PropertyRNA*)&rna_PropertyGroupItem_int, - (PropertyRNA*)&rna_PropertyGroupItem_float, - NULL, NULL, NULL, - (PropertyRNA*)&rna_PropertyGroupItem_group, NULL, - (PropertyRNA*)&rna_PropertyGroupItem_double, - (PropertyRNA*)&rna_PropertyGroupItem_idp_array}; +static PropertyRNA *typemap[IDP_NUMTYPES] = { + (PropertyRNA *)&rna_PropertyGroupItem_string, + (PropertyRNA *)&rna_PropertyGroupItem_int, + (PropertyRNA *)&rna_PropertyGroupItem_float, + NULL, NULL, NULL, + (PropertyRNA *)&rna_PropertyGroupItem_group, NULL, + (PropertyRNA *)&rna_PropertyGroupItem_double, + (PropertyRNA *)&rna_PropertyGroupItem_idp_array +}; -static PropertyRNA *arraytypemap[IDP_NUMTYPES] = - {NULL, (PropertyRNA*)&rna_PropertyGroupItem_int_array, - (PropertyRNA*)&rna_PropertyGroupItem_float_array, - NULL, NULL, NULL, - (PropertyRNA*)&rna_PropertyGroupItem_collection, NULL, - (PropertyRNA*)&rna_PropertyGroupItem_double_array}; +static PropertyRNA *arraytypemap[IDP_NUMTYPES] = { + NULL, (PropertyRNA *)&rna_PropertyGroupItem_int_array, + (PropertyRNA *)&rna_PropertyGroupItem_float_array, + NULL, NULL, NULL, + (PropertyRNA *)&rna_PropertyGroupItem_collection, NULL, + (PropertyRNA *)&rna_PropertyGroupItem_double_array +}; IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr) { @@ -418,7 +420,7 @@ IDProperty *rna_idproperty_check(PropertyRNA **prop, PointerRNA *ptr) } { - IDProperty *idprop = (IDProperty*)(*prop); + IDProperty *idprop = (IDProperty *)(*prop); if (idprop->type == IDP_ARRAY) *prop = arraytypemap[(int)(idprop->subtype)]; @@ -437,7 +439,7 @@ static PropertyRNA *rna_ensure_property(PropertyRNA *prop) return prop; { - IDProperty *idprop = (IDProperty*)prop; + IDProperty *idprop = (IDProperty *)prop; if (idprop->type == IDP_ARRAY) return arraytypemap[(int)(idprop->subtype)]; @@ -451,7 +453,7 @@ static const char *rna_ensure_property_identifier(PropertyRNA *prop) if (prop->magic == RNA_MAGIC) return prop->identifier; else - return ((IDProperty*)prop)->name; + return ((IDProperty *)prop)->name; } static const char *rna_ensure_property_description(PropertyRNA *prop) @@ -471,7 +473,7 @@ static const char *rna_ensure_property_description(PropertyRNA *prop) } if (description == NULL) - description = ((IDProperty*)prop)->name; /* XXX - not correct */ + description = ((IDProperty *)prop)->name; /* XXX - not correct */ } return TIP_(description); @@ -484,7 +486,7 @@ static const char *rna_ensure_property_name(PropertyRNA *prop) if (prop->magic == RNA_MAGIC) name = prop->name; else - name = ((IDProperty*)prop)->name; + name = ((IDProperty *)prop)->name; return CTX_IFACE_(prop->translation_context, name); } @@ -590,8 +592,8 @@ int RNA_struct_is_a(StructRNA *type, StructRNA *srna) PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier) { - if (identifier[0] =='[' && identifier[1] =='"') { /* " (dummy comment to avoid confusing some - * function lists in text editors) */ + if (identifier[0] == '[' && identifier[1] == '"') { /* " (dummy comment to avoid confusing some + * function lists in text editors) */ /* id prop lookup, not so common */ PropertyRNA *r_prop = NULL; PointerRNA r_ptr; /* only support single level props */ @@ -615,7 +617,7 @@ PropertyRNA *RNA_struct_find_nested(PointerRNA *ptr, StructRNA *srna) { PropertyRNA *prop = NULL; - RNA_STRUCT_BEGIN (ptr, iprop) + RNA_STRUCT_BEGIN(ptr, iprop) { /* This assumes that there can only be one user of this nested struct */ if (RNA_property_pointer_type(ptr, iprop) == srna) { @@ -638,7 +640,7 @@ int RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test) iterprop = RNA_struct_iterator_property(ptr->type); - RNA_PROP_BEGIN (ptr, itemptr, iterprop) + RNA_PROP_BEGIN(ptr, itemptr, iterprop) { /* PropertyRNA *prop= itemptr.data; */ if (prop_test == (PropertyRNA *)itemptr.data) { @@ -686,7 +688,7 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier) func = NULL; - RNA_PROP_BEGIN (&tptr, funcptr, iterprop) + RNA_PROP_BEGIN(&tptr, funcptr, iterprop) { if (strcmp(identifier, RNA_function_identifier(funcptr.data)) == 0) { func = funcptr.data; @@ -699,8 +701,7 @@ FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier) #endif } -const struct ListBase *RNA_struct_type_functions(StructRNA *srna) -{ +const struct ListBase *RNA_struct_type_functions(StructRNA *srna){ return &srna->functions; } @@ -814,7 +815,7 @@ int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[ PropertyRNA *rprop = rna_ensure_property(prop); if (length) - rna_ensure_property_multi_array_length(ptr, prop, length); + rna_ensure_property_multi_array_length(ptr, prop, length); return rprop->arraydimension; } @@ -841,7 +842,7 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index) return quatitem[index]; } else if ((index < 4) && ELEM8(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_XYZ_LENGTH, - PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION, PROP_COORDS)) + PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION, PROP_COORDS)) { return vectoritem[index]; } @@ -871,7 +872,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name) } } else if (ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, - PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION)) + PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION)) { switch (name) { case 'x': @@ -903,7 +904,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name) void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax) { - IntPropertyRNA *iprop = (IntPropertyRNA*)rna_ensure_property(prop); + IntPropertyRNA *iprop = (IntPropertyRNA *)rna_ensure_property(prop); int softmin, softmax; if (prop->magic != RNA_MAGIC) { @@ -937,7 +938,7 @@ void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, in void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step) { - IntPropertyRNA *iprop = (IntPropertyRNA*)rna_ensure_property(prop); + IntPropertyRNA *iprop = (IntPropertyRNA *)rna_ensure_property(prop); int hardmin, hardmax; if (prop->magic != RNA_MAGIC) { @@ -978,7 +979,7 @@ void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)rna_ensure_property(prop); + FloatPropertyRNA *fprop = (FloatPropertyRNA *)rna_ensure_property(prop); float softmin, softmax; if (prop->magic != RNA_MAGIC) { @@ -1013,7 +1014,7 @@ void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)rna_ensure_property(prop); + FloatPropertyRNA *fprop = (FloatPropertyRNA *)rna_ensure_property(prop); float hardmin, hardmax; if (prop->magic != RNA_MAGIC) { @@ -1098,7 +1099,7 @@ int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value) * '0' used when their is no maximum */ int RNA_property_string_maxlength(PropertyRNA *prop) { - StringPropertyRNA *sprop = (StringPropertyRNA*)rna_ensure_property(prop); + StringPropertyRNA *sprop = (StringPropertyRNA *)rna_ensure_property(prop); return sprop->maxlength; } @@ -1107,7 +1108,7 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop) prop = rna_ensure_property(prop); if (prop->type == PROP_POINTER) { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; if (pprop->typef) return pprop->typef(ptr); @@ -1115,7 +1116,7 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop) return pprop->type; } else if (prop->type == PROP_COLLECTION) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; if (cprop->item_type) return cprop->item_type; @@ -1130,7 +1131,7 @@ int RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *va prop = rna_ensure_property(prop); if (prop->type == PROP_POINTER) { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; if (pprop->poll) return pprop->poll(ptr, *value); @@ -1155,7 +1156,7 @@ EnumPropertyItem DummyRNA_DEFAULT_items[] = { void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free) { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)rna_ensure_property(prop); + EnumPropertyRNA *eprop = (EnumPropertyRNA *)rna_ensure_property(prop); *free = 0; @@ -1169,7 +1170,7 @@ void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, En if (totitem) { if (*item) { - for ( ; (*item)[tot].identifier; tot++); + for (; (*item)[tot].identifier; tot++) ; } *totitem = tot; @@ -1204,7 +1205,7 @@ void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA for (i = 0; (*item)[i].identifier; i++) totitem++; - nitem = MEM_callocN(sizeof(EnumPropertyItem)*(totitem+1), "enum_items_gettexted"); + nitem = MEM_callocN(sizeof(EnumPropertyItem) * (totitem + 1), "enum_items_gettexted"); for (i = 0; (*item)[i].identifier; i++) nitem[i] = (*item)[i]; @@ -1213,13 +1214,13 @@ void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA } for (i = 0; nitem[i].identifier; i++) { - if ( nitem[i].name ) { + if (nitem[i].name) { if (prop->translation_context) nitem[i].name = BLF_pgettext(prop->translation_context, nitem[i].name); else nitem[i].name = BLF_gettext(nitem[i].name); } - if ( nitem[i].description ) + if (nitem[i].description) nitem[i].description = BLF_gettext(nitem[i].description); } @@ -1483,7 +1484,7 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR if (!is_rna || (prop->flag & PROP_IDPROPERTY)) { /* WARNING! This is so property drivers update the display! * not especially nice */ - DAG_id_tag_update(ptr->id.data, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME); + DAG_id_tag_update(ptr->id.data, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); WM_main_add_notifier(NC_WINDOW, NULL); } } @@ -1525,8 +1526,8 @@ void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, Proper typedef struct tRnaUpdateCacheElem { struct tRnaUpdateCacheElem *next, *prev; - PointerRNA ptr; /* L1 key - id as primary, data secondary/ignored? */ - ListBase L2Funcs; /* L2 functions (LinkData) */ + PointerRNA ptr; /* L1 key - id as primary, data secondary/ignored? */ + ListBase L2Funcs; /* L2 functions (LinkData) */ } tRnaUpdateCacheElem; /* cache global (tRnaUpdateCacheElem's) - only accessible using these API calls */ @@ -1617,7 +1618,7 @@ void RNA_property_update_cache_free(void) int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop) { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); @@ -1633,7 +1634,7 @@ int RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); @@ -1662,7 +1663,7 @@ void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, int value) void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values) { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); @@ -1672,16 +1673,16 @@ void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, int *val if (prop->arraydimension == 0) values[0] = RNA_property_boolean_get(ptr, prop); else - memcpy(values, IDP_Array(idprop), sizeof(int)*idprop->len); + memcpy(values, IDP_Array(idprop), sizeof(int) * idprop->len); } else if (prop->arraydimension == 0) values[0] = RNA_property_boolean_get(ptr, prop); else if (bprop->getarray) bprop->getarray(ptr, values); else if (bprop->defaultarray) - memcpy(values, bprop->defaultarray, sizeof(int)*prop->totarraylength); + memcpy(values, bprop->defaultarray, sizeof(int) * prop->totarraylength); else - memset(values, 0, sizeof(int)*prop->totarraylength); + memset(values, 0, sizeof(int) * prop->totarraylength); } int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) @@ -1699,7 +1700,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index else { int *tmparray, value; - tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index"); + tmparray = MEM_callocN(sizeof(int) * len, "RNA_property_boolean_get_index"); RNA_property_boolean_get_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -1710,7 +1711,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values) { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); @@ -1720,7 +1721,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in if (prop->arraydimension == 0) IDP_Int(idprop) = values[0]; else - memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); + memcpy(IDP_Array(idprop), values, sizeof(int) * idprop->len); rna_idproperty_touch(idprop); } @@ -1739,7 +1740,7 @@ void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const in if (group) { idprop = IDP_New(IDP_ARRAY, &val, prop->identifier); IDP_AddToGroup(group, idprop); - memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); + memcpy(IDP_Array(idprop), values, sizeof(int) * idprop->len); } } } @@ -1760,7 +1761,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde else { int *tmparray; - tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_index"); + tmparray = MEM_callocN(sizeof(int) * len, "RNA_property_boolean_get_index"); RNA_property_boolean_get_array(ptr, prop, tmparray); tmparray[index] = value; RNA_property_boolean_set_array(ptr, prop, tmparray); @@ -1770,7 +1771,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) == 0); @@ -1780,7 +1781,7 @@ int RNA_property_boolean_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values) { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != 0); @@ -1788,9 +1789,9 @@ void RNA_property_boolean_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA if (prop->arraydimension == 0) values[0] = bprop->defaultvalue; else if (bprop->defaultarray) - memcpy(values, bprop->defaultarray, sizeof(int)*prop->totarraylength); + memcpy(values, bprop->defaultarray, sizeof(int) * prop->totarraylength); else - memset(values, 0, sizeof(int)*prop->totarraylength); + memset(values, 0, sizeof(int) * prop->totarraylength); } int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index) @@ -1808,7 +1809,7 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i else { int *tmparray, value; - tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_boolean_get_default_index"); + tmparray = MEM_callocN(sizeof(int) * len, "RNA_property_boolean_get_default_index"); RNA_property_boolean_get_default_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -1819,7 +1820,7 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop) { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); @@ -1835,7 +1836,7 @@ int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value) { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); @@ -1865,7 +1866,7 @@ void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value) void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values) { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); @@ -1875,16 +1876,16 @@ void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values) if (prop->arraydimension == 0) values[0] = RNA_property_int_get(ptr, prop); else - memcpy(values, IDP_Array(idprop), sizeof(int)*idprop->len); + memcpy(values, IDP_Array(idprop), sizeof(int) * idprop->len); } else if (prop->arraydimension == 0) values[0] = RNA_property_int_get(ptr, prop); else if (iprop->getarray) iprop->getarray(ptr, values); else if (iprop->defaultarray) - memcpy(values, iprop->defaultarray, sizeof(int)*prop->totarraylength); + memcpy(values, iprop->defaultarray, sizeof(int) * prop->totarraylength); else - memset(values, 0, sizeof(int)*prop->totarraylength); + memset(values, 0, sizeof(int) * prop->totarraylength); } void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int values[2]) @@ -1939,7 +1940,7 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) else { int *tmparray, value; - tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index"); + tmparray = MEM_callocN(sizeof(int) * len, "RNA_property_int_get_index"); RNA_property_int_get_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -1950,7 +1951,7 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values) { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_INT); @@ -1960,7 +1961,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v if (prop->arraydimension == 0) IDP_Int(idprop) = values[0]; else - memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); + memcpy(IDP_Array(idprop), values, sizeof(int) * idprop->len); rna_idproperty_touch(idprop); } @@ -1981,7 +1982,7 @@ void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *v if (group) { idprop = IDP_New(IDP_ARRAY, &val, prop->identifier); IDP_AddToGroup(group, idprop); - memcpy(IDP_Array(idprop), values, sizeof(int)*idprop->len); + memcpy(IDP_Array(idprop), values, sizeof(int) * idprop->len); } } } @@ -2002,7 +2003,7 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i else { int *tmparray; - tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_int_get_index"); + tmparray = MEM_callocN(sizeof(int) * len, "RNA_property_int_get_index"); RNA_property_int_get_array(ptr, prop, tmparray); tmparray[index] = value; RNA_property_int_set_array(ptr, prop, tmparray); @@ -2012,13 +2013,13 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i int RNA_property_int_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; return iprop->defaultvalue; } void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, int *values) { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_INT); BLI_assert(RNA_property_array_check(prop) != 0); @@ -2026,9 +2027,9 @@ void RNA_property_int_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *pr if (prop->arraydimension == 0) values[0] = iprop->defaultvalue; else if (iprop->defaultarray) - memcpy(values, iprop->defaultarray, sizeof(int)*prop->totarraylength); + memcpy(values, iprop->defaultarray, sizeof(int) * prop->totarraylength); else - memset(values, 0, sizeof(int)*prop->totarraylength); + memset(values, 0, sizeof(int) * prop->totarraylength); } int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index) @@ -2043,7 +2044,7 @@ int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int i else { int *tmparray, value; - tmparray = MEM_callocN(sizeof(int)*len, "RNA_property_int_get_default_index"); + tmparray = MEM_callocN(sizeof(int) * len, "RNA_property_int_get_default_index"); RNA_property_int_get_default_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -2054,7 +2055,7 @@ int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int i float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); @@ -2074,7 +2075,7 @@ float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); @@ -2109,7 +2110,7 @@ void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value) void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; IDProperty *idprop; int i; @@ -2120,11 +2121,11 @@ void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *val if (prop->arraydimension == 0) values[0] = RNA_property_float_get(ptr, prop); else if (idprop->subtype == IDP_FLOAT) { - memcpy(values, IDP_Array(idprop), sizeof(float)*idprop->len); + memcpy(values, IDP_Array(idprop), sizeof(float) * idprop->len); } else { - for (i = 0; ilen; i++) - values[i] = (float)(((double*)IDP_Array(idprop))[i]); + for (i = 0; i < idprop->len; i++) + values[i] = (float)(((double *)IDP_Array(idprop))[i]); } } else if (prop->arraydimension == 0) @@ -2132,9 +2133,9 @@ void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *val else if (fprop->getarray) fprop->getarray(ptr, values); else if (fprop->defaultarray) - memcpy(values, fprop->defaultarray, sizeof(float)*prop->totarraylength); + memcpy(values, fprop->defaultarray, sizeof(float) * prop->totarraylength); else - memset(values, 0, sizeof(float)*prop->totarraylength); + memset(values, 0, sizeof(float) * prop->totarraylength); } void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, float values[2]) @@ -2189,7 +2190,7 @@ float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index else { float *tmparray, value; - tmparray = MEM_callocN(sizeof(float)*len, "RNA_property_float_get_index"); + tmparray = MEM_callocN(sizeof(float) * len, "RNA_property_float_get_index"); RNA_property_float_get_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -2201,7 +2202,7 @@ float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; IDProperty *idprop; int i; @@ -2216,11 +2217,11 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa IDP_Double(idprop) = values[0]; } else if (idprop->subtype == IDP_FLOAT) { - memcpy(IDP_Array(idprop), values, sizeof(float)*idprop->len); + memcpy(IDP_Array(idprop), values, sizeof(float) * idprop->len); } else { - for (i = 0; ilen; i++) - ((double*)IDP_Array(idprop))[i] = values[i]; + for (i = 0; i < idprop->len; i++) + ((double *)IDP_Array(idprop))[i] = values[i]; } rna_idproperty_touch(idprop); @@ -2243,7 +2244,7 @@ void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const floa if (group) { idprop = IDP_New(IDP_ARRAY, &val, prop->identifier); IDP_AddToGroup(group, idprop); - memcpy(IDP_Array(idprop), values, sizeof(float)*idprop->len); + memcpy(IDP_Array(idprop), values, sizeof(float) * idprop->len); } } } @@ -2264,7 +2265,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, else { float *tmparray; - tmparray = MEM_callocN(sizeof(float)*len, "RNA_property_float_get_index"); + tmparray = MEM_callocN(sizeof(float) * len, "RNA_property_float_get_index"); RNA_property_float_get_array(ptr, prop, tmparray); tmparray[index] = value; RNA_property_float_set_array(ptr, prop, tmparray); @@ -2274,7 +2275,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); BLI_assert(RNA_property_array_check(prop) == 0); @@ -2284,7 +2285,7 @@ float RNA_property_float_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) void RNA_property_float_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA *prop, float *values) { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_FLOAT); BLI_assert(RNA_property_array_check(prop) != 0); @@ -2292,9 +2293,9 @@ void RNA_property_float_get_default_array(PointerRNA *UNUSED(ptr), PropertyRNA * if (prop->arraydimension == 0) values[0] = fprop->defaultvalue; else if (fprop->defaultarray) - memcpy(values, fprop->defaultarray, sizeof(float)*prop->totarraylength); + memcpy(values, fprop->defaultarray, sizeof(float) * prop->totarraylength); else - memset(values, 0, sizeof(float)*prop->totarraylength); + memset(values, 0, sizeof(float) * prop->totarraylength); } float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index) @@ -2312,7 +2313,7 @@ float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i else { float *tmparray, value; - tmparray = MEM_callocN(sizeof(float)*len, "RNA_property_float_get_default_index"); + tmparray = MEM_callocN(sizeof(float) * len, "RNA_property_float_get_default_index"); RNA_property_float_get_default_array(ptr, prop, tmparray); value = tmparray[index]; MEM_freeN(tmparray); @@ -2323,7 +2324,7 @@ float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value) { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_STRING); @@ -2357,10 +2358,10 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, length = RNA_property_string_length(ptr, prop); - if (length+1 < fixedlen) + if (length + 1 < fixedlen) buf = fixedbuf; else - buf = MEM_mallocN(sizeof(char)*(length+1), "RNA_string_get_alloc"); + buf = MEM_mallocN(sizeof(char) * (length + 1), "RNA_string_get_alloc"); #ifndef NDEBUG /* safety check to ensure the string is actually set */ @@ -2383,7 +2384,7 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, /* this is the length without \0 terminator */ int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop) { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_STRING); @@ -2408,7 +2409,7 @@ int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value) { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_STRING); @@ -2419,7 +2420,7 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val rna_idproperty_touch(idprop); } else if (sprop->set) - sprop->set(ptr, value); /* set function needs to clamp its self */ + sprop->set(ptr, value); /* set function needs to clamp its self */ else if (prop->flag & PROP_EDITABLE) { IDProperty *group; @@ -2431,7 +2432,7 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val void RNA_property_string_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop, char *value) { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_STRING); @@ -2447,10 +2448,10 @@ char *RNA_property_string_get_default_alloc(PointerRNA *ptr, PropertyRNA *prop, length = RNA_property_string_default_length(ptr, prop); - if (length+1 < fixedlen) + if (length + 1 < fixedlen) buf = fixedbuf; else - buf = MEM_callocN(sizeof(char)*(length+1), "RNA_string_get_alloc"); + buf = MEM_callocN(sizeof(char) * (length + 1), "RNA_string_get_alloc"); RNA_property_string_get_default(ptr, prop, buf); @@ -2460,7 +2461,7 @@ char *RNA_property_string_get_default_alloc(PointerRNA *ptr, PropertyRNA *prop, /* this is the length without \0 terminator */ int RNA_property_string_default_length(PointerRNA *UNUSED(ptr), PropertyRNA *prop) { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_STRING); @@ -2469,7 +2470,7 @@ int RNA_property_string_default_length(PointerRNA *UNUSED(ptr), PropertyRNA *pro int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop) { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_ENUM); @@ -2484,7 +2485,7 @@ int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value) { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_ENUM); @@ -2510,7 +2511,7 @@ void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value) int RNA_property_enum_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_ENUM); @@ -2519,7 +2520,7 @@ int RNA_property_enum_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *prop) void *RNA_property_enum_py_data_get(PropertyRNA *prop) { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; BLI_assert(RNA_property_type(prop) == PROP_ENUM); @@ -2528,13 +2529,13 @@ void *RNA_property_enum_py_data_get(PropertyRNA *prop) PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop) { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_POINTER); if ((idprop = rna_idproperty_check(&prop, ptr))) { - pprop = (PointerPropertyRNA*)prop; + pprop = (PointerPropertyRNA *)prop; /* for groups, data is idprop itself */ return rna_pointer_inherit_refine(ptr, pprop->type, idprop); @@ -2564,12 +2565,12 @@ void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr /* rna_idproperty_touch(idprop); */ } else { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; - if ( pprop->set && - !((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL) && - !((prop->flag & PROP_ID_SELF_CHECK) && ptr->id.data == ptr_value.id.data) - ) { + if (pprop->set && + !((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL) && + !((prop->flag & PROP_ID_SELF_CHECK) && ptr->id.data == ptr_value.id.data)) + { pprop->set(ptr, ptr_value); } } @@ -2590,7 +2591,7 @@ void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop) BLI_assert(RNA_property_type(prop) == PROP_POINTER); - if ((/*idprop=*/rna_idproperty_check(&prop, ptr))) { + if ((/*idprop=*/ rna_idproperty_check(&prop, ptr))) { /* already exists */ } else if (prop->flag & PROP_IDPROPERTY) { @@ -2628,7 +2629,7 @@ void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop) static void rna_property_collection_get_idp(CollectionPropertyIterator *iter) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)iter->prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)iter->prop; iter->ptr.data = rna_iterator_array_get(iter); iter->ptr.type = cprop->item_type; @@ -2658,14 +2659,14 @@ void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, Collectio iter->idprop = 1; } else { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; cprop->begin(iter, ptr); } } void RNA_property_collection_next(CollectionPropertyIterator *iter) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(iter->prop); + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(iter->prop); if (iter->idprop) { rna_iterator_array_next(iter); @@ -2679,7 +2680,7 @@ void RNA_property_collection_next(CollectionPropertyIterator *iter) void RNA_property_collection_end(CollectionPropertyIterator *iter) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(iter->prop); + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(iter->prop); if (iter->idprop) rna_iterator_array_end(iter); @@ -2689,7 +2690,7 @@ void RNA_property_collection_end(CollectionPropertyIterator *iter) int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; IDProperty *idprop; BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); @@ -2756,14 +2757,14 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA } } /*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 if (r_ptr) { if (idprop) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; - r_ptr->data = IDP_GetIndexArray(idprop, idprop->len-1); + r_ptr->data = IDP_GetIndexArray(idprop, idprop->len - 1); r_ptr->type = cprop->item_type; rna_pointer_inherit_id(NULL, ptr, r_ptr); } @@ -2787,14 +2788,14 @@ int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) array = IDP_IDPArray(idprop); if (key >= 0 && key < len) { - if (key+1 < len) { + if (key + 1 < len) { /* move element to be removed to the back */ memcpy(&tmp, &array[key], sizeof(IDProperty)); - memmove(array+key, array+key+1, sizeof(IDProperty)*(len-(key+1))); - memcpy(&array[len-1], &tmp, sizeof(IDProperty)); + memmove(array + key, array + key + 1, sizeof(IDProperty) * (len - (key + 1))); + memcpy(&array[len - 1], &tmp, sizeof(IDProperty)); } - IDP_ResizeIDPArray(idprop, len-1); + IDP_ResizeIDPArray(idprop, len - 1); } return 1; @@ -2815,7 +2816,7 @@ int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) return 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 return 0; } @@ -2836,9 +2837,9 @@ int RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int key, in if (key >= 0 && key < len && pos >= 0 && pos < len && key != pos) { memcpy(&tmp, &array[key], sizeof(IDProperty)); if (pos < key) - memmove(array+pos+1, array+pos, sizeof(IDProperty)*(key - pos)); + memmove(array + pos + 1, array + pos, sizeof(IDProperty) * (key - pos)); else - memmove(array+key, array+key+1, sizeof(IDProperty)*(pos - key)); + memmove(array + key, array + key + 1, sizeof(IDProperty) * (pos - key)); memcpy(&array[pos], &tmp, sizeof(IDProperty)); } @@ -2883,7 +2884,7 @@ int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, Poi int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(prop); + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(prop); BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); @@ -2914,7 +2915,7 @@ int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int k int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(prop); + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(prop); BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); @@ -2962,7 +2963,7 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co /* zero return is an assignment error */ int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, const PointerRNA *assign_ptr) { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)rna_ensure_property(prop); + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(prop); BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); @@ -2979,7 +2980,7 @@ int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, Pointer BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); *r_ptr = *ptr; - return ((r_ptr->type = rna_ensure_property(prop)->srna) ? 1:0); + return ((r_ptr->type = rna_ensure_property(prop)->srna) ? 1 : 0); } int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, RawArray *array) @@ -2998,7 +2999,7 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper if (iter.valid) { /* get data from array iterator and item property */ internal = iter.internal; - arrayp = (iter.valid)? iter.ptr.data: NULL; + arrayp = (iter.valid) ? iter.ptr.data : NULL; if (internal->skip || !RNA_property_editable(&iter.ptr, itemprop)) { /* we might skip some items, so it's not a proper array */ @@ -3008,7 +3009,7 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper array->array = arrayp + itemprop->rawoffset; array->stride = internal->itemsize; - array->len = ((char*)internal->endptr - arrayp)/internal->itemsize; + array->len = ((char *)internal->endptr - arrayp) / internal->itemsize; array->type = itemprop->rawtype; } else @@ -3095,7 +3096,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro /* try to access as raw array */ if (RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) { int arraylen = (itemlen == 0) ? 1 : itemlen; - if (in.len != arraylen*out.len) { + if (in.len != arraylen * out.len) { BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d)", out.len * arraylen, in.len); return 0; @@ -3109,12 +3110,12 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro size = RNA_raw_type_sizeof(out.type) * arraylen; - for (a = 0; a in.len) { + if (a + itemlen > in.len) { BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more)", in.len); err = 1; break; @@ -3231,7 +3232,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro tmparray = NULL; } if (!tmparray) { - tmparray = MEM_callocN(sizeof(float)*itemlen, "RNA tmparray\n"); + tmparray = MEM_callocN(sizeof(float) * itemlen, "RNA tmparray\n"); tmplen = itemlen; } @@ -3239,20 +3240,20 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro if (set) { switch (itemtype) { case PROP_BOOLEAN: { - for (j = 0; jrawtype == PROP_RAW_UNSET) { /* 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_INT; - case PROP_INT: - return PROP_RAW_INT; - case PROP_FLOAT: - return PROP_RAW_FLOAT; - case PROP_ENUM: - return PROP_RAW_INT; - default: - break; + case PROP_BOOLEAN: + return PROP_RAW_INT; + case PROP_INT: + return PROP_RAW_INT; + case PROP_FLOAT: + return PROP_RAW_FLOAT; + case PROP_ENUM: + return PROP_RAW_INT; + default: + break; } } return prop->rawtype; @@ -3380,7 +3381,7 @@ void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, ListBaseIterator *internal; internal = MEM_callocN(sizeof(ListBaseIterator), "ListBaseIterator"); - internal->link = (lb)? lb->first: NULL; + internal->link = (lb) ? lb->first : NULL; internal->skip = skip; iter->internal = internal; @@ -3439,8 +3440,8 @@ void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int i internal = MEM_callocN(sizeof(ArrayIterator), "ArrayIterator"); internal->ptr = ptr; - internal->free_ptr = free_ptr ? ptr:NULL; - internal->endptr = ((char*)ptr)+length*itemsize; + internal->free_ptr = free_ptr ? ptr : NULL; + internal->endptr = ((char *)ptr) + length * itemsize; internal->itemsize = itemsize; internal->skip = skip; internal->length = length; @@ -3480,7 +3481,7 @@ void *rna_iterator_array_dereference_get(CollectionPropertyIterator *iter) ArrayIterator *internal = iter->internal; /* for ** arrays */ - return *(void**)(internal->ptr); + return *(void **)(internal->ptr); } void rna_iterator_array_end(CollectionPropertyIterator *iter) @@ -3500,7 +3501,7 @@ PointerRNA rna_array_lookup_int(PointerRNA *ptr, StructRNA *type, void *data, in if (index < 0 || index >= length) return PointerRNA_NULL; - return rna_pointer_inherit_refine(ptr, type, ((char*)data) + index*itemsize); + return rna_pointer_inherit_refine(ptr, type, ((char *)data) + index * itemsize); } /* RNA Path - Experiment */ @@ -3566,22 +3567,22 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int return NULL; /* try to use fixed buffer if possible */ - if (len+1 < fixedlen) + if (len + 1 < fixedlen) buf = fixedbuf; else - buf = MEM_callocN(sizeof(char)*(len+1), "rna_path_token"); + buf = MEM_callocN(sizeof(char) * (len + 1), "rna_path_token"); /* copy string, taking into account escaped ] */ if (bracket) { - for (p = *path, i = 0, j = 0; i= 2 && token[len-1] =='"') { + if (len >= 2 && token[len - 1] == '"') { /* strip away "" */ - token[len-1] = '\0'; + token[len - 1] = '\0'; return 1; } } @@ -3622,11 +3623,11 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, prop = NULL; curptr = *ptr; - if (path == NULL || *path =='\0') + if (path == NULL || *path == '\0') return 0; while (*path) { - int use_id_prop = (*path =='[') ? 1:0; + int use_id_prop = (*path == '[') ? 1 : 0; /* custom property lookup ? * C.object["someprop"] */ @@ -3640,7 +3641,7 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, if (use_id_prop) { /* look up property name in current struct */ IDProperty *group = RNA_struct_idprops(&curptr, 0); if (group && rna_token_strip_quotes(token)) - prop = (PropertyRNA *)IDP_GetPropertyFromGroup(group, token+1); + prop = (PropertyRNA *)IDP_GetPropertyFromGroup(group, token + 1); } else { prop = RNA_struct_find_property(&curptr, token); @@ -3658,143 +3659,143 @@ int RNA_path_resolve_full(PointerRNA *ptr, const char *path, PointerRNA *r_ptr, * collection, otherwise return the property rna so that the * caller can read the value of the property itself */ switch (type) { - case PROP_POINTER: - nextptr = RNA_property_pointer_get(&curptr, prop); - - if (nextptr.data) { - curptr = nextptr; - prop = NULL; /* now we have a PointerRNA, the prop is our parent so forget it */ - if (index) *index = -1; - } - else - return 0; - - break; - case PROP_COLLECTION: - if (*path) { - if (*path == '[') { - /* resolve the lookup with [] brackets */ - token = rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1); - - if (!token) - return 0; - - /* check for "" to see if it is a string */ - if (rna_token_strip_quotes(token)) { - RNA_property_collection_lookup_string(&curptr, prop, token+1, &nextptr); - } - else { - /* otherwise do int lookup */ - intkey = atoi(token); - if (intkey == 0 && (token[0] != '0' || token[1] != '\0')) { - return 0; /* we can be sure the fixedbuf was used in this case */ - } - RNA_property_collection_lookup_int(&curptr, prop, intkey, &nextptr); - } - - if (token != fixedbuf) { - MEM_freeN(token); - } - } - else { - PointerRNA c_ptr; - - /* ensure we quit on invalid values */ - nextptr.data = NULL; - - if (RNA_property_collection_type_get(&curptr, prop, &c_ptr)) { - nextptr = c_ptr; - } - } + case PROP_POINTER: + nextptr = RNA_property_pointer_get(&curptr, prop); if (nextptr.data) { curptr = nextptr; - prop = NULL; /* now we have a PointerRNA, the prop is our parent so forget it */ + prop = NULL; /* now we have a PointerRNA, the prop is our parent so forget it */ if (index) *index = -1; } else return 0; - } - break; - default: - if (index == NULL) break; - - *index = -1; - - if (*path) { - int index_arr[RNA_MAX_ARRAY_DIMENSION] = {0}; - int len[RNA_MAX_ARRAY_DIMENSION]; - const int dim = RNA_property_array_dimension(&curptr, prop, len); - int i, temp_index; - - for (i = 0; i= len[i]) + if (nextptr.data) { + curptr = nextptr; + prop = NULL; /* now we have a PointerRNA, the prop is our parent so forget it */ + if (index) *index = -1; + } + else return 0; - - index_arr[i] = temp_index; - /* end multi index resolve */ } - /* arrays always contain numbers so further values are not valid */ + break; + default: + if (index == NULL) + break; + + *index = -1; + if (*path) { - return 0; - } - else { - int totdim = 1; - int flat_index = 0; + int index_arr[RNA_MAX_ARRAY_DIMENSION] = {0}; + int len[RNA_MAX_ARRAY_DIMENSION]; + const int dim = RNA_property_array_dimension(&curptr, prop, len); + int i, temp_index; + + for (i = 0; i < dim; i++) { + temp_index = -1; + + /* multi index resolve */ + if (*path == '[') { + token = rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 1); + + if (token == NULL) { + /* invalid syntax blah[] */ + return 0; + } + /* check for "" to see if it is a string */ + else if (rna_token_strip_quotes(token)) { + temp_index = RNA_property_array_item_index(prop, *(token + 1)); + } + else { + /* otherwise do int lookup */ + temp_index = atoi(token); - for (i = dim-1; i >= 0; i--) { - flat_index += index_arr[i] * totdim; - totdim *= len[i]; + if (temp_index == 0 && (token[0] != '0' || token[1] != '\0')) { + if (token != fixedbuf) { + MEM_freeN(token); + } + + return 0; + } + } + } + else if (dim == 1) { + /* location.x || scale.X, single dimension arrays only */ + token = rna_path_token(&path, fixedbuf, sizeof(fixedbuf), 0); + if (token == NULL) { + /* invalid syntax blah.. */ + return 0; + } + temp_index = RNA_property_array_item_index(prop, *token); + } + + if (token != fixedbuf) { + MEM_freeN(token); + } + + /* out of range */ + if (temp_index < 0 || temp_index >= len[i]) + return 0; + + index_arr[i] = temp_index; + /* end multi index resolve */ + } + + /* arrays always contain numbers so further values are not valid */ + if (*path) { + return 0; } + else { + int totdim = 1; + int flat_index = 0; - *index = flat_index; + for (i = dim - 1; i >= 0; i--) { + flat_index += index_arr[i] * totdim; + totdim *= len[i]; + } + + *index = flat_index; + } } - } } } @@ -3815,7 +3816,7 @@ char *RNA_path_append(const char *path, PointerRNA *UNUSED(ptr), PropertyRNA *pr /* add .identifier */ if (path) { - BLI_dynstr_append(dynstr, (char*)path); + BLI_dynstr_append(dynstr, (char *)path); if (*path) BLI_dynstr_append(dynstr, "."); } @@ -3897,7 +3898,7 @@ char *RNA_path_back(const char *path) i = previous - path; result = BLI_strdup(path); - if (i > 0 && result[i-1] == '.') i--; + if (i > 0 && result[i - 1] == '.') i--; result[i] = 0; return result; @@ -3948,7 +3949,7 @@ static char *rna_idp_path_create(IDP_Chain *child_link) path = BLI_dynstr_get_cstring(dynstr); BLI_dynstr_free(dynstr); - if (*path =='\0') { + if (*path == '\0') { MEM_freeN(path); path = NULL; } @@ -4068,7 +4069,7 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr) if (userprop) ptrpath = BLI_strdup(RNA_property_identifier(userprop)); else - return NULL; /* can't do anything about this case yet... */ + return NULL; /* can't do anything about this case yet... */ } else if (RNA_struct_is_a(ptr->type, &RNA_PropertyGroup)) { /* special case, easier to deal with here then in ptr->type->path() */ @@ -4096,7 +4097,7 @@ char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop) propname = RNA_property_identifier(prop); if (ptrpath) { - path = BLI_sprintfN(is_rna ? "%s.%s":"%s[\"%s\"]", ptrpath, propname); + path = BLI_sprintfN(is_rna ? "%s.%s" : "%s[\"%s\"]", ptrpath, propname); MEM_freeN(ptrpath); } else { @@ -4306,7 +4307,7 @@ int RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char int RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int *value) { - for ( ; item->identifier; item++) { + for (; item->identifier; item++) { if (strcmp(item->identifier, identifier) == 0) { *value = item->value; return 1; @@ -4316,9 +4317,9 @@ int RNA_enum_value_from_id(EnumPropertyItem *item, const char *identifier, int * return 0; } -int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **identifier) +int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **identifier) { - for ( ; item->identifier; item++) { + for (; item->identifier; item++) { if (item->value == value) { *identifier = item->identifier; return 1; @@ -4330,7 +4331,7 @@ int RNA_enum_id_from_value(EnumPropertyItem *item, int value, const char **ident int RNA_enum_icon_from_value(EnumPropertyItem *item, int value, int *icon) { - for ( ; item->identifier; item++) { + for (; item->identifier; item++) { if (item->value == value) { *icon = item->icon; return 1; @@ -4342,8 +4343,8 @@ int RNA_enum_icon_from_value(EnumPropertyItem *item, int value, int *icon) int RNA_enum_name_from_value(EnumPropertyItem *item, int value, const char **name) { - for( ; item->identifier; item++) { - if(item->value==value) { + for (; item->identifier; item++) { + if (item->value == value) { *name = item->name; return 1; } @@ -4523,7 +4524,7 @@ char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr) BLI_dynstr_append(dynstr, "{"); - RNA_STRUCT_BEGIN (ptr, prop) + RNA_STRUCT_BEGIN(ptr, prop) { propname = RNA_property_identifier(prop); @@ -4567,7 +4568,7 @@ char *RNA_pointer_as_string_keywords_ex(bContext *C, PointerRNA *ptr, PointerRNA PropertyRNA *prop_default; char *buf_default; - RNA_PROP_BEGIN (ptr, propptr, iterprop) + RNA_PROP_BEGIN(ptr, propptr, iterprop) { prop = propptr.data; @@ -4585,7 +4586,7 @@ char *RNA_pointer_as_string_keywords_ex(bContext *C, PointerRNA *ptr, PointerRNA if (as_function && (flag & PROP_REQUIRED)) { /* required args don't have useful defaults */ - BLI_dynstr_appendf(dynstr, first_iter ? "%s":", %s", arg_name); + BLI_dynstr_appendf(dynstr, first_iter ? "%s" : ", %s", arg_name); first_iter = FALSE; } else { @@ -4614,13 +4615,13 @@ char *RNA_pointer_as_string_keywords_ex(bContext *C, PointerRNA *ptr, PointerRNA buf_default = RNA_property_as_string(C, ptr_default, prop_default); if (strcmp(buf, buf_default) == 0) - ok = FALSE; /* values match, don't bother printing */ + ok = FALSE; /* values match, don't bother printing */ MEM_freeN(buf_default); } } if (ok) { - BLI_dynstr_appendf(dynstr, first_iter ? "%s=%s":", %s=%s", arg_name, buf); + BLI_dynstr_appendf(dynstr, first_iter ? "%s=%s" : ", %s=%s", arg_name, buf); first_iter = FALSE; } @@ -4646,7 +4647,7 @@ char *RNA_pointer_as_string_keywords(bContext *C, PointerRNA *ptr, PointerRNA *p } char *RNA_function_as_string_keywords(bContext *C, FunctionRNA *func, PointerRNA *ptr_default, - const short as_function, const short all_args) + const short as_function, const short all_args) { PointerRNA funcptr; PropertyRNA *iterprop; @@ -4673,144 +4674,144 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop) /* see if we can coorce into a python type - PropertyType */ switch (type) { - case PROP_BOOLEAN: - if (len == 0) { - BLI_dynstr_append(dynstr, RNA_property_boolean_get(ptr, prop) ? "True" : "False"); - } - else { - BLI_dynstr_append(dynstr, "("); - for (i = 0; iidentifier; item++) { - if (item->identifier[0] && item->value & val) { - BLI_dynstr_appendf(dynstr, is_first ? "'%s'" : ", '%s'", item->identifier); - is_first = FALSE; + case PROP_ENUM: + { + /* string arrays don't exist */ + const char *identifier; + int val = RNA_property_enum_get(ptr, prop); + + if (RNA_property_flag(prop) & PROP_ENUM_FLAG) { + /* represent as a python set */ + if (val) { + EnumPropertyItem *item = NULL; + int free; + + BLI_dynstr_append(dynstr, "{"); + + RNA_property_enum_items(C, ptr, prop, &item, NULL, &free); + if (item) { + short is_first = TRUE; + for (; item->identifier; item++) { + if (item->identifier[0] && item->value & val) { + BLI_dynstr_appendf(dynstr, is_first ? "'%s'" : ", '%s'", item->identifier); + is_first = FALSE; + } } - } - if (free) { - MEM_freeN(item); + if (free) { + MEM_freeN(item); + } } - } - BLI_dynstr_append(dynstr, "}"); + BLI_dynstr_append(dynstr, "}"); + } + else { + /* annoying exception, don't confuse with dictionary syntax above: {} */ + BLI_dynstr_append(dynstr, "set()"); + } + } + else if (RNA_property_enum_identifier(C, ptr, prop, val, &identifier)) { + BLI_dynstr_appendf(dynstr, "'%s'", identifier); } else { - /* annoying exception, don't confuse with dictionary syntax above: {} */ - BLI_dynstr_append(dynstr, "set()"); + BLI_dynstr_append(dynstr, "''"); } + break; } - else if (RNA_property_enum_identifier(C, ptr, prop, val, &identifier)) { - BLI_dynstr_appendf(dynstr, "'%s'", identifier); - } - else { - BLI_dynstr_append(dynstr, "''"); - } - break; - } - case PROP_POINTER: - { - PointerRNA tptr = RNA_property_pointer_get(ptr, prop); - cstring = RNA_pointer_as_string(C, &tptr); - BLI_dynstr_append(dynstr, cstring); - MEM_freeN(cstring); - break; - } - case PROP_COLLECTION: - { - int first_time = 1; - CollectionPropertyIterator collect_iter; - BLI_dynstr_append(dynstr, "["); - - for (RNA_property_collection_begin(ptr, prop, &collect_iter); collect_iter.valid; - RNA_property_collection_next(&collect_iter)) { - PointerRNA itemptr = collect_iter.ptr; - - if (first_time == 0) - BLI_dynstr_append(dynstr, ", "); - first_time = 0; - - /* now get every prop of the collection */ - cstring = RNA_pointer_as_string(C, &itemptr); + case PROP_POINTER: + { + PointerRNA tptr = RNA_property_pointer_get(ptr, prop); + cstring = RNA_pointer_as_string(C, &tptr); BLI_dynstr_append(dynstr, cstring); MEM_freeN(cstring); + break; } + case PROP_COLLECTION: + { + int first_time = 1; + CollectionPropertyIterator collect_iter; + BLI_dynstr_append(dynstr, "["); + + for (RNA_property_collection_begin(ptr, prop, &collect_iter); collect_iter.valid; + RNA_property_collection_next(&collect_iter)) { + PointerRNA itemptr = collect_iter.ptr; + + if (first_time == 0) + BLI_dynstr_append(dynstr, ", "); + first_time = 0; + + /* now get every prop of the collection */ + cstring = RNA_pointer_as_string(C, &itemptr); + BLI_dynstr_append(dynstr, cstring); + MEM_freeN(cstring); + } - RNA_property_collection_end(&collect_iter); - BLI_dynstr_append(dynstr, "]"); - break; - } - default: - BLI_dynstr_append(dynstr, "''"); /* TODO */ - break; + RNA_property_collection_end(&collect_iter); + BLI_dynstr_append(dynstr, "]"); + break; + } + default: + BLI_dynstr_append(dynstr, "''"); /* TODO */ + break; } cstring = BLI_dynstr_get_cstring(dynstr); @@ -4850,8 +4851,7 @@ PropertyRNA *RNA_function_find_parameter(PointerRNA *UNUSED(ptr), FunctionRNA *f return BLI_findstring(&func->cont.properties, identifier, offsetof(PropertyRNA, identifier)); } -const struct ListBase *RNA_function_defined_parameters(FunctionRNA *func) -{ +const struct ListBase *RNA_function_defined_parameters(FunctionRNA *func){ return &func->cont.properties; } @@ -4896,22 +4896,22 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE if (!(parm->flag & PROP_REQUIRED) && !(parm->flag & PROP_DYNAMIC)) { switch (parm->type) { case PROP_BOOLEAN: - if (parm->arraydimension) memcpy(data, ((BoolPropertyRNA*)parm)->defaultarray, size); - else memcpy(data, &((BoolPropertyRNA*)parm)->defaultvalue, size); + if (parm->arraydimension) memcpy(data, ((BoolPropertyRNA *)parm)->defaultarray, size); + else memcpy(data, &((BoolPropertyRNA *)parm)->defaultvalue, size); break; case PROP_INT: - if (parm->arraydimension) memcpy(data, ((IntPropertyRNA*)parm)->defaultarray, size); - else memcpy(data, &((IntPropertyRNA*)parm)->defaultvalue, size); + if (parm->arraydimension) memcpy(data, ((IntPropertyRNA *)parm)->defaultarray, size); + else memcpy(data, &((IntPropertyRNA *)parm)->defaultvalue, size); break; case PROP_FLOAT: - if (parm->arraydimension) memcpy(data, ((FloatPropertyRNA*)parm)->defaultarray, size); - else memcpy(data, &((FloatPropertyRNA*)parm)->defaultvalue, size); + if (parm->arraydimension) memcpy(data, ((FloatPropertyRNA *)parm)->defaultarray, size); + else memcpy(data, &((FloatPropertyRNA *)parm)->defaultvalue, size); break; case PROP_ENUM: - memcpy(data, &((EnumPropertyRNA*)parm)->defaultvalue, size); + memcpy(data, &((EnumPropertyRNA *)parm)->defaultvalue, size); break; case PROP_STRING: { - const char *defvalue = ((StringPropertyRNA*)parm)->defaultvalue; + const char *defvalue = ((StringPropertyRNA *)parm)->defaultvalue; if (defvalue && defvalue[0]) { /* causes bug [#29988], possibly this is only correct for thick wrapped * need to look further into it - campbell */ @@ -4929,7 +4929,7 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE } } - data = ((char*)data) + rna_parameter_size_alloc(parm); + data = ((char *)data) + rna_parameter_size_alloc(parm); } return parms; @@ -4943,7 +4943,7 @@ void RNA_parameter_list_free(ParameterList *parms) parm = parms->func->cont.properties.first; for (tot = 0; parm; parm = parm->next) { if (parm->type == PROP_COLLECTION) - BLI_freelistN((ListBase*)((char*)parms->data+tot)); + BLI_freelistN((ListBase *)((char *)parms->data + tot)); else if (parm->flag & PROP_DYNAMIC) { /* for dynamic arrays and strings, data is a pointer to an array */ ParameterDynAlloc *data_alloc = (void *)(((char *)parms->data) + tot); @@ -4987,7 +4987,7 @@ void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter) if (iter->valid) { iter->size = rna_parameter_size_alloc(iter->parm); - iter->data = (((char*)iter->parms->data)); /* +iter->offset, always 0 */ + iter->data = (((char *)iter->parms->data)); /* +iter->offset, always 0 */ } } @@ -4999,7 +4999,7 @@ void RNA_parameter_list_next(ParameterIterator *iter) if (iter->valid) { iter->size = rna_parameter_size_alloc(iter->parm); - iter->data = (((char*)iter->parms->data)+iter->offset); + iter->data = (((char *)iter->parms->data) + iter->offset); } } @@ -5180,11 +5180,11 @@ static int rna_function_format_array_length(const char *format, int ofs, int fle char lenbuf[16]; int idx = 0; - if (format[ofs++] =='[') - for (; ofs=flen or idx over lenbuf capacity */ lenbuf[idx] = '\0'; return atoi(lenbuf); @@ -5200,75 +5200,75 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop /* ptr is always a function pointer, prop always a parameter */ switch (type) { - case PROP_BOOLEAN: + case PROP_BOOLEAN: { - if (ftype !='b') { + if (ftype != 'b') { fprintf(stderr, "%s.%s: wrong type for parameter %s, a boolean was expected\n", tid, fid, pid); return -1; } if (len == 0) - *((int*)dest) = *((int*)src); + *((int *)dest) = *((int *)src); else - memcpy(dest, src, len*sizeof(int)); + memcpy(dest, src, len * sizeof(int)); break; } - case PROP_INT: + case PROP_INT: { - if (ftype !='i') { + if (ftype != 'i') { fprintf(stderr, "%s.%s: wrong type for parameter %s, an integer was expected\n", tid, fid, pid); return -1; } if (len == 0) - *((int*)dest) = *((int*)src); + *((int *)dest) = *((int *)src); else - memcpy(dest, src, len*sizeof(int)); + memcpy(dest, src, len * sizeof(int)); break; } - case PROP_FLOAT: + case PROP_FLOAT: { - if (ftype !='f') { + if (ftype != 'f') { fprintf(stderr, "%s.%s: wrong type for parameter %s, a float was expected\n", tid, fid, pid); return -1; } if (len == 0) - *((float*)dest) = *((float*)src); + *((float *)dest) = *((float *)src); else - memcpy(dest, src, len*sizeof(float)); + memcpy(dest, src, len * sizeof(float)); break; } - case PROP_STRING: + case PROP_STRING: { - if (ftype !='s') { + if (ftype != 's') { fprintf(stderr, "%s.%s: wrong type for parameter %s, a string was expected\n", tid, fid, pid); return -1; } - *((char**)dest) = *((char**)src); + *((char **)dest) = *((char **)src); break; } - case PROP_ENUM: + case PROP_ENUM: { - if (ftype !='e') { + if (ftype != 'e') { fprintf(stderr, "%s.%s: wrong type for parameter %s, an enum was expected\n", tid, fid, pid); return -1; } - *((int*)dest) = *((int*)src); + *((int *)dest) = *((int *)src); break; } - case PROP_POINTER: + case PROP_POINTER: { StructRNA *ptype; - if (ftype !='O') { + if (ftype != 'O') { fprintf(stderr, "%s.%s: wrong type for parameter %s, an object was expected\n", tid, fid, pid); return -1; } @@ -5276,9 +5276,9 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop ptype = RNA_property_pointer_type(ptr, prop); if (prop->flag & PROP_RNAPTR) { - *((PointerRNA*)dest) = *((PointerRNA*)src); + *((PointerRNA *)dest) = *((PointerRNA *)src); break; - } + } if (ptype != srna && !RNA_struct_is_a(srna, ptype)) { fprintf(stderr, "%s.%s: wrong type for parameter %s, " @@ -5287,18 +5287,18 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop return -1; } - *((void**)dest) = *((void**)src); + *((void **)dest) = *((void **)src); break; } - case PROP_COLLECTION: + case PROP_COLLECTION: { StructRNA *ptype; ListBase *lb, *clb; Link *link; CollectionPointerLink *clink; - if (ftype !='C') { + if (ftype != 'C') { fprintf(stderr, "%s.%s: wrong type for parameter %s, a collection was expected\n", tid, fid, pid); return -1; } @@ -5323,7 +5323,7 @@ static int rna_function_parameter_parse(PointerRNA *ptr, PropertyRNA *prop, Prop break; } - default: + default: { if (len == 0) fprintf(stderr, "%s.%s: unknown type for parameter %s\n", tid, fid, pid); @@ -5374,7 +5374,7 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt pid = RNA_property_identifier(parm); - if (ofs >= flen || format[ofs] =='N') { + if (ofs >= flen || format[ofs] == 'N') { if (flag & PROP_REQUIRED) { err = -1; fprintf(stderr, "%s.%s: missing required parameter %s\n", tid, fid, pid); @@ -5399,46 +5399,46 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt } switch (type) { - case PROP_BOOLEAN: - case PROP_INT: - case PROP_ENUM: + case PROP_BOOLEAN: + case PROP_INT: + case PROP_ENUM: { int arg = va_arg(args, int); err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, NULL, tid, fid, pid); break; } - case PROP_FLOAT: + case PROP_FLOAT: { double arg = va_arg(args, double); err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, NULL, tid, fid, pid); break; } - case PROP_STRING: + case PROP_STRING: { - char *arg = va_arg(args, char*); + char *arg = va_arg(args, char *); err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, NULL, tid, fid, pid); break; } - case PROP_POINTER: + case PROP_POINTER: { - StructRNA *srna = va_arg(args, StructRNA*); - void *arg = va_arg(args, void*); + StructRNA *srna = va_arg(args, StructRNA *); + void *arg = va_arg(args, void *); err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid); break; } - case PROP_COLLECTION: + case PROP_COLLECTION: { - StructRNA *srna = va_arg(args, StructRNA*); - ListBase *arg = va_arg(args, ListBase*); + StructRNA *srna = va_arg(args, StructRNA *); + ListBase *arg = va_arg(args, ListBase *); err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, &arg, srna, tid, fid, pid); break; } - default: + default: { /* handle errors */ err = rna_function_parameter_parse(&funcptr, parm, type, ftype, len, iter.data, NULL, @@ -5455,7 +5455,7 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt err = RNA_function_call(C, reports, ptr, func, &parms); /* XXX throw error when more parameters than those needed are passed or leave silent? */ - if (err == 0 && pret && ofsinternal; - FCurve *fcu = (FCurve*)internal->link; + FCurve *fcu = (FCurve *)internal->link; bActionGroup *grp = fcu->grp; /* only continue if the next F-Curve (if existant) belongs in the same group */ if ((fcu->next) && (fcu->next->grp == grp)) - internal->link = (Link*)fcu->next; + internal->link = (Link *)fcu->next; else internal->link = NULL; @@ -74,7 +74,7 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, bActionG /* try to remove the F-Curve from the action */ if (!BLI_remlink_safe(&act->groups, agrp)) { - BKE_reportf(reports, RPT_ERROR, "ActionGroup '%s' not found in action '%s'", agrp->name, act->id.name+2); + BKE_reportf(reports, RPT_ERROR, "ActionGroup '%s' not found in action '%s'", agrp->name, act->id.name + 2); return; } @@ -96,7 +96,7 @@ static void rna_Action_groups_remove(bAction *act, ReportList *reports, bActionG static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const char *data_path, int index, const char *group) { - if (group && group[0] =='\0') group = NULL; + if (group && group[0] == '\0') group = NULL; if (data_path[0] == '\0') { BKE_report(reports, RPT_ERROR, "F-Curve data path empty, invalid argument"); @@ -106,7 +106,7 @@ static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, const ch /* annoying, check if this exists */ if (verify_fcurve(act, group, data_path, index, 0)) { BKE_reportf(reports, RPT_ERROR, "F-Curve '%s[%d]' already exists in action '%s'", data_path, - index, act->id.name+2); + index, act->id.name + 2); return NULL; } return verify_fcurve(act, group, data_path, index, 1); @@ -117,7 +117,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve * if (fcu->grp) { if (BLI_findindex(&act->groups, fcu->grp) == -1) { BKE_reportf(reports, RPT_ERROR, "F-Curve's ActionGroup '%s' not found in action '%s'", - fcu->grp->name, act->id.name+2); + fcu->grp->name, act->id.name + 2); return; } @@ -126,7 +126,7 @@ static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve * } else { if (BLI_findindex(&act->curves, fcu) == -1) { - BKE_reportf(reports, RPT_ERROR, "F-Curve not found in action '%s'", act->id.name+2); + BKE_reportf(reports, RPT_ERROR, "F-Curve not found in action '%s'", act->id.name + 2); return; } @@ -148,7 +148,7 @@ static TimeMarker *rna_Action_pose_markers_new(bAction *act, const char name[]) static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, TimeMarker *marker) { if (!BLI_remlink_safe(&act->markers, marker)) { - BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in Action '%s'", marker->name, act->id.name+2); + BKE_reportf(reports, RPT_ERROR, "TimelineMarker '%s' not found in Action '%s'", marker->name, act->id.name + 2); return; } @@ -158,43 +158,43 @@ static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, Ti static PointerRNA rna_Action_active_pose_marker_get(PointerRNA *ptr) { - bAction *act = (bAction*)ptr->data; - return rna_pointer_inherit_refine(ptr, &RNA_TimelineMarker, BLI_findlink(&act->markers, act->active_marker-1)); + bAction *act = (bAction *)ptr->data; + return rna_pointer_inherit_refine(ptr, &RNA_TimelineMarker, BLI_findlink(&act->markers, act->active_marker - 1)); } static void rna_Action_active_pose_marker_set(PointerRNA *ptr, PointerRNA value) { - bAction *act = (bAction*)ptr->data; + bAction *act = (bAction *)ptr->data; act->active_marker = BLI_findindex(&act->markers, value.data) + 1; } static int rna_Action_active_pose_marker_index_get(PointerRNA *ptr) { - bAction *act = (bAction*)ptr->data; - return MAX2(act->active_marker-1, 0); + bAction *act = (bAction *)ptr->data; + return MAX2(act->active_marker - 1, 0); } static void rna_Action_active_pose_marker_index_set(PointerRNA *ptr, int value) { - bAction *act = (bAction*)ptr->data; - act->active_marker = value+1; + bAction *act = (bAction *)ptr->data; + act->active_marker = value + 1; } static void rna_Action_active_pose_marker_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - bAction *act = (bAction*)ptr->data; + bAction *act = (bAction *)ptr->data; *min = 0; - *max = BLI_countlist(&act->markers)-1; + *max = BLI_countlist(&act->markers) - 1; *max = MAX2(0, *max); } static void rna_Action_frame_range_get(PointerRNA *ptr, float *values) -{ /* don't include modifiers because they too easily can have very large +{ /* don't include modifiers because they too easily can have very large * ranges: MINAFRAMEF to MAXFRAMEF. */ - calc_action_range(ptr->id.data, values, values+1, FALSE); + calc_action_range(ptr->id.data, values, values + 1, FALSE); } @@ -272,20 +272,20 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Datablock Filters", "Show options for whether channels related to certain types of data are included"); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, -1); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN, NULL); /* General Filtering Settings */ prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYSEL); RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_INCL_HIDDEN); RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that aren't visible"); RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); /* Object Group Filtering Settings */ prop = RNA_def_property(srna, "show_only_group_objects", PROP_BOOLEAN, PROP_NONE); @@ -293,13 +293,13 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Only Objects in Group", "Only include channels from Objects in the specified Group"); RNA_def_property_ui_icon(prop, ICON_GROUP, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "filter_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "filter_grp"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Filtering Group", "Group that included Object should be a member of"); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); /* FCurve Display Name Search Settings */ prop = RNA_def_property(srna, "show_only_matching_fcurves", PROP_BOOLEAN, PROP_NONE); @@ -307,12 +307,12 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Only Matching F-Curves", "Only include F-Curves with names containing search text"); RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "filter_fcurve_name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "searchstr"); RNA_def_property_ui_text(prop, "F-Curve Name Filter", "F-Curve live filtering string"); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); /* NLA Specific Settings */ prop = RNA_def_property(srna, "show_missing_nla", PROP_BOOLEAN, PROP_NONE); @@ -320,20 +320,20 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Include Missing NLA", "Include Animation Data blocks with no NLA data (NLA Editor only)"); RNA_def_property_ui_icon(prop, ICON_ACTION, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); /* Summary Settings (DopeSheet editors only) */ prop = RNA_def_property(srna, "show_summary", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_SUMMARY); RNA_def_property_ui_text(prop, "Display Summary", "Display an additional 'summary' line (DopeSheet Editors only)"); RNA_def_property_ui_icon(prop, ICON_BORDERMOVE, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_expanded_summary", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADS_FLAG_SUMMARY_COLLAPSED); RNA_def_property_ui_text(prop, "Collapse Summary", "Collapse summary when shown, so all other channels get hidden (DopeSheet Editors Only)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); /* General DataType Filtering Settings */ @@ -342,97 +342,97 @@ static void rna_def_dopesheet(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Display Transforms", "Include visualization of Object-level Animation data (mostly Transforms)"); RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); /* XXX? */ - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_shapekeys", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS); RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of ShapeKey related Animation data"); RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_meshes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMESH); RNA_def_property_ui_text(prop, "Display Meshes", "Include visualization of Mesh related Animation data"); RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_lattices", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAT); RNA_def_property_ui_text(prop, "Display Lattices", "Include visualization of Lattice related Animation data"); RNA_def_property_ui_icon(prop, ICON_LATTICE_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_cameras", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCAM); RNA_def_property_ui_text(prop, "Display Camera", "Include visualization of Camera related Animation data"); RNA_def_property_ui_icon(prop, ICON_CAMERA_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_materials", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMAT); RNA_def_property_ui_text(prop, "Display Material", "Include visualization of Material related Animation data"); RNA_def_property_ui_icon(prop, ICON_MATERIAL_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_lamps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAM); RNA_def_property_ui_text(prop, "Display Lamp", "Include visualization of Lamp related Animation data"); RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX); RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of Texture related Animation data"); RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_curves", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCUR); RNA_def_property_ui_text(prop, "Display Curve", "Include visualization of Curve related Animation data"); RNA_def_property_ui_icon(prop, ICON_CURVE_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_worlds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOWOR); RNA_def_property_ui_text(prop, "Display World", "Include visualization of World related Animation data"); RNA_def_property_ui_icon(prop, ICON_WORLD_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_scenes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSCE); RNA_def_property_ui_text(prop, "Display Scene", "Include visualization of Scene related Animation data"); RNA_def_property_ui_icon(prop, ICON_SCENE_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOPART); RNA_def_property_ui_text(prop, "Display Particle", "Include visualization of Particle related Animation data"); RNA_def_property_ui_icon(prop, ICON_PARTICLE_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_metaballs", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMBA); RNA_def_property_ui_text(prop, "Display Metaball", "Include visualization of Metaball related Animation data"); RNA_def_property_ui_icon(prop, ICON_META_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_armatures", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOARM); RNA_def_property_ui_text(prop, "Display Armature", "Include visualization of Armature related Animation data"); RNA_def_property_ui_icon(prop, ICON_ARMATURE_DATA, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_nodes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NONTREE); RNA_def_property_ui_text(prop, "Display Node", "Include visualization of Node related Animation data"); RNA_def_property_ui_icon(prop, ICON_NODETREE, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_speakers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSPK); RNA_def_property_ui_text(prop, "Display Speaker", "Include visualization of Speaker related Animation data"); RNA_def_property_ui_icon(prop, ICON_SPEAKER, 0); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); } static void rna_def_action_group(BlenderRNA *brna) @@ -447,7 +447,7 @@ static void rna_def_action_group(BlenderRNA *brna) prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); /* WARNING: be very careful when working with this list, since the endpoint is not * defined like a standard ListBase. Adding/removing channels from this list needs @@ -468,22 +468,22 @@ static void rna_def_action_group(BlenderRNA *brna) prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED); RNA_def_property_ui_text(prop, "Select", "Action Group is selected"); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL); prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED); RNA_def_property_ui_text(prop, "Lock", "Action Group is locked"); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED); RNA_def_property_ui_text(prop, "Expanded", "Action Group is expanded"); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "customCol"); RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set"); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); } /* fcurve.keyframe_points */ @@ -512,7 +512,7 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove action group"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "action_group", "ActionGroup", "", "Action group to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop) @@ -543,7 +543,7 @@ static void rna_def_action_fcurves(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove action group"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "fcurve", "FCurve", "", "F-Curve to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop) @@ -571,7 +571,7 @@ static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove a timeline marker"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "TimelineMarker"); diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 3b89899702d..bb714043002 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -59,15 +59,16 @@ EnumPropertyItem actuator_type_items[] = { {ACT_STATE, "STATE", 0, "State", ""}, {ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""}, {ACT_STEERING, "STEERING", 0, "Steering", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME #include "BKE_sca.h" -static StructRNA* rna_Actuator_refine(struct PointerRNA *ptr) +static StructRNA *rna_Actuator_refine(struct PointerRNA *ptr) { - bActuator *actuator = (bActuator*)ptr->data; + bActuator *actuator = (bActuator *)ptr->data; switch (actuator->type) { case ACT_ACTION: @@ -139,185 +140,185 @@ static void rna_ConstraintActuator_type_set(struct PointerRNA *ptr, int value) if (value != ca->type) { ca->type = value; switch (ca->type) { - case ACT_CONST_TYPE_ORI: - /* negative axis not supported in the orientation mode */ - if (ELEM3(ca->mode, ACT_CONST_DIRNX, ACT_CONST_DIRNY, ACT_CONST_DIRNZ)) - ca->mode = ACT_CONST_NONE; - break; - - case ACT_CONST_TYPE_LOC: - case ACT_CONST_TYPE_DIST: - case ACT_CONST_TYPE_FH: - default: - break; + case ACT_CONST_TYPE_ORI: + /* negative axis not supported in the orientation mode */ + if (ELEM3(ca->mode, ACT_CONST_DIRNX, ACT_CONST_DIRNY, ACT_CONST_DIRNZ)) + ca->mode = ACT_CONST_NONE; + break; + + case ACT_CONST_TYPE_LOC: + case ACT_CONST_TYPE_DIST: + case ACT_CONST_TYPE_FH: + default: + break; } } } static float rna_ConstraintActuator_limitmin_get(struct PointerRNA *ptr) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; if (ca->flag & ACT_CONST_LOCX) fp = ca->minloc; - else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc+1; - else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc+2; + else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc + 1; + else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc + 2; else if (ca->flag & ACT_CONST_ROTX) fp = ca->minrot; - else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot+1; - else fp = ca->minrot+2; + else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot + 1; + else fp = ca->minrot + 2; return *fp; } static void rna_ConstraintActuator_limitmin_set(struct PointerRNA *ptr, float value) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; if (ca->flag & ACT_CONST_LOCX) fp = ca->minloc; - else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc+1; - else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc+2; + else if (ca->flag & ACT_CONST_LOCY) fp = ca->minloc + 1; + else if (ca->flag & ACT_CONST_LOCZ) fp = ca->minloc + 2; else if (ca->flag & ACT_CONST_ROTX) fp = ca->minrot; - else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot+1; - else fp = ca->minrot+2; + else if (ca->flag & ACT_CONST_ROTY) fp = ca->minrot + 1; + else fp = ca->minrot + 2; *fp = value; } static float rna_ConstraintActuator_limitmax_get(struct PointerRNA *ptr) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; if (ca->flag & ACT_CONST_LOCX) fp = ca->maxloc; - else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc+1; - else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc+2; + else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc + 1; + else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc + 2; else if (ca->flag & ACT_CONST_ROTX) fp = ca->maxrot; - else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot+1; - else fp = ca->maxrot+2; + else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot + 1; + else fp = ca->maxrot + 2; return *fp; } static void rna_ConstraintActuator_limitmax_set(struct PointerRNA *ptr, float value) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; if (ca->flag & ACT_CONST_LOCX) fp = ca->maxloc; - else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc+1; - else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc+2; + else if (ca->flag & ACT_CONST_LOCY) fp = ca->maxloc + 1; + else if (ca->flag & ACT_CONST_LOCZ) fp = ca->maxloc + 2; else if (ca->flag & ACT_CONST_ROTX) fp = ca->maxrot; - else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot+1; - else fp = ca->maxrot+2; + else if (ca->flag & ACT_CONST_ROTY) fp = ca->maxrot + 1; + else fp = ca->maxrot + 2; *fp = value; } static float rna_ConstraintActuator_distance_get(struct PointerRNA *ptr) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; - if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc; - else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1; - else fp = ca->minloc+2; + if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc; + else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1; + else fp = ca->minloc + 2; return *fp; } static void rna_ConstraintActuator_distance_set(struct PointerRNA *ptr, float value) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; - if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc; - else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1; - else fp = ca->minloc+2; + if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc; + else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1; + else fp = ca->minloc + 2; *fp = value; } static float rna_ConstraintActuator_range_get(struct PointerRNA *ptr) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; - if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc; - else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1; - else fp = ca->maxloc+2; + if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc; + else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1; + else fp = ca->maxloc + 2; return *fp; } static void rna_ConstraintActuator_range_set(struct PointerRNA *ptr, float value) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; - if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc; - else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1; - else fp = ca->maxloc+2; + if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc; + else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1; + else fp = ca->maxloc + 2; *fp = value; } static float rna_ConstraintActuator_fhheight_get(struct PointerRNA *ptr) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; - if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc; - else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1; - else fp = ca->minloc+2; + if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc; + else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1; + else fp = ca->minloc + 2; return *fp; } static void rna_ConstraintActuator_fhheight_set(struct PointerRNA *ptr, float value) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; - if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->minloc; - else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->minloc+1; - else fp = ca->minloc+2; + if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->minloc; + else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->minloc + 1; + else fp = ca->minloc + 2; *fp = value; } static float rna_ConstraintActuator_spring_get(struct PointerRNA *ptr) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; - if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc; - else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1; - else fp = ca->maxloc+2; + if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc; + else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1; + else fp = ca->maxloc + 2; return *fp; } static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float value) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; float *fp; - if (ca->mode & (ACT_CONST_DIRPX|ACT_CONST_DIRNX)) fp = ca->maxloc; - else if (ca->mode & (ACT_CONST_DIRPY|ACT_CONST_DIRNY)) fp = ca->maxloc+1; - else fp = ca->maxloc+2; + if (ca->mode & (ACT_CONST_DIRPX | ACT_CONST_DIRNX)) fp = ca->maxloc; + else if (ca->mode & (ACT_CONST_DIRPY | ACT_CONST_DIRNY)) fp = ca->maxloc + 1; + else fp = ca->maxloc + 2; *fp = value; } @@ -325,10 +326,10 @@ static void rna_ConstraintActuator_spring_set(struct PointerRNA *ptr, float valu * Therefore we need to clear the property when "use_material_detect" mode changes */ static void rna_Actuator_constraint_detect_material_set(struct PointerRNA *ptr, int value) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bConstraintActuator *ca = act->data; - short old_value = (ca->flag & ACT_CONST_MATERIAL? 1:0); + short old_value = (ca->flag & ACT_CONST_MATERIAL ? 1 : 0); if (old_value != value) { ca->flag ^= ACT_CONST_MATERIAL; @@ -371,51 +372,51 @@ static void rna_ObjectActuator_type_set(struct PointerRNA *ptr, int value) if (value != oa->type) { oa->type = value; switch (oa->type) { - case ACT_OBJECT_NORMAL: - memset(oa, 0, sizeof(bObjectActuator)); - oa->flag = ACT_FORCE_LOCAL|ACT_TORQUE_LOCAL|ACT_DLOC_LOCAL|ACT_DROT_LOCAL; - oa->type = ACT_OBJECT_NORMAL; - break; - - case ACT_OBJECT_SERVO: - memset(oa, 0, sizeof(bObjectActuator)); - oa->flag = ACT_LIN_VEL_LOCAL; - oa->type = ACT_OBJECT_SERVO; - oa->forcerot[0] = 30.0f; - oa->forcerot[1] = 0.5f; - oa->forcerot[2] = 0.0f; - break; + case ACT_OBJECT_NORMAL: + memset(oa, 0, sizeof(bObjectActuator)); + oa->flag = ACT_FORCE_LOCAL | ACT_TORQUE_LOCAL | ACT_DLOC_LOCAL | ACT_DROT_LOCAL; + oa->type = ACT_OBJECT_NORMAL; + break; + + case ACT_OBJECT_SERVO: + memset(oa, 0, sizeof(bObjectActuator)); + oa->flag = ACT_LIN_VEL_LOCAL; + oa->type = ACT_OBJECT_SERVO; + oa->forcerot[0] = 30.0f; + oa->forcerot[1] = 0.5f; + oa->forcerot[2] = 0.0f; + break; } } } static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, float value) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bObjectActuator *oa = act->data; oa->forcerot[1] = value; - oa->forcerot[0] = 60.0f*oa->forcerot[1]; + oa->forcerot[0] = 60.0f * oa->forcerot[1]; } static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values) { - bActuator *act = (bActuator*)ptr->data; + bActuator *act = (bActuator *)ptr->data; bStateActuator *sa = act->data; int i, tot = 0; /* ensure we always have some state selected */ - for (i = 0; imask |= (1<mask &= ~(1<mask |= (1 << i); + else sa->mask &= ~(1 << i); } } @@ -500,10 +501,10 @@ static void rna_Actuator_Armature_update(Main *UNUSED(bmain), Scene *UNUSED(scen static void rna_SteeringActuator_navmesh_set(PointerRNA *ptr, PointerRNA value) { - bActuator *act = (bActuator*)ptr->data; - bSteeringActuator *sa = (bSteeringActuator*) act->data; + bActuator *act = (bActuator *)ptr->data; + bSteeringActuator *sa = (bSteeringActuator *) act->data; - Object* obj = value.data; + Object *obj = value.data; if (obj && obj->body_type == OB_BODY_TYPE_NAVMESH) sa->navmesh = obj; else @@ -579,7 +580,8 @@ static void rna_def_action_actuator(BlenderRNA *brna) #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR {ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""}, #endif - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ActionActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Action Actuator", "Actuator to control the object movement"); @@ -691,12 +693,13 @@ static void rna_def_action_actuator(BlenderRNA *brna) static void rna_def_object_actuator(BlenderRNA *brna) { StructRNA *srna; - PropertyRNA* prop; + PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { {ACT_OBJECT_NORMAL, "OBJECT_NORMAL", 0, "Simple Motion", ""}, {ACT_OBJECT_SERVO, "OBJECT_SERVO", 0, "Servo Control", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ObjectActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Motion Actuator", "Actuator to control the object movement"); @@ -887,7 +890,8 @@ static void rna_def_camera_actuator(BlenderRNA *brna) {OB_POSY, "POS_Y", 0, "+Y", "Camera tries to get behind the Y axis"}, {OB_NEGX, "NEG_X", 0, "-X", "Camera tries to get behind the -X axis"}, {OB_NEGY, "NEG_Y", 0, "-Y", "Camera tries to get behind the -Y axis"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "CameraActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Camera Actuator", ""); @@ -1310,15 +1314,17 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna) {ACT_EDOB_ENABLE_RB, "ENABLERIGIDBODY", 0, "Enable Rigid Body", ""}, {ACT_EDOB_DISABLE_RB, "DISABLERIGIDBODY", 0, "Disable Rigid Body", ""}, {ACT_EDOB_SET_MASS, "SETMASS", 0, "Set Mass", ""}, - {0, NULL, 0, NULL, NULL} }; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_type_items[] = { - {ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""}, - {ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""}, - {ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""}, - {ACT_EDOB_TRACK_TO, "TRACKTO", 0, "Track to", ""}, - {ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""}, - {0, NULL, 0, NULL, NULL} }; + {ACT_EDOB_ADD_OBJECT, "ADDOBJECT", 0, "Add Object", ""}, + {ACT_EDOB_END_OBJECT, "ENDOBJECT", 0, "End Object", ""}, + {ACT_EDOB_REPLACE_MESH, "REPLACEMESH", 0, "Replace Mesh", ""}, + {ACT_EDOB_TRACK_TO, "TRACKTO", 0, "Track to", ""}, + {ACT_EDOB_DYNAMICS, "DYNAMICS", 0, "Dynamics", ""}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "EditObjectActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Edit Object Actuator", "Actuator used to edit objects"); @@ -1427,7 +1433,8 @@ static void rna_def_scene_actuator(BlenderRNA *brna) {ACT_SCENE_REMOVE, "REMOVE", 0, "Remove Scene", ""}, {ACT_SCENE_SUSPEND, "SUSPEND", 0, "Suspend Scene", ""}, {ACT_SCENE_RESUME, "RESUME", 0, "Resume Scene", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SceneActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Scene Actuator", ""); @@ -1469,7 +1476,8 @@ static void rna_def_random_actuator(BlenderRNA *brna) {ACT_RANDOM_FLOAT_UNIFORM, "FLOAT_UNIFORM", 0, "Float Uniform", ""}, {ACT_RANDOM_FLOAT_NORMAL, "FLOAT_NORMAL", 0, "Float Normal", ""}, {ACT_RANDOM_FLOAT_NEGATIVE_EXPONENTIAL, "FLOAT_NEGATIVE_EXPONENTIAL", 0, "Float Neg. Exp.", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "RandomActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Random Actuator", ""); @@ -1588,7 +1596,8 @@ static void rna_def_message_actuator(BlenderRNA *brna) static EnumPropertyItem prop_body_type_items[] = { {ACT_MESG_MESG, "TEXT", 0, "Text", ""}, {ACT_MESG_PROP, "PROPERTY", 0, "Property", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MessageActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Message Actuator", ""); @@ -1638,7 +1647,8 @@ static void rna_def_game_actuator(BlenderRNA *brna) {ACT_GAME_QUIT, "QUIT", 0, "Quit Game", ""}, {ACT_GAME_SAVECFG, "SAVECFG", 0, "Save bge.logic.globalDict", ""}, {ACT_GAME_LOADCFG, "LOADCFG", 0, "Load bge.logic.globalDict", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "GameActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Game Actuator", ""); @@ -1711,7 +1721,8 @@ static void rna_def_twodfilter_actuator(BlenderRNA *brna) {ACT_2DFILTER_INVERT, "INVERT", 0, "Invert", ""}, {ACT_2DFILTER_CUSTOMFILTER, "CUSTOMFILTER", 0, "Custom Filter", ""}, /* {ACT_2DFILTER_NUMBER_OF_FILTERS, "", 0, "Do not use it. Sentinel", ""}, */ - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Filter2DActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Filter 2D Actuator", "Actuator to apply screen graphic effects"); @@ -1757,7 +1768,8 @@ static void rna_def_parent_actuator(BlenderRNA *brna) static EnumPropertyItem prop_type_items[] = { {ACT_PARENT_SET, "SETPARENT", 0, "Set Parent", ""}, {ACT_PARENT_REMOVE, "REMOVEPARENT", 0, "Remove Parent", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ParentActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Parent Actuator", ""); @@ -1805,7 +1817,8 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna) #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR {ACT_ACTION_MOTION, "MOTION", 0, "Displacement", ""}, #endif - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ShapeActionActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Shape Action Actuator", "Actuator to control shape key animations"); @@ -1886,7 +1899,8 @@ static void rna_def_state_actuator(BlenderRNA *brna) {ACT_STATE_ADD, "ADD", 0, "Add State", ""}, {ACT_STATE_REMOVE, "REMOVE", 0, "Remove State", ""}, {ACT_STATE_CHANGE, "CHANGE", 0, "Change State", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "StateActuator", "Actuator"); RNA_def_struct_ui_text(srna, "State Actuator", "Actuator to handle states"); @@ -1908,7 +1922,7 @@ static void rna_def_state_actuator(BlenderRNA *brna) static void rna_def_armature_actuator(BlenderRNA *brna) { StructRNA *srna; - PropertyRNA* prop; + PropertyRNA *prop; static EnumPropertyItem prop_type_items[] = { {ACT_ARM_RUN, "RUN", 0, "Run Armature", ""}, @@ -1917,7 +1931,8 @@ static void rna_def_armature_actuator(BlenderRNA *brna) {ACT_ARM_SETTARGET, "SETTARGET", 0, "Set Target", ""}, {ACT_ARM_SETWEIGHT, "SETWEIGHT", 0, "Set Weight", ""}, {ACT_ARM_SETINFLUENCE, "SETINFLUENCE", 0, "Set Influence", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ArmatureActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Armature Actuator", ""); @@ -1976,7 +1991,8 @@ static void rna_def_steering_actuator(BlenderRNA *brna) {ACT_STEERING_SEEK, "SEEK", 0, "Seek", ""}, {ACT_STEERING_FLEE, "FLEE", 0, "Flee", ""}, {ACT_STEERING_PATHFOLLOWING, "PATHFOLLOWING", 0, "Path following", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem facingaxis_items[] = { {1, "X", 0, "X", ""}, @@ -1985,7 +2001,8 @@ static void rna_def_steering_actuator(BlenderRNA *brna) {4, "NEG_X", 0, "-X", ""}, {5, "NEG_Y", 0, "-Y", ""}, {6, "NEG_Z", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SteeringActuator", "Actuator"); RNA_def_struct_ui_text(srna, "Steering Actuator", ""); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 7f52456355c..7a8f48705a4 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -48,7 +48,8 @@ EnumPropertyItem keyingset_path_grouping_items[] = { {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""}, {KSP_GROUP_NONE, "NONE", 0, "None", ""}, {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -92,6 +93,7 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C) func = &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ RNA_parameter_list_create(&list, &ptr, func); + { /* hook up arguments */ RNA_parameter_set_lookup(&list, "ksi", &ksi); RNA_parameter_set_lookup(&list, "context", &C); @@ -101,7 +103,8 @@ static int RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C) /* read the result */ RNA_parameter_get_lookup(&list, "ok", &ret); - ok = *(int*)ret; + ok = *(int *)ret; + } RNA_parameter_list_free(&list); return ok; @@ -120,6 +123,7 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks func = &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */ RNA_parameter_list_create(&list, &ptr, func); + { /* hook up arguments */ RNA_parameter_set_lookup(&list, "ksi", &ksi); RNA_parameter_set_lookup(&list, "context", &C); @@ -127,6 +131,7 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks /* execute the function */ ksi->ext.call(C, &ptr, func, &list); + } RNA_parameter_list_free(&list); } @@ -143,6 +148,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, func = &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */ RNA_parameter_list_create(&list, &ptr, func); + { /* hook up arguments */ RNA_parameter_set_lookup(&list, "ksi", &ksi); RNA_parameter_set_lookup(&list, "context", &C); @@ -151,6 +157,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, /* execute the function */ ksi->ext.call(C, &ptr, func, &list); + } RNA_parameter_list_free(&list); } @@ -160,7 +167,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks, static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr) { KeyingSetInfo *ksi = (KeyingSetInfo *)ptr->data; - return (ksi->ext.srna)? ksi->ext.srna: &RNA_KeyingSetInfo; + return (ksi->ext.srna) ? ksi->ext.srna : &RNA_KeyingSetInfo; } static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type) @@ -218,9 +225,9 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v /* set callbacks */ /* NOTE: we really should have all of these... */ - ksi->poll = (have_function[0])? RKS_POLL_rna_internal: NULL; - ksi->iter = (have_function[1])? RKS_ITER_rna_internal: NULL; - ksi->generate = (have_function[2])? RKS_GEN_rna_internal: NULL; + ksi->poll = (have_function[0]) ? RKS_POLL_rna_internal : NULL; + ksi->iter = (have_function[1]) ? RKS_ITER_rna_internal : NULL; + ksi->generate = (have_function[2]) ? RKS_GEN_rna_internal : NULL; /* add and register with other info as needed */ ANIM_keyingset_info_register(ksi); @@ -233,19 +240,19 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain, ReportList *reports, v static StructRNA *rna_ksPath_id_typef(PointerRNA *ptr) { - KS_Path *ksp = (KS_Path*)ptr->data; + KS_Path *ksp = (KS_Path *)ptr->data; return ID_code_to_RNA_type(ksp->idtype); } static int rna_ksPath_id_editable(PointerRNA *ptr) { - KS_Path *ksp = (KS_Path*)ptr->data; - return (ksp->idtype)? PROP_EDITABLE : 0; + KS_Path *ksp = (KS_Path *)ptr->data; + return (ksp->idtype) ? PROP_EDITABLE : 0; } static void rna_ksPath_id_type_set(PointerRNA *ptr, int value) { - KS_Path *data = (KS_Path*)(ptr->data); + KS_Path *data = (KS_Path *)(ptr->data); /* set the driver type, then clear the id-block if the type is invalid */ data->idtype = value; @@ -299,26 +306,26 @@ static int rna_KeyingSet_active_ksPath_editable(PointerRNA *ptr) static PointerRNA rna_KeyingSet_active_ksPath_get(PointerRNA *ptr) { KeyingSet *ks = (KeyingSet *)ptr->data; - return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetPath, BLI_findlink(&ks->paths, ks->active_path-1)); + return rna_pointer_inherit_refine(ptr, &RNA_KeyingSetPath, BLI_findlink(&ks->paths, ks->active_path - 1)); } static void rna_KeyingSet_active_ksPath_set(PointerRNA *ptr, PointerRNA value) { KeyingSet *ks = (KeyingSet *)ptr->data; - KS_Path *ksp = (KS_Path*)value.data; + KS_Path *ksp = (KS_Path *)value.data; ks->active_path = BLI_findindex(&ks->paths, ksp) + 1; } static int rna_KeyingSet_active_ksPath_index_get(PointerRNA *ptr) { KeyingSet *ks = (KeyingSet *)ptr->data; - return MAX2(ks->active_path-1, 0); + return MAX2(ks->active_path - 1, 0); } static void rna_KeyingSet_active_ksPath_index_set(PointerRNA *ptr, int value) { KeyingSet *ks = (KeyingSet *)ptr->data; - ks->active_path = value+1; + ks->active_path = value + 1; } static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) @@ -326,7 +333,7 @@ static void rna_KeyingSet_active_ksPath_index_range(PointerRNA *ptr, int *min, i KeyingSet *ks = (KeyingSet *)ptr->data; *min = 0; - *max = BLI_countlist(&ks->paths)-1; + *max = BLI_countlist(&ks->paths) - 1; *max = MAX2(0, *max); } @@ -344,7 +351,7 @@ static PointerRNA rna_KeyingSet_typeinfo_get(PointerRNA *ptr) static KS_Path *rna_KeyingSet_paths_add(KeyingSet *keyingset, ReportList *reports, - ID *id, const char rna_path[], int index, int group_method, const char group_name[]) + ID *id, const char rna_path[], int index, int group_method, const char group_name[]) { KS_Path *ksp = NULL; short flag = 0; @@ -409,7 +416,7 @@ static NlaTrack *rna_NlaTrack_new(AnimData *adt, bContext *C, NlaTrack *track) { NlaTrack *new_track = add_nlatrack(adt, track); - WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_ADDED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); return new_track; } @@ -418,20 +425,20 @@ static void rna_NlaTrack_remove(AnimData *adt, bContext *C, NlaTrack *track) { free_nlatrack(&adt->nla_tracks, track); - WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_REMOVED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_REMOVED, NULL); } static PointerRNA rna_NlaTrack_active_get(PointerRNA *ptr) { - AnimData *adt = (AnimData*)ptr->data; + AnimData *adt = (AnimData *)ptr->data; NlaTrack *track = BKE_nlatrack_find_active(&adt->nla_tracks); return rna_pointer_inherit_refine(ptr, &RNA_NlaTrack, track); } static void rna_NlaTrack_active_set(PointerRNA *ptr, PointerRNA value) { - AnimData *adt = (AnimData*)ptr->data; - NlaTrack *track = (NlaTrack*)value.data; + AnimData *adt = (AnimData *)ptr->data; + NlaTrack *track = (NlaTrack *)value.data; BKE_nlatrack_set_active(&adt->nla_tracks, track); } @@ -461,29 +468,31 @@ static void rna_def_common_keying_flags(StructRNA *srna, short reg) PropertyRNA *prop; static EnumPropertyItem keying_flag_items[] = { - {INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, "Insert Keyframes - Only Needed", - "Only insert keyframes where they're needed in the relevant F-Curves"}, - {INSERTKEY_MATRIX, "INSERTKEY_VISUAL", 0, "Insert Keyframes - Visual", - "Insert keyframes based on 'visual transforms'"}, - {INSERTKEY_XYZ2RGB, "INSERTKEY_XYZ_TO_RGB", 0, "F-Curve Colors - XYZ to RGB", - "Color for newly added transformation F-Curves (Location, Rotation, Scale) " - "and also Color is based on the transform axis"}, - {0, NULL, 0, NULL, NULL}}; + {INSERTKEY_NEEDED, "INSERTKEY_NEEDED", 0, "Insert Keyframes - Only Needed", + "Only insert keyframes where they're needed in the relevant F-Curves"}, + {INSERTKEY_MATRIX, "INSERTKEY_VISUAL", 0, "Insert Keyframes - Visual", + "Insert keyframes based on 'visual transforms'"}, + {INSERTKEY_XYZ2RGB, "INSERTKEY_XYZ_TO_RGB", 0, "F-Curve Colors - XYZ to RGB", + "Color for newly added transformation F-Curves (Location, Rotation, Scale) " + "and also Color is based on the transform axis"}, + {0, NULL, 0, NULL, NULL} + }; prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "keyingflag"); RNA_def_property_enum_items(prop, keying_flag_items); - RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL|PROP_ENUM_FLAG); + RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG); RNA_def_property_ui_text(prop, "Options", "Keying set options"); } /* --- */ /* To avoid repeating it twice! */ -#define KEYINGSET_IDNAME_DOC "If this is set, the Keying Set gets a custom ID, otherwise it takes " \ - "the name of the class used to define the Keying Set (for example, " \ - "if the class name is \"BUILTIN_KSI_location\", and bl_idname is not " \ - "set by the script, then bl_idname = \"BUILTIN_KSI_location\")" +#define KEYINGSET_IDNAME_DOC \ + "If this is set, the Keying Set gets a custom ID, otherwise it takes " \ + "the name of the class used to define the Keying Set (for example, " \ + "if the class name is \"BUILTIN_KSI_location\", and bl_idname is not " \ + "set by the script, then bl_idname = \"BUILTIN_KSI_location\")" static void rna_def_keyingset_info(BlenderRNA *brna) @@ -505,7 +514,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "idname"); - RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); + RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP); RNA_def_property_ui_text(prop, "ID Name", KEYINGSET_IDNAME_DOC); prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); @@ -525,7 +534,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) RNA_define_verify_sdna(1); /* Function Callbacks ------------- */ - /* poll */ + /* poll */ func = RNA_def_function(srna, "poll", NULL); RNA_def_function_ui_description(func, "Test if Keying Set can be used or not"); RNA_def_function_flag(func, FUNC_REGISTER); @@ -533,7 +542,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) parm = RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); - /* iterator */ + /* iterator */ func = RNA_def_function(srna, "iterator", NULL); RNA_def_function_ui_description(func, "Call generate() on the structs which have properties to be keyframed"); RNA_def_function_flag(func, FUNC_REGISTER); @@ -542,7 +551,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) parm = RNA_def_pointer(func, "ks", "KeyingSet", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); - /* generate */ + /* generate */ func = RNA_def_function(srna, "generate", NULL); RNA_def_function_ui_description(func, "Add Paths to the Keying Set to keyframe the properties of the given data"); RNA_def_function_flag(func, FUNC_REGISTER); @@ -551,7 +560,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) parm = RNA_def_pointer(func, "ks", "KeyingSet", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_pointer(func, "data", "AnyType", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_RNAPTR | PROP_NEVER_NULL); } static void rna_def_keyingset_path(BlenderRNA *brna) @@ -572,7 +581,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna) RNA_def_property_ui_text(prop, "ID-Block", "ID-Block that keyframes for Keying Set should be added to " "(for Absolute Keying Sets only)"); - RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ + RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "idtype"); @@ -580,19 +589,19 @@ static void rna_def_keyingset_path(BlenderRNA *brna) RNA_def_property_enum_default(prop, ID_OB); RNA_def_property_enum_funcs(prop, NULL, "rna_ksPath_id_type_set", NULL); RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used"); - RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ + RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ /* Group */ prop = RNA_def_property(srna, "group", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Group Name", "Name of Action Group to assign setting(s) for this path to"); - RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ + RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ /* Grouping */ prop = RNA_def_property(srna, "group_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "groupmode"); RNA_def_property_enum_items(prop, keyingset_path_grouping_items); RNA_def_property_ui_text(prop, "Grouping Method", "Method used to define which Group-name to use"); - RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ + RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ /* Path + Array Index */ prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE); @@ -600,12 +609,12 @@ static void rna_def_keyingset_path(BlenderRNA *brna) "rna_ksPath_RnaPath_set"); RNA_def_property_ui_text(prop, "Data Path", "Path to property setting"); RNA_def_struct_name_property(srna, prop); /* XXX this is the best indicator for now... */ - RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* called 'index' when given as function arg */ prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific setting if applicable"); - RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ + RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ /* Flags */ prop = RNA_def_property(srna, "use_entire_array", PROP_BOOLEAN, PROP_NONE); @@ -613,7 +622,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), " "entire array is to be used"); - RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ + RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_EDITED, NULL); /* XXX: maybe a bit too noisy */ /* Keyframing Settings */ rna_def_common_keying_flags(srna, 0); @@ -640,21 +649,21 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "add", "rna_KeyingSet_paths_add"); RNA_def_function_ui_description(func, "Add a new path for the Keying Set"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - /* return arg */ + /* return arg */ parm = RNA_def_pointer(func, "ksp", "KeyingSetPath", "New Path", "Path created and added to the Keying Set"); - RNA_def_function_return(func, parm); - /* ID-block for target */ + RNA_def_function_return(func, parm); + /* ID-block for target */ parm = RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination"); - RNA_def_property_flag(parm, PROP_REQUIRED); - /* rna-path */ - /* XXX hopefully this is long enough */ + RNA_def_property_flag(parm, PROP_REQUIRED); + /* rna-path */ + /* XXX hopefully this is long enough */ parm = RNA_def_string(func, "data_path", "", 256, "Data-Path", "RNA-Path to destination property"); - RNA_def_property_flag(parm, PROP_REQUIRED); - /* index (defaults to -1 for entire array) */ + RNA_def_property_flag(parm, PROP_REQUIRED); + /* index (defaults to -1 for entire array) */ RNA_def_int(func, "index", -1, -1, INT_MAX, "Index", "The index of the destination property (i.e. axis of Location/Rotation/etc.), " "or -1 for the entire array", 0, INT_MAX); - /* grouping */ + /* grouping */ RNA_def_enum(func, "group_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use"); RNA_def_string(func, "group_name", "", 64, "Group Name", @@ -665,9 +674,9 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "remove", "rna_KeyingSet_paths_remove"); RNA_def_function_ui_description(func, "Remove the given path from the Keying Set"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - /* path to remove */ + /* path to remove */ parm = RNA_def_pointer(func, "path", "KeyingSetPath", "Path", ""); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); /* Remove All Paths */ @@ -701,9 +710,9 @@ static void rna_def_keyingset(BlenderRNA *brna) /* Id/Label. */ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "idname"); - RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); + RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP); RNA_def_property_ui_text(prop, "ID Name", KEYINGSET_IDNAME_DOC); - RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET|NA_RENAME, NULL); + RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_RENAME, NULL); prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); @@ -775,7 +784,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Remove a NLA Track"); parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "NlaTrack"); @@ -783,7 +792,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint"); /* XXX: should (but doesn't) update the active track in the NLA window */ - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA|NA_SELECTED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_SELECTED, NULL); } static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop) @@ -836,8 +845,8 @@ void rna_def_animdata(BlenderRNA *brna) /* Active Action */ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); - /* this flag as well as the dynamic test must be defined for this to be editable... */ - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_REFCOUNT); + /* this flag as well as the dynamic test must be defined for this to be editable... */ + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL, "rna_Action_id_poll"); RNA_def_property_editable_func(prop, "rna_AnimData_action_editable"); RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock"); @@ -849,14 +858,14 @@ void rna_def_animdata(BlenderRNA *brna) RNA_def_property_enum_items(prop, nla_mode_extend_items); RNA_def_property_ui_text(prop, "Action Extrapolation", "Action to take for gaps past the Active Action's range (when evaluating with NLA)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "action_blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "act_blendmode"); RNA_def_property_enum_items(prop, nla_mode_blend_items); RNA_def_property_ui_text(prop, "Action Blending", "Method used for combining Active Action's result with result of NLA stack"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "action_influence", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "act_influence"); @@ -864,7 +873,7 @@ void rna_def_animdata(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Action Influence", "Amount the Active Action contributes to the result of the NLA stack"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ /* Drivers */ prop = RNA_def_property(srna, "drivers", PROP_COLLECTION, PROP_NONE); @@ -878,7 +887,7 @@ void rna_def_animdata(BlenderRNA *brna) prop = RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF); RNA_def_property_ui_text(prop, "NLA Evaluation Enabled", "NLA stack is evaluated when evaluating this block"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ } /* --- */ diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c index c3c4a1355fd..32472c8d415 100644 --- a/source/blender/makesrna/intern/rna_animation_api.c +++ b/source/blender/makesrna/intern/rna_animation_api.c @@ -77,7 +77,7 @@ void RNA_api_keyingset(StructRNA *srna) RNA_def_function_ui_description(func, "Refresh Keying Set to ensure that it is valid for the current context " "(call before each use of one)"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); } #endif diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c index 167eb23c023..990d7c43309 100644 --- a/source/blender/makesrna/intern/rna_animviz.c +++ b/source/blender/makesrna/intern/rna_animviz.c @@ -45,7 +45,8 @@ EnumPropertyItem 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"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -61,7 +62,7 @@ static PointerRNA rna_AnimViz_motion_paths_get(PointerRNA *ptr) static void rna_AnimViz_ghost_start_frame_set(PointerRNA *ptr, int value) { - bAnimVizSettings *data = (bAnimVizSettings*)ptr->data; + bAnimVizSettings *data = (bAnimVizSettings *)ptr->data; CLAMP(value, 1, data->ghost_ef); data->ghost_sf = value; @@ -69,26 +70,26 @@ static void rna_AnimViz_ghost_start_frame_set(PointerRNA *ptr, int value) static void rna_AnimViz_ghost_end_frame_set(PointerRNA *ptr, int value) { - bAnimVizSettings *data = (bAnimVizSettings*)ptr->data; + bAnimVizSettings *data = (bAnimVizSettings *)ptr->data; - CLAMP(value, data->ghost_sf, (int)(MAXFRAMEF/2)); + CLAMP(value, data->ghost_sf, (int)(MAXFRAMEF / 2)); data->ghost_ef = value; } static void rna_AnimViz_path_start_frame_set(PointerRNA *ptr, int value) { - bAnimVizSettings *data = (bAnimVizSettings*)ptr->data; + bAnimVizSettings *data = (bAnimVizSettings *)ptr->data; - CLAMP(value, 1, data->path_ef-1); + CLAMP(value, 1, data->path_ef - 1); data->path_sf = value; } static void rna_AnimViz_path_end_frame_set(PointerRNA *ptr, int value) { - bAnimVizSettings *data = (bAnimVizSettings*)ptr->data; + bAnimVizSettings *data = (bAnimVizSettings *)ptr->data; /* XXX: watchit! Path Start > MAXFRAME/2 could be a problem... */ - CLAMP(value, data->path_sf+1, (int)(MAXFRAMEF/2)); + CLAMP(value, data->path_sf + 1, (int)(MAXFRAMEF / 2)); data->path_ef = value; } @@ -175,7 +176,8 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) {GHOST_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Current Frame", "Show ghosts from around the current frame"}, {GHOST_TYPE_RANGE, "RANGE", 0, "In Range", "Show ghosts for the specified frame range"}, {GHOST_TYPE_KEYS, "KEYS", 0, "On Keyframes", "Show ghosts on keyframes"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "AnimVizOnionSkinning", NULL); @@ -188,21 +190,21 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "ghost_type"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Method used for determining what ghosts get drawn"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ /* Settings */ prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ghost_flag", GHOST_FLAG_ONLYSEL); RNA_def_property_ui_text(prop, "On Selected Bones Only", "For Pose-Mode drawing, only draw ghosts for selected bones"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghost_step"); RNA_def_property_range(prop, 1, 20); RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between ghosts shown (not for 'On Keyframes' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ /* Playback Ranges */ prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); @@ -211,7 +213,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of Ghosts to display " "(not for 'Around Current Frame' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghost_ef"); @@ -219,7 +221,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) RNA_def_property_ui_text(prop, "End Frame", "End frame of range of Ghosts to display " "(not for 'Around Current Frame' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ /* Around Current Ranges */ prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME); @@ -228,7 +230,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame " "(only for 'Around Current Frame' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghost_ac"); @@ -236,7 +238,7 @@ static void rna_def_animviz_ghosts(BlenderRNA *brna) RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame " "(only for 'Around Current Frame' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ } static void rna_def_animviz_paths(BlenderRNA *brna) @@ -246,9 +248,10 @@ static void rna_def_animviz_paths(BlenderRNA *brna) static const EnumPropertyItem prop_type_items[] = { {MOTIONPATH_TYPE_ACFRA, "CURRENT_FRAME", 0, "Around Frame", - "Display Paths of poses within a fixed number of frames around the current frame"}, + "Display Paths of poses within a fixed number of frames around the current frame"}, {MOTIONPATH_TYPE_RANGE, "RANGE", 0, "In Range", "Display Paths of poses within specified range"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "AnimVizMotionPaths", NULL); RNA_def_struct_sdna(srna, "bAnimVizSettings"); @@ -260,43 +263,43 @@ static void rna_def_animviz_paths(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "path_type"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Paths Type", "Type of range to show for Motion Paths"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "bake_location", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "path_bakeflag"); RNA_def_property_enum_items(prop, motionpath_bake_location_items); RNA_def_property_ui_text(prop, "Bake Location", "When calculating Bone Paths, use Head or Tips"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ /* Settings */ prop = RNA_def_property(srna, "show_frame_numbers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_FNUMS); RNA_def_property_ui_text(prop, "Show Frame Numbers", "Show frame numbers on Motion Paths"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "show_keyframe_highlight", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFRAS); RNA_def_property_ui_text(prop, "Highlight Keyframes", "Emphasize position of keyframes on Motion Paths"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "show_keyframe_numbers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFNOS); RNA_def_property_ui_text(prop, "Show Keyframe Numbers", "Show frame numbers of Keyframes on Motion Paths"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "show_keyframe_action_all", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFACT); RNA_def_property_ui_text(prop, "All Action Keyframes", "For bone motion paths, search whole Action for keyframes instead of in group" " with matching name only (is slower)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "path_step"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Frame Step", "Number of frames between paths shown (not for 'On Keyframes' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ /* Playback Ranges */ @@ -306,7 +309,7 @@ static void rna_def_animviz_paths(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Start Frame", "Starting frame of range of paths to display/calculate " "(not for 'Around Current Frame' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "path_ef"); @@ -314,24 +317,24 @@ static void rna_def_animviz_paths(BlenderRNA *brna) RNA_def_property_ui_text(prop, "End Frame", "End frame of range of paths to display/calculate " "(not for 'Around Current Frame' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ /* Around Current Ranges */ prop = RNA_def_property(srna, "frame_before", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "path_bc"); - RNA_def_property_range(prop, 1, MAXFRAMEF/2); + RNA_def_property_range(prop, 1, MAXFRAMEF / 2); RNA_def_property_ui_text(prop, "Before Current", "Number of frames to show before the current frame " "(only for 'Around Current Frame' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ prop = RNA_def_property(srna, "frame_after", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "path_ac"); - RNA_def_property_range(prop, 1, MAXFRAMEF/2); + RNA_def_property_range(prop, 1, MAXFRAMEF / 2); RNA_def_property_ui_text(prop, "After Current", "Number of frames to show after the current frame " "(only for 'Around Current Frame' Onion-skinning method)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */ } /* --- */ @@ -375,8 +378,8 @@ static void rna_def_animviz(BlenderRNA *brna) void RNA_def_animviz(BlenderRNA *brna) { rna_def_animviz(brna); - rna_def_animviz_ghosts(brna); - rna_def_animviz_paths(brna); + rna_def_animviz_ghosts(brna); + rna_def_animviz_paths(brna); rna_def_animviz_motion_path(brna); rna_def_animviz_motionpath_vert(brna); diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index c97a4751135..45887a2264d 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -55,14 +55,14 @@ static void rna_Armature_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), ID *id = ptr->id.data; DAG_id_tag_update(id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); /*WM_main_add_notifier(NC_OBJECT|ND_POSE, NULL); */ } static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value) { - bArmature *arm = (bArmature*)ptr->data; + bArmature *arm = (bArmature *)ptr->data; if (value.id.data == NULL && value.data == NULL) { arm->act_bone = NULL; @@ -84,7 +84,7 @@ static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value) static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value) { - bArmature *arm = (bArmature*)ptr->data; + bArmature *arm = (bArmature *)ptr->data; if (value.id.data == NULL && value.data == NULL) { arm->act_edbone = NULL; @@ -103,7 +103,7 @@ static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value) EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const char *name) { if (arm->edbo == NULL) { - BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone", arm->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone", arm->id.name + 2); return NULL; } return ED_armature_edit_bone_add(arm, name); @@ -112,12 +112,12 @@ EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, EditBone *ebone) { if (arm->edbo == NULL) { - BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone", arm->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone", arm->id.name + 2); return; } if (BLI_findindex(arm->edbo, ebone) == -1) { - BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'", arm->id.name+2, ebone->name); + BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'", arm->id.name + 2, ebone->name); return; } @@ -135,19 +135,19 @@ static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), Pointe if (ob->data == arm && ob->pose) ob->pose->proxy_layer = arm->layer; - WM_main_add_notifier(NC_GEOM|ND_DATA, arm); + WM_main_add_notifier(NC_GEOM | ND_DATA, arm); } static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = ptr->id.data; - WM_main_add_notifier(NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); } static char *rna_Bone_path(PointerRNA *ptr) { - Bone *bone = (Bone*)ptr->data; + Bone *bone = (Bone *)ptr->data; /* special exception for trying to get the path where ID-block is Object * - this will be assumed to be from a Pose Bone... @@ -192,60 +192,60 @@ static void rna_bone_layer_set(int *layer, const int *values) int i, tot = 0; /* ensure we always have some layer selected */ - for (i = 0; i<32; i++) + for (i = 0; i < 32; i++) if (values[i]) tot++; if (tot == 0) return; - for (i = 0; i<32; i++) { - if (values[i]) *layer |= (1<data; + Bone *bone = (Bone *)ptr->data; rna_bone_layer_set(&bone->layer, values); } static void rna_Armature_layer_set(PointerRNA *ptr, const int *values) { - bArmature *arm = (bArmature*)ptr->data; + bArmature *arm = (bArmature *)ptr->data; int i, tot = 0; /* ensure we always have some layer selected */ - for (i = 0; i<32; i++) + for (i = 0; i < 32; i++) if (values[i]) tot++; if (tot == 0) return; - for (i = 0; i<32; i++) { - if (values[i]) arm->layer |= (1<layer &= ~(1<layer |= (1 << i); + else arm->layer &= ~(1 << i); } } /* XXX depreceated.... old armature only animviz */ static void rna_Armature_ghost_start_frame_set(PointerRNA *ptr, int value) { - bArmature *data = (bArmature*)ptr->data; - CLAMP(value, 1, (int)(MAXFRAMEF/2)); + bArmature *data = (bArmature *)ptr->data; + CLAMP(value, 1, (int)(MAXFRAMEF / 2)); data->ghostsf = value; if (data->ghostsf >= data->ghostef) { - data->ghostef = MIN2(data->ghostsf, (int)(MAXFRAMEF/2)); + data->ghostef = MIN2(data->ghostsf, (int)(MAXFRAMEF / 2)); } } static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value) { - bArmature *data = (bArmature*)ptr->data; - CLAMP(value, 1, (int)(MAXFRAMEF/2)); + bArmature *data = (bArmature *)ptr->data; + CLAMP(value, 1, (int)(MAXFRAMEF / 2)); data->ghostef = value; if (data->ghostsf >= data->ghostef) { @@ -256,8 +256,8 @@ static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value) static void rna_EditBone_name_set(PointerRNA *ptr, const char *value) { - bArmature *arm = (bArmature*)ptr->id.data; - EditBone *ebone = (EditBone*)ptr->data; + bArmature *arm = (bArmature *)ptr->id.data; + EditBone *ebone = (EditBone *)ptr->data; char oldname[sizeof(ebone->name)], newname[sizeof(ebone->name)]; /* need to be on the stack */ @@ -269,8 +269,8 @@ static void rna_EditBone_name_set(PointerRNA *ptr, const char *value) static void rna_Bone_name_set(PointerRNA *ptr, const char *value) { - bArmature *arm = (bArmature*)ptr->id.data; - Bone *bone = (Bone*)ptr->data; + bArmature *arm = (bArmature *)ptr->id.data; + Bone *bone = (Bone *)ptr->data; char oldname[sizeof(bone->name)], newname[sizeof(bone->name)]; /* need to be on the stack */ @@ -282,7 +282,7 @@ static void rna_Bone_name_set(PointerRNA *ptr, const char *value) static void rna_EditBone_layer_set(PointerRNA *ptr, const int values[]) { - EditBone *data = (EditBone*)(ptr->data); + EditBone *data = (EditBone *)(ptr->data); rna_bone_layer_set(&data->layer, values); } @@ -304,7 +304,7 @@ static void rna_EditBone_connected_check(EditBone *ebone) static void rna_EditBone_connected_set(PointerRNA *ptr, int value) { - EditBone *ebone = (EditBone*)(ptr->data); + EditBone *ebone = (EditBone *)(ptr->data); if (value) ebone->flag |= BONE_CONNECTED; else ebone->flag &= ~BONE_CONNECTED; @@ -314,14 +314,14 @@ static void rna_EditBone_connected_set(PointerRNA *ptr, int value) static PointerRNA rna_EditBone_parent_get(PointerRNA *ptr) { - EditBone *data = (EditBone*)(ptr->data); + EditBone *data = (EditBone *)(ptr->data); return rna_pointer_inherit_refine(ptr, &RNA_EditBone, data->parent); } static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value) { - EditBone *ebone = (EditBone*)(ptr->data); - EditBone *pbone, *parbone = (EditBone*)value.data; + EditBone *ebone = (EditBone *)(ptr->data); + EditBone *pbone, *parbone = (EditBone *)value.data; if (parbone == NULL) { if (ebone->parent && !(ebone->parent->flag & BONE_ROOTSEL)) @@ -350,9 +350,9 @@ static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value) static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values) { - EditBone *ebone = (EditBone*)(ptr->data); + EditBone *ebone = (EditBone *)(ptr->data); - float delta[3], tmat[3][3], mat[4][4]; + float delta[3], tmat[3][3], mat[4][4]; /* Find the current bone matrix */ sub_v3_v3v3(delta, ebone->tail, ebone->head); @@ -365,8 +365,8 @@ static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values) static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - bArmature *arm = (bArmature*)ptr->id.data; - EditBone *ebone = (EditBone*)ptr->data; + bArmature *arm = (bArmature *)ptr->id.data; + EditBone *ebone = (EditBone *)ptr->data; EditBone *child, *eboflip; /* update our parent */ @@ -394,7 +394,7 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po /* update our children if necessary */ for (child = arm->edbo->first; child; child = child->next) if (child->parent == eboflip && (child->flag & BONE_CONNECTED)) - copy_v3_v3 (child->head, eboflip->tail); + copy_v3_v3(child->head, eboflip->tail); } } @@ -404,19 +404,19 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po static void rna_Armature_bones_next(CollectionPropertyIterator *iter) { ListBaseIterator *internal = iter->internal; - Bone *bone = (Bone*)internal->link; + Bone *bone = (Bone *)internal->link; if (bone->childbase.first) - internal->link = (Link*)bone->childbase.first; + internal->link = (Link *)bone->childbase.first; else if (bone->next) - internal->link = (Link*)bone->next; + internal->link = (Link *)bone->next; else { internal->link = NULL; do { bone = bone->parent; if (bone && bone->next) { - internal->link = (Link*)bone->next; + internal->link = (Link *)bone->next; break; } } while (bone); @@ -504,7 +504,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* Number values */ - /* envelope deform settings */ + /* envelope deform settings */ prop = RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0f, 1000.0f); @@ -521,7 +521,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_float_sdna(prop, NULL, "rad_head"); - /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */ + /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */ /*RNA_def_property_range(prop, 0, 1000); */ RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Envelope Head Radius", "Radius of head of bone (for Envelope deform only)"); @@ -530,12 +530,12 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_float_sdna(prop, NULL, "rad_tail"); - /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */ + /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */ /*RNA_def_property_range(prop, 0, 1000); */ RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Envelope Tail Radius", "Radius of tail of bone (for Envelope deform only)"); - /* b-bones deform settings */ + /* b-bones deform settings */ prop = RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "segments"); RNA_def_property_range(prop, 1, 32); @@ -580,14 +580,14 @@ static void rna_def_bone(BlenderRNA *brna) RNA_def_struct_idprops_func(srna, "rna_Bone_idprops"); /* pointers/collections */ - /* parent (pointer) */ + /* parent (pointer) */ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_pointer_sdna(prop, NULL, "parent"); RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - /* children (collection) */ + /* children (collection) */ prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL); RNA_def_property_struct_type(prop, "Bone"); @@ -595,8 +595,8 @@ static void rna_def_bone(BlenderRNA *brna) rna_def_bone_common(srna, 0); - /* XXX should we define this in PoseChannel wrapping code instead? - * But PoseChannels directly get some of their flags from here... */ + /* XXX should we define this in PoseChannel wrapping code instead? + * But PoseChannels directly get some of their flags from here... */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P); RNA_def_property_ui_text(prop, "Hide", @@ -745,7 +745,7 @@ static void rna_def_edit_bone(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */ RNA_def_property_ui_text(prop, "Editbone Matrix", "Read-only matrix calculated from the roll (armature space)"); - /* TODO - this could be made writable also */ + /* TODO - this could be made writable also */ RNA_def_property_float_funcs(prop, "rna_EditBone_matrix_get", NULL, NULL); RNA_api_armature_edit_bone(srna); @@ -822,7 +822,7 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove an existing bone from the armature"); /* target to remove*/ parm = RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } static void rna_def_armature(BlenderRNA *brna) @@ -837,21 +837,25 @@ static void rna_def_armature(BlenderRNA *brna) {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Display bones as extruded spheres, showing deformation influence volume"}, {ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_vdeformer[] = { {ARM_VDEF_BLENDER, "BLENDER", 0, "Blender", "Use Blender's armature vertex deformation"}, {ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Use vertex deformation code optimized for the BGE"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_ghost_type_items[] = { {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame"}, {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range"}, {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static const EnumPropertyItem prop_pose_position_items[] = { {0, "POSE", 0, "Pose Position", "Show armature in posed state"}, {ARM_RESTPOS, "REST", 0, "Rest Position", "Show Armature in binding pose state (no posing possible)"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Armature", "ID"); RNA_def_struct_ui_text(srna, "Armature", @@ -908,16 +912,16 @@ static void rna_def_armature(BlenderRNA *brna) /* XXX depreceated ....... old animviz for armatures only */ /* Boolean values */ - /* layer */ + /* layer */ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 32); RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Armature_update_layers"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Armature_update_layers"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - /* layer protection */ + /* layer protection */ prop = RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1); RNA_def_property_array(prop, 32); @@ -926,7 +930,7 @@ static void rna_def_armature(BlenderRNA *brna) "on file reload and undo"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - /* flag */ + /* flag */ prop = RNA_def_property(srna, "show_axes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES); RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes"); @@ -976,7 +980,7 @@ static void rna_def_armature(BlenderRNA *brna) /* Number fields */ /* XXX depreceated ....... old animviz for armatures only */ - /* ghost/onionskining settings */ + /* ghost/onionskining settings */ prop = RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghostep"); RNA_def_property_range(prop, 0, 30); diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c index 4a872dca952..29dc23b7bef 100644 --- a/source/blender/makesrna/intern/rna_armature_api.c +++ b/source/blender/makesrna/intern/rna_armature_api.c @@ -76,7 +76,7 @@ void RNA_api_bone(StructRNA *srna) func = RNA_def_function(srna, "evaluate_envelope", "rna_Bone_do_envelope"); RNA_def_function_ui_description(func, "Calculate bone envelope at given point"); parm = RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", - "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); + "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); /* return value */ parm = RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX); diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index 2f27c7a1e84..f803a8b67ea 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -65,7 +65,8 @@ EnumPropertyItem boidrule_type_items[] = { {eBoidRuleType_FollowWall, "FOLLOW_WALL", 0, "Follow Wall", "Move next to a deflector object's in direction of it's tangent"}, #endif - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem boidruleset_type_items[] = { {eBoidRulesetType_Fuzzy, "FUZZY", 0, "Fuzzy", @@ -73,7 +74,8 @@ EnumPropertyItem boidruleset_type_items[] = { "fuzziness threshold is evaluated)"}, {eBoidRulesetType_Random, "RANDOM", 0, "Random", "A random rule is selected for each boid"}, {eBoidRulesetType_Average, "AVERAGE", 0, "Average", "All rules are averaged"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -85,37 +87,37 @@ EnumPropertyItem boidruleset_type_items[] = { static void rna_Boids_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { if (ptr->type == &RNA_ParticleSystem) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; psys->recalc = PSYS_RECALC_RESET; DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); } else - DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET); + DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA | PSYS_RECALC_RESET); - WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL); + WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); } static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr) { if (ptr->type == &RNA_ParticleSystem) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; psys->recalc = PSYS_RECALC_RESET; DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); } else - DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET); + DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA | PSYS_RECALC_RESET); DAG_scene_sort(bmain, scene); - WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL); + WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); } -static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr) +static StructRNA *rna_BoidRule_refine(struct PointerRNA *ptr) { - BoidRule *rule = (BoidRule*)ptr->data; + BoidRule *rule = (BoidRule *)ptr->data; switch (rule->type) { case eBoidRuleType_Goal: @@ -137,13 +139,13 @@ static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr) static char *rna_BoidRule_path(PointerRNA *ptr) { - return BLI_sprintfN("rules[\"%s\"]", ((BoidRule*)ptr->data)->name); /* XXX not unique */ + return BLI_sprintfN("rules[\"%s\"]", ((BoidRule *)ptr->data)->name); /* XXX not unique */ } static PointerRNA rna_BoidState_active_boid_rule_get(PointerRNA *ptr) { - BoidState *state = (BoidState*)ptr->data; - BoidRule *rule = (BoidRule*)state->rules.first; + BoidState *state = (BoidState *)ptr->data; + BoidRule *rule = (BoidRule *)state->rules.first; for (; rule; rule = rule->next) { if (rule->flag & BOIDRULE_CURRENT) @@ -153,16 +155,16 @@ static PointerRNA rna_BoidState_active_boid_rule_get(PointerRNA *ptr) } static void rna_BoidState_active_boid_rule_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - BoidState *state = (BoidState*)ptr->data; + BoidState *state = (BoidState *)ptr->data; *min = 0; - *max = BLI_countlist(&state->rules)-1; + *max = BLI_countlist(&state->rules) - 1; *max = MAX2(0, *max); } static int rna_BoidState_active_boid_rule_index_get(PointerRNA *ptr) { - BoidState *state = (BoidState*)ptr->data; - BoidRule *rule = (BoidRule*)state->rules.first; + BoidState *state = (BoidState *)ptr->data; + BoidRule *rule = (BoidRule *)state->rules.first; int i = 0; for (; rule; rule = rule->next, i++) { @@ -174,8 +176,8 @@ static int rna_BoidState_active_boid_rule_index_get(PointerRNA *ptr) static void rna_BoidState_active_boid_rule_index_set(struct PointerRNA *ptr, int value) { - BoidState *state = (BoidState*)ptr->data; - BoidRule *rule = (BoidRule*)state->rules.first; + BoidState *state = (BoidState *)ptr->data; + BoidRule *rule = (BoidRule *)state->rules.first; int i = 0; for (; rule; rule = rule->next, i++) { @@ -198,7 +200,7 @@ static char *rna_BoidSettings_path(PointerRNA *ptr) BoidSettings *boids = (BoidSettings *)ptr->data; if (particle_id_check(ptr)) { - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; if (part->boids == boids) return BLI_sprintfN("boids"); @@ -208,8 +210,8 @@ static char *rna_BoidSettings_path(PointerRNA *ptr) static PointerRNA rna_BoidSettings_active_boid_state_get(PointerRNA *ptr) { - BoidSettings *boids = (BoidSettings*)ptr->data; - BoidState *state = (BoidState*)boids->states.first; + BoidSettings *boids = (BoidSettings *)ptr->data; + BoidState *state = (BoidState *)boids->states.first; for (; state; state = state->next) { if (state->flag & BOIDSTATE_CURRENT) @@ -220,16 +222,16 @@ static PointerRNA rna_BoidSettings_active_boid_state_get(PointerRNA *ptr) static void rna_BoidSettings_active_boid_state_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - BoidSettings *boids = (BoidSettings*)ptr->data; + BoidSettings *boids = (BoidSettings *)ptr->data; *min = 0; - *max = BLI_countlist(&boids->states)-1; + *max = BLI_countlist(&boids->states) - 1; *max = MAX2(0, *max); } static int rna_BoidSettings_active_boid_state_index_get(PointerRNA *ptr) { - BoidSettings *boids = (BoidSettings*)ptr->data; - BoidState *state = (BoidState*)boids->states.first; + BoidSettings *boids = (BoidSettings *)ptr->data; + BoidState *state = (BoidState *)boids->states.first; int i = 0; for (; state; state = state->next, i++) { @@ -241,8 +243,8 @@ static int rna_BoidSettings_active_boid_state_index_get(PointerRNA *ptr) static void rna_BoidSettings_active_boid_state_index_set(struct PointerRNA *ptr, int value) { - BoidSettings *boids = (BoidSettings*)ptr->data; - BoidState *state = (BoidState*)boids->states.first; + BoidSettings *boids = (BoidSettings *)ptr->data; + BoidState *state = (BoidState *)boids->states.first; int i = 0; for (; state; state = state->next, i++) { diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 70a33734c3f..ad926d6a08e 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -83,7 +83,7 @@ static void rna_Camera_angle_y_set(PointerRNA *ptr, float value) static void rna_Camera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Camera *camera = (Camera*)ptr->id.data; + Camera *camera = (Camera *)ptr->id.data; DAG_id_tag_update(&camera->id, 0); } @@ -98,7 +98,8 @@ void RNA_def_camera(BlenderRNA *brna) {CAM_PERSP, "PERSP", 0, "Perspective", ""}, {CAM_ORTHO, "ORTHO", 0, "Orthographic", ""}, {CAM_PANO, "PANO", 0, "Panoramic", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_draw_type_extra_items[] = { {CAM_DTX_CENTER, "CENTER", 0, "Center", ""}, {CAM_DTX_CENTER_DIAG, "CENTER_DIAGONAL", 0, "Center Diagonal", ""}, @@ -108,16 +109,19 @@ void RNA_def_camera(BlenderRNA *brna) {CAM_DTX_GOLDEN_TRI_B, "GOLDEN_TRIANGLE_B", 0, "Golden Triangle B", ""}, {CAM_DTX_HARMONY_TRI_A, "HARMONY_TRIANGLE_A", 0, "Harmonious Triangle A", ""}, {CAM_DTX_HARMONY_TRI_B, "HARMONY_TRIANGLE_B", 0, "Harmonious Triangle B", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_lens_unit_items[] = { {0, "MILLIMETERS", 0, "Millimeters", ""}, {CAM_ANGLETOGGLE, "DEGREES", 0, "Degrees", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem sensor_fit_items[] = { {CAMERA_SENSOR_FIT_AUTO, "AUTO", 0, "Auto", "Fit to the sensor width or height depending on image resolution"}, {CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Fit to the sensor width"}, {CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Fit to the sensor height"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Camera", "ID"); RNA_def_struct_ui_text(srna, "Camera", "Camera datablock for storing camera settings"); @@ -127,145 +131,145 @@ void RNA_def_camera(BlenderRNA *brna) prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Camera types"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dtx"); RNA_def_property_enum_items(prop, prop_draw_type_extra_items); RNA_def_property_flag(prop, PROP_ENUM_FLAG); RNA_def_property_ui_text(prop, "Composition Guides", "Draw overlay"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sensor_fit"); RNA_def_property_enum_items(prop, sensor_fit_items); RNA_def_property_ui_text(prop, "Sensor Fit", "Method to fit image and field of view angle inside the sensor"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); /* Number values */ prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "passepartalpha"); RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "angle_x", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0)); + RNA_def_property_range(prop, M_PI * (0.367 / 180.0), M_PI * (172.847 / 180.0)); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Horizontal FOV", "Camera lens horizontal field of view in degrees"); RNA_def_property_float_funcs(prop, "rna_Camera_angle_x_get", "rna_Camera_angle_x_set", NULL); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "angle_y", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0)); + RNA_def_property_range(prop, M_PI * (0.367 / 180.0), M_PI * (172.847 / 180.0)); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Vertical FOV", "Camera lens vertical field of view in degrees"); RNA_def_property_float_funcs(prop, "rna_Camera_angle_y_get", "rna_Camera_angle_y_set", NULL); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_range(prop, M_PI * (0.367/180.0), M_PI * (172.847/180.0)); + RNA_def_property_range(prop, M_PI * (0.367 / 180.0), M_PI * (172.847 / 180.0)); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Field of View", "Camera lens field of view in degrees"); RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); RNA_def_property_range(prop, 0.001f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipend"); RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "lens"); RNA_def_property_range(prop, 1.0f, 5000.0f); RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sensor_x"); RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2); RNA_def_property_ui_text(prop, "Sensor Width", "Horizontal size of the image sensor area in millimeters"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "sensor_y"); RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2); RNA_def_property_ui_text(prop, "Sensor Height", "Vertical size of the image sensor area in millimeters"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ortho_scale"); RNA_def_property_range(prop, 0.01f, 4000.0f); RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "drawsize"); RNA_def_property_range(prop, 0.01f, 1000.0f); RNA_def_property_ui_range(prop, 0.01, 100, 1, 2); RNA_def_property_ui_text(prop, "Draw Size", "Apparent size of the Camera object in the 3D View"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shiftx"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3); RNA_def_property_ui_text(prop, "Shift X", "Perspective Camera horizontal shift"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shifty"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3); RNA_def_property_ui_text(prop, "Shift Y", "Perspective Camera vertical shift"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "YF_dofdist"); RNA_def_property_range(prop, 0.0f, 5000.0f); RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); /* flag */ prop = RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWLIMITS); RNA_def_property_ui_text(prop, "Show Limits", "Draw the clipping range and focus point on the camera"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_mist", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWMIST); RNA_def_property_ui_text(prop, "Show Mist", "Draw a line from the Camera to indicate the mist area"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWPASSEPARTOUT); RNA_def_property_ui_text(prop, "Show Passepartout", "Show a darkened overlay outside the image area in Camera view"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_title_safe", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWTITLESAFE); RNA_def_property_ui_text(prop, "Show Title Safe", "Show indicators for the title safe zone in Camera view"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME); RNA_def_property_ui_text(prop, "Show Name", "Show the active Camera's name in Camera view"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_sensor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWSENSOR); RNA_def_property_ui_text(prop, "Show Sensor Size", "Show sensor size (film gate) in Camera view"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); @@ -280,7 +284,7 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "dof_ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); /* Camera API */ RNA_api_camera(srna); diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 2f6a31ff8ee..37795edb884 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -49,39 +49,39 @@ static void rna_cloth_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); } static void rna_cloth_pinning_changed(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; /* ClothSimSettings *settings = (ClothSimSettings*)ptr->data; */ - ClothModifierData *clmd = (ClothModifierData*)modifiers_findByType(ob, eModifierType_Cloth); + ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth); cloth_free_modifier(clmd); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); } static void rna_cloth_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - ClothSimSettings *settings = (ClothSimSettings*)ptr->data; + Object *ob = (Object *)ptr->id.data; + ClothSimSettings *settings = (ClothSimSettings *)ptr->data; settings->reset = 1; DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); } static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value) { - ClothSimSettings *settings = (ClothSimSettings*)ptr->data; + ClothSimSettings *settings = (ClothSimSettings *)ptr->data; /* check for clipping */ if (value < settings->bending) @@ -92,7 +92,7 @@ static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value) static void rna_ClothSettings_max_struct_set(struct PointerRNA *ptr, float value) { - ClothSimSettings *settings = (ClothSimSettings*)ptr->data; + ClothSimSettings *settings = (ClothSimSettings *)ptr->data; /* check for clipping */ if (value < settings->structural) @@ -103,77 +103,77 @@ static void rna_ClothSettings_max_struct_set(struct PointerRNA *ptr, float value static void rna_ClothSettings_mass_vgroup_get(PointerRNA *ptr, char *value) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_mass); } static int rna_ClothSettings_mass_vgroup_length(PointerRNA *ptr) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; return rna_object_vgroup_name_index_length(ptr, sim->vgroup_mass); } static void rna_ClothSettings_mass_vgroup_set(PointerRNA *ptr, const char *value) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_mass); } static void rna_ClothSettings_struct_vgroup_get(PointerRNA *ptr, char *value) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_struct); } static int rna_ClothSettings_struct_vgroup_length(PointerRNA *ptr) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; return rna_object_vgroup_name_index_length(ptr, sim->vgroup_struct); } static void rna_ClothSettings_struct_vgroup_set(PointerRNA *ptr, const char *value) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_struct); } static void rna_ClothSettings_bend_vgroup_get(PointerRNA *ptr, char *value) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; rna_object_vgroup_name_index_get(ptr, value, sim->vgroup_bend); } static int rna_ClothSettings_bend_vgroup_length(PointerRNA *ptr) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; return rna_object_vgroup_name_index_length(ptr, sim->vgroup_bend); } static void rna_ClothSettings_bend_vgroup_set(PointerRNA *ptr, const char *value) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_bend); } static PointerRNA rna_ClothSettings_rest_shape_key_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + Object *ob = (Object *)ptr->id.data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; return rna_object_shapekey_index_get(ob->data, sim->shapekey_rest); } static void rna_ClothSettings_rest_shape_key_set(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object*)ptr->id.data; - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + Object *ob = (Object *)ptr->id.data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; sim->shapekey_rest = rna_object_shapekey_index_set(ob->data, value, sim->shapekey_rest); } static void rna_ClothSettings_gravity_get(PointerRNA *ptr, float *values) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; values[0] = sim->gravity[0]; values[1] = sim->gravity[1]; @@ -182,7 +182,7 @@ static void rna_ClothSettings_gravity_get(PointerRNA *ptr, float *values) static void rna_ClothSettings_gravity_set(PointerRNA *ptr, const float *values) { - ClothSimSettings *sim = (ClothSimSettings*)ptr->data; + ClothSimSettings *sim = (ClothSimSettings *)ptr->data; sim->gravity[0] = values[0]; sim->gravity[1] = values[1]; @@ -191,7 +191,7 @@ static void rna_ClothSettings_gravity_set(PointerRNA *ptr, const float *values) static char *rna_ClothSettings_path(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth); return md ? BLI_sprintfN("modifiers[\"%s\"].settings", md->name) : NULL; @@ -199,7 +199,7 @@ static char *rna_ClothSettings_path(PointerRNA *ptr) static char *rna_ClothCollisionSettings_path(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; ModifierData *md = modifiers_findByType(ob, eModifierType_Cloth); return md ? BLI_sprintfN("modifiers[\"%s\"].collision_settings", md->name) : NULL; @@ -398,40 +398,47 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) /* unused */ - /* unused still + /* unused still */ +#if 0 prop= RNA_def_property(srna, "shear_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shear"); RNA_def_property_range(prop, 0.0f, 1000.0f); - RNA_def_property_ui_text(prop, "Shear Stiffness", "Shear spring stiffness"); */ - - /* unused still + RNA_def_property_ui_text(prop, "Shear Stiffness", "Shear spring stiffness"); +#endif + /* unused still */ +#if 0 prop= RNA_def_property(srna, "shear_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_shear"); RNA_def_property_range(prop, 0.0f, upperLimitf); - RNA_def_property_ui_text(prop, "Shear Stiffness Maximum", "Maximum shear scaling value"); */ - - /* unused still + RNA_def_property_ui_text(prop, "Shear Stiffness Maximum", "Maximum shear scaling value"); +#endif + /* unused still */ +#if 0 prop= RNA_def_property(srna, "effector_force_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "eff_force_scale"); RNA_def_property_range(prop, 0.0f, 100.0f); - RNA_def_property_ui_text(prop, "Effector Force Scale", ""); */ - - /* unused still + RNA_def_property_ui_text(prop, "Effector Force Scale", ""); +#endif + /* unused still */ +#if 0 prop= RNA_def_property(srna, "effector_wind_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "eff_wind_scale"); RNA_def_property_range(prop, 0.0f, 100.0f); - RNA_def_property_ui_text(prop, "Effector Wind Scale", ""); */ - - /* unused still + RNA_def_property_ui_text(prop, "Effector Wind Scale", ""); +#endif + /* unused still */ +#if 0 prop= RNA_def_property(srna, "tearing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_TEARING); - RNA_def_property_ui_text(prop, "Tearing", "");*/ - - /* unused still + RNA_def_property_ui_text(prop, "Tearing", ""); +#endif + /* unused still */ +#if 0 prop= RNA_def_property(srna, "max_spring_extensions", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxspringlen"); RNA_def_property_range(prop, 1.0, 1000.0); - RNA_def_property_ui_text(prop, "Maximum Spring Extension", "Maximum extension before spring gets cut"); */ + RNA_def_property_ui_text(prop, "Maximum Spring Extension", "Maximum extension before spring gets cut"); +#endif } static void rna_def_cloth_collision_settings(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index ed2283dedab..76116602711 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -55,10 +55,10 @@ static int rna_CurveMapping_curves_length(PointerRNA *ptr) { - CurveMapping *cumap = (CurveMapping*)ptr->data; + CurveMapping *cumap = (CurveMapping *)ptr->data; int len; - for (len = 0; lencm[len].curve) break; @@ -67,14 +67,14 @@ static int rna_CurveMapping_curves_length(PointerRNA *ptr) static void rna_CurveMapping_curves_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - CurveMapping *cumap = (CurveMapping*)ptr->data; + CurveMapping *cumap = (CurveMapping *)ptr->data; rna_iterator_array_begin(iter, cumap->cm, sizeof(CurveMap), rna_CurveMapping_curves_length(ptr), 0, NULL); } static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value) { - CurveMapping *cumap = (CurveMapping*)ptr->data; + CurveMapping *cumap = (CurveMapping *)ptr->data; if (value) cumap->flag |= CUMA_DO_CLIP; else cumap->flag &= ~CUMA_DO_CLIP; @@ -84,7 +84,7 @@ static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value) static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *values) { - CurveMapping *cumap = (CurveMapping*)ptr->data; + CurveMapping *cumap = (CurveMapping *)ptr->data; cumap->black[0] = values[0]; cumap->black[1] = values[1]; cumap->black[2] = values[2]; @@ -93,7 +93,7 @@ static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *value static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *values) { - CurveMapping *cumap = (CurveMapping*)ptr->data; + CurveMapping *cumap = (CurveMapping *)ptr->data; cumap->white[0] = values[0]; cumap->white[1] = values[1]; cumap->white[2] = values[2]; @@ -102,7 +102,7 @@ static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *value static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - CurveMapping *cumap = (CurveMapping*)ptr->data; + CurveMapping *cumap = (CurveMapping *)ptr->data; *min = -100.0f; *max = cumap->clipr.xmax; @@ -110,7 +110,7 @@ static void rna_CurveMapping_clipminx_range(PointerRNA *ptr, float *min, float * static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - CurveMapping *cumap = (CurveMapping*)ptr->data; + CurveMapping *cumap = (CurveMapping *)ptr->data; *min = -100.0f; *max = cumap->clipr.ymax; @@ -118,7 +118,7 @@ static void rna_CurveMapping_clipminy_range(PointerRNA *ptr, float *min, float * static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - CurveMapping *cumap = (CurveMapping*)ptr->data; + CurveMapping *cumap = (CurveMapping *)ptr->data; *min = cumap->clipr.xmin; *max = 100.0f; @@ -126,7 +126,7 @@ static void rna_CurveMapping_clipmaxx_range(PointerRNA *ptr, float *min, float * static void rna_CurveMapping_clipmaxy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - CurveMapping *cumap = (CurveMapping*)ptr->data; + CurveMapping *cumap = (CurveMapping *)ptr->data; *min = cumap->clipr.ymin; *max = 100.0f; @@ -140,16 +140,16 @@ static char *rna_ColorRamp_path(PointerRNA *ptr) ID *id = ptr->id.data; switch (GS(id->name)) { - case ID_MA: /* material has 2 cases - diffuse and specular */ + case ID_MA: /* material has 2 cases - diffuse and specular */ { - Material *ma = (Material*)id; + Material *ma = (Material *)id; if (ptr->data == ma->ramp_col) return BLI_strdup("diffuse_ramp"); else if (ptr->data == ma->ramp_spec) return BLI_strdup("specular_ramp"); } - break; + break; } } @@ -202,9 +202,9 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) COLRAMP_GETPATH; } } - break; + break; - /* TODO: node trees need special attention */ + /* TODO: node trees need special attention */ case ID_NT: { bNodeTree *ntree = (bNodeTree *)id; @@ -217,7 +217,7 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr) } } } - break; + break; default: /* everything else should have a "color_ramp" property */ { @@ -247,9 +247,9 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * Material *ma = ptr->id.data; DAG_id_tag_update(&ma->id, 0); - WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma); + WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma); } - break; + break; case ID_NT: { bNodeTree *ntree = (bNodeTree *)id; @@ -261,7 +261,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * } } } - break; + break; case ID_TE: { Tex *tex = ptr->id.data; @@ -269,7 +269,7 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA * DAG_id_tag_update(&tex->id, 0); WM_main_add_notifier(NC_TEXTURE, tex); } - break; + break; default: break; } @@ -301,7 +301,7 @@ static void rna_ColorRampElement_remove(struct ColorBand *coba, ReportList *repo static void rna_Scopes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scopes *s = (Scopes*)ptr->data; + Scopes *s = (Scopes *)ptr->data; s->ok = 0; } @@ -474,7 +474,7 @@ static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Delete element from ColorRamp"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } static void rna_def_color_ramp(BlenderRNA *brna) @@ -489,7 +489,8 @@ static void rna_def_color_ramp(BlenderRNA *brna) {0, "LINEAR", 0, "Linear", ""}, {2, "B_SPLINE", 0, "B-Spline", ""}, {4, "CONSTANT", 0, "Constant", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ColorRamp", NULL); RNA_def_struct_sdna(srna, "ColorBand"); @@ -541,7 +542,8 @@ static void rna_def_histogram(BlenderRNA *brna) {HISTO_MODE_R, "R", ICON_COLOR, "Red", ""}, {HISTO_MODE_G, "G", ICON_COLOR, "Green", ""}, {HISTO_MODE_B, "B", ICON_COLOR, "Blue", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Histogram", NULL); RNA_def_struct_ui_text(srna, "Histogram", "Statistical view of the levels of color in an image"); @@ -564,7 +566,8 @@ static void rna_def_scopes(BlenderRNA *brna) {SCOPES_WAVEFRM_YCC_601, "YCBCR601", ICON_COLOR, "YCbCr (ITU 601)", ""}, {SCOPES_WAVEFRM_YCC_709, "YCBCR709", ICON_COLOR, "YCbCr (ITU 709)", ""}, {SCOPES_WAVEFRM_YCC_JPEG, "YCBCRJPG", ICON_COLOR, "YCbCr (Jpeg)", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Scopes", NULL); RNA_def_struct_ui_text(srna, "Scopes", "Scopes for statistical view of an image"); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index b812c574a01..7c981149aca 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -80,7 +80,8 @@ EnumPropertyItem constraint_type_items[] = { {CONSTRAINT_TYPE_RIGIDBODYJOINT, "RIGID_BODY_JOINT", ICON_CONSTRAINT_DATA, "Rigid Body Joint", ""}, {CONSTRAINT_TYPE_PYTHON, "SCRIPT", ICON_CONSTRAINT_DATA, "Script", ""}, {CONSTRAINT_TYPE_SHRINKWRAP, "SHRINKWRAP", ICON_CONSTRAINT_DATA, "Shrinkwrap", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static EnumPropertyItem target_space_pchan_items[] = { {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space", @@ -95,7 +96,8 @@ static EnumPropertyItem target_space_pchan_items[] = { {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local " "coordinate system"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static EnumPropertyItem owner_space_pchan_items[] = { {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space", @@ -107,7 +109,8 @@ static EnumPropertyItem owner_space_pchan_items[] = { "with the parent transformation added"}, {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The constraint is applied relative to the local coordinate sytem of the object"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -116,7 +119,8 @@ static EnumPropertyItem space_object_items[] = { "The transformation of the target is evaluated relative to the world coordinate system"}, {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #include "BKE_animsys.h" #include "BKE_action.h" @@ -127,7 +131,7 @@ static EnumPropertyItem space_object_items[] = { static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr) { - bConstraint *con = (bConstraint*)ptr->data; + bConstraint *con = (bConstraint *)ptr->data; switch (con->type) { case CONSTRAINT_TYPE_CHILDOF: @@ -249,7 +253,7 @@ static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRN Object *ob = ptr->id.data; if (ob->pose) - ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); + ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK); rna_Constraint_update(bmain, scene, ptr); } @@ -263,10 +267,10 @@ static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value) /* the type of IK constraint has changed, set suitable default values */ /* in case constraints reuse same fields incompatible */ switch (value) { - case CONSTRAINT_IK_COPYPOSE: - break; - case CONSTRAINT_IK_DISTANCE: - break; + case CONSTRAINT_IK_COPYPOSE: + break; + case CONSTRAINT_IK_DISTANCE: + break; } ikdata->type = value; } @@ -275,8 +279,8 @@ static void rna_Constraint_ik_type_set(struct PointerRNA *ptr, int value) static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free)) { - Object *ob = (Object*)ptr->id.data; - bConstraint *con = (bConstraint*)ptr->data; + Object *ob = (Object *)ptr->id.data; + bConstraint *con = (bConstraint *)ptr->data; if (BLI_findindex(&ob->constraints, con) == -1) return owner_space_pchan_items; @@ -287,7 +291,7 @@ static EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED(C), P static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free)) { - bConstraint *con = (bConstraint*)ptr->data; + bConstraint *con = (bConstraint *)ptr->data; bConstraintTypeInfo *cti = constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; bConstraintTarget *ct; @@ -311,7 +315,7 @@ static EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C), static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - bConstraint *con = (bConstraint*)ptr->data; + bConstraint *con = (bConstraint *)ptr->data; bActionConstraint *acon = (bActionConstraint *)con->data; /* 0, 1, 2 = magic numbers for rotX, rotY, rotZ */ @@ -327,20 +331,20 @@ static void rna_ActionConstraint_minmax_range(PointerRNA *ptr, float *min, float static int rna_SplineIKConstraint_joint_bindings_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - bConstraint *con = (bConstraint*)ptr->data; + bConstraint *con = (bConstraint *)ptr->data; bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data; if (ikData) length[0] = ikData->numpoints; else - length[0] = 256; /* for raw_access, untested */ + length[0] = 256; /* for raw_access, untested */ return length[0]; } static void rna_SplineIKConstraint_joint_bindings_get(PointerRNA *ptr, float *values) { - bConstraint *con = (bConstraint*)ptr->data; + bConstraint *con = (bConstraint *)ptr->data; bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data; memcpy(values, ikData->points, ikData->numpoints * sizeof(float)); @@ -348,7 +352,7 @@ static void rna_SplineIKConstraint_joint_bindings_get(PointerRNA *ptr, float *va static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const float *values) { - bConstraint *con = (bConstraint*)ptr->data; + bConstraint *con = (bConstraint *)ptr->data; bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data; memcpy(ikData->points, values, ikData->numpoints * sizeof(float)); @@ -356,10 +360,10 @@ static void rna_SplineIKConstraint_joint_bindings_set(PointerRNA *ptr, const flo static int rna_Constraint_cameraObject_poll(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object*)value.data; + Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_CAMERA && ob != (Object*)ptr->id.data) { + if (ob->type == OB_CAMERA && ob != (Object *)ptr->id.data) { return 1; } } @@ -369,12 +373,12 @@ static int rna_Constraint_cameraObject_poll(PointerRNA *ptr, PointerRNA value) static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr, PointerRNA value) { - bConstraint *con = (bConstraint*)ptr->data; - bFollowTrackConstraint *data = (bFollowTrackConstraint*)con->data; - Object *ob = (Object*)value.data; + bConstraint *con = (bConstraint *)ptr->data; + bFollowTrackConstraint *data = (bFollowTrackConstraint *)con->data; + Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_CAMERA && ob != (Object*)ptr->id.data) { + if (ob->type == OB_CAMERA && ob != (Object *)ptr->id.data) { data->camera = ob; } } @@ -385,12 +389,12 @@ static void rna_Constraint_followTrack_camera_set(PointerRNA *ptr, PointerRNA va static void rna_Constraint_followTrack_depthObject_set(PointerRNA *ptr, PointerRNA value) { - bConstraint *con = (bConstraint*)ptr->data; - bFollowTrackConstraint *data = (bFollowTrackConstraint*)con->data; - Object *ob = (Object*)value.data; + bConstraint *con = (bConstraint *)ptr->data; + bFollowTrackConstraint *data = (bFollowTrackConstraint *)con->data; + Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_MESH && ob != (Object*)ptr->id.data) { + if (ob->type == OB_MESH && ob != (Object *)ptr->id.data) { data->depth_ob = ob; } } @@ -401,10 +405,10 @@ static void rna_Constraint_followTrack_depthObject_set(PointerRNA *ptr, PointerR static int rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object*)value.data; + Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_MESH && ob != (Object*)ptr->id.data) { + if (ob->type == OB_MESH && ob != (Object *)ptr->id.data) { return 1; } } @@ -414,12 +418,12 @@ static int rna_Constraint_followTrack_depthObject_poll(PointerRNA *ptr, PointerR static void rna_Constraint_objectSolver_camera_set(PointerRNA *ptr, PointerRNA value) { - bConstraint *con = (bConstraint*)ptr->data; - bObjectSolverConstraint *data = (bObjectSolverConstraint*)con->data; - Object *ob = (Object*)value.data; + bConstraint *con = (bConstraint *)ptr->data; + bObjectSolverConstraint *data = (bObjectSolverConstraint *)con->data; + Object *ob = (Object *)value.data; if (ob) { - if (ob->type == OB_CAMERA && ob != (Object*)ptr->id.data) { + if (ob->type == OB_CAMERA && ob != (Object *)ptr->id.data) { data->camera = ob; } } @@ -457,12 +461,12 @@ static void rna_def_constrainttarget(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* space, flag and type still to do */ } @@ -481,57 +485,57 @@ static void rna_def_constraint_childof(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCX); RNA_def_property_ui_text(prop, "Location X", "Use X Location of Parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_location_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCY); RNA_def_property_ui_text(prop, "Location Y", "Use Y Location of Parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_location_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCZ); RNA_def_property_ui_text(prop, "Location Z", "Use Z Location of Parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_rotation_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTX); RNA_def_property_ui_text(prop, "Rotation X", "Use X Rotation of Parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_rotation_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTY); RNA_def_property_ui_text(prop, "Rotation Y", "Use Y Rotation of Parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_rotation_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_ROTZ); RNA_def_property_ui_text(prop, "Rotation Z", "Use Z Rotation of Parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_scale_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEX); RNA_def_property_ui_text(prop, "Scale X", "Use X Scale of Parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_scale_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEY); RNA_def_property_ui_text(prop, "Scale Y", "Use Y Scale of Parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_scale_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_SIZEZ); RNA_def_property_ui_text(prop, "Scale Z", "Use Z Scale of Parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "inverse_matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "invmat"); @@ -558,17 +562,17 @@ static void rna_def_constraint_python(BlenderRNA *brna) prop = RNA_def_property(srna, "target_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tarnum"); RNA_def_property_ui_text(prop, "Number of Targets", "Usually only 1-3 are needed"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Script", "The text object that contains the Python script"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_REFCOUNT); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_targets", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_USETARGETS); RNA_def_property_ui_text(prop, "Use Targets", "Use the targets indicated in the constraint panel"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "has_script_error", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_SCRIPTERROR); @@ -601,34 +605,34 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 10000); RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "pole_target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "poletar"); RNA_def_property_ui_text(prop, "Pole Target", "Object for pole rotation"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "pole_subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "polesubtarget"); RNA_def_property_ui_text(prop, "Pole Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "pole_angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "poleangle"); RNA_def_property_range(prop, -M_PI, M_PI); RNA_def_property_ui_text(prop, "Pole Angle", "Pole rotation offset"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01, 1.f); @@ -638,94 +642,94 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "orientweight"); RNA_def_property_range(prop, 0.01, 1.f); RNA_def_property_ui_text(prop, "Orientation Weight", "For Tree-IK: Weight of orientation control for this target"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rootbone"); RNA_def_property_range(prop, 0, 255); RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the IK effect - 0 uses all bones"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "use_tail", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_TIP); RNA_def_property_ui_text(prop, "Use Tail", "Include bone's tail as last element in chain"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "reference_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, constraint_ik_axisref_items); RNA_def_property_ui_text(prop, "Axis Reference", "Constraint axis Lock options relative to Bone or Target reference"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "use_location", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_POS); RNA_def_property_ui_text(prop, "Position", "Chain follows position of target"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "lock_location_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_X); RNA_def_property_ui_text(prop, "Lock X Pos", "Constraint position along X axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "lock_location_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_Y); RNA_def_property_ui_text(prop, "Lock Y Pos", "Constraint position along Y axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "lock_location_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_POS_Z); RNA_def_property_ui_text(prop, "Lock Z Pos", "Constraint position along Z axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_ROT); RNA_def_property_ui_text(prop, "Rotation", "Chain follows rotation of target"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "lock_rotation_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_X); RNA_def_property_ui_text(prop, "Lock X Rot", "Constraint rotation along X axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "lock_rotation_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_Y); RNA_def_property_ui_text(prop, "Lock Y Rot", "Constraint rotation along Y axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "lock_rotation_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_NO_ROT_Z); RNA_def_property_ui_text(prop, "Lock Z Rot", "Constraint rotation along Z axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "use_target", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO); RNA_def_property_ui_text(prop, "Target", "Disable for targetless IK"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_STRETCH); RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "ik_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_funcs(prop, NULL, "rna_Constraint_ik_type_set", NULL); RNA_def_property_enum_items(prop, constraint_ik_type_items); RNA_def_property_ui_text(prop, "IK Type", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, constraint_distance_items); RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0, 100.f); RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_track_to(BlenderRNA *brna) @@ -740,13 +744,15 @@ static void rna_def_constraint_track_to(BlenderRNA *brna) {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""}, {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""}, {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem up_items[] = { {TRACK_X, "UP_X", 0, "X", ""}, {TRACK_Y, "UP_Y", 0, "Y", ""}, {TRACK_Z, "UP_Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "TrackToConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Track To Constraint", "Aim the constrained object toward the target"); @@ -754,7 +760,7 @@ static void rna_def_constraint_track_to(BlenderRNA *brna) prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_struct_sdna_from(srna, "bTrackToConstraint", "data"); @@ -762,29 +768,29 @@ static void rna_def_constraint_track_to(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "reserved1"); RNA_def_property_enum_items(prop, track_items); RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "reserved2"); RNA_def_property_enum_items(prop, up_items); RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_target_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", TARGET_Z_UP); RNA_def_property_ui_text(prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_locate_like(BlenderRNA *brna) @@ -798,7 +804,7 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data"); @@ -807,47 +813,47 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X); RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y); RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y location"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z); RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z location"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X_INVERT); RNA_def_property_ui_text(prop, "Invert X", "Invert the X location"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Y_INVERT); RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y location"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_Z_INVERT); RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z location"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET); RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_rotate_like(BlenderRNA *brna) @@ -863,47 +869,47 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X); RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Y); RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Z); RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "invert_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X_INVERT); RNA_def_property_ui_text(prop, "Invert X", "Invert the X rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "invert_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Y_INVERT); RNA_def_property_ui_text(prop, "Invert Y", "Invert the Y rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "invert_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_Z_INVERT); RNA_def_property_ui_text(prop, "Invert Z", "Invert the Z rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_OFFSET); RNA_def_property_ui_text(prop, "Offset", "Add original rotation into copied rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_size_like(BlenderRNA *brna) @@ -920,32 +926,32 @@ static void rna_def_constraint_size_like(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_X); RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Y); RNA_def_property_ui_text(prop, "Copy Y", "Copy the target's Y scale"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_Z); RNA_def_property_ui_text(prop, "Copy Z", "Copy the target's Z scale"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_OFFSET); RNA_def_property_ui_text(prop, "Offset", "Add original scale into copied scale"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_same_volume(BlenderRNA *brna) @@ -954,10 +960,11 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem volume_items[] = { - {SAMEVOL_X, "SAMEVOL_X", 0, "X", ""}, - {SAMEVOL_Y, "SAMEVOL_Y", 0, "Y", ""}, - {SAMEVOL_Z, "SAMEVOL_Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {SAMEVOL_X, "SAMEVOL_X", 0, "X", ""}, + {SAMEVOL_Y, "SAMEVOL_Y", 0, "Y", ""}, + {SAMEVOL_Z, "SAMEVOL_Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MaintainVolumeConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Maintain Volume Constraint", @@ -968,12 +975,12 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, volume_items); RNA_def_property_ui_text(prop, "Free Axis", "The free scaling axis of the object"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0.001, 100.f); RNA_def_property_ui_text(prop, "Volume", "Volume of the bone at rest"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } @@ -988,7 +995,7 @@ static void rna_def_constraint_transform_like(BlenderRNA *brna) prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_struct_sdna_from(srna, "bTransLikeConstraint", "data"); @@ -996,12 +1003,12 @@ static void rna_def_constraint_transform_like(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); } static void rna_def_constraint_minmax(BlenderRNA *brna) @@ -1016,7 +1023,8 @@ static void rna_def_constraint_minmax(BlenderRNA *brna) {TRACK_nX, "FLOOR_NEGATIVE_X", 0, "-X", ""}, {TRACK_nY, "FLOOR_NEGATIVE_Y", 0, "-Y", ""}, {TRACK_nZ, "FLOOR_NEGATIVE_Z", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "FloorConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Floor Constraint", "Use the target object for location limitation"); @@ -1026,33 +1034,33 @@ static void rna_def_constraint_minmax(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "minmaxflag"); RNA_def_property_enum_items(prop, minmax_items); RNA_def_property_ui_text(prop, "Floor Location", "Location of target that object will not pass through"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_sticky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MINMAX_STICKY); RNA_def_property_ui_text(prop, "Sticky", "Immobilize object while constrained"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MINMAX_USEROT); RNA_def_property_ui_text(prop, "Use Rotation", "Use the target's rotation to determine floor"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0.0, 100.f); RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object origin"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_action(BlenderRNA *brna) @@ -1070,7 +1078,8 @@ static void rna_def_constraint_action(BlenderRNA *brna) {10, "SCALE_X", 0, "X Scale", ""}, {11, "SCALE_Y", 0, "Y Scale", ""}, {12, "SCALE_Z", 0, "Z Scale", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ActionConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Action Constraint", "Map an action to the transform axes of a bone"); @@ -1080,50 +1089,50 @@ static void rna_def_constraint_action(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "transform_channel", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, transform_channel_items); RNA_def_property_ui_text(prop, "Transform Channel", "Transformation channel from the target that is used to key the Action"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act"); RNA_def_property_ui_text(prop, "Action", "The constraining action"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_REFCOUNT); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "start"); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Start Frame", "First frame of the Action to use"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "end"); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "End Frame", "Last frame of the Action to use"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_range(prop, -1000.f, 1000.f); RNA_def_property_ui_text(prop, "Maximum", "Maximum value for target channel range"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range"); prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_range(prop, -1000.f, 1000.f); RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range"); } @@ -1139,13 +1148,15 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""}, {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""}, {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem lock_items[] = { {TRACK_X, "LOCK_X", 0, "X", ""}, {TRACK_Y, "LOCK_Y", 0, "Y", ""}, {TRACK_Z, "LOCK_Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "LockedTrackConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Locked Track Constraint", @@ -1154,7 +1165,7 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data"); @@ -1162,24 +1173,24 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); RNA_def_property_enum_items(prop, locktrack_items); RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "lock_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "lockflag"); RNA_def_property_enum_items(prop, lock_items); RNA_def_property_ui_text(prop, "Locked Axis", "Axis that points upward"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_follow_path(BlenderRNA *brna) @@ -1194,13 +1205,15 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""}, {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""}, {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem pathup_items[] = { {TRACK_X, "UP_X", 0, "X", ""}, {TRACK_Y, "UP_Y", 0, "Y", ""}, {TRACK_Z, "UP_Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "FollowPathConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Follow Path Constraint", "Lock motion to the target path"); @@ -1211,47 +1224,47 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Offset", "Offset from the position corresponding to the time frame"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "offset_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "offset_fac"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Offset Factor", "Percentage value defining target position along length of bone"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "forward_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); RNA_def_property_enum_items(prop, forwardpath_items); RNA_def_property_ui_text(prop, "Forward Axis", "Axis that points forward along the path"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "upflag"); RNA_def_property_enum_items(prop, pathup_items); RNA_def_property_ui_text(prop, "Up Axis", "Axis that points upward"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_curve_follow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_FOLLOW); RNA_def_property_ui_text(prop, "Follow Curve", "Object will follow the heading and banking of the curve"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_fixed_location", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_STATIC); RNA_def_property_ui_text(prop, "Fixed Position", "Object will stay locked to a single point somewhere along the length of the curve " "regardless of time"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_RADIUS); RNA_def_property_ui_text(prop, "Curve Radius", "Object is scaled by the curve radius"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_stretch_to(BlenderRNA *brna) @@ -1264,12 +1277,14 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna) {VOLUME_X, "VOLUME_X", 0, "X", ""}, {VOLUME_Z, "VOLUME_Z", 0, "Z", ""}, {NO_VOLUME, "NO_VOLUME", 0, "None", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem plane_items[] = { {PLANE_X, "PLANE_X", 0, "X", "Keep X Axis"}, {PLANE_Z, "PLANE_Z", 0, "Z", "Keep Z Axis"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "StretchToConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Stretch To Constraint", "Stretch to meet the target object"); @@ -1277,7 +1292,7 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna) prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_struct_sdna_from(srna, "bStretchToConstraint", "data"); @@ -1285,35 +1300,35 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "volmode"); RNA_def_property_enum_items(prop, volume_items); RNA_def_property_ui_text(prop, "Maintain Volume", "Maintain the object's volume as it stretches"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "keep_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "plane"); RNA_def_property_enum_items(prop, plane_items); RNA_def_property_ui_text(prop, "Keep Axis", "Axis to maintain during stretch"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "orglength"); RNA_def_property_range(prop, 0.0, 100.f); RNA_def_property_ui_text(prop, "Original Length", "Length at rest position"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "bulge", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.f); RNA_def_property_ui_text(prop, "Volume Variation", "Factor between volume variation and stretching"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) @@ -1328,7 +1343,8 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) "Allow rotations around all axes with limits for the cone and twist axes"}, {CONSTRAINT_RB_GENERIC6DOF, "GENERIC_6_DOF", 0, "Generic 6 DoF", "No constraints by default, limits can be set individually"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "RigidBodyJointConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Rigid Body Joint Constraint", "For use with the Game Engine"); @@ -1338,64 +1354,64 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "child", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Child Object", "Child object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "pivot_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, pivot_items); RNA_def_property_ui_text(prop, "Pivot Type", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "pivX"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Pivot X", "Offset pivot on X"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "pivY"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Pivot Y", "Offset pivot on Y"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "pivot_z", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "pivZ"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Pivot Z", "Offset pivot on Z"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "axX"); - RNA_def_property_range(prop, -M_PI*2, M_PI*2); + RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Axis X", "Rotate pivot on X axis in degrees"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "axY"); - RNA_def_property_range(prop, -M_PI*2, M_PI*2); + RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Axis Y", "Rotate pivot on Y axis in degrees"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "axZ"); - RNA_def_property_range(prop, -M_PI*2, M_PI*2); + RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Axis Z", "Rotate pivot on Z axis in degrees"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_linked_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE_LINKED_COLLISION); RNA_def_property_ui_text(prop, "Disable Linked Collision", "Disable collision between linked bodies"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "show_pivot", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_DRAW_PIVOT); RNA_def_property_ui_text(prop, "Draw Pivot", "Display the pivot point and rotation in 3D view"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); /* Limits */ @@ -1427,64 +1443,64 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) /* Limit Min/Max for angle */ prop = RNA_def_property(srna, "limit_angle_min_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "minLimit[3]"); - RNA_def_property_range(prop, -M_PI*2, M_PI*2); + RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Minimum Angular Limit X", ""); prop = RNA_def_property(srna, "limit_angle_min_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "minLimit[4]"); - RNA_def_property_range(prop, -M_PI*2, M_PI*2); + RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Minimum Angular Limit Y", ""); prop = RNA_def_property(srna, "limit_angle_min_z", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "minLimit[5]"); - RNA_def_property_range(prop, -M_PI*2, M_PI*2); + RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Minimum Angular Limit Z", ""); prop = RNA_def_property(srna, "limit_angle_max_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "maxLimit[3]"); - RNA_def_property_range(prop, -M_PI*2, M_PI*2); + RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Maximum Angular Limit X", ""); prop = RNA_def_property(srna, "limit_angle_max_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "maxLimit[4]"); - RNA_def_property_range(prop, -M_PI*2, M_PI*2); + RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Maximum Angular Limit Y", ""); prop = RNA_def_property(srna, "limit_angle_max_z", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "maxLimit[5]"); - RNA_def_property_range(prop, -M_PI*2, M_PI*2); + RNA_def_property_range(prop, -M_PI * 2, M_PI * 2); RNA_def_property_ui_text(prop, "Maximum Angular Limit Z", ""); /* Limit Booleans */ prop = RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); RNA_def_property_ui_text(prop, "Limit X", "Use minimum/maximum X limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 2); RNA_def_property_ui_text(prop, "Limit Y", "Use minimum/maximum y limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 4); RNA_def_property_ui_text(prop, "Limit Z", "Use minimum/maximum z limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_angular_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 8); RNA_def_property_ui_text(prop, "Angular X Limit", "Use minimum/maximum X angular limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_angular_limit_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 16); RNA_def_property_ui_text(prop, "Angular Y Limit", "Use minimum/maximum Y angular limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_angular_limit_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 32); RNA_def_property_ui_text(prop, "Angular Z Limit", "Use minimum/maximum Z angular limit"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_clamp_to(BlenderRNA *brna) @@ -1497,7 +1513,8 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna) {CLAMPTO_X, "CLAMPTO_X", 0, "X", ""}, {CLAMPTO_Y, "CLAMPTO_Y", 0, "Y", ""}, {CLAMPTO_Z, "CLAMPTO_Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ClampToConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Clamp To Constraint", @@ -1509,18 +1526,18 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "main_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, clamp_items); RNA_def_property_ui_text(prop, "Main Axis", "Main axis of movement"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", CLAMPTO_CYCLIC); RNA_def_property_ui_text(prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box)"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_transform(BlenderRNA *brna) @@ -1532,13 +1549,15 @@ static void rna_def_constraint_transform(BlenderRNA *brna) {0, "LOCATION", 0, "Loc", ""}, {1, "ROTATION", 0, "Rot", ""}, {2, "SCALE", 0, "Scale", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem axis_map_items[] = { {0, "X", 0, "X", ""}, {1, "Y", 0, "Y", ""}, {2, "Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "TransformConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Transformation Constraint", "Map transformations of the target to the object"); @@ -1548,119 +1567,119 @@ static void rna_def_constraint_transform(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "from"); RNA_def_property_enum_items(prop, transform_items); RNA_def_property_ui_text(prop, "Map From", "The transformation type to use from the target"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "map_to", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "to"); RNA_def_property_enum_items(prop, transform_items); RNA_def_property_ui_text(prop, "Map To", "The transformation type to affect of the constrained object"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "map_to_x_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "map[0]"); RNA_def_property_enum_items(prop, axis_map_items); RNA_def_property_ui_text(prop, "Map To X From", "The source axis constrained object's X axis uses"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "map_to_y_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "map[1]"); RNA_def_property_enum_items(prop, axis_map_items); RNA_def_property_ui_text(prop, "Map To Y From", "The source axis constrained object's Y axis uses"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "map_to_z_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "map[2]"); RNA_def_property_enum_items(prop, axis_map_items); RNA_def_property_ui_text(prop, "Map To Z From", "The source axis constrained object's Z axis uses"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_motion_extrapolate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "expo", CLAMPTO_CYCLIC); RNA_def_property_ui_text(prop, "Extrapolate Motion", "Extrapolate ranges"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "from_min_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "from_min[0]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "From Minimum X", "Bottom range of X axis source motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "from_min_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "from_min[1]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "From Minimum Y", "Bottom range of Y axis source motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "from_min_z", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "from_min[2]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "From Minimum Z", "Bottom range of Z axis source motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "from_max_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "from_max[0]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "From Maximum X", "Top range of X axis source motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "from_max_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "from_max[1]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "From Maximum Y", "Top range of Y axis source motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "from_max_z", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "from_max[2]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "From Maximum Z", "Top range of Z axis source motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "to_min_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "to_min[0]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "To Minimum X", "Bottom range of X axis destination motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "to_min_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "to_min[1]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "To Minimum Y", "Bottom range of Y axis destination motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "to_min_z", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "to_min[2]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "To Minimum Z", "Bottom range of Z axis destination motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "to_max_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "to_max[0]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "To Maximum X", "Top range of X axis destination motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "to_max_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "to_max[1]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "To Maximum Y", "Top range of Y axis destination motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "to_max_z", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "to_max[2]"); RNA_def_property_ui_range(prop, -1000.0f, 1000.0f, 10, 3); RNA_def_property_ui_text(prop, "To Maximum Z", "Top range of Z axis destination motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_location_limit(BlenderRNA *brna) @@ -1675,73 +1694,73 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN); RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN); RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN); RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX); RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX); RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX); RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "xmin"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "ymin"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "zmin"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "xmax"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "ymax"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "zmax"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM); RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_rotation_limit(BlenderRNA *brna) @@ -1756,58 +1775,58 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XROT); RNA_def_property_ui_text(prop, "Limit X", "Use the minimum X value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_limit_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YROT); RNA_def_property_ui_text(prop, "Limit Y", "Use the minimum Y value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_limit_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZROT); RNA_def_property_ui_text(prop, "Limit Z", "Use the minimum Z value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "xmin"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "ymin"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "zmin"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "xmax"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "ymax"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "zmax"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM); RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_size_limit(BlenderRNA *brna) @@ -1822,73 +1841,73 @@ static void rna_def_constraint_size_limit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN); RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMIN); RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_min_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMIN); RNA_def_property_ui_text(prop, "Minimum Z", "Use the minimum Z value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMAX); RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_YMAX); RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_max_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_ZMAX); RNA_def_property_ui_text(prop, "Maximum Z", "Use the maximum Z value"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xmin"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ymin"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "min_z", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "zmin"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Minimum Z", "Lowest Z value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xmax"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ymax"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "max_z", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "zmax"); RNA_def_property_range(prop, -1000.0, 1000.f); RNA_def_property_ui_text(prop, "Maximum Z", "Highest Z value to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", LIMIT_TRANSFORM); RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_distance_limit(BlenderRNA *brna) @@ -1902,7 +1921,7 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data"); @@ -1910,29 +1929,29 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0, 100.f); RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "limit_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, constraint_distance_items); RNA_def_property_ui_text(prop, "Limit Mode", "Distances in relation to sphere of influence to allow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_transform_limit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMITDIST_TRANSFORM); RNA_def_property_ui_text(prop, "For Transform", "Transforms are affected by this constraint as well"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) @@ -1947,7 +1966,8 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) "Shrink the location to the nearest target surface along a given axis"}, {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the location to the nearest target vertex"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ShrinkwrapConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Shrinkwrap Constraint", "Create constraint-based shrinkwrap relationship"); @@ -1958,34 +1978,34 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "shrinkwrap_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "shrinkType"); RNA_def_property_enum_items(prop, type_items); RNA_def_property_ui_text(prop, "Shrinkwrap Type", "Select type of shrinkwrap algorithm for target position"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0, 100.f); RNA_def_property_ui_text(prop, "Distance", "Distance to Target"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS); RNA_def_property_ui_text(prop, "Axis X", "Projection over X Axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS); RNA_def_property_ui_text(prop, "Axis Y", "Projection over Y Axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS); RNA_def_property_ui_text(prop, "Axis Z", "Projection over Z Axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_damped_track(BlenderRNA *brna) @@ -2000,7 +2020,8 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna) {TRACK_nX, "TRACK_NEGATIVE_X", 0, "-X", ""}, {TRACK_nY, "TRACK_NEGATIVE_Y", 0, "-Y", ""}, {TRACK_nZ, "TRACK_NEGATIVE_Z", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "DampedTrackConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Damped Track Constraint", @@ -2009,7 +2030,7 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna) prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_struct_sdna_from(srna, "bDampTrackConstraint", "data"); @@ -2017,18 +2038,18 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); RNA_def_property_enum_items(prop, damptrack_items); RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_spline_ik(BlenderRNA *brna) @@ -2042,7 +2063,8 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) "Use the original scaling of the bones"}, {CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC, "VOLUME_PRESERVE", 0, "Volume Preservation", "Scale of the X and Z axes is the inverse of the Y-Scale"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SplineIKConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Spline IK Constraint", "Align 'n' bones along a curve"); @@ -2053,15 +2075,15 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Curve that controls this relationship"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "chainlen"); - /* TODO: this should really check the max length of the chain the constraint is attached to */ + /* TODO: this should really check the max length of the chain the constraint is attached to */ RNA_def_property_range(prop, 1, 255); RNA_def_property_ui_text(prop, "Chain Length", "How many bones are included in the chain"); - /* XXX: this update goes wrong... needs extra flush? */ - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + /* XXX: this update goes wrong... needs extra flush? */ + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* direct access to bindings */ /* NOTE: only to be used by experienced users */ @@ -2074,38 +2096,38 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Joint Bindings", "(EXPERIENCED USERS ONLY) The relative positions of the joints along the chain, " "as percentages"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); /* settings */ prop = RNA_def_property(srna, "use_chain_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_NO_ROOT); RNA_def_property_ui_text(prop, "Chain Offset", "Offset the entire chain relative to the root joint"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_even_divisions", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_EVENSPLITS); RNA_def_property_ui_text(prop, "Even Divisions", "Ignore the relative lengths of the bones when fitting to the curve"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_y_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_SCALE_LIMITED); RNA_def_property_ui_text(prop, "Y Stretch", "Stretch the Y axis of the bones to fit the curve"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "use_curve_radius", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_SPLINEIK_NO_CURVERAD); RNA_def_property_ui_text(prop, "Use Curve Radius", "Average radius of the endpoints is used to tweak the X and Z Scaling of the bones, " "on top of XZ Scale mode"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "xz_scale_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "xzScaleMode"); RNA_def_property_enum_items(prop, splineik_xz_scale_mode); RNA_def_property_ui_text(prop, "XZ Scale Mode", "Method used for determining the scaling of the X and Z axes of the bones"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_pivot(BlenderRNA *brna) @@ -2124,7 +2146,8 @@ static void rna_def_constraint_pivot(BlenderRNA *brna) {PIVOTCON_AXIS_X, "X", 0, "X Rot", "Use the pivot point in the positive rotation range around the X-axis"}, {PIVOTCON_AXIS_Y, "Y", 0, "Y Rot", "Use the pivot point in the positive rotation range around the Y-axis"}, {PIVOTCON_AXIS_Z, "Z", 0, "Z Rot", "Use the pivot point in the positive rotation range around the Z-axis"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "PivotConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Pivot Constraint", "Rotate around a different point"); @@ -2132,7 +2155,7 @@ static void rna_def_constraint_pivot(BlenderRNA *brna) prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_struct_sdna_from(srna, "bPivotConstraint", "data"); @@ -2141,33 +2164,33 @@ static void rna_def_constraint_pivot(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target Object, defining the position of the pivot when defined"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* pivot offset */ prop = RNA_def_property(srna, "use_relative_location", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PIVOTCON_FLAG_OFFSET_ABS); RNA_def_property_ui_text(prop, "Use Relative Offset", "Offset will be an absolute point in space instead of relative to the target"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_ui_text(prop, "Offset", "Offset of pivot from target (when set), or from owner's location " "(when Fixed Position is off), or the absolute pivot point"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); /* rotation-based activation */ prop = RNA_def_property(srna, "rotation_range", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotAxis"); RNA_def_property_enum_items(prop, pivot_rotAxis_items); RNA_def_property_ui_text(prop, "Enabled Rotation Range", "Rotation range on which pivoting should occur"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_follow_track(BlenderRNA *brna) @@ -2184,31 +2207,31 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "clip"); RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* track */ prop = RNA_def_property(srna, "track", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "track"); RNA_def_property_ui_text(prop, "Track", "Movie tracking track to follow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* use default clip */ prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FOLLOWTRACK_ACTIVECLIP); RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); /* use 3d position */ prop = RNA_def_property(srna, "use_3d_position", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FOLLOWTRACK_USE_3D_POSITION); RNA_def_property_ui_text(prop, "3D Position", "Use 3D position of track to parent to"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); /* object */ prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "object"); RNA_def_property_ui_text(prop, "Object", "Movie tracking object to follow (if empty, camera object is used)"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* camera */ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); @@ -2216,7 +2239,7 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_followTrack_camera_set", NULL, "rna_Constraint_cameraObject_poll"); @@ -2226,7 +2249,7 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Depth Object", "Object used to define depth in camera space by projecting onto surface of this object"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_followTrack_depthObject_set", NULL, "rna_Constraint_followTrack_depthObject_poll"); } @@ -2245,13 +2268,13 @@ static void rna_def_constraint_camera_solver(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "clip"); RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* use default clip */ prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAMERASOLVER_ACTIVECLIP); RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } static void rna_def_constraint_object_solver(BlenderRNA *brna) @@ -2268,19 +2291,19 @@ static void rna_def_constraint_object_solver(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "clip"); RNA_def_property_ui_text(prop, "Movie Clip", "Movie Clip to get tracking data from"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* use default clip */ prop = RNA_def_property(srna, "use_active_clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAMERASOLVER_ACTIVECLIP); RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); /* object */ prop = RNA_def_property(srna, "object", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "object"); RNA_def_property_ui_text(prop, "Object", "Movie tracking object to follow"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); /* camera */ prop = RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); @@ -2288,7 +2311,7 @@ static void rna_def_constraint_object_solver(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Camera", "Camera to which motion is parented (if empty active scene camera is used)"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); RNA_def_property_pointer_funcs(prop, NULL, "rna_Constraint_objectSolver_camera_set", NULL, "rna_Constraint_cameraObject_poll"); } @@ -2300,7 +2323,7 @@ void RNA_def_constraint(BlenderRNA *brna) PropertyRNA *prop; /* data */ - srna = RNA_def_struct(brna, "Constraint", NULL ); + srna = RNA_def_struct(brna, "Constraint", NULL); RNA_def_struct_ui_text(srna, "Constraint", "Constraint modifying the transformation of objects and bones"); RNA_def_struct_refine_func(srna, "rna_ConstraintType_refine"); RNA_def_struct_path_func(srna, "rna_Constraint_path"); @@ -2311,7 +2334,7 @@ void RNA_def_constraint(BlenderRNA *brna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constraint_name_set"); RNA_def_property_ui_text(prop, "Name", "Constraint name"); RNA_def_struct_name_property(srna, prop); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT|NA_RENAME, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT | NA_RENAME, NULL); /* enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); @@ -2342,13 +2365,13 @@ 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_TRIA_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); RNA_def_property_ui_text(prop, "Valid", "Constraint has valid settings and can be evaluated"); - /* TODO: setting this to true must ensure that all others in stack are turned off too... */ + /* TODO: setting this to true must ensure that all others in stack are turned off too... */ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_ACTIVE); RNA_def_property_ui_text(prop, "Active", "Constraint is the one being edited "); @@ -2363,7 +2386,7 @@ void RNA_def_constraint(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "enforce"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Influence", "Amount of influence constraint will have on the final solution"); - RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_influence_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_influence_update"); /* readonly values */ prop = RNA_def_property(srna, "error_location", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index bd149b1f1f3..4204506e67b 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -41,54 +41,54 @@ static PointerRNA rna_Context_manager_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_WindowManager, CTX_wm_manager(C)); } static PointerRNA rna_Context_window_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_Window, CTX_wm_window(C)); } static PointerRNA rna_Context_screen_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_Screen, CTX_wm_screen(C)); } static PointerRNA rna_Context_area_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; PointerRNA newptr; - RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Area, CTX_wm_area(C), &newptr); + RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Area, CTX_wm_area(C), &newptr); return newptr; } static PointerRNA rna_Context_space_data_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; PointerRNA newptr; - RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Space, CTX_wm_space_data(C), &newptr); + RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Space, CTX_wm_space_data(C), &newptr); return newptr; } static PointerRNA rna_Context_region_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; PointerRNA newptr; - RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_Region, CTX_wm_region(C), &newptr); + RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_Region, CTX_wm_region(C), &newptr); return newptr; } static PointerRNA rna_Context_region_data_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; /* only exists for one space still, no generic system yet */ if (CTX_wm_view3d(C)) { PointerRNA newptr; - RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionView3D, CTX_wm_region_data(C), &newptr); + RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_RegionView3D, CTX_wm_region_data(C), &newptr); return newptr; } @@ -97,19 +97,19 @@ static PointerRNA rna_Context_region_data_get(PointerRNA *ptr) static PointerRNA rna_Context_main_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_BlendData, CTX_data_main(C)); } static PointerRNA rna_Context_scene_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_Scene, CTX_data_scene(C)); } static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; ptr->id.data = CTX_data_scene(C); return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C)); } @@ -123,7 +123,7 @@ static PointerRNA rna_Context_user_preferences_get(PointerRNA *UNUSED(ptr)) static int rna_Context_mode_get(PointerRNA *ptr) { - bContext *C = (bContext*)ptr->data; + bContext *C = (bContext *)ptr->data; return CTX_data_mode_enum(C); } @@ -149,7 +149,8 @@ void RNA_def_context(BlenderRNA *brna) {CTX_MODE_PAINT_TEXTURE, "PAINT_TEXTURE", 0, "Texture Paint", ""}, {CTX_MODE_PARTICLE, "PARTICLE", 0, "Particle", ""}, {CTX_MODE_OBJECT, "OBJECT", 0, "Object", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Context", NULL); RNA_def_struct_ui_text(srna, "Context", "Current windowmanager and data context"); diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index fa18c92b86a..6936c5b4324 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -43,36 +43,36 @@ EnumPropertyItem controller_type_items[] = { {CONT_LOGIC_XNOR, "LOGIC_XNOR", 0, "Xnor", "Logic Xnor"}, {CONT_EXPRESSION, "EXPRESSION", 0, "Expression", ""}, {CONT_PYTHON, "PYTHON", 0, "Python", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME #include "BKE_sca.h" #include "DNA_actuator_types.h" -static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr) -{ - bController *controller = (bController*)ptr->data; +static struct StructRNA *rna_Controller_refine(struct PointerRNA *ptr){ + bController *controller = (bController *)ptr->data; switch (controller->type) { - case CONT_LOGIC_AND: - return &RNA_AndController; - case CONT_LOGIC_OR: - return &RNA_OrController; - case CONT_LOGIC_NAND: - return &RNA_NandController; - case CONT_LOGIC_NOR: - return &RNA_NorController; - case CONT_LOGIC_XOR: - return &RNA_XorController; - case CONT_LOGIC_XNOR: - return &RNA_XnorController; - case CONT_EXPRESSION: - return &RNA_ExpressionController; - case CONT_PYTHON: - return &RNA_PythonController; - default: - return &RNA_Controller; + case CONT_LOGIC_AND: + return &RNA_AndController; + case CONT_LOGIC_OR: + return &RNA_OrController; + case CONT_LOGIC_NAND: + return &RNA_NandController; + case CONT_LOGIC_NOR: + return &RNA_NorController; + case CONT_LOGIC_XOR: + return &RNA_XorController; + case CONT_LOGIC_XNOR: + return &RNA_XnorController; + case CONT_EXPRESSION: + return &RNA_ExpressionController; + case CONT_PYTHON: + return &RNA_PythonController; + default: + return &RNA_Controller; } } @@ -116,9 +116,9 @@ static int rna_Controller_state_number_get(struct PointerRNA *ptr) bController *cont = (bController *)ptr->data; int bit; - for (bit = 0; bit<32; bit++) { - if (cont->state_mask & (1<state_mask & (1 << bit)) + return bit + 1; } return 0; } @@ -150,9 +150,9 @@ static void rna_Controller_state_get(PointerRNA *ptr, int *values) bController *cont = (bController *)ptr->data; int i; - memset(values, 0, sizeof(int)*OB_MAX_STATES); - for (i = 0; istate_mask & (1<state_mask & (1 << i)); } static void rna_Controller_state_set(PointerRNA *ptr, const int *values) @@ -161,7 +161,7 @@ static void rna_Controller_state_set(PointerRNA *ptr, const int *values) int i, tot = 0; /* ensure we always have some state selected */ - for (i = 0; i1) + if (tot > 1) return; - for (i = 0; istate_mask |= (1<state_mask &= ~(1<state_mask |= (1 << i); + else cont->state_mask &= ~(1 << i); } } #endif @@ -189,7 +189,8 @@ void RNA_def_controller(BlenderRNA *brna) static EnumPropertyItem python_controller_modes[] = { {CONT_PY_SCRIPT, "SCRIPT", 0, "Script", ""}, {CONT_PY_MODULE, "MODULE", 0, "Module", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; /* Controller */ srna = RNA_def_struct(brna, "Controller", NULL); @@ -265,7 +266,7 @@ void RNA_def_controller(BlenderRNA *brna) RNA_def_property_update(prop, NC_LOGIC, NULL); /* Python Controller */ - srna = RNA_def_struct(brna, "PythonController", "Controller" ); + srna = RNA_def_struct(brna, "PythonController", "Controller"); RNA_def_struct_sdna_from(srna, "bPythonCont", "data"); RNA_def_struct_ui_text(srna, "Python Controller", "Controller executing a python script"); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 96ec37d8fa0..f70fe9082af 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -44,25 +44,28 @@ #include "ED_curve.h" EnumPropertyItem beztriple_handle_type_items[] = { - {HD_FREE, "FREE", 0, "Free", ""}, - {HD_VECT, "VECTOR", 0, "Vector", ""}, - {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, - {HD_AUTO, "AUTO", 0, "Auto", ""}, - {0, NULL, 0, NULL, NULL}}; + {HD_FREE, "FREE", 0, "Free", ""}, + {HD_VECT, "VECTOR", 0, "Vector", ""}, + {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, + {HD_AUTO, "AUTO", 0, "Auto", ""}, + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem keyframe_handle_type_items[] = { - {HD_FREE, "FREE", 0, "Free", ""}, - {HD_VECT, "VECTOR", 0, "Vector", ""}, - {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, - {HD_AUTO, "AUTO", 0, "Automatic", ""}, - {HD_AUTO_ANIM, "AUTO_CLAMPED", 0, "Auto Clamped", "Auto handles clamped to not overshoot"}, - {0, NULL, 0, NULL, NULL}}; + {HD_FREE, "FREE", 0, "Free", ""}, + {HD_VECT, "VECTOR", 0, "Vector", ""}, + {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, + {HD_AUTO, "AUTO", 0, "Automatic", ""}, + {HD_AUTO_ANIM, "AUTO_CLAMPED", 0, "Auto Clamped", "Auto handles clamped to not overshoot"}, + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem beztriple_interpolation_mode_items[] = { - {BEZT_IPO_CONST, "CONSTANT", 0, "Constant", ""}, - {BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""}, - {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""}, - {0, NULL, 0, NULL, NULL}}; + {BEZT_IPO_CONST, "CONSTANT", 0, "Constant", ""}, + {BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""}, + {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""}, + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem curve_type_items[] = { {CU_POLY, "POLY", 0, "Poly", ""}, @@ -70,21 +73,24 @@ EnumPropertyItem curve_type_items[] = { {CU_BSPLINE, "BSPLINE", 0, "BSpline", ""}, {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, {CU_NURBS, "NURBS", 0, "Ease", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static const EnumPropertyItem curve3d_fill_mode_items[] = { {0, "FULL", 0, "Full", ""}, {CU_BACK, "BACK", 0, "Back", ""}, {CU_FRONT, "FRONT", 0, "Front", ""}, - {CU_FRONT|CU_BACK, "HALF", 0, "Half", ""}, - {0, NULL, 0, NULL, NULL}}; + {CU_FRONT | CU_BACK, "HALF", 0, "Half", ""}, + {0, NULL, 0, NULL, NULL} +}; static const EnumPropertyItem curve2d_fill_mode_items[] = { {0, "NONE", 0, "None", ""}, {CU_BACK, "BACK", 0, "Back", ""}, {CU_FRONT, "FRONT", 0, "Front", ""}, - {CU_FRONT|CU_BACK, "BOTH", 0, "Both", ""}, - {0, NULL, 0, NULL, NULL}}; + {CU_FRONT | CU_BACK, "BOTH", 0, "Both", ""}, + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -128,8 +134,8 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index, } if (pt_index) { - if (nu->type == CU_BEZIER) *pt_index = (int)((BezTriple *)point - nu->bezt); - else *pt_index = (int)((BPoint *)point - nu->bp); + if (nu->type == CU_BEZIER) *pt_index = (int)((BezTriple *)point - nu->bezt); + else *pt_index = (int)((BPoint *)point - nu->bp); } } @@ -138,7 +144,7 @@ static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index, static StructRNA *rna_Curve_refine(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->data; + Curve *cu = (Curve *)ptr->data; short obtype = BKE_curve_type_get(cu); if (obtype == OB_FONT) return &RNA_TextCurve; @@ -148,7 +154,7 @@ static StructRNA *rna_Curve_refine(PointerRNA *ptr) static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values) { - BezTriple *bt = (BezTriple*)ptr->data; + BezTriple *bt = (BezTriple *)ptr->data; values[0] = bt->vec[0][0]; values[1] = bt->vec[0][1]; @@ -157,7 +163,7 @@ static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values) static void rna_BezTriple_handle1_set(PointerRNA *ptr, const float *values) { - BezTriple *bt = (BezTriple*)ptr->data; + BezTriple *bt = (BezTriple *)ptr->data; bt->vec[0][0] = values[0]; bt->vec[0][1] = values[1]; @@ -166,7 +172,7 @@ static void rna_BezTriple_handle1_set(PointerRNA *ptr, const float *values) static void rna_BezTriple_handle2_get(PointerRNA *ptr, float *values) { - BezTriple *bt = (BezTriple*)ptr->data; + BezTriple *bt = (BezTriple *)ptr->data; values[0] = bt->vec[2][0]; values[1] = bt->vec[2][1]; @@ -175,7 +181,7 @@ static void rna_BezTriple_handle2_get(PointerRNA *ptr, float *values) static void rna_BezTriple_handle2_set(PointerRNA *ptr, const float *values) { - BezTriple *bt = (BezTriple*)ptr->data; + BezTriple *bt = (BezTriple *)ptr->data; bt->vec[2][0] = values[0]; bt->vec[2][1] = values[1]; @@ -184,7 +190,7 @@ static void rna_BezTriple_handle2_set(PointerRNA *ptr, const float *values) static void rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *values) { - BezTriple *bt = (BezTriple*)ptr->data; + BezTriple *bt = (BezTriple *)ptr->data; values[0] = bt->vec[1][0]; values[1] = bt->vec[1][1]; @@ -193,7 +199,7 @@ static void rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *values) static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values) { - BezTriple *bt = (BezTriple*)ptr->data; + BezTriple *bt = (BezTriple *)ptr->data; bt->vec[1][0] = values[0]; bt->vec[1][1] = values[1]; @@ -202,7 +208,7 @@ static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values) static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->data; + Curve *cu = (Curve *)ptr->data; if (cu->texflag & CU_AUTOSPACE) BKE_curve_texspace_calc(cu); @@ -210,8 +216,8 @@ static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), Po static int rna_Curve_texspace_editable(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->data; - return (cu->texflag & CU_AUTOSPACE)? 0: PROP_EDITABLE; + Curve *cu = (Curve *)ptr->data; + return (cu->texflag & CU_AUTOSPACE) ? 0 : PROP_EDITABLE; } static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values) @@ -250,24 +256,24 @@ static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values) static void rna_Curve_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; *min = 0; - *max = cu->totcol-1; + *max = cu->totcol - 1; *max = MAX2(0, *max); } static void rna_Curve_active_textbox_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; *min = 0; - *max = cu->totbox-1; + *max = cu->totbox - 1; *max = MAX2(0, *max); } static void rna_Curve_dimension_set(PointerRNA *ptr, int value) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; if (value == CU_3D) cu->flag |= CU_3D; else cu->flag &= ~CU_3D; @@ -277,7 +283,7 @@ static void rna_Curve_dimension_set(PointerRNA *ptr, int value) static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *UNUSED(free)) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; /* cast to quiet warning it IS a const still */ return (EnumPropertyItem *)((cu->flag & CU_3D) ? curve3d_fill_mode_items : curve2d_fill_mode_items); @@ -285,28 +291,28 @@ static EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C), PointerR static int rna_Nurb_length(PointerRNA *ptr) { - Nurb *nu = (Nurb*)ptr->data; + Nurb *nu = (Nurb *)ptr->data; if (nu->type == CU_BEZIER) return 0; - return nu->pntsv>0 ? nu->pntsu*nu->pntsv : nu->pntsu; + return nu->pntsv > 0 ? nu->pntsu * nu->pntsv : nu->pntsu; } static void rna_Nurb_type_set(PointerRNA *ptr, int value) { - Nurb *nu = (Nurb*)ptr->data; + Nurb *nu = (Nurb *)ptr->data; ED_nurb_set_spline_type(nu, value); } static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Nurb *nu = (Nurb*)ptr->data; - rna_iterator_array_begin(iter, (void*)nu->bp, sizeof(BPoint), - nu->pntsv > 0 ? nu->pntsu*nu->pntsv : nu->pntsu, 0, NULL); + Nurb *nu = (Nurb *)ptr->data; + rna_iterator_array_begin(iter, (void *)nu->bp, sizeof(BPoint), + nu->pntsv > 0 ? nu->pntsu * nu->pntsv : nu->pntsu, 0, NULL); } static void rna_Curve_update_data_id(Main *UNUSED(bmain), Scene *UNUSED(scene), ID *id) { DAG_id_tag_update(id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); } static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -322,7 +328,7 @@ static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; Nurb *nu = curve_nurb_from_point(cu, ptr->data, NULL, NULL); if (nu) @@ -333,7 +339,7 @@ static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr) static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; Object *ob = cu->bevobj; if (ob) @@ -344,8 +350,8 @@ static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr) static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value) { - Curve *cu = (Curve*)ptr->id.data; - Object *ob = (Object*)value.data; + Curve *cu = (Curve *)ptr->id.data; + Object *ob = (Object *)value.data; if (ob) { /* if bevel object has got the save curve, as object, for which it's */ @@ -361,8 +367,8 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value) static int rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value) { - Curve *cu = (Curve*)ptr->id.data; - Object *ob = (Object*)value.data; + Curve *cu = (Curve *)ptr->id.data; + Object *ob = (Object *)value.data; if (ob) { if (ob->type == OB_CURVE && ob->data != cu) { @@ -375,7 +381,7 @@ static int rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value) static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; Object *ob = cu->taperobj; if (ob) @@ -386,8 +392,8 @@ static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr) static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value) { - Curve *cu = (Curve*)ptr->id.data; - Object *ob = (Object*)value.data; + Curve *cu = (Curve *)ptr->id.data; + Object *ob = (Object *)value.data; if (ob) { /* if taper object has got the save curve, as object, for which it's */ @@ -403,7 +409,7 @@ static void rna_Curve_taperObject_set(PointerRNA *ptr, PointerRNA value) static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; ListBase *nurbs = BKE_curve_nurbs_get(cu); Nurb *nu = nurbs->first; @@ -417,7 +423,7 @@ static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, Pointe static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; ListBase *nurbs = BKE_curve_nurbs_get(cu); Nurb *nu = nurbs->first; @@ -432,26 +438,26 @@ static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, Pointe static float rna_Curve_offset_get(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; return cu->width - 1.0f; } static void rna_Curve_offset_set(PointerRNA *ptr, float value) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; cu->width = 1.0f + value; } /* name functions that ignore the first two ID characters */ void rna_Curve_body_get(PointerRNA *ptr, char *value) { - Curve *cu = (Curve*)ptr->id.data; - BLI_strncpy(value, cu->str, cu->len+1); + Curve *cu = (Curve *)ptr->id.data; + BLI_strncpy(value, cu->str, cu->len + 1); } int rna_Curve_body_length(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; return cu->len; } @@ -459,7 +465,7 @@ int rna_Curve_body_length(PointerRNA *ptr) void rna_Curve_body_set(PointerRNA *ptr, const char *value) { int len = strlen(value); - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; cu->len = cu->pos = len; @@ -470,15 +476,15 @@ void rna_Curve_body_set(PointerRNA *ptr, const char *value) cu->str = MEM_callocN(len + sizeof(wchar_t), "str"); /* don't know why this is +4, just duplicating load_editText() */ - cu->strinfo = MEM_callocN((len+4) *sizeof(CharInfo), "strinfo"); + cu->strinfo = MEM_callocN((len + 4) * sizeof(CharInfo), "strinfo"); /*BLI_strncpy_wchar_as_utf8(cu->str, value, len+1); *//* value is not wchar_t */ - BLI_strncpy(cu->str, value, len+1); + BLI_strncpy(cu->str, value, len + 1); } static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr) { - Nurb *nu = (Nurb*)ptr->data; + Nurb *nu = (Nurb *)ptr->data; if (nu->type == CU_BEZIER) { BKE_nurb_handles_calc(nu); @@ -492,7 +498,7 @@ static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr) { - Nurb *nu = (Nurb*)ptr->data; + Nurb *nu = (Nurb *)ptr->data; BKE_nurb_knot_calc_v(nu); @@ -501,7 +507,7 @@ static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr) { - Nurb *nu = (Nurb*)ptr->data; + Nurb *nu = (Nurb *)ptr->data; BKE_nurb_order_clamp_u(nu); BKE_nurb_knot_calc_u(nu); @@ -511,7 +517,7 @@ static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr) { - Nurb *nu = (Nurb*)ptr->data; + Nurb *nu = (Nurb *)ptr->data; BKE_nurb_order_clamp_v(nu); BKE_nurb_knot_calc_v(nu); @@ -558,7 +564,7 @@ static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, ReportList *reports static Nurb *rna_Curve_spline_new(Curve *cu, int type) { - Nurb *nu = (Nurb *) MEM_callocN(sizeof( Nurb ), "spline.new" ); + Nurb *nu = (Nurb *) MEM_callocN(sizeof(Nurb), "spline.new"); if (type == CU_BEZIER) { BezTriple *bezt = (BezTriple *)MEM_callocN(sizeof(BezTriple), "spline.new.bezt"); @@ -592,7 +598,7 @@ static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu) found = BLI_remlink_safe(nurbs, nu); if (!found) { - BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" does not contain spline given", cu->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" does not contain spline given", cu->id.name + 2); return; } @@ -600,7 +606,7 @@ static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, Nurb *nu) /* invalidate pointer!, no can do */ DAG_id_tag_update(&cu->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_GEOM|ND_DATA, NULL); + WM_main_add_notifier(NC_GEOM | ND_DATA, NULL); } static void rna_Curve_spline_clear(Curve *cu) @@ -610,12 +616,12 @@ static void rna_Curve_spline_clear(Curve *cu) BKE_nurbList_free(nurbs); DAG_id_tag_update(&cu->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_GEOM|ND_DATA, NULL); + WM_main_add_notifier(NC_GEOM | ND_DATA, NULL); } static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->data; + Curve *cu = (Curve *)ptr->data; Nurb *nu; ListBase *nurbs = BKE_curve_nurbs_get(cu); @@ -630,7 +636,7 @@ static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr) static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value) { - Curve *cu = (Curve*)ptr->data; + Curve *cu = (Curve *)ptr->data; Nurb *nu = value.data; ListBase *nubase = BKE_curve_nurbs_get(cu); @@ -643,7 +649,7 @@ static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value) static char *rna_Curve_spline_path(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; ListBase *nubase = BKE_curve_nurbs_get(cu); Nurb *nu = ptr->data; int index = BLI_findindex(nubase, nu); @@ -657,7 +663,7 @@ static char *rna_Curve_spline_path(PointerRNA *ptr) /* use for both bezier and nurbs */ static char *rna_Curve_spline_point_path(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; Nurb *nu; void *point = ptr->data; int nu_index, pt_index; @@ -680,7 +686,7 @@ static char *rna_Curve_spline_point_path(PointerRNA *ptr) static char *rna_TextBox_path(PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; TextBox *tb = ptr->data; int index = (int)(tb - cu->tb); @@ -692,7 +698,7 @@ static char *rna_TextBox_path(PointerRNA *ptr) static void rna_Curve_splines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Curve *cu = (Curve*)ptr->id.data; + Curve *cu = (Curve *)ptr->id.data; rna_iterator_listbase_begin(iter, BKE_curve_nurbs_get(cu), NULL); } @@ -909,7 +915,8 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) {CU_RIGHT, "RIGHT", 0, "Right", "Align text to the right"}, {CU_JUSTIFY, "JUSTIFY", 0, "Justify", "Align to the left and the right"}, {CU_FLUSH, "FLUSH", 0, "Flush", "Align to the left and the right, with equal character spacing"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; /* Enums */ prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE); @@ -992,7 +999,7 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) /* strings */ prop = RNA_def_property(srna, "family", PROP_STRING, PROP_NONE); - RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2); + RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2); RNA_def_property_ui_text(prop, "Object Font", "Use Blender Objects as font characters (give font objects a common name " "followed by the character they represent, eg. familya, familyb, etc, " @@ -1117,10 +1124,12 @@ static void rna_def_charinfo(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Curve_update_data"); /* probably there is no reason to expose this */ - /* prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE); +#if 0 + prop= RNA_def_property(srna, "wrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_WRAP); RNA_def_property_ui_text(prop, "Wrap", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); */ +#endif prop = RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_CHINFO_SMALLCAPS); @@ -1170,16 +1179,16 @@ static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "add", "rna_Curve_spline_points_add"); RNA_def_function_ui_description(func, "Add a number of points to this spline"); - RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS); RNA_def_int(func, "count", 1, 1, INT_MAX, "Number", "Number of points to add to the spline", 1, INT_MAX); - /* +#if 0 func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); - */ +#endif } static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop) @@ -1197,15 +1206,15 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add"); RNA_def_function_ui_description(func, "Add a number of points to this spline"); - RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_REPORTS); RNA_def_int(func, "count", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX); #if 0 - func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); + func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); #endif } @@ -1234,7 +1243,7 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "clear", "rna_Curve_spline_clear"); RNA_def_function_ui_description(func, "Remove all spline from a curve"); @@ -1246,7 +1255,7 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_ui_text(prop, "Active Spline", "Active curve spline"); /* Could call: ED_base_object_activate(C, scene->basact); * but would be a bad level call and it seems the notifier is enough */ - RNA_def_property_update(prop, NC_SCENE|ND_OB_ACTIVE, NULL); + RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, NULL); } @@ -1256,16 +1265,18 @@ static void rna_def_curve(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem curve_twist_mode_items[] = { - {CU_TWIST_Z_UP, "Z_UP", 0, "Z-Up", "Use Z-Up axis to calculate the curve twist at each point"}, - {CU_TWIST_MINIMUM, "MINIMUM", 0, "Minimum", "Use the least twist over the entire curve"}, - {CU_TWIST_TANGENT, "TANGENT", 0, "Tangent", "Use the tangent to calculate twist"}, - {0, NULL, 0, NULL, NULL}}; + {CU_TWIST_Z_UP, "Z_UP", 0, "Z-Up", "Use Z-Up axis to calculate the curve twist at each point"}, + {CU_TWIST_MINIMUM, "MINIMUM", 0, "Minimum", "Use the least twist over the entire curve"}, + {CU_TWIST_TANGENT, "TANGENT", 0, "Tangent", "Use the tangent to calculate twist"}, + {0, NULL, 0, NULL, NULL} + }; static const EnumPropertyItem curve_axis_items[] = { {0, "2D", 0, "2D", "Clamp the Z axis of the curve"}, {CU_3D, "3D", 0, "3D", - "Allow editing on the Z axis of this curve, also allows tilt and curve radius to be used"}, - {0, NULL, 0, NULL, NULL}}; + "Allow editing on the Z axis of this curve, also allows tilt and curve radius to be used"}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Curve", "ID"); RNA_def_struct_ui_text(srna, "Curve", "Curve datablock storing curves, splines and NURBS"); @@ -1295,12 +1306,12 @@ static void rna_def_curve(BlenderRNA *brna) prop = RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_HANDLES); RNA_def_property_ui_text(prop, "Draw Handles", "Display Bezier handles in editmode"); - RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); + RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL); prop = RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "drawflag", CU_HIDE_NORMALS); RNA_def_property_ui_text(prop, "Draw Normals", "Display 3D curve normals in editmode"); - RNA_def_property_update(prop, NC_GEOM|ND_DATA, NULL); + RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL); rna_def_path(brna, srna); @@ -1313,21 +1324,21 @@ static void rna_def_curve(BlenderRNA *brna) "Bevel resolution when depth is non-zero and no specific bevel object has been defined"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH); + prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "width"); RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3); RNA_def_property_float_funcs(prop, "rna_Curve_offset_get", "rna_Curve_offset_set", NULL); RNA_def_property_ui_text(prop, "Offset", "Offset the curve to adjust the width of a text"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop = RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH); + prop = RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "ext1"); RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3); RNA_def_property_range(prop, 0.0, FLT_MAX); RNA_def_property_ui_text(prop, "Extrude", "Amount of curve extrusion when not using a bevel object"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop = RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH); + prop = RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "ext2"); RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3); RNA_def_property_ui_text(prop, "Bevel Depth", "Bevel depth when not using a bevel object"); @@ -1432,7 +1443,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "texflag", CU_AUTOSPACE); RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Curve_texspace_set"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Curve_texspace_set"); prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); @@ -1451,7 +1462,7 @@ static void rna_def_curve(BlenderRNA *brna) /* not supported yet */ #if 0 - prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); + prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); RNA_def_property_float(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); RNA_def_property_editable_func(prop, texspace_editable); @@ -1491,7 +1502,8 @@ static void rna_def_curve_nurb(BlenderRNA *brna) {KEY_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, {KEY_BSPLINE, "BSPLINE", 0, "BSpline", ""}, {KEY_CU_EASE, "EASE", 0, "Ease", ""}, /* todo, define somewhere, not one of BEZT_IPO_* */ - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; StructRNA *srna; PropertyRNA *prop; diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 4c2af854f67..09cbf8bd90a 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -51,8 +51,8 @@ BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1}; /* Duplicated code since we can't link in blenkernel or blenlib */ #ifndef MIN2 -#define MIN2(x,y) ((x)<(y)? (x): (y)) -#define MAX2(x,y) ((x)>(y)? (x): (y)) +#define MIN2(x, y) ((x) < (y) ? (x) : (y)) +#define MAX2(x, y) ((x) > (y) ? (x) : (y)) #endif /* pedantic check for '.', do this since its a hassle for translators */ @@ -268,11 +268,11 @@ static ContainerDefRNA *rna_find_container_def(ContainerRNA *cont) return NULL; } - ds = rna_find_struct_def((StructRNA*)cont); + ds = rna_find_struct_def((StructRNA *)cont); if (ds) return &ds->cont; - dfunc = rna_find_function_def((FunctionRNA*)cont); + dfunc = rna_find_function_def((FunctionRNA *)cont); if (dfunc) return &dfunc->cont; @@ -293,20 +293,20 @@ static int rna_member_cmp(const char *name, const char *oname) int a = 0; /* compare without pointer or array part */ - while (name[0] =='*') + while (name[0] == '*') name++; - while (oname[0] =='*') + while (oname[0] == '*') oname++; while (1) { - if (name[a] =='[' && oname[a] == 0) return 1; - if (name[a] =='[' && oname[a] =='[') return 1; + if (name[a] == '[' && oname[a] == 0) return 1; + if (name[a] == '[' && oname[a] == '[') return 1; if (name[a] == 0) break; if (name[a] != oname[a]) return 0; a++; } if (name[a] == 0 && oname[a] == '.') return 2; - if (name[a] == 0 && oname[a] == '-' && oname[a+1] == '>') return 3; + if (name[a] == 0 && oname[a] == '-' && oname[a + 1] == '>') return 3; return (name[a] == oname[a]); } @@ -325,7 +325,7 @@ static int rna_find_sdna_member(SDNA *sdna, const char *structname, const char * totmember = sp[1]; sp += 2; - for (a = 0; anames[sp[1]]; cmp = rna_member_cmp(dnaname, membername); @@ -400,11 +400,11 @@ static int rna_validate_identifier(const char *identifier, char *error, int prop } } - if (identifier[a] =='_') { + if (identifier[a] == '_') { continue; } - if (identifier[a] ==' ') { + if (identifier[a] == ' ') { strcpy(error, "spaces are not okay in identifier names"); return 0; } @@ -492,9 +492,9 @@ void RNA_define_verify_sdna(int verify) void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext) { #ifdef RNA_RUNTIME - ext->free(ext->data); /* decref's the PyObject that the srna owns */ - RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */ - RNA_struct_py_type_set(srna, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */ + ext->free(ext->data); /* decref's the PyObject that the srna owns */ + RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */ + RNA_struct_py_type_set(srna, NULL); /* NULL the srna's value so RNA_struct_free wont complain of a leak */ #endif } @@ -505,12 +505,13 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna) PropertyRNA *prop, *nextprop; PropertyRNA *parm, *nextparm; - /* +#if 0 if (srna->flag & STRUCT_RUNTIME) { if (RNA_struct_py_type_get(srna)) { fprintf(stderr, "%s '%s' freed while holding a python reference\n", __func__, srna->identifier); } - } */ + } +#endif for (prop = srna->cont.properties.first; prop; prop = nextprop) { nextprop = prop->next; @@ -691,7 +692,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char * } else { #ifdef RNA_RUNTIME - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; cprop->begin = rna_builtin_properties_begin; cprop->next = rna_builtin_properties_next; cprop->get = rna_builtin_properties_get; @@ -709,7 +710,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char * } else { #ifdef RNA_RUNTIME - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; pprop->get = rna_builtin_type_get; pprop->type = &RNA_Struct; #endif @@ -920,20 +921,20 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier } break; case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; - iprop->hardmin = (subtype == PROP_UNSIGNED)? 0: INT_MIN; + iprop->hardmin = (subtype == PROP_UNSIGNED) ? 0 : INT_MIN; iprop->hardmax = INT_MAX; - iprop->softmin = (subtype == PROP_UNSIGNED)? 0: -10000; /* rather arbitrary .. */ + iprop->softmin = (subtype == PROP_UNSIGNED) ? 0 : -10000; /* rather arbitrary .. */ iprop->softmax = 10000; iprop->step = 1; break; } case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; - fprop->hardmin = (subtype == PROP_UNSIGNED)? 0.0f: -FLT_MAX; + fprop->hardmin = (subtype == PROP_UNSIGNED) ? 0.0f : -FLT_MAX; fprop->hardmax = FLT_MAX; if (ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) { @@ -945,7 +946,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier fprop->softmax = fprop->hardmax = 1.0f; } else { - fprop->softmin = (subtype == PROP_UNSIGNED)? 0.0f: -10000.0f; /* rather arbitrary .. */ + fprop->softmin = (subtype == PROP_UNSIGNED) ? 0.0f : -10000.0f; /* rather arbitrary .. */ fprop->softmax = 10000.0f; } fprop->step = 10; @@ -953,7 +954,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier break; } case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; sprop->defaultvalue = ""; break; @@ -1038,10 +1039,10 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier } } else { - prop->flag |= PROP_IDPROPERTY|PROP_RUNTIME; + prop->flag |= PROP_IDPROPERTY | PROP_RUNTIME; #ifdef RNA_RUNTIME if (cont->prophash) - BLI_ghash_insert(cont->prophash, (void*)prop->identifier, prop); + BLI_ghash_insert(cont->prophash, (void *)prop->identifier, prop); #endif } @@ -1069,14 +1070,14 @@ void RNA_def_property_array(PropertyRNA *prop, int length) { StructRNA *srna = DefRNA.laststruct; - if (length<0) { + if (length < 0) { fprintf(stderr, "%s: \"%s.%s\", array length must be zero of greater.\n", __func__, srna->identifier, prop->identifier); DefRNA.error = 1; return; } - if (length>RNA_MAX_ARRAY_LENGTH) { + if (length > RNA_MAX_ARRAY_LENGTH) { fprintf(stderr, "%s: \"%s.%s\", array length must be smaller than %d.\n", __func__, srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH); DefRNA.error = 1; @@ -1134,10 +1135,10 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le prop->totarraylength = 0; if (length) { - memcpy(prop->arraylength, length, sizeof(int)*dimension); + memcpy(prop->arraylength, length, sizeof(int) * dimension); prop->totarraylength = length[0]; - for (i = 1; itotarraylength *= length[i]; } else @@ -1167,14 +1168,14 @@ void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double switch (prop->type) { case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; iprop->softmin = (int)min; iprop->softmax = (int)max; iprop->step = (int)step; break; } case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprop->softmin = (float)min; fprop->softmax = (float)max; fprop->step = (float)step; @@ -1195,7 +1196,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max) switch (prop->type) { case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; iprop->hardmin = (int)min; iprop->hardmax = (int)max; iprop->softmin = MAX2((int)min, iprop->hardmin); @@ -1203,7 +1204,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max) break; } case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprop->hardmin = (float)min; fprop->hardmax = (float)max; fprop->softmin = MAX2((float)min, fprop->hardmin); @@ -1228,13 +1229,13 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type) switch (prop->type) { case PROP_POINTER: { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; - pprop->type = (StructRNA*)type; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; + pprop->type = (StructRNA *)type; break; } case PROP_COLLECTION: { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; - cprop->item_type = (StructRNA*)type; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; + cprop->item_type = (StructRNA *)type; break; } default: @@ -1256,7 +1257,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type) switch (prop->type) { case PROP_POINTER: { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; pprop->type = type; if (type && (type->flag & STRUCT_ID_REFCOUNT)) @@ -1265,7 +1266,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type) break; } case PROP_COLLECTION: { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; cprop->item_type = type; break; } @@ -1284,8 +1285,8 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item switch (prop->type) { case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; - eprop->item = (EnumPropertyItem*)item; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; + eprop->item = (EnumPropertyItem *)item; eprop->totitem = 0; for (i = 0; item[i].identifier; i++) { eprop->totitem++; @@ -1319,7 +1320,7 @@ void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength) switch (prop->type) { case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; sprop->maxlength = maxlength; break; } @@ -1336,7 +1337,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, int value) switch (prop->type) { case PROP_BOOLEAN: { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; bprop->defaultvalue = value; break; } @@ -1353,7 +1354,7 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array) switch (prop->type) { case PROP_BOOLEAN: { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; bprop->defaultarray = array; break; } @@ -1370,7 +1371,7 @@ void RNA_def_property_int_default(PropertyRNA *prop, int value) switch (prop->type) { case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; iprop->defaultvalue = value; break; } @@ -1387,7 +1388,7 @@ void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array) switch (prop->type) { case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; iprop->defaultarray = array; break; } @@ -1404,7 +1405,7 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value) switch (prop->type) { case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprop->defaultvalue = value; break; } @@ -1421,7 +1422,7 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array) switch (prop->type) { case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprop->defaultarray = array; /* WARNING, this array must not come from the stack and lost */ break; } @@ -1438,7 +1439,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value) switch (prop->type) { case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; sprop->defaultvalue = value; break; } @@ -1456,13 +1457,13 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) switch (prop->type) { case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; eprop->defaultvalue = value; if (prop->flag & PROP_ENUM_FLAG) { /* check all bits are accounted for */ int totflag = 0; - for (i = 0; itotitem; i++) { + for (i = 0; i < eprop->totitem; i++) { if (eprop->item[i].identifier[0]) { totflag |= eprop->item[i].value; } @@ -1475,7 +1476,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) } } else { - for (i = 0; itotitem; i++) { + for (i = 0; i < eprop->totitem; i++) { if (eprop->item[i].identifier[0] && eprop->item[i].value == eprop->defaultvalue) defaultfound = 1; } @@ -1512,7 +1513,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru dp = rna_find_struct_property_def(DefRNA.laststruct, prop); if (dp == NULL) return NULL; - ds = rna_find_struct_def((StructRNA*)dp->cont); + ds = rna_find_struct_def((StructRNA *)dp->cont); if (!structname) structname = ds->dnaname; @@ -1610,7 +1611,7 @@ void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *struc void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname) { PropertyDefRNA *dp; - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; StructRNA *srna = DefRNA.laststruct; if (!DefRNA.preprocess) { @@ -1661,7 +1662,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname) { PropertyDefRNA *dp; - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; StructRNA *srna = DefRNA.laststruct; if (!DefRNA.preprocess) { @@ -1714,7 +1715,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const return; } - if (( /* dp= */ rna_def_property_sdna(prop, structname, propname))) { + if ((/* dp= */ rna_def_property_sdna(prop, structname, propname))) { if (prop->arraydimension) { prop->arraydimension = 0; prop->totarraylength = 0; @@ -1743,7 +1744,7 @@ void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structnam void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname) { /* PropertyDefRNA *dp; */ - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; StructRNA *srna = DefRNA.laststruct; if (!DefRNA.preprocess) { @@ -1800,7 +1801,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *lengthpropname) { PropertyDefRNA *dp; - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; StructRNA *srna = DefRNA.laststruct; if (!DefRNA.preprocess) { @@ -1835,7 +1836,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, if (dp && lengthpropname) { DNAStructMember smember; - StructDefRNA *ds = rna_find_struct_def((StructRNA*)dp->cont); + StructDefRNA *ds = rna_find_struct_def((StructRNA *)dp->cont); if (!structname) structname = ds->dnaname; @@ -1939,7 +1940,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch switch (prop->type) { case PROP_BOOLEAN: { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; if (prop->arraydimension) { if (get) bprop->getarray = (PropBooleanArrayGetFunc)get; @@ -1969,7 +1970,7 @@ void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char * switch (prop->type) { case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (prop->arraydimension) { if (get) iprop->getarray = (PropIntArrayGetFunc)get; @@ -2000,7 +2001,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char switch (prop->type) { case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (prop->arraydimension) { if (get) fprop->getarray = (PropFloatArrayGetFunc)get; @@ -2031,7 +2032,7 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char switch (prop->type) { case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; if (get) eprop->get = (PropEnumGetFunc)get; if (set) eprop->set = (PropEnumSetFunc)set; @@ -2056,7 +2057,7 @@ void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const cha switch (prop->type) { case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; if (get) sprop->get = (PropStringGetFunc)get; if (length) sprop->length = (PropStringLengthFunc)length; @@ -2082,7 +2083,7 @@ void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const ch switch (prop->type) { case PROP_POINTER: { - PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; + PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; if (get) pprop->get = (PropPointerGetFunc)get; if (set) pprop->set = (PropPointerSetFunc)set; @@ -2110,7 +2111,7 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con switch (prop->type) { case PROP_COLLECTION: { - CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; if (begin) cprop->begin = (PropCollectionBeginFunc)begin; if (next) cprop->next = (PropCollectionNextFunc)next; @@ -2131,7 +2132,7 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con void RNA_def_property_srna(PropertyRNA *prop, const char *type) { - prop->srna = (StructRNA*)type; + prop->srna = (StructRNA *)type; } void RNA_def_py_data(PropertyRNA *prop, void *py_data) @@ -2371,13 +2372,13 @@ PropertyRNA *RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifie void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc) { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; eprop->itemf = itemfunc; } void RNA_def_enum_py_data(PropertyRNA *prop, void *py_data) { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; eprop->py_data = py_data; } @@ -2707,9 +2708,9 @@ int rna_parameter_size(PropertyRNA *parm) switch (ptype) { case PROP_BOOLEAN: case PROP_INT: - return sizeof(int)*len; + return sizeof(int) * len; case PROP_FLOAT: - return sizeof(float)*len; + return sizeof(float) * len; default: break; } @@ -2725,7 +2726,7 @@ int rna_parameter_size(PropertyRNA *parm) case PROP_STRING: /* return values don't store a pointer to the original */ if (parm->flag & PROP_THICK_WRAP) { - StringPropertyRNA *sparm = (StringPropertyRNA*)parm; + StringPropertyRNA *sparm = (StringPropertyRNA *)parm; return sizeof(char) * sparm->maxlength; } else @@ -2771,18 +2772,18 @@ void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropert int tot = *totitem; if (tot == 0) { - *items = MEM_callocN(sizeof(EnumPropertyItem)*8, "RNA_enum_items_add"); + *items = MEM_callocN(sizeof(EnumPropertyItem) * 8, "RNA_enum_items_add"); } - else if (tot >= 8 && (tot&(tot-1)) == 0) { + else if (tot >= 8 && (tot & (tot - 1)) == 0) { /* power of two > 8 */ - newitems = MEM_callocN(sizeof(EnumPropertyItem)*tot*2, "RNA_enum_items_add"); - memcpy(newitems, *items, sizeof(EnumPropertyItem)*tot); + newitems = MEM_callocN(sizeof(EnumPropertyItem) * tot * 2, "RNA_enum_items_add"); + memcpy(newitems, *items, sizeof(EnumPropertyItem) * tot); MEM_freeN(*items); *items = newitems; } (*items)[tot] = *item; - *totitem = tot+1; + *totitem = tot + 1; } void RNA_enum_item_add_separator(EnumPropertyItem **items, int *totitem) @@ -2830,9 +2831,9 @@ void RNA_def_struct_duplicate_pointers(StructRNA *srna) void RNA_def_struct_free_pointers(StructRNA *srna) { if (srna->flag & STRUCT_FREE_POINTERS) { - if (srna->identifier) MEM_freeN((void*)srna->identifier); - if (srna->name) MEM_freeN((void*)srna->name); - if (srna->description) MEM_freeN((void*)srna->description); + if (srna->identifier) MEM_freeN((void *)srna->identifier); + if (srna->name) MEM_freeN((void *)srna->name); + if (srna->description) MEM_freeN((void *)srna->description); } } @@ -2847,8 +2848,8 @@ void RNA_def_func_duplicate_pointers(FunctionRNA *func) void RNA_def_func_free_pointers(FunctionRNA *func) { if (func->flag & FUNC_FREE_POINTERS) { - if (func->identifier) MEM_freeN((void*)func->identifier); - if (func->description) MEM_freeN((void*)func->description); + if (func->identifier) MEM_freeN((void *)func->identifier); + if (func->description) MEM_freeN((void *)func->description); } } @@ -2864,9 +2865,9 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA * in the first place */ if (prop->identifier) { if (cont->prophash) { - BLI_ghash_remove(cont->prophash, (void*)prop->identifier, NULL, NULL); + BLI_ghash_remove(cont->prophash, (void *)prop->identifier, NULL, NULL); prop->identifier = BLI_strdup(prop->identifier); - BLI_ghash_insert(cont->prophash, (void*)prop->identifier, prop); + BLI_ghash_insert(cont->prophash, (void *)prop->identifier, prop); } else { prop->identifier = BLI_strdup(prop->identifier); @@ -2878,34 +2879,34 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA switch (prop->type) { case PROP_BOOLEAN: { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; if (bprop->defaultarray) { - iarray = MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store"); - memcpy(iarray, bprop->defaultarray, sizeof(int)*prop->totarraylength); + iarray = MEM_callocN(sizeof(int) * prop->totarraylength, "RNA_def_property_store"); + memcpy(iarray, bprop->defaultarray, sizeof(int) * prop->totarraylength); bprop->defaultarray = iarray; } break; } case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (iprop->defaultarray) { - iarray = MEM_callocN(sizeof(int)*prop->totarraylength, "RNA_def_property_store"); - memcpy(iarray, iprop->defaultarray, sizeof(int)*prop->totarraylength); + iarray = MEM_callocN(sizeof(int) * prop->totarraylength, "RNA_def_property_store"); + memcpy(iarray, iprop->defaultarray, sizeof(int) * prop->totarraylength); iprop->defaultarray = iarray; } break; } case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; if (eprop->item) { - earray = MEM_callocN(sizeof(EnumPropertyItem)*(eprop->totitem+1), "RNA_def_property_store"), - memcpy(earray, eprop->item, sizeof(EnumPropertyItem)*(eprop->totitem+1)); + earray = MEM_callocN(sizeof(EnumPropertyItem) * (eprop->totitem + 1), "RNA_def_property_store"), + memcpy(earray, eprop->item, sizeof(EnumPropertyItem) * (eprop->totitem + 1)); eprop->item = earray; - for (a = 0; atotitem; a++) { + for (a = 0; a < eprop->totitem; a++) { if (eprop->item[a].identifier) eprop->item[a].identifier = BLI_strdup(eprop->item[a].identifier); if (eprop->item[a].name) @@ -2917,17 +2918,17 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA break; } case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (fprop->defaultarray) { - farray = MEM_callocN(sizeof(float)*prop->totarraylength, "RNA_def_property_store"); - memcpy(farray, fprop->defaultarray, sizeof(float)*prop->totarraylength); + farray = MEM_callocN(sizeof(float) * prop->totarraylength, "RNA_def_property_store"); + memcpy(farray, fprop->defaultarray, sizeof(float) * prop->totarraylength); fprop->defaultarray = farray; } break; } case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; if (sprop->defaultvalue) sprop->defaultvalue = BLI_strdup(sprop->defaultvalue); break; @@ -2945,52 +2946,52 @@ void RNA_def_property_free_pointers(PropertyRNA *prop) int a; if (prop->identifier) - MEM_freeN((void*)prop->identifier); + MEM_freeN((void *)prop->identifier); if (prop->name) - MEM_freeN((void*)prop->name); + MEM_freeN((void *)prop->name); if (prop->description) - MEM_freeN((void*)prop->description); + MEM_freeN((void *)prop->description); if (prop->py_data) MEM_freeN(prop->py_data); switch (prop->type) { case PROP_BOOLEAN: { - BoolPropertyRNA *bprop = (BoolPropertyRNA*)prop; + BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; if (bprop->defaultarray) - MEM_freeN((void*)bprop->defaultarray); + MEM_freeN((void *)bprop->defaultarray); break; } case PROP_INT: { - IntPropertyRNA *iprop = (IntPropertyRNA*)prop; + IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (iprop->defaultarray) - MEM_freeN((void*)iprop->defaultarray); + MEM_freeN((void *)iprop->defaultarray); break; } case PROP_FLOAT: { - FloatPropertyRNA *fprop = (FloatPropertyRNA*)prop; + FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (fprop->defaultarray) - MEM_freeN((void*)fprop->defaultarray); + MEM_freeN((void *)fprop->defaultarray); break; } case PROP_ENUM: { - EnumPropertyRNA *eprop = (EnumPropertyRNA*)prop; + EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; - for (a = 0; atotitem; a++) { + for (a = 0; a < eprop->totitem; a++) { if (eprop->item[a].identifier) - MEM_freeN((void*)eprop->item[a].identifier); + MEM_freeN((void *)eprop->item[a].identifier); if (eprop->item[a].name) - MEM_freeN((void*)eprop->item[a].name); + MEM_freeN((void *)eprop->item[a].name); if (eprop->item[a].description) - MEM_freeN((void*)eprop->item[a].description); + MEM_freeN((void *)eprop->item[a].description); } - if (eprop->item) MEM_freeN((void*)eprop->item); + if (eprop->item) MEM_freeN((void *)eprop->item); break; } case PROP_STRING: { - StringPropertyRNA *sprop = (StringPropertyRNA*)prop; + StringPropertyRNA *sprop = (StringPropertyRNA *)prop; if (sprop->defaultvalue) - MEM_freeN((void*)sprop->defaultvalue); + MEM_freeN((void *)sprop->defaultvalue); break; } default: @@ -3005,7 +3006,7 @@ static void rna_def_property_free(StructOrFunctionRNA *cont_, PropertyRNA *prop) if (prop->flag & PROP_RUNTIME) { if (cont->prophash) - BLI_ghash_remove(cont->prophash, (void*)prop->identifier, NULL, NULL); + BLI_ghash_remove(cont->prophash, (void *)prop->identifier, NULL, NULL); RNA_def_property_free_pointers(prop); rna_freelinkN(&cont->properties, prop); diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c index b3e89a4e5f8..a38c769c26a 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -44,9 +44,10 @@ #include "WM_types.h" EnumPropertyItem prop_dynamicpaint_type_items[] = { - {MOD_DYNAMICPAINT_TYPE_CANVAS, "CANVAS", 0, "Canvas", ""}, - {MOD_DYNAMICPAINT_TYPE_BRUSH, "BRUSH", 0, "Brush", ""}, - {0, NULL, 0, NULL, NULL}}; + {MOD_DYNAMICPAINT_TYPE_CANVAS, "CANVAS", 0, "Canvas", ""}, + {MOD_DYNAMICPAINT_TYPE_BRUSH, "BRUSH", 0, "Brush", ""}, + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -58,7 +59,7 @@ EnumPropertyItem prop_dynamicpaint_type_items[] = { static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr) { - DynamicPaintCanvasSettings *settings = (DynamicPaintCanvasSettings*)ptr->data; + DynamicPaintCanvasSettings *settings = (DynamicPaintCanvasSettings *)ptr->data; ModifierData *md = (ModifierData *)settings->pmd; return BLI_sprintfN("modifiers[\"%s\"].canvas_settings", md->name); @@ -66,7 +67,7 @@ static char *rna_DynamicPaintCanvasSettings_path(PointerRNA *ptr) static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr) { - DynamicPaintBrushSettings *settings = (DynamicPaintBrushSettings*)ptr->data; + DynamicPaintBrushSettings *settings = (DynamicPaintBrushSettings *)ptr->data; ModifierData *md = (ModifierData *)settings->pmd; return BLI_sprintfN("modifiers[\"%s\"].brush_settings", md->name); @@ -74,7 +75,7 @@ static char *rna_DynamicPaintBrushSettings_path(PointerRNA *ptr) static char *rna_DynamicPaintSurface_path(PointerRNA *ptr) { - DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data; + DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data; ModifierData *md = (ModifierData *)surface->canvas->pmd; return BLI_sprintfN("modifiers[\"%s\"].canvas_settings.canvas_surfaces[\"%s\"]", md->name, surface->name); @@ -92,18 +93,18 @@ static void rna_DynamicPaint_redoModifier(Main *bmain, Scene *scene, PointerRNA static void rna_DynamicPaintSurfaces_updateFrames(Main *bmain, Scene *scene, PointerRNA *ptr) { - dynamicPaint_cacheUpdateFrames((DynamicPaintSurface*)ptr->data); + dynamicPaint_cacheUpdateFrames((DynamicPaintSurface *)ptr->data); } static void rna_DynamicPaintSurface_reset(Main *bmain, Scene *scene, PointerRNA *ptr) { - dynamicPaint_resetSurface((DynamicPaintSurface*)ptr->data); + dynamicPaint_resetSurface((DynamicPaintSurface *)ptr->data); rna_DynamicPaint_redoModifier(bmain, scene, ptr); } static void rna_DynamicPaintSurface_initialcolortype(Main *bmain, Scene *scene, PointerRNA *ptr) { - DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data; + DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data; surface->init_layername[0] = '\0'; dynamicPaint_clearSurface(surface); @@ -112,7 +113,7 @@ static void rna_DynamicPaintSurface_initialcolortype(Main *bmain, Scene *scene, static void rna_DynamicPaintSurface_changePreview(Main *bmain, Scene *scene, PointerRNA *ptr) { - DynamicPaintSurface *act_surface = (DynamicPaintSurface*)ptr->data; + DynamicPaintSurface *act_surface = (DynamicPaintSurface *)ptr->data; DynamicPaintSurface *surface = act_surface->canvas->surfaces.first; /* since only one color surface can show preview at time @@ -126,23 +127,23 @@ static void rna_DynamicPaintSurface_changePreview(Main *bmain, Scene *scene, Poi static void rna_DynamicPaintSurface_uniqueName(Main *bmain, Scene *scene, PointerRNA *ptr) { - dynamicPaintSurface_setUniqueName((DynamicPaintSurface*)ptr->data, ((DynamicPaintSurface*)ptr->data)->name); + dynamicPaintSurface_setUniqueName((DynamicPaintSurface *)ptr->data, ((DynamicPaintSurface *)ptr->data)->name); } static void rna_DynamicPaintSurface_changeType(Main *bmain, Scene *scene, PointerRNA *ptr) { - dynamicPaintSurface_updateType((DynamicPaintSurface*)ptr->data); - dynamicPaint_resetSurface((DynamicPaintSurface*)ptr->data); + dynamicPaintSurface_updateType((DynamicPaintSurface *)ptr->data); + dynamicPaint_resetSurface((DynamicPaintSurface *)ptr->data); rna_DynamicPaintSurface_reset(bmain, scene, ptr); } static void rna_DynamicPaintSurfaces_changeFormat(Main *bmain, Scene *scene, PointerRNA *ptr) { - DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data; + DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data; surface->type = MOD_DPAINT_SURFACE_T_PAINT; - dynamicPaintSurface_updateType((DynamicPaintSurface*)ptr->data); + dynamicPaintSurface_updateType((DynamicPaintSurface *)ptr->data); rna_DynamicPaintSurface_reset(bmain, scene, ptr); } @@ -154,7 +155,7 @@ static void rna_DynamicPaint_resetDependancy(Main *bmain, Scene *scene, PointerR static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr) { - DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data; + DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data; DynamicPaintSurface *surface = canvas->surfaces.first; int id = 0; @@ -168,36 +169,36 @@ static PointerRNA rna_PaintSurface_active_get(PointerRNA *ptr) static void rna_DynamicPaint_surfaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data; + DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data; /*rna_iterator_array_begin(iter, (void*)canvas->surfaces, sizeof(PaintSurface), canvas->totsur, 0, 0); */ rna_iterator_listbase_begin(iter, &canvas->surfaces, NULL); } static int rna_Surface_active_point_index_get(PointerRNA *ptr) { - DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data; + DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data; return canvas->active_sur; } static void rna_Surface_active_point_index_set(struct PointerRNA *ptr, int value) { - DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data; + DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data; canvas->active_sur = value; return; } static void rna_Surface_active_point_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings*)ptr->data; + DynamicPaintCanvasSettings *canvas = (DynamicPaintCanvasSettings *)ptr->data; *min = 0; - *max = BLI_countlist(&canvas->surfaces)-1; + *max = BLI_countlist(&canvas->surfaces) - 1; } /* uvlayer */ static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value) { - DynamicPaintCanvasSettings *canvas = ((DynamicPaintSurface*)ptr->data)->canvas; + DynamicPaintCanvasSettings *canvas = ((DynamicPaintSurface *)ptr->data)->canvas; DynamicPaintSurface *surface = canvas->surfaces.first; int id = 0; @@ -213,7 +214,7 @@ static void rna_DynamicPaint_uvlayer_set(PointerRNA *ptr, const char *value) /* is point cache used */ static int rna_DynamicPaint_is_cache_user_get(PointerRNA *ptr) { - DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data; + DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data; return (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) ? 1 : 0; } @@ -228,7 +229,7 @@ static int rna_DynamicPaint_is_output_exists(DynamicPaintSurface *surface, Objec static EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) { - DynamicPaintSurface *surface = (DynamicPaintSurface*)ptr->data; + DynamicPaintSurface *surface = (DynamicPaintSurface *)ptr->data; EnumPropertyItem *item = NULL; EnumPropertyItem tmp = {0, "", 0, "", ""}; @@ -242,7 +243,7 @@ static EnumPropertyItem *rna_DynamicPaint_surface_type_itemf(bContext *C, Pointe /* Displace */ if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX || - surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) { + surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ) { tmp.value = MOD_DPAINT_SURFACE_T_DISPLACE; tmp.identifier = "DISPLACE"; tmp.name = "Displace"; @@ -294,7 +295,7 @@ static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_struct_type(prop, "DynamicPaintSurface"); RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); } @@ -307,51 +308,58 @@ static void rna_def_canvas_surface(BlenderRNA *brna) /* Surface format */ static EnumPropertyItem prop_dynamicpaint_surface_format[] = { - /*{MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""}, */ - {MOD_DPAINT_SURFACE_F_VERTEX, "VERTEX", ICON_OUTLINER_DATA_MESH, "Vertex", ""}, - {MOD_DPAINT_SURFACE_F_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""}, - {0, NULL, 0, NULL, NULL}}; + /*{MOD_DPAINT_SURFACE_F_PTEX, "PTEX", ICON_TEXTURE_SHADED, "Ptex", ""}, */ + {MOD_DPAINT_SURFACE_F_VERTEX, "VERTEX", ICON_OUTLINER_DATA_MESH, "Vertex", ""}, + {MOD_DPAINT_SURFACE_F_IMAGESEQ, "IMAGE", ICON_FILE_IMAGE, "Image Sequence", ""}, + {0, NULL, 0, NULL, NULL} + }; /* Surface type - generated dynamically based on surface format */ static EnumPropertyItem prop_dynamicpaint_surface_type[] = { - {MOD_DPAINT_SURFACE_T_PAINT, "PAINT", 0, "Paint", ""}, - {0, NULL, 0, NULL, NULL}}; + {MOD_DPAINT_SURFACE_T_PAINT, "PAINT", 0, "Paint", ""}, + {0, NULL, 0, NULL, NULL} + }; /* Surface output preview. currently only paint has multiple outputs */ static EnumPropertyItem prop_dynamicpaint_surface_preview[] = { - {MOD_DPAINT_SURFACE_PREV_PAINT, "PAINT", 0, "Paint", ""}, - {MOD_DPAINT_SURFACE_PREV_WETMAP, "WETMAP", 0, "Wetmap", ""}, - {0, NULL, 0, NULL, NULL}}; + {MOD_DPAINT_SURFACE_PREV_PAINT, "PAINT", 0, "Paint", ""}, + {MOD_DPAINT_SURFACE_PREV_WETMAP, "WETMAP", 0, "Wetmap", ""}, + {0, NULL, 0, NULL, NULL} + }; /* Initial color setting */ static EnumPropertyItem prop_dynamicpaint_init_color_type[] = { - {MOD_DPAINT_INITIAL_NONE, "NONE", 0, "None", ""}, - {MOD_DPAINT_INITIAL_COLOR, "COLOR", ICON_COLOR, "Color", ""}, - {MOD_DPAINT_INITIAL_TEXTURE, "TEXTURE", ICON_TEXTURE, "UV Texture", ""}, - {MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEX_COLOR", ICON_GROUP_VCOL, "Vertex Color", ""}, - {0, NULL, 0, NULL, NULL}}; + {MOD_DPAINT_INITIAL_NONE, "NONE", 0, "None", ""}, + {MOD_DPAINT_INITIAL_COLOR, "COLOR", ICON_COLOR, "Color", ""}, + {MOD_DPAINT_INITIAL_TEXTURE, "TEXTURE", ICON_TEXTURE, "UV Texture", ""}, + {MOD_DPAINT_INITIAL_VERTEXCOLOR, "VERTEX_COLOR", ICON_GROUP_VCOL, "Vertex Color", ""}, + {0, NULL, 0, NULL, NULL} + }; /* Effect type * Only used by ui to view per effect settings */ static EnumPropertyItem prop_dynamicpaint_effecttype[] = { - {1, "SPREAD", 0, "Spread", ""}, - {2, "DRIP", 0, "Drip", ""}, - {3, "SHRINK", 0, "Shrink", ""}, - {0, NULL, 0, NULL, NULL}}; + {1, "SPREAD", 0, "Spread", ""}, + {2, "DRIP", 0, "Drip", ""}, + {3, "SHRINK", 0, "Shrink", ""}, + {0, NULL, 0, NULL, NULL} + }; /* Displacemap file format */ static EnumPropertyItem prop_dynamicpaint_image_fileformat[] = { - {MOD_DPAINT_IMGFORMAT_PNG, "PNG", 0, "PNG", ""}, + {MOD_DPAINT_IMGFORMAT_PNG, "PNG", 0, "PNG", ""}, #ifdef WITH_OPENEXR - {MOD_DPAINT_IMGFORMAT_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, + {MOD_DPAINT_IMGFORMAT_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, #endif - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; /* Displacemap type */ static EnumPropertyItem prop_dynamicpaint_displace_type[] = { - {MOD_DPAINT_DISP_DISPLACE, "DISPLACE", 0, "Displacement", ""}, - {MOD_DPAINT_DISP_DEPTH, "DEPTH", 0, "Depth", ""}, - {0, NULL, 0, NULL, NULL}}; + {MOD_DPAINT_DISP_DISPLACE, "DISPLACE", 0, "Displacement", ""}, + {MOD_DPAINT_DISP_DEPTH, "DEPTH", 0, "Depth", ""}, + {0, NULL, 0, NULL, NULL} + }; @@ -366,7 +374,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "format"); RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_format); RNA_def_property_ui_text(prop, "Format", "Surface Format"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_changeFormat"); prop = RNA_def_property(srna, "surface_type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -374,17 +382,17 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_type); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DynamicPaint_surface_type_itemf"); RNA_def_property_ui_text(prop, "Surface Type", "Surface Type"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changeType"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_changeType"); prop = RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ACTIVE); RNA_def_property_ui_text(prop, "Is Active", "Toggle whether surface is processed or ignored"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "show_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PREVIEW); RNA_def_property_ui_text(prop, "Show Preview", "Display surface preview in 3D-views"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_changePreview"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_changePreview"); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Surface name"); @@ -395,7 +403,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Brush Group", "Only use brush objects from this group"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_resetDependancy"); /* @@ -441,7 +449,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_range(prop, 1.0, 9999.0); RNA_def_property_ui_range(prop, 1.0, 9999, 1, 0); RNA_def_property_ui_text(prop, "Start Frame", "Simulation start frame"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "end_frame"); @@ -449,7 +457,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_range(prop, 1.0, 9999.0); RNA_def_property_ui_range(prop, 1.0, 9999.0, 1, 0); RNA_def_property_ui_text(prop, "End Frame", "Simulation end frame"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurfaces_updateFrames"); prop = RNA_def_property(srna, "frame_substeps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "substeps"); @@ -461,21 +469,21 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ANTIALIAS); RNA_def_property_ui_text(prop, "Anti-aliasing", "Use 5x multisampling to smoothen paint edges"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); prop = RNA_def_property(srna, "brush_influence_scale", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "influence_scale"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); RNA_def_property_ui_text(prop, "Influence Scale", "Adjust influence brush objects have on this surface"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "brush_radius_scale", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "radius_scale"); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 2); RNA_def_property_ui_text(prop, "Radius Scale", "Adjust radius of proximity brushes or particles for this surface"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); /* * Initial Color @@ -485,22 +493,22 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, prop_dynamicpaint_init_color_type); RNA_def_property_ui_text(prop, "Initial Color", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_initialcolortype"); + RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_initialcolortype"); prop = RNA_def_property(srna, "init_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Color", "Initial color of the surface"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); prop = RNA_def_property(srna, "init_texture", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Texture", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); prop = RNA_def_property(srna, "init_layername", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Data Layer", ""); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_DRAW | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); /* * Effect Settings @@ -523,7 +531,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SPREAD); RNA_def_property_ui_text(prop, "Use Spread", "Process spread effect (spread wet paint around surface)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); prop = RNA_def_property(srna, "spread_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spread_speed"); @@ -547,13 +555,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_DRIP); RNA_def_property_ui_text(prop, "Use Drip", "Process drip effect (drip wet paint to gravity direction)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); prop = RNA_def_property(srna, "use_shrink", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "effect", MOD_DPAINT_EFFECT_DO_SHRINK); RNA_def_property_ui_text(prop, "Use Shrink", "Process shrink effect (shrink paint areas)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); prop = RNA_def_property(srna, "shrink_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shrink_speed"); @@ -613,13 +621,13 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "preview_id"); RNA_def_property_enum_items(prop, prop_dynamicpaint_surface_preview); RNA_def_property_ui_text(prop, "Preview", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); /* to check if output name exists */ func = RNA_def_function(srna, "output_exists", "rna_DynamicPaint_is_output_exists"); RNA_def_function_ui_description(func, "Checks if surface output layer of given name exists"); parm = RNA_def_pointer(func, "object", "Object", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); parm = RNA_def_int(func, "index", 0, 0, 1, "Index", "", 0, 1); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ @@ -632,7 +640,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.00, 5.0, 1, 2); RNA_def_property_ui_text(prop, "Max Displace", "Maximum level of depth intersection in object space (use 0.0 to disable)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "displace_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "disp_factor"); @@ -640,7 +648,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_range(prop, -50.0, 50.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 1, 2); RNA_def_property_ui_text(prop, "Displace Factor", "Strength of displace when applied to the mesh"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "image_fileformat", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -657,7 +665,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_DISP_INCREMENTAL); RNA_def_property_ui_text(prop, "Incremental", "New displace is added cumulatively on top of existing"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaintSurface_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaintSurface_reset"); /* wave simulator settings */ prop = RNA_def_property(srna, "wave_damping", PROP_FLOAT, PROP_NONE); @@ -695,7 +703,7 @@ static void rna_def_canvas_surface(BlenderRNA *brna) prop = RNA_def_property(srna, "is_cache_user", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_DynamicPaint_is_cache_user_get", NULL); RNA_def_property_ui_text(prop, "Use Cache", ""); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); } static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna) @@ -727,31 +735,35 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) /* paint collision type */ static EnumPropertyItem prop_dynamicpaint_collisiontype[] = { - {MOD_DPAINT_COL_PSYS, "PARTICLE_SYSTEM", ICON_PARTICLES, "Particle System", ""}, - {MOD_DPAINT_COL_POINT, "POINT", ICON_META_EMPTY, "Object Center", ""}, - {MOD_DPAINT_COL_DIST, "DISTANCE", ICON_META_EMPTY, "Proximity", ""}, - {MOD_DPAINT_COL_VOLDIST, "VOLUME_DISTANCE", ICON_META_CUBE, "Mesh Volume + Proximity", ""}, - {MOD_DPAINT_COL_VOLUME, "VOLUME", ICON_MESH_CUBE, "Mesh Volume", ""}, - {0, NULL, 0, NULL, NULL}}; + {MOD_DPAINT_COL_PSYS, "PARTICLE_SYSTEM", ICON_PARTICLES, "Particle System", ""}, + {MOD_DPAINT_COL_POINT, "POINT", ICON_META_EMPTY, "Object Center", ""}, + {MOD_DPAINT_COL_DIST, "DISTANCE", ICON_META_EMPTY, "Proximity", ""}, + {MOD_DPAINT_COL_VOLDIST, "VOLUME_DISTANCE", ICON_META_CUBE, "Mesh Volume + Proximity", ""}, + {MOD_DPAINT_COL_VOLUME, "VOLUME", ICON_MESH_CUBE, "Mesh Volume", ""}, + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_dynamicpaint_prox_falloff[] = { - {MOD_DPAINT_PRFALL_SMOOTH, "SMOOTH", ICON_SPHERECURVE, "Smooth", ""}, - {MOD_DPAINT_PRFALL_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""}, - {MOD_DPAINT_PRFALL_RAMP, "RAMP", ICON_COLOR, "Color Ramp", ""}, - {0, NULL, 0, NULL, NULL}}; + {MOD_DPAINT_PRFALL_SMOOTH, "SMOOTH", ICON_SPHERECURVE, "Smooth", ""}, + {MOD_DPAINT_PRFALL_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""}, + {MOD_DPAINT_PRFALL_RAMP, "RAMP", ICON_COLOR, "Color Ramp", ""}, + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_dynamicpaint_brush_wave_type[] = { - {MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""}, - {MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""}, - {MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""}, - {MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""}, - {0, NULL, 0, NULL, NULL}}; + {MOD_DPAINT_WAVEB_CHANGE, "CHANGE", 0, "Depth Change", ""}, + {MOD_DPAINT_WAVEB_DEPTH, "DEPTH", 0, "Obstacle", ""}, + {MOD_DPAINT_WAVEB_FORCE, "FORCE", 0, "Force", ""}, + {MOD_DPAINT_WAVEB_REFLECT, "REFLECT", 0, "Reflect Only", ""}, + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_dynamicpaint_brush_ray_dir[] = { - {MOD_DPAINT_RAY_CANVAS, "CANVAS", 0, "Canvas Normal", ""}, - {MOD_DPAINT_RAY_BRUSH_AVG, "BRUSH", 0, "Brush Normal", ""}, - {MOD_DPAINT_RAY_ZPLUS, "Z_AXIS", 0, "Z-Axis", ""}, - {0, NULL, 0, NULL, NULL}}; + {MOD_DPAINT_RAY_CANVAS, "CANVAS", 0, "Canvas Normal", ""}, + {MOD_DPAINT_RAY_BRUSH_AVG, "BRUSH", 0, "Brush Normal", ""}, + {MOD_DPAINT_RAY_ZPLUS, "Z_AXIS", 0, "Z-Axis", ""}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "DynamicPaintBrushSettings", NULL); RNA_def_struct_ui_text(srna, "Brush Settings", "Brush settings"); @@ -765,26 +777,26 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Paint Color", "Color of the paint"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "paint_alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); RNA_def_property_ui_text(prop, "Paint Alpha", "Paint alpha"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "use_material", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_USE_MATERIAL); RNA_def_property_ui_text(prop, "Use object material", "Use object material to define color and influence"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mat"); RNA_def_property_ui_text(prop, "Material", "Material to use (if not defined, material linked to the mesh is used)"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "use_absolute_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ABS_ALPHA); @@ -797,12 +809,12 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 2); RNA_def_property_ui_text(prop, "Paint Wetness", "Paint wetness, visible in wetmap (some effects only affect wet paint)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "use_paint_erase", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_ERASE); RNA_def_property_ui_text(prop, "Erase Paint", "Erase / remove paint instead of adding it"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "wave_type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -839,28 +851,28 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "use_velocity_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_ALPHA); RNA_def_property_ui_text(prop, "Multiply Alpha", "Multiply brush influence by velocity color ramp alpha"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "use_velocity_depth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_DEPTH); RNA_def_property_ui_text(prop, "Multiply Depth", "Multiply brush intersection depth (displace, waves) by velocity ramp alpha"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "use_velocity_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_VELOCITY_COLOR); RNA_def_property_ui_text(prop, "Replace Color", "Replace brush color by velocity color ramp"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); /* - * Paint Area / Collision - */ + * Paint Area / Collision + */ prop = RNA_def_property(srna, "paint_source", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_sdna(prop, NULL, "collision"); RNA_def_property_enum_items(prop, prop_dynamicpaint_collisiontype); RNA_def_property_ui_text(prop, "Paint Source", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "paint_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "paint_distance"); @@ -868,25 +880,25 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0, 500.0, 10, 3); RNA_def_property_ui_text(prop, "Proximity Distance", "Maximum distance from brush to mesh surface to affect paint"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "use_proximity_ramp_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_RAMP_ALPHA); RNA_def_property_ui_text(prop, "Only Use Alpha", "Only read color ramp alpha"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "proximity_falloff", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_sdna(prop, NULL, "proximity_falloff"); RNA_def_property_enum_items(prop, prop_dynamicpaint_prox_falloff); RNA_def_property_ui_text(prop, "Falloff", "Proximity falloff type"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "use_proximity_project", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PROX_PROJECT); RNA_def_property_ui_text(prop, "Project", "Brush is projected to canvas from defined direction within brush proximity"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "ray_direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ray_dir"); @@ -894,17 +906,17 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Ray Direction", "Ray direction to use for projection (if brush object is located in that direction " "it's painted)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "invert_proximity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_INVERSE_PROX); RNA_def_property_ui_text(prop, "Inner Proximity", "Proximity falloff is applied inside the volume"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "use_negative_volume", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_NEGATE_VOLUME); RNA_def_property_ui_text(prop, "Negate Volume", "Negate influence inside the volume"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); /* @@ -915,27 +927,27 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Particle Systems", "The particle system to paint with"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_resetDependancy"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_resetDependancy"); prop = RNA_def_property(srna, "use_particle_radius", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DPAINT_PART_RAD); RNA_def_property_ui_text(prop, "Use Particle Radius", "Use radius from particle settings"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "solid_radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "particle_radius"); RNA_def_property_range(prop, 0.01, 10.0); RNA_def_property_ui_range(prop, 0.01, 2.0, 5, 3); RNA_def_property_ui_text(prop, "Solid Radius", "Radius that will be painted solid"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "smooth_radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "particle_smooth"); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 5, 0); RNA_def_property_ui_text(prop, "Smooth Radius", "Smooth falloff added after solid radius"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); /* @@ -945,13 +957,13 @@ static void rna_def_dynamic_paint_brush_settings(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "paint_ramp"); RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_ui_text(prop, "Paint Color Ramp", "Color ramp used to define proximity falloff"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); prop = RNA_def_property(srna, "velocity_ramp", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "vel_ramp"); RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_ui_text(prop, "Velocity Color Ramp", "Color ramp used to define brush velocity effect"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_DynamicPaint_redoModifier"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_DynamicPaint_redoModifier"); } void RNA_def_dynamic_paint(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 122e42e29e7..333f6878413 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -59,14 +59,16 @@ EnumPropertyItem fmodifier_type_items[] = { /*{FMODIFIER_TYPE_PYTHON, "PYTHON", 0, "Python", ""}, *//* FIXME: not implemented yet! */ {FMODIFIER_TYPE_LIMITS, "LIMITS", 0, "Limits", ""}, {FMODIFIER_TYPE_STEPPED, "STEPPED", 0, "Stepped Interpolation", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem beztriple_keyframe_type_items[] = { {BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", 0, "Keyframe", ""}, {BEZT_KEYTYPE_BREAKDOWN, "BREAKDOWN", 0, "Breakdown", ""}, {BEZT_KEYTYPE_EXTREME, "EXTREME", 0, "Extreme", ""}, {BEZT_KEYTYPE_JITTER, "JITTER", 0, "Jitter", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -115,9 +117,9 @@ static void rna_ChannelDriver_update_data(Main *bmain, Scene *scene, PointerRNA /* TODO: this really needs an update guard... */ DAG_scene_sort(bmain, scene); - DAG_id_tag_update(id, OB_RECALC_OB|OB_RECALC_DATA); + DAG_id_tag_update(id, OB_RECALC_OB | OB_RECALC_DATA); - WM_main_add_notifier(NC_SCENE|ND_FRAME, scene); + WM_main_add_notifier(NC_SCENE | ND_FRAME, scene); } static void rna_ChannelDriver_update_expr(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -163,25 +165,25 @@ static void rna_DriverTarget_update_name(Main *bmain, Scene *scene, PointerRNA * /* note: this function exists only to avoid id refcounting */ static void rna_DriverTarget_id_set(PointerRNA *ptr, PointerRNA value) { - DriverTarget *dtar = (DriverTarget*)ptr->data; + DriverTarget *dtar = (DriverTarget *)ptr->data; dtar->id = value.data; } static StructRNA *rna_DriverTarget_id_typef(PointerRNA *ptr) { - DriverTarget *dtar = (DriverTarget*)ptr->data; + DriverTarget *dtar = (DriverTarget *)ptr->data; return ID_code_to_RNA_type(dtar->idtype); } static int rna_DriverTarget_id_editable(PointerRNA *ptr) { - DriverTarget *dtar = (DriverTarget*)ptr->data; - return (dtar->idtype)? PROP_EDITABLE : 0; + DriverTarget *dtar = (DriverTarget *)ptr->data; + return (dtar->idtype) ? PROP_EDITABLE : 0; } static int rna_DriverTarget_id_type_editable(PointerRNA *ptr) { - DriverTarget *dtar = (DriverTarget*)ptr->data; + DriverTarget *dtar = (DriverTarget *)ptr->data; /* when the id-type can only be object, don't allow editing * otherwise, there may be strange crashes @@ -191,7 +193,7 @@ static int rna_DriverTarget_id_type_editable(PointerRNA *ptr) static void rna_DriverTarget_id_type_set(PointerRNA *ptr, int value) { - DriverTarget *data = (DriverTarget*)(ptr->data); + DriverTarget *data = (DriverTarget *)(ptr->data); /* check if ID-type is settable */ if ((data->flag & DTAR_FLAG_ID_OB_ONLY) == 0) { @@ -254,7 +256,7 @@ static void rna_DriverVariable_type_set(PointerRNA *ptr, int value) static void rna_FKeyframe_handle1_get(PointerRNA *ptr, float *values) { - BezTriple *bezt = (BezTriple*)ptr->data; + BezTriple *bezt = (BezTriple *)ptr->data; values[0] = bezt->vec[0][0]; values[1] = bezt->vec[0][1]; @@ -262,7 +264,7 @@ static void rna_FKeyframe_handle1_get(PointerRNA *ptr, float *values) static void rna_FKeyframe_handle1_set(PointerRNA *ptr, const float *values) { - BezTriple *bezt = (BezTriple*)ptr->data; + BezTriple *bezt = (BezTriple *)ptr->data; bezt->vec[0][0] = values[0]; bezt->vec[0][1] = values[1]; @@ -270,7 +272,7 @@ static void rna_FKeyframe_handle1_set(PointerRNA *ptr, const float *values) static void rna_FKeyframe_handle2_get(PointerRNA *ptr, float *values) { - BezTriple *bezt = (BezTriple*)ptr->data; + BezTriple *bezt = (BezTriple *)ptr->data; values[0] = bezt->vec[2][0]; values[1] = bezt->vec[2][1]; @@ -278,7 +280,7 @@ static void rna_FKeyframe_handle2_get(PointerRNA *ptr, float *values) static void rna_FKeyframe_handle2_set(PointerRNA *ptr, const float *values) { - BezTriple *bezt = (BezTriple*)ptr->data; + BezTriple *bezt = (BezTriple *)ptr->data; bezt->vec[2][0] = values[0]; bezt->vec[2][1] = values[1]; @@ -286,7 +288,7 @@ static void rna_FKeyframe_handle2_set(PointerRNA *ptr, const float *values) static void rna_FKeyframe_ctrlpoint_get(PointerRNA *ptr, float *values) { - BezTriple *bezt = (BezTriple*)ptr->data; + BezTriple *bezt = (BezTriple *)ptr->data; values[0] = bezt->vec[1][0]; values[1] = bezt->vec[1][1]; @@ -294,7 +296,7 @@ static void rna_FKeyframe_ctrlpoint_get(PointerRNA *ptr, float *values) static void rna_FKeyframe_ctrlpoint_set(PointerRNA *ptr, const float *values) { - BezTriple *bezt = (BezTriple*)ptr->data; + BezTriple *bezt = (BezTriple *)ptr->data; bezt->vec[1][0] = values[0]; bezt->vec[1][1] = values[1]; @@ -362,7 +364,7 @@ static void rna_FCurve_group_set(PointerRNA *ptr, PointerRNA value) else { /* the ID given is the owner of the F-Curve (for drivers) */ AnimData *adt = BKE_animdata_from_id(ptr->id.data); - act = (adt)? adt->action : NULL; + act = (adt) ? adt->action : NULL; } /* already belongs to group? */ @@ -420,14 +422,14 @@ void rna_Driver_remove_variable(ChannelDriver *driver, ReportList *reports, Driv static PointerRNA rna_FCurve_active_modifier_get(PointerRNA *ptr) { - FCurve *fcu = (FCurve*)ptr->data; + FCurve *fcu = (FCurve *)ptr->data; FModifier *fcm = find_active_fmodifier(&fcu->modifiers); return rna_pointer_inherit_refine(ptr, &RNA_FModifier, fcm); } static void rna_FCurve_active_modifier_set(PointerRNA *ptr, PointerRNA value) { - FCurve *fcu = (FCurve*)ptr->data; + FCurve *fcu = (FCurve *)ptr->data; set_active_fmodifier(&fcu->modifiers, (FModifier *)value.data); } @@ -447,7 +449,7 @@ static void rna_FCurve_modifiers_remove(FCurve *fcu, ReportList *reports, FModif static void rna_FModifier_active_set(PointerRNA *ptr, int UNUSED(value)) { - FModifier *fm = (FModifier*)ptr->data; + FModifier *fm = (FModifier *)ptr->data; /* don't toggle, always switch on */ fm->flag |= FMODIFIER_FLAG_ACTIVE; @@ -455,23 +457,23 @@ static void rna_FModifier_active_set(PointerRNA *ptr, int UNUSED(value)) static void rna_FModifier_start_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; *min = MINAFRAMEF; - *max = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->efra : MAXFRAMEF; + *max = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT) ? fcm->efra : MAXFRAMEF; } static void rna_FModifier_end_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; - *min = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT)? fcm->sfra : MINAFRAMEF; + *min = (fcm->flag & FMODIFIER_FLAG_RANGERESTRICT) ? fcm->sfra : MINAFRAMEF; *max = MAXFRAMEF; } static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; *min = 0.0f; *max = fcm->efra - fcm->sfra; @@ -479,7 +481,7 @@ static void rna_FModifier_blending_range(PointerRNA *ptr, float *min, float *max static void rna_FModifier_active_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - FModifier *fm, *fmo = (FModifier*)ptr->data; + FModifier *fm, *fmo = (FModifier *)ptr->data; /* clear active state of other FModifiers in this list */ for (fm = fmo->prev; fm; fm = fm->prev) { @@ -493,64 +495,64 @@ static void rna_FModifier_active_update(Main *UNUSED(bmain), Scene *UNUSED(scene static int rna_FModifierGenerator_coefficients_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; FMod_Generator *gen = fcm->data; if (gen) length[0] = gen->arraysize; else - length[0] = 100; /* for raw_access, untested */ + length[0] = 100; /* for raw_access, untested */ return length[0]; } static void rna_FModifierGenerator_coefficients_get(PointerRNA *ptr, float *values) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; FMod_Generator *gen = fcm->data; memcpy(values, gen->coefficients, gen->arraysize * sizeof(float)); } static void rna_FModifierGenerator_coefficients_set(PointerRNA *ptr, const float *values) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; FMod_Generator *gen = fcm->data; memcpy(gen->coefficients, values, gen->arraysize * sizeof(float)); } static void rna_FModifierLimits_minx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; *min = MINAFRAMEF; - *max = (data->flag & FCM_LIMIT_XMAX)? data->rect.xmax : MAXFRAMEF; + *max = (data->flag & FCM_LIMIT_XMAX) ? data->rect.xmax : MAXFRAMEF; } static void rna_FModifierLimits_maxx_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; - *min = (data->flag & FCM_LIMIT_XMIN)? data->rect.xmin : MINAFRAMEF; + *min = (data->flag & FCM_LIMIT_XMIN) ? data->rect.xmin : MINAFRAMEF; *max = MAXFRAMEF; } static void rna_FModifierLimits_miny_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; *min = -FLT_MAX; - *max = (data->flag & FCM_LIMIT_YMAX)? data->rect.ymax : FLT_MAX; + *max = (data->flag & FCM_LIMIT_YMAX) ? data->rect.ymax : FLT_MAX; } static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; FMod_Limits *data = fcm->data; - *min = (data->flag & FCM_LIMIT_YMIN)? data->rect.ymin : -FLT_MAX; + *min = (data->flag & FCM_LIMIT_YMIN) ? data->rect.ymin : -FLT_MAX; *max = FLT_MAX; } @@ -558,27 +560,27 @@ static void rna_FModifierLimits_maxy_range(PointerRNA *ptr, float *min, float *m static void rna_FModifierStepped_start_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; FMod_Stepped *data = fcm->data; *min = MINAFRAMEF; - *max = (data->flag & FCM_STEPPED_NO_AFTER)? data->end_frame : MAXFRAMEF; + *max = (data->flag & FCM_STEPPED_NO_AFTER) ? data->end_frame : MAXFRAMEF; } static void rna_FModifierStepped_end_frame_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - FModifier *fcm = (FModifier*)ptr->data; + FModifier *fcm = (FModifier *)ptr->data; FMod_Stepped *data = fcm->data; - *min = (data->flag & FCM_STEPPED_NO_BEFORE)? data->start_frame : MINAFRAMEF; + *min = (data->flag & FCM_STEPPED_NO_BEFORE) ? data->start_frame : MINAFRAMEF; *max = MAXFRAMEF; } static BezTriple *rna_FKeyframe_points_insert(FCurve *fcu, float frame, float value, int flag) { int index = insert_vert_fcurve(fcu, frame, value, flag); - return ((fcu->bezt) && (index >= 0))? (fcu->bezt + index) : NULL; + return ((fcu->bezt) && (index >= 0)) ? (fcu->bezt + index) : NULL; } static void rna_FKeyframe_points_add(FCurve *fcu, int tot) @@ -621,7 +623,7 @@ static void rna_FKeyframe_points_remove(FCurve *fcu, ReportList *reports, BezTri static void rna_fcurve_range(FCurve *fcu, float range[2]) { - calc_fcurve_range(fcu, range, range+1, FALSE, FALSE); + calc_fcurve_range(fcu, range, range + 1, FALSE, FALSE); } #else @@ -634,7 +636,8 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) static EnumPropertyItem generator_mode_items[] = { {FCM_GENERATOR_POLYNOMIAL, "POLYNOMIAL", 0, "Expanded Polynomial", ""}, {FCM_GENERATOR_POLYNOMIAL_FACTORISED, "POLYNOMIAL_FACTORISED", 0, "Factorized Polynomial", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "FModifierGenerator", "FModifier"); RNA_def_struct_ui_text(srna, "Generator F-Modifier", "Deterministically generate values for the modified F-Curve"); @@ -646,21 +649,21 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of " "the existing values instead of overwriting them"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); - /* XXX this has a special validation func */ + /* XXX this has a special validation func */ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, generator_mode_items); RNA_def_property_ui_text(prop, "Mode", "Type of generator to use"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); /* order of the polynomial */ - /* XXX this has a special validation func */ + /* XXX this has a special validation func */ prop = RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial (number of coefficients - 1)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); /* coefficients array */ prop = RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE); @@ -686,7 +689,8 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) {3, "SQRT", 0, "Square Root", ""}, {4, "LN", 0, "Natural Logarithm", ""}, {5, "SINC", 0, "Normalised Sine", "sin(x) / x"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "FModifierFunctionGenerator", "FModifier"); RNA_def_struct_ui_text(srna, "Built-In Function F-Modifier", "Generate values using a Built-In Function"); @@ -695,19 +699,19 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) /* coefficients */ prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); /* flags */ prop = RNA_def_property(srna, "use_additive", PROP_BOOLEAN, PROP_NONE); @@ -715,13 +719,13 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of " "the existing values instead of overwriting them"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } /* --------- */ @@ -742,18 +746,18 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna) prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); /* Frame */ prop = RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "time"); RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); /* TODO: */ /* - selection flags (not implemented in UI yet though) */ @@ -778,17 +782,17 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna) prop = RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "midval"); RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "default_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "default_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } /* --------- */ @@ -806,7 +810,8 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) "start and end values"}, {FCM_EXTRAPOLATE_MIRROR, "MIRROR", 0, "Repeat Mirrored", "Alternate between forward and reverse playback of keyframe range"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "FModifierCycles", "FModifier"); RNA_def_struct_ui_text(srna, "Cycles F-Modifier", "Repeat the values of the modified F-Curve"); @@ -817,26 +822,26 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "before_mode"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Before Mode", "Cycling mode to use before first keyframe"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "cycles_before", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "before_cycles"); RNA_def_property_ui_text(prop, "Before Cycles", "Maximum number of cycles to allow before first keyframe (0 = infinite)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); /* after */ prop = RNA_def_property(srna, "mode_after", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "after_mode"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "After Mode", "Cycling mode to use after last keyframe"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "cycles_after", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "after_cycles"); RNA_def_property_ui_text(prop, "After Cycles", "Maximum number of cycles to allow after last keyframe (0 = infinite)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } /* --------- */ @@ -865,46 +870,46 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna) prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMIN); RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "use_min_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMIN); RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "use_max_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMAX); RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "use_max_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMAX); RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "min_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmin"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_minx_range"); RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "min_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymin"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_miny_range"); RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "max_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmax"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxx_range"); RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "max_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymax"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxy_range"); RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } /* --------- */ @@ -919,7 +924,8 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) {FCM_NOISE_MODIF_ADD, "ADD", 0, "Add", ""}, {FCM_NOISE_MODIF_SUBTRACT, "SUBTRACT", 0, "Subtract", ""}, {FCM_NOISE_MODIF_MULTIPLY, "MULTIPLY", 0, "Multiply", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "FModifierNoise", "FModifier"); RNA_def_struct_ui_text(srna, "Noise F-Modifier", "Give randomness to the modified F-Curve"); @@ -929,28 +935,28 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "modification"); RNA_def_property_enum_items(prop, prop_modification_items); RNA_def_property_ui_text(prop, "Blend Type", "Method of modifying the existing F-Curve"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Scale", "Scaling (in time) of the noise"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_ui_text(prop, "Strength", "Amplitude of the noise - the amount that it modifies the underlying curve"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "phase"); RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "depth"); RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } @@ -971,36 +977,36 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna) prop = RNA_def_property(srna, "frame_step", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "step_size"); RNA_def_property_ui_text(prop, "Step Size", "Number of frames to hold each value"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "frame_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_ui_text(prop, "Offset", "Reference number of frames before frames get held " "(use to get hold for '1-3' vs '5-7' holding patterns)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "use_frame_start", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_BEFORE); RNA_def_property_ui_text(prop, "Use Start Frame", "Restrict modifier to only act after its 'start' frame"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "use_frame_end", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_AFTER); RNA_def_property_ui_text(prop, "Use End Frame", "Restrict modifier to only act before its 'end' frame"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "start_frame"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_start_frame_range"); RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if applicable)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "end_frame"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_end_frame_range"); RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if applicable)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } /* --------- */ @@ -1017,7 +1023,7 @@ static void rna_def_fmodifier(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "F-Modifier", "Modifier for values of F-Curve"); #if 0 /* XXX not used yet */ - /* name */ + /* name */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", "Short description of F-Curve Modifier"); @@ -1038,21 +1044,21 @@ static void rna_def_fmodifier(BlenderRNA *brna) prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_MUTED); RNA_def_property_ui_text(prop, "Muted", "F-Curve Modifier will not be evaluated"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); RNA_def_property_ui_icon(prop, ICON_MUTE_IPO_OFF, 1); prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FMODIFIER_FLAG_DISABLED); RNA_def_property_ui_text(prop, "Disabled", "F-Curve Modifier has invalid settings and will not be evaluated"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); - /* TODO: setting this to true must ensure that all others in stack are turned off too... */ + /* TODO: setting this to true must ensure that all others in stack are turned off too... */ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_ACTIVE); RNA_def_property_ui_text(prop, "Active", "F-Curve Modifier is the one being edited "); RNA_def_property_boolean_funcs(prop, NULL, "rna_FModifier_active_set"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, "rna_FModifier_active_update"); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, "rna_FModifier_active_update"); RNA_def_property_ui_icon(prop, ICON_RADIOBUT_OFF, 1); /* restricted range */ @@ -1061,7 +1067,7 @@ static void rna_def_fmodifier(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Restrict Frame Range", "F-Curve Modifier is only applied for the specified frame range to help " "mask off effects in order to chain them"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); /* XXX: depends on UI implementation */ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE); @@ -1069,32 +1075,32 @@ static void rna_def_fmodifier(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_start_frame_range"); RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if Restrict Frame Range is in use)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); prop = RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "efra"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_end_frame_range"); RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if Restrict Frame Range is in use)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); prop = RNA_def_property(srna, "blend_in", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blendin"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range"); RNA_def_property_ui_text(prop, "Blend In", "Number of frames from start frame for influence to take effect"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); prop = RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blendout"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifier_blending_range"); RNA_def_property_ui_text(prop, "Blend Out", "Number of frames from end frame for influence to fade out"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); /* influence */ prop = RNA_def_property(srna, "use_influence", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_USEINFLUENCE); RNA_def_property_ui_text(prop, "Use Influence", "F-Curve Modifier's effects will be tempered by a default factor"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); /* XXX: depends on UI implementation */ prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR); @@ -1103,7 +1109,7 @@ static void rna_def_fmodifier(BlenderRNA *brna) RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Influence", "Amount of influence F-Curve Modifier will have when not fading in/out"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); } /* *********************** */ @@ -1123,7 +1129,8 @@ static void rna_def_drivertarget(BlenderRNA *brna) {DTAR_TRANSCHAN_SCALEX, "SCALE_X", 0, "X Scale", ""}, {DTAR_TRANSCHAN_SCALEY, "SCALE_Y", 0, "Y Scale", ""}, {DTAR_TRANSCHAN_SCALEZ, "SCALE_Z", 0, "Z Scale", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_local_space_items[] = { {0, "WORLD_SPACE", 0, "World Space", "Transforms include effects of parenting/restpose and constraints"}, @@ -1132,7 +1139,8 @@ static void rna_def_drivertarget(BlenderRNA *brna) {DTAR_FLAG_LOCALSPACE|DTAR_FLAG_LOCAL_CONSTS, "LOCAL_SPACE", 0, "Local Space", "Transforms include effects of constraints but not " "parenting/restpose"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "DriverTarget", NULL); RNA_def_struct_ui_text(srna, "Driver Target", "Source of input values for driver variables"); @@ -1194,7 +1202,8 @@ static void rna_def_drivervar(BlenderRNA *brna) "Final transformation value of object or bone"}, {DVAR_TYPE_ROT_DIFF, "ROTATION_DIFF", 0, "Rotational Difference", "Use the angle between two bones"}, {DVAR_TYPE_LOC_DIFF, "LOC_DIFF", 0, "Distance", "Distance between two bones or objects"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "DriverVariable", NULL); @@ -1244,9 +1253,9 @@ static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop /* add variable */ func = RNA_def_function(srna, "new", "rna_Driver_new_variable"); RNA_def_function_ui_description(func, "Add a new variable for the driver"); - /* return type */ + /* return type */ parm = RNA_def_pointer(func, "var", "DriverVariable", "", "Newly created Driver Variable"); - RNA_def_function_return(func, parm); + RNA_def_function_return(func, parm); /* remove variable */ func = RNA_def_function(srna, "remove", "rna_Driver_remove_variable"); @@ -1254,7 +1263,7 @@ static void rna_def_channeldriver_variables(BlenderRNA *brna, PropertyRNA *cprop RNA_def_function_flag(func, FUNC_USE_REPORTS); /* target to remove */ parm = RNA_def_pointer(func, "variable", "DriverVariable", "", "Variable to remove from the driver"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } static void rna_def_channeldriver(BlenderRNA *brna) @@ -1268,7 +1277,8 @@ static void rna_def_channeldriver(BlenderRNA *brna) {DRIVER_TYPE_PYTHON, "SCRIPTED", 0, "Scripted Expression", ""}, {DRIVER_TYPE_MIN, "MIN", 0, "Minimum Value", ""}, {DRIVER_TYPE_MAX, "MAX", 0, "Maximum Value", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Driver", NULL); RNA_def_struct_sdna(srna, "ChannelDriver"); @@ -1324,14 +1334,14 @@ static void rna_def_fpoint(BlenderRNA *brna) prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); RNA_def_property_ui_text(prop, "Select", "Selection status"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); /* Vector value */ prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_float_sdna(prop, NULL, "vec"); RNA_def_property_array(prop, 2); RNA_def_property_ui_text(prop, "Point", "Point coordinates"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } @@ -1351,30 +1361,30 @@ static void rna_def_fkeyframe(BlenderRNA *brna) prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "f1", 0); RNA_def_property_ui_text(prop, "Handle 1 selected", "Left handle selection status"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "f3", 0); RNA_def_property_ui_text(prop, "Handle 2 selected", "Right handle selection status"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); prop = RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "f2", 0); RNA_def_property_ui_text(prop, "Select", "Control point selection status"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); /* Enums */ prop = RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "h1"); RNA_def_property_enum_items(prop, keyframe_handle_type_items); RNA_def_property_ui_text(prop, "Left Handle Type", "Handle types"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); prop = RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "h2"); RNA_def_property_enum_items(prop, keyframe_handle_type_items); RNA_def_property_ui_text(prop, "Right Handle Type", "Handle types"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ipo"); @@ -1382,32 +1392,32 @@ static void rna_def_fkeyframe(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Interpolation", "Interpolation method to use for segment of the F-Curve from " "this Keyframe until the next Keyframe"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "hide"); RNA_def_property_enum_items(prop, beztriple_keyframe_type_items); RNA_def_property_ui_text(prop, "Type", "Type of keyframe (for visual purposes only)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); /* Vector values */ prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle1_get", "rna_FKeyframe_handle1_set", NULL); RNA_def_property_ui_text(prop, "Left Handle", "Coordinates of the left handle (before the control point)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_FKeyframe_ctrlpoint_get", "rna_FKeyframe_ctrlpoint_set", NULL); RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_COORDS); /* keyframes are dimensionless */ RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle2_get", "rna_FKeyframe_handle2_set", NULL); RNA_def_property_ui_text(prop, "Right Handle", "Coordinates of the right handle (after the control point)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); } static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop) @@ -1448,7 +1458,7 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove a modifier from this F-Curve"); /* modifier to remove */ parm = RNA_def_pointer(func, "modifier", "FModifier", "", "Removed modifier"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } /* fcurve.keyframe_points */ @@ -1463,7 +1473,8 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop) {INSERTKEY_REPLACE, "REPLACE", 0, "Replace", "Don't add any new keyframes, but just replace existing ones"}, {INSERTKEY_NEEDED, "NEEDED", 0, "Needed", "Only adds keyframes that are needed"}, {INSERTKEY_FAST, "FAST", 0, "Fast", "Fast keyframe insertion to avoid recalculating the curve each time"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; RNA_def_property_srna(cprop, "FCurveKeyframePoints"); srna = RNA_def_struct(brna, "FCurveKeyframePoints", NULL); @@ -1492,7 +1503,7 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove keyframe from an F-Curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); /* optional */ RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time"); } @@ -1507,12 +1518,14 @@ static void rna_def_fcurve(BlenderRNA *brna) static EnumPropertyItem prop_mode_extend_items[] = { {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", 0, "Constant", ""}, {FCURVE_EXTRAPOLATE_LINEAR, "LINEAR", 0, "Linear", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_mode_color_items[] = { {FCURVE_COLOR_AUTO_RAINBOW, "AUTO_RAINBOW", 0, "Auto Rainbow", ""}, {FCURVE_COLOR_AUTO_RGB, "AUTO_RGB", 0, "Auto XYZ to RGB", ""}, {FCURVE_COLOR_CUSTOM, "CUSTOM", 0, "User Defined", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "FCurve", NULL); RNA_def_struct_ui_text(srna, "F-Curve", "F-Curve defining values of a period of time"); @@ -1523,7 +1536,7 @@ static void rna_def_fcurve(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "extend"); RNA_def_property_enum_items(prop, prop_mode_extend_items); RNA_def_property_ui_text(prop, "Extrapolation", ""); - /* XXX need an update callback for this so that animation gets evaluated */ + /* XXX need an update callback for this so that animation gets evaluated */ RNA_def_property_update(prop, NC_ANIMATION, NULL); /* Pointers */ @@ -1543,14 +1556,14 @@ static void rna_def_fcurve(BlenderRNA *brna) RNA_def_property_string_funcs(prop, "rna_FCurve_RnaPath_get", "rna_FCurve_RnaPath_length", "rna_FCurve_RnaPath_set"); RNA_def_property_ui_text(prop, "Data Path", "RNA Path to property affected by F-Curve"); - /* XXX need an update callback for this to that animation gets evaluated */ + /* XXX need an update callback for this to that animation gets evaluated */ RNA_def_property_update(prop, NC_ANIMATION, NULL); /* called 'index' when given as function arg */ prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property affected by F-Curve if applicable"); - /* XXX need an update callback for this so that animation gets evaluated */ + /* XXX need an update callback for this so that animation gets evaluated */ RNA_def_property_update(prop, NC_ANIMATION, NULL); /* Color */ @@ -1569,22 +1582,22 @@ static void rna_def_fcurve(BlenderRNA *brna) prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_SELECTED); RNA_def_property_ui_text(prop, "Select", "F-Curve is selected for editing"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_PROTECTED); RNA_def_property_ui_text(prop, "Lock", "F-Curve's settings cannot be edited"); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_MUTED); RNA_def_property_ui_text(prop, "Muted", "F-Curve is not evaluated"); - RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FCURVE_VISIBLE); RNA_def_property_ui_text(prop, "Hide", "F-Curve and its keyframes are hidden in the Graph Editor graphs"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL); /* State Info (for Debugging) */ prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE); @@ -1592,7 +1605,7 @@ static void rna_def_fcurve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Valid", "False when F-Curve could not be evaluated in past, so should be skipped " "when evaluating"); - RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + RNA_def_property_update(prop, NC_ANIMATION | ND_KEYFRAME_PROP, NULL); /* Collections */ prop = RNA_def_property(srna, "sampled_points", PROP_COLLECTION, PROP_NONE); @@ -1635,8 +1648,8 @@ static void rna_def_fcurve(BlenderRNA *brna) void RNA_def_fcurve(BlenderRNA *brna) { rna_def_fcurve(brna); - rna_def_fkeyframe(brna); - rna_def_fpoint(brna); + rna_def_fkeyframe(brna); + rna_def_fpoint(brna); rna_def_drivertarget(brna); rna_def_drivervar(brna); @@ -1646,8 +1659,10 @@ void RNA_def_fcurve(BlenderRNA *brna) rna_def_fmodifier_generator(brna); rna_def_fmodifier_function_generator(brna); + rna_def_fmodifier_envelope(brna); - rna_def_fmodifier_envelope_ctrl(brna); + rna_def_fmodifier_envelope_ctrl(brna); + rna_def_fmodifier_cycles(brna); rna_def_fmodifier_python(brna); rna_def_fmodifier_limits(brna); diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 003b4ae4fbc..8dd1bc86ca1 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -51,9 +51,9 @@ #include "BKE_particle.h" #include "BKE_pointcache.h" -static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr) +static StructRNA *rna_FluidSettings_refine(struct PointerRNA *ptr) { - FluidsimSettings *fss = (FluidsimSettings*)ptr->data; + FluidsimSettings *fss = (FluidsimSettings *)ptr->data; switch (fss->type) { case OB_FLUIDSIM_DOMAIN: @@ -80,7 +80,7 @@ static void rna_fluid_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR Object *ob = ptr->id.data; DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); } static int fluidsim_find_lastframe(Object *ob, FluidsimSettings *fss) @@ -103,7 +103,7 @@ static int fluidsim_find_lastframe(Object *ob, FluidsimSettings *fss) static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr) { Object *ob = ptr->id.data; - FluidsimModifierData *fluidmd = (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim); + FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim); if (fluidmd->fss->flag & OB_FLUIDSIM_REVERSE) { fluidmd->fss->lastgoodframe = fluidsim_find_lastframe(ob, fluidmd->fss); @@ -116,13 +116,13 @@ static void rna_fluid_find_enframe(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; FluidsimModifierData *fluidmd; ParticleSystemModifierData *psmd; ParticleSystem *psys; ParticleSettings *part; - fluidmd = (FluidsimModifierData*)modifiers_findByType(ob, eModifierType_Fluidsim); + fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim); fluidmd->fss->flag &= ~OB_FLUIDSIM_REVERSE; /* clear flag */ /* remove fluidsim particle system */ @@ -144,7 +144,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA BLI_addtail(&ob->particlesystem, psys); /* add modifier */ - psmd = (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem); + psmd = (ParticleSystemModifierData *)modifier_new(eModifierType_ParticleSystem); BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name)); psmd->psys = psys; BLI_addtail(&ob->modifiers, psmd); @@ -175,8 +175,8 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v (void)ptr; value[0] = '\0'; #else - Object *ob = (Object*)ptr->id.data; - FluidsimSettings *fss = (FluidsimSettings*)ptr->data; + Object *ob = (Object *)ptr->id.data; + FluidsimSettings *fss = (FluidsimSettings *)ptr->data; fluid_estimate_memory(ob, fss, value); #endif @@ -193,7 +193,7 @@ static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr static char *rna_FluidSettings_path(PointerRNA *ptr) { - FluidsimSettings *fss = (FluidsimSettings*)ptr->data; + FluidsimSettings *fss = (FluidsimSettings *)ptr->data; ModifierData *md = (ModifierData *)fss->fmd; return BLI_sprintfN("modifiers[\"%s\"].settings", md->name); @@ -201,13 +201,13 @@ static char *rna_FluidSettings_path(PointerRNA *ptr) static void rna_FluidMeshVertex_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - FluidsimSettings *fss = (FluidsimSettings*)ptr->data; - rna_iterator_array_begin(iter, fss->meshVelocities, sizeof(float)*3, fss->totvert, 0, NULL); + FluidsimSettings *fss = (FluidsimSettings *)ptr->data; + rna_iterator_array_begin(iter, fss->meshVelocities, sizeof(float) * 3, fss->totvert, 0, NULL); } static int rna_FluidMeshVertex_data_length(PointerRNA *ptr) { - FluidsimSettings *fss = (FluidsimSettings*)ptr->data; + FluidsimSettings *fss = (FluidsimSettings *)ptr->data; return fss->totvert; } @@ -225,7 +225,8 @@ static void rna_def_fluidsim_slip(StructRNA *srna) "Mix between no-slip and free-slip (non moving objects only!)"}, {OB_FSBND_FREESLIP, "FREESLIP", 0, "Free Slip", "Obstacle only causes zero normal velocity (=not sticky, non moving objects only!)"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; prop = RNA_def_property(srna, "slip_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "typeFlags"); @@ -267,7 +268,8 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) {OB_FSDOM_GEOM, "GEOMETRY", 0, "Geometry", "Display geometry"}, {OB_FSDOM_PREVIEW, "PREVIEW", 0, "Preview", "Display preview quality results"}, {OB_FSDOM_FINAL, "FINAL", 0, "Final", "Display final quality results"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings"); @@ -446,7 +448,8 @@ static void rna_def_fluidsim_volume(StructRNA *srna) {1, "VOLUME", 0, "Volume", "Use only the inner volume of the mesh"}, {2, "SHELL", 0, "Shell", "Use only the outer shell of the mesh"}, {3, "BOTH", 0, "Both", "Use both the inner volume and the outer shell of the mesh"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; prop = RNA_def_property(srna, "volume_initialization", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "volumeInitType"); @@ -675,8 +678,9 @@ void RNA_def_fluidsim(BlenderRNA *brna) "Object is made a particle system to display particles generated by a " "fluidsim domain object"}, {OB_FLUIDSIM_CONTROL, "CONTROL", 0, "Control", - "Object is made a fluid control mesh, which influences the fluid"}, - {0, NULL, 0, NULL, NULL}}; + "Object is made a fluid control mesh, which influences the fluid"}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "FluidSettings", NULL); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 53ef1bdbf82..e246c6975b5 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -116,13 +116,13 @@ static void rna_def_gpencil_stroke_point(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "x"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Coordinates", ""); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pressure"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); } static void rna_def_gpencil_stroke(BlenderRNA *brna) @@ -207,26 +207,26 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "color[3]"); RNA_def_property_range(prop, 0.3, 1.0f); RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); /* Line Thickness */ prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "thickness"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); /* Onion-Skinning */ prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN); RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); prop = RNA_def_property(srna, "ghost_range_max", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gstep"); @@ -234,23 +234,23 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Max Ghost Range", "Maximum number of frames on either side of the active frame to show " "(0 = show the 'first' available sketch on either side)"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); /* Flags */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE); RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED); RNA_def_property_ui_text(prop, "Locked", "Protect layer from further editing and/or frame changes"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); prop = RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_FRAMELOCK); RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); /* expose as layers.active */ #if 0 @@ -258,25 +258,25 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE); RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set"); RNA_def_property_ui_text(prop, "Active", "Set active layer for editing"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); #endif prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT); RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the DopeSheet"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); - /* XXX keep this option? */ + /* XXX keep this option? */ prop = RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG); RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); /* X-Ray */ prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY); RNA_def_property_ui_text(prop, "X Ray", "Make the layer draw in front of objects"); - RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL); + RNA_def_property_update(prop, NC_SCREEN | ND_GPENCIL, NULL); } static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop) @@ -304,7 +304,7 @@ static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove a spline from a curve"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); #endif prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); @@ -322,9 +322,10 @@ static void rna_def_gpencil_data(BlenderRNA *brna) static EnumPropertyItem draw_mode_items[] = { {GP_DATA_VIEWALIGN, "CURSOR", 0, "Cursor", "Draw stroke at the 3D cursor"}, {0, "VIEW", 0, "View", "Stick stroke to the view "}, /* weird, GP_DATA_VIEWALIGN is inverted */ - {GP_DATA_VIEWALIGN|GP_DATA_DEPTH_VIEW, "SURFACE", 0, "Surface", "Stick stroke to surfaces"}, - {GP_DATA_VIEWALIGN|GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"}, - {0, NULL, 0, NULL, NULL}}; + {GP_DATA_VIEWALIGN | GP_DATA_DEPTH_VIEW, "SURFACE", 0, "Surface", "Stick stroke to surfaces"}, + {GP_DATA_VIEWALIGN | GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "GreasePencil", "ID"); RNA_def_struct_sdna(srna, "bGPdata"); diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index 773daaa6742..586b71aa2da 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -48,27 +48,27 @@ static PointerRNA rna_Group_objects_get(CollectionPropertyIterator *iter) ListBaseIterator *internal = iter->internal; /* we are actually iterating a GroupObject list, so override get */ - return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((GroupObject*)internal->link)->ob); + return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, ((GroupObject *)internal->link)->ob); } static void rna_Group_objects_link(Group *group, bContext *C, ReportList *reports, Object *object) { if (!add_to_group(group, object, CTX_data_scene(C), NULL)) { - BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\"", object->id.name+2, group->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Object \"%s\" already in group \"%s\"", object->id.name + 2, group->id.name + 2); return; } - WM_main_add_notifier(NC_OBJECT|ND_DRAW, &object->id); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id); } static void rna_Group_objects_unlink(Group *group, bContext *C, ReportList *reports, Object *object) { if (!rem_from_group(group, object, CTX_data_scene(C), NULL)) { - BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\"", object->id.name+2, group->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Object \"%s\" not in group \"%s\"", object->id.name + 2, group->id.name + 2); return; } - WM_main_add_notifier(NC_OBJECT|ND_DRAW, &object->id); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, &object->id); } #else @@ -89,16 +89,16 @@ static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop) /* add object */ func = RNA_def_function(srna, "link", "rna_Group_objects_link"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add this object to a group"); /* object to add */ parm = RNA_def_pointer(func, "object", "Object", "", "Object to add"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); /* remove object */ func = RNA_def_function(srna, "unlink", "rna_Group_objects_unlink"); RNA_def_function_ui_description(func, "Remove this object to a group"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); /* object to remove */ parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove"); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -113,7 +113,7 @@ void RNA_def_group(BlenderRNA *brna) srna = RNA_def_struct(brna, "Group", "ID"); RNA_def_struct_ui_text(srna, "Group", "Group of Object datablocks"); RNA_def_struct_ui_icon(srna, ICON_GROUP); - /* this is done on save/load in readfile.c, removed if no objects are in the group */ + /* this is done on save/load in readfile.c, removed if no objects are in the group */ RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); prop = RNA_def_property(srna, "dupli_offset", PROP_FLOAT, PROP_TRANSLATION); diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 7052bfa8225..b022da97630 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -48,7 +48,8 @@ static EnumPropertyItem image_source_items[] = { {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"}, {IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"}, {IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -56,20 +57,20 @@ static EnumPropertyItem image_source_items[] = { static void rna_Image_animated_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Image *ima = (Image*)ptr->data; - int nr; + Image *ima = (Image *)ptr->data; + int nr; if (ima->flag & IMA_TWINANIM) { - nr = ima->xrep*ima->yrep; + nr = ima->xrep * ima->yrep; if (ima->twsta >= nr) ima->twsta = 1; - if (ima->twend >= nr) ima->twend = nr-1; - if (ima->twsta>ima->twend) ima->twsta = 1; + if (ima->twend >= nr) ima->twend = nr - 1; + if (ima->twsta > ima->twend) ima->twsta = 1; } } static int rna_Image_dirty_get(PointerRNA *ptr) { - Image *ima = (Image*)ptr->data; + Image *ima = (Image *)ptr->data; ImBuf *ibuf; for (ibuf = ima->ibufs.first; ibuf; ibuf = ibuf->next) @@ -111,7 +112,7 @@ static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi { Image *ima = ptr->id.data; BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); - WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id); + WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id); DAG_id_tag_update(&ima->id, 0); } @@ -120,7 +121,7 @@ static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P { Image *ima = ptr->id.data; BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD); - WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id); + WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id); DAG_id_tag_update(&ima->id, 0); } @@ -144,8 +145,8 @@ char *rna_ImageUser_path(PointerRNA *ptr) /* ImageUser *iuser= ptr->data; */ switch (GS(((ID *)ptr->id.data)->name)) { - case ID_TE: - return BLI_strdup("image_user"); + case ID_TE: + return BLI_strdup("image_user"); } } @@ -155,7 +156,7 @@ char *rna_ImageUser_path(PointerRNA *ptr) static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) { - Image *ima = (Image*)ptr->data; + Image *ima = (Image *)ptr->data; EnumPropertyItem *item = NULL; int totitem = 0; @@ -177,22 +178,22 @@ static EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C), PointerRNA static int rna_Image_file_format_get(PointerRNA *ptr) { - Image *image = (Image*)ptr->data; + Image *image = (Image *)ptr->data; ImBuf *ibuf = BKE_image_get_ibuf(image, NULL); return BKE_ftype_to_imtype(ibuf ? ibuf->ftype : 0); } static void rna_Image_file_format_set(PointerRNA *ptr, int value) { - Image *image = (Image*)ptr->data; + Image *image = (Image *)ptr->data; if (BKE_imtype_is_movie(value) == 0) { /* should be able to throw an error here */ ImBuf *ibuf; int ftype = BKE_imtype_to_ftype(value); #if 0 - ibuf= BKE_image_get_ibuf(image, NULL); + ibuf = BKE_image_get_ibuf(image, NULL); if (ibuf) - ibuf->ftype= ftype; + ibuf->ftype = ftype; #endif /* to be safe change all buffer file types */ @@ -204,7 +205,7 @@ static void rna_Image_file_format_set(PointerRNA *ptr, int value) static int rna_Image_has_data_get(PointerRNA *ptr) { - Image *im = (Image*)ptr->data; + Image *im = (Image *)ptr->data; if (im->ibufs.first) return 1; @@ -214,7 +215,7 @@ static int rna_Image_has_data_get(PointerRNA *ptr) static void rna_Image_size_get(PointerRNA *ptr, int *values) { - Image *im = (Image*)ptr->data; + Image *im = (Image *)ptr->data; ImBuf *ibuf; void *lock; @@ -233,7 +234,7 @@ static void rna_Image_size_get(PointerRNA *ptr, int *values) static void rna_Image_resolution_get(PointerRNA *ptr, float *values) { - Image *im = (Image*)ptr->data; + Image *im = (Image *)ptr->data; ImBuf *ibuf; void *lock; @@ -252,7 +253,7 @@ static void rna_Image_resolution_get(PointerRNA *ptr, float *values) static void rna_Image_resolution_set(PointerRNA *ptr, const float *values) { - Image *im = (Image*)ptr->data; + Image *im = (Image *)ptr->data; ImBuf *ibuf; void *lock; @@ -267,7 +268,7 @@ static void rna_Image_resolution_set(PointerRNA *ptr, const float *values) static int rna_Image_depth_get(PointerRNA *ptr) { - Image *im = (Image*)ptr->data; + Image *im = (Image *)ptr->data; ImBuf *ibuf; void *lock; int planes; @@ -295,7 +296,7 @@ static int rna_Image_pixels_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock); if (ibuf) - length[0] = ibuf->x*ibuf->y*ibuf->channels; + length[0] = ibuf->x * ibuf->y * ibuf->channels; else length[0] = 0; @@ -314,14 +315,14 @@ static void rna_Image_pixels_get(PointerRNA *ptr, float *values) ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock); if (ibuf) { - size = ibuf->x*ibuf->y*ibuf->channels; + size = ibuf->x * ibuf->y * ibuf->channels; if (ibuf->rect_float) { - memcpy(values, ibuf->rect_float, sizeof(float)*size); + memcpy(values, ibuf->rect_float, sizeof(float) * size); } else { for (i = 0; i < size; i++) - values[i] = ((unsigned char*)ibuf->rect)[i]*(1.0f/255.0f); + values[i] = ((unsigned char *)ibuf->rect)[i] * (1.0f / 255.0f); } } @@ -338,14 +339,14 @@ static void rna_Image_pixels_set(PointerRNA *ptr, const float *values) ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock); if (ibuf) { - size = ibuf->x*ibuf->y*ibuf->channels; + size = ibuf->x * ibuf->y * ibuf->channels; if (ibuf->rect_float) { - memcpy(ibuf->rect_float, values, sizeof(float)*size); + memcpy(ibuf->rect_float, values, sizeof(float) * size); } else { for (i = 0; i < size; i++) - ((unsigned char*)ibuf->rect)[i] = FTOCHAR(values[i]); + ((unsigned char *)ibuf->rect)[i] = FTOCHAR(values[i]); } ibuf->userflags |= IB_BITMAPDIRTY; @@ -423,20 +424,24 @@ static void rna_def_image(BlenderRNA *brna) {IMA_TYPE_UV_TEST, "UV_TEST", 0, "UV Test", ""}, {IMA_TYPE_R_RESULT, "RENDER_RESULT", 0, "Render Result", ""}, {IMA_TYPE_COMPOSITE, "COMPOSITING", 0, "Compositing", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static const EnumPropertyItem prop_generated_type_items[] = { {0, "BLANK", 0, "Blank", "Generate a blank image"}, {1, "UV_GRID", 0, "UV Grid", "Generated grid to test UV mappings"}, {2, "COLOR_GRID", 0, "Color Grid", "Generated improved UV grid to test UV mappings"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static const EnumPropertyItem prop_mapping_items[] = { {0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"}, {IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static const EnumPropertyItem prop_field_order_items[] = { {0, "EVEN", 0, "Upper First", "Upper field first"}, {IMA_STD_FIELD, "ODD", 0, "Lower First", "Lower field first"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Image", "ID"); RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image"); @@ -445,7 +450,7 @@ static void rna_def_image(BlenderRNA *brna) prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "File Name", "Image/Movie file name"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_reload_update"); /* eek. this is horrible but needed so we can save to a new name without blanking the data :( */ prop = RNA_def_property(srna, "filepath_raw", PROP_STRING, PROP_FILEPATH); @@ -461,13 +466,13 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_enum_items(prop, image_source_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Image_source_itemf"); RNA_def_property_ui_text(prop, "Source", "Where the image comes from"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_source_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_source_update"); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Type", "How to generate the image"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); @@ -477,25 +482,25 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_field_order_items); RNA_def_property_ui_text(prop, "Field Order", "Order of video fields (select which lines are displayed first)"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); /* booleans */ prop = RNA_def_property(srna, "use_fields", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS); RNA_def_property_ui_text(prop, "Fields", "Use fields of the image"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_fields_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_fields_update"); prop = RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL); RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_free_update"); prop = RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_CM_PREDIVIDE); RNA_def_property_ui_text(prop, "Color Unpremultiply", "For premultiplied alpha images, do color space conversion on colors without alpha, " "to avoid fringing for images with light backgrounds"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_free_update"); prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL); @@ -507,100 +512,100 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "gen_type"); RNA_def_property_enum_items(prop, prop_generated_type_items); RNA_def_property_ui_text(prop, "Generated Type", "Generated image type"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update"); prop = RNA_def_property(srna, "generated_width", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gen_x"); RNA_def_property_range(prop, 1, 16384); RNA_def_property_ui_text(prop, "Generated Width", "Generated image width"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update"); prop = RNA_def_property(srna, "generated_height", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gen_y"); RNA_def_property_range(prop, 1, 16384); RNA_def_property_ui_text(prop, "Generated Height", "Generated image height"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update"); prop = RNA_def_property(srna, "use_generated_float", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gen_flag", IMA_GEN_FLOAT); RNA_def_property_ui_text(prop, "Float Buffer", "Generate floating point buffer"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_generated_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_generated_update"); /* realtime properties */ prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_mapping_items); RNA_def_property_ui_text(prop, "Mapping", "Mapping type to use for this image in the game engine"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "aspx"); RNA_def_property_array(prop, 2); RNA_def_property_range(prop, 0.1f, 5000.0f); RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "use_animation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TWINANIM); RNA_def_property_ui_text(prop, "Animated", "Use as animated texture in the game engine"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_animated_update"); prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "twsta"); RNA_def_property_range(prop, 0, 128); RNA_def_property_ui_text(prop, "Animation Start", "Start frame of an animated texture"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_animated_update"); prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "twend"); RNA_def_property_range(prop, 0, 128); RNA_def_property_ui_text(prop, "Animation End", "End frame of an animated texture"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_animated_update"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_animated_update"); prop = RNA_def_property(srna, "fps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "animspeed"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Animation Speed", "Speed of the animation in frames per second"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "use_tiles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_TILES); RNA_def_property_ui_text(prop, "Tiles", "Use of tilemode for faces (default shift-LMB to pick the tile for selected faces)"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "tiles_x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "xrep"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Tiles X", "Degree of repetition in the X direction"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "tiles_y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "yrep"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Tiles Y", "Degree of repetition in the Y direction"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "use_clamp_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_U); RNA_def_property_ui_text(prop, "Clamp X", "Disable texture repeating horizontally"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "use_clamp_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tpageflag", IMA_CLAMP_V); RNA_def_property_ui_text(prop, "Clamp Y", "Disable texture repeating vertically"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "bindcode", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "bindcode"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "render_slot", PROP_INT, PROP_UNSIGNED); RNA_def_property_range(prop, 0, IMA_MAX_RENDER_SLOT - 1); RNA_def_property_ui_text(prop, "Render Slot", "The current render slot displayed, only for viewer type images"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); /* * Image.has_data and Image.depth are temporary, diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 84321809ae9..f191303a92c 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -109,7 +109,7 @@ static void rna_Image_save(Image *image, ReportList *reports) if (image->packedfile) { if (writePackedFile(reports, image->name, image->packedfile, 0) != RET_OK) { - BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could saved packed file to \"%s\"", image->id.name+2, image->name); + BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could saved packed file to \"%s\"", image->id.name + 2, image->name); } } else if (IMB_saveiff(ibuf, filename, ibuf->flags)) { @@ -121,11 +121,11 @@ static void rna_Image_save(Image *image, ReportList *reports) ibuf->userflags &= ~IB_BITMAPDIRTY; } else { - BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could not be saved to \"%s\"", image->id.name+2, image->name); + BKE_reportf(reports, RPT_ERROR, "Image \"%s\" could not be saved to \"%s\"", image->id.name + 2, image->name); } } else { - BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name + 2); } } @@ -157,7 +157,7 @@ static void rna_Image_unpack(Image *image, ReportList *reports, int method) } else { /* reports its own error on failure */ - unpackImage (reports, image, method); + unpackImage(reports, image, method); } } @@ -171,7 +171,7 @@ static void rna_Image_update(Image *image, ReportList *reports) ImBuf *ibuf = BKE_image_get_ibuf(image, NULL); if (ibuf == NULL) { - BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name + 2); return; } @@ -189,13 +189,13 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int ibuf = BKE_image_get_ibuf(image, NULL); - if (ibuf == NULL || ibuf->rect == NULL ) { - BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2); + if (ibuf == NULL || ibuf->rect == NULL) { + BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name + 2); return (int)GL_INVALID_OPERATION; } /* could be made into a function? */ - glGenTextures(1, (GLuint*)bind); + glGenTextures(1, (GLuint *)bind); glBindTexture(GL_TEXTURE_2D, *bind); if (filter != GL_NEAREST && filter != GL_LINEAR) @@ -212,7 +212,7 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int } if (error) { - glDeleteTextures(1, (GLuint*)bind); + glDeleteTextures(1, (GLuint *)bind); image->bindcode = 0; } @@ -236,7 +236,7 @@ void RNA_api_image(StructRNA *srna) func = RNA_def_function(srna, "save_render", "rna_Image_save_render"); RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); parm = RNA_def_string_file_path(func, "filepath", "", 0, "", "Save path"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from"); diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 94120c8edc6..5a56518e498 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -57,11 +57,11 @@ static Key *rna_ShapeKey_find_key(ID *id) { switch (GS(id->name)) { - case ID_CU: return ((Curve*)id)->key; - case ID_KE: return (Key*)id; - case ID_LT: return ((Lattice*)id)->key; - case ID_ME: return ((Mesh*)id)->key; - case ID_OB: return ob_get_key((Object*)id); + case ID_CU: return ((Curve *)id)->key; + case ID_KE: return (Key *)id; + case ID_LT: return ((Lattice *)id)->key; + case ID_ME: return ((Mesh *)id)->key; + case ID_OB: return ob_get_key((Object *)id); default: return NULL; } } @@ -89,14 +89,14 @@ void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value) static void rna_ShapeKey_value_set(PointerRNA *ptr, float value) { - KeyBlock *data = (KeyBlock*)ptr->data; + KeyBlock *data = (KeyBlock *)ptr->data; CLAMP(value, data->slidermin, data->slidermax); data->curval = value; } static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - KeyBlock *data = (KeyBlock*)ptr->data; + KeyBlock *data = (KeyBlock *)ptr->data; *min = data->slidermin; *max = data->slidermax; @@ -107,7 +107,7 @@ static void rna_ShapeKey_value_range(PointerRNA *ptr, float *min, float *max, fl static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - KeyBlock *data = (KeyBlock*)ptr->data; + KeyBlock *data = (KeyBlock *)ptr->data; *min = -10.0f; *max = data->slidermax - SHAPEKEY_SLIDER_TOL; @@ -115,7 +115,7 @@ static void rna_ShapeKey_slider_min_range(PointerRNA *ptr, float *min, float *ma static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value) { - KeyBlock *data = (KeyBlock*)ptr->data; + KeyBlock *data = (KeyBlock *)ptr->data; float min, max, softmin, softmax; rna_ShapeKey_slider_min_range(ptr, &min, &max, &softmin, &softmax); @@ -125,7 +125,7 @@ static void rna_ShapeKey_slider_min_set(PointerRNA *ptr, float value) static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - KeyBlock *data = (KeyBlock*)ptr->data; + KeyBlock *data = (KeyBlock *)ptr->data; *min = data->slidermin + SHAPEKEY_SLIDER_TOL; *max = 10.0f; @@ -133,7 +133,7 @@ static void rna_ShapeKey_slider_max_range(PointerRNA *ptr, float *min, float *ma static void rna_ShapeKey_slider_max_set(PointerRNA *ptr, float value) { - KeyBlock *data = (KeyBlock*)ptr->data; + KeyBlock *data = (KeyBlock *)ptr->data; float min, max, softmin, softmax; rna_ShapeKey_slider_max_range(ptr, &min, &max, &softmin, &softmax); @@ -171,21 +171,21 @@ int rna_object_shapekey_index_set(ID *id, PointerRNA value, int current) static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr) { - KeyBlock *kb = (KeyBlock*)ptr->data; + KeyBlock *kb = (KeyBlock *)ptr->data; return rna_object_shapekey_index_get(ptr->id.data, kb->relative); } static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, PointerRNA value) { - KeyBlock *kb = (KeyBlock*)ptr->data; + KeyBlock *kb = (KeyBlock *)ptr->data; kb->relative = rna_object_shapekey_index_set(ptr->id.data, value, kb->relative); } static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, float *values) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; values[0] = vec[0]; values[1] = vec[1]; @@ -194,7 +194,7 @@ static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, float *values) static void rna_ShapeKeyPoint_co_set(PointerRNA *ptr, const float *values) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; vec[0] = values[0]; vec[1] = values[1]; @@ -203,37 +203,37 @@ static void rna_ShapeKeyPoint_co_set(PointerRNA *ptr, const float *values) static float rna_ShapeKeyCurvePoint_tilt_get(PointerRNA *ptr) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; return vec[3]; } static void rna_ShapeKeyCurvePoint_tilt_set(PointerRNA *ptr, float value) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; vec[3] = value; } static void rna_ShapeKeyBezierPoint_co_get(PointerRNA *ptr, float *values) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; - values[0] = vec[0+3]; - values[1] = vec[1+3]; - values[2] = vec[2+3]; + values[0] = vec[0 + 3]; + values[1] = vec[1 + 3]; + values[2] = vec[2 + 3]; } static void rna_ShapeKeyBezierPoint_co_set(PointerRNA *ptr, const float *values) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; - vec[0+3] = values[0]; - vec[1+3] = values[1]; - vec[2+3] = values[2]; + vec[0 + 3] = values[0]; + vec[1 + 3] = values[1]; + vec[2 + 3] = values[2]; } static void rna_ShapeKeyBezierPoint_handle_1_co_get(PointerRNA *ptr, float *values) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; values[0] = vec[0]; values[1] = vec[1]; @@ -242,7 +242,7 @@ static void rna_ShapeKeyBezierPoint_handle_1_co_get(PointerRNA *ptr, float *valu static void rna_ShapeKeyBezierPoint_handle_1_co_set(PointerRNA *ptr, const float *values) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; vec[0] = values[0]; vec[1] = values[1]; @@ -251,46 +251,46 @@ static void rna_ShapeKeyBezierPoint_handle_1_co_set(PointerRNA *ptr, const float static void rna_ShapeKeyBezierPoint_handle_2_co_get(PointerRNA *ptr, float *values) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; - values[0] = vec[6+0]; - values[1] = vec[6+1]; - values[2] = vec[6+2]; + values[0] = vec[6 + 0]; + values[1] = vec[6 + 1]; + values[2] = vec[6 + 2]; } static void rna_ShapeKeyBezierPoint_handle_2_co_set(PointerRNA *ptr, const float *values) { - float *vec = (float*)ptr->data; + float *vec = (float *)ptr->data; - vec[6+0] = values[0]; - vec[6+1] = values[1]; - vec[6+2] = values[2]; + vec[6 + 0] = values[0]; + vec[6 + 1] = values[1]; + vec[6 + 2] = values[2]; } #if 0 static float rna_ShapeKeyBezierPoint_tilt_get(PointerRNA *ptr) { - float *vec= (float*)ptr->data; + float *vec = (float *)ptr->data; return vec[10]; } static void rna_ShapeKeyBezierPoint_tilt_set(PointerRNA *ptr, float value) { - float *vec= (float*)ptr->data; - vec[10]= value; + float *vec = (float *)ptr->data; + vec[10] = value; } #endif static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Key *key = rna_ShapeKey_find_key(ptr->id.data); - KeyBlock *kb = (KeyBlock*)ptr->data; + KeyBlock *kb = (KeyBlock *)ptr->data; Curve *cu; Nurb *nu; int tot = kb->totelem, size = key->elemsize; if (GS(key->from->name) == ID_CU) { - cu = (Curve*)key->from; + cu = (Curve *)key->from; nu = cu->nurb.first; if (nu->bezt) { @@ -299,19 +299,19 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA } } - rna_iterator_array_begin(iter, (void*)kb->data, size, tot, 0, NULL); + rna_iterator_array_begin(iter, (void *)kb->data, size, tot, 0, NULL); } static int rna_ShapeKey_data_length(PointerRNA *ptr) { Key *key = rna_ShapeKey_find_key(ptr->id.data); - KeyBlock *kb = (KeyBlock*)ptr->data; + KeyBlock *kb = (KeyBlock *)ptr->data; Curve *cu; Nurb *nu; int tot = kb->totelem; if (GS(key->from->name) == ID_CU) { - cu = (Curve*)key->from; + cu = (Curve *)key->from; nu = cu->nurb.first; if (nu->bezt) @@ -329,7 +329,7 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) Nurb *nu; if (GS(key->from->name) == ID_CU) { - cu = (Curve*)key->from; + cu = (Curve *)key->from; nu = cu->nurb.first; if (nu->bezt) @@ -362,7 +362,7 @@ static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *p for (ob = bmain->object.first; ob; ob = ob->id.next) { if (ob_get_key(ob) == key) { DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); } } } @@ -440,7 +440,7 @@ static char *rna_ShapeKeyPoint_path(PointerRNA *ptr) return BLI_sprintfN("shape_keys.key_blocks[\"%s\"].data[%d]", kb->name, index); } else - return NULL; /* XXX: there's really no way to resolve this... */ + return NULL; /* XXX: there's really no way to resolve this... */ } #else @@ -462,7 +462,7 @@ static void rna_def_keydata(BlenderRNA *brna) srna = RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL); RNA_def_struct_ui_text(srna, "Shape Key Curve Point", "Point in a shape key for curves"); - /* there's nothing type specific here, so this is fine for now */ + /* there's nothing type specific here, so this is fine for now */ RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); @@ -478,7 +478,7 @@ static void rna_def_keydata(BlenderRNA *brna) srna = RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL); RNA_def_struct_ui_text(srna, "Shape Key Bezier Point", "Point in a shape key for Bezier curves"); - /* there's nothing type specific here, so this is fine for now */ + /* there's nothing type specific here, so this is fine for now */ RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); @@ -519,7 +519,8 @@ static void rna_def_keyblock(BlenderRNA *brna) {KEY_LINEAR, "KEY_LINEAR", 0, "Linear", ""}, {KEY_CARDINAL, "KEY_CARDINAL", 0, "Cardinal", ""}, {KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ShapeKey", NULL); RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock"); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index e1cb714c68d..7adee6fd95f 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -52,7 +52,7 @@ static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value) { - Lamp *la = (Lamp*)ptr->data; + Lamp *la = (Lamp *)ptr->data; CLAMP(value, 512, 10240); la->bufsize = value; @@ -66,13 +66,13 @@ static PointerRNA rna_Lamp_sky_settings_get(PointerRNA *ptr) static void rna_Lamp_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Lamp *la = (Lamp*)ptr->data; - rna_iterator_array_begin(iter, (void*)la->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL); + Lamp *la = (Lamp *)ptr->data; + rna_iterator_array_begin(iter, (void *)la->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL); } static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr) { - Lamp *la = (Lamp*)ptr->data; + Lamp *la = (Lamp *)ptr->data; Tex *tex; tex = give_current_lamp_texture(la); @@ -81,16 +81,16 @@ static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr) static void rna_Lamp_active_texture_set(PointerRNA *ptr, PointerRNA value) { - Lamp *la = (Lamp*)ptr->data; + Lamp *la = (Lamp *)ptr->data; set_current_lamp_texture(la, value.data); } static int rna_use_shadow_get(PointerRNA *ptr) { - Lamp *la = (Lamp*)ptr->data; + Lamp *la = (Lamp *)ptr->data; - if(la->type == LA_SPOT) + if (la->type == LA_SPOT) return la->mode & LA_SHAD_BUF; else return la->mode & LA_SHAD_RAY; @@ -98,20 +98,20 @@ static int rna_use_shadow_get(PointerRNA *ptr) static void rna_use_shadow_set(PointerRNA *ptr, int value) { - Lamp *la = (Lamp*)ptr->data; + Lamp *la = (Lamp *)ptr->data; if (value) { - if(la->type == LA_SPOT) + if (la->type == LA_SPOT) la->mode |= LA_SHAD_BUF; else la->mode |= LA_SHAD_RAY; } else - la->mode &= ~(LA_SHAD_BUF|LA_SHAD_RAY); + la->mode &= ~(LA_SHAD_BUF | LA_SHAD_RAY); } -static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr) +static StructRNA *rna_Lamp_refine(struct PointerRNA *ptr) { - Lamp *la = (Lamp*)ptr->data; + Lamp *la = (Lamp *)ptr->data; switch (la->type) { case LA_LOCAL: @@ -135,9 +135,9 @@ static void rna_Lamp_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) DAG_id_tag_update(&la->id, 0); if (scene->gm.matmode == GAME_MAT_GLSL) - WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la); + WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la); else - WM_main_add_notifier(NC_LAMP|ND_LIGHTING, la); + WM_main_add_notifier(NC_LAMP | ND_LIGHTING, la); } static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) @@ -145,7 +145,7 @@ static void rna_Lamp_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poin Lamp *la = ptr->id.data; DAG_id_tag_update(&la->id, 0); - WM_main_add_notifier(NC_LAMP|ND_LIGHTING_DRAW, la); + WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la); } static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) @@ -153,7 +153,7 @@ static void rna_Lamp_sky_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Point Lamp *la = ptr->id.data; DAG_id_tag_update(&la->id, 0); - WM_main_add_notifier(NC_LAMP|ND_SKY, la); + WM_main_add_notifier(NC_LAMP | ND_SKY, la); } /* only for rad/deg conversion! can remove later */ @@ -171,7 +171,7 @@ static void rna_Lamp_spot_size_set(PointerRNA *ptr, float value) static void rna_Lamp_use_nodes_update(Main *blain, Scene *scene, PointerRNA *ptr) { - Lamp *la = (Lamp*)ptr->data; + Lamp *la = (Lamp *)ptr->data; if (la->use_nodes && la->nodetree == NULL) ED_node_shader_default(scene, &la->id); @@ -187,7 +187,8 @@ EnumPropertyItem lamp_type_items[] = { {LA_SPOT, "SPOT", 0, "Spot", "Directional cone light source"}, {LA_HEMI, "HEMI", 0, "Hemi", "180 degree constant light source"}, {LA_AREA, "AREA", 0, "Area", "Directional area light source"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static void rna_def_lamp_mtex(BlenderRNA *brna) { @@ -198,7 +199,8 @@ static void rna_def_lamp_mtex(BlenderRNA *brna) {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"}, {TEXCO_VIEW, "VIEW", 0, "View", "Use view coordinates for the texture coordinates"}, {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "LampTextureSlot", "TextureSlot"); RNA_def_struct_sdna(srna, "MTex"); @@ -247,7 +249,8 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna) {0, "SMPTE", 0, "SMPTE", ""}, {1, "REC709", 0, "REC709", ""}, {2, "CIE", 0, "CIE", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "LampSkySettings", NULL); RNA_def_struct_sdna(srna, "Lamp"); @@ -418,7 +421,7 @@ static void rna_def_lamp(BlenderRNA *brna) /* textures */ rna_def_mtex_common(brna, srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get", - "rna_Lamp_active_texture_set", NULL, "LampTextureSlot", "LampTextureSlots", "rna_Lamp_update"); + "rna_Lamp_active_texture_set", NULL, "LampTextureSlot", "LampTextureSlots", "rna_Lamp_update"); } static void rna_def_lamp_falloff(StructRNA *srna) @@ -431,7 +434,8 @@ static void rna_def_lamp_falloff(StructRNA *srna) {LA_FALLOFF_INVSQUARE, "INVERSE_SQUARE", 0, "Inverse Square", ""}, {LA_FALLOFF_CURVE, "CUSTOM_CURVE", 0, "Custom Curve", ""}, {LA_FALLOFF_SLIDERS, "LINEAR_QUADRATIC_WEIGHTED", 0, "Lin/Quad Weighted", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_fallofftype_items); @@ -468,24 +472,28 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) static EnumPropertyItem prop_shadow_items[] = { {0, "NOSHADOW", 0, "No Shadow", ""}, {LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_spot_shadow_items[] = { {0, "NOSHADOW", 0, "No Shadow", ""}, {LA_SHAD_BUF, "BUFFER_SHADOW", 0, "Buffer Shadow", "Let spotlight produce shadows using shadow buffer"}, {LA_SHAD_RAY, "RAY_SHADOW", 0, "Ray Shadow", "Use ray tracing for shadow"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_ray_sampling_method_items[] = { {LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""}, {LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_spot_ray_sampling_method_items[] = { {LA_SAMP_HALTON, "ADAPTIVE_QMC", 0, "Adaptive QMC", ""}, {LA_SAMP_HAMMERSLEY, "CONSTANT_QMC", 0, "Constant QMC", ""}, {LA_SAMP_CONSTANT, "CONSTANT_JITTERED", 0, "Constant Jittered", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_shadbuftype_items[] = { {LA_SHADBUF_REGULAR, "REGULAR", 0, "Classical", "Classic shadow buffer"}, @@ -497,33 +505,37 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) {LA_SHADBUF_DEEP, "DEEP", 0, "Deep", "Deep shadow buffer supports transparency and better filtering, at the cost of " "more memory usage and processing time"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_shadbuffiltertype_items[] = { {LA_SHADBUF_BOX, "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples"}, {LA_SHADBUF_TENT, "TENT", 0, "Tent", "Apply the Tent Filter to shadow buffer samples"}, {LA_SHADBUF_GAUSS, "GAUSS", 0, "Gauss", "Apply the Gauss filter to shadow buffer samples"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_numbuffer_items[] = { {1, "BUFFERS_1", 0, "1", "Only one buffer rendered"}, {4, "BUFFERS_4", 0, "4", "Render 4 buffers for better AA, this quadruples memory usage"}, {9, "BUFFERS_9", 0, "9", "Render 9 buffers for better AA, this uses nine times more memory"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; /* GE only */ static EnumPropertyItem prop_ge_shadowbuffer_type_items[] = { {LA_SHADMAP_SIMPLE, "SIMPLE", 0, "Simple", "Simple shadow maps"}, {LA_SHADMAP_VARIANCE, "VARIANCE", 0, "Variance", "Variance shadow maps"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; - prop= RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "use_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_use_shadow_get", "rna_use_shadow_set"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); - prop= RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE); + prop = RNA_def_property(srna, "shadow_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); - RNA_def_property_enum_items(prop, (spot)? prop_spot_shadow_items: prop_shadow_items); + RNA_def_property_enum_items(prop, (spot) ? prop_spot_shadow_items : prop_shadow_items); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "shadow_buffer_size", PROP_INT, PROP_NONE); @@ -555,7 +567,7 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) "Shadow map clip start, below which objects will not generate shadows"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); - prop= RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE); + prop = RNA_def_property(srna, "shadow_buffer_clip_end", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipend"); RNA_def_property_range(prop, 0.0f, 9999.0f); RNA_def_property_ui_text(prop, "Shadow Buffer Clip End", @@ -629,16 +641,16 @@ static void rna_def_lamp_shadow(StructRNA *srna, int spot, int area) prop = RNA_def_property(srna, "shadow_ray_sample_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ray_samp_method"); - RNA_def_property_enum_items(prop, (area)? prop_spot_ray_sampling_method_items: prop_ray_sampling_method_items); + RNA_def_property_enum_items(prop, (area) ? prop_spot_ray_sampling_method_items : prop_ray_sampling_method_items); RNA_def_property_ui_text(prop, "Shadow Ray Sampling Method", "Method for generating shadow samples: Adaptive QMC is fastest, " "Constant QMC is less noisy but slower"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); - prop = RNA_def_property(srna, (area)? "shadow_ray_samples_x": "shadow_ray_samples", PROP_INT, PROP_NONE); + prop = RNA_def_property(srna, (area) ? "shadow_ray_samples_x" : "shadow_ray_samples", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ray_samp"); RNA_def_property_range(prop, 1, 64); - RNA_def_property_ui_text(prop, (area)? "Shadow Ray Samples": "Shadow Ray Samples X", + RNA_def_property_ui_text(prop, (area) ? "Shadow Ray Samples" : "Shadow Ray Samples X", "Number of samples taken extra (samples x samples)"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); @@ -690,7 +702,8 @@ static void rna_def_area_lamp(BlenderRNA *brna) static EnumPropertyItem prop_areashape_items[] = { {LA_AREA_SQUARE, "SQUARE", 0, "Square", ""}, {LA_AREA_RECT, "RECTANGLE", 0, "Rectangle", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "AreaLamp", "Lamp"); RNA_def_struct_sdna(srna, "Lamp"); @@ -749,13 +762,15 @@ static void rna_def_spot_lamp(BlenderRNA *brna) {LA_SHADBUF_BOX, "BOX", 0, "Box", "Apply the Box filter to shadow buffer samples"}, {LA_SHADBUF_TENT, "TENT", 0, "Tent", "Apply the Tent Filter to shadow buffer samples"}, {LA_SHADBUF_GAUSS, "GAUSS", 0, "Gauss", "Apply the Gauss filter to shadow buffer samples"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_numbuffer_items[] = { {1, "BUFFERS_1", 0, "1", "Only one buffer rendered"}, {4, "BUFFERS_4", 0, "4", "Render 4 buffers for better AA, this quadruples memory usage"}, {9, "BUFFERS_9", 0, "9", "Render 9 buffers for better AA, this uses nine times more memory"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SpotLamp", "Lamp"); RNA_def_struct_sdna(srna, "Lamp"); @@ -795,9 +810,9 @@ static void rna_def_spot_lamp(BlenderRNA *brna) prop = RNA_def_property(srna, "spot_size", PROP_FLOAT, PROP_ANGLE); /* RNA_def_property_float_sdna(prop, NULL, "spotsize"); */ - RNA_def_property_range(prop, M_PI/180.0, M_PI); + RNA_def_property_range(prop, M_PI / 180.0, M_PI); RNA_def_property_ui_text(prop, "Spot Size", "Angle of the spotlight beam"); - /* only for deg/rad conversion */ + /* only for deg/rad conversion */ RNA_def_property_float_funcs(prop, "rna_Lamp_spot_size_get", "rna_Lamp_spot_size_set", NULL); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); @@ -830,7 +845,7 @@ static void rna_def_sun_lamp(BlenderRNA *brna) rna_def_lamp_sky_settings(brna); /* BGE Only */ - prop= RNA_def_property(srna, "shadow_frustum_size", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "shadow_frustum_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shadow_frustum_size"); RNA_def_property_ui_range(prop, 0.001, 100.0, 2, 1); RNA_def_property_ui_text(prop, "Frustum Size", "Size of the frustum used for creating the shadow map"); diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index d919406a14d..a50389f01c1 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -51,27 +51,27 @@ static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values) { - Lattice *lt = (Lattice*)ptr->id.data; - BPoint *bp = (BPoint*)ptr->data; + Lattice *lt = (Lattice *)ptr->id.data; + BPoint *bp = (BPoint *)ptr->data; int a = bp - lt->def; int x = a % lt->pntsu; - int y = (a/lt->pntsu) % lt->pntsv; - int z = (a/(lt->pntsu*lt->pntsv)); + int y = (a / lt->pntsu) % lt->pntsv; + int z = (a / (lt->pntsu * lt->pntsv)); - values[0] = lt->fu + x*lt->du; - values[1] = lt->fv + y*lt->dv; - values[2] = lt->fw + z*lt->dw; + values[0] = lt->fu + x * lt->du; + values[1] = lt->fv + y * lt->dv; + values[2] = lt->fw + z * lt->dw; } static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Lattice *lt = (Lattice*)ptr->id.data; + Lattice *lt = (Lattice *)ptr->id.data; if (lt->dvert) { - BPoint *bp = (BPoint*)ptr->data; - MDeformVert *dvert = lt->dvert + (bp-lt->def); + BPoint *bp = (BPoint *)ptr->data; + MDeformVert *dvert = lt->dvert + (bp - lt->def); - rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL); + rna_iterator_array_begin(iter, (void *)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL); } else rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); @@ -79,13 +79,13 @@ static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, Poin static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Lattice *lt = (Lattice*)ptr->data; - int tot = lt->pntsu*lt->pntsv*lt->pntsw; + Lattice *lt = (Lattice *)ptr->data; + int tot = lt->pntsu * lt->pntsv * lt->pntsw; if (lt->editlatt && lt->editlatt->latt->def) - rna_iterator_array_begin(iter, (void*)lt->editlatt->latt->def, sizeof(BPoint), tot, 0, NULL); + rna_iterator_array_begin(iter, (void *)lt->editlatt->latt->def, sizeof(BPoint), tot, 0, NULL); else if (lt->def) - rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, 0, NULL); + rna_iterator_array_begin(iter, (void *)lt->def, sizeof(BPoint), tot, 0, NULL); else rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); } @@ -95,7 +95,7 @@ static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), P ID *id = ptr->id.data; DAG_id_tag_update(id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); } static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -105,9 +105,9 @@ static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr) int newu, newv, neww; /* we don't modify the actual pnts, but go through opnts instead */ - newu = (lt->opntsu > 0)? lt->opntsu: lt->pntsu; - newv = (lt->opntsv > 0)? lt->opntsv: lt->pntsv; - neww = (lt->opntsw > 0)? lt->opntsw: lt->pntsw; + newu = (lt->opntsu > 0) ? lt->opntsu : lt->pntsu; + newv = (lt->opntsv > 0) ? lt->opntsv : lt->pntsv; + neww = (lt->opntsw > 0) ? lt->opntsw : lt->pntsw; /* BKE_lattice_resize needs an object, any object will have the same result */ for (ob = bmain->object.first; ob; ob = ob->id.next) { @@ -148,28 +148,28 @@ static void rna_Lattice_use_outside_set(PointerRNA *ptr, int value) static int rna_Lattice_size_editable(PointerRNA *ptr) { - Lattice *lt = (Lattice*)ptr->data; + Lattice *lt = (Lattice *)ptr->data; return lt->key == NULL; } static void rna_Lattice_points_u_set(PointerRNA *ptr, int value) { - Lattice *lt = (Lattice*)ptr->data; + Lattice *lt = (Lattice *)ptr->data; lt->opntsu = CLAMPIS(value, 1, 64); } static void rna_Lattice_points_v_set(PointerRNA *ptr, int value) { - Lattice *lt = (Lattice*)ptr->data; + Lattice *lt = (Lattice *)ptr->data; lt->opntsv = CLAMPIS(value, 1, 64); } static void rna_Lattice_points_w_set(PointerRNA *ptr, int value) { - Lattice *lt = (Lattice*)ptr->data; + Lattice *lt = (Lattice *)ptr->data; lt->opntsw = CLAMPIS(value, 1, 64); } @@ -187,7 +187,7 @@ static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value) /* annoying, but is a consequence of RNA structures... */ static char *rna_LatticePoint_path(PointerRNA *ptr) { - Lattice *lt = (Lattice*)ptr->id.data; + Lattice *lt = (Lattice *)ptr->id.data; void *point = ptr->data; BPoint *points = NULL; @@ -197,7 +197,7 @@ static char *rna_LatticePoint_path(PointerRNA *ptr) points = lt->def; if (points && point) { - int tot = lt->pntsu*lt->pntsv*lt->pntsw; + int tot = lt->pntsu * lt->pntsv * lt->pntsw; /* only return index if in range */ if ((point >= (void *)points) && (point < (void *)(points + tot))) { @@ -252,7 +252,8 @@ static void rna_def_lattice(BlenderRNA *brna) {KEY_LINEAR, "KEY_LINEAR", 0, "Linear", ""}, {KEY_CARDINAL, "KEY_CARDINAL", 0, "Cardinal", ""}, {KEY_BSPLINE, "KEY_BSPLINE", 0, "BSpline", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Lattice", "ID"); RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects"); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 1a039295924..b0981c19835 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -50,7 +50,7 @@ static int rna_Main_is_saved_get(PointerRNA *UNUSED(ptr)) static int rna_Main_is_dirty_get(PointerRNA *ptr) { /* XXX, not totally nice to do it this way, should store in main ? */ - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; wmWindowManager *wm; for (wm = bmain->wm.first; wm; wm = wm->id.next) { return !wm->file_saved; @@ -61,195 +61,195 @@ static int rna_Main_is_dirty_get(PointerRNA *ptr) static void rna_Main_filepath_get(PointerRNA *ptr, char *value) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; BLI_strncpy(value, bmain->name, sizeof(bmain->name)); } static int rna_Main_filepath_length(PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; return strlen(bmain->name); } #if 0 static void rna_Main_filepath_set(PointerRNA *ptr, const char *value) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; BLI_strncpy(bmain->name, value, sizeof(bmain->name)); } #endif static void rna_Main_scene_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->scene, NULL); } static void rna_Main_object_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->object, NULL); } static void rna_Main_lamp_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->lamp, NULL); } static void rna_Main_library_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->library, NULL); } static void rna_Main_mesh_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->mesh, NULL); } static void rna_Main_curve_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->curve, NULL); } static void rna_Main_mball_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->mball, NULL); } static void rna_Main_mat_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->mat, NULL); } static void rna_Main_tex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->tex, NULL); } static void rna_Main_image_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->image, NULL); } static void rna_Main_latt_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->latt, NULL); } static void rna_Main_camera_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->camera, NULL); } static void rna_Main_key_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->key, NULL); } static void rna_Main_world_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->world, NULL); } static void rna_Main_screen_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->screen, NULL); } static void rna_Main_script_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->script, NULL); } static void rna_Main_font_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->vfont, NULL); } static void rna_Main_text_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->text, NULL); } static void rna_Main_speaker_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->speaker, NULL); } static void rna_Main_sound_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->sound, NULL); } static void rna_Main_group_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->group, NULL); } static void rna_Main_armature_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->armature, NULL); } static void rna_Main_action_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->action, NULL); } static void rna_Main_nodetree_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->nodetree, NULL); } static void rna_Main_brush_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->brush, NULL); } static void rna_Main_particle_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->particle, NULL); } static void rna_Main_gpencil_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->gpencil, NULL); } static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->wm, NULL); } static void rna_Main_movieclips_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Main *bmain = (Main*)ptr->data; + Main *bmain = (Main *)ptr->data; rna_iterator_listbase_begin(iter, &bmain->movieclip, NULL); } @@ -271,11 +271,11 @@ static PointerRNA rna_Test_test_get(PointerRNA *ptr) typedef void (CollectionDefFunc)(struct BlenderRNA *brna, struct PropertyRNA *cprop); typedef struct MainCollectionDef { - const char *identifier; - const char *type; - const char *iter_begin; - const char *name; - const char *description; + const char *identifier; + const char *type; + const char *iter_begin; + const char *name; + const char *description; CollectionDefFunc *func; } MainCollectionDef; @@ -291,14 +291,12 @@ void RNA_def_main(BlenderRNA *brna) {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks", RNA_def_main_scenes}, {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks", RNA_def_main_objects}, {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks", RNA_def_main_materials}, - {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks", - RNA_def_main_node_groups}, + {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks", RNA_def_main_node_groups}, {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks", RNA_def_main_meshes}, {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks", RNA_def_main_lamps}, {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks", RNA_def_main_libraries}, {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks", RNA_def_main_screens}, - {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks", - RNA_def_main_window_managers}, + {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks", RNA_def_main_window_managers}, {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks", RNA_def_main_images}, {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks", RNA_def_main_lattices}, {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks", RNA_def_main_curves}, @@ -313,16 +311,13 @@ void RNA_def_main(BlenderRNA *brna) {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks", RNA_def_main_texts}, {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker datablocks", RNA_def_main_speakers}, {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound datablocks", RNA_def_main_sounds}, - {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks", - RNA_def_main_armatures}, + {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks", RNA_def_main_armatures}, {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks", RNA_def_main_actions}, - {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks", - RNA_def_main_particles}, - {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks", - RNA_def_main_gpencil}, - {"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip datablocks", - RNA_def_main_movieclips}, - {NULL, NULL, NULL, NULL, NULL, NULL}}; + {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks", RNA_def_main_particles}, + {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks", RNA_def_main_gpencil}, + {"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip datablocks", RNA_def_main_movieclips}, + {NULL, NULL, NULL, NULL, NULL, NULL} + }; int i; diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 76cd8279beb..cecd890ef13 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -102,7 +102,7 @@ void rna_Main_cameras_remove(Main *bmain, ReportList *reports, struct Camera *ca BKE_libblock_free(&bmain->camera, camera); else BKE_reportf(reports, RPT_ERROR, "Camera \"%s\" must have zero users to be removed, found %d", - camera->id.name+2, ID_REAL_USERS(camera)); + camera->id.name + 2, ID_REAL_USERS(camera)); /* XXX python now has invalid pointer? */ } @@ -121,7 +121,7 @@ void rna_Main_scenes_remove(Main *bmain, bContext *C, ReportList *reports, struc else if (scene->id.next) newscene = scene->id.next; else { - BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed", scene->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Scene \"%s\" is the last, cant ve removed", scene->id.name + 2); return; } @@ -192,12 +192,11 @@ void rna_Main_objects_remove(Main *bmain, ReportList *reports, struct Object *ob } else { BKE_reportf(reports, RPT_ERROR, "Object \"%s\" must have zero users to be removed, found %d", - object->id.name+2, ID_REAL_USERS(object)); + object->id.name + 2, ID_REAL_USERS(object)); } } -struct Material *rna_Main_materials_new(Main *UNUSED(bmain), const char *name) -{ +struct Material *rna_Main_materials_new(Main *UNUSED(bmain), const char *name){ ID *id = (ID *)BKE_material_add(name); id_us_min(id); return (Material *)id; @@ -208,13 +207,12 @@ void rna_Main_materials_remove(Main *bmain, ReportList *reports, struct Material BKE_libblock_free(&bmain->mat, material); else BKE_reportf(reports, RPT_ERROR, "Material \"%s\" must have zero users to be removed, found %d", - material->id.name+2, ID_REAL_USERS(material)); + material->id.name + 2, ID_REAL_USERS(material)); /* XXX python now has invalid pointer? */ } -struct bNodeTree *rna_Main_nodetree_new(Main *UNUSED(bmain), const char *name, int type) -{ +struct bNodeTree *rna_Main_nodetree_new(Main *UNUSED(bmain), const char *name, int type){ bNodeTree *tree = ntreeAddTree(name, type, NODE_GROUP); id_us_min(&tree->id); @@ -226,7 +224,7 @@ void rna_Main_nodetree_remove(Main *bmain, ReportList *reports, struct bNodeTree BKE_libblock_free(&bmain->nodetree, tree); else BKE_reportf(reports, RPT_ERROR, "Node Tree \"%s\" must have zero users to be removed, found %d", - tree->id.name+2, ID_REAL_USERS(tree)); + tree->id.name + 2, ID_REAL_USERS(tree)); /* XXX python now has invalid pointer? */ } @@ -243,7 +241,7 @@ void rna_Main_meshes_remove(Main *bmain, ReportList *reports, Mesh *mesh) BKE_libblock_free(&bmain->mesh, mesh); else BKE_reportf(reports, RPT_ERROR, "Mesh \"%s\" must have zero users to be removed, found %d", - mesh->id.name+2, ID_REAL_USERS(mesh)); + mesh->id.name + 2, ID_REAL_USERS(mesh)); /* XXX python now has invalid pointer? */ } @@ -261,7 +259,7 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp) BKE_libblock_free(&bmain->lamp, lamp); else BKE_reportf(reports, RPT_ERROR, "Lamp \"%s\" must have zero users to be removed, found %d", - lamp->id.name+2, ID_REAL_USERS(lamp)); + lamp->id.name + 2, ID_REAL_USERS(lamp)); /* XXX python now has invalid pointer? */ } @@ -269,7 +267,7 @@ void rna_Main_lamps_remove(Main *bmain, ReportList *reports, Lamp *lamp) Image *rna_Main_images_new(Main *UNUSED(bmain), const char *name, int width, int height, int alpha, int float_buffer) { float color[4] = {0.0, 0.0, 0.0, 1.0}; - Image *image = BKE_image_add_generated(width, height, name, alpha ? 32:24, float_buffer, 0, color); + Image *image = BKE_image_add_generated(width, height, name, alpha ? 32 : 24, float_buffer, 0, color); id_us_min(&image->id); return image; } @@ -292,7 +290,7 @@ void rna_Main_images_remove(Main *bmain, ReportList *reports, Image *image) BKE_libblock_free(&bmain->image, image); else BKE_reportf(reports, RPT_ERROR, "Image \"%s\" must have zero users to be removed, found %d", - image->id.name+2, ID_REAL_USERS(image)); + image->id.name + 2, ID_REAL_USERS(image)); /* XXX python now has invalid pointer? */ } @@ -309,7 +307,7 @@ void rna_Main_lattices_remove(Main *bmain, ReportList *reports, struct Lattice * BKE_libblock_free(&bmain->latt, lt); else BKE_reportf(reports, RPT_ERROR, "Lattice \"%s\" must have zero users to be removed, found %d", - lt->id.name+2, ID_REAL_USERS(lt)); + lt->id.name + 2, ID_REAL_USERS(lt)); } Curve *rna_Main_curves_new(Main *UNUSED(bmain), const char *name, int type) @@ -324,7 +322,7 @@ void rna_Main_curves_remove(Main *bmain, ReportList *reports, struct Curve *cu) BKE_libblock_free(&bmain->curve, cu); else BKE_reportf(reports, RPT_ERROR, "Curve \"%s\" must have zero users to be removed, found %d", - cu->id.name+2, ID_REAL_USERS(cu)); + cu->id.name + 2, ID_REAL_USERS(cu)); } MetaBall *rna_Main_metaballs_new(Main *UNUSED(bmain), const char *name) @@ -339,7 +337,7 @@ void rna_Main_metaballs_remove(Main *bmain, ReportList *reports, struct MetaBall BKE_libblock_free(&bmain->mball, mb); else BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" must have zero users to be removed, found %d", - mb->id.name+2, ID_REAL_USERS(mb)); + mb->id.name + 2, ID_REAL_USERS(mb)); } VFont *rna_Main_fonts_load(Main *bmain, ReportList *reports, const char *filepath) @@ -362,7 +360,7 @@ void rna_Main_fonts_remove(Main *bmain, ReportList *reports, VFont *vfont) BKE_libblock_free(&bmain->vfont, vfont); else BKE_reportf(reports, RPT_ERROR, "Font \"%s\" must have zero users to be removed, found %d", - vfont->id.name+2, ID_REAL_USERS(vfont)); + vfont->id.name + 2, ID_REAL_USERS(vfont)); /* XXX python now has invalid pointer? */ } @@ -380,7 +378,7 @@ void rna_Main_textures_remove(Main *bmain, ReportList *reports, struct Tex *tex) BKE_libblock_free(&bmain->tex, tex); else BKE_reportf(reports, RPT_ERROR, "Texture \"%s\" must have zero users to be removed, found %d", - tex->id.name+2, ID_REAL_USERS(tex)); + tex->id.name + 2, ID_REAL_USERS(tex)); } Brush *rna_Main_brushes_new(Main *UNUSED(bmain), const char *name) @@ -395,7 +393,7 @@ void rna_Main_brushes_remove(Main *bmain, ReportList *reports, struct Brush *bru BKE_libblock_free(&bmain->brush, brush); else BKE_reportf(reports, RPT_ERROR, "Brush \"%s\" must have zero users to be removed, found %d", - brush->id.name+2, ID_REAL_USERS(brush)); + brush->id.name + 2, ID_REAL_USERS(brush)); } World *rna_Main_worlds_new(Main *UNUSED(bmain), const char *name) @@ -410,7 +408,7 @@ void rna_Main_worlds_remove(Main *bmain, ReportList *reports, struct World *worl BKE_libblock_free(&bmain->world, world); else BKE_reportf(reports, RPT_ERROR, "World \"%s\" must have zero users to be removed, found %d", - world->id.name+2, ID_REAL_USERS(world)); + world->id.name + 2, ID_REAL_USERS(world)); } Group *rna_Main_groups_new(Main *UNUSED(bmain), const char *name) @@ -436,7 +434,7 @@ void rna_Main_speakers_remove(Main *bmain, ReportList *reports, Speaker *speaker BKE_libblock_free(&bmain->speaker, speaker); else BKE_reportf(reports, RPT_ERROR, "Speaker \"%s\" must have zero users to be removed, found %d", - speaker->id.name+2, ID_REAL_USERS(speaker)); + speaker->id.name + 2, ID_REAL_USERS(speaker)); /* XXX python now has invalid pointer? */ } @@ -478,7 +476,7 @@ void rna_Main_armatures_remove(Main *bmain, ReportList *reports, bArmature *arm) BKE_libblock_free(&bmain->armature, arm); else BKE_reportf(reports, RPT_ERROR, "Armature \"%s\" must have zero users to be removed, found %d", - arm->id.name+2, ID_REAL_USERS(arm)); + arm->id.name + 2, ID_REAL_USERS(arm)); /* XXX python now has invalid pointer? */ } @@ -496,7 +494,7 @@ void rna_Main_actions_remove(Main *bmain, ReportList *reports, bAction *act) BKE_libblock_free(&bmain->action, act); else BKE_reportf(reports, RPT_ERROR, "Action \"%s\" must have zero users to be removed, found %d", - act->id.name+2, ID_REAL_USERS(act)); + act->id.name + 2, ID_REAL_USERS(act)); /* XXX python now has invalid pointer? */ } @@ -513,7 +511,7 @@ void rna_Main_particles_remove(Main *bmain, ReportList *reports, ParticleSetting BKE_libblock_free(&bmain->particle, part); else BKE_reportf(reports, RPT_ERROR, "Particle Settings \"%s\" must have zero users to be removed, found %d", - part->id.name+2, ID_REAL_USERS(part)); + part->id.name + 2, ID_REAL_USERS(part)); /* XXX python now has invalid pointer? */ } @@ -606,11 +604,11 @@ void RNA_api_main(StructRNA *srna) PropertyRNA *parm; /* maybe we want to add functions in 'bpy.data' still? * for now they are all in collections bpy.data.images.new(...) */ - func= RNA_def_function(srna, "add_image", "rna_Main_add_image"); + func = RNA_def_function(srna, "add_image", "rna_Main_add_image"); RNA_def_function_ui_description(func, "Add a new image"); - parm= RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from"); + parm = RNA_def_string_file_path(func, "filepath", "", 0, "", "File path to load image from"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "image", "Image", "", "New image"); + parm = RNA_def_pointer(func, "image", "Image", "", "New image"); RNA_def_function_return(func, parm); #endif } @@ -639,7 +637,7 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a camera from the current blendfile"); parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -671,10 +669,10 @@ void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a scene from the current blendfile"); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -713,7 +711,7 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove a object from the current blendfile"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_objects_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -748,7 +746,7 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a material from the current blendfile"); parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_materials_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -766,10 +764,11 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop) PropertyRNA *prop; static EnumPropertyItem node_nodetree_items[] = { - {0, "SHADER", 0, "Shader", ""}, - {1, "COMPOSITE", 0, "Composite", ""}, - {2, "TEXTURE", 0, "Texture", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, "SHADER", 0, "Shader", ""}, + {1, "COMPOSITE", 0, "Composite", ""}, + {2, "TEXTURE", 0, "Texture", ""}, + {0, NULL, 0, NULL, NULL} + }; RNA_def_property_srna(cprop, "BlendDataNodeTrees"); srna = RNA_def_struct(brna, "BlendDataNodeTrees", NULL); @@ -790,7 +789,7 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile"); parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -824,7 +823,7 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile"); parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -860,7 +859,7 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a lamp from the current blendfile"); parm = RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_lamps_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -972,7 +971,7 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove an image from the current blendfile"); parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_images_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1007,7 +1006,7 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile"); parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1043,7 +1042,7 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a curve from the current blendfile"); parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_curves_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1077,7 +1076,7 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile"); parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1112,7 +1111,7 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a font from the current blendfile"); parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1148,7 +1147,7 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a texture from the current blendfile"); parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_textures_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1182,7 +1181,7 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a brush from the current blendfile"); parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1217,7 +1216,7 @@ void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a world from the current blendfile"); parm = RNA_def_pointer(func, "world", "World", "", "World to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1251,7 +1250,7 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "remove", "rna_Main_groups_remove"); RNA_def_function_ui_description(func, "Remove a group from the current blendfile"); parm = RNA_def_pointer(func, "group", "Group", "", "Group to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_groups_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1286,7 +1285,7 @@ void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile"); parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1320,7 +1319,7 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "remove", "rna_Main_texts_remove"); RNA_def_function_ui_description(func, "Remove a text from the current blendfile"); parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); /* load func */ func = RNA_def_function(srna, "load", "rna_Main_texts_load"); @@ -1388,7 +1387,7 @@ void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a armature from the current blendfile"); parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1422,7 +1421,7 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a action from the current blendfile"); parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_actions_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1456,7 +1455,7 @@ void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a particle settings instance from the current blendfile"); parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "tag", "rna_Main_particles_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); @@ -1506,7 +1505,7 @@ void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "remove", "rna_Main_movieclips_remove"); RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile."); parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); /* load func */ func = RNA_def_function(srna, "load", "rna_Main_movieclip_load"); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 8aabc515dcb..3cee8ca271c 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -39,41 +39,43 @@ #include "WM_types.h" static EnumPropertyItem prop_texture_coordinates_items[] = { -{TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"}, -{TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, -{TEXCO_UV, "UV", 0, "UV", "Use UV coordinates for texture coordinates"}, -{TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"}, -{TEXCO_STRAND, "STRAND", 0, "Strand / Particle", - "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, -{TEXCO_STICKY, "STICKY", 0, "Sticky", "Use mesh's sticky coordinates for the texture coordinates"}, -{TEXCO_WINDOW, "WINDOW", 0, "Window", "Use screen coordinates as texture coordinates"}, -{TEXCO_NORM, "NORMAL", 0, "Normal", "Use normal vector as texture coordinates"}, -{TEXCO_REFL, "REFLECTION", 0, "Reflection", "Use reflection vector as texture coordinates"}, -{TEXCO_STRESS, "STRESS", 0, "Stress", - "Use the difference of edge lengths compared to original coordinates of the mesh"}, -{TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Use the optional tangent vector as texture coordinates"}, -{0, NULL, 0, NULL, NULL}}; + {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"}, + {TEXCO_OBJECT, "OBJECT", 0, "Object", "Use linked object's coordinates for texture coordinates"}, + {TEXCO_UV, "UV", 0, "UV", "Use UV coordinates for texture coordinates"}, + {TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"}, + {TEXCO_STRAND, "STRAND", 0, "Strand / Particle", + "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, + {TEXCO_STICKY, "STICKY", 0, "Sticky", "Use mesh's sticky coordinates for the texture coordinates"}, + {TEXCO_WINDOW, "WINDOW", 0, "Window", "Use screen coordinates as texture coordinates"}, + {TEXCO_NORM, "NORMAL", 0, "Normal", "Use normal vector as texture coordinates"}, + {TEXCO_REFL, "REFLECTION", 0, "Reflection", "Use reflection vector as texture coordinates"}, + {TEXCO_STRESS, "STRESS", 0, "Stress", + "Use the difference of edge lengths compared to original coordinates of the mesh"}, + {TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Use the optional tangent vector as texture coordinates"}, + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem ramp_blend_items[] = { -{MA_RAMP_BLEND, "MIX", 0, "Mix", ""}, -{MA_RAMP_ADD, "ADD", 0, "Add", ""}, -{MA_RAMP_MULT, "MULTIPLY", 0, "Multiply", ""}, -{MA_RAMP_SUB, "SUBTRACT", 0, "Subtract", ""}, -{MA_RAMP_SCREEN, "SCREEN", 0, "Screen", ""}, -{MA_RAMP_DIV, "DIVIDE", 0, "Divide", ""}, -{MA_RAMP_DIFF, "DIFFERENCE", 0, "Difference", ""}, -{MA_RAMP_DARK, "DARKEN", 0, "Darken", ""}, -{MA_RAMP_LIGHT, "LIGHTEN", 0, "Lighten", ""}, -{MA_RAMP_OVERLAY, "OVERLAY", 0, "Overlay", ""}, -{MA_RAMP_DODGE, "DODGE", 0, "Dodge", ""}, -{MA_RAMP_BURN, "BURN", 0, "Burn", ""}, -{MA_RAMP_HUE, "HUE", 0, "Hue", ""}, -{MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""}, -{MA_RAMP_VAL, "VALUE", 0, "Value", ""}, -{MA_RAMP_COLOR, "COLOR", 0, "Color", ""}, -{MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""}, -{MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""}, -{0, NULL, 0, NULL, NULL}}; + {MA_RAMP_BLEND, "MIX", 0, "Mix", ""}, + {MA_RAMP_ADD, "ADD", 0, "Add", ""}, + {MA_RAMP_MULT, "MULTIPLY", 0, "Multiply", ""}, + {MA_RAMP_SUB, "SUBTRACT", 0, "Subtract", ""}, + {MA_RAMP_SCREEN, "SCREEN", 0, "Screen", ""}, + {MA_RAMP_DIV, "DIVIDE", 0, "Divide", ""}, + {MA_RAMP_DIFF, "DIFFERENCE", 0, "Difference", ""}, + {MA_RAMP_DARK, "DARKEN", 0, "Darken", ""}, + {MA_RAMP_LIGHT, "LIGHTEN", 0, "Lighten", ""}, + {MA_RAMP_OVERLAY, "OVERLAY", 0, "Overlay", ""}, + {MA_RAMP_DODGE, "DODGE", 0, "Dodge", ""}, + {MA_RAMP_BURN, "BURN", 0, "Burn", ""}, + {MA_RAMP_HUE, "HUE", 0, "Hue", ""}, + {MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""}, + {MA_RAMP_VAL, "VALUE", 0, "Value", ""}, + {MA_RAMP_COLOR, "COLOR", 0, "Color", ""}, + {MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""}, + {MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""}, + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -96,10 +98,10 @@ static void rna_Material_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *p DAG_id_tag_update(&ma->id, 0); if (scene) { /* can be NULL, see [#30025] */ if (scene->gm.matmode == GAME_MAT_GLSL) { - WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma); + WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma); } else { - WM_main_add_notifier(NC_MATERIAL|ND_SHADING, ma); + WM_main_add_notifier(NC_MATERIAL | ND_SHADING, ma); } } } @@ -109,7 +111,7 @@ static void rna_Material_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Material *ma = ptr->id.data; DAG_id_tag_update(&ma->id, 0); - WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, ma); + WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, ma); } static PointerRNA rna_Material_mirror_get(PointerRNA *ptr) @@ -144,23 +146,23 @@ static PointerRNA rna_Material_physics_get(PointerRNA *ptr) static void rna_Material_type_set(PointerRNA *ptr, int value) { - Material *ma = (Material*)ptr->data; + Material *ma = (Material *)ptr->data; if (ma->material_type == MA_TYPE_HALO && value != MA_TYPE_HALO) - ma->mode &= ~(MA_STAR|MA_HALO_XALPHA|MA_ZINV|MA_ENV); + ma->mode &= ~(MA_STAR | MA_HALO_XALPHA | MA_ZINV | MA_ENV); ma->material_type = value; } static void rna_Material_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Material *ma = (Material*)ptr->data; - rna_iterator_array_begin(iter, (void*)ma->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL); + Material *ma = (Material *)ptr->data; + rna_iterator_array_begin(iter, (void *)ma->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL); } static PointerRNA rna_Material_active_texture_get(PointerRNA *ptr) { - Material *ma = (Material*)ptr->data; + Material *ma = (Material *)ptr->data; Tex *tex; tex = give_current_material_texture(ma); @@ -169,27 +171,27 @@ static PointerRNA rna_Material_active_texture_get(PointerRNA *ptr) static void rna_Material_active_texture_set(PointerRNA *ptr, PointerRNA value) { - Material *ma = (Material*)ptr->data; + Material *ma = (Material *)ptr->data; set_current_material_texture(ma, value.data); } static int rna_Material_active_texture_editable(PointerRNA *ptr) { - Material *ma = (Material*)ptr->id.data; + Material *ma = (Material *)ptr->id.data; return has_current_material_texture(ma); } static PointerRNA rna_Material_active_node_material_get(PointerRNA *ptr) { - Material *ma = give_node_material((Material*)ptr->data); + Material *ma = give_node_material((Material *)ptr->data); return rna_pointer_inherit_refine(ptr, &RNA_Material, ma); } static void rna_Material_active_node_material_set(PointerRNA *ptr, PointerRNA value) { - Material *ma = (Material*)ptr->data; + Material *ma = (Material *)ptr->data; Material *ma_act = value.data; nodeSetActiveID(ma->nodetree, ID_MA, &ma_act->id); @@ -197,7 +199,7 @@ static void rna_Material_active_node_material_set(PointerRNA *ptr, PointerRNA va static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - Material *ma = (Material*)ptr->id.data; + Material *ma = (Material *)ptr->id.data; if (ma->mode & MA_STR_B_UNITS) { *min = 0.0001f; @@ -211,7 +213,7 @@ static void rna_MaterialStrand_start_size_range(PointerRNA *ptr, float *min, flo static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - Material *ma = (Material*)ptr->id.data; + Material *ma = (Material *)ptr->id.data; if (ma->mode & MA_STR_B_UNITS) { *min = 0.0001f; @@ -225,36 +227,36 @@ static void rna_MaterialStrand_end_size_range(PointerRNA *ptr, float *min, float static int rna_MaterialTextureSlot_use_get(PointerRNA *ptr) { - Material *ma = (Material*)ptr->id.data; - MTex *mtex = (MTex*)ptr->data; + Material *ma = (Material *)ptr->id.data; + MTex *mtex = (MTex *)ptr->data; int a; - for (a = 0; amtex[a] == mtex) - return (ma->septex & (1<septex & (1 << a)) == 0; return 0; } static void rna_MaterialTextureSlot_use_set(PointerRNA *ptr, int value) { - Material *ma = (Material*)ptr->id.data; - MTex *mtex = (MTex*)ptr->data; + Material *ma = (Material *)ptr->id.data; + MTex *mtex = (MTex *)ptr->data; int a; - for (a = 0; amtex[a] == mtex) { if (value) - ma->septex &= ~(1<septex &= ~(1 << a); else - ma->septex |= (1<septex |= (1 << a); } } } static void rna_Material_use_diffuse_ramp_set(PointerRNA *ptr, int value) { - Material *ma = (Material*)ptr->data; + Material *ma = (Material *)ptr->data; if (value) ma->mode |= MA_RAMP_COL; else ma->mode &= ~MA_RAMP_COL; @@ -265,7 +267,7 @@ static void rna_Material_use_diffuse_ramp_set(PointerRNA *ptr, int value) static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value) { - Material *ma = (Material*)ptr->data; + Material *ma = (Material *)ptr->data; if (value) ma->mode |= MA_RAMP_SPEC; else ma->mode &= ~MA_RAMP_SPEC; @@ -276,7 +278,7 @@ static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value) static void rna_Material_use_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Material *ma = (Material*)ptr->data; + Material *ma = (Material *)ptr->data; if (ma->use_nodes && ma->nodetree == NULL) ED_node_shader_default(scene, &ma->id); @@ -287,7 +289,7 @@ static void rna_Material_use_nodes_update(Main *bmain, Scene *scene, PointerRNA static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) { - Material *ma = (Material*)ptr->id.data; + Material *ma = (Material *)ptr->id.data; EnumPropertyItem *item = NULL; int totitem = 0; @@ -385,35 +387,40 @@ static void rna_def_material_mtex(BlenderRNA *brna) {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"}, {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"}, {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_x_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, {2, "Y", 0, "Y", ""}, {3, "Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_y_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, {2, "Y", 0, "Y", ""}, {3, "Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_z_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, {2, "Y", 0, "Y", ""}, {3, "Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_normal_map_space_items[] = { {MTEX_NSPACE_CAMERA, "CAMERA", 0, "Camera", ""}, {MTEX_NSPACE_WORLD, "WORLD", 0, "World", ""}, {MTEX_NSPACE_OBJECT, "OBJECT", 0, "Object", ""}, {MTEX_NSPACE_TANGENT, "TANGENT", 0, "Tangent", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_bump_method_items[] = { {0, "BUMP_ORIGINAL", 0, "Original", ""}, @@ -421,15 +428,17 @@ static void rna_def_material_mtex(BlenderRNA *brna) {MTEX_3TAP_BUMP, "BUMP_LOW_QUALITY", 0, "Low Quality", "Use 3 tap filtering"}, {MTEX_5TAP_BUMP, "BUMP_MEDIUM_QUALITY", 0, "Medium Quality", "Use 5 tap filtering"}, {MTEX_BICUBIC_BUMP, "BUMP_BEST_QUALITY", 0, - "Best Quality", "Use bicubic filtering (requires OpenGL 3.0+, it will fall back on " - "medium setting for other systems)"}, - {0, NULL, 0, NULL, NULL}}; + "Best Quality", "Use bicubic filtering (requires OpenGL 3.0+, it will fall back on " + "medium setting for other systems)"}, + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_bump_space_items[] = { {0, "BUMP_VIEWSPACE", 0, "ViewSpace", ""}, {MTEX_BUMP_OBJECTSPACE, "BUMP_OBJECTSPACE", 0, "ObjectSpace", ""}, {MTEX_BUMP_TEXTURESPACE, "BUMP_TEXTURESPACE", 0, "TextureSpace", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MaterialTextureSlot", "TextureSlot"); RNA_def_struct_sdna(srna, "MTex"); @@ -763,14 +772,16 @@ static void rna_def_material_gamesettings(BlenderRNA *brna) "Render polygon transparent, depending on alpha channel of the texture"}, {GEMAT_ALPHA_SORT, "ALPHA_SORT", 0, "Alpha Sort", "Sort faces for correct alpha drawing (slow, use Alpha Clip instead when possible)"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_face_orientation_items[] = { {GEMAT_NORMAL, "NORMAL", 0, "Normal", "No tranformation"}, {GEMAT_HALO, "HALO", 0, "Halo", "Screen aligned billboard"}, {GEMAT_BILLBOARD, "BILLBOARD", 0, "Billboard", "Billboard with Z-axis constraint"}, {GEMAT_SHADOW, "SHADOW", 0, "Shadow", "Faces are used for shadow"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MaterialGameSettings", NULL); RNA_def_struct_sdna(srna, "GameSettings"); @@ -816,7 +827,8 @@ static void rna_def_material_colors(StructRNA *srna) {MA_RAMP_IN_ENERGY, "ENERGY", 0, "Energy", ""}, {MA_RAMP_IN_NOR, "NORMAL", 0, "Normal", ""}, {MA_RAMP_IN_RESULT, "RESULT", 0, "Result", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; prop = RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); @@ -919,7 +931,8 @@ static void rna_def_material_diffuse(StructRNA *srna) {MA_DIFF_TOON, "TOON", 0, "Toon", "Use a toon shader"}, {MA_DIFF_MINNAERT, "MINNAERT", 0, "Minnaert", "Use a Minnaert shader"}, {MA_DIFF_FRESNEL, "FRESNEL", 0, "Fresnel", "Use a Fresnel shader"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; prop = RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "diff_shader"); @@ -976,7 +989,8 @@ static void rna_def_material_raymirror(BlenderRNA *brna) static EnumPropertyItem prop_fadeto_mir_items[] = { {MA_RAYMIR_FADETOSKY, "FADE_TO_SKY", 0, "Sky", ""}, {MA_RAYMIR_FADETOMAT, "FADE_TO_MATERIAL", 0, "Material", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MaterialRaytraceMirror", NULL); RNA_def_struct_sdna(srna, "Material"); @@ -1148,13 +1162,15 @@ static void rna_def_material_volume(BlenderRNA *brna) {MA_VOL_SHADE_SHADED, "SHADED", 0, "Shaded", ""}, {MA_VOL_SHADE_MULTIPLE, "MULTIPLE_SCATTERING", 0, "Multiple Scattering", ""}, {MA_VOL_SHADE_SHADEDPLUSMULTIPLE, "SHADED_PLUS_MULTIPLE_SCATTERING", 0, "Shaded + Multiple Scattering", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_stepsize_items[] = { {MA_VOL_STEP_RANDOMIZED, "RANDOMIZED", 0, "Randomized", ""}, {MA_VOL_STEP_CONSTANT, "CONSTANT", 0, "Constant", ""}, /*{MA_VOL_STEP_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", ""}, */ - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MaterialVolume", NULL); RNA_def_struct_sdna(srna, "VolumeSettings"); @@ -1433,7 +1449,7 @@ static void rna_def_material_sss(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Material Subsurface Scattering", "Diffuse subsurface scattering settings for a Material datablock"); - prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR|PROP_UNIT_LENGTH); + prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_COLOR | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "sss_radius"); RNA_def_property_range(prop, 0.001, FLT_MAX); RNA_def_property_ui_range(prop, 0.001, 10000, 1, 3); @@ -1503,7 +1519,8 @@ static void rna_def_material_specularity(StructRNA *srna) {MA_SPEC_BLINN, "BLINN", 0, "Blinn", "Use a Blinn shader"}, {MA_SPEC_TOON, "TOON", 0, "Toon", "Use a toon shader"}, {MA_SPEC_WARDISO, "WARDISO", 0, "WardIso", "Use a Ward anisotropic shader"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; prop = RNA_def_property(srna, "specular_shader", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "spec_shader"); @@ -1678,12 +1695,14 @@ void RNA_def_material(BlenderRNA *brna) {MA_TYPE_WIRE, "WIRE", 0, "Wire", "Render the edges of faces as wires (not supported in raytracing)"}, {MA_TYPE_VOLUME, "VOLUME", 0, "Volume", "Render object as a volume"}, {MA_TYPE_HALO, "HALO", 0, "Halo", "Render object as halo particles"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem transparency_items[] = { {0, "MASK", 0, "Mask", "Mask the background"}, {MA_ZTRANSP, "Z_TRANSPARENCY", 0, "Z Transparency", "Use alpha buffer for transparent faces"}, {MA_RAYTRANSP, "RAYTRACE", 0, "Raytrace", "Use raytracing for transparent refraction rendering"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; /* Render Preview Types */ static EnumPropertyItem preview_type_items[] = { @@ -1693,14 +1712,16 @@ void RNA_def_material(BlenderRNA *brna) {MA_MONKEY, "MONKEY", ICON_MONKEY, "Monkey", "Monkey"}, {MA_HAIR, "HAIR", ICON_HAIR, "Hair", "Hair strands"}, {MA_SPHERE_A, "SPHERE_A", ICON_MAT_SPHERE_SKY, "World Sphere", "Large sphere with sky"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_shadows_only_items[] = { {MA_SO_OLD, "SHADOW_ONLY_OLD", 0, "Shadow and Distance", "Old shadow only method"}, {MA_SO_SHADOW, "SHADOW_ONLY", 0, "Shadow Only", "Improved shadow only method"}, {MA_SO_SHADED, "SHADOW_ONLY_SHADED", 0, "Shadow and Shading", - "Improved shadow only method which also renders lightless areas as shadows"}, - {0, NULL, 0, NULL, NULL}}; + "Improved shadow only method which also renders lightless areas as shadows"}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Material", "ID"); RNA_def_struct_ui_text(srna, "Material", @@ -1990,8 +2011,8 @@ void RNA_def_material(BlenderRNA *brna) /* common */ rna_def_animdata_common(srna); rna_def_mtex_common(brna, srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get", - "rna_Material_active_texture_set", "rna_Material_active_texture_editable", - "MaterialTextureSlot", "MaterialTextureSlots", "rna_Material_update"); + "rna_Material_active_texture_set", "rna_Material_active_texture_editable", + "MaterialTextureSlot", "MaterialTextureSlots", "rna_Material_update"); /* only material has this one */ prop = RNA_def_property(srna, "use_textures", PROP_BOOLEAN, PROP_NONE); @@ -2034,26 +2055,26 @@ static void rna_def_texture_slots(BlenderRNA *brna, PropertyRNA *cprop, const ch /* functions */ func = RNA_def_function(srna, "add", "rna_mtex_texture_slots_add"); - RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF | FUNC_USE_CONTEXT | FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "create", "rna_mtex_texture_slots_create"); - RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF | FUNC_USE_CONTEXT | FUNC_USE_REPORTS); parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to initialize", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_pointer(func, "mtex", structname, "", "The newly initialized mtex"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "clear", "rna_mtex_texture_slots_clear"); - RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_NO_SELF|FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF | FUNC_USE_CONTEXT | FUNC_USE_REPORTS); parm = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "Slot index to clear", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); } void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin, - const char *activeget, const char *activeset, const char *activeeditable, - const char *structname, const char *structname_slots, const char *update) + const char *activeget, const char *activeset, const char *activeeditable, + const char *structname, const char *structname_slots, const char *update) { PropertyRNA *prop; @@ -2076,7 +2097,7 @@ void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin, prop = RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "texact"); - RNA_def_property_range(prop, 0, MAX_MTEX-1); + RNA_def_property_range(prop, 0, MAX_MTEX - 1); RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot"); RNA_def_property_update(prop, 0, update); } diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 733e14857fd..01726ea2dda 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -116,7 +116,7 @@ static void rna_Mesh_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) /* cheating way for importers to avoid slow updates */ if (id->us > 0) { DAG_id_tag_update(id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); } } @@ -125,7 +125,7 @@ static void rna_Mesh_update_select(Main *bmain, Scene *scene, PointerRNA *ptr) ID *id = ptr->id.data; /* cheating way for importers to avoid slow updates */ if (id->us > 0) { - WM_main_add_notifier(NC_GEOM|ND_SELECT, id); + WM_main_add_notifier(NC_GEOM | ND_SELECT, id); } } @@ -134,14 +134,14 @@ void rna_Mesh_update_draw(Main *bmain, Scene *scene, PointerRNA *ptr) ID *id = ptr->id.data; /* cheating way for importers to avoid slow updates */ if (id->us > 0) { - WM_main_add_notifier(NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); } } void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr) { - Mesh* me = ptr->data; + Mesh *me = ptr->data; if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) { me->editflag ^= ME_EDIT_PAINT_MASK; } @@ -150,7 +150,7 @@ void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr) void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr) { - Mesh* me = ptr->data; + Mesh *me = ptr->data; if ((me->editflag & ME_EDIT_VERT_SEL) && (me->editflag & ME_EDIT_PAINT_MASK)) { me->editflag ^= ME_EDIT_VERT_SEL; } @@ -158,13 +158,13 @@ void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr) } static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value) { - MVert *mvert = (MVert*)ptr->data; + MVert *mvert = (MVert *)ptr->data; normal_short_to_float_v3(value, mvert->no); } static void rna_MeshVertex_normal_set(PointerRNA *ptr, const float *value) { - MVert *mvert = (MVert*)ptr->data; + MVert *mvert = (MVert *)ptr->data; float no[3]; copy_v3_v3(no, value); @@ -174,61 +174,61 @@ static void rna_MeshVertex_normal_set(PointerRNA *ptr, const float *value) static float rna_MeshVertex_bevel_weight_get(PointerRNA *ptr) { - MVert *mvert = (MVert*)ptr->data; - return mvert->bweight/255.0f; + MVert *mvert = (MVert *)ptr->data; + return mvert->bweight / 255.0f; } static void rna_MeshVertex_bevel_weight_set(PointerRNA *ptr, float value) { - MVert *mvert = (MVert*)ptr->data; - mvert->bweight = (char)(CLAMPIS(value*255.0f, 0, 255)); + MVert *mvert = (MVert *)ptr->data; + mvert->bweight = (char)(CLAMPIS(value * 255.0f, 0, 255)); } static float rna_MEdge_bevel_weight_get(PointerRNA *ptr) { - MEdge *medge = (MEdge*)ptr->data; - return medge->bweight/255.0f; + MEdge *medge = (MEdge *)ptr->data; + return medge->bweight / 255.0f; } static void rna_MEdge_bevel_weight_set(PointerRNA *ptr, float value) { - MEdge *medge = (MEdge*)ptr->data; - medge->bweight = (char)(CLAMPIS(value*255.0f, 0, 255)); + MEdge *medge = (MEdge *)ptr->data; + medge->bweight = (char)(CLAMPIS(value * 255.0f, 0, 255)); } static float rna_MEdge_crease_get(PointerRNA *ptr) { - MEdge *medge = (MEdge*)ptr->data; - return medge->crease/255.0f; + MEdge *medge = (MEdge *)ptr->data; + return medge->crease / 255.0f; } static void rna_MEdge_crease_set(PointerRNA *ptr, float value) { - MEdge *medge = (MEdge*)ptr->data; - medge->crease = (char)(CLAMPIS(value*255.0f, 0, 255)); + MEdge *medge = (MEdge *)ptr->data; + medge->crease = (char)(CLAMPIS(value * 255.0f, 0, 255)); } static void rna_MeshPolygon_normal_get(PointerRNA *ptr, float *values) { Mesh *me = rna_mesh(ptr); - MPoly *mp = (MPoly*)ptr->data; + MPoly *mp = (MPoly *)ptr->data; /* BMESH_TODO: might be faster to look for a CD_NORMALS layer and use that */ - mesh_calc_poly_normal(mp, me->mloop+mp->loopstart, me->mvert, values); + mesh_calc_poly_normal(mp, me->mloop + mp->loopstart, me->mvert, values); } static float rna_MeshPolygon_area_get(PointerRNA *ptr) { - Mesh *me = (Mesh*)ptr->id.data; - MPoly *mp = (MPoly*)ptr->data; + Mesh *me = (Mesh *)ptr->id.data; + MPoly *mp = (MPoly *)ptr->data; - return BKE_mesh_calc_poly_area(mp, me->mloop+mp->loopstart, me->mvert, NULL); + return BKE_mesh_calc_poly_area(mp, me->mloop + mp->loopstart, me->mvert, NULL); } static void rna_MeshTessFace_normal_get(PointerRNA *ptr, float *values) { Mesh *me = rna_mesh(ptr); - MFace *mface = (MFace*)ptr->data; + MFace *mface = (MFace *)ptr->data; if (mface->v4) normal_quad_v3(values, me->mvert[mface->v1].co, me->mvert[mface->v2].co, @@ -240,7 +240,7 @@ static void rna_MeshTessFace_normal_get(PointerRNA *ptr, float *values) static float rna_MeshTessFace_area_get(PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - MFace *mface = (MFace*)ptr->data; + MFace *mface = (MFace *)ptr->data; if (mface->v4) return area_quad_v3(me->mvert[mface->v1].co, me->mvert[mface->v2].co, me->mvert[mface->v3].co, @@ -251,7 +251,7 @@ static float rna_MeshTessFace_area_get(PointerRNA *ptr) static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; values[0] = mtface->uv[0][0]; values[1] = mtface->uv[0][1]; @@ -259,7 +259,7 @@ static void rna_MeshTextureFace_uv1_get(PointerRNA *ptr, float *values) static void rna_MeshTextureFace_uv1_set(PointerRNA *ptr, const float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; mtface->uv[0][0] = values[0]; mtface->uv[0][1] = values[1]; @@ -267,7 +267,7 @@ static void rna_MeshTextureFace_uv1_set(PointerRNA *ptr, const float *values) static void rna_MeshTextureFace_uv2_get(PointerRNA *ptr, float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; values[0] = mtface->uv[1][0]; values[1] = mtface->uv[1][1]; @@ -275,7 +275,7 @@ static void rna_MeshTextureFace_uv2_get(PointerRNA *ptr, float *values) static void rna_MeshTextureFace_uv2_set(PointerRNA *ptr, const float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; mtface->uv[1][0] = values[0]; mtface->uv[1][1] = values[1]; @@ -283,7 +283,7 @@ static void rna_MeshTextureFace_uv2_set(PointerRNA *ptr, const float *values) static void rna_MeshTextureFace_uv3_get(PointerRNA *ptr, float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; values[0] = mtface->uv[2][0]; values[1] = mtface->uv[2][1]; @@ -291,7 +291,7 @@ static void rna_MeshTextureFace_uv3_get(PointerRNA *ptr, float *values) static void rna_MeshTextureFace_uv3_set(PointerRNA *ptr, const float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; mtface->uv[2][0] = values[0]; mtface->uv[2][1] = values[1]; @@ -299,7 +299,7 @@ static void rna_MeshTextureFace_uv3_set(PointerRNA *ptr, const float *values) static void rna_MeshTextureFace_uv4_get(PointerRNA *ptr, float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; values[0] = mtface->uv[3][0]; values[1] = mtface->uv[3][1]; @@ -307,7 +307,7 @@ static void rna_MeshTextureFace_uv4_get(PointerRNA *ptr, float *values) static void rna_MeshTextureFace_uv4_set(PointerRNA *ptr, const float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; mtface->uv[3][0] = values[0]; mtface->uv[3][1] = values[1]; @@ -322,7 +322,7 @@ static int rna_CustomDataData_numverts(PointerRNA *ptr, int type) for (cdl = fdata->layers, a = 0; a < fdata->totlayer; cdl++, a++) { if (cdl->type == type) { - b = ((char *)ptr->data - ((char*)cdl->data)) / CustomData_sizeof(type); + b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type); if (b >= 0 && b < me->totface) { return (me->mface[b].v4 ? 4 : 3); } @@ -336,12 +336,12 @@ static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr, int length[RNA_MAX { length[0] = rna_CustomDataData_numverts(ptr, CD_MTFACE); length[1] = 2; - return length[0]*length[1]; + return length[0] * length[1]; } static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; int totvert = rna_CustomDataData_numverts(ptr, CD_MTFACE); memcpy(values, mtface->uv, totvert * 2 * sizeof(float)); @@ -349,7 +349,7 @@ static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values) static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values) { - MTFace *mtface = (MTFace*)ptr->data; + MTFace *mtface = (MTFace *)ptr->data; int totvert = rna_CustomDataData_numverts(ptr, CD_MTFACE); memcpy(mtface->uv, values, totvert * 2 * sizeof(float)); @@ -358,74 +358,74 @@ static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values) /* notice red and blue are swapped */ static void rna_MeshColor_color1_get(PointerRNA *ptr, float *values) { - MCol *mcol = (MCol*)ptr->data; + MCol *mcol = (MCol *)ptr->data; - values[2] = (&mcol[0].r)[0]/255.0f; - values[1] = (&mcol[0].r)[1]/255.0f; - values[0] = (&mcol[0].r)[2]/255.0f; + values[2] = (&mcol[0].r)[0] / 255.0f; + values[1] = (&mcol[0].r)[1] / 255.0f; + values[0] = (&mcol[0].r)[2] / 255.0f; } static void rna_MeshColor_color1_set(PointerRNA *ptr, const float *values) { - MCol *mcol = (MCol*)ptr->data; + MCol *mcol = (MCol *)ptr->data; - (&mcol[0].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255)); - (&mcol[0].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255)); - (&mcol[0].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255)); + (&mcol[0].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); + (&mcol[0].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); + (&mcol[0].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); } static void rna_MeshColor_color2_get(PointerRNA *ptr, float *values) { - MCol *mcol = (MCol*)ptr->data; + MCol *mcol = (MCol *)ptr->data; - values[2] = (&mcol[1].r)[0]/255.0f; - values[1] = (&mcol[1].r)[1]/255.0f; - values[0] = (&mcol[1].r)[2]/255.0f; + values[2] = (&mcol[1].r)[0] / 255.0f; + values[1] = (&mcol[1].r)[1] / 255.0f; + values[0] = (&mcol[1].r)[2] / 255.0f; } static void rna_MeshColor_color2_set(PointerRNA *ptr, const float *values) { - MCol *mcol = (MCol*)ptr->data; + MCol *mcol = (MCol *)ptr->data; - (&mcol[1].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255)); - (&mcol[1].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255)); - (&mcol[1].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255)); + (&mcol[1].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); + (&mcol[1].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); + (&mcol[1].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); } static void rna_MeshColor_color3_get(PointerRNA *ptr, float *values) { - MCol *mcol = (MCol*)ptr->data; + MCol *mcol = (MCol *)ptr->data; - values[2] = (&mcol[2].r)[0]/255.0f; - values[1] = (&mcol[2].r)[1]/255.0f; - values[0] = (&mcol[2].r)[2]/255.0f; + values[2] = (&mcol[2].r)[0] / 255.0f; + values[1] = (&mcol[2].r)[1] / 255.0f; + values[0] = (&mcol[2].r)[2] / 255.0f; } static void rna_MeshColor_color3_set(PointerRNA *ptr, const float *values) { - MCol *mcol = (MCol*)ptr->data; + MCol *mcol = (MCol *)ptr->data; - (&mcol[2].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255)); - (&mcol[2].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255)); - (&mcol[2].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255)); + (&mcol[2].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); + (&mcol[2].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); + (&mcol[2].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); } static void rna_MeshColor_color4_get(PointerRNA *ptr, float *values) { - MCol *mcol = (MCol*)ptr->data; + MCol *mcol = (MCol *)ptr->data; - values[2] = (&mcol[3].r)[0]/255.0f; - values[1] = (&mcol[3].r)[1]/255.0f; - values[0] = (&mcol[3].r)[2]/255.0f; + values[2] = (&mcol[3].r)[0] / 255.0f; + values[1] = (&mcol[3].r)[1] / 255.0f; + values[0] = (&mcol[3].r)[2] / 255.0f; } static void rna_MeshColor_color4_set(PointerRNA *ptr, const float *values) { - MCol *mcol = (MCol*)ptr->data; + MCol *mcol = (MCol *)ptr->data; - (&mcol[3].r)[2] = (char)(CLAMPIS(values[0]*255.0f, 0, 255)); - (&mcol[3].r)[1] = (char)(CLAMPIS(values[1]*255.0f, 0, 255)); - (&mcol[3].r)[0] = (char)(CLAMPIS(values[2]*255.0f, 0, 255)); + (&mcol[3].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); + (&mcol[3].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); + (&mcol[3].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); } static void rna_MeshLoopColor_color_get(PointerRNA *ptr, float *values) @@ -448,15 +448,15 @@ static void rna_MeshLoopColor_color_set(PointerRNA *ptr, const float *values) static int rna_Mesh_texspace_editable(PointerRNA *ptr) { - Mesh *me = (Mesh*)ptr->data; - return (me->texflag & ME_AUTOSPACE)? 0: PROP_EDITABLE; + Mesh *me = (Mesh *)ptr->data; + return (me->texflag & ME_AUTOSPACE) ? 0 : PROP_EDITABLE; } static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float values[3]) { - Mesh *me= (Mesh*)ptr->data; + Mesh *me = (Mesh *)ptr->data; - if(!me->bb) + if (!me->bb) BKE_mesh_texspace_calc(me); copy_v3_v3(values, me->size); @@ -464,9 +464,9 @@ static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float values[3]) static void rna_Mesh_texspace_loc_get(PointerRNA *ptr, float values[3]) { - Mesh *me= (Mesh*)ptr->data; + Mesh *me = (Mesh *)ptr->data; - if(!me->bb) + if (!me->bb) BKE_mesh_texspace_calc(me); copy_v3_v3(values, me->loc); @@ -477,10 +477,10 @@ static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, Pointe Mesh *me = rna_mesh(ptr); if (me->dvert) { - MVert *mvert = (MVert*)ptr->data; - MDeformVert *dvert = me->dvert + (mvert-me->mvert); + MVert *mvert = (MVert *)ptr->data; + MDeformVert *dvert = me->dvert + (mvert - me->mvert); - rna_iterator_array_begin(iter, (void*)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL); + rna_iterator_array_begin(iter, (void *)dvert->dw, sizeof(MDeformWeight), dvert->totweight, 0, NULL); } else rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); @@ -488,7 +488,7 @@ static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, Pointe static int rna_CustomDataLayer_active_get(PointerRNA *ptr, CustomData *data, int type, int render) { - int n = ((CustomDataLayer*)ptr->data) - data->layers; + int n = ((CustomDataLayer *)ptr->data) - data->layers; if (render) return (n == CustomData_get_render_layer_index(data, type)); else return (n == CustomData_get_active_layer_index(data, type)); @@ -496,32 +496,32 @@ static int rna_CustomDataLayer_active_get(PointerRNA *ptr, CustomData *data, int static int rna_CustomDataLayer_clone_get(PointerRNA *ptr, CustomData *data, int type, int render) { - int n = ((CustomDataLayer*)ptr->data) - data->layers; + int n = ((CustomDataLayer *)ptr->data) - data->layers; return (n == CustomData_get_clone_layer_index(data, type)); } static void rna_CustomDataLayer_active_set(PointerRNA *ptr, CustomData *data, int value, int type, int render) { - int n = (((CustomDataLayer*)ptr->data) - data->layers) - CustomData_get_layer_index(data, type); + int n = (((CustomDataLayer *)ptr->data) - data->layers) - CustomData_get_layer_index(data, type); if (value == 0) return; if (render) CustomData_set_layer_render(data, type, n); - else CustomData_set_layer_active(data, type, n); + else CustomData_set_layer_active(data, type, n); /* sync loop layer */ if (type == CD_MTEXPOLY) { CustomData *ldata = rna_mesh_ldata(ptr); if (render) CustomData_set_layer_render(ldata, CD_MLOOPUV, n); - else CustomData_set_layer_active(ldata, CD_MLOOPUV, n); + else CustomData_set_layer_active(ldata, CD_MLOOPUV, n); } } static void rna_CustomDataLayer_clone_set(PointerRNA *ptr, CustomData *data, int value, int type, int render) { - int n = ((CustomDataLayer*)ptr->data) - data->layers; + int n = ((CustomDataLayer *)ptr->data) - data->layers; if (value == 0) return; @@ -539,9 +539,9 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(uv_layer, ldata, CD_MLOOPUV, rende /* MeshUVLoopLayer */ -static char *rna_MeshUVLoopLayer_path(PointerRNA *ptr) +static char *rna_MeshUVLoopLayer_path(PointerRNA * ptr) { - return BLI_sprintfN("uv_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("uv_layers[\"%s\"]", ((CustomDataLayer *)ptr->data)->name); } static void rna_MeshUVLoopLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) @@ -568,14 +568,14 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(tessface_uv_texture, fdata, CD_MTF static void rna_MeshTextureFaceLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - CustomDataLayer *layer = (CustomDataLayer*)ptr->data; - rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), (me->edit_btmesh)? 0: me->totface, 0, NULL); + CustomDataLayer *layer = (CustomDataLayer *)ptr->data; + rna_iterator_array_begin(iter, layer->data, sizeof(MTFace), (me->edit_btmesh) ? 0 : me->totface, 0, NULL); } static int rna_MeshTextureFaceLayer_data_length(PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - return (me->edit_btmesh)? 0: me->totface; + return (me->edit_btmesh) ? 0 : me->totface; } static int rna_MeshTextureFaceLayer_active_render_get(PointerRNA *ptr) @@ -611,7 +611,7 @@ static void rna_MeshTextureFaceLayer_clone_set(PointerRNA *ptr, int value) static void rna_MeshTextureFaceLayer_name_set(PointerRNA *ptr, const char *value) { CustomData *fdata = rna_mesh_fdata(ptr); - CustomDataLayer *cdl = (CustomDataLayer*)ptr->data; + CustomDataLayer *cdl = (CustomDataLayer *)ptr->data; BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name)); CustomData_set_layer_unique_name(fdata, cdl - fdata->layers); } @@ -627,7 +627,7 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(uv_texture, pdata, CD_MTEXPOLY, re static void rna_MeshTexturePolyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - CustomDataLayer *layer = (CustomDataLayer*)ptr->data; + CustomDataLayer *layer = (CustomDataLayer *)ptr->data; rna_iterator_array_begin(iter, layer->data, sizeof(MTexPoly), (me->edit_btmesh) ? 0 : me->totpoly, 0, NULL); } @@ -670,7 +670,7 @@ static void rna_MeshTexturePolyLayer_clone_set(PointerRNA *ptr, int value) static void rna_MeshTexturePolyLayer_name_set(PointerRNA *ptr, const char *value) { CustomData *pdata = rna_mesh_pdata(ptr); - CustomDataLayer *cdl = (CustomDataLayer*)ptr->data; + CustomDataLayer *cdl = (CustomDataLayer *)ptr->data; BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name)); CustomData_set_layer_unique_name(pdata, cdl - pdata->layers); } @@ -721,7 +721,7 @@ DEFINE_CUSTOMDATA_LAYER_COLLECTION_ACTIVEITEM(vertex_color, ldata, CD_MLOOPCOL, static void rna_MeshLoopColorLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - CustomDataLayer *layer = (CustomDataLayer*)ptr->data; + CustomDataLayer *layer = (CustomDataLayer *)ptr->data; rna_iterator_array_begin(iter, layer->data, sizeof(MLoopCol), me->totloop, 0, NULL); } @@ -755,7 +755,7 @@ static void rna_MeshLoopColorLayer_name_set(PointerRNA *ptr, const char *value) { /* Mesh *me = rna_mesh(ptr); */ /* UNUSED */ /* CustomData *pdata = rna_mesh_pdata(ptr); */ /* UNUSED */ - CustomDataLayer *cdl = (CustomDataLayer*)ptr->data; + CustomDataLayer *cdl = (CustomDataLayer *)ptr->data; BLI_strncpy_utf8(cdl->name, value, sizeof(cdl->name)); CustomData_set_layer_unique_name(rna_mesh_ldata(ptr), cdl - rna_mesh_ldata(ptr)->layers); } @@ -763,7 +763,7 @@ static void rna_MeshLoopColorLayer_name_set(PointerRNA *ptr, const char *value) static void rna_MeshFloatPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - CustomDataLayer *layer = (CustomDataLayer*)ptr->data; + CustomDataLayer *layer = (CustomDataLayer *)ptr->data; rna_iterator_array_begin(iter, layer->data, sizeof(MFloatProperty), me->totpoly, 0, NULL); } @@ -775,14 +775,14 @@ static int rna_MeshFloatPropertyLayer_data_length(PointerRNA *ptr) static int rna_float_layer_check(CollectionPropertyIterator *iter, void *data) { - CustomDataLayer *layer = (CustomDataLayer*)data; + CustomDataLayer *layer = (CustomDataLayer *)data; return (layer->type != CD_PROP_FLT); } static void rna_Mesh_polygon_float_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { CustomData *pdata = rna_mesh_pdata(ptr); - rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0, + rna_iterator_array_begin(iter, (void *)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0, rna_float_layer_check); } @@ -793,14 +793,14 @@ static int rna_Mesh_polygon_float_layers_length(PointerRNA *ptr) static int rna_int_layer_check(CollectionPropertyIterator *iter, void *data) { - CustomDataLayer *layer = (CustomDataLayer*)data; + CustomDataLayer *layer = (CustomDataLayer *)data; return (layer->type != CD_PROP_INT); } static void rna_MeshIntPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - CustomDataLayer *layer = (CustomDataLayer*)ptr->data; + CustomDataLayer *layer = (CustomDataLayer *)ptr->data; rna_iterator_array_begin(iter, layer->data, sizeof(MIntProperty), me->totpoly, 0, NULL); } @@ -813,7 +813,7 @@ static int rna_MeshIntPropertyLayer_data_length(PointerRNA *ptr) static void rna_Mesh_polygon_int_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { CustomData *pdata = rna_mesh_pdata(ptr); - rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0, + rna_iterator_array_begin(iter, (void *)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0, rna_int_layer_check); } @@ -824,14 +824,14 @@ static int rna_Mesh_polygon_int_layers_length(PointerRNA *ptr) static int rna_string_layer_check(CollectionPropertyIterator *iter, void *data) { - CustomDataLayer *layer = (CustomDataLayer*)data; + CustomDataLayer *layer = (CustomDataLayer *)data; return (layer->type != CD_PROP_STR); } static void rna_MeshStringPropertyLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - CustomDataLayer *layer = (CustomDataLayer*)ptr->data; + CustomDataLayer *layer = (CustomDataLayer *)ptr->data; rna_iterator_array_begin(iter, layer->data, sizeof(MStringProperty), me->totpoly, 0, NULL); } @@ -844,7 +844,7 @@ static int rna_MeshStringPropertyLayer_data_length(PointerRNA *ptr) static void rna_Mesh_polygon_string_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { CustomData *pdata = rna_mesh_pdata(ptr); - rna_iterator_array_begin(iter, (void*)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0, + rna_iterator_array_begin(iter, (void *)pdata->layers, sizeof(CustomDataLayer), pdata->totlayer, 0, rna_string_layer_check); } @@ -855,7 +855,7 @@ static int rna_Mesh_polygon_string_layers_length(PointerRNA *ptr) static void rna_TexturePoly_image_set(PointerRNA *ptr, PointerRNA value) { - MTexPoly *tf = (MTexPoly*)ptr->data; + MTexPoly *tf = (MTexPoly *)ptr->data; ID *id = value.data; if (id) { @@ -874,7 +874,7 @@ static void rna_TexturePoly_image_set(PointerRNA *ptr, PointerRNA value) * keep it to support importers that only make tessfaces */ static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value) { - MTFace *tf = (MTFace*)ptr->data; + MTFace *tf = (MTFace *)ptr->data; ID *id = value.data; if (id) { @@ -905,32 +905,32 @@ static float rna_Mesh_auto_smooth_angle_get(PointerRNA *ptr) static int rna_MeshTessFace_verts_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - MFace *face = (MFace*)ptr->data; + MFace *face = (MFace *)ptr->data; if (face) - length[0] = (face->v4)? 4: 3; + length[0] = (face->v4) ? 4 : 3; else - length[0] = 4; /* XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell */ + length[0] = 4; /* XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell */ return length[0]; } static void rna_MeshTessFace_verts_get(PointerRNA *ptr, int *values) { - MFace *face = (MFace*)ptr->data; + MFace *face = (MFace *)ptr->data; memcpy(values, &face->v1, (face->v4 ? 4 : 3) * sizeof(int)); } static void rna_MeshTessFace_verts_set(PointerRNA *ptr, const int *values) { - MFace *face = (MFace*)ptr->data; + MFace *face = (MFace *)ptr->data; memcpy(&face->v1, values, (face->v4 ? 4 : 3) * sizeof(int)); } /* poly.vertices - this is faked loop access for convenience */ static int rna_MeshPoly_vertices_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - MPoly *mp = (MPoly*)ptr->data; + 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 */ return (length[0] = mp->totloop); } @@ -938,7 +938,7 @@ static int rna_MeshPoly_vertices_get_length(PointerRNA *ptr, int length[RNA_MAX_ static void rna_MeshPoly_vertices_get(PointerRNA *ptr, int *values) { Mesh *me = rna_mesh(ptr); - MPoly *mp = (MPoly*)ptr->data; + MPoly *mp = (MPoly *)ptr->data; MLoop *ml = &me->mloop[mp->loopstart]; unsigned int i; for (i = mp->totloop; i > 0; i--, values++, ml++) { @@ -949,7 +949,7 @@ static void rna_MeshPoly_vertices_get(PointerRNA *ptr, int *values) static void rna_MeshPoly_vertices_set(PointerRNA *ptr, const int *values) { Mesh *me = rna_mesh(ptr); - MPoly *mp = (MPoly*)ptr->data; + MPoly *mp = (MPoly *)ptr->data; MLoop *ml = &me->mloop[mp->loopstart]; unsigned int i; for (i = mp->totloop; i > 0; i--, values++, ml++) { @@ -961,42 +961,42 @@ static void rna_MeshPoly_material_index_range(PointerRNA *ptr, int *min, int *ma { Mesh *me = rna_mesh(ptr); *min = 0; - *max = me->totcol-1; + *max = me->totcol - 1; *max = MAX2(0, *max); } static int rna_MeshVertex_index_get(PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - MVert *vert = (MVert*)ptr->data; + MVert *vert = (MVert *)ptr->data; return (int)(vert - me->mvert); } static int rna_MeshEdge_index_get(PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - MEdge *edge = (MEdge*)ptr->data; + MEdge *edge = (MEdge *)ptr->data; return (int)(edge - me->medge); } static int rna_MeshTessFace_index_get(PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - MFace *face = (MFace*)ptr->data; + MFace *face = (MFace *)ptr->data; return (int)(face - me->mface); } static int rna_MeshPolygon_index_get(PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - MPoly *mpoly = (MPoly*)ptr->data; + MPoly *mpoly = (MPoly *)ptr->data; return (int)(mpoly - me->mpoly); } static int rna_MeshLoop_index_get(PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - MLoop *mloop = (MLoop*)ptr->data; + MLoop *mloop = (MLoop *)ptr->data; return (int)(mloop - me->mloop); } @@ -1005,7 +1005,7 @@ static int rna_MeshLoop_index_get(PointerRNA *ptr) static char *rna_VertexGroupElement_path(PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); /* XXX not always! */ - MDeformWeight *dw = (MDeformWeight*)ptr->data; + MDeformWeight *dw = (MDeformWeight *)ptr->data; MDeformVert *dvert; int a, b; @@ -1019,7 +1019,7 @@ static char *rna_VertexGroupElement_path(PointerRNA *ptr) static char *rna_MeshPolygon_path(PointerRNA *ptr) { - return BLI_sprintfN("polygons[%d]", (int)((MPoly*)ptr->data - rna_mesh(ptr)->mpoly)); + return BLI_sprintfN("polygons[%d]", (int)((MPoly *)ptr->data - rna_mesh(ptr)->mpoly)); } static char *rna_MeshTessFace_path(PointerRNA *ptr) @@ -1029,28 +1029,28 @@ static char *rna_MeshTessFace_path(PointerRNA *ptr) static char *rna_MeshEdge_path(PointerRNA *ptr) { - return BLI_sprintfN("edges[%d]", (int)((MEdge*)ptr->data - rna_mesh(ptr)->medge)); + return BLI_sprintfN("edges[%d]", (int)((MEdge *)ptr->data - rna_mesh(ptr)->medge)); } static char *rna_MeshLoop_path(PointerRNA *ptr) { - return BLI_sprintfN("loops[%d]", (int)((MLoop*)ptr->data - rna_mesh(ptr)->mloop)); + return BLI_sprintfN("loops[%d]", (int)((MLoop *)ptr->data - rna_mesh(ptr)->mloop)); } static char *rna_MeshVertex_path(PointerRNA *ptr) { - return BLI_sprintfN("vertices[%d]", (int)((MVert*)ptr->data - rna_mesh(ptr)->mvert)); + return BLI_sprintfN("vertices[%d]", (int)((MVert *)ptr->data - rna_mesh(ptr)->mvert)); } static char *rna_MeshTextureFaceLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("tessface_uv_textures[\"%s\"]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("tessface_uv_textures[\"%s\"]", ((CustomDataLayer *)ptr->data)->name); } static char *rna_MeshTexturePolyLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("uv_textures[\"%s\"]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("uv_textures[\"%s\"]", ((CustomDataLayer *)ptr->data)->name); } static char *rna_PolyCustomData_data_path(PointerRNA *ptr, char *collection, int type) @@ -1062,7 +1062,7 @@ static char *rna_PolyCustomData_data_path(PointerRNA *ptr, char *collection, int for (cdl = pdata->layers, a = 0; a < pdata->totlayer; cdl++, a++) { if (cdl->type == type) { - b = ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type); + b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type); if (b >= 0 && b < totpoly) return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b); } @@ -1080,7 +1080,7 @@ static char *rna_LoopCustomData_data_path(PointerRNA *ptr, char *collection, int for (cdl = ldata->layers, a = 0; a < ldata->totlayer; cdl++, a++) { if (cdl->type == type) { - b = ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type); + b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type); if (b >= 0 && b < totloop) return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b); } @@ -1098,7 +1098,7 @@ static char *rna_FaceCustomData_data_path(PointerRNA *ptr, char *collection, int for (cdl = fdata->layers, a = 0; a < fdata->totlayer; cdl++, a++) { if (cdl->type == type) { - b = ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type); + b = ((char *)ptr->data - ((char *)cdl->data)) / CustomData_sizeof(type); if (b >= 0 && b < totloop) return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b); } @@ -1124,12 +1124,12 @@ static char *rna_MeshTexturePoly_path(PointerRNA *ptr) static char *rna_MeshColorLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("tessface_vertex_colors[\"%s\"]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("tessface_vertex_colors[\"%s\"]", ((CustomDataLayer *)ptr->data)->name); } static char *rna_MeshLoopColorLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("vertex_colors[\"%s\"]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("vertex_colors[\"%s\"]", ((CustomDataLayer *)ptr->data)->name); } static char *rna_MeshColor_path(PointerRNA *ptr) @@ -1139,12 +1139,12 @@ static char *rna_MeshColor_path(PointerRNA *ptr) static char *rna_MeshSticky_path(PointerRNA *ptr) { - return BLI_sprintfN("sticky[%d]", (int)((MSticky*)ptr->data - rna_mesh(ptr)->msticky)); + return BLI_sprintfN("sticky[%d]", (int)((MSticky *)ptr->data - rna_mesh(ptr)->msticky)); } static char *rna_MeshIntPropertyLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("int_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("int_layers[\"%s\"]", ((CustomDataLayer *)ptr->data)->name); } static char *rna_MeshIntProperty_path(PointerRNA *ptr) @@ -1154,7 +1154,7 @@ static char *rna_MeshIntProperty_path(PointerRNA *ptr) static char *rna_MeshFloatPropertyLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("float_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("float_layers[\"%s\"]", ((CustomDataLayer *)ptr->data)->name); } static char *rna_MeshFloatProperty_path(PointerRNA *ptr) @@ -1164,7 +1164,7 @@ static char *rna_MeshFloatProperty_path(PointerRNA *ptr) static char *rna_MeshStringPropertyLayer_path(PointerRNA *ptr) { - return BLI_sprintfN("string_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name); + return BLI_sprintfN("string_layers[\"%s\"]", ((CustomDataLayer *)ptr->data)->name); } static char *rna_MeshStringProperty_path(PointerRNA *ptr) @@ -1180,7 +1180,7 @@ static int rna_Mesh_tot_vert_get(PointerRNA *ptr) static int rna_Mesh_tot_edge_get(PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); - return me->edit_btmesh ? me->edit_btmesh->bm->totedgesel: 0; + return me->edit_btmesh ? me->edit_btmesh->bm->totedgesel : 0; } static int rna_Mesh_tot_face_get(PointerRNA *ptr) { @@ -1696,8 +1696,8 @@ static void rna_def_mtface(BlenderRNA *brna) RNA_def_property_struct_type(prop, "MeshTextureFace"); RNA_def_property_ui_text(prop, "Data", ""); RNA_def_property_collection_funcs(prop, "rna_MeshTextureFaceLayer_data_begin", "rna_iterator_array_next", - "rna_iterator_array_end", "rna_iterator_array_get", - "rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL); + "rna_iterator_array_end", "rna_iterator_array_get", + "rna_MeshTextureFaceLayer_data_length", NULL, NULL, NULL); srna = RNA_def_struct(brna, "MeshTextureFace", NULL); RNA_def_struct_sdna(srna, "MTFace"); @@ -2097,12 +2097,14 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable) RNA_def_property_editable_func(prop, texspace_editable); RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); - /* not supported yet + /* not supported yet */ +#if 0 prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); RNA_def_property_float(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); RNA_def_property_editable_func(prop, texspace_editable); - RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/ + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); +#endif /* materials */ prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); @@ -2294,13 +2296,14 @@ static void rna_def_loop_colors(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_RNAPTR); RNA_def_function_return(func, parm); -/* +#if 0 func = RNA_def_function(srna, "remove", "rna_Mesh_vertex_color_remove"); RNA_def_function_ui_description(func, "Remove a vertex color layer"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); -*/ +#endif + prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshLoopColorLayer"); RNA_def_property_pointer_funcs(prop, "rna_Mesh_vertex_color_active_get", @@ -2470,13 +2473,14 @@ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_RNAPTR); RNA_def_function_return(func, parm); -/* +#if 0 func = RNA_def_function(srna, "remove", "rna_Mesh_uv_texture_layers_remove"); RNA_def_function_ui_description(func, "Remove a vertex color layer"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "layer", "Layer", "", "The layer to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); -*/ +#endif + prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshTexturePolyLayer"); RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_active_get", @@ -2539,7 +2543,7 @@ static void rna_def_mesh(BlenderRNA *brna) /* TODO, should this be allowed to be its self? */ prop = RNA_def_property(srna, "texture_mesh", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "texcomesh"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_ui_text(prop, "Texture Mesh", "Use another mesh for texture indices (vertex indices must be aligned)"); @@ -2702,21 +2706,23 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Auto Texture Space", "Adjust active object's texture space automatically when transforming object"); - /*prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION); +#if 0 + prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Texture Space Location", "Texture space location"); RNA_def_property_editable_func(prop, "rna_Mesh_texspace_editable"); RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_loc_get", "rna_Mesh_texspace_loc_set", NULL); RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); - */ +#endif - /* not supported yet + /* not supported yet */ +#if 0 prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); RNA_def_property_float(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); RNA_def_property_editable_func(prop, texspace_editable); RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); - */ +#endif /* Mesh Draw Options for Edit Mode*/ @@ -2728,7 +2734,7 @@ static void rna_def_mesh(BlenderRNA *brna) prop = RNA_def_property(srna, "show_all_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_ALLEDGES); RNA_def_property_ui_text(prop, "All Edges", "Display all edges for wireframe in all view modes in the 3D view"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES); @@ -2795,15 +2801,15 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X); RNA_def_property_ui_text(prop, "X Mirror", "X Axis mirror editing"); - /* +#if 0 prop = RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Y); RNA_def_property_ui_text(prop, "Y Mirror", "Y Axis mirror editing"); - prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "use_mirror_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_Z); RNA_def_property_ui_text(prop, "Z Mirror", "Z Axis mirror editing"); - */ +#endif prop = RNA_def_property(srna, "use_mirror_topology", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_TOPO); @@ -2815,13 +2821,13 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_PAINT_MASK); RNA_def_property_ui_text(prop, "Paint Mask", "Face selection masking for painting"); RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_facemask"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Mesh_update_facemask"); prop = RNA_def_property(srna, "use_paint_mask_vertex", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_VERT_SEL); RNA_def_property_ui_text(prop, "Vertex Selection", "Vertex selection masking for painting (weight paint only)"); RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_Mesh_update_vertmask"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_Mesh_update_vertmask"); /* readonly editmesh info - use for extrude menu */ prop = RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index c0a9d19360d..ec03d452b57 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -42,7 +42,7 @@ #ifdef RNA_RUNTIME const char *rna_Mesh_unit_test_compare(struct Mesh *mesh, bContext *C, struct Mesh *mesh2) { - const char *ret = BKE_mesh_cmp(mesh, mesh2, FLT_EPSILON*60); + const char *ret = BKE_mesh_cmp(mesh, mesh2, FLT_EPSILON * 60); if (!ret) ret = "Same"; @@ -82,7 +82,7 @@ void RNA_api_mesh(StructRNA *srna) func = RNA_def_function(srna, "validate", "BKE_mesh_validate"); RNA_def_function_ui_description(func, "validate geometry, return True when the mesh has had " - "invalid geometry corrected/removed"); + "invalid geometry corrected/removed"); RNA_def_boolean(func, "verbose", 0, "Verbose", "Output information about the errors found"); parm = RNA_def_boolean(func, "result", 0, "Result", ""); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index eda38a43d54..c8b52b45604 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -53,13 +53,13 @@ static int rna_Meta_texspace_editable(PointerRNA *ptr) { - MetaBall *mb = (MetaBall*)ptr->data; - return (mb->texflag & MB_AUTOSPACE)? 0: PROP_EDITABLE; + MetaBall *mb = (MetaBall *)ptr->data; + return (mb->texflag & MB_AUTOSPACE) ? 0 : PROP_EDITABLE; } static void rna_Meta_texspace_loc_get(PointerRNA *ptr, float *values) { - MetaBall *mb = (MetaBall*)ptr->data; + MetaBall *mb = (MetaBall *)ptr->data; /* tex_space_mball() needs object.. ugh */ @@ -68,14 +68,14 @@ static void rna_Meta_texspace_loc_get(PointerRNA *ptr, float *values) static void rna_Meta_texspace_loc_set(PointerRNA *ptr, const float *values) { - MetaBall *mb = (MetaBall*)ptr->data; + MetaBall *mb = (MetaBall *)ptr->data; copy_v3_v3(mb->loc, values); } static void rna_Meta_texspace_size_get(PointerRNA *ptr, float *values) { - MetaBall *mb = (MetaBall*)ptr->data; + MetaBall *mb = (MetaBall *)ptr->data; /* tex_space_mball() needs object.. ugh */ @@ -84,7 +84,7 @@ static void rna_Meta_texspace_size_get(PointerRNA *ptr, float *values) static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values) { - MetaBall *mb = (MetaBall*)ptr->data; + MetaBall *mb = (MetaBall *)ptr->data; copy_v3_v3(mb->size, values); } @@ -102,7 +102,7 @@ static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) BKE_mball_properties_copy(scene, ob); DAG_id_tag_update(&mb->id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, mb); + WM_main_add_notifier(NC_GEOM | ND_DATA, mb); } } @@ -120,7 +120,7 @@ static MetaElem *rna_MetaBall_elements_new(MetaBall *mb, int type) /* cheating way for importers to avoid slow updates */ if (mb->id.us > 0) { DAG_id_tag_update(&mb->id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id); + WM_main_add_notifier(NC_GEOM | ND_DATA, &mb->id); } return ml; @@ -133,7 +133,7 @@ static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, Meta found = BLI_remlink_safe(&mb->elems, ml); if (!found) { - BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" does not contain spline given", mb->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Metaball \"%s\" does not contain spline given", mb->id.name + 2); return; } @@ -143,7 +143,7 @@ static void rna_MetaBall_elements_remove(MetaBall *mb, ReportList *reports, Meta /* cheating way for importers to avoid slow updates */ if (mb->id.us > 0) { DAG_id_tag_update(&mb->id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id); + WM_main_add_notifier(NC_GEOM | ND_DATA, &mb->id); } } @@ -154,7 +154,7 @@ static void rna_MetaBall_elements_clear(MetaBall *mb) /* cheating way for importers to avoid slow updates */ if (mb->id.us > 0) { DAG_id_tag_update(&mb->id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, &mb->id); + WM_main_add_notifier(NC_GEOM | ND_DATA, &mb->id); } } @@ -188,7 +188,7 @@ static void rna_def_metaelement(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Rotation", "Normalized quaternion rotation"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_rotation"); - prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_UNSIGNED|PROP_UNIT_LENGTH); + prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_UNSIGNED | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "rad"); RNA_def_property_ui_text(prop, "Radius", ""); RNA_def_property_range(prop, 0.0f, FLT_MAX); @@ -254,7 +254,7 @@ static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove an element from the metaball"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "element", "MetaElement", "", "The element to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "clear", "rna_MetaBall_elements_clear"); RNA_def_function_ui_description(func, "Remove all elements from the metaball"); @@ -273,7 +273,8 @@ static void rna_def_metaball(BlenderRNA *brna) {MB_UPDATE_HALFRES, "HALFRES", 0, "Half", "While editing, update metaball in half resolution"}, {MB_UPDATE_FAST, "FAST", 0, "Fast", "While editing, update metaball without polygonization"}, {MB_UPDATE_NEVER, "NEVER", 0, "Never", "While editing, don't update metaball at all"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MetaBall", "ID"); RNA_def_struct_ui_text(srna, "MetaBall", "Metaball datablock to defined blobby surfaces"); @@ -333,7 +334,7 @@ static void rna_def_metaball(BlenderRNA *brna) /* not supported yet */ #if 0 - prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); + prop = RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); RNA_def_property_float(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); RNA_def_property_editable_func(prop, "rna_Meta_texspace_editable"); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 4f045788561..07ea69fc260 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -102,7 +102,8 @@ EnumPropertyItem modifier_type_items[] = { {eModifierType_Smoke, "SMOKE", ICON_MOD_SMOKE, "Smoke", ""}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -117,13 +118,13 @@ EnumPropertyItem modifier_type_items[] = { static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - UVProjectModifierData *uvp = (UVProjectModifierData*)ptr->data; - rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), uvp->num_projectors, 0, NULL); + UVProjectModifierData *uvp = (UVProjectModifierData *)ptr->data; + rna_iterator_array_begin(iter, (void *)uvp->projectors, sizeof(Object *), uvp->num_projectors, 0, NULL); } -static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) +static StructRNA *rna_Modifier_refine(struct PointerRNA *ptr) { - ModifierData *md = (ModifierData*)ptr->data; + ModifierData *md = (ModifierData *)ptr->data; switch (md->type) { case eModifierType_Subsurf: @@ -234,13 +235,13 @@ void rna_Modifier_name_set(PointerRNA *ptr, const char *value) static char *rna_Modifier_path(PointerRNA *ptr) { - return BLI_sprintfN("modifiers[\"%s\"]", ((ModifierData*)ptr->data)->name); + return BLI_sprintfN("modifiers[\"%s\"]", ((ModifierData *)ptr->data)->name); } static void rna_Modifier_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ptr->id.data); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->id.data); } static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -252,7 +253,7 @@ static void rna_Modifier_dependency_update(Main *bmain, Scene *scene, PointerRNA static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr) { SmokeModifierData *smd = (SmokeModifierData *)ptr->data; - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; ParticleSystemModifierData *psmd = NULL; ParticleSystem *psys = NULL; ParticleSettings *part = NULL; @@ -285,7 +286,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr) part->flag |= PART_UNBORN; part->draw_as = PART_DRAW_DOT; BLI_strncpy(psys->name, "SmokeParticles", sizeof(psys->name)); - psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS); + psys->recalc |= (PSYS_RECALC_RESET | PSYS_RECALC_PHYS); DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); } } @@ -304,137 +305,137 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value) { - ExplodeModifierData *emd = (ExplodeModifierData*)ptr->data; + ExplodeModifierData *emd = (ExplodeModifierData *)ptr->data; rna_object_vgroup_name_index_get(ptr, value, emd->vgroup); } static int rna_ExplodeModifier_vgroup_length(PointerRNA *ptr) { - ExplodeModifierData *emd = (ExplodeModifierData*)ptr->data; + ExplodeModifierData *emd = (ExplodeModifierData *)ptr->data; return rna_object_vgroup_name_index_length(ptr, emd->vgroup); } static void rna_ExplodeModifier_vgroup_set(PointerRNA *ptr, const char *value) { - ExplodeModifierData *emd = (ExplodeModifierData*)ptr->data; + ExplodeModifierData *emd = (ExplodeModifierData *)ptr->data; rna_object_vgroup_name_index_set(ptr, value, &emd->vgroup); } static void rna_SimpleDeformModifier_vgroup_set(PointerRNA *ptr, const char *value) { - SimpleDeformModifierData *smd = (SimpleDeformModifierData*)ptr->data; + SimpleDeformModifierData *smd = (SimpleDeformModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, smd->vgroup_name, sizeof(smd->vgroup_name)); } static void rna_ShrinkwrapModifier_vgroup_set(PointerRNA *ptr, const char *value) { - ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*)ptr->data; + ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, smd->vgroup_name, sizeof(smd->vgroup_name)); } static void rna_LatticeModifier_vgroup_set(PointerRNA *ptr, const char *value) { - LatticeModifierData *lmd = (LatticeModifierData*)ptr->data; + LatticeModifierData *lmd = (LatticeModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name)); } static void rna_ArmatureModifier_vgroup_set(PointerRNA *ptr, const char *value) { - ArmatureModifierData *lmd = (ArmatureModifierData*)ptr->data; + ArmatureModifierData *lmd = (ArmatureModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name)); } static void rna_CurveModifier_vgroup_set(PointerRNA *ptr, const char *value) { - CurveModifierData *lmd = (CurveModifierData*)ptr->data; + CurveModifierData *lmd = (CurveModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name)); } static void rna_DisplaceModifier_vgroup_set(PointerRNA *ptr, const char *value) { - DisplaceModifierData *lmd = (DisplaceModifierData*)ptr->data; + DisplaceModifierData *lmd = (DisplaceModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name)); } static void rna_HookModifier_vgroup_set(PointerRNA *ptr, const char *value) { - HookModifierData *lmd = (HookModifierData*)ptr->data; + HookModifierData *lmd = (HookModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->name, sizeof(lmd->name)); } static void rna_MaskModifier_vgroup_set(PointerRNA *ptr, const char *value) { - MaskModifierData *lmd = (MaskModifierData*)ptr->data; + MaskModifierData *lmd = (MaskModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->vgroup, sizeof(lmd->vgroup)); } static void rna_MeshDeformModifier_vgroup_set(PointerRNA *ptr, const char *value) { - MeshDeformModifierData *lmd = (MeshDeformModifierData*)ptr->data; + MeshDeformModifierData *lmd = (MeshDeformModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name)); } static void rna_SmoothModifier_vgroup_set(PointerRNA *ptr, const char *value) { - SmoothModifierData *lmd = (SmoothModifierData*)ptr->data; + SmoothModifierData *lmd = (SmoothModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name)); } static void rna_WaveModifier_vgroup_set(PointerRNA *ptr, const char *value) { - WaveModifierData *lmd = (WaveModifierData*)ptr->data; + WaveModifierData *lmd = (WaveModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name)); } static void rna_CastModifier_vgroup_set(PointerRNA *ptr, const char *value) { - CastModifierData *lmd = (CastModifierData*)ptr->data; + CastModifierData *lmd = (CastModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, lmd->defgrp_name, sizeof(lmd->defgrp_name)); } static void rna_SolidifyModifier_vgroup_set(PointerRNA *ptr, const char *value) { - SolidifyModifierData *smd = (SolidifyModifierData*)ptr->data; + SolidifyModifierData *smd = (SolidifyModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, smd->defgrp_name, sizeof(smd->defgrp_name)); } static void rna_WeightVGModifier_vgroup_set(PointerRNA *ptr, const char *value) { - ModifierData *md = (ModifierData*)ptr->data; + ModifierData *md = (ModifierData *)ptr->data; if (md->type == eModifierType_WeightVGEdit) { - WeightVGEditModifierData *wmd = (WeightVGEditModifierData*)md; + WeightVGEditModifierData *wmd = (WeightVGEditModifierData *)md; rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name)); } else if (md->type == eModifierType_WeightVGMix) { - WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)md; + WeightVGMixModifierData *wmd = (WeightVGMixModifierData *)md; rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_a, sizeof(wmd->defgrp_name_a)); } else if (md->type == eModifierType_WeightVGProximity) { - WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*)md; + WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *)md; rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name, sizeof(wmd->defgrp_name)); } } static void rna_WeightVGModifier_mask_vgroup_set(PointerRNA *ptr, const char *value) { - ModifierData *md = (ModifierData*)ptr->data; + ModifierData *md = (ModifierData *)ptr->data; if (md->type == eModifierType_WeightVGEdit) { - WeightVGEditModifierData *wmd = (WeightVGEditModifierData*)md; + WeightVGEditModifierData *wmd = (WeightVGEditModifierData *)md; rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name)); } else if (md->type == eModifierType_WeightVGMix) { - WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)md; + WeightVGMixModifierData *wmd = (WeightVGMixModifierData *)md; rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name)); } else if (md->type == eModifierType_WeightVGProximity) { - WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*)md; + WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *)md; rna_object_vgroup_name_set(ptr, value, wmd->mask_defgrp_name, sizeof(wmd->mask_defgrp_name)); } } static void rna_WeightVGMixModifier_vgroup2_set(PointerRNA *ptr, const char *value) { - WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)ptr->data; + WeightVGMixModifierData *wmd = (WeightVGMixModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, wmd->defgrp_name_b, sizeof(wmd->defgrp_name_b)); } @@ -446,36 +447,36 @@ static void rna_MappingInfo_uvlayer_set(PointerRNA *ptr, const char *value) static void rna_UVProjectModifier_uvlayer_set(PointerRNA *ptr, const char *value) { - UVProjectModifierData *umd = (UVProjectModifierData*)ptr->data; + UVProjectModifierData *umd = (UVProjectModifierData *)ptr->data; rna_object_uvlayer_name_set(ptr, value, umd->uvlayer_name, sizeof(umd->uvlayer_name)); } static void RNA_WarpModifier_vgroup_set(PointerRNA *ptr, const char *value) { - WarpModifierData *tmd = (WarpModifierData*)ptr->data; + WarpModifierData *tmd = (WarpModifierData *)ptr->data; rna_object_vgroup_name_set(ptr, value, tmd->defgrp_name, sizeof(tmd->defgrp_name)); } static void rna_WeightVGModifier_mask_uvlayer_set(PointerRNA *ptr, const char *value) { - ModifierData *md = (ModifierData*)ptr->data; + ModifierData *md = (ModifierData *)ptr->data; if (md->type == eModifierType_WeightVGEdit) { - WeightVGEditModifierData *wmd = (WeightVGEditModifierData*)md; + WeightVGEditModifierData *wmd = (WeightVGEditModifierData *)md; rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name)); } else if (md->type == eModifierType_WeightVGMix) { - WeightVGMixModifierData *wmd = (WeightVGMixModifierData*)md; + WeightVGMixModifierData *wmd = (WeightVGMixModifierData *)md; rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name)); } else if (md->type == eModifierType_WeightVGProximity) { - WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*)md; + WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *)md; rna_object_uvlayer_name_set(ptr, value, wmd->mask_tex_uvlayer_name, sizeof(wmd->mask_tex_uvlayer_name)); } } static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - MultiresModifierData *mmd = (MultiresModifierData*)ptr->data; + MultiresModifierData *mmd = (MultiresModifierData *)ptr->data; *min = 0; *max = mmd->totlvl; /* intentionally _not_ -1 */ @@ -484,7 +485,7 @@ static void rna_MultiresModifier_level_range(PointerRNA *ptr, int *min, int *max static int rna_MultiresModifier_external_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Mesh *me = ob->data; return CustomData_external_test(&me->ldata, CD_MDISPS); @@ -492,16 +493,16 @@ static int rna_MultiresModifier_external_get(PointerRNA *ptr) static void rna_MultiresModifier_filepath_get(PointerRNA *ptr, char *value) { - Object *ob = (Object*)ptr->id.data; - CustomDataExternal *external = ((Mesh*)ob->data)->ldata.external; + Object *ob = (Object *)ptr->id.data; + CustomDataExternal *external = ((Mesh *)ob->data)->ldata.external; - BLI_strncpy(value, (external)? external->filename: "", sizeof(external->filename)); + BLI_strncpy(value, (external) ? external->filename : "", sizeof(external->filename)); } static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value) { - Object *ob = (Object*)ptr->id.data; - CustomDataExternal *external = ((Mesh*)ob->data)->ldata.external; + Object *ob = (Object *)ptr->id.data; + CustomDataExternal *external = ((Mesh *)ob->data)->ldata.external; if (external && strcmp(external->filename, value)) { BLI_strncpy(external->filename, value, sizeof(external->filename)); @@ -511,10 +512,10 @@ static void rna_MultiresModifier_filepath_set(PointerRNA *ptr, const char *value static int rna_MultiresModifier_filepath_length(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - CustomDataExternal *external = ((Mesh*)ob->data)->ldata.external; + Object *ob = (Object *)ptr->id.data; + CustomDataExternal *external = ((Mesh *)ob->data)->ldata.external; - return strlen((external)? external->filename: ""); + return strlen((external) ? external->filename : ""); } static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRNA value) @@ -531,126 +532,126 @@ static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRN static void rna_LatticeModifier_object_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((LatticeModifierData*)ptr->data)->object, OB_LATTICE, value); + modifier_object_set(ptr->id.data, &((LatticeModifierData *)ptr->data)->object, OB_LATTICE, value); } static void rna_BooleanModifier_object_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((BooleanModifierData*)ptr->data)->object, OB_MESH, value); + modifier_object_set(ptr->id.data, &((BooleanModifierData *)ptr->data)->object, OB_MESH, value); } static void rna_CurveModifier_object_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((CurveModifierData*)ptr->data)->object, OB_CURVE, value); + modifier_object_set(ptr->id.data, &((CurveModifierData *)ptr->data)->object, OB_CURVE, value); } static void rna_CastModifier_object_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((CastModifierData*)ptr->data)->object, OB_EMPTY, value); + modifier_object_set(ptr->id.data, &((CastModifierData *)ptr->data)->object, OB_EMPTY, value); } static void rna_ArmatureModifier_object_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((ArmatureModifierData*)ptr->data)->object, OB_ARMATURE, value); + modifier_object_set(ptr->id.data, &((ArmatureModifierData *)ptr->data)->object, OB_ARMATURE, value); } static void rna_MaskModifier_armature_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((MaskModifierData*)ptr->data)->ob_arm, OB_ARMATURE, value); + modifier_object_set(ptr->id.data, &((MaskModifierData *)ptr->data)->ob_arm, OB_ARMATURE, value); } static void rna_ShrinkwrapModifier_auxiliary_target_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((ShrinkwrapModifierData*)ptr->data)->auxTarget, OB_MESH, value); + modifier_object_set(ptr->id.data, &((ShrinkwrapModifierData *)ptr->data)->auxTarget, OB_MESH, value); } static void rna_ShrinkwrapModifier_target_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((ShrinkwrapModifierData*)ptr->data)->target, OB_MESH, value); + modifier_object_set(ptr->id.data, &((ShrinkwrapModifierData *)ptr->data)->target, OB_MESH, value); } static int rna_ShrinkwrapModifier_face_cull_get(PointerRNA *ptr) { - ShrinkwrapModifierData *swm = (ShrinkwrapModifierData*)ptr->data; - return swm->shrinkOpts & (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE); + ShrinkwrapModifierData *swm = (ShrinkwrapModifierData *)ptr->data; + return swm->shrinkOpts & (MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE | MOD_SHRINKWRAP_CULL_TARGET_BACKFACE); } static void rna_ShrinkwrapModifier_face_cull_set(struct PointerRNA *ptr, int value) { - ShrinkwrapModifierData *swm = (ShrinkwrapModifierData*)ptr->data; + ShrinkwrapModifierData *swm = (ShrinkwrapModifierData *)ptr->data; swm->shrinkOpts = - (swm->shrinkOpts & ~(MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE|MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)) | value; + (swm->shrinkOpts & ~(MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE | MOD_SHRINKWRAP_CULL_TARGET_BACKFACE)) | value; } static void rna_MeshDeformModifier_object_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((MeshDeformModifierData*)ptr->data)->object, OB_MESH, value); + modifier_object_set(ptr->id.data, &((MeshDeformModifierData *)ptr->data)->object, OB_MESH, value); } static void rna_ArrayModifier_end_cap_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((ArrayModifierData*)ptr->data)->end_cap, OB_MESH, value); + modifier_object_set(ptr->id.data, &((ArrayModifierData *)ptr->data)->end_cap, OB_MESH, value); } static void rna_ArrayModifier_start_cap_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((ArrayModifierData*)ptr->data)->start_cap, OB_MESH, value); + modifier_object_set(ptr->id.data, &((ArrayModifierData *)ptr->data)->start_cap, OB_MESH, value); } static void rna_ArrayModifier_curve_set(PointerRNA *ptr, PointerRNA value) { - modifier_object_set(ptr->id.data, &((ArrayModifierData*)ptr->data)->curve_ob, OB_CURVE, value); + modifier_object_set(ptr->id.data, &((ArrayModifierData *)ptr->data)->curve_ob, OB_CURVE, value); } static int rna_MeshDeformModifier_is_bound_get(PointerRNA *ptr) { - return (((MeshDeformModifierData*)ptr->data)->bindcagecos != NULL); + return (((MeshDeformModifierData *)ptr->data)->bindcagecos != NULL); } static PointerRNA rna_SoftBodyModifier_settings_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; return rna_pointer_inherit_refine(ptr, &RNA_SoftBodySettings, ob->soft); } static PointerRNA rna_SoftBodyModifier_point_cache_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; return rna_pointer_inherit_refine(ptr, &RNA_PointCache, ob->soft->pointcache); } static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd); } static PointerRNA rna_UVProjector_object_get(PointerRNA *ptr) { - Object **ob = (Object**)ptr->data; + Object **ob = (Object **)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_Object, *ob); } static void rna_UVProjector_object_set(PointerRNA *ptr, PointerRNA value) { - Object **ob = (Object**)ptr->data; + Object **ob = (Object **)ptr->data; if (*ob) - id_us_min((ID*)*ob); + id_us_min((ID *)*ob); if (value.data) - id_us_plus((ID*)value.data); + id_us_plus((ID *)value.data); *ob = value.data; } static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value) { - UVProjectModifierData *md = (UVProjectModifierData*)ptr->data; + UVProjectModifierData *md = (UVProjectModifierData *)ptr->data; int a; md->num_projectors = CLAMPIS(value, 1, MOD_UVPROJECT_MAX); - for (a = md->num_projectors; anum_projectors; a < MOD_UVPROJECT_MAX; a++) md->projectors[a] = NULL; } @@ -665,16 +666,16 @@ static int rna_OceanModifier_is_build_enabled_get(PointerRNA *UNUSED(ptr)) static void rna_OceanModifier_init_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - OceanModifierData *omd = (OceanModifierData*)ptr->data; + OceanModifierData *omd = (OceanModifierData *)ptr->data; - omd->refresh |= (MOD_OCEAN_REFRESH_RESET|MOD_OCEAN_REFRESH_SIM|MOD_OCEAN_REFRESH_CLEAR_CACHE); + omd->refresh |= (MOD_OCEAN_REFRESH_RESET | MOD_OCEAN_REFRESH_SIM | MOD_OCEAN_REFRESH_CLEAR_CACHE); rna_Modifier_update(bmain, scene, ptr); } static void rna_OceanModifier_sim_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - OceanModifierData *omd = (OceanModifierData*)ptr->data; + OceanModifierData *omd = (OceanModifierData *)ptr->data; omd->refresh |= MOD_OCEAN_REFRESH_SIM; @@ -683,7 +684,7 @@ static void rna_OceanModifier_sim_update(Main *bmain, Scene *scene, PointerRNA * static void rna_OceanModifier_topology_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - OceanModifierData *omd = (OceanModifierData*)ptr->data; + OceanModifierData *omd = (OceanModifierData *)ptr->data; omd->refresh |= MOD_OCEAN_REFRESH_TOPOLOGY; @@ -692,13 +693,13 @@ static void rna_OceanModifier_topology_update(Main *bmain, Scene *scene, Pointer static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value) { - OceanModifierData *omd = (OceanModifierData*)ptr->data; + OceanModifierData *omd = (OceanModifierData *)ptr->data; float old_value = omd->chop_amount; omd->chop_amount = value; if ((old_value == 0.0f && value > 0.0f) || - (old_value > 0.0f && value == 0.0f)) + (old_value > 0.0f && value == 0.0f)) { omd->refresh |= MOD_OCEAN_REFRESH_RESET; omd->refresh |= MOD_OCEAN_REFRESH_CLEAR_CACHE; @@ -707,13 +708,13 @@ static void rna_OceanModifier_ocean_chop_set(PointerRNA *ptr, float value) static float rna_EdgeSplitModifier_split_angle_get(PointerRNA *ptr) { - EdgeSplitModifierData *md = (EdgeSplitModifierData*)ptr->data; + EdgeSplitModifierData *md = (EdgeSplitModifierData *)ptr->data; return DEG2RADF(md->split_angle); } static void rna_EdgeSplitModifier_split_angle_set(PointerRNA *ptr, float value) { - EdgeSplitModifierData *md = (EdgeSplitModifierData*)ptr->data; + EdgeSplitModifierData *md = (EdgeSplitModifierData *)ptr->data; value = RAD2DEGF(value); CLAMP(value, 0.0f, 180.0f); md->split_angle = (int)value; @@ -721,13 +722,13 @@ static void rna_EdgeSplitModifier_split_angle_set(PointerRNA *ptr, float value) static float rna_BevelModifier_angle_limit_get(PointerRNA *ptr) { - BevelModifierData *md = (BevelModifierData*)ptr->data; + BevelModifierData *md = (BevelModifierData *)ptr->data; return DEG2RADF(md->bevel_angle); } static void rna_BevelModifier_angle_limit_set(PointerRNA *ptr, float value) { - BevelModifierData *md = (BevelModifierData*)ptr->data; + BevelModifierData *md = (BevelModifierData *)ptr->data; value = RAD2DEGF(value); CLAMP(value, 0.0f, 180.0f); md->bevel_angle = (int)value; @@ -740,7 +741,8 @@ static void rna_def_property_subdivision_common(StructRNA *srna, const char type static EnumPropertyItem prop_subdivision_type_items[] = { {0, "CATMULL_CLARK", 0, "Catmull-Clark", ""}, {1, "SIMPLE", 0, "Simple", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; PropertyRNA *prop = RNA_def_property(srna, "subdivision_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, type); @@ -789,9 +791,10 @@ static void rna_def_modifier_generic_map_info(StructRNA *srna) {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Local", "Use the local coordinate system for the texture coordinates"}, {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Use the global coordinate system for the texture coordinates"}, {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", - "Use the linked object's local coordinate system for the texture coordinates"}, + "Use the linked object's local coordinate system for the texture coordinates"}, {MOD_DISP_MAP_UV, "UV", 0, "UV", "Use UV coordinates for the texture coordinates"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; PropertyRNA *prop; @@ -815,7 +818,7 @@ static void rna_def_modifier_generic_map_info(StructRNA *srna) prop = RNA_def_property(srna, "texture_coords_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "map_object"); RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Object to set the texture coordinates"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } @@ -825,15 +828,16 @@ static void rna_def_modifier_warp(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_falloff_items[] = { - {eWarp_Falloff_None, "NONE", 0, "No Falloff", ""}, - {eWarp_Falloff_Curve, "CURVE", 0, "Curve", ""}, - {eWarp_Falloff_Smooth, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, - {eWarp_Falloff_Sphere, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, - {eWarp_Falloff_Root, "ROOT", ICON_ROOTCURVE, "Root", ""}, - {eWarp_Falloff_Sharp, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, - {eWarp_Falloff_Linear, "LINEAR", ICON_LINCURVE, "Linear", ""}, - {eWarp_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", ""}, - {0, NULL, 0, NULL, NULL}}; + {eWarp_Falloff_None, "NONE", 0, "No Falloff", ""}, + {eWarp_Falloff_Curve, "CURVE", 0, "Curve", ""}, + {eWarp_Falloff_Smooth, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, + {eWarp_Falloff_Sphere, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, + {eWarp_Falloff_Root, "ROOT", ICON_ROOTCURVE, "Root", ""}, + {eWarp_Falloff_Sharp, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, + {eWarp_Falloff_Linear, "LINEAR", ICON_LINCURVE, "Linear", ""}, + {eWarp_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", ""}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "WarpModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Warp Modifier", "Warp modifier"); @@ -842,12 +846,12 @@ static void rna_def_modifier_warp(BlenderRNA *brna) prop = RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "From", "Object to transform from"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "object_to", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "To", "Object to transform to"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); @@ -954,7 +958,7 @@ static void rna_def_modifier_lattice(BlenderRNA *brna) prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with"); RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL, "rna_Lattice_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); @@ -983,7 +987,8 @@ static void rna_def_modifier_curve(BlenderRNA *brna) {MOD_CURVE_NEGX, "NEG_X", 0, "-X", ""}, {MOD_CURVE_NEGY, "NEG_Y", 0, "-Y", ""}, {MOD_CURVE_NEGZ, "NEG_Z", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "CurveModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Curve Modifier", "Curve deformation modifier"); @@ -993,7 +998,7 @@ static void rna_def_modifier_curve(BlenderRNA *brna) prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Curve object to deform with"); RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL, "rna_Curve_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); @@ -1103,7 +1108,7 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) prop = RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mirror_ob"); RNA_def_property_ui_text(prop, "Mirror Object", "Object to use as mirror"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } @@ -1218,7 +1223,7 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop = RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "objectcenter"); RNA_def_property_ui_text(prop, "Start Position Object", "Object which defines the wave center"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); @@ -1270,7 +1275,7 @@ static void rna_def_modifier_armature(BlenderRNA *brna) prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Armature object to deform with"); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL, "rna_Armature_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE); @@ -1330,7 +1335,7 @@ static void rna_def_modifier_hook(BlenderRNA *brna) prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Parent Object for hook, also recalculates and clears offset"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); @@ -1380,7 +1385,8 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) "Keep the part of the mesh that intersects with the other selected object"}, {eBooleanModifierOp_Union, "UNION", 0, "Union", "Combine two meshes in an additive way"}, {eBooleanModifierOp_Difference, "DIFFERENCE", 0, "Difference", "Combine two meshes in a subtractive way"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "BooleanModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Boolean Modifier", "Boolean operations modifier"); @@ -1390,7 +1396,7 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Mesh object to use for Boolean operation"); RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL, "rna_Mesh_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE); @@ -1409,7 +1415,8 @@ static void rna_def_modifier_array(BlenderRNA *brna) {MOD_ARR_FITLENGTH, "FIT_LENGTH", 0, "Fit Length", "Duplicate the object as many times as fits in a certain length"}, {MOD_ARR_FITCURVE, "FIT_CURVE", 0, "Fit Curve", "Fit the duplicated objects to a curve"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ArrayModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Array Modifier", "Array duplication modifier"); @@ -1439,7 +1446,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "curve_ob"); RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to"); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL, "rna_Curve_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); /* Offset parameters */ @@ -1459,7 +1466,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Relative Offset", "Add an offset relative to the object's bounding box"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - /* PROP_TRANSLATION causes units to be used which we don't want */ + /* PROP_TRANSLATION causes units to be used which we don't want */ prop = RNA_def_property(srna, "relative_offset_displace", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_ui_text(prop, "Relative Offset Displacement", @@ -1495,20 +1502,20 @@ static void rna_def_modifier_array(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object Offset", "Use the location and rotation of another object to determine the distance and " "rotational change between arrayed items"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); /* Caps */ prop = RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap"); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL, "rna_Mesh_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap"); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL, "rna_Mesh_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } @@ -1560,7 +1567,8 @@ static void rna_def_modifier_displace(BlenderRNA *brna) "Use the texture's intensity value to displace in the normal direction"}, {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", "Use the texture's RGB values to displace the mesh in the XYZ direction"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "DisplaceModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Displace Modifier", "Displacement modifier"); @@ -1668,7 +1676,7 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform"); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } @@ -1728,7 +1736,8 @@ static void rna_def_modifier_cast(BlenderRNA *brna) {MOD_CAST_TYPE_SPHERE, "SPHERE", 0, "Sphere", ""}, {MOD_CAST_TYPE_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, {MOD_CAST_TYPE_CUBOID, "CUBOID", 0, "Cuboid", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "CastModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Cast Modifier", "Modifier to cast to other shapes"); @@ -1745,7 +1754,7 @@ static void rna_def_modifier_cast(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect"); RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); @@ -1809,7 +1818,8 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) static EnumPropertyItem prop_mode_items[] = { {0, "VOLUME", 0, "Volume", "Bind to volume inside cage mesh"}, {1, "SURFACE", 0, "Surface", "Bind to surface of cage mesh"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; #endif srna = RNA_def_struct(brna, "MeshDeformModifier", "Modifier"); @@ -1820,7 +1830,7 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with"); RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "is_bound", PROP_BOOLEAN, PROP_NONE); @@ -1896,7 +1906,7 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_ui_text(prop, "Object", "Object that has the particle system"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "particle_system_index", PROP_INT, PROP_NONE); @@ -2047,11 +2057,12 @@ static void rna_def_modifier_smoke(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_smoke_type_items[] = { - {0, "NONE", 0, "None", ""}, - {MOD_SMOKE_TYPE_DOMAIN, "DOMAIN", 0, "Domain", ""}, - {MOD_SMOKE_TYPE_FLOW, "FLOW", 0, "Flow", "Inflow/Outflow"}, - {MOD_SMOKE_TYPE_COLL, "COLLISION", 0, "Collision", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, "NONE", 0, "None", ""}, + {MOD_SMOKE_TYPE_DOMAIN, "DOMAIN", 0, "Domain", ""}, + {MOD_SMOKE_TYPE_FLOW, "FLOW", 0, "Flow", "Inflow/Outflow"}, + {MOD_SMOKE_TYPE_COLL, "COLLISION", 0, "Collision", ""}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SmokeModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Smoke Modifier", "Smoke simulation modifier"); @@ -2131,13 +2142,15 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) {BME_BEVEL_WEIGHT, "WEIGHT", 0, "Weight", "Use bevel weights to determine how much bevel is applied; " "apply them separately in vert/edge select mode"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_edge_weight_method_items[] = { {0, "AVERAGE", 0, "Average", ""}, {BME_BEVEL_EMIN, "SHARPEST", 0, "Sharpest", ""}, {BME_BEVEL_EMAX, "LARGEST", 0, "Largest", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "BevelModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Bevel Modifier", "Bevel modifier to make edges and vertices more rounded"); @@ -2210,13 +2223,15 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) "Shrink the mesh to the nearest target surface along a given axis"}, {MOD_SHRINKWRAP_NEAREST_VERTEX, "NEAREST_VERTEX", 0, "Nearest Vertex", "Shrink the mesh to the nearest target vertex"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem shrink_face_cull_items[] = { {0, "OFF", 0, "Off", "No culling"}, {MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE, "FRONT", 0, "Front", "No projection when in front of the face"}, {MOD_SHRINKWRAP_CULL_TARGET_BACKFACE, "BACK", 0, "Back", "No projection when behind the face"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ShrinkwrapModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Shrinkwrap Modifier", @@ -2242,7 +2257,7 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to"); RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL, "rna_Mesh_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE); @@ -2250,7 +2265,7 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to"); RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL, "rna_Mesh_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); @@ -2330,7 +2345,8 @@ static void rna_def_modifier_mask(BlenderRNA *brna) static EnumPropertyItem modifier_mask_mode_items[] = { {MOD_MASK_MODE_VGROUP, "VERTEX_GROUP", 0, "Vertex Group", ""}, {MOD_MASK_MODE_ARM, "ARMATURE", 0, "Armature", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MaskModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Mask Modifier", "Mask modifier to hide parts of the mesh"); @@ -2346,7 +2362,7 @@ static void rna_def_modifier_mask(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob_arm"); RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask"); RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL, "rna_Armature_object_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); @@ -2372,7 +2388,8 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) {MOD_SIMPLEDEFORM_MODE_TAPER, "TAPER", 0, "Taper", "Linearly scale along Z axis of the modifier space"}, {MOD_SIMPLEDEFORM_MODE_STRETCH, "STRETCH", 0, "Stretch", "Stretch the object along the Z axis of the modifier space"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SimpleDeformModifier", "Modifier"); RNA_def_struct_ui_text(srna, "SimpleDeform Modifier", @@ -2394,7 +2411,7 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) prop = RNA_def_property(srna, "origin", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Origin", "Origin of modifier space coordinates"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "use_relative", PROP_BOOLEAN, PROP_NONE); @@ -2543,7 +2560,8 @@ static void rna_def_modifier_screw(BlenderRNA *brna) {0, "X", 0, "X Axis", ""}, {1, "Y", 0, "Y Axis", ""}, {2, "Z", 0, "Z Axis", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; StructRNA *srna; PropertyRNA *prop; @@ -2556,7 +2574,7 @@ static void rna_def_modifier_screw(BlenderRNA *brna) prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob_axis"); RNA_def_property_ui_text(prop, "Object", "Object to define the screw axis"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "steps", PROP_INT, PROP_UNSIGNED); @@ -2584,7 +2602,7 @@ static void rna_def_modifier_screw(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); - RNA_def_property_ui_range(prop, 0, -M_PI*2, M_PI*2, 2); + RNA_def_property_ui_range(prop, 0, -M_PI * 2, M_PI * 2, 2); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_text(prop, "Angle", "Angle of revolution"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); @@ -2609,10 +2627,12 @@ static void rna_def_modifier_screw(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object Screw", "Use the distance between the objects to make a screw"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - /*prop= RNA_def_property(srna, "use_angle_object", PROP_BOOLEAN, PROP_NONE); +#if 0 + prop= RNA_def_property(srna, "use_angle_object", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_OBJECT_ANGLE); RNA_def_property_ui_text(prop, "Object Angle", "Use the angle between the objects rather than the fixed angle"); - RNA_def_property_update(prop, 0, "rna_Modifier_update");*/ + RNA_def_property_update(prop, 0, "rna_Modifier_update"); +#endif } static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna) @@ -2622,7 +2642,8 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna) {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", "Use global coordinates"}, {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", "Use local generated coordinates of another object"}, {MOD_DISP_MAP_UV, "UV", 0, "UV", "Use coordinates from an UV layer"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem weightvg_mask_tex_used_items[] = { {MOD_WVG_MASK_TEX_USE_INT, "INT", 0, "Intensity", ""}, @@ -2633,7 +2654,8 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna) {MOD_WVG_MASK_TEX_USE_SAT, "SAT", 0, "Saturation", ""}, {MOD_WVG_MASK_TEX_USE_VAL, "VAL", 0, "Value", ""}, {MOD_WVG_MASK_TEX_USE_ALPHA, "ALPHA", 0, "Alpha", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; PropertyRNA *prop; @@ -2662,7 +2684,7 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna) prop = RNA_def_property(srna, "mask_tex_mapping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_mask_tex_map_items); RNA_def_property_ui_text(prop, "Texture Coordinates", "Which texture coordinates " - "to use for mapping"); + "to use for mapping"); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "mask_tex_uv_layer", PROP_STRING, PROP_NONE); @@ -2674,8 +2696,8 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *brna, StructRNA *srna) prop = RNA_def_property(srna, "mask_tex_map_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mask_tex_map_obj"); RNA_def_property_ui_text(prop, "Texture Coordinate Object", "Which object to take texture " - "coordinates from"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + "coordinates from"); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } @@ -2691,7 +2713,8 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""}, {MOD_WVG_MAPPING_STEP, "STEP", ICON_NOCURVE /* Would need a better icon... */, "Median Step", "Map all values below 0.5 to 0.0, and all others to 1.0"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; StructRNA *srna; PropertyRNA *prop; @@ -2716,20 +2739,20 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_add", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_ADD2VG); RNA_def_property_ui_text(prop, "Group Add", "Add vertices with weight over threshold " - "to vgroup"); + "to vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "use_remove", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_REMFVG); RNA_def_property_ui_text(prop, "Group Remove", "Remove vertices with weight below threshold " - "from vgroup"); + "from vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0); RNA_def_property_ui_text(prop, "Default Weight", "Default weight a vertex will have if " - "it is not in the vgroup"); + "it is not in the vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "map_curve", PROP_POINTER, PROP_NONE); @@ -2742,7 +2765,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0); RNA_def_property_ui_text(prop, "Add Threshold", "Lower bound for a vertex's weight " - "to be added to the vgroup"); + "to be added to the vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "remove_threshold", PROP_FLOAT, PROP_NONE); @@ -2750,7 +2773,7 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0); RNA_def_property_ui_text(prop, "Rem Threshold", "Upper bound for a vertex's weight " - "to be removed from the vgroup"); + "to be removed from the vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Common masking properties. */ @@ -2767,7 +2790,8 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna) {MOD_WVG_MIX_DIV, "DIV", 0, "Divide", "Divide VGroup A's weights by VGroup B's ones"}, {MOD_WVG_MIX_DIF, "DIF", 0, "Difference", "Difference between VGroup A's and VGroup B's weigths"}, {MOD_WVG_MIX_AVG, "AVG", 0, "Average", "Average value of VGroup A's and VGroup B's weigths"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem weightvg_mix_set_items[] = { {MOD_WVG_SET_ALL, "ALL", 0, "All", "Affect all vertices (might add some to VGroup A)"}, @@ -2776,7 +2800,8 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna) {MOD_WVG_SET_OR, "OR", 0, "VGroup A or B", "Affect vertices in at least one of both VGroups (might add some to VGroup A)"}, {MOD_WVG_SET_AND, "AND", 0, "VGroup A and B", "Affect vertices in both groups"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; StructRNA *srna; PropertyRNA *prop; @@ -2803,20 +2828,20 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0); RNA_def_property_ui_text(prop, "Default Weight A", "Default weight a vertex will have if " - "it is not in the first A vgroup"); + "it is not in the first A vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "default_weight_b", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0f); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, 0); RNA_def_property_ui_text(prop, "Default Weight B", "Default weight a vertex will have if " - "it is not in the second B vgroup"); + "it is not in the second B vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, weightvg_mix_modes_items); RNA_def_property_ui_text(prop, "Mix Mode", "How weights from vgroup B affect weights " - "of vgroup A"); + "of vgroup A"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "mix_set", PROP_ENUM, PROP_NONE); @@ -2836,13 +2861,15 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) {MOD_WVG_PROXIMITY_GEOMETRY, "GEOMETRY", 0, "Geometry Distance", "Use distance between affected object's vertices and target " "object, or target object's geometry"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem proximity_geometry_items[] = { {MOD_WVG_PROXIMITY_GEOM_VERTS, "VERTEX", ICON_VERTEXSEL, "Vertex", "Compute distance to nearest vertex"}, {MOD_WVG_PROXIMITY_GEOM_EDGES, "EDGE", ICON_EDGESEL, "Edge", "Compute distance to nearest edge"}, {MOD_WVG_PROXIMITY_GEOM_FACES, "FACE", ICON_FACESEL, "Face", "Compute distance to nearest face"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem weightvg_proximity_falloff_type_items[] = { {MOD_WVG_MAPPING_NONE, "LINEAR", ICON_LINCURVE, "Linear", "Null action"}, @@ -2854,7 +2881,8 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) {MOD_WVG_MAPPING_RANDOM, "RANDOM", ICON_RNDCURVE, "Random", ""}, {MOD_WVG_MAPPING_STEP, "STEP", ICON_NOCURVE /* Would need a better icon... */, "Median Step", "Map all values below 0.5 to 0.0, and all others to 1.0"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; StructRNA *srna; PropertyRNA *prop; @@ -2891,7 +2919,7 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "proximity_ob_target"); RNA_def_property_ui_text(prop, "Target Object", "Object to calculate vertices distances from"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop = RNA_def_property(srna, "min_dist", PROP_FLOAT, PROP_DISTANCE); @@ -2922,7 +2950,8 @@ static void rna_def_modifier_remesh(BlenderRNA *brna) {MOD_REMESH_MASS_POINT, "SMOOTH", 0, "Smooth", "Output a smooth surface with no sharp-features detection"}, {MOD_REMESH_SHARP_FEATURES, "SHARP", 0, "Sharp", "Output a surface that reproduces sharp edges and corners from the input mesh"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; StructRNA *srna; PropertyRNA *prop; @@ -2986,7 +3015,8 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) {MOD_OCEAN_GEOM_SIM_ONLY, "SIM_ONLY", 0, "Sim Only", "Leaves geometry unchanged, but still runs simulation (to be used from texture)"}, #endif - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "OceanModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Ocean Modifier", "Simulate an ocean surface"); @@ -3172,7 +3202,7 @@ void RNA_def_modifier(BlenderRNA *brna) prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Modifier_name_set"); RNA_def_property_ui_text(prop, "Name", "Modifier name"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER | NA_RENAME, NULL); RNA_def_struct_name_property(srna, prop); /* enums */ @@ -3194,7 +3224,7 @@ void RNA_def_modifier(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Render); RNA_def_property_ui_text(prop, "Render", "Use modifier during rendering"); RNA_def_property_ui_icon(prop, ICON_SCENE, 0); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); prop = RNA_def_property(srna, "show_in_editmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode); diff --git a/source/blender/makesrna/intern/rna_movieclip.c b/source/blender/makesrna/intern/rna_movieclip.c index 96da24b3392..2cbe6946485 100644 --- a/source/blender/makesrna/intern/rna_movieclip.c +++ b/source/blender/makesrna/intern/rna_movieclip.c @@ -52,7 +52,7 @@ static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - MovieClip *clip = (MovieClip*)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->id.data; BKE_movieclip_reload(clip); DAG_id_tag_update(&clip->id, 0); @@ -60,7 +60,7 @@ static void rna_MovieClip_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene static void rna_MovieClip_size_get(PointerRNA *ptr, int *values) { - MovieClip *clip = (MovieClip*)ptr->id.data; + MovieClip *clip = (MovieClip *)ptr->id.data; values[0] = clip->lastsize[0]; values[1] = clip->lastsize[1]; @@ -82,7 +82,8 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna) "written by recording device"}, {IMB_TC_RECORD_RUN_NO_GAPS, "FREE_RUN_NO_GAPS", 0, "Free Run No Gaps", "Record run, but ignore timecode, changes in framerate or dropouts"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MovieClipProxy", NULL); RNA_def_struct_ui_text(srna, "Movie Clip Proxy", "Proxy parameters for a movie clip"); @@ -158,14 +159,14 @@ static void rna_def_movieclip_proxy(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_items(prop, clip_tc_items); RNA_def_property_ui_text(prop, "Timecode", ""); - RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL); /* directory */ prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "dir"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files"); - RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); + RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update"); } static void rna_def_moviecliUser(BlenderRNA *brna) @@ -179,7 +180,8 @@ static void rna_def_moviecliUser(BlenderRNA *brna) {MCLIP_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "Proxy size 75%", ""}, {MCLIP_PROXY_RENDER_SIZE_100, "PROXY_100", 0, "Proxy size 100%", ""}, {MCLIP_PROXY_RENDER_SIZE_FULL, "FULL", 0, "No proxy, full render", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MovieClipUser", NULL); RNA_def_struct_ui_text(srna, "Movie Clip User", @@ -197,13 +199,13 @@ static void rna_def_moviecliUser(BlenderRNA *brna) RNA_def_property_enum_items(prop, clip_render_size_items); RNA_def_property_ui_text(prop, "Proxy render size", "Draw preview using full resolution or different proxy resolutions"); - RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL); /* render undistorted */ prop = RNA_def_property(srna, "use_render_undistorted", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "render_flag", MCLIP_PROXY_RENDER_UNDISTORT); RNA_def_property_ui_text(prop, "Render Undistorted", "Render preview using undistorted proxy"); - RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL); } static void rna_def_movieClipScopes(BlenderRNA *brna) @@ -223,7 +225,8 @@ static void rna_def_movieclip(BlenderRNA *brna) static EnumPropertyItem clip_source_items[] = { {MCLIP_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"}, {MCLIP_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MovieClip", "ID"); RNA_def_struct_ui_text(srna, "MovieClip", "MovieClip datablock referencing an external movie file"); @@ -232,7 +235,7 @@ static void rna_def_movieclip(BlenderRNA *brna) prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "File Path", "Filename of the movie or sequence file"); - RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); + RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update"); prop = RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "MovieTracking"); @@ -246,7 +249,7 @@ static void rna_def_movieclip(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Use Proxy / Timecode", "Use a preview proxy and/or timecode index for this clip"); - RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL); prop = RNA_def_int_vector(srna, "size", 2, NULL, 0, 0, "Size", "Width and height in pixels, zero when image data cant be loaded", 0, 0); @@ -259,7 +262,7 @@ static void rna_def_movieclip(BlenderRNA *brna) RNA_def_property_range(prop, 0.1f, 5000.0f); RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2); RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this clip, does not affect rendering"); - RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL); /* source */ prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); @@ -273,7 +276,7 @@ static void rna_def_movieclip(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Proxy Custom Directory", "Create proxy images in a custom directory (default is movie location)"); - RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_MovieClip_reload_update"); + RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update"); /* grease pencil */ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 7ad13b8a6d1..edfbf0f2efd 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -52,7 +52,7 @@ #include "ED_anim_api.h" /* temp constant defined for these funcs only... */ -#define NLASTRIP_MIN_LEN_THRESH 0.1f +#define NLASTRIP_MIN_LEN_THRESH 0.1f static void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) { @@ -94,14 +94,14 @@ static char *rna_NlaStrip_path(PointerRNA *ptr) static void rna_NlaStrip_transform_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - NlaStrip *strip = (NlaStrip*)ptr->data; + NlaStrip *strip = (NlaStrip *)ptr->data; BKE_nlameta_flush_transforms(strip); } static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) { - NlaStrip *data = (NlaStrip*)ptr->data; + NlaStrip *data = (NlaStrip *)ptr->data; /* clamp value to lie within valid limits * - cannot start past the end of the strip + some flexibility threshold @@ -112,13 +112,13 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) */ if (data->prev) { if (data->prev->type == NLASTRIP_TYPE_TRANSITION) { - CLAMP(value, data->prev->start+NLASTRIP_MIN_LEN_THRESH, data->end-NLASTRIP_MIN_LEN_THRESH); + CLAMP(value, data->prev->start + NLASTRIP_MIN_LEN_THRESH, data->end - NLASTRIP_MIN_LEN_THRESH); /* readjust the transition to stick to the endpoints of the action-clips */ data->prev->end = value; } else { - CLAMP(value, data->prev->end, data->end-NLASTRIP_MIN_LEN_THRESH); + CLAMP(value, data->prev->end, data->end - NLASTRIP_MIN_LEN_THRESH); } } else { @@ -129,7 +129,7 @@ static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) { - NlaStrip *data = (NlaStrip*)ptr->data; + NlaStrip *data = (NlaStrip *)ptr->data; /* clamp value to lie within valid limits * - must not have zero or negative length strip, so cannot start before the first frame @@ -140,17 +140,17 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) */ if (data->next) { if (data->next->type == NLASTRIP_TYPE_TRANSITION) { - CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->end-NLASTRIP_MIN_LEN_THRESH); + CLAMP(value, data->start + NLASTRIP_MIN_LEN_THRESH, data->next->end - NLASTRIP_MIN_LEN_THRESH); /* readjust the transition to stick to the endpoints of the action-clips */ data->next->start = value; } else { - CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, data->next->start); + CLAMP(value, data->start + NLASTRIP_MIN_LEN_THRESH, data->next->start); } } else { - CLAMP(value, data->start+NLASTRIP_MIN_LEN_THRESH, MAXFRAME); + CLAMP(value, data->start + NLASTRIP_MIN_LEN_THRESH, MAXFRAME); } data->end = value; @@ -170,10 +170,10 @@ static void rna_NlaStrip_end_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value) { - NlaStrip *data = (NlaStrip*)ptr->data; + 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; @@ -183,10 +183,10 @@ static void rna_NlaStrip_scale_set(PointerRNA *ptr, float value) static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value) { - NlaStrip *data = (NlaStrip*)ptr->data; + 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; @@ -196,7 +196,7 @@ static void rna_NlaStrip_repeat_set(PointerRNA *ptr, float value) static void rna_NlaStrip_blend_in_set(PointerRNA *ptr, float value) { - NlaStrip *data = (NlaStrip*)ptr->data; + NlaStrip *data = (NlaStrip *)ptr->data; float len; /* blend-in is limited to the length of the strip, and also cannot overlap with blendout */ @@ -208,7 +208,7 @@ static void rna_NlaStrip_blend_in_set(PointerRNA *ptr, float value) static void rna_NlaStrip_blend_out_set(PointerRNA *ptr, float value) { - NlaStrip *data = (NlaStrip*)ptr->data; + NlaStrip *data = (NlaStrip *)ptr->data; float len; /* blend-out is limited to the length of the strip */ @@ -247,7 +247,7 @@ static int rna_NlaStrip_action_editable(PointerRNA *ptr) static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value) { - NlaStrip *data = (NlaStrip*)ptr->data; + NlaStrip *data = (NlaStrip *)ptr->data; /* prevent start frame from occurring after end of action */ CLAMP(value, MINAFRAME, data->actend); @@ -260,7 +260,7 @@ static void rna_NlaStrip_action_start_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value) { - NlaStrip *data = (NlaStrip*)ptr->data; + NlaStrip *data = (NlaStrip *)ptr->data; /* prevent end frame from starting before start of action */ CLAMP(value, data->actstart, MAXFRAME); @@ -272,7 +272,7 @@ static void rna_NlaStrip_action_end_frame_set(PointerRNA *ptr, float value) static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value) { - NlaStrip *data = (NlaStrip*)ptr->data; + NlaStrip *data = (NlaStrip *)ptr->data; if (value) { /* set the flag, then make sure a curve for this exists */ @@ -285,7 +285,7 @@ static void rna_NlaStrip_animated_influence_set(PointerRNA *ptr, int value) static void rna_NlaStrip_animated_time_set(PointerRNA *ptr, int value) { - NlaStrip *data = (NlaStrip*)ptr->data; + NlaStrip *data = (NlaStrip *)ptr->data; if (value) { /* set the flag, then make sure a curve for this exists */ @@ -318,7 +318,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo /* create dummy AnimData block so that BKE_nlastrip_validate_name() * can be used to ensure a valid name, as we don't have one here... - * - only the nla_tracks list is needed there, which we aim to reverse engineer here... + * - only the nla_tracks list is needed there, which we aim to reverse engineer here... */ { AnimData adt = {NULL}; @@ -340,7 +340,7 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo BKE_nlastrip_validate_name(&adt, strip); } - WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_ADDED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); return strip; } @@ -353,7 +353,7 @@ static void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *report } else { free_nlastrip(&track->strips, strip); - WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_REMOVED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_REMOVED, NULL); } } @@ -374,20 +374,22 @@ EnumPropertyItem nla_mode_extend_items[] = { {NLASTRIP_EXTEND_HOLD, "HOLD", 0, "Hold", "Hold the first frame if no previous strips in track, and always hold last frame"}, {NLASTRIP_EXTEND_HOLD_FORWARD, "HOLD_FORWARD", 0, "Hold Forward", "Only hold last frame"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static void rna_def_nlastrip(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - /* enum defs */ + /* enum defs */ static EnumPropertyItem prop_type_items[] = { {NLASTRIP_TYPE_CLIP, "CLIP", 0, "Action Clip", "NLA Strip references some Action"}, {NLASTRIP_TYPE_TRANSITION, "TRANSITION", 0, "Transition", "NLA Strip 'transitions' between adjacent strips"}, {NLASTRIP_TYPE_META, "META", 0, "Meta", "NLA Strip acts as a container for adjacent strips"}, {NLASTRIP_TYPE_SOUND, "SOUND", 0, "Sound Clip", "NLA Strip representing a sound event for speakers"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; /* struct definition */ srna = RNA_def_struct(brna, "NlaStrip", NULL); @@ -400,7 +402,7 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Name", ""); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_NlaStrip_name_set"); RNA_def_struct_name_property(srna, prop); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ /* Enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); @@ -408,19 +410,19 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* XXX for now, not editable, since this is dangerous */ RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Type of NLA Strip"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "extendmode"); RNA_def_property_enum_items(prop, nla_mode_extend_items); RNA_def_property_ui_text(prop, "Extrapolation", "Action to take for gaps past the strip extents"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "blendmode"); RNA_def_property_enum_items(prop, nla_mode_blend_items); RNA_def_property_ui_text(prop, "Blending", "Method used for combining strip's result with accumulated result"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ /* Strip extents */ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME); @@ -440,61 +442,61 @@ static void rna_def_nlastrip(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "blendin"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_in_set", NULL); RNA_def_property_ui_text(prop, "Blend In", "Number of frames at start of strip to fade in influence"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "blend_out", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blendout"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_blend_out_set", NULL); RNA_def_property_ui_text(prop, "Blend Out", ""); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "use_auto_blend", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_AUTO_BLENDS); RNA_def_property_ui_text(prop, "Auto Blend In/Out", "Number of frames for Blending In/Out is automatically determined from " "overlapping strips"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ /* Action */ prop = RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act"); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_REFCOUNT); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT); RNA_def_property_editable_func(prop, "rna_NlaStrip_action_editable"); RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ /* Action extents */ prop = RNA_def_property(srna, "action_frame_start", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "actstart"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_start_frame_set", NULL); RNA_def_property_ui_text(prop, "Action Start Frame", ""); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "action_frame_end", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "actend"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_action_end_frame_set", NULL); RNA_def_property_ui_text(prop, "Action End Frame", ""); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ /* Action Reuse */ prop = RNA_def_property(srna, "repeat", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "repeat"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL); - /* these limits have currently be chosen arbitarily, but could be extended - * (minimum should still be > 0 though) if needed... */ + /* these limits have currently be chosen arbitarily, but could be extended + * (minimum should still be > 0 though) if needed... */ RNA_def_property_range(prop, 0.1f, 1000.0f); RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the action range"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_scale_set", NULL); - /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs - * due to numeric errors */ + /* these limits can be extended, but beyond this, we can get some crazy+annoying bugs + * due to numeric errors */ RNA_def_property_range(prop, 0.0001f, 1000.0f); RNA_def_property_ui_text(prop, "Scale", "Scaling factor for action"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ /* Strip's F-Curves */ prop = RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE); @@ -516,26 +518,26 @@ static void rna_def_nlastrip(BlenderRNA *brna) prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Influence", "Amount the strip contributes to the current result"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ 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"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ - /* TODO: should the animated_influence/time settings be animatable themselves? */ + /* TODO: should the animated_influence/time settings be animatable themselves? */ prop = RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_INFLUENCE); RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_influence_set"); RNA_def_property_ui_text(prop, "Animated Influence", "Influence setting is controlled by an F-Curve rather than automatically determined"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "use_animated_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME); RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set"); RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "use_animated_time_cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC); @@ -544,28 +546,28 @@ static void rna_def_nlastrip(BlenderRNA *brna) /* settings */ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); - /* can be made editable by hooking it up to the necessary NLA API methods */ + /* can be made editable by hooking it up to the necessary NLA API methods */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_ACTIVE); RNA_def_property_ui_text(prop, "Active", "NLA Strip is active"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_SELECT); RNA_def_property_ui_text(prop, "Select", "NLA Strip is selected"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_MUTED); RNA_def_property_ui_text(prop, "Muted", "NLA Strip is not evaluated"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "use_reverse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_REVERSE); RNA_def_property_ui_text(prop, "Reversed", "NLA Strip is played back in reverse order (only when timing is " "automatically determined)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ /* TODO: */ /* - sync length */ @@ -583,7 +585,7 @@ static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_ui_text(srna, "Nla Strips", "Collection of Nla Strips"); func = RNA_def_function(srna, "new", "rna_NlaStrip_new"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add a new Action-Clip strip to the track"); parm = RNA_def_string(func, "name", "NlaStrip", 0, "", "Name for the NLA Strips"); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -591,16 +593,16 @@ static void rna_api_nlatrack_strips(BlenderRNA *brna, PropertyRNA *cprop) "Start frame for this strip", INT_MIN, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_pointer(func, "action", "Action", "", "Action to assign to this strip"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); /* return type */ parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "New NLA Strip"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_NlaStrip_remove"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove a NLA Strip"); parm = RNA_def_pointer(func, "strip", "NlaStrip", "", "NLA Strip to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } static void rna_def_nlatrack(BlenderRNA *brna) @@ -623,39 +625,39 @@ static void rna_def_nlatrack(BlenderRNA *brna) prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ /* settings */ prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); - /* can be made editable by hooking it up to the necessary NLA API methods */ + /* can be made editable by hooking it up to the necessary NLA API methods */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_ACTIVE); RNA_def_property_ui_text(prop, "Active", "NLA Track is active"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "is_solo", PROP_BOOLEAN, PROP_NONE); - /* can be made editable by hooking it up to the necessary NLA API methods */ + /* can be made editable by hooking it up to the necessary NLA API methods */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SOLO); RNA_def_property_ui_text(prop, "Solo", "NLA Track is evaluated itself (i.e. active Action and all other NLA Tracks in the " "same AnimData block are disabled)"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_SELECTED); RNA_def_property_ui_text(prop, "Select", "NLA Track is selected"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_MUTED); RNA_def_property_ui_text(prop, "Muted", "NLA Track is not evaluated"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", NLATRACK_PROTECTED); RNA_def_property_ui_text(prop, "Locked", "NLA Track is locked"); - RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA, NULL); /* this will do? */ } /* --------- */ diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 2472e7613ad..21c9187cbb8 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -66,7 +66,8 @@ EnumPropertyItem object_mode_items[] = { {OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""}, {OB_MODE_PARTICLE_EDIT, "PARTICLE_EDIT", ICON_PARTICLEMODE, "Particle Edit", ""}, {OB_MODE_POSE, "POSE", ICON_POSE_HLT, "Pose", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static EnumPropertyItem parent_type_items[] = { {PAROBJECT, "OBJECT", 0, "Object", "The object is parented to an object"}, @@ -77,7 +78,8 @@ static EnumPropertyItem parent_type_items[] = { {PARVERT1, "VERTEX", 0, "Vertex", "The object is parented to a vertex"}, {PARVERT3, "VERTEX_3", 0, "3 Vertices", ""}, {PARBONE, "BONE", 0, "Bone", "The object is parented to a bone"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static EnumPropertyItem collision_bounds_items[] = { {OB_BOUND_BOX, "BOX", 0, "Box", ""}, @@ -88,7 +90,8 @@ static EnumPropertyItem collision_bounds_items[] = { {OB_BOUND_TRIANGLE_MESH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""}, {OB_BOUND_CAPSULE, "CAPSULE", 0, "Capsule", ""}, /*{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""}, */ - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem metaelem_type_items[] = { {MB_BALL, "BALL", ICON_META_BALL, "Ball", ""}, @@ -96,7 +99,8 @@ EnumPropertyItem metaelem_type_items[] = { {MB_PLANE, "PLANE", ICON_META_PLANE, "Plane", ""}, {MB_ELIPSOID, "ELLIPSOID", ICON_META_ELLIPSOID, "Ellipsoid", ""}, /* NOTE: typo at original definition! */ {MB_CUBE, "CUBE", ICON_META_CUBE, "Cube", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; /* used for 2 enums */ #define OBTYPE_CU_CURVE {OB_CURVE, "CURVE", 0, "Curve", ""} @@ -117,13 +121,15 @@ EnumPropertyItem object_type_items[] = { {OB_CAMERA, "CAMERA", 0, "Camera", ""}, {OB_LAMP, "LAMP", 0, "Lamp", ""}, {OB_SPEAKER, "SPEAKER", 0, "Speaker", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem object_type_curve_items[] = { OBTYPE_CU_CURVE, OBTYPE_CU_SURF, OBTYPE_CU_FONT, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -217,7 +223,7 @@ static void rna_Object_matrix_basis_set(PointerRNA *ptr, const float values[16]) void rna_Object_internal_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->id.data); } void rna_Object_active_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -230,8 +236,8 @@ void rna_Object_active_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) case OB_MESH: EDBM_mesh_load(ob); EDBM_mesh_make(scene->toolsettings, scene, ob); - EDBM_mesh_normals_update(((Mesh*)ob->data)->edit_btmesh); - BMEdit_RecalcTessellation(((Mesh*)ob->data)->edit_btmesh); + EDBM_mesh_normals_update(((Mesh *)ob->data)->edit_btmesh); + BMEdit_RecalcTessellation(((Mesh *)ob->data)->edit_btmesh); break; case OB_CURVE: case OB_SURF: @@ -254,14 +260,14 @@ static void rna_Object_dependency_update(Main *bmain, Scene *scene, PointerRNA * if (scene) { DAG_scene_sort(bmain, scene); } - WM_main_add_notifier(NC_OBJECT|ND_PARENT, ptr->id.data); + WM_main_add_notifier(NC_OBJECT | ND_PARENT, ptr->id.data); } /* when changing the selection flag the scene needs updating */ static void rna_Object_select_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { if (scene) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; short mode = ob->flag & SELECT ? BA_SELECT : BA_DESELECT; ED_base_object_select(BKE_scene_base_find(scene, ob), mode); } @@ -269,7 +275,7 @@ static void rna_Object_select_update(Main *UNUSED(bmain), Scene *scene, PointerR static void rna_Base_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Base *base = (Base*)ptr->data; + Base *base = (Base *)ptr->data; short mode = base->flag & BA_SELECT ? BA_SELECT : BA_DESELECT; ED_base_object_select(base, mode); } @@ -281,7 +287,7 @@ static void rna_Object_layer_update__internal(Main *bmain, Scene *scene, Base *b /* pass - unlikely but when running scripts on startup it happens */ } else if ((ob->lay & scene->lay) && (base->lay & scene->lay)) { - /* pass */ + /* pass */ } else if ((ob->lay & scene->lay) == 0 && (base->lay & scene->lay) == 0) { /* pass */ @@ -295,7 +301,7 @@ static void rna_Object_layer_update__internal(Main *bmain, Scene *scene, Base *b static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Base *base; base = scene ? BKE_scene_base_find(scene, ob) : NULL; @@ -307,23 +313,23 @@ static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) rna_Object_layer_update__internal(bmain, scene, base, ob); ob->lay = base->lay; - WM_main_add_notifier(NC_SCENE|ND_LAYER_CONTENT, scene); + WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, scene); } static void rna_Base_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Base *base = (Base*)ptr->data; - Object *ob = (Object*)base->object; + Base *base = (Base *)ptr->data; + Object *ob = (Object *)base->object; rna_Object_layer_update__internal(bmain, scene, base, ob); ob->lay = base->lay; - WM_main_add_notifier(NC_SCENE|ND_LAYER_CONTENT, scene); + WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, scene); } static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object*)ptr->data; + Object *ob = (Object *)ptr->data; ID *id = value.data; if (id == NULL || ob->mode & OB_MODE_EDIT) @@ -331,7 +337,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value) if (ob->type == OB_EMPTY) { if (ob->data) { - id_us_min((ID*)ob->data); + id_us_min((ID *)ob->data); ob->data = NULL; } @@ -341,11 +347,11 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value) } } else if (ob->type == OB_MESH) { - set_mesh(ob, (Mesh*)id); + set_mesh(ob, (Mesh *)id); } else { if (ob->data) - id_us_min((ID*)ob->data); + id_us_min((ID *)ob->data); if (id) id_us_plus(id); @@ -361,7 +367,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value) static StructRNA *rna_Object_data_typef(PointerRNA *ptr) { - Object *ob = (Object*)ptr->data; + Object *ob = (Object *)ptr->data; switch (ob->type) { case OB_EMPTY: return &RNA_Image; @@ -381,8 +387,8 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr) static void rna_Object_parent_set(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object*)ptr->data; - Object *par = (Object*)value.data; + Object *ob = (Object *)ptr->data; + Object *par = (Object *)value.data; #ifdef FREE_WINDOWS /* NOTE: this dummy check here prevents this method causing weird runtime errors on mingw 4.6.2 */ @@ -395,7 +401,7 @@ static void rna_Object_parent_set(PointerRNA *ptr, PointerRNA value) static void rna_Object_parent_type_set(PointerRNA *ptr, int value) { - Object *ob = (Object*)ptr->data; + Object *ob = (Object *)ptr->data; ED_object_parent(ob, ob->parent, value, ob->parsubstr); } @@ -403,7 +409,7 @@ static void rna_Object_parent_type_set(PointerRNA *ptr, int value) static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) { - Object *ob = (Object*)ptr->data; + Object *ob = (Object *)ptr->data; EnumPropertyItem *item = NULL; int totitem = 0; @@ -437,7 +443,7 @@ static EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C), Point static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) { - Object *ob = (Object*)ptr->data; + Object *ob = (Object *)ptr->data; EnumPropertyItem *item = NULL; int totitem = 0; @@ -460,7 +466,7 @@ static EnumPropertyItem *rna_Object_collision_bounds_itemf(bContext *UNUSED(C), static void rna_Object_parent_bone_set(PointerRNA *ptr, const char *value) { - Object *ob = (Object*)ptr->data; + Object *ob = (Object *)ptr->data; ED_object_parent(ob, ob->parent, ob->partype, value); } @@ -490,44 +496,44 @@ void rna_VertexGroup_name_set(PointerRNA *ptr, const char *value) static int rna_VertexGroup_index_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; return BLI_findindex(&ob->defbase, ptr->data); } static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef-1)); + Object *ob = (Object *)ptr->id.data; + return rna_pointer_inherit_refine(ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef - 1)); } static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - return ob->actdef-1; + Object *ob = (Object *)ptr->id.data; + return ob->actdef - 1; } static void rna_Object_active_vertex_group_index_set(PointerRNA *ptr, int value) { - Object *ob = (Object*)ptr->id.data; - ob->actdef = value+1; + Object *ob = (Object *)ptr->id.data; + ob->actdef = value + 1; } static void rna_Object_active_vertex_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; *min = 0; - *max = BLI_countlist(&ob->defbase)-1; + *max = BLI_countlist(&ob->defbase) - 1; *max = MAX2(0, *max); } void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; bDeformGroup *dg; - dg = BLI_findlink(&ob->defbase, index-1); + dg = BLI_findlink(&ob->defbase, index - 1); if (dg) BLI_strncpy(value, dg->name, sizeof(dg->name)); else value[0] = '\0'; @@ -535,22 +541,22 @@ void rna_object_vgroup_name_index_get(PointerRNA *ptr, char *value, int index) int rna_object_vgroup_name_index_length(PointerRNA *ptr, int index) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; bDeformGroup *dg; - dg = BLI_findlink(&ob->defbase, index-1); - return (dg)? strlen(dg->name): 0; + dg = BLI_findlink(&ob->defbase, index - 1); + return (dg) ? strlen(dg->name) : 0; } void rna_object_vgroup_name_index_set(PointerRNA *ptr, const char *value, short *index) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; *index = defgroup_name_index(ob, value) + 1; } void rna_object_vgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; bDeformGroup *dg = defgroup_find_name(ob, value); if (dg) { BLI_strncpy(result, value, maxlen); /* no need for BLI_strncpy_utf8, since this matches an existing group */ @@ -562,15 +568,15 @@ void rna_object_vgroup_name_set(PointerRNA *ptr, const char *value, char *result void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Mesh *me; CustomDataLayer *layer; int a; if (ob->type == OB_MESH && ob->data) { - me = (Mesh*)ob->data; + me = (Mesh *)ob->data; - for (a = 0; apdata.totlayer; a++) { + for (a = 0; a < me->pdata.totlayer; a++) { layer = &me->pdata.layers[a]; if (layer->type == CD_MTEXPOLY && strcmp(layer->name, value) == 0) { @@ -585,15 +591,15 @@ void rna_object_uvlayer_name_set(PointerRNA *ptr, const char *value, char *resul void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Mesh *me; CustomDataLayer *layer; int a; if (ob->type == OB_MESH && ob->data) { - me = (Mesh*)ob->data; + me = (Mesh *)ob->data; - for (a = 0; afdata.totlayer; a++) { + for (a = 0; a < me->fdata.totlayer; a++) { layer = &me->fdata.layers[a]; if (layer->type == CD_MCOL && strcmp(layer->name, value) == 0) { @@ -608,14 +614,14 @@ void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *res static int rna_Object_active_material_index_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; return MAX2(ob->actcol - 1, 0); } static void rna_Object_active_material_index_set(PointerRNA *ptr, int value) { - Object *ob = (Object*)ptr->id.data; - ob->actcol = value+1; + Object *ob = (Object *)ptr->id.data; + ob->actcol = value + 1; if (ob->type == OB_MESH) { Mesh *me = ob->data; @@ -627,24 +633,24 @@ static void rna_Object_active_material_index_set(PointerRNA *ptr, int value) static void rna_Object_active_material_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; *min = 0; - *max = MAX2(ob->totcol-1, 0); + *max = MAX2(ob->totcol - 1, 0); } /* returns active base material */ static PointerRNA rna_Object_active_material_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Material *ma; - ma = (ob->totcol)? give_current_material(ob, ob->actcol): NULL; + ma = (ob->totcol) ? give_current_material(ob, ob->actcol) : NULL; return rna_pointer_inherit_refine(ptr, &RNA_Material, ma); } static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; DAG_id_tag_update(value.data, 0); assign_material(ob, value.data, ob->actcol); @@ -653,27 +659,27 @@ static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value) static void rna_Object_active_particle_system_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; *min = 0; - *max = BLI_countlist(&ob->particlesystem)-1; + *max = BLI_countlist(&ob->particlesystem) - 1; *max = MAX2(0, *max); } static int rna_Object_active_particle_system_index_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; return psys_get_current_num(ob); } static void rna_Object_active_particle_system_index_set(PointerRNA *ptr, int value) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; psys_set_current_num(ob, value); } static void rna_Object_particle_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; PE_current_changed(scene, ob); } @@ -791,34 +797,34 @@ static int rna_Object_rotation_4d_editable(PointerRNA *ptr, int index) static PointerRNA rna_MaterialSlot_material_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Material *ma; - int index = (Material**)ptr->data - ob->mat; + int index = (Material **)ptr->data - ob->mat; - ma = give_current_material(ob, index+1); + ma = give_current_material(ob, index + 1); return rna_pointer_inherit_refine(ptr, &RNA_Material, ma); } static void rna_MaterialSlot_material_set(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object*)ptr->id.data; - int index = (Material**)ptr->data - ob->mat; + Object *ob = (Object *)ptr->id.data; + int index = (Material **)ptr->data - ob->mat; - assign_material(ob, value.data, index+1); + assign_material(ob, value.data, index + 1); } static int rna_MaterialSlot_link_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - int index = (Material**)ptr->data - ob->mat; + Object *ob = (Object *)ptr->id.data; + int index = (Material **)ptr->data - ob->mat; return ob->matbits[index] != 0; } static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value) { - Object *ob = (Object*)ptr->id.data; - int index = (Material**)ptr->data - ob->mat; + Object *ob = (Object *)ptr->id.data; + int index = (Material **)ptr->data - ob->mat; if (value) { ob->matbits[index] = 1; @@ -832,28 +838,28 @@ static void rna_MaterialSlot_link_set(PointerRNA *ptr, int value) static int rna_MaterialSlot_name_length(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Material *ma; - int index = (Material**)ptr->data - ob->mat; + int index = (Material **)ptr->data - ob->mat; - ma = give_current_material(ob, index+1); + ma = give_current_material(ob, index + 1); if (ma) - return strlen(ma->id.name+2); + return strlen(ma->id.name + 2); return 0; } static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *str) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Material *ma; - int index = (Material**)ptr->data - ob->mat; + int index = (Material **)ptr->data - ob->mat; - ma = give_current_material(ob, index+1); + ma = give_current_material(ob, index + 1); if (ma) - strcpy(str, ma->id.name+2); + strcpy(str, ma->id.name + 2); else str[0] = '\0'; } @@ -861,7 +867,7 @@ static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *str) static void rna_MaterialSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr) { rna_Object_internal_update(bmain, scene, ptr); - WM_main_add_notifier(NC_OBJECT|ND_OB_SHADING, ptr->id.data); + WM_main_add_notifier(NC_OBJECT | ND_OB_SHADING, ptr->id.data); } /* why does this have to be so complicated?, can't all this crap be @@ -871,7 +877,7 @@ static void rna_MaterialSlot_update(Main *bmain, Scene *scene, PointerRNA *ptr) * */ static int rna_GameObjectSettings_physics_type_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; /* determine the body_type setting based on flags */ if (!(ob->gameflag & OB_COLLISION)) { @@ -891,7 +897,7 @@ static int rna_GameObjectSettings_physics_type_get(PointerRNA *ptr) else if (!(ob->gameflag & OB_DYNAMIC)) { ob->body_type = OB_BODY_TYPE_STATIC; } - else if (!(ob->gameflag & (OB_RIGID_BODY|OB_SOFT_BODY))) { + else if (!(ob->gameflag & (OB_RIGID_BODY | OB_SOFT_BODY))) { ob->body_type = OB_BODY_TYPE_DYNAMIC; } else if (ob->gameflag & OB_RIGID_BODY) { @@ -909,58 +915,58 @@ static int rna_GameObjectSettings_physics_type_get(PointerRNA *ptr) static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; const int was_navmesh = (ob->gameflag & OB_NAVMESH); ob->body_type = value; switch (ob->body_type) { - case OB_BODY_TYPE_SENSOR: - ob->gameflag |= OB_SENSOR | OB_COLLISION | OB_GHOST; - ob->gameflag &= ~(OB_OCCLUDER | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_ACTOR | - OB_ANISOTROPIC_FRICTION | OB_DO_FH | OB_ROT_FH | OB_COLLISION_RESPONSE | OB_NAVMESH); - break; - case OB_BODY_TYPE_OCCLUDER: - ob->gameflag |= OB_OCCLUDER; - ob->gameflag &= ~(OB_SENSOR|OB_RIGID_BODY|OB_SOFT_BODY|OB_COLLISION|OB_DYNAMIC|OB_NAVMESH); - break; - case OB_BODY_TYPE_NAVMESH: - ob->gameflag |= OB_NAVMESH; - ob->gameflag &= ~(OB_SENSOR|OB_RIGID_BODY|OB_SOFT_BODY|OB_COLLISION|OB_DYNAMIC|OB_OCCLUDER); - - if (ob->type == OB_MESH) { - /* could be moved into mesh UI but for now ensure mesh data layer */ - BKE_mesh_ensure_navmesh(ob->data); - } + case OB_BODY_TYPE_SENSOR: + ob->gameflag |= OB_SENSOR | OB_COLLISION | OB_GHOST; + ob->gameflag &= ~(OB_OCCLUDER | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_ACTOR | + OB_ANISOTROPIC_FRICTION | OB_DO_FH | OB_ROT_FH | OB_COLLISION_RESPONSE | OB_NAVMESH); + break; + case OB_BODY_TYPE_OCCLUDER: + ob->gameflag |= OB_OCCLUDER; + ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_DYNAMIC | OB_NAVMESH); + break; + case OB_BODY_TYPE_NAVMESH: + ob->gameflag |= OB_NAVMESH; + ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_DYNAMIC | OB_OCCLUDER); + + if (ob->type == OB_MESH) { + /* could be moved into mesh UI but for now ensure mesh data layer */ + BKE_mesh_ensure_navmesh(ob->data); + } - break; - case OB_BODY_TYPE_NO_COLLISION: - ob->gameflag &= ~(OB_SENSOR|OB_RIGID_BODY|OB_SOFT_BODY|OB_COLLISION|OB_OCCLUDER|OB_DYNAMIC|OB_NAVMESH); - break; - case OB_BODY_TYPE_STATIC: - ob->gameflag |= OB_COLLISION; - ob->gameflag &= ~(OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH); - break; - case OB_BODY_TYPE_DYNAMIC: - ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_ACTOR; - ob->gameflag &= ~(OB_RIGID_BODY|OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH); - break; - case OB_BODY_TYPE_RIGID: - ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_RIGID_BODY|OB_ACTOR; - ob->gameflag &= ~(OB_SOFT_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH); - break; - default: - case OB_BODY_TYPE_SOFT: - ob->gameflag |= OB_COLLISION|OB_DYNAMIC|OB_SOFT_BODY|OB_ACTOR; - ob->gameflag &= ~(OB_RIGID_BODY|OB_OCCLUDER|OB_SENSOR|OB_NAVMESH); - - /* assume triangle mesh, if no bounds chosen for soft body */ - if ((ob->gameflag & OB_BOUNDS) && (ob->boundtypeboundtype = OB_BOUND_TRIANGLE_MESH; - } - /* create a BulletSoftBody structure if not already existing */ - if (!ob->bsoft) - ob->bsoft = bsbNew(); - break; + break; + case OB_BODY_TYPE_NO_COLLISION: + ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_OCCLUDER | OB_DYNAMIC | OB_NAVMESH); + break; + case OB_BODY_TYPE_STATIC: + ob->gameflag |= OB_COLLISION; + ob->gameflag &= ~(OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_OCCLUDER | OB_SENSOR | OB_NAVMESH); + break; + case OB_BODY_TYPE_DYNAMIC: + ob->gameflag |= OB_COLLISION | OB_DYNAMIC | OB_ACTOR; + ob->gameflag &= ~(OB_RIGID_BODY | OB_SOFT_BODY | OB_OCCLUDER | OB_SENSOR | OB_NAVMESH); + break; + case OB_BODY_TYPE_RIGID: + ob->gameflag |= OB_COLLISION | OB_DYNAMIC | OB_RIGID_BODY | OB_ACTOR; + ob->gameflag &= ~(OB_SOFT_BODY | OB_OCCLUDER | OB_SENSOR | OB_NAVMESH); + break; + default: + case OB_BODY_TYPE_SOFT: + ob->gameflag |= OB_COLLISION | OB_DYNAMIC | OB_SOFT_BODY | OB_ACTOR; + ob->gameflag &= ~(OB_RIGID_BODY | OB_OCCLUDER | OB_SENSOR | OB_NAVMESH); + + /* assume triangle mesh, if no bounds chosen for soft body */ + if ((ob->gameflag & OB_BOUNDS) && (ob->boundtype < OB_BOUND_TRIANGLE_MESH)) { + ob->boundtype = OB_BOUND_TRIANGLE_MESH; + } + /* create a BulletSoftBody structure if not already existing */ + if (!ob->bsoft) + ob->bsoft = bsbNew(); + break; } if (was_navmesh != (ob->gameflag & OB_NAVMESH)) { @@ -970,12 +976,12 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value) } } - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ptr->id.data); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ptr->id.data); } static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; ParticleSystem *psys = psys_get_current(ob); return rna_pointer_inherit_refine(ptr, &RNA_ParticleSystem, psys); } @@ -991,16 +997,16 @@ static unsigned int rna_Object_layer_validate__internal(const int *values, unsig int i, tot = 0; /* ensure we always have some layer selected */ - for (i = 0; i<20; i++) + for (i = 0; i < 20; i++) if (values[i]) tot++; if (tot == 0) return 0; - for (i = 0; i<20; i++) { - if (values[i]) lay |= (1<data; + Object *ob = (Object *)ptr->data; unsigned int lay; lay = rna_Object_layer_validate__internal(values, ob->lay); @@ -1018,7 +1024,7 @@ static void rna_Object_layer_set(PointerRNA *ptr, const int *values) static void rna_Base_layer_set(PointerRNA *ptr, const int *values) { - Base *base = (Base*)ptr->data; + Base *base = (Base *)ptr->data; unsigned int lay; lay = rna_Object_layer_validate__internal(values, base->lay); @@ -1030,45 +1036,45 @@ static void rna_Base_layer_set(PointerRNA *ptr, const int *values) static void rna_GameObjectSettings_state_get(PointerRNA *ptr, int *values) { - Object *ob = (Object*)ptr->data; + Object *ob = (Object *)ptr->data; int i; - int all_states = (ob->scaflag & OB_ALLSTATE?1:0); + int all_states = (ob->scaflag & OB_ALLSTATE ? 1 : 0); - memset(values, 0, sizeof(int)*OB_MAX_STATES); - for (i = 0; istate & (1<state & (1 << i)) | all_states; } static void rna_GameObjectSettings_state_set(PointerRNA *ptr, const int *values) { - Object *ob = (Object*)ptr->data; + Object *ob = (Object *)ptr->data; int i, tot = 0; /* ensure we always have some state selected */ - for (i = 0; istate |= (1<state &= ~(1<state |= (1 << i); + else ob->state &= ~(1 << i); } } static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values) { - Object *ob = (Object*)ptr->data; + Object *ob = (Object *)ptr->data; bController *cont; - memset(values, 0, sizeof(int)*OB_MAX_STATES); + memset(values, 0, sizeof(int) * OB_MAX_STATES); for (cont = ob->controllers.first; cont; cont = cont->next) { int i; - for (i = 0; istate_mask & (1<state_mask & (1 << i)) values[i] = 1; } } @@ -1076,12 +1082,12 @@ static void rna_GameObjectSettings_used_state_get(PointerRNA *ptr, int *values) static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Key *key = ob_get_key(ob); *min = 0; if (key) { - *max = BLI_countlist(&key->block)-1; + *max = BLI_countlist(&key->block) - 1; if (*max < 0) *max = 0; } else { @@ -1091,21 +1097,21 @@ static void rna_Object_active_shape_key_index_range(PointerRNA *ptr, int *min, i static int rna_Object_active_shape_key_index_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; - return MAX2(ob->shapenr-1, 0); + return MAX2(ob->shapenr - 1, 0); } static void rna_Object_active_shape_key_index_set(PointerRNA *ptr, int value) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; - ob->shapenr = value+1; + ob->shapenr = value + 1; } static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; Key *key = ob_get_key(ob); KeyBlock *kb; PointerRNA keyptr; @@ -1113,14 +1119,14 @@ static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr) if (key == NULL) return PointerRNA_NULL; - kb = BLI_findlink(&key->block, ob->shapenr-1); + kb = BLI_findlink(&key->block, ob->shapenr - 1); RNA_pointer_create((ID *)key, &RNA_ShapeKey, kb, &keyptr); return keyptr; } static PointerRNA rna_Object_field_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; /* weak */ if (!ob->pd) @@ -1131,7 +1137,7 @@ static PointerRNA rna_Object_field_get(PointerRNA *ptr) static PointerRNA rna_Object_collision_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; if (ob->type != OB_MESH) return PointerRNA_NULL; @@ -1145,34 +1151,34 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr) static PointerRNA rna_Object_active_constraint_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; bConstraint *con = constraints_get_active(&ob->constraints); return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con); } static void rna_Object_active_constraint_set(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; constraints_set_active(&ob->constraints, (bConstraint *)value.data); } static bConstraint *rna_Object_constraints_new(Object *object, int type) { - WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_ADDED, object); + WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_ADDED, object); return add_ob_constraint(object, NULL, type); } static void rna_Object_constraints_remove(Object *object, ReportList *reports, bConstraint *con) { if (BLI_findindex(&object->constraints, con) == -1) { - BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'", con->name, object->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in object '%s'", con->name, object->id.name + 2); return; } remove_constraint(&object->constraints, con); ED_object_constraint_update(object); ED_object_constraint_set_active(object, NULL); - WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, object); + WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, object); } static void rna_Object_constraints_clear(Object *object) @@ -1182,7 +1188,7 @@ static void rna_Object_constraints_clear(Object *object) ED_object_constraint_update(object); ED_object_constraint_set_active(object, NULL); - WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, object); + WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, object); } static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports, @@ -1195,25 +1201,25 @@ static void rna_Object_modifier_remove(Object *object, bContext *C, ReportList * { ED_object_modifier_remove(reports, CTX_data_main(C), CTX_data_scene(C), object, md); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER|NA_REMOVED, object); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER | NA_REMOVED, object); } static void rna_Object_modifier_clear(Object *object, bContext *C) { ED_object_modifier_clear(CTX_data_main(C), CTX_data_scene(C), object); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER|NA_REMOVED, object); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER | NA_REMOVED, object); } static void rna_Object_boundbox_get(PointerRNA *ptr, float *values) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; BoundBox *bb = BKE_object_boundbox_get(ob); if (bb) { memcpy(values, bb->vec, sizeof(bb->vec)); } else { - fill_vn_fl(values, sizeof(bb->vec)/sizeof(float), 0.0f); + fill_vn_fl(values, sizeof(bb->vec) / sizeof(float), 0.0f); } } @@ -1222,7 +1228,7 @@ static bDeformGroup *rna_Object_vgroup_new(Object *ob, const char *name) { bDeformGroup *defgroup = ED_vgroup_add_name(ob, name); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); return defgroup; } @@ -1231,14 +1237,14 @@ static void rna_Object_vgroup_remove(Object *ob, bDeformGroup *defgroup) { ED_vgroup_delete(ob, defgroup); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); } static void rna_Object_vgroup_clear(Object *ob) { ED_vgroup_clear(ob); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); } static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *reports, int index_len, @@ -1252,9 +1258,9 @@ static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *re } while (index_len--) - ED_vgroup_vert_add(ob, def, *index++, weight, assignmode); /* XXX, not efficient calling within loop*/ + ED_vgroup_vert_add(ob, def, *index++, weight, assignmode); /* XXX, not efficient calling within loop*/ - WM_main_add_notifier(NC_GEOM|ND_DATA, (ID *)ob->data); + WM_main_add_notifier(NC_GEOM | ND_DATA, (ID *)ob->data); } static void rna_VertexGroup_vertex_remove(ID *id, bDeformGroup *dg, ReportList *reports, int index_len, int *index) @@ -1269,7 +1275,7 @@ static void rna_VertexGroup_vertex_remove(ID *id, bDeformGroup *dg, ReportList * while (index_len--) ED_vgroup_vert_remove(ob, dg, *index++); - WM_main_add_notifier(NC_GEOM|ND_DATA, (ID *)ob->data); + WM_main_add_notifier(NC_GEOM | ND_DATA, (ID *)ob->data); } static float rna_VertexGroup_weight(ID *id, bDeformGroup *dg, ReportList *reports, int index) @@ -1334,14 +1340,14 @@ static void rna_def_vertex_group(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Name", "Vertex group name"); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_VertexGroup_name_set"); - /* update data because modifiers may use [#24761] */ - RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); + /* update data because modifiers may use [#24761] */ + RNA_def_property_update(prop, NC_GEOM | ND_DATA | NA_RENAME, "rna_Object_internal_update_data"); prop = RNA_def_property(srna, "lock_weight", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "", "Maintain the relative weights for the group"); RNA_def_property_boolean_sdna(prop, NULL, "flag", 0); - /* update data because modifiers may use [#24761] */ - RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); + /* update data because modifiers may use [#24761] */ + RNA_def_property_update(prop, NC_GEOM | ND_DATA | NA_RENAME, "rna_Object_internal_update_data"); prop = RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1350,10 +1356,10 @@ static void rna_def_vertex_group(BlenderRNA *brna) func = RNA_def_function(srna, "add", "rna_VertexGroup_vertex_add"); RNA_def_function_ui_description(func, "Add vertices to the group"); - RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); + RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); /* TODO, see how array size of 0 works, this shouldnt be used */ prop = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0); - RNA_def_property_flag(prop, PROP_DYNAMIC|PROP_REQUIRED); + RNA_def_property_flag(prop, PROP_DYNAMIC | PROP_REQUIRED); prop = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f); RNA_def_property_flag(prop, PROP_REQUIRED); prop = RNA_def_enum(func, "type", assign_mode_items, 0, "", "Vertex assign mode"); @@ -1361,14 +1367,14 @@ static void rna_def_vertex_group(BlenderRNA *brna) func = RNA_def_function(srna, "remove", "rna_VertexGroup_vertex_remove"); RNA_def_function_ui_description(func, "Remove a vertex from the group"); - RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); + RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); /* TODO, see how array size of 0 works, this shouldnt be used */ prop = RNA_def_int_array(func, "index", 1, NULL, 0, 0, "", "Index List", 0, 0); - RNA_def_property_flag(prop, PROP_DYNAMIC|PROP_REQUIRED); + RNA_def_property_flag(prop, PROP_DYNAMIC | PROP_REQUIRED); func = RNA_def_function(srna, "weight", "rna_VertexGroup_weight"); RNA_def_function_ui_description(func, "Get a vertex weight from the group"); - RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); + RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); prop = RNA_def_int(func, "index", 0, 0, INT_MAX, "Index", "The index of the vertex", 0, INT_MAX); RNA_def_property_flag(prop, PROP_REQUIRED); prop = RNA_def_float(func, "weight", 0, 0.0f, 1.0f, "", "Vertex weight", 0.0f, 1.0f); @@ -1383,7 +1389,8 @@ static void rna_def_material_slot(BlenderRNA *brna) static EnumPropertyItem link_items[] = { {1, "OBJECT", 0, "Object", ""}, {0, "DATA", 0, "Data", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; /* NOTE: there is no MaterialSlot equivalent in DNA, so the internal * pointer data points to ob->mat + index, and we manually implement @@ -1398,13 +1405,13 @@ static void rna_def_material_slot(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL, NULL); RNA_def_property_ui_text(prop, "Material", "Material datablock used by this material slot"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_MaterialSlot_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_MaterialSlot_update"); prop = RNA_def_property(srna, "link", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, link_items); RNA_def_property_enum_funcs(prop, "rna_MaterialSlot_link_get", "rna_MaterialSlot_link_set", NULL); RNA_def_property_ui_text(prop, "Link", "Link material to object or the object's data"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_MaterialSlot_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_MaterialSlot_update"); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_MaterialSlot_name_get", "rna_MaterialSlot_name_length", NULL); @@ -1429,7 +1436,8 @@ static void rna_def_object_game_settings(BlenderRNA *brna) "Collision Sensor, detects static and dynamic objects but not the other " "collision sensor objects"}, {OB_BODY_TYPE_NAVMESH, "NAVMESH", 0, "Navigation Mesh", "Navigation mesh"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "GameObjectSettings", NULL); RNA_def_struct_sdna(srna, "Object"); @@ -1491,12 +1499,12 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.01, 10000.0); RNA_def_property_ui_text(prop, "Mass", "Mass of the object"); - prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH); + prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "inertia"); RNA_def_property_range(prop, 0.01f, FLT_MAX); RNA_def_property_ui_range(prop, 0.01f, 10.0f, 1, 3); RNA_def_property_ui_text(prop, "Radius", "Radius of bounding sphere and material physics"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "use_sleep", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_COLLISION_RESPONSE); @@ -1583,20 +1591,20 @@ static void rna_def_object_game_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "use_collision_bounds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_BOUNDS); RNA_def_property_ui_text(prop, "Use Collision Bounds", "Specify a collision bounds type other than the default"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "collision_bounds_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "collision_boundtype"); RNA_def_property_enum_items(prop, collision_bounds_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Object_collision_bounds_itemf"); RNA_def_property_ui_text(prop, "Collision Bounds", "Select the collision type"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "use_collision_compound", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_CHILD); RNA_def_property_ui_text(prop, "Collision Compound", "Add children to form a compound collision object"); - prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH); + prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "margin"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Collision Margin", @@ -1611,7 +1619,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_HASOBSTACLE); RNA_def_property_ui_text(prop, "Create obstacle", "Create representation for obstacle simulation"); - prop = RNA_def_property(srna, "obstacle_radius", PROP_FLOAT, PROP_NONE|PROP_UNIT_LENGTH); + prop = RNA_def_property(srna, "obstacle_radius", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH); RNA_def_property_float_sdna(prop, NULL, "obstacleRad"); RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_ui_text(prop, "Obstacle Radius", "Radius of object representation in obstacle simulation"); @@ -1688,7 +1696,7 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_REPORTS); /* constraint to remove */ parm = RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "clear", "rna_Object_constraints_clear"); RNA_def_function_ui_description(func, "Remove all constraint from this object"); @@ -1722,7 +1730,7 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) /* add target */ func = RNA_def_function(srna, "new", "rna_Object_modifier_new"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add a new modifier"); parm = RNA_def_string(func, "name", "Name", 0, "", "New name for the bone"); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -1735,11 +1743,11 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) /* remove target */ func = RNA_def_function(srna, "remove", "rna_Object_modifier_remove"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove an existing modifier from the object"); /* target to remove*/ parm = RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); /* clear all modifiers */ func = RNA_def_function(srna, "clear", "rna_Object_modifier_clear"); @@ -1766,7 +1774,7 @@ static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -1774,7 +1782,7 @@ static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range"); RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_particle_update"); } @@ -1798,7 +1806,7 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object"); - RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data"); + RNA_def_property_update(prop, NC_GEOM | ND_DATA, "rna_Object_internal_update_data"); prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); @@ -1807,7 +1815,7 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range"); RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array"); - RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data"); + RNA_def_property_update(prop, NC_GEOM | ND_DATA, "rna_Object_internal_update_data"); /* vertex groups */ /* add_vertex_group */ func = RNA_def_function(srna, "new", "rna_Object_vgroup_new"); @@ -1819,7 +1827,7 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "remove", "rna_Object_vgroup_remove"); RNA_def_function_ui_description(func, "Delete vertex group from object"); parm = RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); func = RNA_def_function(srna, "clear", "rna_Object_vgroup_clear"); RNA_def_function_ui_description(func, "Delete all vertex groups from object"); @@ -1840,7 +1848,8 @@ static void rna_def_object(BlenderRNA *brna) {OB_EMPTY_SPHERE, "SPHERE", 0, "Sphere", ""}, {OB_EMPTY_CONE, "CONE", 0, "Cone", ""}, {OB_EMPTY_IMAGE, "IMAGE", 0, "Image", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem track_items[] = { {OB_POSX, "POS_X", 0, "+X", ""}, @@ -1849,13 +1858,15 @@ static void rna_def_object(BlenderRNA *brna) {OB_NEGX, "NEG_X", 0, "-X", ""}, {OB_NEGY, "NEG_Y", 0, "-Y", ""}, {OB_NEGZ, "NEG_Z", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem up_items[] = { {OB_POSX, "X", 0, "X", ""}, {OB_POSY, "Y", 0, "Y", ""}, {OB_POSZ, "Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem drawtype_items[] = { {OB_BOUNDBOX, "BOUNDS", 0, "Bounds", "Draw the bounds of the object"}, @@ -1863,14 +1874,16 @@ static void rna_def_object(BlenderRNA *brna) {OB_SOLID, "SOLID", 0, "Solid", "Draw the object as a solid (if solid drawing is enabled in the viewport)"}, {OB_TEXTURE, "TEXTURED", 0, "Textured", "Draw the object with textures (if textures are enabled in the viewport)"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem boundtype_items[] = { {OB_BOUND_BOX, "BOX", 0, "Box", "Draw bounds as box"}, {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", "Draw bounds as sphere"}, {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", "Draw bounds as cylinder"}, {OB_BOUND_CONE, "CONE", 0, "Cone", "Draw bounds as cone"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem dupli_items[] = { {0, "NONE", 0, "None", ""}, @@ -1878,7 +1891,8 @@ static void rna_def_object(BlenderRNA *brna) {OB_DUPLIVERTS, "VERTS", 0, "Verts", "Duplicate child objects on all vertices"}, {OB_DUPLIFACES, "FACES", 0, "Faces", "Duplicate child objects on all faces"}, {OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; /* XXX: this RNA enum define is currently duplicated for objects, * since there is some text here which is not applicable */ @@ -1892,10 +1906,11 @@ static void rna_def_object(BlenderRNA *brna) {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order - prone to Gimbal Lock"}, {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ), defines a rotation around some axis defined by 3D-Vector"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; - static float default_quat[4] = {1, 0, 0, 0}; /* default quaternion values */ - static float default_axisAngle[4] = {0, 0, 1, 0}; /* default axis-angle rotation values */ + static float default_quat[4] = {1, 0, 0, 0}; /* default quaternion values */ + static float default_axisAngle[4] = {0, 0, 1, 0}; /* default axis-angle rotation values */ static float default_scale[3] = {1, 1, 1}; /* default scale values */ static int boundbox_dimsize[] = {8, 3}; @@ -1907,7 +1922,7 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", NULL); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Data", "Object data"); RNA_def_property_update(prop, 0, "rna_Object_internal_update_data"); @@ -1929,12 +1944,12 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Layers", "Layers the object is on"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_layer_set"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_layer_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_layer_update"); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); RNA_def_property_ui_text(prop, "Select", "Object selection state"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_select_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_select_update"); /* for data access */ prop = RNA_def_property(srna, "bound_box", PROP_FLOAT, PROP_NONE); @@ -1948,28 +1963,28 @@ static void rna_def_object(BlenderRNA *brna) /* parent */ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_ui_text(prop, "Parent", "Parent Object"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); prop = RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "partype"); RNA_def_property_enum_items(prop, parent_type_items); RNA_def_property_enum_funcs(prop, NULL, "rna_Object_parent_type_set", "rna_Object_parent_type_itemf"); RNA_def_property_ui_text(prop, "Parent Type", "Type of parent relation"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); prop = RNA_def_property(srna, "parent_vertices", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "par1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Parent Vertices", "Indices of vertices in case of a vertex parenting relation"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); prop = RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "parsubstr"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Object_parent_bone_set"); RNA_def_property_ui_text(prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); /* Track and Up flags */ /* XXX: these have been saved here for a bit longer (after old track was removed), @@ -1980,7 +1995,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Track Axis", "Axis that points in 'forward' direction (applies to DupliFrame when " "parent 'Follow' is enabled)"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); prop = RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "upflag"); @@ -1988,7 +2003,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Up Axis", "Axis that points in the upward direction (applies to DupliFrame when " "parent 'Follow' is enabled)"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); /* proxy */ prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); @@ -2001,7 +2016,7 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "material_slots", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); RNA_def_property_struct_type(prop, "MaterialSlot"); - /* don't dereference pointer! */ + /* don't dereference pointer! */ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Material Slots", "Material slots in the object"); @@ -2011,7 +2026,7 @@ static void rna_def_object(BlenderRNA *brna) "rna_Object_active_material_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_MaterialSlot_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_MaterialSlot_update"); prop = RNA_def_property(srna, "active_material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "actcol"); @@ -2019,7 +2034,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set", "rna_Object_active_material_index_range"); RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING, NULL); /* transform */ prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); @@ -2027,18 +2042,18 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_editable_array_func(prop, "rna_Object_location_editable"); RNA_def_property_ui_text(prop, "Location", "Location of the object"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "quat"); RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); RNA_def_property_float_array_default(prop, default_quat); RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but - * having a single one is better for Keyframing and other property-management situations... - */ + /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but + * having a single one is better for Keyframing and other property-management situations... + */ prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE); RNA_def_property_array(prop, 4); RNA_def_property_float_funcs(prop, "rna_Object_rotation_axis_angle_get", @@ -2046,20 +2061,20 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_editable_array_func(prop, "rna_Object_rotation_4d_editable"); RNA_def_property_float_array_default(prop, default_axisAngle); RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "rot"); RNA_def_property_editable_array_func(prop, "rna_Object_rotation_euler_editable"); RNA_def_property_ui_text(prop, "Euler Rotation", "Rotation in Eulers"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_enum_items(prop, prop_rotmode_items); /* XXX move to using a single define of this someday */ RNA_def_property_enum_funcs(prop, NULL, "rna_Object_rotation_mode_set", NULL); RNA_def_property_ui_text(prop, "Rotation Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); @@ -2067,14 +2082,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3); RNA_def_property_float_array_default(prop, default_scale); RNA_def_property_ui_text(prop, "Scale", "Scaling of the object"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); prop = RNA_def_property(srna, "dimensions", PROP_FLOAT, PROP_XYZ_LENGTH); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_Object_dimensions_get", "rna_Object_dimensions_set", NULL); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3); RNA_def_property_ui_text(prop, "Dimensions", "Absolute bounding box dimensions of the object"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); /* delta transforms */ @@ -2082,29 +2097,29 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "dloc"); RNA_def_property_ui_text(prop, "Delta Location", "Extra translation added to the location of the object"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); prop = RNA_def_property(srna, "delta_rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "drot"); RNA_def_property_ui_text(prop, "Delta Rotation (Euler)", "Extra rotation added to the rotation of the object (when using Euler rotations)"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); prop = RNA_def_property(srna, "delta_rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "dquat"); RNA_def_property_float_array_default(prop, default_quat); RNA_def_property_ui_text(prop, "Delta Rotation (Quaternion)", "Extra rotation added to the rotation of the object (when using Quaternion rotations)"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); #if 0 /* XXX not supported well yet... */ prop = RNA_def_property(srna, "delta_rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE); - /* FIXME: this is not a single field any more! (drotAxis and drotAngle) */ + /* FIXME: this is not a single field any more! (drotAxis and drotAngle) */ RNA_def_property_float_sdna(prop, NULL, "dquat"); RNA_def_property_float_array_default(prop, default_axisAngle); RNA_def_property_ui_text(prop, "Delta Rotation (Axis Angle)", "Extra rotation added to the rotation of the object (when using Axis-Angle rotations)"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); #endif prop = RNA_def_property(srna, "delta_scale", PROP_FLOAT, PROP_XYZ); @@ -2112,7 +2127,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, 3); RNA_def_property_float_array_default(prop, default_scale); RNA_def_property_ui_text(prop, "Delta Scale", "Extra scaling added to the scale of the object"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); /* transform locks */ prop = RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_NONE); @@ -2120,23 +2135,23 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface"); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface"); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); - /* XXX this is sub-optimal - it really should be included above, - * but due to technical reasons we can't do this! */ + /* XXX this is sub-optimal - it really should be included above, + * but due to technical reasons we can't do this! */ prop = RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)", "Lock editing of 'angle' component of four-component rotations in the interface"); - /* XXX this needs a better name */ + /* XXX this needs a better name */ prop = RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D); RNA_def_property_ui_text(prop, "Lock Rotations (4D)", @@ -2147,7 +2162,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface"); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); /* matrix */ prop = RNA_def_property(srna, "matrix_world", PROP_FLOAT, PROP_MATRIX); @@ -2155,14 +2170,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Matrix World", "Worldspace transformation matrix"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_matrix_world_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_matrix_world_update"); prop = RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Local Matrix", "Parent relative transformation matrix"); RNA_def_property_float_funcs(prop, "rna_Object_matrix_local_get", "rna_Object_matrix_local_set", NULL); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, NULL); prop = RNA_def_property(srna, "matrix_basis", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); @@ -2171,14 +2186,14 @@ static void rna_def_object(BlenderRNA *brna) "Matrix access to location, rotation and scale (including deltas), " "before constraints and parenting are applied"); RNA_def_property_float_funcs(prop, "rna_Object_matrix_basis_get", "rna_Object_matrix_basis_set", NULL); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); /*parent_inverse*/ prop = RNA_def_property(srna, "matrix_parent_inverse", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "parentinv"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_ui_text(prop, "Matrix", "Inverse of object's parent matrix at time of parenting"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); /* modifiers */ prop = RNA_def_property(srna, "modifiers", PROP_COLLECTION, PROP_NONE); @@ -2212,20 +2227,20 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "empty_drawtype"); RNA_def_property_enum_items(prop, empty_drawtype_items); RNA_def_property_ui_text(prop, "Empty Display Type", "Viewport display style for empties"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "empty_draw_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "empty_drawsize"); RNA_def_property_range(prop, 0.0001f, 1000.0f); RNA_def_property_ui_range(prop, 0.01, 100, 1, 2); RNA_def_property_ui_text(prop, "Empty Display Size", "Size of display for empties in the viewport"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "empty_image_offset", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "ima_ofs"); RNA_def_property_ui_text(prop, "Origin Offset", "Origin offset distance"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 0.1f, 2); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); /* render */ prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED); @@ -2236,7 +2251,7 @@ static void rna_def_object(BlenderRNA *brna) prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "col"); RNA_def_property_ui_text(prop, "Color", "Object color and alpha, used when faces have the ObColor mode enabled"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); /* physics */ prop = RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE); @@ -2268,19 +2283,19 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_VIEW); RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_SELECT); RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 1); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", OB_RESTRICT_RENDER); RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); /* anim */ rna_def_animdata_common(srna); @@ -2295,75 +2310,75 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship (beware: this isn't renderfarm " "safe and may be invalid after jumping around the timeline)"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); - prop = RNA_def_property(srna, "slow_parent_offset", PROP_FLOAT, PROP_NONE|PROP_UNIT_TIME); + prop = RNA_def_property(srna, "slow_parent_offset", PROP_FLOAT, PROP_NONE | PROP_UNIT_TIME); RNA_def_property_float_sdna(prop, NULL, "sf"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Slow Parent Offset", "Delay in the parent relationship"); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_TRANSFORM, "rna_Object_internal_update"); /* duplicates */ prop = RNA_def_property(srna, "dupli_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "transflag"); RNA_def_property_enum_items(prop, dupli_items); RNA_def_property_ui_text(prop, "Dupli Type", "If not None, object duplication method to use"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); prop = RNA_def_property(srna, "use_dupli_frames_speed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED); RNA_def_property_ui_text(prop, "Dupli Frames Speed", "Set dupliframes to use the current frame instead of parent curve's evaluation time"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); prop = RNA_def_property(srna, "use_dupli_vertices_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT); RNA_def_property_ui_text(prop, "Dupli Verts Rotation", "Rotate dupli according to vertex normal"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "use_dupli_faces_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIFACES_SCALE); RNA_def_property_ui_text(prop, "Dupli Faces Inherit Scale", "Scale dupli based on face size"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); prop = RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dupfacesca"); RNA_def_property_range(prop, 0.001f, 10000.0f); RNA_def_property_ui_text(prop, "Dupli Faces Scale", "Scale the DupliFace objects"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "dup_group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_dup_group_set", NULL, NULL); RNA_def_property_ui_text(prop, "Dupli Group", "Instance an existing group"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_dependency_update"); - prop = RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE|PROP_UNIT_TIME); + prop = RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE | PROP_UNIT_TIME); RNA_def_property_int_sdna(prop, NULL, "dupsta"); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); - prop = RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE|PROP_UNIT_TIME); + prop = RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE | PROP_UNIT_TIME); RNA_def_property_int_sdna(prop, NULL, "dupend"); RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); - prop = RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE|PROP_UNIT_TIME); + prop = RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE | PROP_UNIT_TIME); RNA_def_property_int_sdna(prop, NULL, "dupon"); RNA_def_property_range(prop, MINFRAME, MAXFRAME); RNA_def_property_ui_range(prop, 1, 1500, 1, 0); RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); - prop = RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE|PROP_UNIT_TIME); + prop = RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE | PROP_UNIT_TIME); RNA_def_property_int_sdna(prop, NULL, "dupoff"); RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_range(prop, 0, 1500, 1, 0); RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update"); prop = RNA_def_property(srna, "dupli_list", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "duplilist", NULL); @@ -2379,50 +2394,50 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "dt"); RNA_def_property_enum_items(prop, drawtype_items); RNA_def_property_ui_text(prop, "Maximum Draw Type", "Maximum draw type to display object with in viewport"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_bounds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_BOUNDBOX); RNA_def_property_ui_text(prop, "Draw Bounds", "Display the object's bounds"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "draw_bounds_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "boundtype"); RNA_def_property_enum_items(prop, boundtype_items); RNA_def_property_ui_text(prop, "Draw Bounds Type", "Object boundary display type"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWNAME); RNA_def_property_ui_text(prop, "Draw Name", "Display the object's name"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_AXIS); RNA_def_property_ui_text(prop, "Draw Axes", "Display the object's origin and axes"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_texture_space", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_TEXSPACE); RNA_def_property_ui_text(prop, "Draw Texture Space", "Display the object's texture space"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWWIRE); RNA_def_property_ui_text(prop, "Draw Wire", "Add the object's wireframe over solid drawing"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_transparent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWTRANSP); RNA_def_property_ui_text(prop, "Draw Transparent", "Display material transparency in the object (unsupported for duplicator drawing)"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "dtx", OB_DRAWXRAY); RNA_def_property_ui_text(prop, "X-Ray", "Make the object draw in front of others (unsupported for duplicator drawing)"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); /* Grease Pencil */ prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); @@ -2430,7 +2445,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "GreasePencil"); RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); /* pose */ prop = RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE); @@ -2491,18 +2506,18 @@ static void rna_def_dupli_object(BlenderRNA *brna) prop = RNA_def_property(srna, "matrix_original", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "omat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object Matrix", "The original matrix of this object before it was duplicated"); prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "mat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object Duplicate Matrix", "Object duplicate transformation matrix"); prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "no_draw", 0); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE|PROP_EDITABLE); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE); RNA_def_property_ui_text(prop, "Hide", "Don't show dupli object in viewport or render"); /* TODO: DupliObject has more properties that can be wrapped */ @@ -2528,12 +2543,12 @@ static void rna_def_object_base(BlenderRNA *brna) RNA_def_property_array(prop, 20); RNA_def_property_ui_text(prop, "Layers", "Layers the object base is on"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Base_layer_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Base_layer_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Base_layer_update"); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BA_SELECT); RNA_def_property_ui_text(prop, "Select", "Object base selection state"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Base_select_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Base_select_update"); RNA_api_object_base(srna); } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 7ed0304ebb4..4d7ecc9350f 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -82,157 +82,157 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ /* perform the mesh extraction based on type */ switch (ob->type) { - case OB_FONT: - case OB_CURVE: - case OB_SURF: + case OB_FONT: + case OB_CURVE: + case OB_SURF: - /* copies object and modifiers (but not the data) */ - tmpobj = BKE_object_copy(ob); - tmpcu = (Curve *)tmpobj->data; - tmpcu->id.us--; + /* copies object and modifiers (but not the data) */ + tmpobj = BKE_object_copy(ob); + tmpcu = (Curve *)tmpobj->data; + tmpcu->id.us--; - /* if getting the original caged mesh, delete object modifiers */ - if ( cage ) - BKE_object_free_modifiers(tmpobj); + /* if getting the original caged mesh, delete object modifiers */ + if (cage) + BKE_object_free_modifiers(tmpobj); - /* copies the data */ - copycu = tmpobj->data = BKE_curve_copy((Curve *) ob->data ); - - /* temporarily set edit so we get updates from edit mode, but - * also because for text datablocks copying it while in edit - * mode gives invalid data structures */ - copycu->editfont = tmpcu->editfont; - copycu->editnurb = tmpcu->editnurb; + /* copies the data */ + copycu = tmpobj->data = BKE_curve_copy((Curve *) ob->data); - /* get updated display list, and convert to a mesh */ - BKE_displist_make_curveTypes(sce, tmpobj, 0); + /* temporarily set edit so we get updates from edit mode, but + * also because for text datablocks copying it while in edit + * mode gives invalid data structures */ + copycu->editfont = tmpcu->editfont; + copycu->editnurb = tmpcu->editnurb; - copycu->editfont = NULL; - copycu->editnurb = NULL; + /* get updated display list, and convert to a mesh */ + BKE_displist_make_curveTypes(sce, tmpobj, 0); - BKE_mesh_from_nurbs(tmpobj); + copycu->editfont = NULL; + copycu->editnurb = NULL; - /* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */ - if (tmpobj->type != OB_MESH) { - BKE_libblock_free_us(&(G.main->object), tmpobj); - BKE_report(reports, RPT_ERROR, "cant convert curve to mesh. Does the curve have any segments?"); - return NULL; - } - tmpmesh = tmpobj->data; - BKE_libblock_free_us(&G.main->object, tmpobj); - break; + BKE_mesh_from_nurbs(tmpobj); - case OB_MBALL: { - /* metaballs don't have modifiers, so just convert to mesh */ - Object *basis_ob = BKE_mball_basis_find(sce, ob); - /* todo, re-generatre for render-res */ - /* metaball_polygonize(scene, ob) */ + /* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */ + if (tmpobj->type != OB_MESH) { + BKE_libblock_free_us(&(G.main->object), tmpobj); + BKE_report(reports, RPT_ERROR, "cant convert curve to mesh. Does the curve have any segments?"); + return NULL; + } + tmpmesh = tmpobj->data; + BKE_libblock_free_us(&G.main->object, tmpobj); + break; - if (ob != basis_ob) - return NULL; /* only do basis metaball */ + case OB_MBALL: { + /* metaballs don't have modifiers, so just convert to mesh */ + Object *basis_ob = BKE_mball_basis_find(sce, ob); + /* todo, re-generatre for render-res */ + /* metaball_polygonize(scene, ob) */ - tmpmesh = BKE_mesh_add("Mesh"); + if (ob != basis_ob) + return NULL; /* only do basis metaball */ - if (render) { - ListBase disp = {NULL, NULL}; - BKE_displist_make_mball_forRender(sce, ob, &disp); - BKE_mesh_from_metaball(&disp, tmpmesh); - BKE_displist_free(&disp); - } - else - BKE_mesh_from_metaball(&ob->disp, tmpmesh); - break; + tmpmesh = BKE_mesh_add("Mesh"); - } - case OB_MESH: - /* copies object and modifiers (but not the data) */ - if (cage) { - /* copies the data */ - tmpmesh = BKE_mesh_copy( ob->data ); - /* if not getting the original caged mesh, get final derived mesh */ - } - else { - /* Make a dummy mesh, saves copying */ - DerivedMesh *dm; - /* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */ - CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter, - * for example, needs CD_MASK_MDEFORMVERT */ - - /* Write the display mesh into the dummy mesh */ - if (render) - dm = mesh_create_derived_render(sce, ob, mask); + if (render) { + ListBase disp = {NULL, NULL}; + BKE_displist_make_mball_forRender(sce, ob, &disp); + BKE_mesh_from_metaball(&disp, tmpmesh); + BKE_displist_free(&disp); + } else - dm = mesh_create_derived_view(sce, ob, mask); - - tmpmesh = BKE_mesh_add("Mesh"); - DM_to_mesh(dm, tmpmesh, ob); - dm->release(dm); + BKE_mesh_from_metaball(&ob->disp, tmpmesh); + break; + } + case OB_MESH: + /* copies object and modifiers (but not the data) */ + if (cage) { + /* copies the data */ + tmpmesh = BKE_mesh_copy(ob->data); + /* if not getting the original caged mesh, get final derived mesh */ + } + else { + /* Make a dummy mesh, saves copying */ + DerivedMesh *dm; + /* CustomDataMask mask = CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL; */ + CustomDataMask mask = CD_MASK_MESH; /* this seems more suitable, exporter, + * for example, needs CD_MASK_MDEFORMVERT */ + + /* Write the display mesh into the dummy mesh */ + if (render) + dm = mesh_create_derived_render(sce, ob, mask); + else + dm = mesh_create_derived_view(sce, ob, mask); - break; - default: - BKE_report(reports, RPT_ERROR, "Object does not have geometry data"); - return NULL; + tmpmesh = BKE_mesh_add("Mesh"); + DM_to_mesh(dm, tmpmesh, ob); + dm->release(dm); + } + + break; + default: + BKE_report(reports, RPT_ERROR, "Object does not have geometry data"); + return NULL; } /* Copy materials to new mesh */ switch (ob->type) { - case OB_SURF: - case OB_FONT: - case OB_CURVE: - tmpmesh->totcol = tmpcu->totcol; - - /* free old material list (if it exists) and adjust user counts */ - if ( tmpcu->mat ) { - for ( i = tmpcu->totcol; i-- > 0; ) { - /* are we an object material or data based? */ + case OB_SURF: + case OB_FONT: + case OB_CURVE: + tmpmesh->totcol = tmpcu->totcol; + + /* free old material list (if it exists) and adjust user counts */ + if (tmpcu->mat) { + for (i = tmpcu->totcol; i-- > 0; ) { + /* are we an object material or data based? */ - tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : tmpcu->mat[i]; + tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : tmpcu->mat[i]; - if (tmpmesh->mat[i]) { - tmpmesh->mat[i]->id.us++; + if (tmpmesh->mat[i]) { + tmpmesh->mat[i]->id.us++; + } } } - } - break; + break; #if 0 - /* Crashes when assigning the new material, not sure why */ - case OB_MBALL: - tmpmb = (MetaBall *)ob->data; - tmpmesh->totcol = tmpmb->totcol; - - /* free old material list (if it exists) and adjust user counts */ - if ( tmpmb->mat ) { - for ( i = tmpmb->totcol; i-- > 0; ) { - tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */ - if (tmpmesh->mat[i]) { - tmpmb->mat[i]->id.us++; + /* Crashes when assigning the new material, not sure why */ + case OB_MBALL: + tmpmb = (MetaBall *)ob->data; + tmpmesh->totcol = tmpmb->totcol; + + /* free old material list (if it exists) and adjust user counts */ + if (tmpmb->mat) { + for (i = tmpmb->totcol; i-- > 0; ) { + tmpmesh->mat[i] = tmpmb->mat[i]; /* CRASH HERE ??? */ + if (tmpmesh->mat[i]) { + tmpmb->mat[i]->id.us++; + } } } - } - break; + break; #endif - case OB_MESH: - if (!cage) { - Mesh *origmesh = ob->data; - tmpmesh->flag = origmesh->flag; - tmpmesh->mat = MEM_dupallocN(origmesh->mat); - tmpmesh->totcol = origmesh->totcol; - tmpmesh->smoothresh = origmesh->smoothresh; - if ( origmesh->mat ) { - for ( i = origmesh->totcol; i-- > 0; ) { - /* are we an object material or data based? */ - tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i]; - - if (tmpmesh->mat[i]) { - tmpmesh->mat[i]->id.us++; + case OB_MESH: + if (!cage) { + Mesh *origmesh = ob->data; + tmpmesh->flag = origmesh->flag; + tmpmesh->mat = MEM_dupallocN(origmesh->mat); + tmpmesh->totcol = origmesh->totcol; + tmpmesh->smoothresh = origmesh->smoothresh; + if (origmesh->mat) { + for (i = origmesh->totcol; i-- > 0; ) { + /* are we an object material or data based? */ + tmpmesh->mat[i] = ob->matbits[i] ? ob->mat[i] : origmesh->mat[i]; + + if (tmpmesh->mat[i]) { + tmpmesh->mat[i]->id.us++; + } } } } - } - break; + break; } /* end copy materials */ /* cycles and exporters rely on this still */ @@ -277,7 +277,7 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e /* this is to make sure we get render level duplis in groups: * the derivedmesh must be created before init_render_mesh, * since object_duplilist does dupliparticles before that */ - dm = mesh_create_derived_render(scene, ob, CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL); + dm = mesh_create_derived_render(scene, ob, CD_MASK_BAREMESH | CD_MASK_MTFACE | CD_MASK_MCOL); dm->release(dm); for (psys = ob->particlesystem.first; psys; psys = psys->next) @@ -289,7 +289,7 @@ static void dupli_render_particle_set(Scene *scene, Object *ob, int level, int e group = ob->dup_group; for (go = group->gobject.first; go; go = go->next) - dupli_render_particle_set(scene, go->ob, level+1, enable); + dupli_render_particle_set(scene, go->ob, level + 1, enable); } /* When no longer needed, duplilist should be freed with Object.free_duplilist */ void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *sce) @@ -332,12 +332,12 @@ static PointerRNA rna_Object_shape_key_add(Object *ob, bContext *C, ReportList * PointerRNA keyptr; RNA_pointer_create((ID *)ob->data, &RNA_ShapeKey, kb, &keyptr); - WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); return keyptr; } else { - BKE_reportf(reports, RPT_ERROR, "Object \"%s\"does not support shapes", ob->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Object \"%s\"does not support shapes", ob->id.name + 2); return PointerRNA_NULL; } } @@ -356,7 +356,7 @@ static void rna_Mesh_assign_verts_to_group(Object *ob, bDeformGroup *group, int return; } - Mesh *me = (Mesh*)ob->data; + Mesh *me = (Mesh *)ob->data; int group_index = BLI_findlink(&ob->defbase, group); if (group_index == -1) { BKE_report(reports, RPT_ERROR, "No deform groups assigned to mesh"); @@ -391,7 +391,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl BVHTreeFromMesh treeData = {NULL}; if (ob->derivedFinal == NULL) { - BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for ray casting", ob->id.name+2); + BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for ray casting", ob->id.name + 2); return; } @@ -399,7 +399,7 @@ void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start[3], fl bvhtree_from_mesh_faces(&treeData, ob->derivedFinal, 0.0f, 4, 6); if (treeData.tree == NULL) { - BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for ray casting", ob->id.name+2); + BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for ray casting", ob->id.name + 2); return; } else { @@ -433,7 +433,7 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi if (ob->derivedFinal == NULL) { BKE_reportf(reports, RPT_ERROR, "object \"%s\" has no mesh data to be used for finding nearest point", - ob->id.name+2); + ob->id.name + 2); return; } @@ -442,7 +442,7 @@ void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float poi if (treeData.tree == NULL) { BKE_reportf(reports, RPT_ERROR, "object \"%s\" could not create internal data for finding nearest point", - ob->id.name+2); + ob->id.name + 2); return; } else { @@ -546,7 +546,7 @@ void RNA_api_object(StructRNA *srna) RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers"); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); @@ -558,10 +558,10 @@ void RNA_api_object(StructRNA *srna) /* duplis */ func = RNA_def_function(srna, "dupli_list_create", "rna_Object_create_duplilist"); RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to " - "be freed manually with free_dupli_list to restore the " - "objects real matrix and layers"); + "be freed manually with free_dupli_list to restore the " + "objects real matrix and layers"); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); RNA_def_function_flag(func, FUNC_USE_REPORTS); func = RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist"); @@ -576,7 +576,7 @@ void RNA_api_object(StructRNA *srna) /* Shape key */ func = RNA_def_function(srna, "shape_key_add", "rna_Object_shape_key_add"); RNA_def_function_ui_description(func, "Add shape key to an object"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); + RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keylock"); /* optional */ RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes"); parm = RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock"); @@ -635,7 +635,7 @@ void RNA_api_object(StructRNA *srna) func = RNA_def_function(srna, "is_visible", "rna_Object_is_visible"); RNA_def_function_ui_description(func, "Determine if object is visible in a given scene"); parm = RNA_def_pointer(func, "scene", "Scene", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); parm = RNA_def_boolean(func, "result", 0, "", "Object visibility"); RNA_def_function_return(func, parm); @@ -643,7 +643,7 @@ void RNA_api_object(StructRNA *srna) func = RNA_def_function(srna, "is_modified", "rna_Object_is_modified"); RNA_def_function_ui_description(func, "Determine if this object is modified from the base mesh data"); parm = RNA_def_pointer(func, "scene", "Scene", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_boolean(func, "result", 0, "", "Object visibility"); @@ -652,7 +652,7 @@ void RNA_api_object(StructRNA *srna) func = RNA_def_function(srna, "is_deform_modified", "rna_Object_is_deform_modified"); RNA_def_function_ui_description(func, "Determine if this object is modified by a deformation from the base mesh data"); parm = RNA_def_pointer(func, "scene", "Scene", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_boolean(func, "result", 0, "", "Object visibility"); @@ -682,7 +682,7 @@ void RNA_api_object_base(StructRNA *srna) RNA_def_function_ui_description(func, "Sets the object layers from a 3D View (use when adding an object in local view)"); parm = RNA_def_pointer(func, "view", "SpaceView3D", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } #endif diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 2e8e597ad35..25866dd996f 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -100,8 +100,8 @@ static EnumPropertyItem empty_vortex_shape_items[] = { static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - PointCache *cache = (PointCache*)ptr->data; + Object *ob = (Object *)ptr->id.data; + PointCache *cache = (PointCache *)ptr->data; PTCacheID *pid = NULL; ListBase pidlist; @@ -131,8 +131,8 @@ static void rna_Cache_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - PointCache *cache = (PointCache*)ptr->data; + Object *ob = (Object *)ptr->id.data; + PointCache *cache = (PointCache *)ptr->data; PTCacheID *pid = NULL; ListBase pidlist; @@ -157,8 +157,8 @@ static void rna_Cache_toggle_disk_cache(Main *UNUSED(bmain), Scene *UNUSED(scene static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - PointCache *cache = (PointCache*)ptr->data; + Object *ob = (Object *)ptr->id.data; + PointCache *cache = (PointCache *)ptr->data; PTCacheID *pid = NULL, *pid2 = NULL; ListBase pidlist; int new_name = 1; @@ -239,7 +239,7 @@ static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, for (pid = pidlist.first; pid; pid = pid->next) { if (pid->cache == cache) { - *max = BLI_countlist(pid->ptcaches)-1; + *max = BLI_countlist(pid->ptcaches) - 1; *max = MAX2(0, *max); break; } @@ -315,7 +315,7 @@ static char *rna_CollisionSettings_path(PointerRNA *UNUSED(ptr)) { /* both methods work ok, but return the shorter path */ #if 0 - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Collision); if (md) { @@ -332,59 +332,59 @@ static char *rna_CollisionSettings_path(PointerRNA *UNUSED(ptr)) static int rna_SoftBodySettings_use_edges_get(PointerRNA *ptr) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); return (((data->softflag) & OB_SB_EDGES) != 0); } static void rna_SoftBodySettings_use_edges_set(PointerRNA *ptr, int value) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); if (value) data->softflag |= OB_SB_EDGES; else data->softflag &= ~OB_SB_EDGES; } static int rna_SoftBodySettings_use_goal_get(PointerRNA *ptr) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); return (((data->softflag) & OB_SB_GOAL) != 0); } static void rna_SoftBodySettings_use_goal_set(PointerRNA *ptr, int value) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); if (value) data->softflag |= OB_SB_GOAL; else data->softflag &= ~OB_SB_GOAL; } static int rna_SoftBodySettings_stiff_quads_get(PointerRNA *ptr) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); return (((data->softflag) & OB_SB_QUADS) != 0); } static void rna_SoftBodySettings_stiff_quads_set(PointerRNA *ptr, int value) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); if (value) data->softflag |= OB_SB_QUADS; else data->softflag &= ~OB_SB_QUADS; } static int rna_SoftBodySettings_self_collision_get(PointerRNA *ptr) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); return (((data->softflag) & OB_SB_SELF) != 0); } static void rna_SoftBodySettings_self_collision_set(PointerRNA *ptr, int value) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); if (value) data->softflag |= OB_SB_SELF; else data->softflag &= ~OB_SB_SELF; } static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); if (data->softflag & OB_SB_AERO_ANGLE) return 1; else @@ -393,73 +393,73 @@ static int rna_SoftBodySettings_new_aero_get(PointerRNA *ptr) static void rna_SoftBodySettings_new_aero_set(PointerRNA *ptr, int value) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); if (value == 1) data->softflag |= OB_SB_AERO_ANGLE; - else /* value == 0 */ + else /* value == 0 */ data->softflag &= ~OB_SB_AERO_ANGLE; } static int rna_SoftBodySettings_face_collision_get(PointerRNA *ptr) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); return (((data->softflag) & OB_SB_FACECOLL) != 0); } static void rna_SoftBodySettings_face_collision_set(PointerRNA *ptr, int value) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); if (value) data->softflag |= OB_SB_FACECOLL; else data->softflag &= ~OB_SB_FACECOLL; } static int rna_SoftBodySettings_edge_collision_get(PointerRNA *ptr) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); return (((data->softflag) & OB_SB_EDGECOLL) != 0); } static void rna_SoftBodySettings_edge_collision_set(PointerRNA *ptr, int value) { - Object *data = (Object*)(ptr->id.data); + Object *data = (Object *)(ptr->id.data); if (value) data->softflag |= OB_SB_EDGECOLL; else data->softflag &= ~OB_SB_EDGECOLL; } static void rna_SoftBodySettings_goal_vgroup_get(PointerRNA *ptr, char *value) { - SoftBody *sb = (SoftBody*)ptr->data; + SoftBody *sb = (SoftBody *)ptr->data; rna_object_vgroup_name_index_get(ptr, value, sb->vertgroup); } static int rna_SoftBodySettings_goal_vgroup_length(PointerRNA *ptr) { - SoftBody *sb = (SoftBody*)ptr->data; + SoftBody *sb = (SoftBody *)ptr->data; return rna_object_vgroup_name_index_length(ptr, sb->vertgroup); } static void rna_SoftBodySettings_goal_vgroup_set(PointerRNA *ptr, const char *value) { - SoftBody *sb = (SoftBody*)ptr->data; + SoftBody *sb = (SoftBody *)ptr->data; rna_object_vgroup_name_index_set(ptr, value, &sb->vertgroup); } static void rna_SoftBodySettings_mass_vgroup_set(PointerRNA *ptr, const char *value) { - SoftBody *sb = (SoftBody*)ptr->data; + SoftBody *sb = (SoftBody *)ptr->data; rna_object_vgroup_name_set(ptr, value, sb->namedVG_Mass, sizeof(sb->namedVG_Mass)); } static void rna_SoftBodySettings_spring_vgroup_set(PointerRNA *ptr, const char *value) { - SoftBody *sb = (SoftBody*)ptr->data; + SoftBody *sb = (SoftBody *)ptr->data; rna_object_vgroup_name_set(ptr, value, sb->namedVG_Spring_K, sizeof(sb->namedVG_Spring_K)); } static char *rna_SoftBodySettings_path(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Softbody); return BLI_sprintfN("modifiers[\"%s\"].settings", md->name); @@ -475,7 +475,7 @@ static int particle_id_check(PointerRNA *ptr) static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { if (particle_id_check(ptr)) { - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; if (part->pd->forcefield != PFIELD_TEXTURE && part->pd->tex) { part->pd->tex->id.us--; @@ -487,12 +487,12 @@ static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), part->pd2->tex = NULL; } - DAG_id_tag_update(&part->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME|PSYS_RECALC_RESET); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL); + DAG_id_tag_update(&part->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME | PSYS_RECALC_RESET); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); } else { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; if (ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) { ob->pd->tex->id.us--; @@ -500,14 +500,14 @@ static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), } DAG_id_tag_update(&ob->id, OB_RECALC_OB); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); } } static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA *ptr) { if (!particle_id_check(ptr)) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; PartDeflect *pd = ob->pd; ModifierData *md = modifiers_findByType(ob, eModifierType_Surface); @@ -522,23 +522,23 @@ static void rna_FieldSettings_shape_update(Main *bmain, Scene *scene, PointerRNA ED_object_modifier_remove(NULL, bmain, scene, ob, md); } - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); } } static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) { if (particle_id_check(ptr)) { - DAG_id_tag_update((ID*)ptr->id.data, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME|PSYS_RECALC_RESET); + DAG_id_tag_update((ID *)ptr->id.data, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME | PSYS_RECALC_RESET); } else { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; /* do this before scene sort, that one checks for CU_PATH */ #if 0 /* XXX */ if (ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE) { Curve *cu = ob->data; - cu->flag |= (CU_PATH|CU_3D); + cu->flag |= (CU_PATH | CU_3D); do_curvebuts(B_CU3D); /* all curves too */ } #endif @@ -548,11 +548,11 @@ static void rna_FieldSettings_dependency_update(Main *bmain, Scene *scene, Point DAG_scene_sort(bmain, scene); if (ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE) - DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME); + DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); else DAG_id_tag_update(&ob->id, OB_RECALC_OB); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); } } @@ -564,7 +564,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr) if (particle_id_check(ptr)) { /* particle system force field */ - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; if (part->pd == pd) return BLI_sprintfN("force_field_1"); @@ -573,7 +573,7 @@ static char *rna_FieldSettings_path(PointerRNA *ptr) } else { /* object force field */ - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; if (ob->pd == pd) return BLI_sprintfN("field"); @@ -583,18 +583,18 @@ static char *rna_FieldSettings_path(PointerRNA *ptr) static void rna_EffectorWeight_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DAG_id_tag_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET); + DAG_id_tag_update((ID *)ptr->id.data, OB_RECALC_DATA | PSYS_RECALC_RESET); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); } static void rna_EffectorWeight_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) { DAG_scene_sort(bmain, scene); - DAG_id_tag_update((ID*)ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET); + DAG_id_tag_update((ID *)ptr->id.data, OB_RECALC_DATA | PSYS_RECALC_RESET); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); } static char *rna_EffectorWeight_path(PointerRNA *ptr) @@ -604,13 +604,13 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr) if (particle_id_check(ptr)) { /* particle effector weights */ - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; if (part->effector_weights == ew) return BLI_sprintfN("effector_weights"); } else { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; ModifierData *md; /* check softbody modifier */ @@ -660,7 +660,7 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr) static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; ModifierData *md = modifiers_findByType(ob, eModifierType_Collision); /* add/remove modifier as needed */ @@ -669,23 +669,23 @@ static void rna_CollisionSettings_dependency_update(Main *bmain, Scene *scene, P else if (!ob->pd->deflect && md) ED_object_modifier_remove(NULL, bmain, scene, ob, md); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); } static void rna_CollisionSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; - DAG_id_tag_update(&ob->id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME); - WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob); + DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob); } static void rna_softbody_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); } @@ -697,7 +697,7 @@ static EnumPropertyItem *rna_Effector_shape_itemf(bContext *UNUSED(C), PointerRN if (particle_id_check(ptr)) return empty_shape_items; - ob = (Object*)ptr->id.data; + ob = (Object *)ptr->id.data; if (ob->type == OB_CURVE) { if (ob->pd->forcefield == PFIELD_VORTEX) @@ -752,7 +752,8 @@ static void rna_def_pointcache(BlenderRNA *brna) {PTCACHE_COMPRESS_NO, "NO", 0, "No", "No compression"}, {PTCACHE_COMPRESS_LZO, "LIGHT", 0, "Light", "Fast but not so effective compression"}, {PTCACHE_COMPRESS_LZMA, "HEAVY", 0, "Heavy", "Effective but slow compression"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "PointCache", NULL); RNA_def_struct_ui_text(srna, "Point Cache", "Point cache for physics simulations"); @@ -1081,25 +1082,29 @@ static void rna_def_field(BlenderRNA *brna) {PFIELD_BOID, "BOID", ICON_FORCE_BOID, "Boid", ""}, {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", "Create turbulence with a noise field"}, {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", "Create a force that dampens motion"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem falloff_items[] = { {PFIELD_FALL_SPHERE, "SPHERE", 0, "Sphere", ""}, {PFIELD_FALL_TUBE, "TUBE", 0, "Tube", ""}, {PFIELD_FALL_CONE, "CONE", 0, "Cone", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem texture_items[] = { {PFIELD_TEX_RGB, "RGB", 0, "RGB", ""}, {PFIELD_TEX_GRAD, "GRADIENT", 0, "Gradient", ""}, {PFIELD_TEX_CURL, "CURL", 0, "Curl", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem zdirection_items[] = { {PFIELD_Z_BOTH, "BOTH", 0, "Both Z", ""}, {PFIELD_Z_POS, "POSITIVE", 0, "+Z", ""}, {PFIELD_Z_NEG, "NEGATIVE", 0, "-Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem guide_kink_items[] = { {0, "NONE", 0, "Nothing", ""}, @@ -1109,13 +1114,15 @@ static void rna_def_field(BlenderRNA *brna) {4, "BRAID", 0, "Braid", ""}, {5, "ROTATION", 0, "Rotation", ""}, {6, "ROLL", 0, "Roll", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem guide_kink_axis_items[] = { {0, "X", 0, "X", ""}, {1, "Y", 0, "Y", ""}, {2, "Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "FieldSettings", NULL); RNA_def_struct_sdna(srna, "PartDeflect"); @@ -1495,12 +1502,14 @@ static void rna_def_softbody(BlenderRNA *brna) {SBC_MODE_MIN, "MINIMAL", 0, "Minimal", "Minimal Spring length * Ball Size"}, {SBC_MODE_MAX, "MAXIMAL", 0, "Maximal", "Maximal Spring length * Ball Size"}, {SBC_MODE_AVGMINMAX, "MINMAX", 0, "AvMinMax", "(Min+Max)/2 * Ball Size"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem aerodynamics_type[] = { {0, "SIMPLE", 0, "Simple", "Edges receive a drag force from surrounding media"}, {1, "LIFT_FORCE", 0, "Lift Force", "Edges receive a lift force when passing through surrounding media"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SoftBodySettings", NULL); RNA_def_struct_sdna(srna, "SoftBody"); diff --git a/source/blender/makesrna/intern/rna_packedfile.c b/source/blender/makesrna/intern/rna_packedfile.c index 1fed98b33eb..e691ca46c69 100644 --- a/source/blender/makesrna/intern/rna_packedfile.c +++ b/source/blender/makesrna/intern/rna_packedfile.c @@ -38,7 +38,8 @@ EnumPropertyItem unpack_method_items[] = { {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""}, {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use Original File", ""}, {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write Original File (overwrite existing)", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME #else diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 52c41c869bb..d179612ae04 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -147,9 +147,9 @@ static void rna_ParticleHairKey_location_object_info(PointerRNA *ptr, ParticleSy /* given the pointer HairKey *hkey, we iterate over all particles in all * particle systems in the object "ob" in order to find - *- the ParticleSystemData to which the HairKey (and hence the particle) - * belongs (will be stored in psmd_pt) - *- the ParticleData to which the HairKey belongs (will be stored in pa_pt) + * - the ParticleSystemData to which the HairKey (and hence the particle) + * belongs (will be stored in psmd_pt) + * - the ParticleData to which the HairKey belongs (will be stored in pa_pt) * * not a very efficient way of getting hair key location data, * but it's the best we've got at the present @@ -242,16 +242,16 @@ static void rna_ParticleHairKey_location_object_set(PointerRNA *ptr, const float static void particle_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr, short flag) { if (ptr->type == &RNA_ParticleSystem) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; psys->recalc = flag; DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA); } else - DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA|flag); + DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA | flag); - WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL); + WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); } static void rna_Particle_redo(Main *bmain, Scene *scene, PointerRNA *ptr) { @@ -271,12 +271,12 @@ static void rna_Particle_reset(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Particle_change_type(Main *bmain, Scene *scene, PointerRNA *ptr) { - particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET|PSYS_RECALC_TYPE); + particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET | PSYS_RECALC_TYPE); } static void rna_Particle_change_physics(Main *bmain, Scene *scene, PointerRNA *ptr) { - particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET|PSYS_RECALC_PHYS); + particle_recalc(bmain, scene, ptr, PSYS_RECALC_RESET | PSYS_RECALC_PHYS); } static void rna_Particle_redo_child(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -300,12 +300,12 @@ static ParticleSystem *rna_particle_system_for_target(Object *ob, ParticleTarget static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr) { if (ptr->type == &RNA_ParticleTarget) { - Object *ob = (Object*)ptr->id.data; - ParticleTarget *pt = (ParticleTarget*)ptr->data; + Object *ob = (Object *)ptr->id.data; + ParticleTarget *pt = (ParticleTarget *)ptr->data; ParticleSystem *kpsys = NULL, *psys = rna_particle_system_for_target(ob, pt); if (pt->ob == ob || pt->ob == NULL) { - kpsys = BLI_findlink(&ob->particlesystem, pt->psys-1); + kpsys = BLI_findlink(&ob->particlesystem, pt->psys - 1); if (kpsys) pt->flag |= PTARGET_VALID; @@ -314,7 +314,7 @@ static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr } else { if (pt->ob) - kpsys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1); + kpsys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1); if (kpsys) pt->flag |= PTARGET_VALID; @@ -328,43 +328,43 @@ static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr DAG_scene_sort(bmain, scene); } - WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL); + WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); } static void rna_Particle_target_redo(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { if (ptr->type == &RNA_ParticleTarget) { - Object *ob = (Object*)ptr->id.data; - ParticleTarget *pt = (ParticleTarget*)ptr->data; + Object *ob = (Object *)ptr->id.data; + ParticleTarget *pt = (ParticleTarget *)ptr->data; ParticleSystem *psys = rna_particle_system_for_target(ob, pt); psys->recalc = PSYS_RECALC_REDO; DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL); + WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); } } static void rna_Particle_hair_dynamics(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - ParticleSystem *psys = (ParticleSystem*)ptr->data; + Object *ob = (Object *)ptr->id.data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; if (psys && !psys->clmd) { - psys->clmd = (ClothModifierData*)modifier_new(eModifierType_Cloth); + psys->clmd = (ClothModifierData *)modifier_new(eModifierType_Cloth); psys->clmd->sim_parms->goalspring = 0.0f; - psys->clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_GOAL|CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS; + psys->clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_GOAL | CLOTH_SIMSETTINGS_FLAG_NO_SPRING_COMPRESS; psys->clmd->coll_parms->flags &= ~CLOTH_COLLSETTINGS_FLAG_SELF; rna_Particle_redo(bmain, scene, ptr); } else - WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL); + WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); } static PointerRNA rna_particle_settings_get(PointerRNA *ptr) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; ParticleSettings *part = psys->part; return rna_pointer_inherit_refine(ptr, &RNA_ParticleSettings, part); @@ -372,7 +372,7 @@ static PointerRNA rna_particle_settings_get(PointerRNA *ptr) static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; int old_type = 0; @@ -392,21 +392,21 @@ static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value) } static void rna_Particle_abspathtime_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; float delta = settings->end + settings->lifetime - settings->sta; if (settings->draw & PART_ABS_PATH_TIME) { settings->path_start = settings->sta + settings->path_start * delta; settings->path_end = settings->sta + settings->path_end * delta; } else { - settings->path_start = (settings->path_start - settings->sta)/delta; - settings->path_end = (settings->path_end - settings->sta)/delta; + settings->path_start = (settings->path_start - settings->sta) / delta; + settings->path_end = (settings->path_end - settings->sta) / delta; } rna_Particle_redo(bmain, scene, ptr); } static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; /* check for clipping */ if (value > settings->end) @@ -423,7 +423,7 @@ static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value) static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; /* check for clipping */ if (value < settings->sta) @@ -434,44 +434,44 @@ static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value) static void rna_PartSetings_timestep_set(struct PointerRNA *ptr, float value) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; - settings->timetweak = value/0.04f; + settings->timetweak = value / 0.04f; } static float rna_PartSettings_timestep_get(struct PointerRNA *ptr) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; return settings->timetweak * 0.04f; } static void rna_PartSetting_hairlength_set(struct PointerRNA *ptr, float value) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; settings->normfac = value / 4.f; } static float rna_PartSetting_hairlength_get(struct PointerRNA *ptr) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; return settings->normfac * 4.f; } static void rna_PartSetting_linelentail_set(struct PointerRNA *ptr, float value) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; settings->draw_line[0] = value; } static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; return settings->draw_line[0]; } static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max, float *softmin, float *softmax) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; if (settings->type == PART_HAIR) { *min = 0.0f; @@ -484,20 +484,20 @@ static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, floa } static void rna_PartSetting_linelenhead_set(struct PointerRNA *ptr, float value) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; settings->draw_line[1] = value; } static float rna_PartSetting_linelenhead_get(struct PointerRNA *ptr) { - ParticleSettings *settings = (ParticleSettings*)ptr->data; + ParticleSettings *settings = (ParticleSettings *)ptr->data; return settings->draw_line[1]; } static int rna_PartSettings_is_fluid_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings*)ptr->data; + ParticleSettings *part = (ParticleSettings *)ptr->data; return part->type == PART_FLUID; } @@ -505,7 +505,7 @@ static int rna_PartSettings_is_fluid_get(PointerRNA *ptr) void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value) { Object *ob = ptr->id.data; - ParticleSystem *part = (ParticleSystem*)ptr->data; + ParticleSystem *part = (ParticleSystem *)ptr->data; /* copy the new name into the name slot */ BLI_strncpy_utf8(part->name, value, sizeof(part->name)); @@ -516,7 +516,7 @@ void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value) static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; ParticleTarget *pt = psys->targets.first; for (; pt; pt = pt->next) { @@ -528,15 +528,15 @@ static PointerRNA rna_ParticleSystem_active_particle_target_get(PointerRNA *ptr) static void rna_ParticleSystem_active_particle_target_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; *min = 0; - *max = BLI_countlist(&psys->targets)-1; + *max = BLI_countlist(&psys->targets) - 1; *max = MAX2(0, *max); } static int rna_ParticleSystem_active_particle_target_index_get(PointerRNA *ptr) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; ParticleTarget *pt = psys->targets.first; int i = 0; @@ -549,7 +549,7 @@ static int rna_ParticleSystem_active_particle_target_index_get(PointerRNA *ptr) static void rna_ParticleSystem_active_particle_target_index_set(struct PointerRNA *ptr, int value) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; ParticleTarget *pt = psys->targets.first; int i = 0; @@ -568,15 +568,15 @@ static int rna_ParticleTarget_name_length(PointerRNA *ptr) ParticleSystem *psys = NULL; if (pt->ob) - psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1); + psys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1); else { - Object *ob = (Object*) ptr->id.data; - psys = BLI_findlink(&ob->particlesystem, pt->psys-1); + Object *ob = (Object *) ptr->id.data; + psys = BLI_findlink(&ob->particlesystem, pt->psys - 1); } if (psys) { if (pt->ob) - return strlen(pt->ob->id.name+2) + 2 + strlen(psys->name); + return strlen(pt->ob->id.name + 2) + 2 + strlen(psys->name); else return strlen(psys->name); } @@ -595,15 +595,15 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str) ParticleSystem *psys = NULL; if (pt->ob) - psys = BLI_findlink(&pt->ob->particlesystem, pt->psys-1); + psys = BLI_findlink(&pt->ob->particlesystem, pt->psys - 1); else { - Object *ob = (Object*) ptr->id.data; - psys = BLI_findlink(&ob->particlesystem, pt->psys-1); + Object *ob = (Object *) ptr->id.data; + psys = BLI_findlink(&ob->particlesystem, pt->psys - 1); } if (psys) { if (pt->ob) - sprintf(str, "%s: %s", pt->ob->id.name+2, psys->name); + sprintf(str, "%s: %s", pt->ob->id.name + 2, psys->name); else strcpy(str, psys->name); } @@ -626,7 +626,7 @@ static char *rna_SPHFluidSettings_path(PointerRNA *ptr) SPHFluidSettings *fluid = (SPHFluidSettings *)ptr->data; if (particle_id_check(ptr)) { - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; if (part->fluid == fluid) return BLI_sprintfN("fluid"); @@ -636,19 +636,19 @@ static char *rna_SPHFluidSettings_path(PointerRNA *ptr) static int rna_ParticleSystem_multiple_caches_get(PointerRNA *ptr) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; return (psys->ptcaches.first != psys->ptcaches.last); } static int rna_ParticleSystem_editable_get(PointerRNA *ptr) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; return psys_check_edited(psys); } static int rna_ParticleSystem_edited_get(PointerRNA *ptr) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; if (psys->part && psys->part->type == PART_HAIR) return (psys->flag & PSYS_EDITED || (psys->edit && psys->edit->edited)); @@ -657,7 +657,7 @@ static int rna_ParticleSystem_edited_get(PointerRNA *ptr) } static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; ParticleDupliWeight *dw = part->dupliweights.first; for (; dw; dw = dw->next) { @@ -668,15 +668,15 @@ static PointerRNA rna_ParticleDupliWeight_active_get(PointerRNA *ptr) } static void rna_ParticleDupliWeight_active_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; *min = 0; - *max = BLI_countlist(&part->dupliweights)-1; + *max = BLI_countlist(&part->dupliweights) - 1; *max = MAX2(0, *max); } static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; ParticleDupliWeight *dw = part->dupliweights.first; int i = 0; @@ -689,7 +689,7 @@ static int rna_ParticleDupliWeight_active_index_get(PointerRNA *ptr) static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int value) { - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; ParticleDupliWeight *dw = part->dupliweights.first; int i = 0; @@ -715,7 +715,7 @@ static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str) ParticleDupliWeight *dw = ptr->data; if (dw->ob) - sprintf(str, "%s: %i", dw->ob->id.name+2, dw->count); + sprintf(str, "%s: %i", dw->ob->id.name + 2, dw->count); else strcpy(str, "No object"); } @@ -726,7 +726,7 @@ static EnumPropertyItem *rna_Particle_from_itemf(bContext *UNUSED(C), PointerRNA /*if (part->type==PART_REACTOR) */ /* return part_reactor_from_items; */ /*else */ - return part_from_items; + return part_from_items; } static EnumPropertyItem *rna_Particle_dist_itemf(bContext *UNUSED(C), PointerRNA *ptr, @@ -764,7 +764,7 @@ static EnumPropertyItem *rna_Particle_ren_as_itemf(bContext *UNUSED(C), PointerR static PointerRNA rna_Particle_field1_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; /* weak */ if (!part->pd) @@ -775,7 +775,7 @@ static PointerRNA rna_Particle_field1_get(PointerRNA *ptr) static PointerRNA rna_Particle_field2_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings*)ptr->id.data; + ParticleSettings *part = (ParticleSettings *)ptr->id.data; /* weak */ if (!part->pd2) @@ -787,10 +787,10 @@ static PointerRNA rna_Particle_field2_get(PointerRNA *ptr) static void psys_vg_name_get__internal(PointerRNA *ptr, char *value, int index) { Object *ob = ptr->id.data; - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; if (psys->vgroup[index] > 0) { - bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index]-1); + bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index] - 1); if (defGroup) { strcpy(value, defGroup->name); @@ -803,10 +803,10 @@ static void psys_vg_name_get__internal(PointerRNA *ptr, char *value, int index) static int psys_vg_name_len__internal(PointerRNA *ptr, int index) { Object *ob = ptr->id.data; - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; if (psys->vgroup[index] > 0) { - bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index]-1); + bDeformGroup *defGroup = BLI_findlink(&ob->defbase, psys->vgroup[index] - 1); if (defGroup) { return strlen(defGroup->name); @@ -817,9 +817,9 @@ static int psys_vg_name_len__internal(PointerRNA *ptr, int index) static void psys_vg_name_set__internal(PointerRNA *ptr, const char *value, int index) { Object *ob = ptr->id.data; - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; - if (value[0] =='\0') { + if (value[0] == '\0') { psys->vgroup[index] = 0; } else { @@ -834,19 +834,19 @@ static void psys_vg_name_set__internal(PointerRNA *ptr, const char *value, int i static char *rna_ParticleSystem_path(PointerRNA *ptr) { - ParticleSystem *psys = (ParticleSystem*)ptr->data; + ParticleSystem *psys = (ParticleSystem *)ptr->data; return BLI_sprintfN("particle_systems[\"%s\"]", psys->name); } static void rna_ParticleSettings_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings*)ptr->data; - rna_iterator_array_begin(iter, (void*)part->mtex, sizeof(MTex*), MAX_MTEX, 0, NULL); + ParticleSettings *part = (ParticleSettings *)ptr->data; + rna_iterator_array_begin(iter, (void *)part->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL); } static PointerRNA rna_ParticleSettings_active_texture_get(PointerRNA *ptr) { - ParticleSettings *part = (ParticleSettings*)ptr->data; + ParticleSettings *part = (ParticleSettings *)ptr->data; Tex *tex; tex = give_current_particle_texture(part); @@ -855,7 +855,7 @@ static PointerRNA rna_ParticleSettings_active_texture_get(PointerRNA *ptr) static void rna_ParticleSettings_active_texture_set(PointerRNA *ptr, PointerRNA value) { - ParticleSettings *part = (ParticleSettings*)ptr->data; + ParticleSettings *part = (ParticleSettings *)ptr->data; set_current_particle_texture(part, value.data); } @@ -1259,35 +1259,40 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) {TEXCO_ORCO, "ORCO", 0, "Generated", "Use the original undeformed coordinates of the object"}, {TEXCO_STRAND, "STRAND", 0, "Strand / Particle", "Use normalized strand texture coordinate (1D) or particle age (X) and trail position (Y)"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_mapping_items[] = { {MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"}, {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"}, {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"}, {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_x_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, {2, "Y", 0, "Y", ""}, {3, "Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_y_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, {2, "Y", 0, "Y", ""}, {3, "Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_z_mapping_items[] = { {0, "NONE", 0, "None", ""}, {1, "X", 0, "X", ""}, {2, "Y", 0, "Y", ""}, {3, "Z", 0, "Z", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ParticleSettingsTextureSlot", "TextureSlot"); RNA_def_struct_sdna(srna, "MTex"); @@ -1914,7 +1919,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) /*TODO: not found in UI, readonly? */ prop = RNA_def_property(srna, "keys_step", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0, SHRT_MAX);/*TODO:min,max */ + RNA_def_property_range(prop, 0, SHRT_MAX); /*TODO:min,max */ RNA_def_property_ui_text(prop, "Keys Step", ""); /* adaptive path rendering */ @@ -2068,7 +2073,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) /* general values */ prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sta");/*optional if prop names are the same */ + RNA_def_property_float_sdna(prop, NULL, "sta"); /*optional if prop names are the same */ RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL); @@ -2153,7 +2158,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Number", "Total number of particles"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - prop = RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);/*TODO: can we get a better name for userjit? */ + prop = RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED); /*TODO: can we get a better name for userjit? */ RNA_def_property_int_sdna(prop, NULL, "userjit"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0, 1000); @@ -2183,7 +2188,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) /* initial velocity factors */ prop = RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "normfac");/*optional if prop names are the same */ + RNA_def_property_float_sdna(prop, NULL, "normfac"); /*optional if prop names are the same */ RNA_def_property_range(prop, -1000.0f, 1000.0f); RNA_def_property_ui_range(prop, 0, 100, 1, 3); RNA_def_property_ui_text(prop, "Normal", "Let the surface normal give the particle a starting speed"); @@ -2197,7 +2202,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop = RNA_def_property(srna, "factor_random", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "randfac");/*optional if prop names are the same */ + RNA_def_property_float_sdna(prop, NULL, "randfac"); /*optional if prop names are the same */ RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_range(prop, 0, 100, 1, 3); RNA_def_property_ui_text(prop, "Random", "Give the starting speed a random variation"); @@ -2322,7 +2327,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) /* children */ prop = RNA_def_property(srna, "child_nbr", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "child_nbr");/*optional if prop names are the same */ + RNA_def_property_int_sdna(prop, NULL, "child_nbr"); /*optional if prop names are the same */ RNA_def_property_range(prop, 0, 100000); RNA_def_property_ui_range(prop, 0, 1000, 1, 0); RNA_def_property_ui_text(prop, "Children Per Parent", "Number of children/parent"); @@ -2683,7 +2688,7 @@ static void rna_def_particle_system(BlenderRNA *brna) prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Particle system name"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER | NA_RENAME, NULL); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ParticleSystem_name_set"); RNA_def_struct_name_property(srna, prop); @@ -2692,7 +2697,7 @@ static void rna_def_particle_system(BlenderRNA *brna) prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE); /*RNA_def_property_pointer_sdna(prop, NULL, "part"); */ RNA_def_property_struct_type(prop, "ParticleSettings"); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL, NULL); RNA_def_property_ui_text(prop, "Settings", "Particle system settings"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); @@ -2970,7 +2975,7 @@ static void rna_def_particle_system(BlenderRNA *brna) * the next time-step. The user should change ParticlSettings.subframes or * ParticleSettings.courant_target instead. */ prop = RNA_def_property(srna, "dt_frac", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 1.0f/101.0f, 1.0f); + RNA_def_property_range(prop, 1.0f / 101.0f, 1.0f); RNA_def_property_ui_text(prop, "Timestep", "The current simulation time step size, as a fraction of a frame"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index c87dabf46ca..6ec0932dba8 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -57,7 +57,8 @@ EnumPropertyItem posebone_rotmode_items[] = { {ROT_MODE_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order (prone to Gimbal Lock)"}, {ROT_MODE_AXISANGLE, "AXIS_ANGLE", 0, "Axis Angle", "Axis Angle (W+XYZ), defines a rotation around some axis defined by 3D-Vector"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -103,7 +104,7 @@ static void rna_Pose_IK_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe static char *rna_PoseBone_path(PointerRNA *ptr) { - return BLI_sprintfN("pose.bones[\"%s\"]", ((bPoseChannel*)ptr->data)->name); + return BLI_sprintfN("pose.bones[\"%s\"]", ((bPoseChannel *)ptr->data)->name); } static void rna_BoneGroup_color_set_set(PointerRNA *ptr, int value) @@ -163,7 +164,7 @@ static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, int create) static void rna_Pose_ik_solver_set(struct PointerRNA *ptr, int value) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; if (pose->iksolver != value) { /* the solver has changed, must clean any temporary structures */ @@ -182,14 +183,14 @@ static void rna_Pose_ik_solver_update(Main *bmain, Scene *scene, PointerRNA *ptr Object *ob = ptr->id.data; bPose *pose = ptr->data; - pose->flag |= POSE_RECALC; /* checks & sorts pose channels */ + pose->flag |= POSE_RECALC; /* checks & sorts pose channels */ DAG_scene_sort(bmain, scene); BKE_pose_update_constraint_flags(pose); object_test_constraints(ob); - DAG_id_tag_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB); + DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB); } /* rotation - axis-angle */ @@ -228,8 +229,8 @@ static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value) static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value) { - Object *ob = (Object*)ptr->id.data; - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + Object *ob = (Object *)ptr->id.data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; char oldname[sizeof(pchan->name)], newname[sizeof(pchan->name)]; /* need to be on the stack */ @@ -241,8 +242,8 @@ static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value) static int rna_PoseChannel_has_ik_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + Object *ob = (Object *)ptr->id.data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; return ED_pose_channel_in_IK_chain(ob, pchan); } @@ -252,28 +253,28 @@ StructRNA *rna_IKParam_refine(PointerRNA *ptr) bIKParam *param = (bIKParam *)ptr->data; switch (param->iksolver) { - case IKSOLVER_ITASC: - return &RNA_Itasc; - default: - return &RNA_IKParam; + case IKSOLVER_ITASC: + return &RNA_Itasc; + default: + return &RNA_IKParam; } } PointerRNA rna_Pose_ikparam_get(struct PointerRNA *ptr) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_IKParam, pose->ikparam); } static StructRNA *rna_Pose_ikparam_typef(PointerRNA *ptr) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; switch (pose->iksolver) { - case IKSOLVER_ITASC: - return &RNA_Itasc; - default: - return &RNA_IKParam; + case IKSOLVER_ITASC: + return &RNA_Itasc; + default: + return &RNA_IKParam; } } @@ -307,13 +308,13 @@ static void rna_Itasc_update_rebuild(Main *bmain, Scene *scene, PointerRNA *ptr) Object *ob = ptr->id.data; bPose *pose = ob->pose; - pose->flag |= POSE_RECALC; /* checks & sorts pose channels */ + pose->flag |= POSE_RECALC; /* checks & sorts pose channels */ rna_Itasc_update(bmain, scene, ptr); } static void rna_PoseChannel_bone_custom_set(PointerRNA *ptr, PointerRNA value) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; if (pchan->custom) { @@ -328,13 +329,13 @@ static void rna_PoseChannel_bone_custom_set(PointerRNA *ptr, PointerRNA value) static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; bPose *pose = (ob) ? ob->pose : NULL; - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; bActionGroup *grp; if (pose) - grp = BLI_findlink(&pose->agroups, pchan->agrp_index-1); + grp = BLI_findlink(&pose->agroups, pchan->agrp_index - 1); else grp = NULL; @@ -343,9 +344,9 @@ static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr) static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; bPose *pose = (ob) ? ob->pose : NULL; - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; if (pose) pchan->agrp_index = BLI_findindex(&pose->agroups, value.data) + 1; @@ -355,25 +356,25 @@ static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value) static int rna_PoseChannel_bone_group_index_get(PointerRNA *ptr) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; - return MAX2(pchan->agrp_index-1, 0); + bPoseChannel *pchan = (bPoseChannel *)ptr->data; + return MAX2(pchan->agrp_index - 1, 0); } static void rna_PoseChannel_bone_group_index_set(PointerRNA *ptr, int value) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; - pchan->agrp_index = value+1; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; + pchan->agrp_index = value + 1; } static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; bPose *pose = (ob) ? ob->pose : NULL; *min = 0; if (pose) { - *max = BLI_countlist(&pose->agroups)-1; + *max = BLI_countlist(&pose->agroups) - 1; *max = MAX2(0, *max); } else @@ -382,44 +383,44 @@ static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, in static PointerRNA rna_Pose_active_bone_group_get(PointerRNA *ptr) { - bPose *pose = (bPose*)ptr->data; - return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group-1)); + bPose *pose = (bPose *)ptr->data; + return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group - 1)); } static void rna_Pose_active_bone_group_set(PointerRNA *ptr, PointerRNA value) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; pose->active_group = BLI_findindex(&pose->agroups, value.data) + 1; } static int rna_Pose_active_bone_group_index_get(PointerRNA *ptr) { - bPose *pose = (bPose*)ptr->data; - return MAX2(pose->active_group-1, 0); + bPose *pose = (bPose *)ptr->data; + return MAX2(pose->active_group - 1, 0); } static void rna_Pose_active_bone_group_index_set(PointerRNA *ptr, int value) { - bPose *pose = (bPose*)ptr->data; - pose->active_group = value+1; + bPose *pose = (bPose *)ptr->data; + pose->active_group = value + 1; } static void rna_Pose_active_bone_group_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; *min = 0; - *max = BLI_countlist(&pose->agroups)-1; + *max = BLI_countlist(&pose->agroups) - 1; *max = MAX2(0, *max); } #if 0 static void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int index) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; bActionGroup *grp; - grp = BLI_findlink(&pose->agroups, index-1); + grp = BLI_findlink(&pose->agroups, index - 1); if (grp) BLI_strncpy(value, grp->name, sizeof(grp->name)); else value[0] = '\0'; @@ -427,16 +428,16 @@ static void rna_pose_bgroup_name_index_get(PointerRNA *ptr, char *value, int ind static int rna_pose_bgroup_name_index_length(PointerRNA *ptr, int index) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; bActionGroup *grp; - grp = BLI_findlink(&pose->agroups, index-1); - return (grp)? strlen(grp->name): 0; + grp = BLI_findlink(&pose->agroups, index - 1); + return (grp) ? strlen(grp->name) : 0; } static void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, short *index) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; bActionGroup *grp; int a; @@ -452,7 +453,7 @@ static void rna_pose_bgroup_name_index_set(PointerRNA *ptr, const char *value, s static void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; bActionGroup *grp; for (grp = pose->agroups.first; grp; grp = grp->next) { @@ -468,14 +469,14 @@ static void rna_pose_pgroup_name_set(PointerRNA *ptr, const char *value, char *r static PointerRNA rna_PoseChannel_active_constraint_get(PointerRNA *ptr) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; bConstraint *con = constraints_get_active(&pchan->constraints); return rna_pointer_inherit_refine(ptr, &RNA_Constraint, con); } static void rna_PoseChannel_active_constraint_set(PointerRNA *ptr, PointerRNA value) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; constraints_set_active(&pchan->constraints, (bConstraint *)value.data); } @@ -500,7 +501,7 @@ static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, Repo remove_constraint(&pchan->constraints, con); ED_object_constraint_update(ob); constraints_set_active(&pchan->constraints, NULL); - WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, id); + WM_main_add_notifier(NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, id); if (is_ik) { BIK_clear_data(ob->pose); @@ -510,16 +511,16 @@ static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, Repo static int rna_PoseChannel_proxy_editable(PointerRNA *ptr) { - Object *ob = (Object*)ptr->id.data; + Object *ob = (Object *)ptr->id.data; bArmature *arm = ob->data; - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; - return (ob->proxy && pchan->bone && (pchan->bone->layer & arm->layer_protected))? 0: PROP_EDITABLE; + return (ob->proxy && pchan->bone && (pchan->bone->layer & arm->layer_protected)) ? 0 : PROP_EDITABLE; } static int rna_PoseChannel_location_editable(PointerRNA *ptr, int index) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; /* only if the axis in question is locked, not editable... */ if ((index == 0) && (pchan->protectflag & OB_LOCK_LOCX)) @@ -534,7 +535,7 @@ static int rna_PoseChannel_location_editable(PointerRNA *ptr, int index) static int rna_PoseChannel_scale_editable(PointerRNA *ptr, int index) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; /* only if the axis in question is locked, not editable... */ if ((index == 0) && (pchan->protectflag & OB_LOCK_SCALEX)) @@ -549,7 +550,7 @@ static int rna_PoseChannel_scale_editable(PointerRNA *ptr, int index) static int rna_PoseChannel_rotation_euler_editable(PointerRNA *ptr, int index) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; /* only if the axis in question is locked, not editable... */ if ((index == 0) && (pchan->protectflag & OB_LOCK_ROTX)) @@ -564,7 +565,7 @@ static int rna_PoseChannel_rotation_euler_editable(PointerRNA *ptr, int index) static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; /* only consider locks if locking components individually... */ if (pchan->protectflag & OB_LOCK_ROT4D) { @@ -585,7 +586,7 @@ static int rna_PoseChannel_rotation_4d_editable(PointerRNA *ptr, int index) /* not essential, but much faster then the default lookup function */ int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr) { - bPose *pose = (bPose*)ptr->data; + bPose *pose = (bPose *)ptr->data; bPoseChannel *pchan = BKE_pose_channel_find_name(pose, key); if (pchan) { RNA_pointer_create(ptr->id.data, &RNA_PoseBone, pchan, r_ptr); @@ -598,20 +599,20 @@ int rna_PoseBones_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ static void rna_PoseChannel_matrix_basis_get(PointerRNA *ptr, float *values) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; BKE_pchan_to_mat4(pchan, (float (*)[4])values); } static void rna_PoseChannel_matrix_basis_set(PointerRNA *ptr, const float *values) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; BKE_pchan_apply_mat4(pchan, (float (*)[4])values, FALSE); /* no compat for predictable result */ } static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values) { - bPoseChannel *pchan = (bPoseChannel*)ptr->data; - Object *ob = (Object*)ptr->id.data; + bPoseChannel *pchan = (bPoseChannel *)ptr->data; + Object *ob = (Object *)ptr->id.data; float tmat[4][4]; BKE_armature_mat_pose_to_bone_ex(ob, pchan, (float (*)[4])values, tmat); @@ -646,7 +647,8 @@ static void rna_def_bone_group(BlenderRNA *brna) {19, "THEME19", 0, "19 - Theme Color Set", ""}, {20, "THEME20", 0, "20 - Theme Color Set", ""}, {-1, "CUSTOM", 0, "Custom Color Set", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; StructRNA *srna; PropertyRNA *prop; @@ -671,27 +673,29 @@ static void rna_def_bone_group(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_colorSets_items); RNA_def_property_enum_funcs(prop, NULL, "rna_BoneGroup_color_set_set", NULL); RNA_def_property_ui_text(prop, "Color Set", "Custom color set to use"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - /* TODO: editing the colors for this should result in changes to the color type... */ + /* TODO: editing the colors for this should result in changes to the color type... */ prop = RNA_def_property(srna, "colors", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "ThemeBoneColorSet"); - /* NOTE: the DNA data is not really a pointer, but this code works :) */ + /* NOTE: the DNA data is not really a pointer, but this code works :) */ RNA_def_property_pointer_sdna(prop, NULL, "cs"); RNA_def_property_ui_text(prop, "Colors", "Copy of the colors associated with the group's color set"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); } static EnumPropertyItem prop_iksolver_items[] = { {IKSOLVER_LEGACY, "LEGACY", 0, "Legacy", "Original IK solver"}, {IKSOLVER_ITASC, "ITASC", 0, "iTaSC", "Multi constraint, stateful IK solver"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static EnumPropertyItem prop_solver_items[] = { {ITASC_SOLVER_SDLS, "SDLS", 0, "SDLS", "Selective Damped Least Square"}, {ITASC_SOLVER_DLS, "DLS", 0, "DLS", "Damped Least Square with Numerical Filtering"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cprop) @@ -728,16 +732,16 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro func = RNA_def_function(srna, "remove", "rna_PoseChannel_constraints_remove"); RNA_def_function_ui_description(func, "Remove a constraint from this object"); - RNA_def_function_flag(func, FUNC_USE_REPORTS|FUNC_USE_SELF_ID); /* ID needed for refresh */ + RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_SELF_ID); /* ID needed for refresh */ /* constraint to remove */ parm = RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } static void rna_def_pose_channel(BlenderRNA *brna) { - static float default_quat[4] = {1, 0, 0, 0}; /* default quaternion values */ - static float default_axisAngle[4] = {0, 0, 1, 0}; /* default axis-angle rotation values */ + static float default_quat[4] = {1, 0, 0, 0}; /* default quaternion values */ + static float default_axisAngle[4] = {0, 0, 1, 0}; /* default axis-angle rotation values */ static float default_scale[3] = {1, 1, 1}; /* default scale values */ const int matrix_dimsize[] = {4, 4}; @@ -791,31 +795,31 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_editable_array_func(prop, "rna_PoseChannel_location_editable"); RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); - /* 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_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_editable_array_func(prop, "rna_PoseChannel_scale_editable"); RNA_def_property_float_array_default(prop, default_scale); RNA_def_property_ui_text(prop, "Scale", ""); - /* 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_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, PROP_QUATERNION); RNA_def_property_float_sdna(prop, NULL, "quat"); RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable"); RNA_def_property_float_array_default(prop, default_quat); RNA_def_property_ui_text(prop, "Quaternion Rotation", "Rotation in Quaternions"); - /* 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_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but - * having a single one is better for Keyframing and other property-management situations... - */ + /* XXX: for axis-angle, it would have been nice to have 2 separate fields for UI purposes, but + * having a single one is better for Keyframing and other property-management situations... + */ prop = RNA_def_property(srna, "rotation_axis_angle", PROP_FLOAT, PROP_AXISANGLE); RNA_def_property_array(prop, 4); RNA_def_property_float_funcs(prop, "rna_PoseChannel_rotation_axis_angle_get", @@ -823,26 +827,26 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_4d_editable"); RNA_def_property_float_array_default(prop, default_axisAngle); RNA_def_property_ui_text(prop, "Axis-Angle Rotation", "Angle of Rotation for Axis-Angle rotation representation"); - /* 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_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "rotation_euler", PROP_FLOAT, PROP_EULER); RNA_def_property_float_sdna(prop, NULL, "eul"); RNA_def_property_editable_array_func(prop, "rna_PoseChannel_rotation_euler_editable"); - /* 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, "Euler Rotation", "Rotation in Eulers"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_enum_items(prop, posebone_rotmode_items); /* XXX move to using a single define of this someday */ 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"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); /* transform matrices - should be read-only since these are set directly by AnimSys evaluation */ prop = RNA_def_property(srna, "matrix_channel", PROP_FLOAT, PROP_MATRIX); @@ -858,7 +862,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) "Alternative access to location/scale/rotation relative to the parent and own rest bone"); RNA_def_property_float_funcs(prop, "rna_PoseChannel_matrix_basis_get", "rna_PoseChannel_matrix_basis_set", NULL); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); /* final matrix */ prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); @@ -867,7 +871,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_float_funcs(prop, NULL, "rna_PoseChannel_matrix_set", NULL); RNA_def_property_ui_text(prop, "Pose Matrix", "Final 4x4 matrix after constraints and drivers are applied (object space)"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); /* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */ prop = RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION); @@ -887,139 +891,139 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "lock_ik_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF); RNA_def_property_ui_text(prop, "IK X Lock", "Disallow movement around the X axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "lock_ik_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF); RNA_def_property_ui_text(prop, "IK Y Lock", "Disallow movement around the Y axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "lock_ik_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF); RNA_def_property_ui_text(prop, "IK Z Lock", "Disallow movement around the Z axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "use_ik_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT); RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "use_ik_limit_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT); RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "use_ik_limit_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT); RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "use_ik_rotation_control", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ROTCTL); RNA_def_property_ui_text(prop, "IK rot control", "Apply channel rotation as IK constraint"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "use_ik_linear_control", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_LINCTL); RNA_def_property_ui_text(prop, "IK rot control", "Apply channel size as IK constraint if stretching is enabled"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmin[0]"); RNA_def_property_range(prop, -M_PI, 0.0f); RNA_def_property_ui_text(prop, "IK X Minimum", "Minimum angles for IK Limit"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_max_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmax[0]"); RNA_def_property_range(prop, 0.0f, M_PI); RNA_def_property_ui_text(prop, "IK X Maximum", "Maximum angles for IK Limit"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_min_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmin[1]"); RNA_def_property_range(prop, -M_PI, 0.0f); RNA_def_property_ui_text(prop, "IK Y Minimum", "Minimum angles for IK Limit"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_max_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmax[1]"); RNA_def_property_range(prop, 0.0f, M_PI); RNA_def_property_ui_text(prop, "IK Y Maximum", "Maximum angles for IK Limit"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_min_z", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmin[2]"); RNA_def_property_range(prop, -M_PI, 0.0f); RNA_def_property_ui_text(prop, "IK Z Minimum", "Minimum angles for IK Limit"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_max_z", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmax[2]"); RNA_def_property_range(prop, 0.0f, M_PI); RNA_def_property_ui_text(prop, "IK Z Maximum", "Maximum angles for IK Limit"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_stiffness_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stiffness[0]"); RNA_def_property_range(prop, 0.0f, 0.99f); RNA_def_property_ui_text(prop, "IK X Stiffness", "IK stiffness around the X axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_stiffness_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stiffness[1]"); RNA_def_property_range(prop, 0.0f, 0.99f); RNA_def_property_ui_text(prop, "IK Y Stiffness", "IK stiffness around the Y axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_stiffness_z", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stiffness[2]"); RNA_def_property_range(prop, 0.0f, 0.99f); RNA_def_property_ui_text(prop, "IK Z Stiffness", "IK stiffness around the Z axis"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_stretch", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ikstretch"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_IK_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_IK_update"); prop = RNA_def_property(srna, "ik_rotation_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ikrotweight"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "IK Rot Weight", "Weight of rotation constraint for IK"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "ik_linear_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "iklinweight"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "IK Lin Weight", "Weight of scale constraint for IK"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); /* custom bone shapes */ prop = RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE); @@ -1029,7 +1033,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, "rna_PoseChannel_bone_custom_set", NULL, NULL); RNA_def_property_ui_text(prop, "Custom Object", "Object that defines custom draw type for this bone"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "custom_shape_transform", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "custom_tx"); @@ -1038,7 +1042,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Custom Shape Transform", "Bone that defines the display transform of this custom shape"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); /* bone groups */ prop = RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE); @@ -1049,7 +1053,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) "rna_PoseChannel_bone_group_index_range"); RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group)"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "BoneGroup"); @@ -1058,7 +1062,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) "rna_PoseChannel_bone_group_set", NULL, NULL); RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); /* transform locks */ prop = RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_NONE); @@ -1067,7 +1071,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock Location", "Lock editing of location in the interface"); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTX); @@ -1075,25 +1079,25 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock Rotation", "Lock editing of rotation in the interface"); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - /* XXX this is sub-optimal - it really should be included above, but due to technical reasons - * we can't do this! */ + /* XXX this is sub-optimal - it really should be included above, but due to technical reasons + * we can't do this! */ prop = RNA_def_property(srna, "lock_rotation_w", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROTW); RNA_def_property_ui_text(prop, "Lock Rotation (4D Angle)", "Lock editing of 'angle' component of four-component rotations in the interface"); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); - /* XXX this needs a better name */ + /* XXX this needs a better name */ prop = RNA_def_property(srna, "lock_rotations_4d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_ROT4D); RNA_def_property_ui_text(prop, "Lock Rotations (4D)", "Lock editing of four component rotations by components (instead of as Eulers)"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "lock_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_SCALEX); @@ -1101,7 +1105,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock Scale", "Lock editing of scale in the interface"); RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); RNA_api_pose_channel(srna); } @@ -1114,7 +1118,8 @@ static void rna_def_pose_itasc(BlenderRNA *brna) {ITASC_SIMULATION, "SIMULATION", 0, "Simulation", "Statefull solver running in real-time context and ignoring actions " "and non-IK constraints"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static const EnumPropertyItem prop_itasc_reiteration_items[] = { {0, "NEVER", 0, "Never", "The solver does not reiterate, not even on first frame (starts from rest pose)"}, {ITASC_INITIAL_REITERATION, "INITIAL", 0, "Initial", @@ -1122,7 +1127,8 @@ static void rna_def_pose_itasc(BlenderRNA *brna) "subsequent frame"}, {ITASC_INITIAL_REITERATION|ITASC_REITERATION, "ALWAYS", 0, "Always", "The solver reiterates (converges) on all frames"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; StructRNA *srna; PropertyRNA *prop; @@ -1135,26 +1141,26 @@ static void rna_def_pose_itasc(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "precision"); RNA_def_property_range(prop, 0.0f, 0.1f); RNA_def_property_ui_text(prop, "Precision", "Precision of convergence in case of reiteration"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "numiter"); RNA_def_property_range(prop, 1.f, 1000.f); RNA_def_property_ui_text(prop, "Iterations", "Maximum number of iterations for convergence in case of reiteration"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "step_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "numstep"); RNA_def_property_range(prop, 1.f, 50.f); RNA_def_property_ui_text(prop, "Num steps", "Divide the frame interval into this many steps"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_itasc_mode_items); RNA_def_property_ui_text(prop, "Mode", NULL); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update_rebuild"); prop = RNA_def_property(srna, "reiteration_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); @@ -1162,26 +1168,26 @@ static void rna_def_pose_itasc(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Reiteration", "Defines if the solver is allowed to reiterate (converge until " "precision is met) on none, first or all frames"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "use_auto_step", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ITASC_AUTO_STEP); RNA_def_property_ui_text(prop, "Auto step", "Automatically determine the optimal number of steps for best " "performance/accuracy trade off"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "step_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "minstep"); RNA_def_property_range(prop, 0.0f, 0.1f); RNA_def_property_ui_text(prop, "Min step", "Lower bound for timestep in second in case of automatic substeps"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "step_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxstep"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Max step", "Higher bound for timestep in second in case of automatic substeps"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "feedback", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "feedback"); @@ -1189,19 +1195,19 @@ static void rna_def_pose_itasc(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Feedback", "Feedback coefficient for error correction, average response time is 1/feedback " "(default=20)"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "velocity_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxvel"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Max Velocity", "Maximum joint velocity in rad/s (default=50)"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "solver"); RNA_def_property_enum_items(prop, prop_solver_items); RNA_def_property_ui_text(prop, "Solver", "Solving method selection: automatic damping or manual damping"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update_rebuild"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update_rebuild"); prop = RNA_def_property(srna, "damping_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dampmax"); @@ -1209,7 +1215,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Damp", "Maximum damping coefficient when singular value is nearly 0 " "(higher values=more stability, less reactivity - default=0.5)"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); prop = RNA_def_property(srna, "damping_epsilon", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dampeps"); @@ -1217,7 +1223,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Epsilon", "Singular value under which damping is progressively applied " "(higher values=more stability, less reactivity - default=0.1)"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Itasc_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); } static void rna_def_pose_ikparam(BlenderRNA *brna) @@ -1258,14 +1264,14 @@ static void rna_def_bone_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "active_group"); RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set", "rna_Pose_active_bone_group_index_range"); RNA_def_property_ui_text(prop, "Active Bone Group Index", "Active index in bone groups array"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_update"); } static void rna_def_pose(BlenderRNA *brna) @@ -1283,7 +1289,7 @@ static void rna_def_pose(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "chanbase", NULL); RNA_def_property_struct_type(prop, "PoseBone"); RNA_def_property_ui_text(prop, "Pose Bones", "Individual pose bones for the armature"); - /* can be removed, only for fast lookup */ + /* can be removed, only for fast lookup */ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, "rna_PoseBones_lookup_string", NULL); /* bone groups */ @@ -1300,7 +1306,7 @@ static void rna_def_pose(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_iksolver_items); RNA_def_property_ui_text(prop, "IK Solver", "Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_ik_solver_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_ik_solver_update"); prop = RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "IKParam"); diff --git a/source/blender/makesrna/intern/rna_pose_api.c b/source/blender/makesrna/intern/rna_pose_api.c index 531a85edeea..ed4690ac6a7 100644 --- a/source/blender/makesrna/intern/rna_pose_api.c +++ b/source/blender/makesrna/intern/rna_pose_api.c @@ -71,7 +71,7 @@ void RNA_api_pose_channel(StructRNA *srna) func = RNA_def_function(srna, "evaluate_envelope", "rna_PoseBone_do_envelope"); RNA_def_function_ui_description(func, "Calculate bone envelope at given point"); parm = RNA_def_float_vector_xyz(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "Point", - "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); + "Position in 3d space to evaluate", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); /* return value */ parm = RNA_def_float(func, "factor", 0, -FLT_MAX, FLT_MAX, "Factor", "Envelope factor", -FLT_MAX, FLT_MAX); diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c index 637e21cf6c5..bf9f924489b 100644 --- a/source/blender/makesrna/intern/rna_property.c +++ b/source/blender/makesrna/intern/rna_property.c @@ -41,16 +41,17 @@ EnumPropertyItem gameproperty_type_items[] = { {GPROP_FLOAT, "FLOAT", 0, "Float", "Floating-Point Property"}, {GPROP_STRING, "STRING", 0, "String", "String Property"}, {GPROP_TIME, "TIMER", 0, "Timer", "Timer Property"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME #include "BKE_property.h" -static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr) +static StructRNA *rna_GameProperty_refine(struct PointerRNA *ptr) { - bProperty *property = (bProperty*)ptr->data; + bProperty *property = (bProperty *)ptr->data; switch (property->type) { case GPROP_BOOL: @@ -71,20 +72,20 @@ static StructRNA* rna_GameProperty_refine(struct PointerRNA *ptr) /* for both float and timer */ static float rna_GameFloatProperty_value_get(PointerRNA *ptr) { - bProperty *prop = (bProperty*)(ptr->data); - return *(float*)(&prop->data); + bProperty *prop = (bProperty *)(ptr->data); + return *(float *)(&prop->data); } static void rna_GameFloatProperty_value_set(PointerRNA *ptr, float value) { - bProperty *prop = (bProperty*)(ptr->data); + bProperty *prop = (bProperty *)(ptr->data); CLAMP(value, -10000.0f, 10000.0f); - *(float*)(&prop->data) = value; + *(float *)(&prop->data) = value; } static void rna_GameProperty_type_set(PointerRNA *ptr, int value) { - bProperty *prop = (bProperty*)(ptr->data); + bProperty *prop = (bProperty *)(ptr->data); if (prop->type != value) { prop->type = value; @@ -94,7 +95,7 @@ static void rna_GameProperty_type_set(PointerRNA *ptr, int value) static void rna_GameProperty_name_set(PointerRNA *ptr, const char *value) { - bProperty *prop = (bProperty*)(ptr->data); + bProperty *prop = (bProperty *)(ptr->data); BLI_strncpy_utf8(prop->name, value, sizeof(prop->name)); unique_property(NULL, prop, 1); } diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 69d9ce05d7d..fff16650a93 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -184,10 +184,10 @@ static StructRNA *rna_RenderEngine_register(Main *bmain, ReportList *reports, vo et->ext.free = free; RNA_struct_blender_type_set(et->ext.srna, et); - et->update = (have_function[0])? engine_update: NULL; - et->render = (have_function[1])? engine_render: NULL; - et->view_update = (have_function[2])? engine_view_update: NULL; - et->view_draw = (have_function[3])? engine_view_draw: NULL; + et->update = (have_function[0]) ? engine_update : NULL; + et->render = (have_function[1]) ? engine_render : NULL; + et->view_update = (have_function[2]) ? engine_view_update : NULL; + et->view_draw = (have_function[3]) ? engine_view_draw : NULL; BLI_addtail(&R_engines, et); @@ -200,66 +200,66 @@ static void **rna_RenderEngine_instance(PointerRNA *ptr) return &engine->py_instance; } -static StructRNA* rna_RenderEngine_refine(PointerRNA *ptr) +static StructRNA *rna_RenderEngine_refine(PointerRNA *ptr) { - RenderEngine *engine = (RenderEngine*)ptr->data; - return (engine->type && engine->type->ext.srna)? engine->type->ext.srna: &RNA_RenderEngine; + RenderEngine *engine = (RenderEngine *)ptr->data; + return (engine->type && engine->type->ext.srna) ? engine->type->ext.srna : &RNA_RenderEngine; } static void rna_RenderResult_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - RenderResult *rr = (RenderResult*)ptr->data; + RenderResult *rr = (RenderResult *)ptr->data; rna_iterator_listbase_begin(iter, &rr->layers, NULL); } static void rna_RenderLayer_passes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - RenderLayer *rl = (RenderLayer*)ptr->data; + RenderLayer *rl = (RenderLayer *)ptr->data; rna_iterator_listbase_begin(iter, &rl->passes, NULL); } static int rna_RenderLayer_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - RenderLayer *rl = (RenderLayer*)ptr->data; + RenderLayer *rl = (RenderLayer *)ptr->data; - length[0] = rl->rectx*rl->recty; + length[0] = rl->rectx * rl->recty; length[1] = 4; - return length[0]*length[1]; + return length[0] * length[1]; } static void rna_RenderLayer_rect_get(PointerRNA *ptr, float *values) { - RenderLayer *rl = (RenderLayer*)ptr->data; - memcpy(values, rl->rectf, sizeof(float)*rl->rectx*rl->recty*4); + RenderLayer *rl = (RenderLayer *)ptr->data; + memcpy(values, rl->rectf, sizeof(float) * rl->rectx * rl->recty * 4); } void rna_RenderLayer_rect_set(PointerRNA *ptr, const float *values) { - RenderLayer *rl = (RenderLayer*)ptr->data; - memcpy(rl->rectf, values, sizeof(float)*rl->rectx*rl->recty*4); + RenderLayer *rl = (RenderLayer *)ptr->data; + memcpy(rl->rectf, values, sizeof(float) * rl->rectx * rl->recty * 4); } static int rna_RenderPass_rect_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - RenderPass *rpass = (RenderPass*)ptr->data; + RenderPass *rpass = (RenderPass *)ptr->data; - length[0] = rpass->rectx*rpass->recty; + length[0] = rpass->rectx * rpass->recty; length[1] = rpass->channels; - return length[0]*length[1]; + return length[0] * length[1]; } static void rna_RenderPass_rect_get(PointerRNA *ptr, float *values) { - RenderPass *rpass = (RenderPass*)ptr->data; - memcpy(values, rpass->rect, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); + RenderPass *rpass = (RenderPass *)ptr->data; + memcpy(values, rpass->rect, sizeof(float) * rpass->rectx * rpass->recty * rpass->channels); } void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values) { - RenderPass *rpass = (RenderPass*)ptr->data; - memcpy(rpass->rect, values, sizeof(float)*rpass->rectx*rpass->recty*rpass->channels); + RenderPass *rpass = (RenderPass *)ptr->data; + memcpy(rpass->rect, values, sizeof(float) * rpass->rectx * rpass->recty * rpass->channels); } #else /* RNA_RUNTIME */ @@ -364,7 +364,7 @@ static void rna_def_render_engine(BlenderRNA *brna) prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); - RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP); + RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP); prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE); RNA_def_property_string_sdna(prop, NULL, "type->name"); @@ -398,8 +398,8 @@ static void rna_def_render_result(BlenderRNA *brna) RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name", - "Filename to load into this render tile, must be no smaller than " - "the render result"); + "Filename to load into this render tile, must be no smaller than " + "the render result"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_define_verify_sdna(0); @@ -434,7 +434,7 @@ static void rna_def_render_layer(BlenderRNA *brna) RNA_def_function_ui_description(func, "Copies the pixels of this renderlayer from an image file"); RNA_def_function_flag(func, FUNC_USE_REPORTS); prop = RNA_def_string(func, "filename", "", 0, "Filename", - "Filename to load into this render tile, must be no smaller than the renderlayer"); + "Filename to load into this render tile, must be no smaller than the renderlayer"); RNA_def_property_flag(prop, PROP_REQUIRED); RNA_def_int(func, "x", 0, 0, INT_MAX, "Offset X", "Offset the position to copy from if the image is larger than the render layer", 0, INT_MAX); @@ -492,7 +492,8 @@ static void rna_def_render_pass(BlenderRNA *brna) {SCE_PASS_TRANSM_DIRECT, "TRANSMISSION_DIRECT", 0, "Transmission Direct", ""}, {SCE_PASS_TRANSM_INDIRECT, "TRANSMISSION_INDIRECT", 0, "Transmission Indirect", ""}, {SCE_PASS_TRANSM_COLOR, "TRANSMISSION_COLOR", 0, "Transmission Color", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "RenderPass", NULL); RNA_def_struct_ui_text(srna, "Render Pass", ""); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index e9f35debe72..38fbe708038 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -42,7 +42,8 @@ EnumPropertyItem property_type_items[] = { {PROP_ENUM, "ENUM", 0, "Enumeration", ""}, {PROP_POINTER, "POINTER", 0, "Pointer", ""}, {PROP_COLLECTION, "COLLECTION", 0, "Collection", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem property_subtype_items[] = { {PROP_NONE, "NONE", 0, "None", ""}, @@ -79,7 +80,8 @@ EnumPropertyItem property_subtype_items[] = { /* booleans */ {PROP_LAYER, "LAYER", 0, "Layer", ""}, {PROP_LAYER_MEMBER, "LAYER_MEMBER", 0, "Layer Member", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem property_unit_items[] = { {PROP_UNIT_NONE, "NONE", 0, "None", ""}, @@ -90,7 +92,8 @@ EnumPropertyItem property_unit_items[] = { {PROP_UNIT_TIME, "TIME", 0, "Time", ""}, {PROP_UNIT_VELOCITY, "VELOCITY", 0, "Velocity", ""}, {PROP_UNIT_ACCELERATION, "ACCELERATION", 0, "Acceleration", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" @@ -101,57 +104,57 @@ EnumPropertyItem property_unit_items[] = { static void rna_Struct_identifier_get(PointerRNA *ptr, char *value) { - strcpy(value, ((StructRNA*)ptr->data)->identifier); + strcpy(value, ((StructRNA *)ptr->data)->identifier); } static int rna_Struct_identifier_length(PointerRNA *ptr) { - return strlen(((StructRNA*)ptr->data)->identifier); + return strlen(((StructRNA *)ptr->data)->identifier); } static void rna_Struct_description_get(PointerRNA *ptr, char *value) { - strcpy(value, ((StructRNA*)ptr->data)->description); + strcpy(value, ((StructRNA *)ptr->data)->description); } static int rna_Struct_description_length(PointerRNA *ptr) { - return strlen(((StructRNA*)ptr->data)->description); + return strlen(((StructRNA *)ptr->data)->description); } static void rna_Struct_name_get(PointerRNA *ptr, char *value) { - strcpy(value, ((StructRNA*)ptr->data)->name); + strcpy(value, ((StructRNA *)ptr->data)->name); } static int rna_Struct_name_length(PointerRNA *ptr) { - return strlen(((StructRNA*)ptr->data)->name); + return strlen(((StructRNA *)ptr->data)->name); } static void rna_Struct_translation_context_get(PointerRNA *ptr, char *value) { - strcpy(value, ((StructRNA*)ptr->data)->translation_context ? ((StructRNA*)ptr->data)->translation_context : ""); + strcpy(value, ((StructRNA *)ptr->data)->translation_context ? ((StructRNA *)ptr->data)->translation_context : ""); } static int rna_Struct_translation_context_length(PointerRNA *ptr) { - return ((StructRNA*)ptr->data)->translation_context ? strlen(((StructRNA*)ptr->data)->translation_context) : 0; + return ((StructRNA *)ptr->data)->translation_context ? strlen(((StructRNA *)ptr->data)->translation_context) : 0; } static PointerRNA rna_Struct_base_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((StructRNA*)ptr->data)->base); + return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((StructRNA *)ptr->data)->base); } static PointerRNA rna_Struct_nested_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((StructRNA*)ptr->data)->nested); + return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((StructRNA *)ptr->data)->nested); } static PointerRNA rna_Struct_name_property_get(PointerRNA *ptr) { - return rna_pointer_inherit_refine(ptr, &RNA_Property, ((StructRNA*)ptr->data)->nameproperty); + return rna_pointer_inherit_refine(ptr, &RNA_Property, ((StructRNA *)ptr->data)->nameproperty); } /* Struct property iteration. This is quite complicated, the purpose is to @@ -160,7 +163,7 @@ static PointerRNA rna_Struct_name_property_get(PointerRNA *ptr) static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data) { - IDProperty *idprop = (IDProperty*)data; + IDProperty *idprop = (IDProperty *)data; PropertyRNA *prop; StructRNA *ptype = iter->builtin_parent.type; @@ -177,7 +180,7 @@ static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data) static int rna_property_builtin(CollectionPropertyIterator *UNUSED(iter), void *data) { - PropertyRNA *prop = (PropertyRNA*)data; + PropertyRNA *prop = (PropertyRNA *)data; /* function to skip builtin rna properties */ @@ -186,7 +189,7 @@ static int rna_property_builtin(CollectionPropertyIterator *UNUSED(iter), void * static int rna_function_builtin(CollectionPropertyIterator *UNUSED(iter), void *data) { - FunctionRNA *func = (FunctionRNA*)data; + FunctionRNA *func = (FunctionRNA *)data; /* function to skip builtin rna functions */ @@ -200,9 +203,9 @@ static void rna_inheritance_next_level_restart(CollectionPropertyIterator *iter, StructRNA *srna; int i; - srna = (StructRNA*)iter->parent.data; + srna = (StructRNA *)iter->parent.data; iter->level--; - for (i = iter->level; i>0; i--) + for (i = iter->level; i > 0; i--) srna = srna->base; rna_iterator_listbase_end(iter); @@ -363,7 +366,7 @@ int rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key, Point do { if (srna->cont.prophash) { - prop = BLI_ghash_lookup(srna->cont.prophash, (void*)key); + prop = BLI_ghash_lookup(srna->cont.prophash, (void *)key); if (prop) { propptr.type = &RNA_Property; @@ -420,7 +423,7 @@ PointerRNA rna_builtin_type_get(PointerRNA *ptr) static StructRNA *rna_Property_refine(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); /* XXX ptr? */ @@ -438,185 +441,185 @@ static StructRNA *rna_Property_refine(PointerRNA *ptr) static void rna_Property_identifier_get(PointerRNA *ptr, char *value) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - strcpy(value, ((PropertyRNA*)prop)->identifier); + strcpy(value, ((PropertyRNA *)prop)->identifier); } static int rna_Property_identifier_length(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); return strlen(prop->identifier); } static void rna_Property_name_get(PointerRNA *ptr, char *value) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); strcpy(value, prop->name); } static int rna_Property_name_length(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); return strlen(prop->name); } static void rna_Property_description_get(PointerRNA *ptr, char *value) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - strcpy(value, prop->description ? prop->description:""); + strcpy(value, prop->description ? prop->description : ""); } static int rna_Property_description_length(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); return prop->description ? strlen(prop->description) : 0; } static void rna_Property_translation_context_get(PointerRNA *ptr, char *value) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - strcpy(value, prop->translation_context ? prop->translation_context:""); + strcpy(value, prop->translation_context ? prop->translation_context : ""); } static int rna_Property_translation_context_length(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); return prop->translation_context ? strlen(prop->translation_context) : 0; } static int rna_Property_type_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); return prop->type; } static int rna_Property_subtype_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); return prop->subtype; } static PointerRNA rna_Property_srna_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); return rna_pointer_inherit_refine(ptr, &RNA_Struct, prop->srna); } static int rna_Property_unit_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); return RNA_SUBTYPE_UNIT(prop->subtype); } static int rna_Property_readonly_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; /* don't use this becaure it will call functions that check the internal * data for introspection we only need to know if it can be edited so the * flag is better for this */ /* return RNA_property_editable(ptr, prop); */ - return prop->flag & PROP_EDITABLE ? 0:1; + return prop->flag & PROP_EDITABLE ? 0 : 1; } static int rna_Property_animatable_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; return (prop->flag & PROP_ANIMATABLE) != 0; } static int rna_Property_use_output_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; - return prop->flag & PROP_OUTPUT ? 1:0; + PropertyRNA *prop = (PropertyRNA *)ptr->data; + return prop->flag & PROP_OUTPUT ? 1 : 0; } static int rna_Property_is_required_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; - return prop->flag & PROP_REQUIRED ? 1:0; + PropertyRNA *prop = (PropertyRNA *)ptr->data; + return prop->flag & PROP_REQUIRED ? 1 : 0; } static int rna_Property_is_never_none_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; - return prop->flag & PROP_NEVER_NULL ? 1:0; + PropertyRNA *prop = (PropertyRNA *)ptr->data; + return prop->flag & PROP_NEVER_NULL ? 1 : 0; } static int rna_Property_is_hidden_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; - return prop->flag & PROP_HIDDEN ? 1:0; + PropertyRNA *prop = (PropertyRNA *)ptr->data; + return prop->flag & PROP_HIDDEN ? 1 : 0; } static int rna_Property_is_skip_save_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; - return prop->flag & PROP_SKIP_SAVE ? 1:0; + PropertyRNA *prop = (PropertyRNA *)ptr->data; + return prop->flag & PROP_SKIP_SAVE ? 1 : 0; } static int rna_Property_is_enum_flag_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; - return prop->flag & PROP_ENUM_FLAG ? 1:0; + PropertyRNA *prop = (PropertyRNA *)ptr->data; + return prop->flag & PROP_ENUM_FLAG ? 1 : 0; } static int rna_Property_array_length_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); return prop->totarraylength; } static int rna_Property_registered_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; return prop->flag & PROP_REGISTER; } static int rna_Property_registered_optional_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; return prop->flag & PROP_REGISTER_OPTIONAL; } static int rna_Property_runtime_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; return prop->flag & PROP_RUNTIME; } static int rna_BoolProperty_default_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((BoolPropertyRNA*)prop)->defaultvalue; + return ((BoolPropertyRNA *)prop)->defaultvalue; } static int rna_IntProperty_default_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((IntPropertyRNA*)prop)->defaultvalue; + return ((IntPropertyRNA *)prop)->defaultvalue; } /* int/float/bool */ static int rna_NumberProperty_default_array_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); length[0] = prop->totarraylength; @@ -625,8 +628,8 @@ static int rna_NumberProperty_default_array_get_length(PointerRNA *ptr, int leng } static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; - IntPropertyRNA *nprop = (IntPropertyRNA*)prop; + PropertyRNA *prop = (PropertyRNA *)ptr->data; + IntPropertyRNA *nprop = (IntPropertyRNA *)prop; rna_idproperty_check(&prop, ptr); if (nprop->defaultarray) { @@ -640,8 +643,8 @@ static void rna_IntProperty_default_array_get(PointerRNA *ptr, int *values) } static void rna_BoolProperty_default_array_get(PointerRNA *ptr, int *values) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; - BoolPropertyRNA *nprop = (BoolPropertyRNA*)prop; + PropertyRNA *prop = (PropertyRNA *)ptr->data; + BoolPropertyRNA *nprop = (BoolPropertyRNA *)prop; rna_idproperty_check(&prop, ptr); if (nprop->defaultarray) { @@ -655,8 +658,8 @@ static void rna_BoolProperty_default_array_get(PointerRNA *ptr, int *values) } static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; - FloatPropertyRNA *nprop = (FloatPropertyRNA*)prop; + PropertyRNA *prop = (PropertyRNA *)ptr->data; + FloatPropertyRNA *nprop = (FloatPropertyRNA *)prop; rna_idproperty_check(&prop, ptr); if (nprop->defaultarray) { @@ -671,125 +674,125 @@ static void rna_FloatProperty_default_array_get(PointerRNA *ptr, float *values) static int rna_IntProperty_hard_min_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((IntPropertyRNA*)prop)->hardmin; + return ((IntPropertyRNA *)prop)->hardmin; } static int rna_IntProperty_hard_max_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((IntPropertyRNA*)prop)->hardmax; + return ((IntPropertyRNA *)prop)->hardmax; } static int rna_IntProperty_soft_min_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((IntPropertyRNA*)prop)->softmin; + return ((IntPropertyRNA *)prop)->softmin; } static int rna_IntProperty_soft_max_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((IntPropertyRNA*)prop)->softmax; + return ((IntPropertyRNA *)prop)->softmax; } static int rna_IntProperty_step_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((IntPropertyRNA*)prop)->step; + return ((IntPropertyRNA *)prop)->step; } static float rna_FloatProperty_default_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((FloatPropertyRNA*)prop)->defaultvalue; + return ((FloatPropertyRNA *)prop)->defaultvalue; } static float rna_FloatProperty_hard_min_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((FloatPropertyRNA*)prop)->hardmin; + return ((FloatPropertyRNA *)prop)->hardmin; } static float rna_FloatProperty_hard_max_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((FloatPropertyRNA*)prop)->hardmax; + return ((FloatPropertyRNA *)prop)->hardmax; } static float rna_FloatProperty_soft_min_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((FloatPropertyRNA*)prop)->softmin; + return ((FloatPropertyRNA *)prop)->softmin; } static float rna_FloatProperty_soft_max_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((FloatPropertyRNA*)prop)->softmax; + return ((FloatPropertyRNA *)prop)->softmax; } static float rna_FloatProperty_step_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((FloatPropertyRNA*)prop)->step; + return ((FloatPropertyRNA *)prop)->step; } static int rna_FloatProperty_precision_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((FloatPropertyRNA*)prop)->precision; + return ((FloatPropertyRNA *)prop)->precision; } static void rna_StringProperty_default_get(PointerRNA *ptr, char *value) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - strcpy(value, ((StringPropertyRNA*)prop)->defaultvalue); + strcpy(value, ((StringPropertyRNA *)prop)->defaultvalue); } static int rna_StringProperty_default_length(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return strlen(((StringPropertyRNA*)prop)->defaultvalue); + return strlen(((StringPropertyRNA *)prop)->defaultvalue); } static int rna_StringProperty_max_length_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((StringPropertyRNA*)prop)->maxlength; + return ((StringPropertyRNA *)prop)->maxlength; } static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop_parent, int *free) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; EnumPropertyRNA *eprop; rna_idproperty_check(&prop, ptr); - eprop = (EnumPropertyRNA*)prop; + eprop = (EnumPropertyRNA *)prop; /* incompatible default attributes */ if ((prop_parent->flag & PROP_ENUM_FLAG) != (prop->flag & PROP_ENUM_FLAG)) { return NULL; } - if ( (eprop->itemf == NULL) || - (eprop->itemf == rna_EnumProperty_default_itemf) || - (ptr->type == &RNA_EnumProperty) || - (C == NULL)) + if ((eprop->itemf == NULL) || + (eprop->itemf == rna_EnumProperty_default_itemf) || + (ptr->type == &RNA_EnumProperty) || + (C == NULL)) { return eprop->item; } @@ -800,21 +803,21 @@ static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA /* XXX - not sure this is needed? */ static int rna_EnumProperty_default_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return ((EnumPropertyRNA*)prop)->defaultvalue; + return ((EnumPropertyRNA *)prop)->defaultvalue; } static int rna_enum_check_separator(CollectionPropertyIterator *UNUSED(iter), void *data) { - EnumPropertyItem *item = (EnumPropertyItem*)data; + EnumPropertyItem *item = (EnumPropertyItem *)data; return (item->identifier[0] == 0); } static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; /* EnumPropertyRNA *eprop; *//* UNUSED */ EnumPropertyItem *item = NULL; int totitem, free = 0; @@ -823,32 +826,32 @@ static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, Point /* eprop= (EnumPropertyRNA*)prop; */ RNA_property_enum_items(NULL, ptr, prop, &item, &totitem, &free); - rna_iterator_array_begin(iter, (void*)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator); + rna_iterator_array_begin(iter, (void *)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator); } static void rna_EnumPropertyItem_identifier_get(PointerRNA *ptr, char *value) { - strcpy(value, ((EnumPropertyItem*)ptr->data)->identifier); + strcpy(value, ((EnumPropertyItem *)ptr->data)->identifier); } static int rna_EnumPropertyItem_identifier_length(PointerRNA *ptr) { - return strlen(((EnumPropertyItem*)ptr->data)->identifier); + return strlen(((EnumPropertyItem *)ptr->data)->identifier); } static void rna_EnumPropertyItem_name_get(PointerRNA *ptr, char *value) { - strcpy(value, ((EnumPropertyItem*)ptr->data)->name); + strcpy(value, ((EnumPropertyItem *)ptr->data)->name); } static int rna_EnumPropertyItem_name_length(PointerRNA *ptr) { - return strlen(((EnumPropertyItem*)ptr->data)->name); + return strlen(((EnumPropertyItem *)ptr->data)->name); } static void rna_EnumPropertyItem_description_get(PointerRNA *ptr, char *value) { - EnumPropertyItem *eprop = (EnumPropertyItem*)ptr->data; + EnumPropertyItem *eprop = (EnumPropertyItem *)ptr->data; if (eprop->description) strcpy(value, eprop->description); @@ -858,7 +861,7 @@ static void rna_EnumPropertyItem_description_get(PointerRNA *ptr, char *value) static int rna_EnumPropertyItem_description_length(PointerRNA *ptr) { - EnumPropertyItem *eprop = (EnumPropertyItem*)ptr->data; + EnumPropertyItem *eprop = (EnumPropertyItem *)ptr->data; if (eprop->description) return strlen(eprop->description); @@ -868,65 +871,65 @@ static int rna_EnumPropertyItem_description_length(PointerRNA *ptr) static int rna_EnumPropertyItem_value_get(PointerRNA *ptr) { - return ((EnumPropertyItem*)ptr->data)->value; + return ((EnumPropertyItem *)ptr->data)->value; } static PointerRNA rna_PointerProperty_fixed_type_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((PointerPropertyRNA*)prop)->type); + return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((PointerPropertyRNA *)prop)->type); } static PointerRNA rna_CollectionProperty_fixed_type_get(PointerRNA *ptr) { - PropertyRNA *prop = (PropertyRNA*)ptr->data; + PropertyRNA *prop = (PropertyRNA *)ptr->data; rna_idproperty_check(&prop, ptr); - return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((CollectionPropertyRNA*)prop)->item_type); + return rna_pointer_inherit_refine(ptr, &RNA_Struct, ((CollectionPropertyRNA *)prop)->item_type); } /* Function */ static void rna_Function_identifier_get(PointerRNA *ptr, char *value) { - strcpy(value, ((FunctionRNA*)ptr->data)->identifier); + strcpy(value, ((FunctionRNA *)ptr->data)->identifier); } static int rna_Function_identifier_length(PointerRNA *ptr) { - return strlen(((FunctionRNA*)ptr->data)->identifier); + return strlen(((FunctionRNA *)ptr->data)->identifier); } static void rna_Function_description_get(PointerRNA *ptr, char *value) { - strcpy(value, ((FunctionRNA*)ptr->data)->description); + strcpy(value, ((FunctionRNA *)ptr->data)->description); } static int rna_Function_description_length(PointerRNA *ptr) { - return strlen(((FunctionRNA*)ptr->data)->description); + return strlen(((FunctionRNA *)ptr->data)->description); } static void rna_Function_parameters_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - rna_iterator_listbase_begin(iter, &((FunctionRNA*)ptr->data)->cont.properties, rna_property_builtin); + rna_iterator_listbase_begin(iter, &((FunctionRNA *)ptr->data)->cont.properties, rna_property_builtin); } static int rna_Function_registered_get(PointerRNA *ptr) { - FunctionRNA *func = (FunctionRNA*)ptr->data; + FunctionRNA *func = (FunctionRNA *)ptr->data; return func->flag & FUNC_REGISTER; } static int rna_Function_registered_optional_get(PointerRNA *ptr) { - FunctionRNA *func = (FunctionRNA*)ptr->data; + FunctionRNA *func = (FunctionRNA *)ptr->data; return func->flag & FUNC_REGISTER_OPTIONAL; } static int rna_Function_no_self_get(PointerRNA *ptr) { - FunctionRNA *func = (FunctionRNA*)ptr->data; + FunctionRNA *func = (FunctionRNA *)ptr->data; return !(func->flag & FUNC_NO_SELF); } @@ -934,17 +937,17 @@ static int rna_Function_no_self_get(PointerRNA *ptr) static void rna_BlenderRNA_structs_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - rna_iterator_listbase_begin(iter, &((BlenderRNA*)ptr->data)->structs, NULL); + rna_iterator_listbase_begin(iter, &((BlenderRNA *)ptr->data)->structs, NULL); } /* optional, for faster lookups */ static int rna_BlenderRNA_structs_length(PointerRNA *ptr) { - return BLI_countlist(&((BlenderRNA*)ptr->data)->structs); + return BLI_countlist(&((BlenderRNA *)ptr->data)->structs); } static int rna_BlenderRNA_structs_lookup_int(PointerRNA *ptr, int index, PointerRNA *r_ptr) { - StructRNA *srna = BLI_findlink(&((BlenderRNA*)ptr->data)->structs, index); + StructRNA *srna = BLI_findlink(&((BlenderRNA *)ptr->data)->structs, index); if (srna) { RNA_pointer_create(NULL, &RNA_Struct, srna, r_ptr); @@ -956,7 +959,7 @@ static int rna_BlenderRNA_structs_lookup_int(PointerRNA *ptr, int index, Pointer } static int rna_BlenderRNA_structs_lookup_string(PointerRNA *ptr, const char *key, PointerRNA *r_ptr) { - StructRNA *srna = ((BlenderRNA*)ptr->data)->structs.first; + StructRNA *srna = ((BlenderRNA *)ptr->data)->structs.first; for (; srna; srna = srna->cont.next) { if (key[0] == srna->identifier[0] && strcmp(key, srna->identifier) == 0) { RNA_pointer_create(NULL, &RNA_Struct, srna, r_ptr); @@ -1062,7 +1065,8 @@ static void rna_def_property(BlenderRNA *brna) {PROP_COORDS, "COORDINATES", 0, "Vector Coordinates", ""}, {PROP_LAYER, "LAYER", 0, "Layer", ""}, {PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Property", NULL); RNA_def_struct_ui_text(srna, "Property Definition", "RNA property definition"); @@ -1331,7 +1335,8 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna) /* the itemf func is used instead, keep blender happy */ static EnumPropertyItem default_dummy_items[] = { {PROP_NONE, "DUMMY", 0, "Dummy", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; prop = RNA_def_property(srna, "default", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1457,7 +1462,7 @@ void RNA_def_rna(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Struct"); RNA_def_property_collection_funcs(prop, "rna_BlenderRNA_structs_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", - /* included for speed, can be removed */ + /* included for speed, can be removed */ #if 0 NULL, NULL, NULL, NULL); #else diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index ca01d61f630..429f1d48df3 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -56,7 +56,7 @@ void rna_Scene_frame_set(Scene *scene, int frame, float subframe) scene->r.subframe = subframe; CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME); - BKE_scene_update_for_newframe(G.main, scene, (1<<20) - 1); + BKE_scene_update_for_newframe(G.main, scene, (1 << 20) - 1); BKE_scene_camera_switch_update(scene); /* cant use NC_SCENE|ND_FRAME because this casues wm_event_do_notifiers to call @@ -133,7 +133,7 @@ void RNA_api_scene_render(StructRNA *srna) RNA_def_int(func, "frame", INT_MIN, INT_MIN, INT_MAX, "", "Frame number to use, if unset the current frame will be used", MINAFRAME, MAXFRAME); parm = RNA_def_string_file_path(func, "filepath", "", FILE_MAX, "File Path", - "The resulting filepath from the scenes render settings"); + "The resulting filepath from the scenes render settings"); RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */ RNA_def_function_output(func, parm); } diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index db43db273bd..e442de6fc7c 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -45,7 +45,8 @@ EnumPropertyItem region_type_items[] = { {RGN_TYPE_TOOLS, "TOOLS", 0, "Tools", ""}, {RGN_TYPE_TOOL_PROPS, "TOOL_PROPS", 0, "Tool Properties", ""}, {RGN_TYPE_PREVIEW, "PREVIEW", 0, "Preview", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #include "ED_screen.h" @@ -58,7 +59,7 @@ EnumPropertyItem region_type_items[] = { static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value) { - bScreen *sc = (bScreen*)ptr->data; + bScreen *sc = (bScreen *)ptr->data; if (value.data == NULL) return; @@ -68,12 +69,12 @@ static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value) static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr) { - bScreen *sc = (bScreen*)ptr->data; + bScreen *sc = (bScreen *)ptr->data; /* exception: must use context so notifier gets to the right window */ if (sc->newscene) { ED_screen_set_scene(C, sc, sc->newscene); - WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene); + WM_event_add_notifier(C, NC_SCENE | ND_SCENEBROWSE, sc->newscene); if (G.debug & G_DEBUG) printf("scene set %p\n", sc->newscene); @@ -93,19 +94,19 @@ static void rna_Screen_redraw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), static int rna_Screen_is_animation_playing_get(PointerRNA *ptr) { - bScreen *sc = (bScreen*)ptr->data; + bScreen *sc = (bScreen *)ptr->data; return (sc->animtimer != NULL); } static int rna_Screen_fullscreen_get(PointerRNA *ptr) { - bScreen *sc = (bScreen*)ptr->data; + bScreen *sc = (bScreen *)ptr->data; return (sc->full != 0); } static void rna_Area_type_set(PointerRNA *ptr, int value) { - ScrArea *sa = (ScrArea*)ptr->data; + ScrArea *sa = (ScrArea *)ptr->data; sa->butspacetype = value; } @@ -113,12 +114,12 @@ static void rna_Area_type_update(bContext *C, PointerRNA *ptr) { wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win; - bScreen *sc = (bScreen*)ptr->id.data; - ScrArea *sa = (ScrArea*)ptr->data; + bScreen *sc = (bScreen *)ptr->id.data; + ScrArea *sa = (ScrArea *)ptr->data; /* XXX this call still use context, so we trick it to work in the right context */ - for(win=wm->windows.first; win; win=win->next) { - if(sc == win->screen) { + for (win = wm->windows.first; win; win = win->next) { + if (sc == win->screen) { wmWindow *prevwin = CTX_wm_window(C); ScrArea *prevsa = CTX_wm_area(C); ARegion *prevar = CTX_wm_region(C); @@ -255,7 +256,7 @@ static void rna_def_screen(BlenderRNA *brna) /* pointers */ prop = RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL, NULL); RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); @@ -282,42 +283,42 @@ static void rna_def_screen(BlenderRNA *brna) prop = RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_REGION); RNA_def_property_ui_text(prop, "Top-Left 3D Editor", ""); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_3D_WIN); RNA_def_property_ui_text(prop, "All 3D View Editors", ""); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_ANIM_WIN); RNA_def_property_ui_text(prop, "Animation Editors", ""); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_BUTS_WIN); RNA_def_property_ui_text(prop, "Property Editors", ""); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_IMAGE_WIN); RNA_def_property_ui_text(prop, "Image Editors", ""); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_SEQ); RNA_def_property_ui_text(prop, "Sequencer Editors", ""); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES); RNA_def_property_ui_text(prop, "Node Editors", ""); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_clip_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_CLIPS); RNA_def_property_ui_text(prop, "Clip Editors", ""); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); } void RNA_def_screen(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index c8aa5ebaaca..ad40e71eb71 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -49,7 +49,8 @@ static EnumPropertyItem particle_edit_hair_brush_items[] = { {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up"}, {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"}, {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" @@ -68,18 +69,20 @@ static EnumPropertyItem particle_edit_disconnected_hair_brush_items[] = { {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter"}, {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs"}, {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Weight hair particles"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static EnumPropertyItem particle_edit_cache_brush_items[] = { {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush"}, {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths"}, {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths"}, {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr) { - ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data; + ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data; ParticleBrushData *brush = NULL; if (pset->brushtype != PE_BRUSH_NONE) @@ -95,7 +98,7 @@ static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr) static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { - Object *ob = (scene->basact)? scene->basact->object: NULL; + Object *ob = (scene->basact) ? scene->basact->object : NULL; PTCacheEdit *edit = PE_get_current(scene, ob); if (!edit) @@ -106,20 +109,20 @@ static void rna_ParticleEdit_redo(Main *UNUSED(bmain), Scene *scene, PointerRNA static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { - Object *ob = (scene->basact)? scene->basact->object: NULL; + Object *ob = (scene->basact) ? scene->basact->object : NULL; if (ob) DAG_id_tag_update(&ob->id, OB_RECALC_DATA); } static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value) { - ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data; + ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data; /* redraw hair completely if weight brush is/was used */ if ((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->scene) { - Object *ob = (pset->scene->basact)? pset->scene->basact->object: NULL; + Object *ob = (pset->scene->basact) ? pset->scene->basact->object : NULL; if (ob) { DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL); + WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL); } } @@ -129,7 +132,7 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UN PropertyRNA *UNUSED(prop), int *UNUSED(free)) { Scene *scene = CTX_data_scene(C); - Object *ob = (scene->basact)? scene->basact->object: NULL; + Object *ob = (scene->basact) ? scene->basact->object : NULL; #if 0 PTCacheEdit *edit = PE_get_current(scene, ob); ParticleSystem *psys = edit ? edit->psys : NULL; @@ -154,13 +157,13 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UN static int rna_ParticleEdit_editable_get(PointerRNA *ptr) { - ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data; + ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data; return (pset->object && pset->scene && PE_get_current(pset->scene, pset->object)); } static int rna_ParticleEdit_hair_get(PointerRNA *ptr) { - ParticleEditSettings *pset = (ParticleEditSettings*)ptr->data; + ParticleEditSettings *pset = (ParticleEditSettings *)ptr->data; if (pset->scene) { PTCacheEdit *edit = PE_get_current(pset->scene, pset->object); @@ -195,11 +198,11 @@ static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value) static void rna_Sculpt_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) { - Object *ob = (scene->basact)? scene->basact->object: NULL; + Object *ob = (scene->basact) ? scene->basact->object : NULL; if (ob) { DAG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); } } @@ -218,7 +221,7 @@ static void rna_def_paint(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll"); RNA_def_property_ui_text(prop, "Brush", "Active Brush"); - RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_BRUSH | NA_EDITED, NULL); prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH); @@ -288,7 +291,7 @@ static void rna_def_sculpt(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Use Deform Only", "Use only deformation modifiers (temporary disable all " "constructive modifiers except multi-resolution)"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Sculpt_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update"); } @@ -381,7 +384,7 @@ static void rna_def_image_paint(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle"); prop = RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size", - "Size to capture the image for re-projecting", 0, 0); + "Size to capture the image for re-projecting", 0, 0); RNA_def_property_range(prop, 512, 16384); } @@ -394,17 +397,20 @@ static void rna_def_particle_edit(BlenderRNA *brna) {SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"}, {SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"}, {SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem puff_mode[] = { {0, "ADD", 0, "Add", "Make hairs more puffy"}, {1, "SUB", 0, "Sub", "Make hairs less puffy"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem length_mode[] = { {0, "GROW", 0, "Grow", "Make hairs longer"}, {1, "SHRINK", 0, "Shrink", "Make hairs shorter"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem edit_type_items[] = { {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""}, @@ -430,7 +436,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode"); RNA_def_property_enum_items(prop, select_mode_items); RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update"); prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS); @@ -452,7 +458,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME); RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update"); prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY); @@ -461,7 +467,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART); RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo"); prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED); @@ -481,18 +487,18 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop = RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo"); prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Frames", "How many frames to fade"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update"); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "edittype"); RNA_def_property_enum_items(prop, edit_type_items); RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo"); prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL); diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 8bed95f88b2..cce0612bd68 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -56,16 +56,17 @@ EnumPropertyItem sensor_type_items[] = { {SENS_RANDOM, "RANDOM", 0, "Random", ""}, {SENS_RAY, "RAY", 0, "Ray", ""}, {SENS_TOUCH, "TOUCH", 0, "Touch", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME #include "BKE_sca.h" #include "DNA_controller_types.h" -static StructRNA* rna_Sensor_refine(struct PointerRNA *ptr) +static StructRNA *rna_Sensor_refine(struct PointerRNA *ptr) { - bSensor *sensor = (bSensor*)ptr->data; + bSensor *sensor = (bSensor *)ptr->data; switch (sensor->type) { case SENS_ALWAYS: @@ -214,7 +215,7 @@ static void rna_Sensor_keyboard_modifier2_set(struct PointerRNA *ptr, int value) static void rna_Sensor_tap_set(struct PointerRNA *ptr, int value) { - bSensor *sens = (bSensor*)ptr->data; + bSensor *sens = (bSensor *)ptr->data; sens->tap = value; if (sens->tap == 1) @@ -223,7 +224,7 @@ static void rna_Sensor_tap_set(struct PointerRNA *ptr, int value) static void rna_Sensor_level_set(struct PointerRNA *ptr, int value) { - bSensor *sens = (bSensor*)ptr->data; + bSensor *sens = (bSensor *)ptr->data; sens->level = value; if (sens->level == 1) @@ -404,7 +405,8 @@ static void rna_def_mouse_sensor(BlenderRNA *brna) {BL_SENS_MOUSE_MOVEMENT, "MOVEMENT", 0, "Movement", ""}, {BL_SENS_MOUSE_MOUSEOVER, "MOUSEOVER", 0, "Mouse Over", ""}, {BL_SENS_MOUSE_MOUSEOVER_ANY, "MOUSEOVERANY", 0, "Mouse Over Any", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "MouseSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Mouse Sensor", "Sensor to detect mouse events"); @@ -492,7 +494,8 @@ static void rna_def_property_sensor(BlenderRNA *brna) {SENS_PROP_INTERVAL, "PROPINTERVAL", 0, "Interval", ""}, {SENS_PROP_CHANGED, "PROPCHANGED", 0, "Changed", ""}, /* {SENS_PROP_EXPRESSION, "PROPEXPRESSION", 0, "Expression", ""}, NOT_USED_IN_UI */ - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "PropertySensor", "Sensor"); RNA_def_struct_ui_text(srna, "Property Sensor", "Sensor to detect values and changes in values of properties"); @@ -535,7 +538,8 @@ static void rna_def_armature_sensor(BlenderRNA *brna) {SENS_ARM_LIN_ERROR_ABOVE, "LINERRORABOVE", 0, "Lin error above", ""}, {SENS_ARM_ROT_ERROR_BELOW, "ROTERRORBELOW", 0, "Rot error below", ""}, {SENS_ARM_ROT_ERROR_ABOVE, "ROTERRORABOVE", 0, "Rot error above", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "ArmatureSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Armature Sensor", "Sensor to detect values and changes in values of IK solver"); @@ -663,7 +667,8 @@ static void rna_def_radar_sensor(BlenderRNA *brna) {SENS_RADAR_NEG_X_AXIS, "NEGXAXIS", 0, "-X axis", ""}, {SENS_RADAR_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""}, {SENS_RADAR_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "RadarSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Radar Sensor", @@ -719,12 +724,14 @@ static void rna_def_ray_sensor(BlenderRNA *brna) {SENS_RAY_NEG_X_AXIS, "NEGXAXIS", 0, "-X axis", ""}, {SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""}, {SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static const EnumPropertyItem prop_ray_type_items[] = { {SENS_COLLISION_PROPERTY, "PROPERTY", ICON_LOGIC, "Property", "Use a material for ray intersections"}, {SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a property for ray intersections"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "RaySensor", "Sensor"); RNA_def_struct_ui_text(srna, "Ray Sensor", @@ -801,14 +808,16 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) {SENS_JOY_AXIS, "AXIS", 0, "Axis", ""}, {SENS_JOY_HAT, "HAT", 0, "Hat", ""}, {SENS_JOY_AXIS_SINGLE, "AXIS_SINGLE", 0, "Single Axis", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem axis_direction_items[] = { {SENS_JOY_X_AXIS, "RIGHTAXIS", 0, "Right Axis", ""}, {SENS_JOY_Y_AXIS, "UPAXIS", 0, "Up Axis", ""}, {SENS_JOY_NEG_X_AXIS, "LEFTAXIS", 0, "Left Axis", ""}, {SENS_JOY_NEG_Y_AXIS, "DOWNAXIS", 0, "Down Axis", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem hat_direction_items[] = { {SENS_JOY_HAT_UP, "UP", 0, "Up", ""}, @@ -820,7 +829,8 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) {SENS_JOY_HAT_DOWN_LEFT, "DOWNLEFT", 0, "Down/Left", ""}, {SENS_JOY_HAT_UP_LEFT, "UPLEFT", 0, "Up/Left", ""}, {SENS_JOY_HAT_DOWN_RIGHT, "DOWNRIGHT", 0, "Down/Right", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "JoystickSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Joystick Sensor", "Sensor to detect joystick events"); @@ -829,7 +839,7 @@ static void rna_def_joystick_sensor(BlenderRNA *brna) prop = RNA_def_property(srna, "joystick_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "joyindex"); RNA_def_property_ui_text(prop, "Index", "Which joystick to use"); - RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX-1); + RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX - 1); RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index d64dd1a626e..e7b648377e9 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -561,14 +561,14 @@ static int rna_Sequence_input_count_get(PointerRNA *ptr) #if 0 static void rna_SoundSequence_filename_set(PointerRNA *ptr, const char *value) { - Sequence *seq= (Sequence*)(ptr->data); + Sequence *seq = (Sequence *)(ptr->data); BLI_split_dirfile(value, seq->strip->dir, seq->strip->stripdata->name, sizeof(seq->strip->dir), sizeof(seq->strip->stripdata->name)); } static void rna_SequenceElement_filename_set(PointerRNA *ptr, const char *value) { - StripElem *elem= (StripElem*)(ptr->data); + StripElem *elem = (StripElem *)(ptr->data); BLI_split_file_part(value, elem->name, sizeof(elem->name)); } #endif @@ -953,15 +953,15 @@ static void rna_def_strip_color_balance(BlenderRNA *brna) /* not yet used */ #if 0 - prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Exposure", ""); - RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); - prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Saturation", ""); - RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); #endif } diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index b1fed62f87b..19925546de3 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -65,7 +65,7 @@ static void rna_Smoke_dependency_update(Main *bmain, Scene *scene, PointerRNA *p static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr) { - SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; + SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data; smokeModifier_reset(settings->smd); @@ -77,7 +77,7 @@ static void rna_Smoke_reset(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *ptr) { - SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; + SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data; smokeModifier_reset(settings->smd); @@ -89,7 +89,7 @@ static void rna_Smoke_reset_dependancy(Main *bmain, Scene *scene, PointerRNA *pt static char *rna_SmokeDomainSettings_path(PointerRNA *ptr) { - SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; + SmokeDomainSettings *settings = (SmokeDomainSettings *)ptr->data; ModifierData *md = (ModifierData *)settings->smd; return BLI_sprintfN("modifiers[\"%s\"].domain_settings", md->name); @@ -97,7 +97,7 @@ static char *rna_SmokeDomainSettings_path(PointerRNA *ptr) static char *rna_SmokeFlowSettings_path(PointerRNA *ptr) { - SmokeFlowSettings *settings = (SmokeFlowSettings*)ptr->data; + SmokeFlowSettings *settings = (SmokeFlowSettings *)ptr->data; ModifierData *md = (ModifierData *)settings->smd; return BLI_sprintfN("modifiers[\"%s\"].flow_settings", md->name); @@ -105,7 +105,7 @@ static char *rna_SmokeFlowSettings_path(PointerRNA *ptr) static char *rna_SmokeCollSettings_path(PointerRNA *ptr) { - SmokeCollSettings *settings = (SmokeCollSettings*)ptr->data; + SmokeCollSettings *settings = (SmokeCollSettings *)ptr->data; ModifierData *md = (ModifierData *)settings->smd; return BLI_sprintfN("modifiers[\"%s\"].coll_settings", md->name); @@ -119,24 +119,27 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_noise_type_items[] = { - {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""}, + {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""}, #ifdef WITH_FFTW3 - {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""}, + {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""}, #endif - /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */ - {0, NULL, 0, NULL, NULL}}; + /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */ + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem smoke_cache_comp_items[] = { {SM_CACHE_LIGHT, "CACHELIGHT", 0, "Light", "Fast but not so effective compression"}, {SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem smoke_domain_colli_items[] = { {SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"}, {SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open", - "Smoke doesn't collide with top and bottom sides"}, + "Smoke doesn't collide with top and bottom sides"}, {SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL); RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings"); @@ -149,7 +152,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, 24, 512, 2, 0); RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "amplify"); @@ -157,25 +160,25 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, 1, 10, 1, 0); RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG); RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noise"); RNA_def_property_enum_items(prop, prop_noise_type_items); RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "alpha"); @@ -183,7 +186,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Density", "How much density affects smoke motion (higher value results in faster rising smoke)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "beta"); @@ -191,52 +194,52 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Heat", "How much heat affects smoke motion (higher value results in faster rising smoke)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "coll_group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset_dependancy"); prop = RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "fluid_group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset_dependancy"); prop = RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "eff_group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset_dependancy"); prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2); RNA_def_property_ui_text(prop, "Strength", "Strength of noise"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "diss_speed"); RNA_def_property_range(prop, 1.0, 10000.0); RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, 0); RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE); RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG); RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x "); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -253,7 +256,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, smoke_domain_colli_items); RNA_def_property_ui_text(prop, "Border Collisions", "Select which domain border will be treated as collision object"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "EffectorWeights"); @@ -263,21 +266,21 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH); RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothen emitted smoke to avoid blockiness"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "time_scale"); RNA_def_property_range(prop, 0.2, 1.5); RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5); RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vorticity"); RNA_def_property_range(prop, 0.01, 4.0); RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5); RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); } @@ -296,14 +299,14 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.001, 1); RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4); RNA_def_property_ui_text(prop, "Density", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "temp"); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_range(prop, -10, 10, 1, 1); RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "psys"); @@ -315,24 +318,24 @@ static void rna_def_smoke_flow_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW); RNA_def_property_ui_text(prop, "Outflow", "Delete smoke from simulation"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE); RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY); RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits its velocity from the emitter particle"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vel_multi"); RNA_def_property_range(prop, -2.0, 2.0); RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5); RNA_def_property_ui_text(prop, "Multiplier", "Multiplier to adjust velocity passed to smoke"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); } static void rna_def_smoke_coll_settings(BlenderRNA *brna) @@ -341,7 +344,8 @@ static void rna_def_smoke_coll_settings(BlenderRNA *brna) {SM_COLL_STATIC, "COLLSTATIC", 0, "Static", "Non moving obstacle"}, {SM_COLL_RIGID, "COLLRIGID", 0, "Rigid", "Rigid obstacle"}, {SM_COLL_ANIMATED, "COLLANIMATED", 0, "Animated", "Animated obstacle"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; StructRNA *srna; PropertyRNA *prop; @@ -355,7 +359,7 @@ static void rna_def_smoke_coll_settings(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, smoke_coll_type_items); RNA_def_property_ui_text(prop, "Collision type", "Collision type"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); } void RNA_def_smoke(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index 18499fa52fe..206a72a01b0 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -41,18 +41,18 @@ static void rna_Sound_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - sound_load(bmain, (bSound*)ptr->data); + sound_load(bmain, (bSound *)ptr->data); } static int rna_Sound_caching_get(PointerRNA *ptr) { - bSound *sound = (bSound*)(ptr->data); + bSound *sound = (bSound *)(ptr->data); return (sound->flags & SOUND_FLAGS_CACHING) != 0; } static void rna_Sound_caching_set(PointerRNA *ptr, const int value) { - bSound *sound = (bSound*)(ptr->data); + bSound *sound = (bSound *)(ptr->data); if (value) sound_cache(sound); else @@ -61,7 +61,7 @@ static void rna_Sound_caching_set(PointerRNA *ptr, const int value) static void rna_Sound_caching_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { - sound_update_sequencer(bmain, (bSound*)(ptr->data)); + sound_update_sequencer(bmain, (bSound *)(ptr->data)); } #else diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index aafcc381c51..5b5e3ac8c77 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -74,7 +74,8 @@ EnumPropertyItem space_type_items[] = { {SPACE_CONSOLE, "CONSOLE", 0, "Python Console", ""}, {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""}, {SPACE_CLIP, "CLIP_EDITOR", 0, "Clip Editor", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static EnumPropertyItem draw_channels_items[] = { {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"}, @@ -83,7 +84,8 @@ static EnumPropertyItem draw_channels_items[] = { {SI_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"}, {SI_SHOW_ZBUF, "Z_BUFFER", ICON_IMAGE_ZDEPTH, "Z-Buffer", "Draw Z-buffer associated with image (mapped from camera clip start to end)"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; static EnumPropertyItem transform_orientation_items[] = { {V3D_MANIP_GLOBAL, "GLOBAL", 0, "Global", "Align the transformation axes to world space"}, @@ -94,14 +96,16 @@ static EnumPropertyItem transform_orientation_items[] = { "(bone Y axis for pose mode)"}, {V3D_MANIP_VIEW, "VIEW", 0, "View", "Align the transformation axes to the window"}, {V3D_MANIP_CUSTOM, "CUSTOM", 0, "Custom", "Use a custom transform orientation"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem autosnap_items[] = { {SACTSNAP_OFF, "NONE", 0, "No Auto-Snap", ""}, {SACTSNAP_STEP, "STEP", 0, "Time Step", "Snap to 1.0 frame/second intervals"}, {SACTSNAP_FRAME, "FRAME", 0, "Nearest Frame", "Snap to actual frames/seconds (nla-action time)"}, {SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; EnumPropertyItem viewport_shade_items[] = { {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"}, @@ -110,7 +114,8 @@ EnumPropertyItem viewport_shade_items[] = { {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Texture", "Display the object solid, with a texture"}, {OB_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Display objects solid, with GLSL material"}, {OB_RENDER, "RENDERED", ICON_SMOOTH, "Rendered", "Display render preview"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} +}; #ifdef RNA_RUNTIME @@ -138,9 +143,9 @@ EnumPropertyItem viewport_shade_items[] = { #include "IMB_imbuf_types.h" -static StructRNA* rna_Space_refine(struct PointerRNA *ptr) +static StructRNA *rna_Space_refine(struct PointerRNA *ptr) { - SpaceLink *space = (SpaceLink*)ptr->data; + SpaceLink *space = (SpaceLink *)ptr->data; switch (space->spacetype) { case SPACE_VIEW3D: @@ -184,8 +189,8 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) static ScrArea *rna_area_from_space(PointerRNA *ptr) { - bScreen *sc = (bScreen*)ptr->id.data; - SpaceLink *link = (SpaceLink*)ptr->data; + bScreen *sc = (bScreen *)ptr->id.data; + SpaceLink *link = (SpaceLink *)ptr->data; ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) @@ -216,7 +221,7 @@ static void area_region_from_regiondata(bScreen *sc, void *regiondata, ScrArea * static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_sa, ARegion **r_ar) { - bScreen *sc = (bScreen*)ptr->id.data; + bScreen *sc = (bScreen *)ptr->id.data; void *regiondata = ptr->data; area_region_from_regiondata(sc, regiondata, r_sa, r_ar); @@ -224,8 +229,8 @@ static void rna_area_region_from_regiondata(PointerRNA *ptr, ScrArea **r_sa, ARe static PointerRNA rna_CurrentOrientation_get(PointerRNA *ptr) { - Scene *scene = ((bScreen*)ptr->id.data)->scene; - View3D *v3d = (View3D*)ptr->data; + Scene *scene = ((bScreen *)ptr->id.data)->scene; + View3D *v3d = (View3D *)ptr->data; if (v3d->twmode < V3D_MANIP_CUSTOM) return rna_pointer_inherit_refine(ptr, &RNA_TransformOrientation, NULL); @@ -250,9 +255,9 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, P RNA_enum_items_add_value(&item, &totitem, transform_orientation_items, V3D_MANIP_VIEW); if (ptr->type == &RNA_SpaceView3D) - scene = ((bScreen*)ptr->id.data)->scene; + scene = ((bScreen *)ptr->id.data)->scene; else - scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */ + scene = CTX_data_scene(C); /* can't use scene from ptr->id.data because that enum is also used by operators */ if (scene) { transform_spaces = &scene->transform_spaces; @@ -279,8 +284,8 @@ EnumPropertyItem *rna_TransformOrientation_itemf(bContext *C, PointerRNA *ptr, P /* Space 3D View */ static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int value) { - View3D *v3d = (View3D*)(ptr->data); - bScreen *sc = (bScreen*)ptr->id.data; + View3D *v3d = (View3D *)(ptr->data); + bScreen *sc = (bScreen *)ptr->id.data; v3d->scenelock = value; @@ -289,9 +294,9 @@ static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int valu v3d->lay = sc->scene->lay; /* seek for layact */ bit = 0; - while (bit<32) { - if (v3d->lay & (1<layact = 1<lay & (1 << bit)) { + v3d->layact = 1 << bit; break; } bit++; @@ -302,8 +307,8 @@ static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int valu static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values) { - View3D *v3d = (View3D*)(ptr->data); - bScreen *sc = (bScreen*)ptr->id.data; + View3D *v3d = (View3D *)(ptr->data); + bScreen *sc = (bScreen *)ptr->id.data; Scene *scene = (Scene *)sc->scene; float *loc = give_cursor(scene, v3d); @@ -312,8 +317,8 @@ static void rna_View3D_CursorLocation_get(PointerRNA *ptr, float *values) static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values) { - View3D *v3d = (View3D*)(ptr->data); - bScreen *sc = (bScreen*)ptr->id.data; + View3D *v3d = (View3D *)(ptr->data); + bScreen *sc = (bScreen *)ptr->id.data; Scene *scene = (Scene *)sc->scene; float *cursor = give_cursor(scene, v3d); @@ -322,7 +327,7 @@ static void rna_View3D_CursorLocation_set(PointerRNA *ptr, const float *values) static void rna_SpaceView3D_layer_set(PointerRNA *ptr, const int *values) { - View3D *v3d = (View3D*)(ptr->data); + View3D *v3d = (View3D *)(ptr->data); v3d->lay = ED_view3d_scene_layer_set(v3d->lay, values, &v3d->layact); } @@ -334,7 +339,7 @@ static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), Poin static void rna_SpaceView3D_viewport_shade_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - View3D *v3d = (View3D*)(ptr->data); + View3D *v3d = (View3D *)(ptr->data); ScrArea *sa = rna_area_from_space(ptr); if (v3d->drawtype != OB_RENDER) { @@ -354,7 +359,7 @@ static void rna_SpaceView3D_viewport_shade_update(Main *UNUSED(bmain), Scene *UN static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) { if (U.uiflag & USER_LOCKAROUND) { - View3D *v3d_act = (View3D*)(ptr->data); + View3D *v3d_act = (View3D *)(ptr->data); /* TODO, space looper */ bScreen *screen; @@ -362,7 +367,7 @@ static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), Poin ScrArea *sa; for (sa = screen->areabase.first; sa; sa = sa->next) { SpaceLink *sl; - for (sl = sa->spacedata.first; sl ;sl = sl->next) { + for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; if (v3d != v3d_act) { @@ -379,11 +384,11 @@ static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), Poin static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr) { - View3D *v3d = (View3D*)(ptr->data); + View3D *v3d = (View3D *)(ptr->data); ScrArea *sa = rna_area_from_space(ptr); void *regiondata = NULL; if (sa) { - ListBase *regionbase = (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase; + ListBase *regionbase = (sa->spacedata.first == v3d) ? &sa->regionbase : &v3d->regionbase; ARegion *ar = regionbase->last; /* always last in list, weak .. */ regiondata = ar->regiondata; } @@ -393,14 +398,14 @@ static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr) static PointerRNA rna_SpaceView3D_region_quadview_get(PointerRNA *ptr) { - View3D *v3d = (View3D*)(ptr->data); + View3D *v3d = (View3D *)(ptr->data); ScrArea *sa = rna_area_from_space(ptr); void *regiondata = NULL; if (sa) { - ListBase *regionbase = (sa->spacedata.first == v3d)? &sa->regionbase: &v3d->regionbase; + ListBase *regionbase = (sa->spacedata.first == v3d) ? &sa->regionbase : &v3d->regionbase; ARegion *ar = regionbase->last; /* always before last in list, weak .. */ - ar = (ar->alignment == RGN_ALIGN_QSPLIT)? ar->prev: NULL; + ar = (ar->alignment == RGN_ALIGN_QSPLIT) ? ar->prev : NULL; if (ar) { regiondata = ar->regiondata; } @@ -483,7 +488,7 @@ void rna_RegionView3D_update(ID *id, RegionView3D *rv3d) static EnumPropertyItem *rna_SpaceView3D_viewport_shade_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) { - Scene *scene = ((bScreen*)ptr->id.data)->scene; + Scene *scene = ((bScreen *)ptr->id.data)->scene; RenderEngineType *type = RE_engines_find(scene->r.engine); EnumPropertyItem *item = NULL; @@ -522,35 +527,35 @@ static void rna_SpaceImageEditor_paint_update(Main *bmain, Scene *scene, Pointer static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr) { - SpaceImage *sima = (SpaceImage*)(ptr->data); + SpaceImage *sima = (SpaceImage *)(ptr->data); return ED_space_image_show_render(sima); } static int rna_SpaceImageEditor_show_paint_get(PointerRNA *ptr) { - SpaceImage *sima = (SpaceImage*)(ptr->data); + SpaceImage *sima = (SpaceImage *)(ptr->data); return ED_space_image_show_paint(sima); } static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr) { - SpaceImage *sima = (SpaceImage*)(ptr->data); - bScreen *sc = (bScreen*)ptr->id.data; + SpaceImage *sima = (SpaceImage *)(ptr->data); + bScreen *sc = (bScreen *)ptr->id.data; return ED_space_image_show_uvedit(sima, sc->scene->obedit); } static void rna_SpaceImageEditor_image_set(PointerRNA *ptr, PointerRNA value) { - SpaceImage *sima = (SpaceImage*)(ptr->data); - bScreen *sc = (bScreen*)ptr->id.data; + SpaceImage *sima = (SpaceImage *)(ptr->data); + bScreen *sc = (bScreen *)ptr->id.data; - ED_space_image_set(sima, sc->scene, sc->scene->obedit, (Image*)value.data); + ED_space_image_set(sima, sc->scene, sc->scene->obedit, (Image *)value.data); } static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) { - SpaceImage *sima = (SpaceImage*)ptr->data; + SpaceImage *sima = (SpaceImage *)ptr->data; EnumPropertyItem *item = NULL; ImBuf *ibuf; void *lock; @@ -584,7 +589,7 @@ static EnumPropertyItem *rna_SpaceImageEditor_draw_channels_itemf(bContext *UNUS static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values) { - SpaceImage *sima = (SpaceImage*)ptr->data; + SpaceImage *sima = (SpaceImage *)ptr->data; ScrArea *sa; ARegion *ar; @@ -600,7 +605,7 @@ static void rna_SpaceImageEditor_zoom_get(PointerRNA *ptr, float *values) static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *values) { - SpaceImage *sima = (SpaceImage*)ptr->data; + SpaceImage *sima = (SpaceImage *)ptr->data; if (sima->flag & SI_COORDFLOATS) { copy_v2_v2(values, sima->cursor); @@ -616,7 +621,7 @@ static void rna_SpaceImageEditor_cursor_location_get(PointerRNA *ptr, float *val static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const float *values) { - SpaceImage *sima = (SpaceImage*)ptr->data; + SpaceImage *sima = (SpaceImage *)ptr->data; if (sima->flag & SI_COORDFLOATS) { copy_v2_v2(sima->cursor, values); @@ -632,7 +637,7 @@ static void rna_SpaceImageEditor_cursor_location_set(PointerRNA *ptr, const floa static void rna_SpaceImageEditor_curves_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - SpaceImage *sima = (SpaceImage*)ptr->data; + SpaceImage *sima = (SpaceImage *)ptr->data; ImBuf *ibuf; void *lock; @@ -646,7 +651,7 @@ static void rna_SpaceImageEditor_curves_update(Main *UNUSED(bmain), Scene *UNUSE static void rna_SpaceImageEditor_scopes_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { - SpaceImage *sima = (SpaceImage*)ptr->data; + SpaceImage *sima = (SpaceImage *)ptr->data; ImBuf *ibuf; void *lock; @@ -662,7 +667,7 @@ static void rna_SpaceImageEditor_scopes_update(Main *UNUSED(bmain), Scene *scene static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value) { - SpaceText *st = (SpaceText*)(ptr->data); + SpaceText *st = (SpaceText *)(ptr->data); st->wordwrap = value; st->left = 0; @@ -670,19 +675,19 @@ static void rna_SpaceTextEditor_word_wrap_set(PointerRNA *ptr, int value) static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) { - SpaceText *st = (SpaceText*)(ptr->data); + SpaceText *st = (SpaceText *)(ptr->data); st->text = value.data; - WM_main_add_notifier(NC_TEXT|NA_SELECTED, st->text); + WM_main_add_notifier(NC_TEXT | NA_SELECTED, st->text); } static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - SpaceText *st = (SpaceText*)ptr->data; + SpaceText *st = (SpaceText *)ptr->data; if (st->text) - WM_main_add_notifier(NC_TEXT|NA_EDITED, st->text); + WM_main_add_notifier(NC_TEXT | NA_EDITED, st->text); } @@ -691,13 +696,13 @@ static void rna_SpaceTextEditor_updateEdited(Main *UNUSED(bmain), Scene *UNUSED( /* note: this function exists only to avoid id refcounting */ static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value) { - SpaceButs *sbuts = (SpaceButs*)(ptr->data); + SpaceButs *sbuts = (SpaceButs *)(ptr->data); sbuts->pinid = value.data; } static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr) { - SpaceButs *sbuts = (SpaceButs*)(ptr->data); + SpaceButs *sbuts = (SpaceButs *)(ptr->data); if (sbuts->pinid) return ID_code_to_RNA_type(GS(sbuts->pinid->name)); @@ -707,7 +712,7 @@ static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr) static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - SpaceButs *sbuts = (SpaceButs*)(ptr->data); + SpaceButs *sbuts = (SpaceButs *)(ptr->data); ID *id = sbuts->pinid; if (id == NULL) { @@ -717,7 +722,7 @@ static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED switch (GS(id->name)) { case ID_MA: - WM_main_add_notifier(NC_MATERIAL|ND_SHADING, NULL); + WM_main_add_notifier(NC_MATERIAL | ND_SHADING, NULL); break; case ID_TE: WM_main_add_notifier(NC_TEXTURE, NULL); @@ -734,7 +739,7 @@ static void rna_SpaceProperties_pin_id_update(Main *UNUSED(bmain), Scene *UNUSED static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value) { - SpaceButs *sbuts = (SpaceButs*)(ptr->data); + SpaceButs *sbuts = (SpaceButs *)(ptr->data); sbuts->mainb = value; sbuts->mainbuser = value; @@ -742,7 +747,7 @@ static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value) static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value) { - SpaceButs *sbuts = (SpaceButs*)(ptr->data); + SpaceButs *sbuts = (SpaceButs *)(ptr->data); sbuts->align = value; sbuts->re_align = 1; @@ -751,19 +756,19 @@ static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value) /* Space Console */ static void rna_ConsoleLine_body_get(PointerRNA *ptr, char *value) { - ConsoleLine *ci = (ConsoleLine*)ptr->data; + ConsoleLine *ci = (ConsoleLine *)ptr->data; strcpy(value, ci->line); } static int rna_ConsoleLine_body_length(PointerRNA *ptr) { - ConsoleLine *ci = (ConsoleLine*)ptr->data; + ConsoleLine *ci = (ConsoleLine *)ptr->data; return ci->len; } static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value) { - ConsoleLine *ci = (ConsoleLine*)ptr->data; + ConsoleLine *ci = (ConsoleLine *)ptr->data; int len = strlen(value); if ((len >= ci->len_alloc) || (len * 2 < ci->len_alloc) ) { /* allocate a new string */ @@ -780,7 +785,7 @@ static void rna_ConsoleLine_body_set(PointerRNA *ptr, const char *value) static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) { - ConsoleLine *ci = (ConsoleLine*)ptr->data; + ConsoleLine *ci = (ConsoleLine *)ptr->data; *min = 0; *max = ci->len; /* intentionally _not_ -1 */ @@ -790,8 +795,8 @@ static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *m static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value) { - SpaceAction *saction = (SpaceAction*)(ptr->data); - bAction *act = (bAction*)value.data; + SpaceAction *saction = (SpaceAction *)(ptr->data); + bAction *act = (bAction *)value.data; if ((act == NULL) || (act->idroot == 0)) { /* just set if we're clearing the action or if the action is "amorphous" still */ @@ -805,7 +810,7 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu saction->action = act; else printf("ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level animation\n", - act->id.name+2); + act->id.name + 2); } else if (saction->mode == SACTCONT_SHAPEKEY) { /* as the name says, "shapekey-level" only... */ @@ -813,7 +818,7 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu saction->action = act; else printf("ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate Shape Keys\n", - act->id.name+2); + act->id.name + 2); } else { printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n"); @@ -823,11 +828,11 @@ static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA valu static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { - SpaceAction *saction = (SpaceAction*)(ptr->data); - Object *obact = (scene->basact)? scene->basact->object: NULL; + SpaceAction *saction = (SpaceAction *)(ptr->data); + Object *obact = (scene->basact) ? scene->basact->object : NULL; /* we must set this action to be the one used by active object (if not pinned) */ - if (obact/* && saction->pin == 0*/) { + if (obact /* && saction->pin == 0*/) { AnimData *adt = NULL; if (saction->mode == SACTCONT_ACTION) { @@ -837,7 +842,7 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *s else if (saction->mode == SACTCONT_SHAPEKEY) { Key *key = ob_get_key(obact); if (key) - adt = BKE_id_add_animdata(&key->id); /* this only adds if non-existant */ + adt = BKE_id_add_animdata(&key->id); /* this only adds if non-existant */ } /* set action */ @@ -851,14 +856,14 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *s } /* force depsgraph flush too */ - DAG_id_tag_update(&obact->id, OB_RECALC_OB|OB_RECALC_DATA); + DAG_id_tag_update(&obact->id, OB_RECALC_OB | OB_RECALC_DATA); } } static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { - SpaceAction *saction = (SpaceAction*)(ptr->data); - Object *obact = (scene->basact)? scene->basact->object: NULL; + SpaceAction *saction = (SpaceAction *)(ptr->data); + Object *obact = (scene->basact) ? scene->basact->object : NULL; /* special exceptions for ShapeKey Editor mode */ if (saction->mode == SACTCONT_SHAPEKEY) { @@ -866,7 +871,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *sce /* 1) update the action stored for the editor */ if (key) - saction->action = (key->adt)? key->adt->action : NULL; + saction->action = (key->adt) ? key->adt->action : NULL; else saction->action = NULL; @@ -881,7 +886,7 @@ static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *sce /* 1) update the action stored for the editor */ /* TODO: context selector could help decide this with more control? */ if (obact) - saction->action = (obact->adt)? obact->adt->action : NULL; + saction->action = (obact->adt) ? obact->adt->action : NULL; else saction->action = NULL; } @@ -901,7 +906,7 @@ static void rna_SpaceGraphEditor_display_mode_update(Main *UNUSED(bmain), Scene static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr) { - SpaceIpo *sipo = (SpaceIpo*)(ptr->data); + SpaceIpo *sipo = (SpaceIpo *)(ptr->data); return (sipo->ghostCurves.first != NULL); } @@ -914,7 +919,7 @@ static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(sc static float rna_BackgroundImage_opacity_get(PointerRNA *ptr) { BGpic *bgpic = (BGpic *)ptr->data; - return 1.0f-bgpic->blend; + return 1.0f - bgpic->blend; } static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value) @@ -927,7 +932,7 @@ static BGpic *rna_BackgroundImage_new(View3D *v3d) { BGpic *bgpic = ED_view3D_background_image_new(v3d); - WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d); + WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d); return bgpic; } @@ -939,22 +944,22 @@ static void rna_BackgroundImage_remove(View3D *v3d, ReportList *reports, BGpic * } else { ED_view3D_background_image_remove(v3d, bgpic); - WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d); + WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d); } } static void rna_BackgroundImage_clear(View3D *v3d) { ED_view3D_background_image_clear(v3d); - WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d); + WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, v3d); } /* Space Node Editor */ static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, PointerRNA value) { - SpaceNode *snode = (SpaceNode*)ptr->data; - bNodeTree *ntree = (bNodeTree*)value.data; + SpaceNode *snode = (SpaceNode *)ptr->data; + bNodeTree *ntree = (bNodeTree *)value.data; /* exclude group trees, only trees of the active type */ return (ntree->nodetype == 0 && ntree->type == snode->treetype); @@ -962,7 +967,7 @@ static int rna_SpaceNodeEditor_node_tree_poll(PointerRNA *ptr, PointerRNA value) static void rna_SpaceNodeEditor_node_tree_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr) { - SpaceNode *snode = (SpaceNode*)ptr->data; + SpaceNode *snode = (SpaceNode *)ptr->data; ED_node_tree_update(snode, scene); } @@ -1023,22 +1028,22 @@ static EnumPropertyItem *rna_SpaceProperties_texture_context_itemf(bContext *C, static void rna_SpaceClipEditor_clip_set(PointerRNA *ptr, PointerRNA value) { - SpaceClip *sc = (SpaceClip*)(ptr->data); - bScreen *screen = (bScreen*)ptr->id.data; + SpaceClip *sc = (SpaceClip *)(ptr->data); + bScreen *screen = (bScreen *)ptr->id.data; - ED_space_clip_set(NULL, screen, sc, (MovieClip*)value.data); + ED_space_clip_set(NULL, screen, sc, (MovieClip *)value.data); } static void rna_SpaceClipEditor_clip_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - SpaceClip *sc = (SpaceClip*)(ptr->data); + SpaceClip *sc = (SpaceClip *)(ptr->data); sc->scopes.ok = 0; } static void rna_SpaceClipEditor_lock_selection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - SpaceClip *sc = (SpaceClip*)(ptr->data); + SpaceClip *sc = (SpaceClip *)(ptr->data); sc->xlockof = 0.f; sc->ylockof = 0.f; @@ -1080,25 +1085,29 @@ static void rna_def_space_image_uv(BlenderRNA *brna) "Select UVs that are at the same location and share a mesh vertex"}, {SI_STICKY_VERTEX, "SHARED_VERTEX", ICON_STICKY_UVS_VERT, "Shared Vertex", "Select UVs that share mesh vertex, irrespective if they are in the same location"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem dt_uv_items[] = { {SI_UVDT_OUTLINE, "OUTLINE", 0, "Outline", "Draw white edges with black outline"}, {SI_UVDT_DASH, "DASH", 0, "Dash", "Draw dashed black-white edges"}, {SI_UVDT_BLACK, "BLACK", 0, "Black", "Draw black edges"}, {SI_UVDT_WHITE, "WHITE", 0, "White", "Draw white edges"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem dt_uvstretch_items[] = { {SI_UVDT_STRETCH_ANGLE, "ANGLE", 0, "Angle", "Angular distortion between UV and 3D angles"}, {SI_UVDT_STRETCH_AREA, "AREA", 0, "Area", "Area distortion between UV and 3D faces"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem pivot_items[] = { {V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""}, {V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""}, {V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SpaceUVEditor", NULL); RNA_def_struct_sdna(srna, "SpaceImage"); @@ -1111,85 +1120,85 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_enum_items(prop, sticky_mode_items); RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); /* drawing */ prop = RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt_uv"); RNA_def_property_enum_items(prop, dt_uv_items); RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "show_smooth_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV); RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "show_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH); RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and " "their 3D coordinates (blue for low distortion, red for high distortion)"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch"); RNA_def_property_enum_items(prop, dt_uvstretch_items); RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "show_modified_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW); RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "show_other_objects", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER); RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "show_normalized_coords", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS); RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAWFACES); RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get", "rna_SpaceImageEditor_cursor_location_set", NULL); RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); /* todo: move edge and face drawing options here from G.f */ prop = RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP); RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "lock_bounds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV); RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "use_live_unwrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP); RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "around"); RNA_def_property_enum_items(prop, pivot_items); RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL); } static void rna_def_space_outliner(BlenderRNA *brna) @@ -1211,7 +1220,8 @@ static void rna_def_space_outliner(BlenderRNA *brna) {SO_DATABLOCKS, "DATABLOCKS", 0, "Datablocks", "Display raw datablocks"}, {SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display the user preference datablocks"}, {SO_KEYMAP, "KEYMAPS", 0, "Key Maps", "Display keymap datablocks"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "SpaceOutliner", "Space"); RNA_def_struct_sdna(srna, "SpaceOops"); @@ -1221,27 +1231,27 @@ static void rna_def_space_outliner(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "outlinevis"); RNA_def_property_enum_items(prop, display_mode_items); RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "search_string"); RNA_def_property_ui_text(prop, "Display Filter", "Live search filtering string"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); prop = RNA_def_property(srna, "use_filter_case_sensitive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_CASE_SENSITIVE); RNA_def_property_ui_text(prop, "Case Sensitive Matches Only", "Only use case sensitive matches of search string"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); prop = RNA_def_property(srna, "use_filter_complete", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "search_flags", SO_FIND_COMPLETE); RNA_def_property_ui_text(prop, "Complete Matches Only", "Only use complete matches of search string"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); prop = RNA_def_property(srna, "show_restrict_columns", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS); RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); } static void rna_def_background_image(BlenderRNA *brna) @@ -1252,26 +1262,27 @@ static void rna_def_background_image(BlenderRNA *brna) /* note: combinations work but don't flip so arnt that useful */ static EnumPropertyItem bgpic_axis_items[] = { {0, "", 0, N_("X Axis"), ""}, - {(1<