Revision: 15478
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15478
Author:   campbellbarton
Date:     2008-07-07 23:18:30 +0200 (Mon, 07 Jul 2008)

Log Message:
-----------
svn  merge  -r14639:14688 
https://svn.blender.org/svnroot/bf-blender/trunk/blender/

Modified Paths:
--------------
    branches/apricot/source/blender/blenkernel/intern/DerivedMesh.c
    branches/apricot/source/blender/blenkernel/intern/particle.c
    branches/apricot/source/blender/blenkernel/intern/particle_system.c
    branches/apricot/source/blender/include/BSE_sequence.h
    branches/apricot/source/blender/makesdna/DNA_space_types.h
    branches/apricot/source/blender/python/api2_2x/sceneSequence.c
    branches/apricot/source/blender/src/buttons_logic.c
    branches/apricot/source/blender/src/buttons_object.c
    branches/apricot/source/blender/src/buttons_scene.c
    branches/apricot/source/blender/src/drawimage.c
    branches/apricot/source/blender/src/editsima.c
    branches/apricot/source/blender/src/edittime.c
    branches/apricot/source/blender/src/header_image.c
    branches/apricot/source/blender/src/sequence.c
    branches/apricot/source/blender/src/transform_snap.c

Modified: branches/apricot/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/DerivedMesh.c     
2008-07-07 21:04:30 UTC (rev 15477)
+++ branches/apricot/source/blender/blenkernel/intern/DerivedMesh.c     
2008-07-07 21:18:30 UTC (rev 15478)
@@ -1208,7 +1208,7 @@
 
        /* store vertex indices in tmp union */
        for(ev = em->verts.first, i = 0; ev; ev = ev->next, ++i)
