[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15609] branches/soc-2008-mxcurioni/source /blender/freestyle: soc-2008-mxcurioni: SWIG removal - completed SVertex and CurvePoint classes migration.

2008-07-16 Thread Maxime Curioni
Revision: 15609
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15609
Author:   mxcurioni
Date: 2008-07-17 08:35:30 +0200 (Thu, 17 Jul 2008)

Log Message:
---
soc-2008-mxcurioni: SWIG removal - completed SVertex and CurvePoint classes 
migration. Stabilized a lot of the code for C++ -> Python conversion. Added the 
correct rich comparison operator and tested it. Corrected 'dupplicate' typo and 
changde to __copy__ for Python API.

>From now on, when a set should be output (PySet_Type), it is given as a list 
>(PyList_Type). The reason is that it doesn't really matter what we bring back 
>to the Python interpreter. The set is guaranteed in memory on the C++ side.

For the CurvePoint class, the userdata variable is not yet ported (and will 
probably available as a list or a dictionary). The CurvePoint implementation 
works except for the initialization from other CurvePoints: somehow, the inner 
variables don't seem to be correctly handled. I do not know if it is a bug in 
Freestyle or if the CurvePoint object's state is correct for my test case. 
CurvePoint needs more testing.

Modified Paths:
--
branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Convert.h
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Id.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/SVertex.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/FEdge/FEdgeSharp.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/swig/ModuleWrapper.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/Silhouette.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewMap.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WEdge.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WEdge.h

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/winged_edge/WXEdge.h
branches/soc-2008-mxcurioni/source/blender/freestyle/python/Freestyle.py

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript
===
--- branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 
2008-07-16 23:02:23 UTC (rev 15608)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/SConscript 
2008-07-17 06:35:30 UTC (rev 15609)
@@ -67,6 +67,7 @@
prefix + '/Id.cpp',
prefix + '/Interface0D.cpp',
prefix + '/Interface0D/CurvePoint.cpp',
+   prefix + '/Interface0D/SVertex.cpp',
prefix + '/Interface1D.cpp'
]
 

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp
===
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp
2008-07-16 23:02:23 UTC (rev 15608)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp
2008-07-17 06:35:30 UTC (rev 15609)
@@ -153,7 +153,7 @@
BPy_Interface0D *obj1, *obj2;
bool b;
 
