[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47399] branches/soc-2011-tomato: Merging r47382 through r47398 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Mon Jun 4 12:55:16 CEST 2012


Revision: 47399
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47399
Author:   nazgul
Date:     2012-06-04 10:55:05 +0000 (Mon, 04 Jun 2012)
Log Message:
-----------
Merging r47382 through r47398 from trunk into soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47382
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47398

Modified Paths:
--------------
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_console.py
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_image.h
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_paint.h
    branches/soc-2011-tomato/source/blender/blenkernel/intern/image.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/paint.c
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/editors/animation/anim_channels_defines.c
    branches/soc-2011-tomato/source/blender/editors/include/UI_resources.h
    branches/soc-2011-tomato/source/blender/editors/interface/resources.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_cursor.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_intern.h
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_ops.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_utils.c
    branches/soc-2011-tomato/source/blender/editors/space_action/action_draw.c
    branches/soc-2011-tomato/source/blender/editors/space_buttons/buttons_texture.c
    branches/soc-2011-tomato/source/blender/editors/space_console/console_intern.h
    branches/soc-2011-tomato/source/blender/editors/space_console/console_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_console/space_console.c
    branches/soc-2011-tomato/source/blender/editors/space_image/image_buttons.c
    branches/soc-2011-tomato/source/blender/editors/space_image/image_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_image/space_image.c
    branches/soc-2011-tomato/source/blender/editors/space_nla/nla_draw.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_edit.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_image_types.h
    branches/soc-2011-tomato/source/blender/makesdna/DNA_userdef_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_userdef.c
    branches/soc-2011-tomato/source/blender/render/intern/source/render_texture.c

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47381
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-47398

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_console.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_console.py	2012-06-04 10:51:00 UTC (rev 47398)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_console.py	2012-06-04 10:55:05 UTC (rev 47399)
@@ -41,8 +41,16 @@
     def draw(self, context):
         layout = self.layout
 
+        layout.operator("console.indent")
+        layout.operator("console.unindent")
+
+        layout.separator()
+
         layout.operator("console.clear")
         layout.operator("console.clear_line")
+
+        layout.separator()
+
         layout.operator("console.copy")
         layout.operator("console.paste")
         layout.menu("CONSOLE_MT_language")

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_image.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_image.h	2012-06-04 10:51:00 UTC (rev 47398)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_image.h	2012-06-04 10:55:05 UTC (rev 47399)
@@ -44,6 +44,7 @@
 struct Scene;
 struct Object;
 struct ImageFormatData;
+struct Main;
 
 /* call from library */
 void    BKE_image_free(struct Image *me);
@@ -143,6 +144,9 @@
 /* for reload, refresh, pack */
 void BKE_image_signal(struct Image *ima, struct ImageUser *iuser, int signal);
 
+void BKE_image_walk_all_users(const struct Main *mainp, void *customdata,
+                              void callback(struct Image *ima, struct ImageUser *iuser, void *customdata));
+
 /* ensures an Image exists for viewing nodes or render */
 struct Image *BKE_image_verify_viewer(int type, const char *name);
 
@@ -151,6 +155,7 @@
 
 /* called on frame change or before render */
 void BKE_image_user_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
+void BKE_image_user_check_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
 int  BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr);
 
 /* sets index offset for multilayer files */

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_paint.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_paint.h	2012-06-04 10:51:00 UTC (rev 47398)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_paint.h	2012-06-04 10:55:05 UTC (rev 47399)
@@ -32,6 +32,7 @@
  *  \ingroup bke
  */
 
+struct bContext;
 struct Brush;
 struct MDisps;
 struct MeshElemMap;
@@ -55,6 +56,7 @@
 void copy_paint(struct Paint *src, struct Paint *tar);
 
 struct Paint *paint_get_active(struct Scene *sce);
+struct Paint *paint_get_active_from_context(const struct bContext *C);
 struct Brush *paint_brush(struct Paint *paint);
 void paint_brush_set(struct Paint *paint, struct Brush *br);
 

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/image.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/image.c	2012-06-04 10:51:00 UTC (rev 47398)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/image.c	2012-06-04 10:55:05 UTC (rev 47399)
@@ -91,6 +91,14 @@
 
 #include "BLO_sys_types.h" // for intptr_t support
 
+/* for image user iteration */
+#include "DNA_node_types.h"
+#include "DNA_space_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_view3d_types.h"
+
+#include "WM_api.h"
+
 /* max int, to indicate we don't store sequences in ibuf */
 #define IMA_NO_INDEX    0x7FEFEFEF
 
@@ -1814,6 +1822,65 @@
 	image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
 }
 
