From 8360dc066c7d12ec9b8e96ad399f23f9c873f691 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 3 Dec 2008 20:17:12 +0000 Subject: [PATCH] RNA * Added a function to define booleans negative, to turn negative properties into positive ones gettin rid of the no_ prefix, and also got rid of the use_ prefix for two booleans. * Also made the function for enum bitflags separate, this is quite rare so don't need to bother with this in most cases. * Removed svn:executable flags from some files. --- source/blender/makesrna/intern/makesrna.c | 24 ++++++++-------- source/blender/makesrna/intern/rna_brush.c | 0 source/blender/makesrna/intern/rna_camera.c | 13 ++++++--- source/blender/makesrna/intern/rna_color.c | 12 ++++---- source/blender/makesrna/intern/rna_curve.c | 6 ++-- source/blender/makesrna/intern/rna_define.c | 28 ++++++++++++++++--- source/blender/makesrna/intern/rna_image.c | 4 +-- source/blender/makesrna/intern/rna_internal.h | 2 +- source/blender/makesrna/intern/rna_ipo.c | 6 ++-- source/blender/makesrna/intern/rna_lamp.c | 20 ++++++------- source/blender/makesrna/intern/rna_lattice.c | 6 ++-- source/blender/makesrna/intern/rna_material.c | 6 ++-- source/blender/makesrna/intern/rna_mesh.c | 6 ++-- source/blender/makesrna/intern/rna_meta.c | 0 source/blender/makesrna/intern/rna_modifier.c | 2 +- source/blender/makesrna/intern/rna_radio.c | 2 +- source/blender/makesrna/intern/rna_scene.c | 2 +- source/blender/makesrna/intern/rna_sensor.c | 14 +++++----- source/blender/makesrna/intern/rna_vfont.c | 0 19 files changed, 89 insertions(+), 64 deletions(-) mode change 100755 => 100644 source/blender/makesrna/intern/rna_brush.c mode change 100755 => 100644 source/blender/makesrna/intern/rna_curve.c mode change 100755 => 100644 source/blender/makesrna/intern/rna_meta.c mode change 100755 => 100644 source/blender/makesrna/intern/rna_modifier.c mode change 100755 => 100644 source/blender/makesrna/intern/rna_vfont.c diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 03b1855cefb..b5c0c7644f8 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -205,15 +205,15 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr rna_print_data_get(f, dp); if(dp->dnaarraylength == 1) { if(prop->type == PROP_BOOLEAN && dp->booleanbit) - fprintf(f, " return ((data->%s & (%d<dnaname, dp->booleanbit); + fprintf(f, " return (%s(data->%s & (%d<booleannegative)? "!": "", dp->dnaname, dp->booleanbit); else - fprintf(f, " return (%s)((&data->%s)[index]);\n", rna_type_type(prop), dp->dnaname); + fprintf(f, " return (%s)%s((&data->%s)[index]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname); } else { if(prop->type == PROP_BOOLEAN && dp->booleanbit) - fprintf(f, " return ((data->%s[index] & %d) != 0);\n", dp->dnaname, dp->booleanbit); + fprintf(f, " return (%s(data->%s[index] & %d) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit); else - fprintf(f, " return (%s)(data->%s[index]);\n", rna_type_type(prop), dp->dnaname); + fprintf(f, " return (%s)%s(data->%s[index]);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname); } fprintf(f, "}\n\n"); } @@ -222,13 +222,13 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr fprintf(f, "{\n"); rna_print_data_get(f, dp); if(prop->type == PROP_BOOLEAN && dp->booleanbit) - fprintf(f, " return (((data->%s) & %d) != 0);\n", dp->dnaname, dp->booleanbit); + fprintf(f, " return (%s((data->%s) & %d) != 0);\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit); else if(prop->type == PROP_ENUM && dp->enumbitflags) fprintf(f, " return ((data->%s) & %d);\n", dp->dnaname, rna_enum_bitmask(prop)); else if(prop->type == PROP_POINTER && dp->dnapointerlevel == 0) fprintf(f, " return (%s)&(data->%s);\n", rna_type_type(prop), dp->dnaname); else - fprintf(f, " return (%s)(data->%s);\n", rna_type_type(prop), dp->dnaname); + fprintf(f, " return (%s)%s(data->%s);\n", rna_type_type(prop), (dp->booleannegative)? "!": "", dp->dnaname); fprintf(f, "}\n\n"); } break; @@ -313,22 +313,22 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr rna_print_data_get(f, dp); if(dp->dnaarraylength == 1) { if(prop->type == PROP_BOOLEAN && dp->booleanbit) { - fprintf(f, " if(value) data->%s |= (%d<dnaname, dp->booleanbit); + fprintf(f, " if(%svalue) data->%s |= (%d<booleannegative)? "!": "", dp->dnaname, dp->booleanbit); fprintf(f, " else data->%s &= ~(%d<dnaname, dp->booleanbit); } else { rna_clamp_value(f, prop); - fprintf(f, " (&data->%s)[index]= value;\n", dp->dnaname); + fprintf(f, " (&data->%s)[index]= %svalue;\n", dp->dnaname, (dp->booleannegative)? "!": ""); } } else { if(prop->type == PROP_BOOLEAN && dp->booleanbit) { - fprintf(f, " if(value) data->%s[index] |= %d;\n", dp->dnaname, dp->booleanbit); + fprintf(f, " if(%svalue) data->%s[index] |= %d;\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit); fprintf(f, " else data->%s[index] &= ~%d;\n", dp->dnaname, dp->booleanbit); } else { rna_clamp_value(f, prop); - fprintf(f, " data->%s[index]= value;\n", dp->dnaname); + fprintf(f, " data->%s[index]= %svalue;\n", dp->dnaname, (dp->booleannegative)? "!": ""); } } fprintf(f, "}\n\n"); @@ -338,7 +338,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr fprintf(f, "{\n"); rna_print_data_get(f, dp); if(prop->type == PROP_BOOLEAN && dp->booleanbit) { - fprintf(f, " if(value) data->%s |= %d;\n", dp->dnaname, dp->booleanbit); + fprintf(f, " if(%svalue) data->%s |= %d;\n", (dp->booleannegative)? "!": "", dp->dnaname, dp->booleanbit); fprintf(f, " else data->%s &= ~%d;\n", dp->dnaname, dp->booleanbit); } else if(prop->type == PROP_ENUM && dp->enumbitflags) { @@ -347,7 +347,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr } else { rna_clamp_value(f, prop); - fprintf(f, " data->%s= value;\n", dp->dnaname); + fprintf(f, " data->%s= %svalue;\n", dp->dnaname, (dp->booleannegative)? "!": ""); } fprintf(f, "}\n\n"); } diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c old mode 100755 new mode 100644 diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index f5ee073b663..55fc5989fa8 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -43,6 +43,10 @@ void RNA_def_camera(BlenderRNA *brna) {CAM_PERSP, "PERSP", "Perspective", ""}, {CAM_ORTHO, "ORTHO", "Orthographic", ""}, {0, NULL, NULL, NULL}}; + static EnumPropertyItem prop_lens_unit_items[] = { + {0, "MILLIMETERS", "Millimeters", ""}, + {CAM_ANGLETOGGLE, "DEGREES", "Degrees", ""}, + {0, NULL, NULL, NULL}}; srna= RNA_def_struct(brna, "Camera", "ID", "Camera"); @@ -124,11 +128,12 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME); RNA_def_property_ui_text(prop, "Show Name", "Draw the active Camera's name in Camera view."); - prop= RNA_def_property(srna, "use_degrees", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_ANGLETOGGLE); - RNA_def_property_ui_text(prop, "Use Degrees", "Use degrees instead of mm as the unit of the Camera lens."); + prop= RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, prop_lens_unit_items); + RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface."); - /* Pointers */ + /* pointers */ rna_def_ipo_common(srna); prop= RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index ba92cb9c938..c3ebf591d81 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -53,7 +53,7 @@ static void rna_CurveMapping_curves_begin(CollectionPropertyIterator *iter, Poin rna_iterator_array_begin(iter, cumap->cm, sizeof(CurveMap), rna_CurveMapping_curves_length(ptr), NULL); } -static void rna_CurveMapping_use_clipping_set(PointerRNA *ptr, int value) +static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value) { CurveMapping *cumap= (CurveMapping*)ptr->data; @@ -132,7 +132,7 @@ static void rna_def_curvemappoint(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Location", ""); prop= RNA_def_property(srna, "handle_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "flag", PROP_DEF_ENUM_BITFLAGS); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_handle_type_items); RNA_def_property_flag(prop, PROP_NOT_EDITABLE); RNA_def_property_ui_text(prop, "Handle Type", ""); @@ -157,7 +157,7 @@ static void rna_def_curvemap(BlenderRNA *brna) /* not editable for now, need to have CurveMapping to do curvemapping_changed */ prop= RNA_def_property(srna, "extend", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "flag", CUMA_EXTEND_EXTRAPOLATE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_extend_items); RNA_def_property_flag(prop, PROP_NOT_EDITABLE); RNA_def_property_ui_text(prop, "Extend", ""); @@ -175,10 +175,10 @@ static void rna_def_curvemapping(BlenderRNA *brna) srna= RNA_def_struct(brna, "CurveMapping", NULL, "CurveMapping"); - prop= RNA_def_property(srna, "use_clipping", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CUMA_DO_CLIP); - RNA_def_property_ui_text(prop, "Use Clipping", ""); - RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveMapping_use_clipping_set"); + RNA_def_property_ui_text(prop, "Clip", ""); + RNA_def_property_boolean_funcs(prop, NULL, "rna_CurveMapping_clip_set"); prop= RNA_def_property(srna, "clip_min_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clipr.xmin"); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c old mode 100755 new mode 100644 index f7db5bc1c45..132b41d93d4 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -166,9 +166,9 @@ static void rna_def_nurbs(BlenderRNA *brna, StructRNA *srna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO); RNA_def_property_ui_text(prop, "UV Orco", "Forces to use UV coordinates for texture mapping 'orco'."); - prop= RNA_def_property(srna, "no_puno_flip", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_NOPUNOFLIP); - RNA_def_property_ui_text(prop, "No Puno Flip", "Don't flip vertex normals while rendering."); + prop= RNA_def_property(srna, "vertex_normal_flip", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_NOPUNOFLIP); + RNA_def_property_ui_text(prop, "Vertex Normal Flip", "Flip vertex normals towards the camera during render"); } static void rna_def_font(BlenderRNA *brna, StructRNA *srna) diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 6993167be11..77093938c55 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -592,7 +592,7 @@ PropertyRNA *RNA_def_property(StructRNA *srna, const char *identifier, int type, } case PROP_ENUM: DefRNA.silent= 1; - RNA_def_property_enum_sdna(prop, NULL, identifier, 0); + RNA_def_property_enum_sdna(prop, NULL, identifier); DefRNA.silent= 0; break; case PROP_POINTER: @@ -970,6 +970,17 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, co dp->booleanbit= bit; } +void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int booleanbit) +{ + StructDefRNA *ds; + PropertyDefRNA *dp; + + RNA_def_property_boolean_sdna(prop, structname, propname, booleanbit); + + if((ds=DefRNA.structs.last) && (dp=ds->properties.last)) + dp->booleannegative= 1; +} + void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname) { PropertyDefRNA *dp; @@ -1028,7 +1039,7 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons rna_def_property_sdna(prop, structname, propname); } -void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname, EnumPropertyFlag flag) +void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname) { PropertyDefRNA *dp; StructRNA *srna= DefRNA.laststruct; @@ -1045,8 +1056,6 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const } if((dp=rna_def_property_sdna(prop, structname, propname))) { - dp->enumbitflags= (flag & PROP_DEF_ENUM_BITFLAGS); - if(prop->arraylength) { prop->arraylength= 0; if(!DefRNA.silent) { @@ -1057,6 +1066,17 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const } } +void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname) +{ + StructDefRNA *ds; + PropertyDefRNA *dp; + + RNA_def_property_enum_sdna(prop, structname, propname); + + if((ds=DefRNA.structs.last) && (dp=ds->properties.last)) + dp->enumbitflags= 1; +} + void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname) { PropertyDefRNA *dp; diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 17a0f9eadcd..899349afba1 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -150,7 +150,7 @@ static void rna_def_image(BlenderRNA *brna) /* generated image (image_generated_change_cb) */ prop= RNA_def_property(srna, "generated_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "gen_type", 0); + 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."); @@ -166,7 +166,7 @@ static void rna_def_image(BlenderRNA *brna) /* realtime properties */ prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "flag", PROP_DEF_ENUM_BITFLAGS); + 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."); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index bdbc87c2372..9bb6eb24056 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -56,7 +56,7 @@ typedef struct PropertyDefRNA { const char *dnalengthname; int dnalengthfixed; - int booleanbit; + int booleanbit, booleannegative; int enumbitflags; } PropertyDefRNA; diff --git a/source/blender/makesrna/intern/rna_ipo.c b/source/blender/makesrna/intern/rna_ipo.c index 9cd3c088a7a..eda8cf656f8 100644 --- a/source/blender/makesrna/intern/rna_ipo.c +++ b/source/blender/makesrna/intern/rna_ipo.c @@ -83,13 +83,13 @@ void rna_def_ipocurve(BlenderRNA *brna) /* Enums */ prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "ipo", 0); + RNA_def_property_enum_sdna(prop, NULL, "ipo"); RNA_def_property_flag(prop, PROP_NOT_EDITABLE); RNA_def_property_enum_items(prop, prop_mode_interpolation_items); RNA_def_property_ui_text(prop, "Interpolation", ""); prop= RNA_def_property(srna, "extrapolation", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "extrap", 0); + RNA_def_property_enum_sdna(prop, NULL, "extrap"); RNA_def_property_flag(prop, PROP_NOT_EDITABLE); RNA_def_property_enum_items(prop, prop_mode_extend_items); RNA_def_property_ui_text(prop, "Extrapolation", ""); @@ -132,7 +132,7 @@ void rna_def_ipo(BlenderRNA *brna) /* Enums */ prop= RNA_def_property(srna, "block_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "blocktype", 0); + RNA_def_property_enum_sdna(prop, NULL, "blocktype"); RNA_def_property_flag(prop, PROP_NOT_EDITABLE); RNA_def_property_enum_items(prop, prop_blocktype_items); RNA_def_property_ui_text(prop, "Block Type", ""); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index fbc86fec54c..ec3a346934f 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -128,7 +128,7 @@ void RNA_def_lamp(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Sky Color Space", ""); prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "skyblendtype", 0); + RNA_def_property_enum_sdna(prop, NULL, "skyblendtype"); RNA_def_property_enum_items(prop, prop_blendmode_items); RNA_def_property_ui_text(prop, "Sky Blend Type", "Blend type for how sky is combined with world sky"); @@ -141,12 +141,12 @@ void RNA_def_lamp(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Ray Sample Method", "The Method in how rays are sampled"); prop= RNA_def_property(srna, "buffer_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "buftype", 0); + RNA_def_property_enum_sdna(prop, NULL, "buftype"); RNA_def_property_enum_items(prop, prop_shadbuftype_items); RNA_def_property_ui_text(prop, "Buffer Type", "Type of Shadow Buffer."); prop= RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "filtertype", 0); + RNA_def_property_enum_sdna(prop, NULL, "filtertype"); RNA_def_property_enum_items(prop, prop_shadbuffiltertype_items); RNA_def_property_ui_text(prop, "Filter Type", "Type of Shadow Buffer Filter."); @@ -356,20 +356,20 @@ void RNA_def_lamp(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG); RNA_def_property_ui_text(prop, "Negative", "Lamp casts negative light."); - prop= RNA_def_property(srna, "no_specular", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NO_SPEC); - RNA_def_property_ui_text(prop, "No Specular", "Lamp does not create specular highlights."); + prop= RNA_def_property(srna, "specular", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC); + RNA_def_property_ui_text(prop, "Specular", "Lamp creates specular highlights."); - prop= RNA_def_property(srna, "no_diffuse", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NO_DIFF); - RNA_def_property_ui_text(prop, "No Diffuse", "Lamp does not create diffuse shading."); + prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF); + RNA_def_property_ui_text(prop, "Diffuse", "Lamp does diffuse shading."); prop= RNA_def_property(srna, "only_shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_ONLYSHADOW); RNA_def_property_ui_text(prop, "Only Shadow", "Lamp only creates shadows."); prop= RNA_def_property(srna, "shadow", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "mode", PROP_DEF_ENUM_BITFLAGS); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, prop_shadow_items); RNA_def_property_ui_text(prop, "Shadow", "Method to compute lamp shadow."); diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index e4e82b3f065..89299e1c6ca 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -64,17 +64,17 @@ void RNA_def_lattice(BlenderRNA *brna) RNA_def_property_ui_text(prop, "W", "Points in W direction."); prop= RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "typeu", 0); + RNA_def_property_enum_sdna(prop, NULL, "typeu"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type U", ""); prop= RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "typev", 0); + RNA_def_property_enum_sdna(prop, NULL, "typev"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type V", ""); prop= RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "typew", 0); + RNA_def_property_enum_sdna(prop, NULL, "typew"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type W", ""); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 0ef564282eb..b4b58baced6 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -63,7 +63,7 @@ void RNA_def_material(BlenderRNA *brna) srna= RNA_def_struct(brna, "Material", "ID", "Material"); prop= RNA_def_property(srna, "color_model", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "colormodel", 0); + RNA_def_property_enum_sdna(prop, NULL, "colormodel"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Color Model", ""); @@ -99,7 +99,7 @@ void RNA_def_material(BlenderRNA *brna) /* diffuse shaders */ prop= RNA_def_property(srna, "diffuse_shader", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "diff_shader", 0); + RNA_def_property_enum_sdna(prop, NULL, "diff_shader"); RNA_def_property_enum_items(prop, prop_diff_shader_items); RNA_def_property_ui_text(prop, "Diffuse Shader Model", ""); @@ -172,7 +172,7 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Ray Mirror Max Dist", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color."); prop= RNA_def_property(srna, "ray_mirror_fadeto", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir", 0); + RNA_def_property_enum_sdna(prop, NULL, "fadeto_mir"); RNA_def_property_enum_items(prop, prop_fadeto_mir_items); RNA_def_property_ui_text(prop, "Ray Mirror End Fade-out", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor."); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index b0d66254c08..e21d2a57ff3 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -942,9 +942,9 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_range(prop, 1, 80); RNA_def_property_ui_text(prop, "Auto Smooth Angle", "Defines maximum angle between face normals that 'Auto Smooth' will operate on"); - prop= RNA_def_property(srna, "no_vnormal_flip", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_NOPUNOFLIP); - RNA_def_property_ui_text(prop, "No Vertex Normal Flip", "Disables flipping of vertexnormals during render"); + prop= RNA_def_property(srna, "vertex_normal_flip", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ME_NOPUNOFLIP); + RNA_def_property_ui_text(prop, "Vertex Normal Flip", "Flip vertex normals towards the camera during render"); prop= RNA_def_property(srna, "double_sided", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_TWOSIDED); diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c old mode 100755 new mode 100644 diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c old mode 100755 new mode 100644 index 510e4291259..c3a2274101f --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -83,7 +83,7 @@ void RNA_def_modifier(BlenderRNA *brna) /* enums */ prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_flag(prop, PROP_NOT_EDITABLE); - RNA_def_property_enum_sdna(prop, NULL, "type", PROP_DEF_ENUM_BITFLAGS); + RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, type_items); RNA_def_property_ui_text(prop, "Type", ""); diff --git a/source/blender/makesrna/intern/rna_radio.c b/source/blender/makesrna/intern/rna_radio.c index 478dc2d2063..31398b5fa4e 100644 --- a/source/blender/makesrna/intern/rna_radio.c +++ b/source/blender/makesrna/intern/rna_radio.c @@ -50,7 +50,7 @@ void RNA_def_radio(BlenderRNA *brna) /* Enums */ prop= RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "drawtype", 0); + RNA_def_property_enum_sdna(prop, NULL, "drawtype"); RNA_def_property_enum_items(prop, prop_drawtype_items); RNA_def_property_ui_text(prop, "Draw Mode", "Radiosity draw modes."); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 3ee0e78f65f..03b0d7db6bf 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -137,7 +137,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Stamp Note", "User define note for the render stamping."); prop= RNA_def_property(srna, "unwrapper", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "toolsettings->unwrapper", 0); + RNA_def_property_enum_sdna(prop, NULL, "toolsettings->unwrapper"); RNA_def_property_enum_items(prop, unwrapper_items); RNA_def_property_ui_text(prop, "Unwrapper", "Unwrap algorithm used by the Unwrap tool."); diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 661b813080e..e8c32a5f78b 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -176,7 +176,7 @@ void rna_def_mouse_sensor(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bMouseSensor", "data"); prop= RNA_def_property(srna, "mouse_event", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type", 0); + RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, mouse_event_items); RNA_def_property_ui_text(prop, "Mouse Event", "Specify the type of event this mouse sensor should trigger on."); } @@ -249,7 +249,7 @@ void rna_def_property_sensor(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bPropertySensor", "data"); prop= RNA_def_property(srna, "evaluation_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type", 0); + RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Evaluation Type", "Type of property evaluation."); @@ -325,7 +325,7 @@ void rna_def_collision_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Material Name", "Only look for Objects with this material."); prop= RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "mode", 0); + RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Collision Type", "Toggle collision on material or property."); } @@ -406,7 +406,7 @@ void rna_def_ray_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material."); prop= RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "mode", 0); + RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Collision Type", "Toggle collision on material or property."); @@ -419,7 +419,7 @@ void rna_def_ray_sensor(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Range", "Sense objects no farther than this distance."); prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "axisflag", 0); + RNA_def_property_enum_sdna(prop, NULL, "axisflag"); RNA_def_property_enum_items(prop, axis_items); RNA_def_property_ui_text(prop, "Axis", "Specify along which axis the ray is cast."); } @@ -463,7 +463,7 @@ void rna_def_joystick_sensor(BlenderRNA *brna) RNA_def_property_range(prop, 0, SENS_JOY_MAXINDEX-1); prop= RNA_def_property(srna, "event_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type", 0); + RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, event_type_items); RNA_def_property_ui_text(prop, "Event Type", "The type of event this joystick sensor is triggered on."); @@ -489,7 +489,7 @@ void rna_def_joystick_sensor(BlenderRNA *brna) RNA_def_property_range(prop, 0, 32768); prop= RNA_def_property(srna, "axis_direction", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "axisf", 0); + RNA_def_property_enum_sdna(prop, NULL, "axisf"); RNA_def_property_enum_items(prop, axis_direction_items); RNA_def_property_ui_text(prop, "Axis Direction", "The direction of the axis."); diff --git a/source/blender/makesrna/intern/rna_vfont.c b/source/blender/makesrna/intern/rna_vfont.c old mode 100755 new mode 100644