-   if( !PyArg_ParseTuple(args,(char *)"OO:BinaryPredicate0D___call__", 
&obj1, obj2) ) {
+   if( !PyArg_ParseTuple(args,(char *)"OO", &obj1, &obj2) ) {
cout << "ERROR: BinaryPredicate0D___call__ " << endl;   
return NULL;
}

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp
===
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp
2008-07-16 23:02:23 UTC (rev 15608)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp
2008-07-17 06:35:30 UTC (rev 15609)
@@ -151,7 +151,7 @@
BPy_Interface1D *obj1, *obj2;
bool b;

-   if( !PyArg_ParseTuple(args,(char *)"OO:BinaryPredicat

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15608] branches/apricot/source: svn merge -r15597:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender

2008-07-16 Thread Campbell Barton
Revision: 15608
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15608
Author:   campbellbarton
Date: 2008-07-17 01:02:23 +0200 (Thu, 17 Jul 2008)

Log Message:
---
svn merge -r15597:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--
branches/apricot/source/blender/blenlib/intern/arithb.c
branches/apricot/source/blender/render/intern/source/rendercore.c
branches/apricot/source/blender/src/editmesh.c
branches/apricot/source/blender/src/editmesh_lib.c
branches/apricot/source/blender/src/editobject.c
branches/apricot/source/gameengine/Converter/BL_ShapeDeformer.cpp
branches/apricot/source/gameengine/Converter/BL_SkinDeformer.cpp
branches/apricot/source/gameengine/Converter/BL_SkinDeformer.h

Modified: branches/apricot/source/blender/blenlib/intern/arithb.c
===
--- branches/apricot/source/blender/blenlib/intern/arithb.c 2008-07-16 
21:24:54 UTC (rev 15607)
+++ branches/apricot/source/blender/blenlib/intern/arithb.c 2008-07-16 
23:02:23 UTC (rev 15608)
@@ -60,6 +60,7 @@
 #define SMALL_NUMBER   1.e-8
 #define ABS(x) ((x) < 0 ? -(x) : (x))
 #define SWAP(type, a, b)   { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
+#define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)
 
 
 #if defined(WIN32) || defined(__APPLE__)
@@ -3808,12 +3809,50 @@
 
 /* Adapted from the paper by Kasper Fauerby */
 /* "Improved Collision detection and Response" */
+static int getLowestRoot(float a, float b, float c, float maxR, float* root)
+{
+   // Check if a solution exists
+   float determinant = b*b - 4.0f*a*c;
+
+   // If determinant is negative it means no solutions.
+   if (determinant >= 0.0f)
+   {
+   // calculate the two roots: (if determinant == 0 then
+   // x1==x2 but let’s disregard that slight optimization)
+   float sqrtD = sqrt(determinant);
+   float r1 = (-b - sqrtD) / (2.0f*a);
+   float r2 = (-b + sqrtD) / (2.0f*a);
+   
+   // Sort so x1 <= x2
+   if (r1 > r2)
+   SWAP( float, r1, r2);
+
+   // Get lowest root:
+   if (r1 > 0.0f && r1 < maxR)
+   {
+   *root = r1;
+   return 1;
+   }
+
+   // It is possible that we want x2 - this can happen
+   // if x1 < 0
+   if (r2 > 0.0f && r2 < maxR)
+   {
+   *root = r2;
+   return 1;
+   }
+   }
+   // No (valid) solutions
+   return 0;
+}
+
 int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, 
float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint)
 {
float e1[3], e2[3], e3[3], point[3], vel[3], /*dist[3],*/ nor[3], 
temp[3], bv[3];
-   float a, b, c, d, e, x, y, z, t, t0, t1, radius2=radius*radius;
+   float a, b, c, d, e, x, y, z, radius2=radius*radius;
float elen2,edotv,edotbv,nordotv,vel2;
-   int embedded_in_plane=0, found_by_sweep=0;
+   float newLambda;
+   int found_by_sweep=0;
 
VecSubf(e1,v1,v0);
VecSubf(e2,v2,v0);
@@ -3822,45 +3861,42 @@
 /*---test plane of tri---*/
Crossf(nor,e1,e2);
Normalize(nor);
+
/* flip normal */
if(Inpf(nor,vel)>0.0f) VecMulf(nor,-1.0f);

a=Inpf(p1,nor)-Inpf(v0,nor);
-
nordotv=Inpf(nor,vel);
 
-   if ((nordotv > -0.01) && (nordotv < 0.01)) {
-   if(fabs(a)>=1.0f)
+   if (fabs(nordotv) < 0.01)
+   {
+   if(fabs(a)>=radius)
+   {
return 0;
-   else{
-   embedded_in_plane=1;
-   t0=0.0f;
-   t1=1.0f;
}
}
-   else{
-   t0=(radius-a)/nordotv;
-   t1=(-radius-a)/nordotv;
-   /* make t0t1){b=t1; t1=t0; t0=b;}
+   else
+   {
+   float t0=(-a+radius)/nordotv;
+   float t1=(-a-radius)/nordotv;
 
+   if(t0>t1)
+   SWAP(float, t0, t1);
+
if(t0>1.0f || t1<0.0f) return 0;
 
/* clamp to [0,1] */
-   t0=(t0<0.0f)?0.0f:((t0>1.0f)?1.0:t0);
-   t1=(t1<0.0f)?0.0f:((t1>1.0f)?1.0:t1);
-   }
+   CLAMP(t0, 0.0f, 1.0f);
+   CLAMP(t1, 0.0f, 1.0f);
 
-/*---test inside of tri---*/
-   if(embedded_in_plane==0){
+   /*---test inside of tri---*/
/* plane intersection point */
-   VecCopyf(point,vel);
-   VecMulf(point,t0);
-   VecAddf(point,point,p1);
-   VecCopyf(temp,nor);
-   VecMulf(temp,radius);
- 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15607] trunk/blender/source/gameengine/ Converter: BGE patch: fix mesh deformation errors with duplicated objects sharing the same mesh in case of 1

2008-07-16 Thread Benoit Bolsee
Revision: 15607
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15607
Author:   ben2610
Date: 2008-07-16 23:24:54 +0200 (Wed, 16 Jul 2008)

Log Message:
---
BGE patch: fix mesh deformation errors with duplicated objects sharing the same 
mesh in case of 1) armature+multiple material 2) shape drivers

Modified Paths:
--
trunk/blender/source/gameengine/Converter/BL_ShapeDeformer.cpp
trunk/blender/source/gameengine/Converter/BL_SkinDeformer.cpp
trunk/blender/source/gameengine/Converter/BL_SkinDeformer.h

Modified: trunk/blender/source/gameengine/Converter/BL_ShapeDeformer.cpp
===
--- trunk/blender/source/gameengine/Converter/BL_ShapeDeformer.cpp  
2008-07-16 16:20:52 UTC (rev 15606)
+++ trunk/blender/source/gameengine/Converter/BL_ShapeDeformer.cpp  
2008-07-16 21:24:54 UTC (rev 15607)
@@ -109,6 +109,13 @@
vector::iterator it;
void *poin;
int type;
+   // the shape drivers use the bone matrix as input. Must 
+   // update the matrix now
+   Object* par_arma = m_armobj->GetArmatureObject();
+   m_armobj->ApplyPose();
+   where_is_pose( par_arma ); 
+   PoseApplied(true);
+
for (it=m_shapeDrivers.begin(); it!=m_shapeDrivers.end(); it++) 
{
// no need to set a specific time: this curve has a 
driver
IpoCurve *icu = *it;

Modified: trunk/blender/source/gameengine/Converter/BL_SkinDeformer.cpp
===
--- trunk/blender/source/gameengine/Converter/BL_SkinDeformer.cpp   
2008-07-16 16:20:52 UTC (rev 15606)
+++ trunk/blender/source/gameengine/Converter/BL_SkinDeformer.cpp   
2008-07-16 21:24:54 UTC (rev 15607)
@@ -66,7 +66,8 @@
m_armobj(arma),
m_lastArmaUpdate(-1),

m_defbase(&bmeshobj->defbase),
-   m_releaseobject(false)
+   m_releaseobject(false),
+   m_poseApplied(false)
 {
Mat4CpyMat4(m_obmat, bmeshobj->obmat);
 };
@@ -98,32 +99,28 @@
m_armobj->Release();
 }
 
-bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *)
+bool BL_SkinDeformer::Apply(RAS_IPolyMaterial *mat)
 {
size_t i, j;
 
-   if (!Update())
-   // no need to update the cache
-   return false;
+   // update the vertex in m_transverts
+   Update();
 
-   // Update all materials at once, so we can do the above update test
-   // without ending up with some materials not updated
-   for(RAS_MaterialBucket::Set::iterator mit = 
m_pMeshObject->GetFirstMaterial();
-   mit != m_pMeshObject->GetLastMaterial(); ++ mit) {
-   RAS_IPolyMaterial *mat = (*mit)->GetPolyMaterial();
+   // The vertex cache can only be updated for this deformer:
+   // Duplicated objects with more than one ploymaterial (=multiple mesh 
slot per object)
+   // share the same mesh (=the same cache). As the rendering is done per 
polymaterial
+   // cycling through the objects, the entire mesh cache cannot be updated 
in one shot.
+   vecVertexArray& vertexarrays = m_pMeshObject->GetVertexCache(mat);
 
-   vecVertexArray& vertexarrays = 
m_pMeshObject->GetVertexCache(mat);
+   // For each array
+   for (i=0; iGetArmatureObject();
-   where_is_pose( par_arma ); 
+   if (!PoseApplied()){
+   m_armobj->ApplyPose();
+   where_is_pose( par_arma ); 
+   }
 
/* store verts locally */
VerifyStorage();
@@ -180,7 +179,8 @@
 
/* Update the current frame */
m_lastArmaUpdate=m_armobj->GetLastFrame();
-   
+   /* reset for next frame */
+   PoseApplied(false);
/* indicate that the m_transverts and normals are up to date */
return true;
}

Modified: trunk/blender/source/gameengine/Converter/BL_SkinDeformer.h
===
--- trunk/blender/source/gameengine/Converter/BL_SkinDeformer.h 2008-07-16 
16:20:52 UTC (rev 15606)
+++ trunk/blender/source/gameengine/Converter/BL_SkinDeformer.h 2008-07-16 
21:24:54 UTC (rev 15607)
@@ -81,10 +81,13 @@
virtual ~BL_SkinDeformer();
bool Update (void);
bool Apply (class RAS_IPolyMaterial *polymat);
+   bool PoseApplied()
+   { return m_poseApplied; }
+   void PoseApplied(bool applied)
+   {

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15606] branches/apricot/source: Apricot: GLSL

2008-07-16 Thread Brecht Van Lommel
Revision: 15606
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15606
Author:   blendix
Date: 2008-07-16 18:20:52 +0200 (Wed, 16 Jul 2008)

Log Message:
---
Apricot: GLSL
=

* Moved GLSL setting switching functions into the game engine
  python API so they work in the blender player, and can do
  better state switching.
* Also fixes bug #17331, error compiling with cmake.

* For the makers of test builds: it would be great if builds of
  this revision or newer for various platforms could be made
  available. We want to release a file to test and benchmark
  GLSL on different graphics cards, and we need test builds for
  this. Thanks!

Modified Paths:
--
branches/apricot/source/blender/python/SConscript
branches/apricot/source/blender/python/api2_2x/Blender.c
branches/apricot/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
branches/apricot/source/gameengine/GamePlayer/ActiveX/BlenderPlayerCtl.cpp
branches/apricot/source/gameengine/GamePlayer/ghost/GPG_Application.cpp

branches/apricot/source/gameengine/GamePlayer/netscape/src/ketsji/KXH_ketsji_hooks.cpp
branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp
branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.h
branches/apricot/source/gameengine/Ketsji/KX_PythonInit.cpp
branches/apricot/source/gameengine/Ketsji/KX_PythonInit.h
branches/apricot/source/gameengine/PyDoc/Rasterizer.py

Modified: branches/apricot/source/blender/python/SConscript
===
--- branches/apricot/source/blender/python/SConscript   2008-07-16 15:44:47 UTC 
(rev 15605)
+++ branches/apricot/source/blender/python/SConscript   2008-07-16 16:20:52 UTC 
(rev 15606)
@@ -6,7 +6,7 @@
 incs = 'api2_2x ../blenkernel ../nodes ../blenlib ../blenloader'
 incs += ' ../render/extern/include ../radiosity/extern/include'
 incs += ' ../makesdna #intern/guardedalloc #intern/bmfont ../imbuf ../include'
-incs += ' #extern/glew/include ../gpu'
+incs += ' #extern/glew/include'
 incs += ' ' + env['BF_PYTHON_INC']
 incs += ' ' + env['BF_OPENGL_INC']
 

Modified: branches/apricot/source/blender/python/api2_2x/Blender.c
===
--- branches/apricot/source/blender/python/api2_2x/Blender.c2008-07-16 
15:44:47 UTC (rev 15605)
+++ branches/apricot/source/blender/python/api2_2x/Blender.c2008-07-16 
16:20:52 UTC (rev 15606)
@@ -56,7 +56,6 @@
 #include "DNA_screen_types.h"  /* for SPACE_VIEW3D */
 #include "DNA_userdef_types.h"
 #include "DNA_packedFile_types.h"
-#include "GPU_material.h"
 #include "EXPP_interface.h" /* for bpy_gethome() */
 #include "gen_utils.h"
 #include "modules.h"
@@ -316,41 +315,7 @@
U.gameflags |= USER_DISABLE_MIPMAP;

set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
-   } 
-   else if(StringEqual( name, "glsl_lights" ) ||
-   StringEqual( name, "glsl_shaders" ) ||
-   StringEqual( name, "glsl_shadows" ) ||
-   StringEqual( name, "glsl_ramps" ) ||
-   StringEqual( name, "glsl_nodes" ) ||
-   StringEqual( name, "glsl_extra_textures" )) {
-
-   int value = PyObject_IsTrue( arg );
-   int flag = 0;
-   
-   if (value==-1)
-   return EXPP_ReturnPyObjError( PyExc_ValueError,
-   "expected an integer" );
-   
-   if(StringEqual( name, "glsl_lights" ))
-   flag = G_FILE_GLSL_NO_LIGHTS;
-   else if(StringEqual( name, "glsl_shaders" ))
-   flag = G_FILE_GLSL_NO_SHADERS;
-   else if(StringEqual( name, "glsl_shadows" ))
-   flag = G_FILE_GLSL_NO_SHADOWS;
-   else if(StringEqual( name, "glsl_ramps" ))
-   flag = G_FILE_GLSL_NO_RAMPS;
-   else if(StringEqual( name, "glsl_nodes" ))
-   flag = G_FILE_GLSL_NO_NODES;
-   else if(StringEqual( name, "glsl_extra_textures" ))
-   flag = G_FILE_GLSL_NO_EXTRA_TEX;
-
-   if (value)
-   G.fileflags &= ~flag;
-   else
-   G.fileflags |= flag;
-
-   GPU_materials_free();
-   }else
+   } else
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
"value given is not a blender 
setting" ) );
Py_RETURN_NONE;
@@ -597,18 +562,6 @@
ret = PyInt_FromLong( (U.flag & USER_FILECOMPRESS) >> 15  );
else if(StringEqual( str, "mipmap" ))
ret = PyInt_FromLong( (U.gameflags & USER_DISABLE_MIPMAP)!=0  );
-   else if(StringEqual( str, "glsl_lights" ))
-   ret = PyInt_FromLong( (G.f

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15605] branches/soc-2007-hcube: Added soundsystem to intern solution.

2008-07-16 Thread Robert Holcomb
Revision: 15605
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15605
Author:   scourage
Date: 2008-07-16 17:44:47 +0200 (Wed, 16 Jul 2008)

Log Message:
---
Added soundsystem to intern solution.  Added tinySDN to external solution. 
Removed existing sound projects from internal solution.

Modified Paths:
--
branches/soc-2007-hcube/extern/make/msvc_7_0/extern.sln
branches/soc-2007-hcube/intern/make/msvc_7_0/intern.sln
branches/soc-2007-hcube/intern/soundsystem/SND_file.cpp
branches/soc-2007-hcube/intern/soundsystem/SND_soundattrs.cpp

Added Paths:
---
branches/soc-2007-hcube/extern/tinySND/make/
branches/soc-2007-hcube/extern/tinySND/make/msvc_7_0/
branches/soc-2007-hcube/extern/tinySND/make/msvc_7_0/tinySND.vcproj
branches/soc-2007-hcube/intern/soundsystem/make/
branches/soc-2007-hcube/intern/soundsystem/make/msvc_7_0/
branches/soc-2007-hcube/intern/soundsystem/make/msvc_7_0/soundsystem.vcproj

Modified: branches/soc-2007-hcube/extern/make/msvc_7_0/extern.sln
===
--- branches/soc-2007-hcube/extern/make/msvc_7_0/extern.sln 2008-07-16 
15:41:39 UTC (rev 15604)
+++ branches/soc-2007-hcube/extern/make/msvc_7_0/extern.sln 2008-07-16 
15:44:47 UTC (rev 15605)
@@ -51,6 +51,10 @@
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySND", 
"..\..\tinySND\make\msvc_7_0\tinySND.vcproj", 
"{E223848A-715C-4DA0-B507-E457E8763E20}"
+   ProjectSection(ProjectDependencies) = postProject
+   EndProjectSection
+EndProject
 Global
GlobalSection(SolutionConfiguration) = preSolution
3D Plugin Debug = 3D Plugin Debug
@@ -237,6 +241,22 @@
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Debug.Build.0 = Blender 
Debug|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Release.ActiveCfg = 
Blender Release|Win32
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A}.Release.Build.0 = 
Blender Release|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.3D Plugin 
Debug.ActiveCfg = Debug|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.3D Plugin Debug.Build.0 
= Debug|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.3D Plugin 
Release.ActiveCfg = Release|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.3D Plugin 
Release.Build.0 = Release|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.Blender Debug.ActiveCfg 
= Blender Debug|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.Blender Debug.Build.0 = 
Blender Debug|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.Blender 
Release.ActiveCfg = Blender Release|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.Blender Release.Build.0 
= Blender Release|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.BlenderPlayer 
Debug.ActiveCfg = Debug|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.BlenderPlayer 
Debug.Build.0 = Debug|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.BlenderPlayer 
Release.ActiveCfg = Release|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.BlenderPlayer 
Release.Build.0 = Release|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.Debug.ActiveCfg = 
Debug|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.Debug.Build.0 = 
Debug|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.Release.ActiveCfg = 
Release|Win32
+   {E223848A-715C-4DA0-B507-E457E8763E20}.Release.Build.0 = 
Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection

Added: branches/soc-2007-hcube/extern/tinySND/make/msvc_7_0/tinySND.vcproj
===
--- branches/soc-2007-hcube/extern/tinySND/make/msvc_7_0/tinySND.vcproj 
(rev 0)
+++ branches/soc-2007-hcube/extern/tinySND/make/msvc_7_0/tinySND.vcproj 
2008-07-16 15:44:47 UTC (rev 15605)
@@ -0,0 +1,319 @@
+
+
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   
+ 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15604] trunk/lib/windows: Added for sound integration.

2008-07-16 Thread Robert Holcomb
Revision: 15604
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15604
Author:   scourage
Date: 2008-07-16 17:41:39 +0200 (Wed, 16 Jul 2008)

Log Message:
---
Added for sound integration.  PortAudio backend to be added as well when I get 
a windows build done.

Added Paths:
---
trunk/lib/windows/samplerate/
trunk/lib/windows/samplerate/include/
trunk/lib/windows/samplerate/include/samplerate.h
trunk/lib/windows/samplerate/lib/
trunk/lib/windows/samplerate/lib/libsamplerate.dll
trunk/lib/windows/samplerate/lib/libsamplerate.exp
trunk/lib/windows/samplerate/lib/libsamplerate.lib
trunk/lib/windows/sndfile/
trunk/lib/windows/sndfile/include/
trunk/lib/windows/sndfile/include/sndfile.h
trunk/lib/windows/sndfile/lib/
trunk/lib/windows/sndfile/lib/libsndfile-1.def
trunk/lib/windows/sndfile/lib/libsndfile-1.dll
trunk/lib/windows/sndfile/lib/libsndfile-1.exp
trunk/lib/windows/sndfile/lib/libsndfile-1.lib