-               ev->tmp.l = (long) i++;
+               ev->tmp.l = (long) i;
 
        for( ; ee; ee = ee->next, ++edge_r) {
                edge_r->crease = (unsigned char) (ee->crease*255.0f);

Modified: branches/apricot/source/blender/blenkernel/intern/particle.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/particle.c        
2008-07-07 21:04:30 UTC (rev 15477)
+++ branches/apricot/source/blender/blenkernel/intern/particle.c        
2008-07-07 21:18:30 UTC (rev 15478)
@@ -1371,7 +1371,7 @@
 /************************************************/
 void psys_particle_on_emitter(Object *ob, ParticleSystemModifierData *psmd, 
int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, 
float *nor, float *utan, float *vtan, float *orco, float *ornor){
        if(psmd){
-               if(psmd->psys->part->distr==PART_DISTR_GRID){
+               if(psmd->psys->part->distr==PART_DISTR_GRID && 
psmd->psys->part->from != PART_FROM_VERT){
                        if(vec){
                                VECCOPY(vec,fuv);
                        }

Modified: branches/apricot/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- branches/apricot/source/blender/blenkernel/intern/particle_system.c 
2008-07-07 21:04:30 UTC (rev 15477)
+++ branches/apricot/source/blender/blenkernel/intern/particle_system.c 
2008-07-07 21:18:30 UTC (rev 15478)
@@ -168,7 +168,7 @@
        int i, totpart, totsaved = 0;
 
        if(new_totpart<0) {
-               if(psys->part->distr==PART_DISTR_GRID) {
+               if(psys->part->distr==PART_DISTR_GRID  && psys->part->from != 
PART_FROM_VERT) {
                        totpart= psys->part->grid_res;
                        totpart*=totpart*totpart;
                }
@@ -1056,7 +1056,7 @@
                dm= CDDM_from_mesh((Mesh*)ob->data, ob);
 
                /* special handling of grid distribution */
-               if(part->distr==PART_DISTR_GRID){
+               if(part->distr==PART_DISTR_GRID && from != PART_FROM_VERT){
                        distribute_particles_in_grid(dm,psys);
                        dm->release(dm);
                        return 0;
@@ -1600,7 +1600,7 @@
 
        NormalQuat(pa->r_rot);
 
-       if(part->distr!=PART_DISTR_GRID){
+       if(part->distr!=PART_DISTR_GRID && part->from != PART_FROM_VERT){
                /* any unique random number will do (r_ave[0]) */
                if(ptex.exist < 0.5*(1.0+pa->r_ave[0]))
                        pa->flag |= PARS_UNEXIST;
@@ -4515,7 +4515,7 @@
        if(part->from == PART_FROM_PARTICLE) {
                if(part->type != PART_REACTOR)
                        part->from = PART_FROM_FACE;
-               if(part->distr == PART_DISTR_GRID)
+               if(part->distr == PART_DISTR_GRID && part->from != 
PART_FROM_VERT)
                        part->distr = PART_DISTR_JIT;
        }
 
@@ -4710,7 +4710,7 @@
        oldtotpart = psys->totpart;
        oldtotchild = psys->totchild;
 
-       if(part->distr == PART_DISTR_GRID)
+       if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT)
                totpart = part->grid_res*part->grid_res*part->grid_res;
        else
                totpart = psys->part->totpart;

Modified: branches/apricot/source/blender/include/BSE_sequence.h
===================================================================
--- branches/apricot/source/blender/include/BSE_sequence.h      2008-07-07 
21:04:30 UTC (rev 15477)
+++ branches/apricot/source/blender/include/BSE_sequence.h      2008-07-07 
21:18:30 UTC (rev 15478)
@@ -92,6 +92,8 @@
 struct RenderResult;
 void do_render_seq(struct RenderResult *rr, int cfra);
 
+int seq_can_blend(struct Sequence *seq);
+
 #define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_HD_SOUND || 
seq->type==SEQ_RAM_SOUND || seq->type==SEQ_IMAGE)
 
 #endif

Modified: branches/apricot/source/blender/makesdna/DNA_space_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_space_types.h  2008-07-07 
21:04:30 UTC (rev 15477)
+++ branches/apricot/source/blender/makesdna/DNA_space_types.h  2008-07-07 
21:18:30 UTC (rev 15478)
@@ -236,8 +236,9 @@
        short imanr;
        short curtile; /* the currently active tile of the image when tile is 
enabled, is kept in sync with the active faces tile */
        int flag;
+       short selectmode;
        short imtypenr, lock;
-       short pin, pad2;
+       short pin;
        float zoom;
        char dt_uv; /* UV draw type */
        char sticky; /* sticky selection type */
@@ -500,6 +501,12 @@
 #define SI_STICKY_DISABLE      1
 #define SI_STICKY_VERTEX       2
 
+/* SpaceImage->selectmode */
+#define SI_SELECT_VERTEX       0
+#define SI_SELECT_EDGE         1 /* not implemented */
+#define SI_SELECT_FACE         2
+#define SI_SELECT_ISLAND       3
+
 /* SpaceImage->flag */
 #define SI_BE_SQUARE   1<<0
 #define SI_EDITTILE            1<<1
@@ -507,7 +514,7 @@
 #define SI_DRAWTOOL            1<<3
 #define SI_DEPRECATED1  1<<4   /* stick UVs to others in the same location */
 #define SI_DRAWSHADOW   1<<5
-#define SI_SELACTFACE   1<<6
+#define SI_SELACTFACE   1<<6   /* deprecated */
 #define SI_DEPRECATED2 1<<7
 #define SI_DEPRECATED3  1<<8   /* stick UV selection to mesh vertex (UVs wont 
always be touching) */
 #define SI_COORDFLOATS  1<<9

Modified: branches/apricot/source/blender/python/api2_2x/sceneSequence.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/sceneSequence.c      
2008-07-07 21:04:30 UTC (rev 15477)
+++ branches/apricot/source/blender/python/api2_2x/sceneSequence.c      
2008-07-07 21:18:30 UTC (rev 15478)
@@ -81,6 +81,7 @@
 static PyObject *Sequence_copy( BPy_Sequence * self );
 static PyObject *Sequence_new( BPy_Sequence * self, PyObject * args );
 static PyObject *Sequence_remove( BPy_Sequence * self, PyObject * args );
+static PyObject *Sequence_rebuildProxy( BPy_Sequence * self );
 
 static PyObject *SceneSeq_new( BPy_SceneSeq * self, PyObject * args );
 static PyObject *SceneSeq_remove( BPy_SceneSeq * self, PyObject * args );
@@ -96,6 +97,8 @@
         "() - Return a copy of the sequence containing the same objects."},
        {"copy", ( PyCFunction ) Sequence_copy, METH_NOARGS,
         "() - Return a copy of the sequence containing the same objects."},
+       {"rebuildProxy", ( PyCFunction ) Sequence_rebuildProxy, METH_VARARGS,
+        "() - Rebuild the active strip's Proxy."},
        {NULL, NULL, 0, NULL}
 };
 
@@ -309,6 +312,7 @@
        Py_RETURN_NONE;
 }
 
+
 /*****************************************************************************/
 /* PythonTypeObject callback function prototypes                        */
 /*****************************************************************************/
@@ -383,8 +387,6 @@
 }
 
 
-
-
 static PyObject *Sequence_getName( BPy_Sequence * self )
 {
        return PyString_FromString( self->seq->name+2 );
@@ -403,11 +405,13 @@
        return 0;
 }
 
+
 static PyObject *Sequence_getProxyDir( BPy_Sequence * self )
 {
        return PyString_FromString( self->seq->strip->proxy ? 
self->seq->strip->proxy->dir : "" );
 }
 
+
 static int Sequence_setProxyDir( BPy_Sequence * self, PyObject * value )
 {
        char *name = NULL;
@@ -430,6 +434,14 @@
 }
 
 
+static PyObject *Sequence_rebuildProxy( BPy_Sequence * self )
+{
+       if (self->seq->strip->proxy)
+               seq_proxy_rebuild(self->seq);
+       Py_RETURN_NONE;
+}
+
+
 static PyObject *Sequence_getSound( BPy_Sequence * self )
 {
        if (self->seq->type == SEQ_RAM_SOUND && self->seq->sound)
@@ -622,6 +634,54 @@
        return 0;
 }
 
+static PyObject *M_Sequence_BlendModesDict( void )
+{
+       PyObject *M = PyConstant_New(  );
+
+       if( M ) {
+               BPy_constant *d = ( BPy_constant * ) M;
+               PyConstant_Insert( d, "CROSS", PyInt_FromLong( SEQ_CROSS ) );
+               PyConstant_Insert( d, "ADD", PyInt_FromLong( SEQ_ADD ) );
+               PyConstant_Insert( d, "SUBTRACT", PyInt_FromLong( SEQ_SUB ) );
+               PyConstant_Insert( d, "ALPHAOVER", PyInt_FromLong( 
SEQ_ALPHAOVER ) );
+               PyConstant_Insert( d, "ALPHAUNDER", PyInt_FromLong( 
SEQ_ALPHAUNDER ) );
+               PyConstant_Insert( d, "GAMMACROSS", PyInt_FromLong( 
SEQ_GAMCROSS ) );
+               PyConstant_Insert( d, "MULTIPLY", PyInt_FromLong( SEQ_MUL ) );
+               PyConstant_Insert( d, "OVERDROP", PyInt_FromLong( SEQ_OVERDROP 
) );
+               PyConstant_Insert( d, "PLUGIN", PyInt_FromLong( SEQ_PLUGIN ) );
+               PyConstant_Insert( d, "WIPE", PyInt_FromLong( SEQ_WIPE ) );
+               PyConstant_Insert( d, "GLOW", PyInt_FromLong( SEQ_GLOW ) );
+               PyConstant_Insert( d, "TRANSFORM", PyInt_FromLong( 
SEQ_TRANSFORM ) );
+               PyConstant_Insert( d, "COLOR", PyInt_FromLong( SEQ_COLOR ) );
+               PyConstant_Insert( d, "SPEED", PyInt_FromLong( SEQ_SPEED ) );
+       }
+       return M;
+}
+
+static PyObject *Sequence_getBlendMode( BPy_Sequence * self )
+{
+       return PyInt_FromLong( self->seq->blend_mode );
+}
+
+static int Sequence_setBlendMode( BPy_Sequence * self, PyObject * value )
+{
+       struct Sequence *seq= self->seq;
+       int number = PyInt_AsLong( value );
+       
+       if( number==-1 && PyErr_Occurred() )
+               return EXPP_ReturnIntError( PyExc_TypeError, "expected an int 
value" );
+       
+       if ( !seq_can_blend(seq) )
+               return EXPP_ReturnIntError( PyExc_AttributeError, "this 
sequence type dosnt support blending" );        
+       
+       if (number<SEQ_EFFECT || number>SEQ_EFFECT_MAX)
+               return EXPP_ReturnIntError( PyExc_TypeError, "expected an int 
value" );
+       
+       seq->blend_mode=number;
+       
+       return 0;
+}
+
 /*
  * get floating point attributes
  */
@@ -836,7 +896,11 @@
         (getter)Sequence_getImages, (setter)Sequence_setImages,
         "Sequence scene",
          NULL},
-         
+       {"blendMode",
+        (getter)Sequence_getBlendMode, (setter)Sequence_setBlendMode,
+        "Sequence Blend Mode",
+         NULL},
+
        {"type",
         (getter)getIntAttr, (setter)NULL,
         "",
@@ -1131,6 +1195,7 @@
 /*****************************************************************************/
 PyObject *Sequence_Init( void )
 {
+       PyObject *BlendModesDict = M_Sequence_BlendModesDict( );
        PyObject *submodule;
        if( PyType_Ready( &Sequence_Type ) < 0 )
                return NULL;
@@ -1142,6 +1207,9 @@
 "The Blender Sequence module\n\n\
 This module provides access to **Sequence Data** in Blender.\n" );
 
+       if( BlendModesDict )
+               PyModule_AddObject( submodule, "BlendModes", BlendModesDict );
+
        /*Add SUBMODULES to the module*/
        /*PyDict_SetItemString(dict, "Constraint", Constraint_Init()); 
//creates a *new* module*/
        return submodule;

Modified: branches/apricot/source/blender/src/buttons_logic.c
===================================================================
--- branches/apricot/source/blender/src/buttons_logic.c 2008-07-07 21:04:30 UTC 
(rev 15477)

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to