[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59524] branches/soc-2013-depsgraph_mt/ source/blender/modifiers/intern: Workaround for other object' s DM build from modifier stack

Sergey Sharybin sergey.vfx at gmail.com
Mon Aug 26 16:39:34 CEST 2013


Revision: 59524
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59524
Author:   nazgul
Date:     2013-08-26 14:39:34 +0000 (Mon, 26 Aug 2013)
Log Message:
-----------
Workaround for other object's DM build from modifier stack

Original issue is caused by dependency graph limitation,
which doesn't always give you other object's DM in such
modifiers as boolean and array. This might easily happen
when you render other scene from compositor,

Ideally, we need to make it so dependency graph is also
used in render database filling routines. This will also
solve issues with preview parameters used for boolean
operand as well.

For now let's use simpler change to make blender behave
stable at least by using CD_MASK_BAREMESH for other
object's derived final.

The thing is, handle_object_update will use baremesh mask
for derived mesh calculation and it seems baremesh is enough
for our purposes.

Modified Paths:
--------------
    branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_array.c
    branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_boolean.c

Modified: branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_array.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_array.c	2013-08-26 14:30:00 UTC (rev 59523)
+++ branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_array.c	2013-08-26 14:39:34 UTC (rev 59524)
@@ -347,10 +347,11 @@
 	BMOpSlot *slot_targetmap = NULL;  /* for weldop */
 
 	/* need to avoid infinite recursion here */
+	/* TODO(sergey): We shouldn't build other object's DM from modifier stack! */
 	if (amd->start_cap && amd->start_cap != ob && amd->start_cap->type == OB_MESH)
-		start_cap = mesh_get_derived_final(scene, amd->start_cap, CD_MASK_MESH);
+		start_cap = mesh_get_derived_final(scene, amd->start_cap, CD_MASK_BAREMESH);
 	if (amd->end_cap && amd->end_cap != ob && amd->end_cap->type == OB_MESH)
-		end_cap = mesh_get_derived_final(scene, amd->end_cap, CD_MASK_MESH);
+		end_cap = mesh_get_derived_final(scene, amd->end_cap, CD_MASK_BAREMESH);
 
 	unit_m4(offset);
 

Modified: branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_boolean.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_boolean.c	2013-08-26 14:30:00 UTC (rev 59523)
+++ branches/soc-2013-depsgraph_mt/source/blender/modifiers/intern/MOD_boolean.c	2013-08-26 14:39:34 UTC (rev 59524)
@@ -137,7 +137,8 @@
 	if (bmd->object != ob) {
 		/* weak! - but we can too easy end up with circular dep crash otherwise */
 		if (bmd->object->type == OB_MESH && modifiers_findByType(bmd->object, eModifierType_Boolean) == NULL) {
-			dm = mesh_get_derived_final(md->scene, bmd->object, CD_MASK_MESH);
+			/* TODO(sergey): We shouldn't build other object's DM from modifier stack! */
+			dm = mesh_get_derived_final(md->scene, bmd->object, CD_MASK_BAREMESH);
 		}
 		else {
 			dm = bmd->object->derivedFinal;




More information about the Bf-blender-cvs mailing list