Revision: 38419
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38419
Author:   nazgul
Date:     2011-07-15 20:22:01 +0000 (Fri, 15 Jul 2011)
Log Message:
-----------
Merging r38390 through r38418 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c
    branches/soc-2011-tomato/source/blender/editors/physics/physics_fluid.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_particle_types.h
    branches/soc-2011-tomato/source/blender/python/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/python/SConscript
    branches/soc-2011-tomato/source/blender/python/generic/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/python/intern/bpy.c
    branches/soc-2011-tomato/source/blender/python/intern/bpy_interface.c
    branches/soc-2011-tomato/source/blender/python/intern/bpy_rna.c
    branches/soc-2011-tomato/source/blenderplayer/CMakeLists.txt
    branches/soc-2011-tomato/source/creator/CMakeLists.txt
    branches/soc-2011-tomato/source/gameengine/Expressions/PyObjectPlus.h
    branches/soc-2011-tomato/source/gameengine/Ketsji/CMakeLists.txt
    branches/soc-2011-tomato/source/gameengine/Ketsji/KX_PyMath.h
    branches/soc-2011-tomato/source/gameengine/Ketsji/KX_PythonInit.cpp
    branches/soc-2011-tomato/source/gameengine/Ketsji/SConscript

Added Paths:
-----------
    branches/soc-2011-tomato/source/blender/python/mathutils/
    branches/soc-2011-tomato/source/blender/python/mathutils/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils.h
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Color.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Color.h
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Euler.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Euler.h
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Matrix.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Matrix.h
    
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Quaternion.c
    
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Quaternion.h
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Vector.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Vector.h
    
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_geometry.c
    
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_geometry.h

Removed Paths:
-------------
    branches/soc-2011-tomato/source/blender/python/generic/mathutils.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils.h
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Color.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Color.h
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Euler.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Euler.h
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Matrix.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Matrix.h
    
branches/soc-2011-tomato/source/blender/python/generic/mathutils_Quaternion.c
    
branches/soc-2011-tomato/source/blender/python/generic/mathutils_Quaternion.h
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Vector.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_Vector.h
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_geometry.c
    branches/soc-2011-tomato/source/blender/python/generic/mathutils_geometry.h
    branches/soc-2011-tomato/source/blender/python/mathutils/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils.h
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Color.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Color.h
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Euler.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Euler.h
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Matrix.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Matrix.h
    
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Quaternion.c
    
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Quaternion.h
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Vector.c
    branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_Vector.h
    
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_geometry.c
    
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_geometry.h

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/doc/python_api/rst/bge.constraints.rst


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/blender:36831-38389
   + /trunk/blender:36831-38418


Property changes on: 
branches/soc-2011-tomato/doc/python_api/rst/bge.constraints.rst
___________________________________________________________________
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Modified: branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c        
2011-07-15 17:16:26 UTC (rev 38418)
+++ branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c        
2011-07-15 20:22:01 UTC (rev 38419)
@@ -75,6 +75,7 @@
 #include "DNA_node_types.h"
 #include "DNA_object_fluidsim.h" // NT
 #include "DNA_packedFile_types.h"
+#include "DNA_particle_types.h"
 #include "DNA_property_types.h"
 #include "DNA_text_types.h"
 #include "DNA_view3d_types.h"
@@ -3203,10 +3204,38 @@
                        if(part->effector_weights)
                                part->effector_weights->group = newlibadr(fd, 
part->id.lib, part->effector_weights->group);
 
