[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50162] branches/soc-2011-tomato: Merging r50160 through r50161 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Thu Aug 23 18:15:37 CEST 2012


Revision: 50162
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50162
Author:   nazgul
Date:     2012-08-23 16:15:37 +0000 (Thu, 23 Aug 2012)
Log Message:
-----------
Merging r50160 through r50161 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/editors/space_sequencer/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_draw.c
    branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_intern.h
    branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_ops.c

Added Paths:
-----------
    branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_view.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-50159
   + /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-50161


Property changes on: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c: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/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-50159
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c: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/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-50161


Property changes on: branches/soc-2011-tomato/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-50159
   + /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-50161

Modified: branches/soc-2011-tomato/source/blender/editors/space_sequencer/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_sequencer/CMakeLists.txt	2012-08-23 16:14:52 UTC (rev 50161)
+++ branches/soc-2011-tomato/source/blender/editors/space_sequencer/CMakeLists.txt	2012-08-23 16:15:37 UTC (rev 50162)
@@ -44,6 +44,7 @@
 	sequencer_ops.c
 	sequencer_scopes.c
 	sequencer_select.c
+	sequencer_view.c
 	space_sequencer.c
 
 	sequencer_intern.h

Modified: branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_draw.c	2012-08-23 16:14:52 UTC (rev 50161)
+++ branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_draw.c	2012-08-23 16:15:37 UTC (rev 50162)
@@ -815,6 +815,41 @@
 	else special_seq_update = NULL;
 }
 
+ImBuf *sequencer_ibuf_get(struct Main *bmain, Scene *scene, SpaceSeq *sseq, int cfra, int frame_ofs)
+{
+	SeqRenderData context;
+	ImBuf *ibuf;
+	int rectx, recty;
+	float render_size = 0.0;
+	float proxy_size = 100.0;
+
+	render_size = sseq->render_size;
+	if (render_size == 0) {
+		render_size = scene->r.size;
+	}
+	else {
+		proxy_size = render_size;
+	}
+
+	if (render_size < 0) {
+		return NULL;
+	}
+
+	rectx = (render_size * (float)scene->r.xsch) / 100.0f + 0.5f;
+	recty = (render_size * (float)scene->r.ysch) / 100.0f + 0.5f;
+
+	context = BKE_sequencer_new_render_data(bmain, scene, rectx, recty, proxy_size);
+
+	if (special_seq_update)
+		ibuf = BKE_sequencer_give_ibuf_direct(context, cfra + frame_ofs, special_seq_update);
+	else if (!U.prefetchframes) // XXX || (G.f & G_PLAYANIM) == 0) {
+		ibuf = BKE_sequencer_give_ibuf(context, cfra + frame_ofs, sseq->chanshown);
+	else
+		ibuf = BKE_sequencer_give_ibuf_threaded(context, cfra + frame_ofs, sseq->chanshown);
+
+	return ibuf;
+}
+
 void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs, int draw_overlay)
 {
 	struct Main *bmain = CTX_data_main(C);
@@ -828,7 +863,6 @@
 	float col[3];
 	GLuint texid;
 	GLuint last_texid;
-	SeqRenderData context;
 	unsigned char *display_buffer;
 	void *cache_handle = NULL;
 
@@ -871,14 +905,7 @@
 	if (G.is_rendering)
 		return;
 
-	context = BKE_sequencer_new_render_data(bmain, scene, rectx, recty, proxy_size);
-
-	if (special_seq_update)
-		ibuf = BKE_sequencer_give_ibuf_direct(context, cfra + frame_ofs, special_seq_update);
-	else if (!U.prefetchframes) // XXX || (G.f & G_PLAYANIM) == 0) {
-		ibuf = BKE_sequencer_give_ibuf(context, cfra + frame_ofs, sseq->chanshown);
-	else
-		ibuf = BKE_sequencer_give_ibuf_threaded(context, cfra + frame_ofs, sseq->chanshown);
+	ibuf = sequencer_ibuf_get(bmain, scene, sseq, cfra, frame_ofs);
 	
 	if (ibuf == NULL)
 		return;

Modified: branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_intern.h
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_intern.h	2012-08-23 16:14:52 UTC (rev 50161)
+++ branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_intern.h	2012-08-23 16:15:37 UTC (rev 50162)
@@ -44,6 +44,7 @@
 struct ARegion;
 struct ARegionType;
 struct Scene;
+struct Main;
 
 /* space_sequencer.c */
 struct ARegion *sequencer_has_buttons_region(struct ScrArea *sa);
@@ -55,6 +56,8 @@
 
 void seq_reset_imageofs(struct SpaceSeq *sseq);
 
+struct ImBuf *sequencer_ibuf_get(struct Main *bmain, struct Scene *scene, struct SpaceSeq *sseq, int cfra, int frame_ofs);
+
 /* sequencer_edit.c */
 struct View2D;
 void seq_rectf(struct Sequence *seq, struct rctf *rectf);
@@ -181,5 +184,8 @@
 void SEQUENCER_OT_strip_modifier_remove(struct wmOperatorType *ot);
 void SEQUENCER_OT_strip_modifier_move(struct wmOperatorType *ot);
 
+/* sequencer_view.c */
+void SEQUENCER_OT_sample(struct wmOperatorType *ot);
+
 #endif /* __SEQUENCER_INTERN_H__ */
 

Modified: branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_ops.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_ops.c	2012-08-23 16:14:52 UTC (rev 50161)
+++ branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_ops.c	2012-08-23 16:15:37 UTC (rev 50162)
@@ -118,6 +118,9 @@
 	WM_operatortype_append(SEQUENCER_OT_strip_modifier_add);
 	WM_operatortype_append(SEQUENCER_OT_strip_modifier_remove);
 	WM_operatortype_append(SEQUENCER_OT_strip_modifier_move);
+
+	/* sequencer_view.h */
+	WM_operatortype_append(SEQUENCER_OT_sample);
 }
 
 
@@ -335,6 +338,9 @@
 	RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD4, KM_PRESS, 0, 0)->ptr, "ratio", 0.25f);
 	RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD8, KM_PRESS, 0, 0)->ptr, "ratio", 0.125f);
 #endif
+
+	/* sample */
+	WM_keymap_add_item(keymap, "SEQUENCER_OT_sample", ACTIONMOUSE, KM_PRESS, 0, 0);
 }
 
 void ED_operatormacros_sequencer(void)

Copied: branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_view.c (from rev 50161, trunk/blender/source/blender/editors/space_sequencer/sequencer_view.c)
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_view.c	                        (rev 0)
+++ branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_view.c	2012-08-23 16:15:37 UTC (rev 50162)
@@ -0,0 +1,221 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation,
+ *                 Sergey Sharybin
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+
+/** \file blender/editors/space_sequencer/sequencer_modifier.c
+ *  \ingroup spseq
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_utildefines.h"
+
+#include "DNA_scene_types.h"
+
+#include "BKE_context.h"
+#include "BKE_main.h"
+#include "BKE_sequencer.h"
+#include "BKE_screen.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_image.h"
+#include "ED_screen.h"
+#include "ED_space_api.h"
+
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
+#include "UI_view2d.h"
+
+/* own include */
+#include "sequencer_intern.h"
+
+/******************** sample backdrop operator ********************/
+
+typedef struct ImageSampleInfo {
+	ARegionType *art;
+	void *draw_handle;
+	int x, y;
+	int channels;
+
+	unsigned char col[4];
+	float colf[4];
+
+	unsigned char *colp;
+	float *colfp;
+

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list