Added: trunk/lib/windows/samplerate/include/samplerate.h
===
--- trunk/lib/windows/samplerate/include/samplerate.h   
(rev 0)
+++ trunk/lib/windows/samplerate/include/samplerate.h   2008-07-16 15:41:39 UTC 
(rev 15604)
@@ -0,0 +1,196 @@
+/*
+** Copyright (C) 2002-2004 Erik de Castro Lopo <[EMAIL PROTECTED]>
+**
+** 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+/*
+** API documentation is available here:
+** http://www.mega-nerd.com/SRC/api.html
+*/
+
+#ifndef SAMPLERATE_H
+#define SAMPLERATE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Opaque data type SRC_STATE. */
+typedef struct SRC_STATE_tag SRC_STATE ;
+
+/* SRC_DATA is used to pass data to src_simple() and src_process(). */
+typedef struct
+{  float   *data_in, *data_out ;
+
+   longinput_frames, output_frames ;
+   longinput_frames_used, output_frames_gen ;
+
+   int end_of_input ;
+
+   double  src_ratio ;
+} SRC_DATA ;
+
+/* SRC_CB_DATA is used with callback based API. */
+typedef struct
+{  longframes ;
+   float   *data_in ;
+} SRC_CB_DATA ;
+
+/*
+** User supplied callback function type for use with src_callback_new()
+** and src_callback_read(). First parameter is the same pointer that was
+** passed into src_callback_new(). Second parameter is pointer to a
+** pointer. The user supplied callback function must modify *data to
+** point to the start of the user supplied float array. The user supplied
+** function must return the number of frames that **data points to.
+*/
+
+typedef long (*src_callback_t) (void *cb_data, float **data) ;
+
+/*
+** Standard initialisation function : return an anonymous pointer to the
+** internal state of the converter. Choose a converter from the enums 
below.
+** Error returned in *error.
+*/
+
+SRC_STATE* src_new (int converter_type, int channels, int *error) ;
+
+/*
+** Initilisation for callback based API : return an anonymous pointer to 
the
+** internal state of the converter. Choose a converter from the enums 
below.
+** The cb_data pointer can point to any data or be set to NULL. Whatever 
the
+** value, when processing, user supplied function "func" gets called with
+** cb_data as first parameter.
+*/
+
+SRC_STATE* src_callback_new (src_callback_t func, int converter_type, int 
channels,
+   int *error, void* cb_data) ;
+
+/*
+** Cleanup all internal allocations.
+** Always returns NULL.
+*/
+
+SRC_STATE* src_delete (SRC_STATE *state) ;
+
+/*
+** Standard processing function.
+** Returns non zero on error.
+*/
+
+int src_process (SRC_STATE *state, SRC_DATA *data) ;
+
+/*
+** Callback based processing function. Read up to frames worth of data from
+** the converter int *data and return frames read or -1 on error.
+*/
+long src_callback_read (SRC_STATE *state, double src_ratio, long frames, float 
*data) ;
+
+/*
+** Simple interface for performing a single conversion from input buffer to
+** output buffer at a fixed conversion ratio.
+** Simple interface does not require initialisation as it can only operate 
on
+** a single buffer worth of audio.
+

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15603] branches/apricot/source: Apricot Branch

2008-07-16 Thread Brecht Van Lommel
Revision: 15603
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15603
Author:   blendix
Date: 2008-07-16 15:53:39 +0200 (Wed, 16 Jul 2008)

Log Message:
---
Apricot Branch
==

Fix for bug #17326: normal and tangents in the game engine
were computed different than other parts of Blender, this
makes the game engine use the same code as Blender.

Fix for part of bug #17307: normal maps not working correct
in editmode in some cases.

Fix for bug #17339: a crash on ATI cards in glTexSubImage1D
due to a mistake in the code. A patch to fix this was provided
by Yong Ch, thanks!

Modified Paths:
--
branches/apricot/source/blender/blenkernel/BKE_DerivedMesh.h
branches/apricot/source/blender/blenkernel/intern/DerivedMesh.c
branches/apricot/source/blender/gpu/intern/gpu_codegen.c
branches/apricot/source/blender/gpu/intern/gpu_extensions.c
branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp

Modified: branches/apricot/source/blender/blenkernel/BKE_DerivedMesh.h
===
--- branches/apricot/source/blender/blenkernel/BKE_DerivedMesh.h
2008-07-16 13:47:03 UTC (rev 15602)
+++ branches/apricot/source/blender/blenkernel/BKE_DerivedMesh.h
2008-07-16 13:53:39 UTC (rev 15603)
@@ -483,5 +483,7 @@
 void DM_vertex_attributes_from_gpu(DerivedMesh *dm,
struct GPUVertexAttribs *gattribs, DMVertexAttribs *attribs);
 
+void DM_add_tangent_layer(DerivedMesh *dm);
+
 #endif
 

Modified: branches/apricot/source/blender/blenkernel/intern/DerivedMesh.c
===
--- branches/apricot/source/blender/blenkernel/intern/DerivedMesh.c 
2008-07-16 13:47:03 UTC (rev 15602)
+++ branches/apricot/source/blender/blenkernel/intern/DerivedMesh.c 
2008-07-16 13:53:39 UTC (rev 15603)
@@ -1252,6 +1252,43 @@
}
 }
 
+static void *emDM_getFaceDataArray(DerivedMesh *dm, int type)
+{
+   EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
+   EditMesh *em= emdm->em;
+   EditFace *efa;
+   char *data, *emdata;
+   void *datalayer;
+   int index, offset, size;
+
+   datalayer = DM_get_face_data_layer(dm, type);
+   if(datalayer)
+   return datalayer;
+
+   /* layers are store per face for editmesh, we convert to a temporary
+* data layer array in the derivedmesh when these are requested */
+   if(type == CD_MTFACE || type == CD_MCOL) {
+   index = CustomData_get_layer_index(&em->fdata, type);
+
+   if(index != -1) {
+   offset = em->fdata.layers[index].offset;
+   size = CustomData_sizeof(type);
+
+   DM_add_face_layer(dm, type, CD_CALLOC, NULL);
+   index = CustomData_get_layer_index(&dm->faceData, type);
+   dm->faceData.layers[index].flag |= CD_FLAG_TEMPORARY;
+
+   data = datalayer = DM_get_face_data_layer(dm, type);
+   for(efa=em->faces.first; efa; efa=efa->next, 
data+=size) {
+   emdata = CustomData_em_get(&em->fdata, 
efa->data, type);
+   memcpy(data, emdata, size);
+   }
+   }
+   }
+
+   return datalayer;
+}
+
 static void emDM_release(DerivedMesh *dm)
 {
EditMeshDerivedMesh *emdm= (EditMeshDerivedMesh*) dm;
@@ -1287,6 +1324,7 @@
emdm->dm.copyVertArray = emDM_copyVertArray;
emdm->dm.copyEdgeArray = emDM_copyEdgeArray;
emdm->dm.copyFaceArray = emDM_copyFaceArray;
+   emdm->dm.getFaceDataArray = emDM_getFaceDataArray;
 
emdm->dm.foreachMappedVert = emDM_foreachMappedVert;
emdm->dm.foreachMappedEdge = emDM_foreachMappedEdge;
@@ -3079,7 +3117,7 @@
 
 /* *** GLSL  */
 
-static void DM_add_tangent_layer(DerivedMesh *dm)
+void DM_add_tangent_layer(DerivedMesh *dm)
 {
/* mesh vars */
MTFace *mtface, *tf;

Modified: branches/apricot/source/blender/gpu/intern/gpu_codegen.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-16 
13:47:03 UTC (rev 15602)
+++ branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-16 
13:53:39 UTC (rev 15603)
@@ -965,11 +965,11 @@
input->textype = type;
 
if (type == GPU_TEX1D) {
-   input->tex = GPU_texture_create_1D(link->texturesize, 
link->ptr1, 1);
+   input->tex = GPU_texture_create_1D(link->texturesize, 
link->ptr1, 0);
input->textarget = GL_TEXTURE_1D;
}
else {
-   input->tex = GPU_texture_create_2D(link->texturesize, 
link->texturesize, link->ptr2, 1);
+   inp

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15602] trunk/blender/source/blender/ blenlib/intern/arithb.c:

2008-07-16 Thread Brecht Van Lommel
Revision: 15602
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15602
Author:   blendix
Date: 2008-07-16 15:47:03 +0200 (Wed, 16 Jul 2008)

Log Message:
---

Bugfix: particles with deflection based on size could pass through
objects due to a broken SweepingSphereIntersectsTriangleUV. This
merges the code from the shrinkwrap branch by Andr?\195?\169 Pinto, thanks!

Modified Paths:
--
trunk/blender/source/blender/blenlib/intern/arithb.c

Modified: trunk/blender/source/blender/blenlib/intern/arithb.c
===
--- trunk/blender/source/blender/blenlib/intern/arithb.c2008-07-16 
12:56:23 UTC (rev 15601)
+++ trunk/blender/source/blender/blenlib/intern/arithb.c2008-07-16 
13:47:03 UTC (rev 15602)
@@ -60,6 +60,7 @@
 #define SMALL_NUMBER   1.e-8
 #define ABS(x) ((x) < 0 ? -(x) : (x))
 #define SWAP(type, a, b)   { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
+#define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)
 
 
 #if defined(WIN32) || defined(__APPLE__)
@@ -3800,12 +3801,50 @@
 
 /* Adapted from the paper by Kasper Fauerby */
 /* "Improved Collision detection and Response" */
+static int getLowestRoot(float a, float b, float c, float maxR, float* root)
+{
+   // Check if a solution exists
+   float determinant = b*b - 4.0f*a*c;
+
+   // If determinant is negative it means no solutions.
+   if (determinant >= 0.0f)
+   {
+   // calculate the two roots: (if determinant == 0 then
+   // x1==x2 but let’s disregard that slight optimization)
+   float sqrtD = sqrt(determinant);
+   float r1 = (-b - sqrtD) / (2.0f*a);
+   float r2 = (-b + sqrtD) / (2.0f*a);
+   
+   // Sort so x1 <= x2
+   if (r1 > r2)
+   SWAP( float, r1, r2);
+
+   // Get lowest root:
+   if (r1 > 0.0f && r1 < maxR)
+   {
+   *root = r1;
+   return 1;
+   }
+
+   // It is possible that we want x2 - this can happen
+   // if x1 < 0
+   if (r2 > 0.0f && r2 < maxR)
+   {
+   *root = r2;
+   return 1;
+   }
+   }
+   // No (valid) solutions
+   return 0;
+}
+
 int SweepingSphereIntersectsTriangleUV(float p1[3], float p2[3], float radius, 
float v0[3], float v1[3], float v2[3], float *lambda, float *ipoint)
 {
float e1[3], e2[3], e3[3], point[3], vel[3], /*dist[3],*/ nor[3], 
temp[3], bv[3];
-   float a, b, c, d, e, x, y, z, t, t0, t1, radius2=radius*radius;
+   float a, b, c, d, e, x, y, z, radius2=radius*radius;
float elen2,edotv,edotbv,nordotv,vel2;
-   int embedded_in_plane=0, found_by_sweep=0;
+   float newLambda;
+   int found_by_sweep=0;
 
VecSubf(e1,v1,v0);
VecSubf(e2,v2,v0);
@@ -3814,45 +3853,42 @@
 /*---test plane of tri---*/
Crossf(nor,e1,e2);
Normalize(nor);
+
/* flip normal */
if(Inpf(nor,vel)>0.0f) VecMulf(nor,-1.0f);

a=Inpf(p1,nor)-Inpf(v0,nor);
-
nordotv=Inpf(nor,vel);
 
-   if ((nordotv > -0.01) && (nordotv < 0.01)) {
-   if(fabs(a)>=1.0f)
+   if (fabs(nordotv) < 0.01)
+   {
+   if(fabs(a)>=radius)
+   {
return 0;
-   else{
-   embedded_in_plane=1;
-   t0=0.0f;
-   t1=1.0f;
}
}
-   else{
-   t0=(radius-a)/nordotv;
-   t1=(-radius-a)/nordotv;
-   /* make t0t1){b=t1; t1=t0; t0=b;}
+   else
+   {
+   float t0=(-a+radius)/nordotv;
+   float t1=(-a-radius)/nordotv;
 
+   if(t0>t1)
+   SWAP(float, t0, t1);
+
if(t0>1.0f || t1<0.0f) return 0;
 
/* clamp to [0,1] */
-   t0=(t0<0.0f)?0.0f:((t0>1.0f)?1.0:t0);
-   t1=(t1<0.0f)?0.0f:((t1>1.0f)?1.0:t1);
-   }
+   CLAMP(t0, 0.0f, 1.0f);
+   CLAMP(t1, 0.0f, 1.0f);
 
-/*---test inside of tri---*/
-   if(embedded_in_plane==0){
+   /*---test inside of tri---*/
/* plane intersection point */
-   VecCopyf(point,vel);
-   VecMulf(point,t0);
-   VecAddf(point,point,p1);
-   VecCopyf(temp,nor);
-   VecMulf(temp,radius);
-   VecSubf(point,point,temp);
 
+   point[0] = p1[0] + vel[0]*t0 - nor[0]*radius;
+   point[1] = p1[1] + vel[1]*t0 - nor[1]*radius;
+   point[2] = p1[2] + vel[2]*t0 - nor[2]*radius;
+
+
/* is the point in the tri? */
a=Inpf(e1,e1);
b=In

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15601] branches/soc-2008-quorn/release/ scripts: Fixed error when scripts were run without a visible Text to work on.

2008-07-16 Thread Ian Thompson
Revision: 15601
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15601
Author:   quorn
Date: 2008-07-16 14:56:23 +0200 (Wed, 16 Jul 2008)

Log Message:
---
Fixed error when scripts were run without a visible Text to work on.

Modified Paths:
--
branches/soc-2008-quorn/release/scripts/textplugin_imports.py
branches/soc-2008-quorn/release/scripts/textplugin_membersuggest.py
branches/soc-2008-quorn/release/scripts/textplugin_suggest.py

Modified: branches/soc-2008-quorn/release/scripts/textplugin_imports.py
===
--- branches/soc-2008-quorn/release/scripts/textplugin_imports.py   
2008-07-16 11:48:55 UTC (rev 15600)
+++ branches/soc-2008-quorn/release/scripts/textplugin_imports.py   
2008-07-16 12:56:23 UTC (rev 15601)
@@ -18,6 +18,9 @@
 
 def main():
txt = bpy.data.texts.active
+   if not txt:
+   return
+   
line, c = current_line(txt)

# Check we are in a normal context

Modified: branches/soc-2008-quorn/release/scripts/textplugin_membersuggest.py
===
--- branches/soc-2008-quorn/release/scripts/textplugin_membersuggest.py 
2008-07-16 11:48:55 UTC (rev 15600)
+++ branches/soc-2008-quorn/release/scripts/textplugin_membersuggest.py 
2008-07-16 12:56:23 UTC (rev 15601)
@@ -18,6 +18,9 @@
 
 def main():
txt = bpy.data.texts.active
+   if not txt:
+   return
+   
(line, c) = current_line(txt)

# Check we are in a normal context

Modified: branches/soc-2008-quorn/release/scripts/textplugin_suggest.py
===
--- branches/soc-2008-quorn/release/scripts/textplugin_suggest.py   
2008-07-16 11:48:55 UTC (rev 15600)
+++ branches/soc-2008-quorn/release/scripts/textplugin_suggest.py   
2008-07-16 12:56:23 UTC (rev 15601)
@@ -33,6 +33,9 @@
 
 def main():
txt = bpy.data.texts.active
+   if not txt:
+   return
+   
(line, c) = current_line(txt)

# Check we are in a normal context


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


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15600] trunk/blender/source/blender/src: * change active face behavior so that entering editmode will assign the first face as active when none is se

2008-07-16 Thread Campbell Barton
Revision: 15600
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15600
Author:   campbellbarton
Date: 2008-07-16 13:48:55 +0200 (Wed, 16 Jul 2008)

Log Message:
---
* change active face behavior so that entering editmode will assign the first 
face as active when none is set. UnSetting the active face will also use the 
first face as active.
* missing countall when selecting linked

Modified Paths:
--
trunk/blender/source/blender/src/editmesh.c
trunk/blender/source/blender/src/editmesh_lib.c
trunk/blender/source/blender/src/editobject.c

Modified: trunk/blender/source/blender/src/editmesh.c
===
--- trunk/blender/source/blender/src/editmesh.c 2008-07-16 10:33:48 UTC (rev 
15599)
+++ trunk/blender/source/blender/src/editmesh.c 2008-07-16 11:48:55 UTC (rev 
15600)
@@ -1059,7 +1059,11 @@
EM_hide_reset();
/* sets helper flags which arent saved */
EM_fgon_flags();
-
+   
+   if (EM_get_actFace(0)==NULL) {
+   EM_set_actFace(NULL); /* will use the first face, this is so we 
alwats have an active face */
+   }
+   
/* vertex coordinates change with cache edit, need to recalc */
if(cacheedit)
recalc_editnormals();

Modified: trunk/blender/source/blender/src/editmesh_lib.c
===
--- trunk/blender/source/blender/src/editmesh_lib.c 2008-07-16 10:33:48 UTC 
(rev 15599)
+++ trunk/blender/source/blender/src/editmesh_lib.c 2008-07-16 11:48:55 UTC 
(rev 15600)
@@ -72,7 +72,12 @@
 /* this replaces the active flag used in uv/face mode */
 void EM_set_actFace(EditFace *efa)
 {
-   G.editMesh->act_face = efa;
+   if (efa) {
+   G.editMesh->act_face = efa;
+   } else {
+   /* True or NULL if we have no faces, so we always have an 
active face */
+   G.editMesh->act_face = G.editMesh->faces.first;
+   }
 }
 
 EditFace * EM_get_actFace(int sloppy)

Modified: trunk/blender/source/blender/src/editobject.c
===
--- trunk/blender/source/blender/src/editobject.c   2008-07-16 10:33:48 UTC 
(rev 15599)
+++ trunk/blender/source/blender/src/editobject.c   2008-07-16 11:48:55 UTC 
(rev 15600)
@@ -5505,6 +5505,7 @@
allqueue(REDRAWDATASELECT, 0);
allqueue(REDRAWOOPS, 0);
BIF_undo_push("Select linked");
+   countall();
}
 }
 


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


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15599] branches/soc-2008-quorn/release/ scripts: Previously relying on import to run scripts didn' t work every time and was not the right way to do

2008-07-16 Thread Ian Thompson
Revision: 15599
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15599
Author:   quorn
Date: 2008-07-16 12:33:48 +0200 (Wed, 16 Jul 2008)

Log Message:
---
Previously relying on import to run scripts didn't work every time and was not 
the right way to do it. Also fixed a problem with 'import *' not working and 
added the sys.modules list to the import suggestion list with a timed update.

Modified Paths:
--
branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py
branches/soc-2008-quorn/release/scripts/textplugin_imports.py
branches/soc-2008-quorn/release/scripts/textplugin_membersuggest.py
branches/soc-2008-quorn/release/scripts/textplugin_suggest.py

Modified: branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py
===
--- branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py 
2008-07-16 08:10:23 UTC (rev 15598)
+++ branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py 
2008-07-16 10:33:48 UTC (rev 15599)
@@ -1,10 +1,10 @@
-import bpy
+import bpy, sys
 import __builtin__, tokenize
 from Blender.sys import time
 from tokenize import generate_tokens, TokenError
-# TODO: Remove the dependency for a full Python installation. Currently only 
the
-# tokenize module is required 
 
+# TODO: Remove the dependency for a full Python installation.
+
 # Context types
 NORMAL = 0
 SINGLE_QUOTE = 1
@@ -22,6 +22,23 @@
 _token_cache = None
 _cache_update = 0
 
+ModuleType = type(__builtin__)
+_modules = dict([(n, None) for n in sys.builtin_module_names])
+_modules_updated = 0
+
+def get_modules(since=1):
+   """Returns the set of built-in modules and any modules that have been
+   imported into the system upto 'since' seconds ago.
+   """
+   
+   global _modules, _modules_updated
+   
+   t = time()
+   if _modules_updated < t - since:
+   _modules.update(sys.modules)
+   _modules_updated = t
+   return _modules.keys()
+
 def suggest_cmp(x, y):
"""Use this method when sorting a list of suggestions.
"""
@@ -35,10 +52,11 @@

global _token_cache, _cache_update

-   if _cache_update < time() - since:
+   t = time()
+   if _cache_update < t - since:
txt.reset()
_token_cache = [g for g in generate_tokens(txt.readline)]
-   _cache_update = time()
+   _cache_update = t
return _token_cache
 
 def get_module(name):
@@ -52,12 +70,6 @@
mod = getattr(mod, comp)
return mod
 
-def is_module(m):
-   """Taken from the inspect module of the standard Python installation.
-   """
-   
-   return isinstance(m, type(bpy))
-
 def type_char(v):
"""Returns the character used to signify the type of a variable. Use 
this
method to identify the type character for an item in a suggestion list.
@@ -68,7 +80,7 @@
  'v' if the parameter is variable or otherwise indeterminable
"""

-   if is_module(v):
+   if isinstance(v, ModuleType):
return 'm'
elif callable(v):
return 'f'
@@ -215,7 +227,7 @@
if string == 'as':
impname = '.'.join(tmp)
step = 3
-   elif type == tokenize.NAME:
+   elif type == tokenize.NAME or string == '*':
tmp.append(string)
elif string != '.':
impname = '.'.join(tmp)

Modified: branches/soc-2008-quorn/release/scripts/textplugin_imports.py
===
--- branches/soc-2008-quorn/release/scripts/textplugin_imports.py   
2008-07-16 08:10:23 UTC (rev 15598)
+++ branches/soc-2008-quorn/release/scripts/textplugin_imports.py   
2008-07-16 10:33:48 UTC (rev 15599)
@@ -31,13 +31,13 @@
# Check instead for straight 'import'
pos2 = line.rfind('import ', 0, c)
if pos2 != -1 and (pos2 == c-7 or (pos2 < c-7 and 
line[c-2]==',')):
-   items = [(m, 'm') for m in sys.builtin_module_names]
+   items = [(m, 'm') for m in get_modules()]
items.sort(cmp = suggest_cmp)
txt.suggest(items, '')

# Immediate 'from' before cursor
elif pos == c-5:
-   items = [(m, 'm') for m in sys.builtin_module_names]
+   items = [(m, 'm') for m in get_modules()]
items.sort(cmp = suggest_cmp)
txt.suggest(items, '')

@@ -60,12 +60,10 @@

items = [('*', 'k')]
for (k,v) in mod.__dict__.items():
-  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15598] trunk/blender/source/blender/ render/intern/source/rendercore.c: Bug Fix #17337, now atmosphere works correctly with FSA enabled

