diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index ffd9bb772cc..57e46314777 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -290,13 +290,11 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = { "Spawn particles from the shape"}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Surface, "SURFACE", ICON_MODIFIER, "Surface", ""}, -#ifdef WITH_NEW_SIMULATION_TYPE {eModifierType_Simulation, "SIMULATION", ICON_PHYSICS, "Simulation", ""}, /* TODO: Use correct icon. */ -#endif {0, NULL, 0, NULL, NULL}, }; @@ -1163,7 +1161,7 @@ static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr) static void rna_BevelModifier_update_segments(Main *bmain, Scene *scene, PointerRNA *ptr) { BevelModifierData *bmd = (BevelModifierData *)ptr->data; - if (RNA_boolean_get(ptr, "use_custom_profile")) { + if (RNA_enum_get(ptr, "profile_type") == MOD_BEVEL_PROFILE_CUSTOM) { short segments = (short)RNA_int_get(ptr, "segments"); BKE_curveprofile_initialize(bmd->custom_profile, segments); } @@ -1632,7 +1630,6 @@ static void rna_ParticleInstanceModifier_particle_system_set(PointerRNA *ptr, CLAMP_MIN(psmd->psys, 1); } -# ifdef WITH_NEW_SIMULATION_TYPE static void rna_SimulationModifier_simulation_update(Main *bmain, Scene *scene, PointerRNA *ptr) { SimulationModifierData *smd = ptr->data; @@ -1641,11 +1638,10 @@ static void rna_SimulationModifier_simulation_update(Main *bmain, Scene *scene, } rna_Modifier_dependency_update(bmain, scene, ptr); } -# endif /** * Special set callback that just changes the first bit of the expansion flag. - * This way the expansion state of all the subpanels is not changed by RNA. + * This way the expansion state of all the sub-panels is not changed by RNA. */ static void rna_Modifier_show_expanded_set(PointerRNA *ptr, bool value) { @@ -3948,6 +3944,25 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) 0, "Percent", "Amount is percent of adjacent edge length"}, + {MOD_BEVEL_AMT_ABSOLUTE, + "ABSOLUTE", + 0, + "Absolute", + "Amount is absolute distance along adjacent edge"}, + {0, NULL, 0, NULL, NULL}, + }; + + static const EnumPropertyItem prop_profile_type_items[] = { + {MOD_BEVEL_PROFILE_SUPERELLIPSE, + "SUPERELLIPSE", + 0, + "Superellipse", + "The profile can be a concave or convex curve"}, + {MOD_BEVEL_PROFILE_CUSTOM, + "CUSTOM", + 0, + "Custom", + "The profile can be any arbitrary path between its endpoints"}, {0, NULL, 0, NULL, NULL}, }; @@ -4061,6 +4076,13 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Width Type", "What distance Width measures"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "profile_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "profile_type"); + RNA_def_property_enum_items(prop, prop_profile_type_items); + RNA_def_property_ui_text( + prop, "Profile Type", "The type of shape used to rebuild a beveled section"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "profile", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05, 2); @@ -4120,12 +4142,6 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Spread", "Spread distance for inner miter arcs"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "use_custom_profile", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_BEVEL_CUSTOM_PROFILE); - RNA_def_property_ui_text( - prop, "Custom Profile", "Whether to use a user inputted curve for the bevel's profile"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "custom_profile", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "CurveProfile"); RNA_def_property_pointer_sdna(prop, NULL, "custom_profile"); @@ -5021,7 +5037,7 @@ 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... */, + ICON_IPO_CONSTANT, "Median Step", "Map all values below 0.5 to 0.0, and all others to 1.0"}, {0, NULL, 0, NULL, NULL}, @@ -5272,7 +5288,7 @@ 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... */, + ICON_IPO_CONSTANT, "Median Step", "Map all values below 0.5 to 0.0, and all others to 1.0"}, {0, NULL, 0, NULL, NULL}, @@ -5438,6 +5454,7 @@ static void rna_def_modifier_remesh(BlenderRNA *brna) prop = RNA_def_property(srna, "voxel_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "voxel_size"); + RNA_def_property_range(prop, 0.0001f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0001, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Voxel Size", @@ -6818,12 +6835,10 @@ static void rna_def_modifier_simulation(BlenderRNA *brna) RNA_define_lib_overridable(true); -# ifdef WITH_NEW_SIMULATION_TYPE prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Simulation", "Simulation to access"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_SimulationModifier_simulation_update"); -# endif prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE); RNA_def_property_ui_text( |