Fix #20928: difference boolean modifier is not applied during rendering,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 7 Feb 2010 10:16:42 +0000 (10:16 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 7 Feb 2010 10:16:42 +0000 (10:16 +0000)
fixed by last depsgraph commit and this extra check to avoid unnecessary
free of derivedmesh for sculpt/multires.

source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/intern/multires.c
source/blender/editors/screen/screen_ops.c

index 2f372f8..51f3c34 100644 (file)
@@ -40,6 +40,7 @@ struct Object;
 void multires_mark_as_modified(struct Object *ob);
 
 void multires_force_update(struct Object *ob);
+void multires_force_render_update(struct Object *ob);
 
 struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*,
        int local_mmd, struct DerivedMesh*, struct Object *, int, int);
index 6ed4f7a..20f8d48 100644 (file)
@@ -122,6 +122,7 @@ void multires_mark_as_modified(Object *ob)
 
 void multires_force_update(Object *ob)
 {
+
        if(ob && ob->derivedFinal) {
                ob->derivedFinal->needsFree =1;
                ob->derivedFinal->release(ob->derivedFinal);
@@ -129,6 +130,12 @@ void multires_force_update(Object *ob)
        }
 }
 
+void multires_force_render_update(Object *ob)
+{
+       if(ob && (ob->mode & OB_MODE_SCULPT) && modifiers_findByType(ob, eModifierType_Multires))
+               multires_force_update(ob);
+}
+
 /* XXX */
 #if 0
 void multiresModifier_join(Object *ob)
index d5afd99..f7aeee1 100644 (file)
@@ -3173,7 +3173,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
        WM_cursor_wait(1);
        
        /* flush multires changes (for sculpt) */
-       multires_force_update(CTX_data_active_object(C));
+       multires_force_render_update(CTX_data_active_object(C));
        
        /* get editmode results */
        ED_object_exit_editmode(C, EM_FREEDATA|EM_DO_UNDO);     /* 0 = does not exit editmode */