-                       dw = part->dupliweights.first;
-                       for(; dw; dw=dw->next)
-                               dw->ob = newlibadr(fd, part->id.lib, dw->ob);
+                       if(part->dupliweights.first) {
+                               int index_ok = 0;
+                               /* check for old files without indices (all 
indexes 0) */
+                               dw = part->dupliweights.first;
+                               if(part->dupliweights.first == 
part->dupliweights.last) {
+                                       /* special case for only one object in 
the group */
+                                       index_ok = 1;
+                               }
+                               else { 
+                                       for(; dw; dw=dw->next) {
+                                               if(dw->index > 0) {
+                                                       index_ok = 1;
+                                                       break;
+                                               }
+                                       }
+                               }
 
+                               if(index_ok) {
+                                       /* if we have indexes, let's use them */
+                                       dw = part->dupliweights.first;
+                                       for(; dw; dw=dw->next) {
+                                               GroupObject *go = (GroupObject 
*)BLI_findlink(&part->dup_group->gobject, dw->index);
+                                               dw->ob = go ? go->ob : NULL;
+                                       }
+                               }
+                               else {
+                                       /* otherwise try to get objects from 
own library (won't work on library linked groups) */
+                                       for(; dw; dw=dw->next)
+                                               dw->ob = newlibadr(fd, 
part->id.lib, dw->ob);
+                               }
+                       }
+
                        if(part->boids) {
                                BoidState *state = part->boids->states.first;
                                BoidRule *rule;

Modified: branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c       
2011-07-15 17:16:26 UTC (rev 38418)
+++ branches/soc-2011-tomato/source/blender/blenloader/intern/writefile.c       
2011-07-15 20:22:01 UTC (rev 38419)
@@ -838,6 +838,7 @@
 {
        ParticleSettings *part;
        ParticleDupliWeight *dw;
+       GroupObject *go;
        int a;
 
        part= idbase->first;
@@ -852,8 +853,16 @@
                        writestruct(wd, DATA, "EffectorWeights", 1, 
part->effector_weights);
 
                        dw = part->dupliweights.first;
-                       for(; dw; dw=dw->next)
+                       for(; dw; dw=dw->next) {
+                               /* update indices */
+                               dw->index = 0;
+                               go = part->dup_group->gobject.first;
+                               while(go && go->ob != dw->ob) {
+                                       go=go->next;
+                                       dw->index++;
+                               }
                                writestruct(wd, DATA, "ParticleDupliWeight", 1, 
dw);
+                       }
 
                        if(part->boids && part->phystype == PART_PHYS_BOIDS) {
                                BoidState *state = part->boids->states.first;

Modified: 
branches/soc-2011-tomato/source/blender/editors/physics/physics_fluid.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/physics/physics_fluid.c     
2011-07-15 17:16:26 UTC (rev 38418)
+++ branches/soc-2011-tomato/source/blender/editors/physics/physics_fluid.c     
2011-07-15 20:22:01 UTC (rev 38419)
@@ -722,15 +722,17 @@
 
 static void fluidbake_free(void *customdata)
 {
-       FluidBakeJob *fb= customdata;
+       FluidBakeJob *fb= (FluidBakeJob *)customdata;
        MEM_freeN(fb);
 }
 
 /* called by fluidbake, only to check job 'stop' value */
-static int fluidbake_breakjob(void *UNUSED(customdata))
+static int fluidbake_breakjob(void *customdata)
 {
-       //FluidBakeJob *fb= (FluidBakeJob *)customdata;
-       //return *(fb->stop);
+       FluidBakeJob *fb= (FluidBakeJob *)customdata;
+
+       if(fb->stop && *(fb->stop))
+               return 1;
        
        /* this is not nice yet, need to make the jobs list template better 
         * for identifying/acting upon various different jobs */
@@ -741,7 +743,7 @@
 /* called by fluidbake, wmJob sends notifier */
 static void fluidbake_updatejob(void *customdata, float progress)
 {
-       FluidBakeJob *fb= customdata;
+       FluidBakeJob *fb= (FluidBakeJob *)customdata;
        
        *(fb->do_update)= 1;
        *(fb->progress)= progress;
@@ -749,7 +751,7 @@
 
 static void fluidbake_startjob(void *customdata, short *stop, short 
*do_update, float *progress)
 {
-       FluidBakeJob *fb= customdata;
+       FluidBakeJob *fb= (FluidBakeJob *)customdata;
        
        fb->stop= stop;
        fb->do_update = do_update;
@@ -764,7 +766,7 @@
 
 static void fluidbake_endjob(void *customdata)
 {
-       FluidBakeJob *fb= customdata;
+       FluidBakeJob *fb= (FluidBakeJob *)customdata;
        
        if (fb->settings) {
                MEM_freeN(fb->settings);

Modified: branches/soc-2011-tomato/source/blender/makesdna/DNA_particle_types.h
===================================================================
--- branches/soc-2011-tomato/source/blender/makesdna/DNA_particle_types.h       
2011-07-15 17:16:26 UTC (rev 38418)
+++ branches/soc-2011-tomato/source/blender/makesdna/DNA_particle_types.h       
2011-07-15 20:22:01 UTC (rev 38419)
@@ -89,7 +89,8 @@
        struct ParticleDupliWeight *next, *prev;
        struct Object *ob;
        short count;
-       short flag, rt[2];
+       short flag;
+       short index, rt; /* only updated on file save and used on file load */
 } ParticleDupliWeight;
 
 typedef struct ParticleData {

Modified: branches/soc-2011-tomato/source/blender/python/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/python/CMakeLists.txt       
2011-07-15 17:16:26 UTC (rev 38418)
+++ branches/soc-2011-tomato/source/blender/python/CMakeLists.txt       
2011-07-15 20:22:01 UTC (rev 38419)
@@ -18,3 +18,4 @@
 
 add_subdirectory(intern)
 add_subdirectory(generic)
+add_subdirectory(mathutils)

Modified: branches/soc-2011-tomato/source/blender/python/SConscript
===================================================================
--- branches/soc-2011-tomato/source/blender/python/SConscript   2011-07-15 
17:16:26 UTC (rev 38418)
+++ branches/soc-2011-tomato/source/blender/python/SConscript   2011-07-15 
20:22:01 UTC (rev 38419)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-# TODO, split into 2 files.
+# TODO, split into 3 files.
 
 Import ('env')
 
@@ -18,9 +18,16 @@
     defs.append('_DEBUG')
 
 sources = env.Glob('generic/*.c')
-env.BlenderLib( libname = 'bf_python_ext', sources = Split(sources), includes 
= Split(incs), defines = defs, libtype = ['core','player'], priority = 
[362,165]) # ketsji is 360
+env.BlenderLib( libname = 'bf_python_ext', sources = Split(sources), includes 
= Split(incs), defines = defs, libtype = ['core','player'], priority = 
[363,165]) # ketsji is 360
 
 
+# mathutils
+defs = []
+
+sources = env.Glob('mathutils/*.c')
+env.BlenderLib( libname = 'bf_python_mathutils', sources = Split(sources), 
includes = Split(incs), defines = defs, libtype = ['core','player'], priority = 
[362,165])
+
+
 # bpy
 defs = []
 

Modified: branches/soc-2011-tomato/source/blender/python/generic/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/python/generic/CMakeLists.txt       
2011-07-15 17:16:26 UTC (rev 38418)
+++ branches/soc-2011-tomato/source/blender/python/generic/CMakeLists.txt       
2011-07-15 20:22:01 UTC (rev 38419)
@@ -37,13 +37,6 @@
        bgl.c
        blf_py_api.c
        bpy_internal_import.c
-       mathutils.c
-       mathutils_Color.c
-       mathutils_Euler.c
-       mathutils_Matrix.c
-       mathutils_Quaternion.c
-       mathutils_Vector.c
-       mathutils_geometry.c
        noise_py_api.c
        py_capi_utils.c
 
@@ -51,13 +44,6 @@
        bgl.h
        blf_py_api.h
        bpy_internal_import.h
-       mathutils.h
-       mathutils_Color.h
-       mathutils_Euler.h
-       mathutils_Matrix.h
-       mathutils_Quaternion.h
-       mathutils_Vector.h
-       mathutils_geometry.h
        noise_py_api.h
        py_capi_utils.h
 )

Deleted: branches/soc-2011-tomato/source/blender/python/generic/mathutils.c
===================================================================
--- branches/soc-2011-tomato/source/blender/python/generic/mathutils.c  
2011-07-15 17:16:26 UTC (rev 38418)
+++ branches/soc-2011-tomato/source/blender/python/generic/mathutils.c  
2011-07-15 20:22:01 UTC (rev 38419)
@@ -1,384 +0,0 @@
-/* 
- * $Id$
- *
- * ***** 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) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Joseph Gilbert, Campbell Barton
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/python/generic/mathutils.c
- *  \ingroup pygen
- */
-
-#include <Python.h>
-
-#include "mathutils.h"
-
-#include "BLI_math.h"
-#include "BLI_utildefines.h"
-
-PyDoc_STRVAR(M_Mathutils_doc,
-"This module provides access to matrices, eulers, quaternions and vectors."
-);
-static int mathutils_array_parse_fast(float *array, int array_min, int 
array_max, PyObject *value, const char *error_prefix)
-{
-       PyObject *value_fast= NULL;
-       PyObject *item;
-
-       int i, size;
-
-       /* non list/tuple cases */
-       if(!(value_fast=PySequence_Fast(value, error_prefix))) {
-               /* PySequence_Fast sets the error */
-               return -1;
-       }
-
-       size= PySequence_Fast_GET_SIZE(value_fast);
-
-       if(size > array_max || size < array_min) {
-               if (array_max == array_min)     {
-                       PyErr_Format(PyExc_ValueError,
-                                    "%.200s: sequence size is %d, expected %d",
-                                    error_prefix, size, array_max);
-               }
-               else {

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to