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:
authorGeoffrey Bantle <hairbat@yahoo.com>2008-02-24 01:11:16 +0300
committerGeoffrey Bantle <hairbat@yahoo.com>2008-02-24 01:11:16 +0300
commite03ab146ae673ec296e97f3c146c048417833521 (patch)
tree24e5d7445c6ce151fb95f4252f23319165dacd23 /source/blender/src/drawobject.c
parent40934ef6df34a70f2275f1208d9433830e9ccf8f (diff)
-> Bevel tools and Bmesh kernel
The following is a commit of Levi Schooley's bevel code and the bmesh library it depends on. The current editmode bevel has been replaced with a new per edge bevel function. Vertex beveling is also availible. To set weights for the modifier to use, use the ctrl-shift-e shortcut on either edges or vertices. Recursive beveling is turned of for the time being.
Diffstat (limited to 'source/blender/src/drawobject.c')
-rw-r--r--source/blender/src/drawobject.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index 6edb89a1049..6375af4d49e 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -1660,6 +1660,41 @@ static void draw_dm_creases(DerivedMesh *dm)
glLineWidth(1.0);
}
+static int draw_dm_bweights__setDrawOptions(void *userData, int index)
+{
+ EditEdge *eed = EM_get_edge_for_index(index);
+
+ if (eed->h==0 && eed->bweight!=0.0) {
+ BIF_ThemeColorBlend(TH_WIRE, TH_EDGE_SELECT, eed->bweight);
+ return 1;
+ } else {
+ return 0;
+ }
+}
+static void draw_dm_bweights__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
+{
+ EditVert *eve = EM_get_vert_for_index(index);
+
+ if (eve->h==0 && eve->bweight!=0.0) {
+ BIF_ThemeColorBlend(TH_VERTEX, TH_VERTEX_SELECT, eve->bweight);
+ bglVertex3fv(co);
+ }
+}
+static void draw_dm_bweights(DerivedMesh *dm)
+{
+ if (G.scene->selectmode & SCE_SELECT_VERTEX) {
+ glPointSize(BIF_GetThemeValuef(TH_VERTEX_SIZE) + 2);
+ bglBegin(GL_POINTS);
+ dm->foreachMappedVert(dm, draw_dm_bweights__mapFunc, NULL);
+ bglEnd();
+ }
+ else {
+ glLineWidth(3.0);
+ dm->drawMappedEdges(dm, draw_dm_bweights__setDrawOptions, NULL);
+ glLineWidth(1.0);
+ }
+}
+
/* Second section of routines: Combine first sets to form fancy
* drawing routines (for example rendering twice to get overlays).
*
@@ -2139,6 +2174,9 @@ static void draw_em_fancy(Object *ob, EditMesh *em, DerivedMesh *cageDM, Derived
if(G.f & G_DRAWCREASES) {
draw_dm_creases(cageDM);
}
+ if(G.f & G_DRAWBWEIGHTS) {
+ draw_dm_bweights(cageDM);
+ }
draw_em_fancy_edges(cageDM, 0, eed_act);
}