2008-07-16 Thread Hamed Zaghaghi
Revision: 15598
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15598
Author:   zaghaghi
Date: 2008-07-16 10:10:23 +0200 (Wed, 16 Jul 2008)

Log Message:
---
Bug Fix #17337, now atmosphere works correctly with FSA enabled

Modified Paths:
--
trunk/blender/source/blender/render/intern/source/rendercore.c

Modified: trunk/blender/source/blender/render/intern/source/rendercore.c
===
--- trunk/blender/source/blender/render/intern/source/rendercore.c  
2008-07-16 07:10:33 UTC (rev 15597)
+++ trunk/blender/source/blender/render/intern/source/rendercore.c  
2008-07-16 08:10:23 UTC (rev 15598)
@@ -671,8 +671,10 @@
RenderPass *zpass;
GroupObject *go;
LampRen *lar;
-   
-   int x, y;
+   RenderLayer *rlpp[RE_MAX_OSA];
+
+   int totsample, fullsample, sample;
+   int x, y,od;
short first_lamp;
float *zrect;
float *rgbrect;
@@ -683,7 +685,10 @@

fac = 0.5;
facm = 1.0 - fac;
-   
+
+   totsample= get_sample_layers(pa, rl, rlpp);
+   fullsample= (totsample > 1);
+
/* check that z pass is enabled */
if(pa->rectz==NULL) return;
for(zpass= rl->passes.first; zpass; zpass= zpass->next)
@@ -708,9 +713,10 @@

