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:
authorMatt Ebb <matt@mke3.net>2005-11-22 18:00:32 +0300
committerMatt Ebb <matt@mke3.net>2005-11-22 18:00:32 +0300
commit3cd17c637a380576a72ba282de5715a5b46bd56a (patch)
tree5dcedc00487eac5476c4ff2d0714dce1cd809b82 /source/blender/src
parentaf2042d2197abdddd9749c49dee7e6d364d41cc9 (diff)
* LSCM live transform is finally here!
This is a combined effort from Jens, Ton who finished the code here on my machine, and myself putting in the little menu toggle and committing :). Turn it on and off in the UV/Image window menu UVs -> LSCM Live Transform. It recalculates the LSCM within the transform loop when you're transforming pinned vertices, so it gives realtime feedback - a real time saver! Note: this is much more powerful than proportional edit, since it's properly calculating LSCM using the correct edge angles, etc. I recorded a quicky demo video here: http://orange.blender.org/wp-content/themes/orange/images/media/lscm_live.mov (quicktime animation codec)
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/header_image.c8
-rwxr-xr-xsource/blender/src/transform_generics.c1
-rw-r--r--source/blender/src/unwrapper.c32
3 files changed, 40 insertions, 1 deletions
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c
index d839323dd83..8a4603ec532 100644
--- a/source/blender/src/header_image.c
+++ b/source/blender/src/header_image.c
@@ -1007,6 +1007,10 @@ static void do_image_uvsmenu(void *arg, int event)
case 10:
unwrap_lscm();
break;
+ case 11:
+ if(G.sima->flag & SI_LSCM_LIVE) G.sima->flag &= ~SI_LSCM_LIVE;
+ else G.sima->flag |= SI_LSCM_LIVE;
+ break;
}
}
@@ -1033,9 +1037,11 @@ static uiBlock *image_uvsmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+ if(G.sima->flag & SI_LSCM_LIVE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "LSCM Live Transform", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
+ else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "LSCM Live Transform", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "LSCM Unwrap|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unpin|Alt P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pin|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "LSCM Unwrap|E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c
index 99b9c3d021a..edad524e383 100755
--- a/source/blender/src/transform_generics.c
+++ b/source/blender/src/transform_generics.c
@@ -272,6 +272,7 @@ void recalcData(TransInfo *t)
}
else if(t->spacetype==SPACE_IMAGE) {
flushTransUVs(t);
+ if (G.sima->flag & SI_LSCM_LIVE) unwrap_lscm_live();
}
else {
for(base= FIRSTBASE; base; base= base->next) {
diff --git a/source/blender/src/unwrapper.c b/source/blender/src/unwrapper.c
index c1bf0d3fa3f..045eea31625 100644
--- a/source/blender/src/unwrapper.c
+++ b/source/blender/src/unwrapper.c
@@ -1164,6 +1164,38 @@ void unwrap_lscm(void)
allqueue(REDRAWIMAGE, 0);
}
+/* note; to make it quick work, brecht/jens: you can make it nice later! (ton) */
+void unwrap_lscm_live(void)
+{
+ int dopack = 1;
+ int res;
+ Mesh *me;
+ int totgroup, *groups=NULL, a;
+
+ me= get_mesh(OBACT);
+ if(me==0 || me->tface==0) return;
+
+ totgroup= make_seam_groups(me, &groups);
+
+ if(totgroup==0) return;
+
+ for(a=totgroup; a>0; a--) {
+ res= unwrap_lscm_face_group(me, groups, a);
+ if((res < 3) && (res > -1)) {
+ seam_group_normalize(me, groups, a);
+ }
+ else {
+ dopack = 0;
+ }
+
+ }
+
+ if(dopack) pack_seam_groups(me, groups, totgroup);
+
+ MEM_freeN(groups);
+
+}
+
/* Set tface seams based on edge data, uses hash table to find seam edges. */
void set_seamtface()