Prevent user from applying editmode operations that will be ignored by multires.
authorNicholas Bishop <nicholasbishop@gmail.com>
Sun, 31 Dec 2006 10:51:21 +0000 (10:51 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Sun, 31 Dec 2006 10:51:21 +0000 (10:51 +0000)
source/blender/include/editmesh.h
source/blender/src/editdeform.c
source/blender/src/editmesh_mods.c
source/blender/src/multires.c

index 0dde2b2f695fc082f703229b92fb920b2cfcde2e..36007252a268dff6c9ea917818228fad8ee541bb 100644 (file)
@@ -106,6 +106,7 @@ extern EditVert *findnearestvert(int *dist, short sel, short strict);
 
 /* multires.c */
 int multires_test();
+int multires_level1_test();
 
 #endif
 
index 007dd52df8bb0d24bf580b6eb4b6418ce60ff6f5..bca2fc60ef161f4f0161ab4ad9b281db4fa97d3d 100644 (file)
@@ -61,6 +61,8 @@
 
 #include "BSE_edit.h"
 
+#include "multires.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -493,6 +495,8 @@ void assign_verts_defgroup (void)
        MDeformWeight *newdw;
        MDeformVert *dvert;
        int     i, done;
+       
+       if(multires_level1_test()) return;
 
        ob= G.obedit;
 
@@ -604,6 +608,8 @@ void remove_verts_defgroup (int allverts)
        MDeformWeight *newdw;
        bDeformGroup *dg, *eg;
        int     i;
+       
+       if(multires_level1_test()) return;
 
        ob= G.obedit;
 
index 1102c69113c3c3f617acc75469476c984d9f0a57..c7b34068b3e2e200f6aa382d50c2391565ad4d6b 100644 (file)
@@ -2576,6 +2576,8 @@ void editmesh_mark_seam(int clear)
 {
        EditMesh *em= G.editMesh;
        EditEdge *eed;
+       
+       if(multires_level1_test()) return;
 
        /* auto-enable seams drawing */
        if(clear==0) {
index e15556c8794f24056c080c50169b37eaefee02af..f5690f4eba49515818f557251999001a70cab143 100644 (file)
@@ -82,14 +82,22 @@ CustomDataMask vdata_mask= CD_MASK_MDEFORMVERT;
 /* editmesh.h */
 int multires_test()
 {
-       Mesh *me= get_mesh(
-               OBACT);
+       Mesh *me= get_mesh(OBACT);
        if(me && me->mr) {
                error("Unable to complete action with multires enabled.");
                return 1;
        }
        return 0;
 }
+int multires_level1_test()
+{
+       Mesh *me= get_mesh(OBACT);
+       if(me && me->mr && me->mr->current != 1) {
+               error("Operation only available for multires level 1.");
+               return 1;
+       }
+       return 0;
+}
 
 /* Sculptmode */