[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12854] trunk/blender/source/blender: Patch from ILdar AKHmetgaleev (akhil) - [#7864] correct scale in sequencer 's glow
Campbell Barton
ideasman42 at gmail.com
Wed Dec 12 15:20:12 CET 2007
Revision: 12854
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12854
Author: campbellbarton
Date: 2007-12-12 15:20:12 +0100 (Wed, 12 Dec 2007)
Log Message:
-----------
Patch from ILdar AKHmetgaleev (akhil) - [#7864] correct scale in sequencer's glow
Added py-api write access to sequencer images.
Modified Paths:
--------------
trunk/blender/source/blender/python/api2_2x/sceneSequence.c
trunk/blender/source/blender/src/seqeffects.c
Modified: trunk/blender/source/blender/python/api2_2x/sceneSequence.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/sceneSequence.c 2007-12-12 14:07:24 UTC (rev 12853)
+++ trunk/blender/source/blender/python/api2_2x/sceneSequence.c 2007-12-12 14:20:12 UTC (rev 12854)
@@ -531,8 +531,45 @@
return ret;
}
+static int Sequence_setImages( BPy_Sequence * self, PyObject *value )
+{
+ Strip *strip;
+ StripElem *se;
+ int i;
+ PyObject *list, *item;
+ char *basepath, *name;
+
+ if (self->seq->type != SEQ_IMAGE) {
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "Sequence is not an image type" );
+ }
+
+ if( !PyArg_ParseTuple
+ ( value, "sO!", &basepath, &PyList_Type, &list ) )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected string and optional list argument" );
+
+ strip = self->seq->strip;
+ se = strip->stripdata;
+
+ /* for now dont support different image list sizes */
+ if (PyList_Size(list) != strip->len) {
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "at the moment only image lista with the same number of images as the strip are supported" );
+ }
+
+ strncpy(strip->dir, basepath, sizeof(strip->dir));
+
+ for (i=0; i<strip->len; i++, se++) {
+ name = PyString_AsString(PyList_GetItem(list, i));
+ if (name) {
+ strncpy(se->name, name, sizeof(se->name));
+ }
+ }
+
+ return 0;
+}
-
/*
* get floating point attributes
*/
@@ -724,7 +761,7 @@
"Sequence name",
NULL},
{"images",
- (getter)Sequence_getImages, (setter)NULL,
+ (getter)Sequence_getImages, (setter)Sequence_setImages,
"Sequence scene",
NULL},
Modified: trunk/blender/source/blender/src/seqeffects.c
===================================================================
--- trunk/blender/source/blender/src/seqeffects.c 2007-12-12 14:07:24 UTC (rev 12853)
+++ trunk/blender/source/blender/src/seqeffects.c 2007-12-12 14:20:12 UTC (rev 12854)
@@ -35,6 +35,7 @@
#include "MEM_guardedalloc.h"
#include "PIL_dynlib.h"
+#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "BLI_blenlib.h"
@@ -2494,9 +2495,10 @@
unsigned char *outbuf=(unsigned char *)out;
unsigned char *inbuf=(unsigned char *)rect1;
GlowVars *glow = (GlowVars *)seq->effectdata;
+ struct RenderData *rd = &G.scene->r;
RVIsolateHighlights_byte(inbuf, outbuf , x, y, glow->fMini*765, glow->fBoost, glow->fClamp);
- RVBlurBitmap2_byte (outbuf, x, y, glow->dDist,glow->dQuality);
+ RVBlurBitmap2_byte (outbuf, x, y, glow->dDist * (rd->size / 100.0f),glow->dQuality);
if (!glow->bNoComp)
RVAddBitmaps_byte (inbuf , outbuf, outbuf, x, y);
}
@@ -2508,9 +2510,10 @@
float *outbuf = out;
float *inbuf = rect1;
GlowVars *glow = (GlowVars *)seq->effectdata;
+ struct RenderData *rd = &G.scene->r;
RVIsolateHighlights_float(inbuf, outbuf , x, y, glow->fMini*3.0f, glow->fBoost, glow->fClamp);
- RVBlurBitmap2_float (outbuf, x, y, glow->dDist,glow->dQuality);
+ RVBlurBitmap2_float (outbuf, x, y, glow->dDist * (rd->size / 100.0f),glow->dQuality);
if (!glow->bNoComp)
RVAddBitmaps_float (inbuf , outbuf, outbuf, x, y);
}
More information about the Bf-blender-cvs
mailing list