+void BKE_image_walk_all_users(const Main *mainp, void *customdata,
+                              void callback(Image *ima, ImageUser *iuser, void *customdata))
+{
+	wmWindowManager *wm;
+	wmWindow *win;
+	Tex *tex;
+
+	/* texture users */
+	for (tex = mainp->tex.first; tex; tex = tex->id.next) {
+		if (tex->type == TEX_IMAGE && tex->ima) {
+			if (ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+				callback(tex->ima, &tex->iuser, customdata);
+			}
+		}
+	}
+
+	/* image window, compo node users */
+	for (wm = mainp->wm.first; wm; wm = wm->id.next) { /* only 1 wm */
+		for (win = wm->windows.first; win; win = win->next) {
+			ScrArea *sa;
+			for (sa = win->screen->areabase.first; sa; sa = sa->next) {
+				if (sa->spacetype == SPACE_VIEW3D) {
+					View3D *v3d = sa->spacedata.first;
+					BGpic *bgpic;
+					for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next) {
+						callback(bgpic->ima, &bgpic->iuser, customdata);
+					}
+				}
+				else if (sa->spacetype == SPACE_IMAGE) {
+					SpaceImage *sima = sa->spacedata.first;
+					callback(sima->image, &sima->iuser, customdata);
+				}
+				else if (sa->spacetype == SPACE_NODE) {
+					SpaceNode *snode = sa->spacedata.first;
+					if ((snode->treetype == NTREE_COMPOSIT) && (snode->nodetree)) {
+						bNode *node;
+						for (node = snode->nodetree->nodes.first; node; node = node->next) {
+							if (node->id && node->type == CMP_NODE_IMAGE) {
+								Image *ima = (Image *)node->id;
+								ImageUser *iuser = node->storage;
+								callback(ima, iuser, customdata);
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+static void image_tag_frame_recalc(Image *ima, ImageUser *iuser, void *customdata)
+{
+	Image *changed_image = customdata;
+
+	if (ima == changed_image) {
+		iuser->flag |= IMA_NEED_FRAME_RECALC;
+	}
+}
+
 void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
 {
 	if (ima == NULL)
@@ -1847,6 +1914,9 @@
 			ima->ok = 1;
 			if (iuser)
 				iuser->ok = 1;
+
+			BKE_image_walk_all_users(G.main, ima, image_tag_frame_recalc);
+
 			break;
 
 		case IMA_SIGNAL_RELOAD:
@@ -2669,6 +2739,15 @@
 	if (iuser->ok == 0) iuser->ok = 1;
 }
 
+void BKE_image_user_check_frame_calc(ImageUser *iuser, int cfra, int fieldnr)
+{
+	if ((iuser->flag & IMA_ANIM_ALWAYS) || (iuser->flag & IMA_NEED_FRAME_RECALC)) {
+		BKE_image_user_frame_calc(iuser, cfra, fieldnr);
+
+		iuser->flag &= ~IMA_NEED_FRAME_RECALC;
+	}
+}
+
 int BKE_image_has_alpha(struct Image *image)
 {
 	ImBuf *ibuf;
@@ -2684,4 +2763,3 @@
 	else
 		return 0;
 }
-

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/paint.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/paint.c	2012-06-04 10:51:00 UTC (rev 47398)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/paint.c	2012-06-04 10:55:05 UTC (rev 47399)
@@ -41,6 +41,7 @@
 #include "BLI_utildefines.h"
 
 #include "BKE_brush.h"
+#include "BKE_context.h"
 #include "BKE_library.h"
 #include "BKE_paint.h"
 #include "BKE_subsurf.h"
@@ -83,6 +84,54 @@
 	return NULL;
 }
 
+Paint *paint_get_active_from_context(const bContext *C)
+{
+	Scene *sce = CTX_data_scene(C);
+
+	if (sce) {
+		ToolSettings *ts = sce->toolsettings;
+		Object *obact = NULL;
+
+		if (sce->basact && sce->basact->object)
+			obact = sce->basact->object;
+
+		if (CTX_wm_space_image(C) != NULL) {
+			if (obact->mode == OB_MODE_EDIT) {
+				if (ts->use_uv_sculpt)
+					return &ts->uvsculpt->paint;
+				else
+					return &ts->imapaint.paint;
+			}
+			else {
+				return &ts->imapaint.paint;
+			}
+		}
+		else if (obact) {
+			switch (obact->mode) {
+				case OB_MODE_SCULPT:
+					return &ts->sculpt->paint;
+				case OB_MODE_VERTEX_PAINT:
+					return &ts->vpaint->paint;
+				case OB_MODE_WEIGHT_PAINT:
+					return &ts->wpaint->paint;
+				case OB_MODE_TEXTURE_PAINT:
+					return &ts->imapaint.paint;
+				case OB_MODE_EDIT:
+					if (ts->use_uv_sculpt)
+						return &ts->uvsculpt->paint;
+					else
+						return &ts->imapaint.paint;
+			}
+		}
+		else {
+			/* default to image paint */
+			return &ts->imapaint.paint;
+		}
+	}
+
+	return NULL;
+}
+
 Brush *paint_brush(Paint *p)
 {
 	return p ? p->brush : NULL;

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp	2012-06-04 10:51:00 UTC (rev 47398)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp	2012-06-04 10:55:05 UTC (rev 47399)
@@ -43,6 +43,8 @@
 
 void GaussianBokehBlurOperation::initExecution()
 {
+	BlurBaseOperation::initExecution();
+
 	if (this->sizeavailable) {
 		updateGauss(NULL);
 	}

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp	2012-06-04 10:51:00 UTC (rev 47398)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp	2012-06-04 10:55:05 UTC (rev 47399)
@@ -45,6 +45,8 @@
 
 void GaussianXBlurOperation::initExecution()
 {
+	BlurBaseOperation::initExecution();
+
 	if (this->sizeavailable) {
 		float rad = size*this->data->sizex;
 		if (rad<1)

Modified: branches/soc-2011-tomato/source/blender/editors/animation/anim_channels_defines.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/animation/anim_channels_defines.c	2012-06-04 10:51:00 UTC (rev 47398)
+++ branches/soc-2011-tomato/source/blender/editors/animation/anim_channels_defines.c	2012-06-04 10:55:05 UTC (rev 47399)
@@ -395,11 +395,8 @@
 /* get backdrop color for summary widget */

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list