zrect = zpass->rect;
rgbrect = rl->rectf;
+   od=0;
/* for each x,y and sun lamp*/
for(y=pa->disprect.ymin; ydisprect.ymax; y++) {
-   for(x=pa->disprect.xmin; xdisprect.xmax; x++, zrect++, 
rgbrect+=4) {
+   for(x=pa->disprect.xmin; xdisprect.xmax; x++, zrect++, 
od++) {

first_lamp = 1;
for(go=R.lights.first; go; go= go->next) {
@@ -724,7 +730,7 @@
}
 
if(lar->sunsky->effect_type & 
LA_SUN_EFFECT_AP){
-   VECCOPY(tmp_rgb, rgbrect);
+   VECCOPY(tmp_rgb, 
(float*)(rgbrect+4*od));
 
shadeAtmPixel(lar->sunsky, 
tmp_rgb, x, y, *zrect);

@@ -743,7 +749,16 @@
 
/* if at least for one sun lamp aerial perspective was 
applied*/
if(first_lamp==0)
-   VECCOPY(rgbrect, rgb);
+   {
+   if(fullsample) {
+   for(sample=0; samplerectf + od*4), rgb);
+   }
+   }
+   else {
+   VECCOPY((float*)(rgbrect+4*od), rgb);
+   }
+   }
}
}
 }


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


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15597] branches/apricot/source: svn merge -r15566:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender

