[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30294] branches/soc-2010-jwilkins: * ' front face only' now uses the current sculpt plane
Jason Wilkins
Jason.A.Wilkins at gmail.com
Wed Jul 14 09:23:04 CEST 2010
Revision: 30294
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30294
Author: jwilkins
Date: 2010-07-14 09:23:04 +0200 (Wed, 14 Jul 2010)
Log Message:
-----------
* 'front face only' now uses the current sculpt plane
* inflate, pinch, and smooth should not show the sculpt plane selector
* inflate, pinch, and smooth use the view normal when 'front face only' is enabled
Modified Paths:
--------------
branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
Modified: branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py 2010-07-14 07:04:56 UTC (rev 30293)
+++ branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py 2010-07-14 07:23:04 UTC (rev 30294)
@@ -626,19 +626,18 @@
row = col.row(align=True)
row.prop(brush, "crease_pinch_factor", slider=True)
+ if brush.sculpt_tool not in ('PINCH', 'INFLATE', 'SMOOTH'):
+ row = col.row(align=True)
+ col.separator()
- col.separator()
+ if brush.use_original_normal:
+ row.prop(brush, "use_original_normal", toggle=True, text="", icon='LOCKED')
+ else:
+ row.prop(brush, "use_original_normal", toggle=True, text="", icon='UNLOCKED')
- row = col.row(align=True)
+ row.prop(brush, "sculpt_plane", text="")
- if brush.use_original_normal:
- row.prop(brush, "use_original_normal", toggle=True, text="", icon='LOCKED')
- else:
- row.prop(brush, "use_original_normal", toggle=True, text="", icon='UNLOCKED')
-
- row.prop(brush, "sculpt_plane", text="")
-
if brush.sculpt_tool in ('CLAY', 'CLAY_TUBES', 'WAX', 'FLATTEN', 'FILL', 'SCRAPE'):
row = col.row(align=True)
row.prop(brush, "plane_offset", slider=True)
Modified: branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c 2010-07-14 07:04:56 UTC (rev 30293)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c 2010-07-14 07:23:04 UTC (rev 30294)
@@ -404,7 +404,7 @@
}
}
-static float frontface(SculptSession *ss, Brush *brush, short no[3], float fno[3])
+static float frontface(Brush *brush, float sculpt_normal[3], short no[3], float fno[3])
{
if (brush->flag & BRUSH_FRONTFACE) {
float dot;
@@ -413,10 +413,10 @@
float tmp[3];
normal_short_to_float_v3(tmp, no);
- dot= dot_v3v3(tmp, ss->cache->view_normal);
+ dot= dot_v3v3(tmp, sculpt_normal);
}
else {
- dot= dot_v3v3(fno, ss->cache->view_normal);
+ dot= dot_v3v3(fno, sculpt_normal);
}
return dot > 0 ? dot : 0;
@@ -1034,7 +1034,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, ss->cache->view_normal, vd.no, vd.fno);
float avg[3], val[3];
neighbor_average(ss, avg, vd.vert_indices[vd.i]);
@@ -1127,7 +1127,7 @@
fno= data[index].no;
if(sculpt_brush_test(&test, co)) {
- const float fade = bstrength*tex_strength(ss, brush, co, test.dist)*frontface(ss, brush, NULL, fno);
+ const float fade = bstrength*tex_strength(ss, brush, co, test.dist)*frontface(brush, ss->cache->view_normal, NULL, fno);
float *avg, val[3];
float n;
@@ -1222,7 +1222,7 @@
if (sculpt_brush_test(&test, vd.co)) {
//if(sculpt_brush_test_cyl(&test, vd.co, ss->cache->location, area_normal)) {
/* offset vertex */
- float fade = tex_strength(ss, brush, vd.co, test.dist)*frontface(ss, brush, vd.no, vd.fno);
+ float fade = tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, area_normal, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], offset, fade);
@@ -1275,7 +1275,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
/* offset vertex */
- const float fade = tex_strength(ss, brush, vd.co, test.dist)*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, area_normal, vd.no, vd.fno);
float val1[3];
float val2[3];
@@ -1315,7 +1315,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
- float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(ss, brush, vd.no, vd.fno);
+ float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, ss->cache->view_normal, vd.no, vd.fno);
float val[3];
sub_v3_v3v3(val, test.location, vd.co);
@@ -1370,7 +1370,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, origco[vd.i])) {
- const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist)*frontface(ss, brush, origno[vd.i], NULL);
+ const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist)*frontface(brush, an, origno[vd.i], NULL);
mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
@@ -1410,7 +1410,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], cono, fade);
@@ -1458,7 +1458,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], grab_delta, fade);
@@ -1505,7 +1505,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, origco[vd.i])) {
- const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist)*frontface(ss, brush, origno[vd.i], NULL);
+ const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist)*frontface(brush, an, origno[vd.i], NULL);
mul_v3_v3fl(proxy[vd.i], cono, fade);
@@ -1550,7 +1550,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, origco[vd.i])) {
- const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist)*frontface(ss, brush, origno[vd.i], NULL);
+ const float fade = bstrength*tex_strength(ss, brush, origco[vd.i], test.dist)*frontface(brush, an, origno[vd.i], NULL);
mul_v3_m3v3(proxy[vd.i], m, origco[vd.i]);
sub_v3_v3(proxy[vd.i], origco[vd.i]);
@@ -1603,7 +1603,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
- const float fade = bstrength*ss->cache->radius*tex_strength(ss, brush, vd.co, test.dist)*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*ss->cache->radius*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, area_normal, vd.no, vd.fno);
float *disp= &layer_disp[vd.i];
float val[3];
@@ -1653,7 +1653,7 @@
BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
if(sculpt_brush_test(&test, vd.co)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, ss->cache->view_normal, vd.no, vd.fno);
float val[3];
if(vd.fno) copy_v3_v3(val, vd.fno);
@@ -1972,7 +1972,7 @@
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(brush, an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
@@ -2042,7 +2042,7 @@
sub_v3_v3v3(proxy[vd.i], intr, vd.co);
if (plane_trim(ss->cache, brush, proxy[vd.i])) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(brush, an, vd.no, vd.fno);
mul_v3_fl(proxy[vd.i], fade);
@@ -2110,7 +2110,7 @@
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(brush, an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
@@ -2200,7 +2200,7 @@
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, ss->cache->radius*test.dist)*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, ss->cache->radius*test.dist)*frontface(brush, an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
@@ -2260,7 +2260,7 @@
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(brush, an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
@@ -2320,7 +2320,7 @@
sub_v3_v3v3(val, intr, vd.co);
if (plane_trim(ss->cache, brush, val)) {
- const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(ss, brush, vd.no, vd.fno);
+ const float fade = bstrength*tex_strength(ss, brush, vd.co, sqrt(test.dist))*frontface(brush, an, vd.no, vd.fno);
mul_v3_v3fl(proxy[vd.i], val, fade);
More information about the Bf-blender-cvs
mailing list