diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-17 15:59:31 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-17 15:59:31 +0300 |
commit | 200e63b0bf7222df57297453d982268fbb4ae374 (patch) | |
tree | 3ef326260560fd7ef5f9be41737575f6b567d1ba /source/blender/makesrna | |
parent | ed62b65474f007025bc19d1f8758257b12cbc8b3 (diff) |
Fix: Copy and paste error in curves RNA
Use a similar solution for meshes for curves symmetry updating.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_curves.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_curves.c b/source/blender/makesrna/intern/rna_curves.c index 60530eb8bf9..2b406125409 100644 --- a/source/blender/makesrna/intern/rna_curves.c +++ b/source/blender/makesrna/intern/rna_curves.c @@ -133,14 +133,22 @@ static void rna_Curves_update_data(struct Main *UNUSED(bmain), PointerRNA *ptr) { ID *id = ptr->owner_id; - - /* cheating way for importers to avoid slow updates */ + /* Avoid updates for importers creating curves. */ if (id->us > 0) { DEG_id_tag_update(id, 0); WM_main_add_notifier(NC_GEOM | ND_DATA, id); } } +void rna_Curves_update_draw(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + ID *id = ptr->owner_id; + /* Avoid updates for importers creating curves. */ + if (id->us > 0) { + WM_main_add_notifier(NC_GEOM | ND_DATA, id); + } +} + #else static void rna_def_curves_point(BlenderRNA *brna) @@ -278,17 +286,17 @@ static void rna_def_curves(BlenderRNA *brna) prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "symmetry", CURVES_SYMMETRY_X); RNA_def_property_ui_text(prop, "X", "Enable symmetry in the X axis"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); + RNA_def_property_update(prop, 0, "rna_Curves_update_draw"); prop = RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "symmetry", CURVES_SYMMETRY_Y); RNA_def_property_ui_text(prop, "Y", "Enable symmetry in the Y axis"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); + RNA_def_property_update(prop, 0, "rna_Curves_update_draw"); prop = RNA_def_property(srna, "use_mirror_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "symmetry", CURVES_SYMMETRY_Z); RNA_def_property_ui_text(prop, "Z", "Enable symmetry in the Z axis"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); + RNA_def_property_update(prop, 0, "rna_Curves_update_draw"); /* attributes */ rna_def_attributes_common(srna); |