[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43346] branches/bmesh/blender: svn merge ^/trunk/blender -r43338:43345
Campbell Barton
ideasman42 at gmail.com
Fri Jan 13 09:28:57 CET 2012
Revision: 43346
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43346
Author: campbellbarton
Date: 2012-01-13 08:28:51 +0000 (Fri, 13 Jan 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r43338:43345
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43338
Modified Paths:
--------------
branches/bmesh/blender/doc/python_api/rst/info_tips_and_tricks.rst
branches/bmesh/blender/release/scripts/startup/bl_ui/space_image.py
branches/bmesh/blender/source/blender/editors/render/render_opengl.c
branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_vertex.c
branches/bmesh/blender/source/blender/makesrna/intern/rna_scene.c
Property Changed:
----------------
branches/bmesh/blender/
branches/bmesh/blender/release/
Property changes on: branches/bmesh/blender
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2011-cucumber:37517,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43338
+ /branches/soc-2011-cucumber:37517,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43345
Modified: branches/bmesh/blender/doc/python_api/rst/info_tips_and_tricks.rst
===================================================================
--- branches/bmesh/blender/doc/python_api/rst/info_tips_and_tricks.rst 2012-01-13 08:18:22 UTC (rev 43345)
+++ branches/bmesh/blender/doc/python_api/rst/info_tips_and_tricks.rst 2012-01-13 08:28:51 UTC (rev 43346)
@@ -26,6 +26,27 @@
For Linux and OSX users this means starting the terminal first, then running blender from within it. On Windows the terminal can be enabled from the help menu.
+Interface Tricks
+================
+
+
+Access Operator Commands
+------------------------
+
+You may have noticed that the tooltip for menu items and buttons includes the ``bpy.ops``... command to run that button, a handy (hidden) feature is that you can press Ctrl+C over any menu item/button to copy this command into the clipboard.
+
+
+Access Data Path
+----------------
+
+To find the path from an :class:`ID` datablock to its setting isn't always so simple since it may be nested away. To get this quickly you can right click on the setting and select select **Copy Data Path**,
+if this can't be generated, only the property name is copied.
+
+.. note::
+
+ This uses the same method for creating the animation path used by :class:`FCurve.data_path` and :class:`DriverTarget.data_path` drivers.
+
+
Show All Operators
==================
Property changes on: branches/bmesh/blender/release
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk/blender/release:31524-42516,42522-42548,42551-42585,42587-42655,42681-42757,42779-42870,42921-42927,42954-42957,42974-43085,43093-43278,43295-43338
+ /trunk/blender/release:31524-42516,42522-42548,42551-42585,42587-42655,42681-42757,42779-42870,42921-42927,42954-42957,42974-43085,43093-43278,43295-43345
Modified: branches/bmesh/blender/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/bmesh/blender/release/scripts/startup/bl_ui/space_image.py 2012-01-13 08:18:22 UTC (rev 43345)
+++ branches/bmesh/blender/release/scripts/startup/bl_ui/space_image.py 2012-01-13 08:28:51 UTC (rev 43346)
@@ -143,7 +143,7 @@
# only for dirty && specific image types, perhaps
# this could be done in operator poll too
if ima.is_dirty:
- if ima.source in {'FILE', 'GENERATED'} and ima.type != 'MULTILAYER':
+ if ima.source in {'FILE', 'GENERATED'} and ima.type != 'OPEN_EXR_MULTILAYER':
layout.operator("image.pack", text="Pack As PNG").as_png = True
layout.separator()
Modified: branches/bmesh/blender/source/blender/editors/render/render_opengl.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/render/render_opengl.c 2012-01-13 08:18:22 UTC (rev 43345)
+++ branches/bmesh/blender/source/blender/editors/render/render_opengl.c 2012-01-13 08:28:51 UTC (rev 43346)
@@ -46,6 +46,7 @@
#include "DNA_object_types.h"
#include "BKE_context.h"
+#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_report.h"
@@ -258,6 +259,11 @@
const short is_write_still= RNA_boolean_get(op->ptr, "write_still");
char err_out[256]= "unknown";
+ if(G.background) {
+ BKE_report(op->reports, RPT_ERROR, "Can't use OpenGL render in background mode (no opengl context)");
+ return 0;
+ }
+
/* ensure we have a 3d view */
if(!ED_view3d_context_activate(C)) {
Modified: branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_vertex.c 2012-01-13 08:18:22 UTC (rev 43345)
+++ branches/bmesh/blender/source/blender/editors/sculpt_paint/paint_vertex.c 2012-01-13 08:28:51 UTC (rev 43346)
@@ -470,7 +470,7 @@
{
Mesh *me= ob->data;
MPoly *mf;
- MDeformWeight *dw, *uw;
+ MDeformWeight *dw, *dw_prev;
int vgroup_active, vgroup_mirror= -1;
unsigned int index;
@@ -505,8 +505,8 @@
dw= defvert_verify_index(&me->dvert[vidx], vgroup_active);
if(dw) {
- uw= defvert_verify_index(wp->wpaint_prev+vidx, vgroup_active);
- uw->weight= dw->weight; /* set the undo weight */
+ dw_prev= defvert_verify_index(wp->wpaint_prev+vidx, vgroup_active);
+ dw_prev->weight= dw->weight; /* set the undo weight */
dw->weight= paintweight;
if(me->editflag & ME_EDIT_MIRROR_X) { /* x mirror painting */
@@ -515,12 +515,12 @@
/* copy, not paint again */
if(vgroup_mirror != -1) {
dw= defvert_verify_index(me->dvert+j, vgroup_mirror);
- uw= defvert_verify_index(wp->wpaint_prev+j, vgroup_mirror);
+ dw_prev= defvert_verify_index(wp->wpaint_prev+j, vgroup_mirror);
} else {
dw= defvert_verify_index(me->dvert+j, vgroup_active);
- uw= defvert_verify_index(wp->wpaint_prev+j, vgroup_active);
+ dw_prev= defvert_verify_index(wp->wpaint_prev+j, vgroup_active);
}
- uw->weight= dw->weight; /* set the undo weight */
+ dw_prev->weight= dw->weight; /* set the undo weight */
dw->weight= paintweight;
}
}
@@ -868,7 +868,7 @@
return 0.0f;
}
-static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval, int flip, int multipaint)
+static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *dw_prev, float alpha, float paintval, int flip, int multipaint)
{
Brush *brush = paint_brush(&wp->paint);
int tool = brush->vertexpaint_tool;
@@ -915,35 +915,35 @@
alpha= brush_alpha(brush);
if(tool==VP_MIX || tool==VP_BLUR)
- testw = paintval*alpha + uw->weight*(1.0f-alpha);
+ testw = paintval*alpha + dw_prev->weight*(1.0f-alpha);
else if(tool==VP_ADD)
- testw = uw->weight + paintval*alpha;
+ testw = dw_prev->weight + paintval*alpha;
else if(tool==VP_SUB)
- testw = uw->weight - paintval*alpha;
+ testw = dw_prev->weight - paintval*alpha;
else if(tool==VP_MUL)
/* first mul, then blend the fac */
- testw = ((1.0f-alpha) + alpha*paintval)*uw->weight;
+ testw = ((1.0f-alpha) + alpha*paintval)*dw_prev->weight;
else if(tool==VP_LIGHTEN) {
- if (uw->weight < paintval)
- testw = paintval*alpha + uw->weight*(1.0f-alpha);
+ if (dw_prev->weight < paintval)
+ testw = paintval*alpha + dw_prev->weight*(1.0f-alpha);
else
- testw = uw->weight;
+ testw = dw_prev->weight;
} else if(tool==VP_DARKEN) {
- if (uw->weight > paintval)
- testw = paintval*alpha + uw->weight*(1.0f-alpha);
+ if (dw_prev->weight > paintval)
+ testw = paintval*alpha + dw_prev->weight*(1.0f-alpha);
else
- testw = uw->weight;
+ testw = dw_prev->weight;
}
if(multipaint == FALSE) {
CLAMP(testw, 0.0f, 1.0f);
- if( testw<uw->weight ) {
+ if( testw<dw_prev->weight ) {
if(dw->weight < testw) dw->weight= testw;
- else if(dw->weight > uw->weight) dw->weight= uw->weight;
+ else if(dw->weight > dw_prev->weight) dw->weight= dw_prev->weight;
}
else {
if(dw->weight > testw) dw->weight= testw;
- else if(dw->weight < uw->weight) dw->weight= uw->weight;
+ else if(dw->weight < dw_prev->weight) dw->weight= dw_prev->weight;
}
}
}
@@ -1143,75 +1143,99 @@
ot->prop= prop;
}
-
-#if 0 /* UNUSED */
-static void do_weight_paint_auto_normalize(MDeformVert *dvert,
- int paint_nr, char *map)
+static void do_weight_paint_normalize_all(MDeformVert *dvert, const int defbase_tot, const char *vgroup_validmap)
{
-// MDeformWeight *dw = dvert->dw;
- float sum=0.0f, fac=0.0f, paintw=0.0f;
- int i, tot=0;
+ float sum= 0.0f, fac;
+ unsigned int i, tot=0;
+ MDeformWeight *dw;
- if (!map)
+ for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) {
+ tot++;
+ sum += dw->weight;
+ }
+ }
+
+ if ((tot == 0) || (sum == 1.0f)) {
return;
+ }
- for (i=0; i<dvert->totweight; i++) {
- if (dvert->dw[i].def_nr == paint_nr)
- paintw = dvert->dw[i].weight;
+ if (sum != 0.0f) {
+ fac= 1.0f / sum;
- if (map[dvert->dw[i].def_nr]) {
- tot += 1;
- if (dvert->dw[i].def_nr != paint_nr)
- sum += dvert->dw[i].weight;
+ for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) {
+ dw->weight *= fac;
+ }
}
}
-
- if (!tot || sum <= (1.0f - paintw))
- return;
+ else {
+ /* hrmf, not a factor in this case */
+ fac = 1.0f / tot;
- fac = sum / (1.0f - paintw);
- fac = fac==0.0f ? 1.0f : 1.0f / fac;
-
- for (i=0; i<dvert->totweight; i++) {
- if (map[dvert->dw[i].def_nr]) {
- if (dvert->dw[i].def_nr != paint_nr)
- dvert->dw[i].weight *= fac;
+ for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
+ if (dw->def_nr < defbase_tot && vgroup_validmap[dw->def_nr]) {
+ dw->weight = fac;
+ }
}
}
}
-#endif
-/* the active group should be involved in auto normalize */
-static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, const int defbase_tot,
- const char *vgroup_validmap, char do_auto_normalize)
+/* same as function above except it normalizes against the active vgroup which remains unchanged
+ *
+ * note that the active is just the group which is unchanged, it can be any,
+ * can also be -1 to normalize all but in that case call 'do_weight_paint_normalize_all' */
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list