2008-07-16 Thread Campbell Barton
Revision: 15597
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15597
Author:   campbellbarton
Date: 2008-07-16 09:10:33 +0200 (Wed, 16 Jul 2008)

Log Message:
---
svn merge -r15566:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--
branches/apricot/source/blender/src/buttons_scene.c
branches/apricot/source/blender/src/transform_conversions.c
branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp
branches/apricot/source/gameengine/Ketsji/KX_GameObject.h
branches/apricot/source/gameengine/Ketsji/KX_NearSensor.cpp
branches/apricot/source/gameengine/Ketsji/KX_RadarSensor.cpp
branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp
branches/apricot/source/gameengine/Ketsji/KX_Scene.h
branches/apricot/source/gameengine/Rasterizer/Makefile

Modified: branches/apricot/source/blender/src/buttons_scene.c
===
--- branches/apricot/source/blender/src/buttons_scene.c 2008-07-16 05:50:54 UTC 
(rev 15596)
+++ branches/apricot/source/blender/src/buttons_scene.c 2008-07-16 07:10:33 UTC 
(rev 15597)
@@ -137,36 +137,42 @@
bSample *sample, *newsample;
 
sound = G.buts->lockpoin;
+   
+   /* No Sound or Selected the same sample as we alredy have, just ignore 
*/
+   if (sound==NULL || str==sound->name)
+   return;
+   
+   if (sizeof(sound->sample->name) < strlen(str)) {
+   error("Path too long: %s", str);
+   return;
+   }
+   
+   // save values
+   sample = sound->sample;
+   strcpy(name, sound->sample->name);  
+   strcpy(sound->name, str);
+   sound_set_sample(sound, NULL);
+   sound_initialize_sample(sound);
 
