From e839a2565190556d397449e07b00c5f03fee6fb5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 19 Mar 2020 21:15:37 +1100 Subject: RNA: add MetaElem.select & use_scale_stiffness --- source/blender/makesrna/intern/rna_meta.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 382e83a5650..a391defe542 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -87,6 +87,14 @@ static void rna_Meta_texspace_size_set(PointerRNA *ptr, const float *values) copy_v3_v3(mb->size, values); } +static void rna_MetaBall_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + ID *id = ptr->owner_id; + + DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); +} + static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { MetaBall *mb = (MetaBall *)ptr->owner_id; @@ -254,6 +262,16 @@ static void rna_def_metaelement(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Negative", "Set metaball as negative one"); RNA_def_property_update(prop, 0, "rna_MetaBall_update_data"); + prop = RNA_def_property(srna, "use_scale_stiffness", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MB_SCALE_RAD); + RNA_def_property_ui_text(prop, "Scale Stiffness", "Scale stiffness instead of radius"); + RNA_def_property_update(prop, 0, "rna_MetaBall_redraw_data"); + + prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", 1); /* SELECT */ + RNA_def_property_ui_text(prop, "Select", "Select element"); + RNA_def_property_update(prop, 0, "rna_MetaBall_redraw_data"); + prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MB_HIDE); RNA_def_property_ui_text(prop, "Hide", "Hide element"); -- cgit v1.2.3