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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2004-07-13 15:48:52 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2004-07-13 15:48:52 +0400
commite0773281220c5af56585b0e07ccdbfc6ee485b4f (patch)
tree4b06de628461f5822cb31c59eb6c6768ae06cc6f /source/blender/src/editsima.c
parent4f1c674ee02e07a6986a54a312d7fb9e2547e950 (diff)
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf Implementation Least Squares Conformal Maps parameterization, based on chapter 2 of: Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002, July 2002. Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define where a mesh will be cut when executing LSCM unwrapping. Seams can be marked and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark the selected edges as seams. Select Linked in Face Select Mode now only selects linked faces if no seams separate them. So if seams are defined, this will now select the 'face group' defined by the seams. Hotkey is still LKEY. LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local angles). Based on seams, the selected faces will be 'cut'. If multiple 'face groups' are selected, they will be unwrapped separately and packed in the image rectangle in the UV Editor. Packing uses a simple and fast algorithm, only designed to avoid having overlapping faces. LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel. Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then executed, these UV's will stay in place, allowing to tweak the solution. PKEY and ALT+PKEY will respectively pin and unpin selected UV's. Face Select Mode Drawing Changes: - Draw Seams option to enable disable drawing of seams - Draw Faces option to enable drawing of selected faces in transparent purple - Draw Hidden Edges option to enable drawing of edges of hidden faces - Draw Edges option to enable drawing of edges of visible faces The colors for these seams, faces and edges are themeable.
Diffstat (limited to 'source/blender/src/editsima.c')
-rw-r--r--source/blender/src/editsima.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c
index 9e3558be259..a55de075504 100644
--- a/source/blender/src/editsima.c
+++ b/source/blender/src/editsima.c
@@ -79,6 +79,7 @@
#include "BSE_trans_types.h"
#include "BDR_editobject.h"
+#include "BDR_unwrapper.h"
#include "blendef.h"
#include "mydevice.h"
@@ -1682,3 +1683,34 @@ void toggle_uv_select(int mode)
allqueue(REDRAWIMAGE, 0);
}
+void pin_tface_uv(int mode)
+{
+ Mesh *me;
+ TFace *tface;
+ MFace *mface;
+ int a;
+
+ if( is_uv_tface_editing_allowed()==0 ) return;
+ me= get_mesh(OBACT);
+
+ mface= me->mface;
+ tface= me->tface;
+ for(a=me->totface; a>0; a--, tface++, mface++) {
+ if(mode ==1){
+ if(tface->flag & TF_SEL1) tface->unwrap |= TF_PIN1;
+ if(tface->flag & TF_SEL2) tface->unwrap |= TF_PIN2;
+ if(tface->flag & TF_SEL3) tface->unwrap |= TF_PIN3;
+ if(mface->v4)
+ if(tface->flag & TF_SEL4) tface->unwrap |= TF_PIN4;
+ }
+ else if (mode ==0){
+ if(tface->flag & TF_SEL1) tface->unwrap &= ~TF_PIN1;
+ if(tface->flag & TF_SEL2) tface->unwrap &= ~TF_PIN2;
+ if(tface->flag & TF_SEL3) tface->unwrap &= ~TF_PIN3;
+ if(mface->v4)
+ if(tface->flag & TF_SEL4) tface->unwrap &= ~TF_PIN4;
+ }
+ }
+ scrarea_queue_winredraw(curarea);
+}
+