-   if (sound) {
-   // save values
-   sample = sound->sample;
-   strcpy(name, sound->sample->name);
+   if (sound->sample->type == SAMPLE_INVALID) {
+   error("Not a valid sample: %s", str);
 
-   strcpy(sound->name, str);
-   sound_set_sample(sound, NULL);
-   sound_initialize_sample(sound);
+   newsample = sound->sample;
 
-   if (sound->sample->type == SAMPLE_INVALID) {
-   error("Not a valid sample: %s", str);
+   // restore values
+   strcpy(sound->name, name);
+   sound_set_sample(sound, sample);
 
-   newsample = sound->sample;
+   // remove invalid sample
 
-   // restore values
-   strcpy(sound->name, name);
-   sound_set_sample(sound, sample);
-
-   // remove invalid sample
-
-   sound_free_sample(newsample);
-   BLI_remlink(samples, newsample);
-   MEM_freeN(newsample);
-   }
+   sound_free_sample(newsample);
+   BLI_remlink(samples, newsample);
+   MEM_freeN(newsample);
+   return;
}
-
+   
BIF_undo_push("Load new audio file");
allqueue(REDRAWBUTSSCENE, 0);
-
 }
 
 
@@ -403,7 +409,7 @@
sample = sound->sample;
 
/* info string */
-   if (sound->sample && sound->sample->len) {
+   if (sound->sample && sound->sample->len && 
sound->sample->channels && sound->sample->bits) {
char *tmp;
if (sound->sample->channels == 1) tmp= "Mono";
else if (sound->sample->channels == 2) tmp= "Stereo";
@@ -1174,18 +1180,18 @@
 130,140,120,19, &last_seq->flag, 
 0.0, 21.0, 100, 0, 
 "Use a custom directory to store data");
-   }
 
-   if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) {
-   uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR, 
-ICON_FILESEL, 10, 120, 20, 20, 0, 0, 0, 0, 0, 
-"Select the directory/name for "
-"the proxy storage");
+   if (last_seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) {
+   uiDefIconBut(block, BUT, B_SEQ_SEL_PROXY_DIR, 
+ICON_FILESEL, 10, 120, 20, 20, 0, 0, 0, 0, 
0, 
+"Select the directory/name for "
+"the proxy storage");
 
-   uiDefBut(block, TEX, 
-B_SEQ_BUT_RELOAD, "Dir: ", 
-30,120,220,20, last_seq->strip->proxy->dir, 
-0.0, 160.0, 100, 0, "");
+   uiDefBut(block, TEX, 
+B_SEQ_BUT_RELOAD, "Dir: ", 
+30,120,220,20, last_se