Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-04-24 18:23:44 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-04-24 18:23:44 +0300
commita8441fc90086bf21dc50dc9dcd6085e0a0674921 (patch)
treef02a5d015e1b315175c1887f7de6a3c575cb1ea8 /source/blender/makesrna
parent4542b50afcfc9b797d5f3048393ba1f1836561a0 (diff)
Fix T69753 Instanced Metaballs not rendering but showing up in Viewport
This hides the original metaballs when they are used in duplifaces/-verts instancing, and still shows the instanced metaballs. The visibility of the original metaballs is now determined by the visibility of the instancer. I'm not too thrilled about this, but at least it gives users the ability to show/hide the metaballs for viewport/render. Differential Revision: https://developer.blender.org/D7478
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_object.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index b108093a9dd..33048d4b057 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -349,6 +349,14 @@ static void rna_Object_hide_update(Main *bmain, Scene *UNUSED(scene), PointerRNA
WM_main_add_notifier(NC_OBJECT | ND_DRAW, &ob->id);
}
+static void rna_Object_duplicator_visibility_flag_update(Main *UNUSED(bmain),
+ Scene *UNUSED(scene),
+ PointerRNA *ptr)
+{
+ Object *ob = (Object *)ptr->owner_id;
+ DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
+}
+
static void rna_MaterialIndex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;
@@ -3097,10 +3105,14 @@ static void rna_def_object(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_instancer_for_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "duplicator_visibility_flag", OB_DUPLI_FLAG_RENDER);
RNA_def_property_ui_text(prop, "Render Instancer", "Make instancer visible when rendering");
+ RNA_def_property_update(
+ prop, NC_OBJECT | ND_DRAW, "rna_Object_duplicator_visibility_flag_update");
prop = RNA_def_property(srna, "show_instancer_for_viewport", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "duplicator_visibility_flag", OB_DUPLI_FLAG_VIEWPORT);
RNA_def_property_ui_text(prop, "Display Instancer", "Make instancer visible in the viewport");
+ RNA_def_property_update(
+ prop, NC_OBJECT | ND_DRAW, "rna_Object_duplicator_visibility_flag_update");
/* anim */
rna_def_animdata_common(srna);