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:
authorNicholas Bishop <nicholasbishop@gmail.com>2008-01-16 10:19:21 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2008-01-16 10:19:21 +0300
commitc6118036bc044bd5f25106dfb0b422ee2310d5ba (patch)
treeb7d3105398c881d155043dc6579bf6e7652f179e /source/blender/src/drawview.c
parentf41c3340be9fbd5126a09a514f48cf88af2ec951 (diff)
== Radial Control ==
* Generalized the interactive brush property control from sculpt mode into a simple API * Modified sculpt mode to take advantage of this (even fixes some minor bugs!) * Added shortcuts in particle edit to set brush size/strength (FKEY/shift+FKEY) Still todo are the other modes that have brushes...
Diffstat (limited to 'source/blender/src/drawview.c')
-rw-r--r--source/blender/src/drawview.c66
1 files changed, 7 insertions, 59 deletions
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c
index fd23761c82c..e3d73f4cda3 100644
--- a/source/blender/src/drawview.c
+++ b/source/blender/src/drawview.c
@@ -125,6 +125,7 @@
#include "BIF_mywindow.h"
#include "BIF_poseobject.h"
#include "BIF_previewrender.h"
+#include "BIF_radialcontrol.h"
#include "BIF_resources.h"
#include "BIF_retopo.h"
#include "BIF_screen.h"
@@ -3061,68 +3062,13 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
/* Draw Sculpt Mode brush */
if(!G.obedit && (G.f & G_SCULPTMODE) && area_is_active_area(v3d->area) && sculpt_session()) {
- PropsetData *pd= sculpt_session()->propset;
- short r1=100, r2=100, r3=100;
- short mouse[2];
+ RadialControl *rc= sculpt_session()->radialcontrol;
if(sculpt_data()->flags & SCULPT_INPUT_SMOOTH)
sculpt_stroke_draw();
- if(pd) {
- if(pd->mode == PropsetSize) {
- r1= sculptmode_brush()->size;
- r2= pd->origsize;
- r3= r1;
- } else if(pd->mode == PropsetStrength) {
- r1= 200 - sculptmode_brush()->strength * 2;
- r2= 200;
- r3= 200;
- } else if(pd->mode == PropsetTexRot) {
- r1= r2= 200;
- r3= 200;
- }
-
- /* Draw brush with texture */
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- glBindTexture(GL_TEXTURE_2D, pd->tex);
-
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glPushMatrix();
- glTranslatef(pd->origloc[0], pd->origloc[1], 0);
- glRotatef(tex_angle(), 0, 0, 1);
-
- glEnable(GL_TEXTURE_2D);
- glBegin(GL_QUADS);
- glColor4f(0,0,0,1);
- glTexCoord2f(0,0);
- glVertex2f(-r3, -r3);
- glTexCoord2f(1,0);
- glVertex2f(r3, -r3);
- glTexCoord2f(1,1);
- glVertex2f(r3, r3);
- glTexCoord2f(0,1);
- glVertex2f(-r3, r3);
- glEnd();
- glDisable(GL_TEXTURE_2D);
-
- glPopMatrix();
-
- if(r1 != r2)
- fdrawXORcirc(pd->origloc[0], pd->origloc[1], r1);
- fdrawXORcirc(pd->origloc[0], pd->origloc[1], r2);
-
- if(pd->mode == PropsetTexRot) {
- const float ang= pd->origtexrot * (M_PI/180.0f);
- getmouseco_areawin(mouse);
- sdrawXORline(pd->origloc[0], pd->origloc[1],
- pd->origloc[0]+200*cos(ang), pd->origloc[1]+200*sin(ang));
- sdrawXORline(pd->origloc[0], pd->origloc[1], mouse[0], mouse[1]);
- }
- }
+ if(rc)
+ radialcontrol_draw(rc);
else if(sculpt_data()->flags & SCULPT_DRAW_BRUSH) {
short csc[2], car[2];
getmouseco_sc(csc);
@@ -3143,7 +3089,9 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
ParticleEditSettings *pset = PE_settings();
short c[2];
- if(psys && psys->edit && pset->brushtype>=0){
+ if(*PE_radialcontrol())
+ radialcontrol_draw(*PE_radialcontrol());
+ else if(psys && psys->edit && pset->brushtype>=0) {
getmouseco_areawin(c);
fdrawXORcirc((float)c[0], (float)c[1], (float)pset->brush[pset->brushtype].size);
}