[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16163] branches/soc-2008-quorn/release/ scripts/bpymodules/BPyTextPlugin.py: Better class support with inheritance for text parsing.

2008-08-18 Thread Ian Thompson
Revision: 16163
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16163
Author:   quorn
Date: 2008-08-18 12:01:49 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Better class support with inheritance for text parsing.

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

Modified: branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py
===
--- branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py 
2008-08-18 02:29:25 UTC (rev 16162)
+++ branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py 
2008-08-18 10:01:49 UTC (rev 16163)
@@ -56,8 +56,9 @@
which it is defined is held in lineno.


-   def __init__(self, name, defs, vars, lineno, doc=''):
+   def __init__(self, name, parents, defs, vars, lineno, doc=''):
Definition.__init__(self, name, lineno, doc)
+   self.parents = parents
self.defs = defs
self.vars = vars
 
@@ -150,8 +151,11 @@
i = 1

desc = get_cached_descriptor(txt)
-   if desc.classes.has_key(targets[0]):
-   local = desc.classes[targets[0]]
+   b = targets[0].find('(')
+   if b==-1: b = None # Trick to let us use [:b] and get the whole string
+   
+   if desc.classes.has_key(targets[0][:b]):
+   local = desc.classes[targets[0][:b]]
elif desc.defs.has_key(targets[0]):
local = desc.defs[targets[0]]
elif desc.vars.has_key(targets[0]):
@@ -159,8 +163,10 @@

if local:
while i  count:
-   if hasattr(local, 'classes') and 
local.classes.has_key(targets[i]):
-   local = local.classes[targets[i]]
+   b = targets[i].find('(')
+   if b==-1: b = None
+   if hasattr(local, 'classes') and 
local.classes.has_key(targets[i][:b]):
+   local = local.classes[targets[i][:b]]
elif hasattr(local, 'defs') and 
local.defs.has_key(targets[i]):
local = local.defs[targets[i]]
elif hasattr(local, 'vars') and 
local.vars.has_key(targets[i]):
@@ -369,14 +375,21 @@
cls_indent = indent
cls_step = 1

-   # Found 'class', look for cls_name followed by '('
+   # Found 'class', look for cls_name followed by '(' parents ')'
elif cls_step == 1:
if not cls_name:
if type == NAME:
cls_name = text
cls_sline = False
+   cls_parents = dict()
cls_defs = dict()
cls_vars = dict()
+   elif type == NAME:
+   if classes.has_key(text):
+   parent = classes[text]
+   cls_parents[text] = parent
+   cls_defs.update(parent.defs)
+   cls_vars.update(parent.vars)
elif text == ':':
cls_step = 2

@@ -394,11 +407,11 @@
cls_doc = _trim_doc(text)
if cls_sline:
if type == NEWLINE:
-   classes[cls_name] = ClassDesc(cls_name, 
cls_defs, cls_vars, cls_lineno, cls_doc)
+   classes[cls_name] = ClassDesc(cls_name, 
cls_parents, cls_defs, cls_vars, cls_lineno, cls_doc)
cls_step = 0
else:
if type == DEDENT and indent = cls_indent:
-   classes[cls_name] = ClassDesc(cls_name, 
cls_defs, cls_vars, cls_lineno, cls_doc)
+   classes[cls_name] = ClassDesc(cls_name, 
cls_parents, cls_defs, cls_vars, cls_lineno, cls_doc)
cls_step = 0

#
@@ -699,11 +712,22 @@
returns them as a list in the same order.


-   i = cursor - 1
-   while i = 0 and (line[i].isalnum() or line[i] == '_' or line[i] == 
'.'):
+   brk = 0
+   targets = []
+   j = cursor
+   i = j-1
+   while i = 0:
+   if line[i] == ')': brk += 1
+   elif brk:
+   if line[i] == '(': brk -= 1
+   else:
+   if line[i] == '.':
+   

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16164] branches/soc-2008-quorn/source/ blender/src/drawtext.c: Moving the find panel caused some funky projection effect, introduced when I fixed the

2008-08-18 Thread Ian Thompson
Revision: 16164
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16164
Author:   quorn
Date: 2008-08-18 12:24:56 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Moving the find panel caused some funky projection effect, introduced when I 
fixed the scrollbar. The scrollbar and panel now play nice.

Modified Paths:
--
branches/soc-2008-quorn/source/blender/src/drawtext.c

Modified: branches/soc-2008-quorn/source/blender/src/drawtext.c
===
--- branches/soc-2008-quorn/source/blender/src/drawtext.c   2008-08-18 
10:01:49 UTC (rev 16163)
+++ branches/soc-2008-quorn/source/blender/src/drawtext.c   2008-08-18 
10:24:56 UTC (rev 16164)
@@ -,10 +,8 @@
 
st-flags|= ST_SCROLL_SELECT;
 
-   glDrawBuffer(GL_FRONT);
-   uiEmboss(st-txtbar.xmin, st-txtbar.ymin, st-txtbar.xmax, 
st-txtbar.ymax, st-flags  ST_SCROLL_SELECT);
-   bglFlush();
-   glDrawBuffer(GL_BACK);
+   scrarea_do_windraw(curarea);
+   screen_swapbuffers();
 
getmouseco_areawin(mval);
old[0]= hold[0]= mval[0];
@@ -1152,10 +1150,8 @@
}
st-flags^= ST_SCROLL_SELECT;
 
-   glDrawBuffer(GL_FRONT);
-   uiEmboss(st-txtbar.xmin, st-txtbar.ymin, st-txtbar.xmax, 
st-txtbar.ymax, st-flags  ST_SCROLL_SELECT);
-   bglFlush();
-   glDrawBuffer(GL_BACK);
+   scrarea_do_windraw(curarea);
+   screen_swapbuffers();
 }
 
 static void do_selection(SpaceText *st, int selecting)
@@ -1626,6 +1622,9 @@
int linecount = 0;
 
if (st==NULL || st-spacetype != SPACE_TEXT) return;
+
+   bwin_clear_viewmat(sa-win);/* clear buttons view */
+   glLoadIdentity();

BIF_GetThemeColor3fv(TH_BACK, col);
glClearColor(col[0], col[1], col[2], 0.0);
@@ -1701,10 +1700,6 @@

bwin_scalematrix(sa-win, st-blockscale, st-blockscale, 
st-blockscale);
text_blockhandlers(sa);
-
-   /* We end here in non-buttons scale so that the scrollbar can be drawn 
correctly */
-   bwin_clear_viewmat(sa-win);/* clear buttons view */
-   glLoadIdentity();

curarea-win_swap= WIN_BACK_OK;
 }


___
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 [16165] branches/apricot/source/gameengine /Converter: Apricot Branch: bugfix, some meshes were not deforming anymore

2008-08-18 Thread Brecht Van Lommel
Revision: 16165
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16165
Author:   blendix
Date: 2008-08-18 12:27:48 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Apricot Branch: bugfix, some meshes were not deforming anymore
after a recent commit.

Modified Paths:
--
branches/apricot/source/gameengine/Converter/BL_DeformableGameObject.cpp
branches/apricot/source/gameengine/Converter/BL_MeshDeformer.cpp
branches/apricot/source/gameengine/Converter/BL_MeshDeformer.h
branches/apricot/source/gameengine/Converter/BL_ShapeDeformer.h
branches/apricot/source/gameengine/Converter/BL_SkinDeformer.cpp
branches/apricot/source/gameengine/Converter/BL_SkinDeformer.h

Modified: 
branches/apricot/source/gameengine/Converter/BL_DeformableGameObject.cpp
===
--- branches/apricot/source/gameengine/Converter/BL_DeformableGameObject.cpp
2008-08-18 10:24:56 UTC (rev 16164)
+++ branches/apricot/source/gameengine/Converter/BL_DeformableGameObject.cpp
2008-08-18 10:27:48 UTC (rev 16165)
@@ -41,12 +41,14 @@
delete m_pDeformer; //  __NLA : Temporary until 
we decide where to put this
 }
 
-void   BL_DeformableGameObject::ProcessReplica(KX_GameObject* replica)
+void BL_DeformableGameObject::ProcessReplica(KX_GameObject* replica)
 {
+   BL_MeshDeformer *deformer;
KX_GameObject::ProcessReplica(replica);
 
-   if (m_pDeformer){
-   ((BL_DeformableGameObject*)replica)-m_pDeformer = 
m_pDeformer-GetReplica();
+   if (m_pDeformer) {
+   deformer = (BL_MeshDeformer*)m_pDeformer-GetReplica();
+   ((BL_DeformableGameObject*)replica)-m_pDeformer = deformer;
}
 
 }

Modified: branches/apricot/source/gameengine/Converter/BL_MeshDeformer.cpp
===
--- branches/apricot/source/gameengine/Converter/BL_MeshDeformer.cpp
2008-08-18 10:24:56 UTC (rev 16164)
+++ branches/apricot/source/gameengine/Converter/BL_MeshDeformer.cpp
2008-08-18 10:27:48 UTC (rev 16165)
@@ -90,8 +90,18 @@
delete [] m_transverts;
if (m_transnors)
delete [] m_transnors;
-};
+}
+ 
+void BL_MeshDeformer::Relink(GEN_Mapclass GEN_HashedPtr, void**map)
+{
+   void **h_obj = (*map)[m_gameobj];
 
+   if (h_obj)
+   m_gameobj = (BL_DeformableGameObject*)(*h_obj);
+   else
+   m_gameobj = NULL;
+}
+
 /**
  * @warning This function is expensive!
  */
@@ -218,4 +228,4 @@
m_tvtot = m_bmesh-totvert;
}
 }
- 
+

Modified: branches/apricot/source/gameengine/Converter/BL_MeshDeformer.h
===
--- branches/apricot/source/gameengine/Converter/BL_MeshDeformer.h  
2008-08-18 10:24:56 UTC (rev 16164)
+++ branches/apricot/source/gameengine/Converter/BL_MeshDeformer.h  
2008-08-18 10:27:48 UTC (rev 16165)
@@ -47,7 +47,7 @@
 public:
void VerifyStorage();
void RecalcNormals();
-   virtual void Relink(GEN_Mapclass GEN_HashedPtr, void**map){};
+   virtual void Relink(GEN_Mapclass GEN_HashedPtr, void**map);
BL_MeshDeformer(BL_DeformableGameObject *gameobj,
struct Object* obj,
class BL_SkinMeshObject *meshobj ):
@@ -67,6 +67,7 @@
virtual RAS_Deformer*   GetReplica(){return NULL;};
struct Mesh* GetMesh() { return m_bmesh; };
//  virtual void InitDeform(double time){};
+
 protected:
class BL_SkinMeshObject*m_pMeshObject;
struct Mesh*m_bmesh;

Modified: branches/apricot/source/gameengine/Converter/BL_ShapeDeformer.h
===
--- branches/apricot/source/gameengine/Converter/BL_ShapeDeformer.h 
2008-08-18 10:24:56 UTC (rev 16164)
+++ branches/apricot/source/gameengine/Converter/BL_ShapeDeformer.h 
2008-08-18 10:27:48 UTC (rev 16165)
@@ -43,17 +43,6 @@
 class BL_ShapeDeformer : public BL_SkinDeformer  
 {
 public:
-   virtual void Relink(GEN_Mapclass GEN_HashedPtr, void**map)
-   {
-   void **h_obj = (*map)[m_gameobj];
-   if (h_obj){
-   m_gameobj = (BL_DeformableGameObject*)(*h_obj);
-   }
-   else
-   m_gameobj=NULL;
-   // relink the underlying skin deformer
-   BL_SkinDeformer::Relink(map);
-   };
BL_ShapeDeformer(BL_DeformableGameObject *gameobj,
  Object *bmeshobj,
  BL_SkinMeshObject *mesh)

Modified: branches/apricot/source/gameengine/Converter/BL_SkinDeformer.cpp
===
--- 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16166] trunk/blender: Fixing compile errors on mingw/cygwin (reported by aligorith)

2008-08-18 Thread Daniel Genrich
Revision: 16166
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16166
Author:   genscher
Date: 2008-08-18 12:37:15 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Fixing compile errors on mingw/cygwin (reported by aligorith)

Modified Paths:
--
trunk/blender/intern/guardedalloc/BLO_sys_types.h
trunk/blender/intern/opennl/superlu/BLO_sys_types.h
trunk/blender/source/blender/blenloader/BLO_sys_types.h

Modified: trunk/blender/intern/guardedalloc/BLO_sys_types.h
===
--- trunk/blender/intern/guardedalloc/BLO_sys_types.h   2008-08-18 10:27:48 UTC 
(rev 16165)
+++ trunk/blender/intern/guardedalloc/BLO_sys_types.h   2008-08-18 10:37:15 UTC 
(rev 16166)
@@ -96,6 +96,10 @@
 
 #include inttypes.h
 
+#elif defined(FREE_WINDOWS)
+
+#include stdint.h
+
 #else
 
/* FreeBSD, Irix, Solaris */

Modified: trunk/blender/intern/opennl/superlu/BLO_sys_types.h
===
--- trunk/blender/intern/opennl/superlu/BLO_sys_types.h 2008-08-18 10:27:48 UTC 
(rev 16165)
+++ trunk/blender/intern/opennl/superlu/BLO_sys_types.h 2008-08-18 10:37:15 UTC 
(rev 16166)
@@ -96,6 +96,10 @@
 
 #include inttypes.h
 
+#elif defined(FREE_WINDOWS)
+
+#include stdint.h
+
 #else
 
/* FreeBSD, Irix, Solaris */

Modified: trunk/blender/source/blender/blenloader/BLO_sys_types.h
===
--- trunk/blender/source/blender/blenloader/BLO_sys_types.h 2008-08-18 
10:27:48 UTC (rev 16165)
+++ trunk/blender/source/blender/blenloader/BLO_sys_types.h 2008-08-18 
10:37:15 UTC (rev 16166)
@@ -81,6 +81,10 @@
 
 #include inttypes.h
 
+#elif defined(FREE_WINDOWS)
+
+#include stdint.h
+
 #else
 
/* FreeBSD, Irix, Solaris */


___
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 [16167] trunk/blender: #2: Fixing compile errors on mingw/cygwin (reported by aligorith)

2008-08-18 Thread Daniel Genrich
Revision: 16167
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16167
Author:   genscher
Date: 2008-08-18 12:48:37 +0200 (Mon, 18 Aug 2008)

Log Message:
---
#2: Fixing compile errors on mingw/cygwin (reported by aligorith)

Modified Paths:
--
trunk/blender/intern/guardedalloc/BLO_sys_types.h
trunk/blender/intern/opennl/superlu/BLO_sys_types.h
trunk/blender/source/blender/blenloader/BLO_sys_types.h

Modified: trunk/blender/intern/guardedalloc/BLO_sys_types.h
===
--- trunk/blender/intern/guardedalloc/BLO_sys_types.h   2008-08-18 10:37:15 UTC 
(rev 16166)
+++ trunk/blender/intern/guardedalloc/BLO_sys_types.h   2008-08-18 10:48:37 UTC 
(rev 16167)
@@ -48,11 +48,6 @@
 #ifdef __cplusplus
 extern C {
 #endif
-
-#ifdef FREE_WINDOWS
-typedef unsigned char uint8_t;
-typedef unsigned int uint32_t;
-#endif
  
 #if defined(_WIN32)  !defined(FREE_WINDOWS)
 

Modified: trunk/blender/intern/opennl/superlu/BLO_sys_types.h
===
--- trunk/blender/intern/opennl/superlu/BLO_sys_types.h 2008-08-18 10:37:15 UTC 
(rev 16166)
+++ trunk/blender/intern/opennl/superlu/BLO_sys_types.h 2008-08-18 10:48:37 UTC 
(rev 16167)
@@ -48,11 +48,6 @@
 #ifdef __cplusplus
 extern C {
 #endif
-
-#ifdef FREE_WINDOWS
-typedef unsigned char uint8_t;
-typedef unsigned int uint32_t;
-#endif
  
 #if defined(_WIN32)  !defined(FREE_WINDOWS)
 

Modified: trunk/blender/source/blender/blenloader/BLO_sys_types.h
===
--- trunk/blender/source/blender/blenloader/BLO_sys_types.h 2008-08-18 
10:37:15 UTC (rev 16166)
+++ trunk/blender/source/blender/blenloader/BLO_sys_types.h 2008-08-18 
10:48:37 UTC (rev 16167)
@@ -43,11 +43,6 @@
 #ifdef __cplusplus
 extern C {
 #endif
-
-#ifdef FREE_WINDOWS
-typedef unsigned char uint8_t;
-typedef unsigned int uint32_t;
-#endif
  
 #if defined(_WIN32)  !defined(FREE_WINDOWS)
 


___
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 [16168] trunk/blender/source/blender: a) New unified effector system by Janne (jahka) + Me (genscher): particle and cloth/sb don't use different syste

2008-08-18 Thread Daniel Genrich
Revision: 16168
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16168
Author:   genscher
Date: 2008-08-18 13:09:27 +0200 (Mon, 18 Aug 2008)

Log Message:
---
a) New unified effector system by Janne (jahka) + Me (genscher): particle and 
cloth/sb don't use different systems anymore. b) cloth wind corrected for new 
system c) Wind has noise option now d) @ Bjornmose: since the old factors are 
gone SB doesn't need to divide by 1000 etc. anymore. I didn't want to touch 
your code - you might like to take a look at it :) 

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_effect.h
trunk/blender/source/blender/blenkernel/intern/effect.c
trunk/blender/source/blender/blenkernel/intern/implicit.c
trunk/blender/source/blender/blenkernel/intern/particle_system.c
trunk/blender/source/blender/blenlib/BLI_rand.h
trunk/blender/source/blender/blenlib/intern/rand.c
trunk/blender/source/blender/blenloader/intern/readfile.c
trunk/blender/source/blender/makesdna/DNA_object_force.h
trunk/blender/source/blender/src/buttons_object.c

Modified: trunk/blender/source/blender/blenkernel/BKE_effect.h
===
--- trunk/blender/source/blender/blenkernel/BKE_effect.h2008-08-18 
10:48:37 UTC (rev 16167)
+++ trunk/blender/source/blender/blenkernel/BKE_effect.h2008-08-18 
11:09:27 UTC (rev 16168)
@@ -37,6 +37,7 @@
 struct ListBase;
 struct Particle;
 struct Group;
+struct RNG;
 
 typedef struct pEffectorCache {
struct pEffectorCache *next, *prev;
@@ -64,7 +65,12 @@
 void   pdEndEffectors(struct ListBase *lb);
 void   pdDoEffectors(struct ListBase *lb, float *opco, float 
*force, float *speed, float cur_time, float loc_time, unsigned int flags);
 
+/* required for particle_system.c */
+void do_physical_effector(short type, float force_val, float distance, float 
falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float 
*velocity, float *field, int planar, struct RNG *rng, float noise);
+float effector_falloff(struct PartDeflect *pd, float *eff_velocity, float 
*vec_to_part);
 
 
+
+
 #endif
 

Modified: trunk/blender/source/blender/blenkernel/intern/effect.c
===
--- trunk/blender/source/blender/blenkernel/intern/effect.c 2008-08-18 
10:48:37 UTC (rev 16167)
+++ trunk/blender/source/blender/blenkernel/intern/effect.c 2008-08-18 
11:09:27 UTC (rev 16168)
@@ -157,6 +157,13 @@
}
}
else if(pd-forcefield) {
+   
+   if(pd-forcefield == PFIELD_WIND)
+   {
+   pd-rng = rng_new(1);
+   rng_srandom(pd-rng, (unsigned 
int)(ceil(PIL_check_seconds_timer(; // use better seed
+   }
+   
ec= MEM_callocN(sizeof(pEffectorCache), effector cache);
ec-ob= ob;
BLI_addtail(lb, ec);
@@ -205,13 +212,189 @@
pEffectorCache *ec;
/* restore full copy */
for(ec= lb-first; ec; ec= ec-next)
+   {
+   if(ec-ob-pd  (ec-ob-pd-forcefield == 
PFIELD_WIND))
+   rng_free(ec-ob-pd-rng);
+   
*(ec-ob)= ec-obcopy;
+   }
 
BLI_freelistN(lb);
}
 }
 
 
+//
+/* Effectors   */
+//
+
+// noise function for wind e.g.
+static float wind_func(struct RNG *rng, float strength)
+{
+   int random = (rng_getInt(rng)+1) % 65535; // max 2357
+   float force = rng_getFloat(rng) + 1.0f;
+   float ret;
+   float sign = 0;
+   
+   sign = (random  32000.0) ? 1.0: -1.0; // dividing by 2 is not giving 
equal sign distribution
+   
+   ret = sign*((float)random / force)*strength/65535.0f;
+   
+   return ret;
+}
+
+
+static float falloff_func(float fac, int usemin, float mindist, int usemax, 
float maxdist, float power)
+{
+   if(!usemin)
+   mindist= 0.0f;
+
+   if(fac  mindist) {
+   return 1.0f;
+   }
+   else if(usemax) {
+   if(facmaxdist || (maxdist-mindist)=0.0f)
+   return 0.0f;
+
+   fac= (fac-mindist)/(maxdist-mindist);
+   return 1.0f - (float)pow((double)fac, (double)power);
+   }
+   else
+   return pow((double)1.0f+fac-mindist, (double)-power);
+}
+
+static float falloff_func_dist(PartDeflect *pd, float fac)
+{
+   return falloff_func(fac, pd-flagPFIELD_USEMIN, pd-mindist, 
pd-flagPFIELD_USEMAX, pd-maxdist, pd-f_power);
+}
+
+static float falloff_func_rad(PartDeflect *pd, float fac)
+{
+   return falloff_func(fac, 

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

2008-08-18 Thread Brecht Van Lommel
Revision: 16170
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16170
Author:   blendix
Date: 2008-08-18 14:09:33 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Apricot Branch
==

svn merge -r16142:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--
branches/apricot/intern/guardedalloc/MEM_guardedalloc.h
branches/apricot/intern/guardedalloc/intern/mallocn.c
branches/apricot/intern/guardedalloc/intern/mmap_win.c
branches/apricot/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj
branches/apricot/intern/guardedalloc/mmap_win.h
branches/apricot/intern/opennl/make/msvc_7_0/opennl.vcproj
branches/apricot/intern/opennl/superlu/smemory.c
branches/apricot/projectfiles_vc7/kernel/system/SYS_system.vcproj
branches/apricot/release/datafiles/datatoc.c
branches/apricot/source/blender/blenkernel/BKE_customdata.h
branches/apricot/source/blender/blenkernel/BKE_effect.h
branches/apricot/source/blender/blenkernel/BKE_endian.h
branches/apricot/source/blender/blenkernel/BKE_utildefines.h
branches/apricot/source/blender/blenkernel/intern/CCGSubSurf.c
branches/apricot/source/blender/blenkernel/intern/DerivedMesh.c
branches/apricot/source/blender/blenkernel/intern/cloth.c
branches/apricot/source/blender/blenkernel/intern/displist.c
branches/apricot/source/blender/blenkernel/intern/effect.c
branches/apricot/source/blender/blenkernel/intern/icons.c
branches/apricot/source/blender/blenkernel/intern/image.c
branches/apricot/source/blender/blenkernel/intern/implicit.c
branches/apricot/source/blender/blenkernel/intern/particle_system.c
branches/apricot/source/blender/blenlib/BLI_editVert.h
branches/apricot/source/blender/blenlib/BLI_rand.h
branches/apricot/source/blender/blenlib/intern/BLI_ghash.c
branches/apricot/source/blender/blenlib/intern/BLI_kdopbvh.c
branches/apricot/source/blender/blenlib/intern/fileops.c
branches/apricot/source/blender/blenlib/intern/psfont.c
branches/apricot/source/blender/blenlib/intern/rand.c
branches/apricot/source/blender/blenlib/intern/util.c
branches/apricot/source/blender/blenloader/BLO_sys_types.h
branches/apricot/source/blender/blenloader/intern/genfile.c
branches/apricot/source/blender/blenloader/intern/readblenentry.c
branches/apricot/source/blender/blenloader/intern/readfile.c
branches/apricot/source/blender/blenpluginapi/intern/pluginapi.c
branches/apricot/source/blender/imbuf/intern/cineon/cineonlib.c
branches/apricot/source/blender/imbuf/intern/cineon/dpxlib.c
branches/apricot/source/blender/imbuf/intern/cineon/logImageCore.h
branches/apricot/source/blender/imbuf/intern/cineon/logmemfile.c
branches/apricot/source/blender/imbuf/intern/cineon/logmemfile.h
branches/apricot/source/blender/imbuf/intern/scaling.c
branches/apricot/source/blender/include/BIF_meshtools.h
branches/apricot/source/blender/makesdna/DNA_object_force.h
branches/apricot/source/blender/makesdna/intern/makesdna.c
branches/apricot/source/blender/python/api2_2x/Draw.c
branches/apricot/source/blender/python/api2_2x/doc/Mathutils.py
branches/apricot/source/blender/python/api2_2x/vector.c
branches/apricot/source/blender/python/api2_2x/vector.h
branches/apricot/source/blender/radiosity/CMakeLists.txt
branches/apricot/source/blender/radiosity/SConscript
branches/apricot/source/blender/radiosity/intern/source/Makefile
branches/apricot/source/blender/radiosity/intern/source/radnode.c
branches/apricot/source/blender/radiosity/intern/source/radpreprocess.c
branches/apricot/source/blender/render/CMakeLists.txt
branches/apricot/source/blender/render/SConscript
branches/apricot/source/blender/render/intern/include/render_types.h
branches/apricot/source/blender/render/intern/source/occlusion.c
branches/apricot/source/blender/render/intern/source/pipeline.c
branches/apricot/source/blender/render/intern/source/rendercore.c
branches/apricot/source/blender/render/intern/source/shadbuf.c
branches/apricot/source/blender/render/intern/source/strand.c
branches/apricot/source/blender/render/intern/source/zbuf.c
branches/apricot/source/blender/src/buttons_editing.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/drawmesh.c
branches/apricot/source/blender/src/drawobject.c
branches/apricot/source/blender/src/editkey.c
branches/apricot/source/blender/src/editmesh_mods.c
branches/apricot/source/blender/src/editmesh_tools.c
branches/apricot/source/blender/src/header_info.c
branches/apricot/source/blender/src/header_script.c
branches/apricot/source/blender/src/interface.c

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16171] trunk/blender/source/blender/ python/api2_2x: python get/set material function for 3d text

2008-08-18 Thread Campbell Barton
Revision: 16171
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16171
Author:   campbellbarton
Date: 2008-08-18 14:40:31 +0200 (Mon, 18 Aug 2008)

Log Message:
---
python get/set material function for 3d text

Modified Paths:
--
trunk/blender/source/blender/python/api2_2x/Text3d.c
trunk/blender/source/blender/python/api2_2x/doc/Text3d.py

Modified: trunk/blender/source/blender/python/api2_2x/Text3d.c
===
--- trunk/blender/source/blender/python/api2_2x/Text3d.c2008-08-18 
12:09:33 UTC (rev 16170)
+++ trunk/blender/source/blender/python/api2_2x/Text3d.c2008-08-18 
12:40:31 UTC (rev 16171)
@@ -132,9 +132,12 @@
 static PyObject *Text3d_setAlignment( BPy_Text3d * self, PyObject * args );
 static PyObject *Text3d_getFont( BPy_Text3d * self );
 static PyObject *Text3d_setFont( BPy_Text3d * self, PyObject * args );
+static PyObject *Text3d_getMaterial( BPy_Text3d * self, PyObject * value );
+static PyObject *Text3d_setMaterial( BPy_Text3d * self, PyObject * args );
 static PyObject *Text3d_addFrame( BPy_Text3d * self );
 static PyObject *Text3d_removeFrame( BPy_Text3d * self, PyObject * args );
 
+
 /*/
 /* Python BPy_Text3d methods table:
*/
 /*/
@@ -210,6 +213,10 @@
METH_NOARGS, () - Gets font list for Text3d},
{setFont, ( PyCFunction ) Text3d_setFont,
METH_VARARGS, () - Sets font for Text3d},
+   {getMaterial, ( PyCFunction ) Text3d_getMaterial,
+   METH_O, () - Gets font list for Text3d},
+   {setMaterial, ( PyCFunction ) Text3d_setMaterial,
+   METH_VARARGS, () - Sets font for Text3d}, 
{addFrame, ( PyCFunction ) Text3d_addFrame,
METH_NOARGS, () - adds a new text frame},
{removeFrame, ( PyCFunction ) Text3d_removeFrame,
@@ -1132,6 +1139,45 @@
Py_RETURN_NONE;
 }
 
+/* todo, add style access, will be almost exact copy of these 2  */
+static PyObject *Text3d_getMaterial( BPy_Text3d * self, PyObject * value )
+{
+   int index = PyInt_AsLong( value );
+   if (index == -1  PyErr_Occurred())
+   return EXPP_ReturnPyObjError( PyExc_TypeError, expected a 
character index );
+
+   if (index  0)
+   index = self-curve-len + index;
+   
+   if ( index  0 || index = self-curve-len )
+   return EXPP_ReturnPyObjError( PyExc_IndexError, character 
index out of range );
+   
+   return PyInt_FromLong( self-curve-strinfo[index].mat_nr );
+}
+
+static PyObject *Text3d_setMaterial( BPy_Text3d * self, PyObject * args )
+{
+   int index, mat_nr;
+   if( !PyArg_ParseTuple( args, ii,index, mat_nr) )
+   return NULL; /* Python error is ok */
+   
+   if (index  0)
+   index = self-curve-len + index;
+   
+   if ( index  0 || index = self-curve-len )
+   return EXPP_ReturnPyObjError( PyExc_IndexError, character 
index out of range );
+
+   if (mat_nr  0)
+   mat_nr = self-curve-totcol + mat_nr;
+   
+   if ( mat_nr  0 || mat_nr = self-curve-totcol )
+   return EXPP_ReturnPyObjError( PyExc_IndexError, material index 
out of range );
+   
+   self-curve-strinfo[index].mat_nr = mat_nr;
+   
+   Py_RETURN_NONE;
+}
+
 static PyObject *Text3d_addFrame( BPy_Text3d * self )
 {
Curve *cu = self-curve;

Modified: trunk/blender/source/blender/python/api2_2x/doc/Text3d.py
===
--- trunk/blender/source/blender/python/api2_2x/doc/Text3d.py   2008-08-18 
12:09:33 UTC (rev 16170)
+++ trunk/blender/source/blender/python/api2_2x/doc/Text3d.py   2008-08-18 
12:40:31 UTC (rev 16171)
@@ -287,6 +287,26 @@
@param align: The new text3d's Alignment value. 


+   def getMaterial(index):
+   
+   get the material index of a character.
+   @rtype: int
+   @return: the material index if the character
+   @type index: int
+   @param index: the index of the character in a string
+   
+
+   def setMaterial(index, material_index):
+   
+   Set a characters material.
+   @note: after changing this youll need to update the object with 
object.makeDisplayList() to see the changes.
+   @rtype: None
+   @type index: int
+   @param index: the index of the character in a string
+   @type material_index: int
+   @param material_index: the material index set set the character.
+   
+   
def addFrame():

Adds a text frame. 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16172] branches/apricot/intern/ guardedalloc/intern/mallocn.c: small error, stopped apricot building on linux-32bit

2008-08-18 Thread Campbell Barton
Revision: 16172
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16172
Author:   campbellbarton
Date: 2008-08-18 15:06:33 +0200 (Mon, 18 Aug 2008)

Log Message:
---
small error, stopped apricot building on linux-32bit

Modified Paths:
--
branches/apricot/intern/guardedalloc/intern/mallocn.c

Modified: branches/apricot/intern/guardedalloc/intern/mallocn.c
===
--- branches/apricot/intern/guardedalloc/intern/mallocn.c   2008-08-18 
12:40:31 UTC (rev 16171)
+++ branches/apricot/intern/guardedalloc/intern/mallocn.c   2008-08-18 
13:06:33 UTC (rev 16172)
@@ -696,12 +696,12 @@
return(name);
 }
 
-unsigned long MEM_get_memory_in_use(void)
+uintptr_t MEM_get_memory_in_use(void)
 {
return mem_in_use;
 }
 
-unsigned long MEM_get_mapped_memory_in_use(void)
+uintptr_t MEM_get_mapped_memory_in_use(void)
 {
return mmap_in_use;
 }


___
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 [16173] branches/apricot/source/blender/ src/previewrender.c: Apricot Branch: fix some missing updates for GLSL materials

2008-08-18 Thread Brecht Van Lommel
Revision: 16173
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16173
Author:   blendix
Date: 2008-08-18 15:25:27 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Apricot Branch: fix some missing updates for GLSL materials
when changing world settings. Thanks Pablo for the patch,
though I implemented it a bit differently.

Modified Paths:
--
branches/apricot/source/blender/src/previewrender.c

Modified: branches/apricot/source/blender/src/previewrender.c
===
--- branches/apricot/source/blender/src/previewrender.c 2008-08-18 13:06:33 UTC 
(rev 16172)
+++ branches/apricot/source/blender/src/previewrender.c 2008-08-18 13:25:27 UTC 
(rev 16173)
@@ -224,11 +224,20 @@
}
}
 
-   if(ELEM3(id_code, ID_MA, ID_TE, ID_LA)) {
+   if(ELEM4(id_code, ID_MA, ID_TE, ID_LA, ID_WO)) {
Object *ob;
Material *ma;
 
-   if(id_code == ID_LA) {
+   if(id_code == ID_WO) {
+   for(ma=G.main-mat.first; ma; ma=ma-id.next) {
+   if(ma-gpumaterial) {
+   GPU_material_free(ma-gpumaterial);
+   ma-gpumaterial= NULL;
+   allqueue(REDRAWVIEW3D, 0);
+   }
+   }
+   }
+   else if(id_code == ID_LA) {
for(ob=G.main-object.first; ob; ob=ob-id.next) {
if(ob-gpulamp) {
GPU_lamp_free(ob-gpulamp);


___
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 [16174] branches/soc-2008-quorn/release/ scripts/bpymodules/BPyTextPlugin.py: Missed parentheses from except clause, has a whole different meaning.

2008-08-18 Thread Ian Thompson
Revision: 16174
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16174
Author:   quorn
Date: 2008-08-18 16:16:34 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Missed parentheses from except clause, has a whole different meaning.

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

Modified: branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py
===
--- branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py 
2008-08-18 13:25:27 UTC (rev 16173)
+++ branches/soc-2008-quorn/release/scripts/bpymodules/BPyTextPlugin.py 
2008-08-18 14:16:34 UTC (rev 16174)
@@ -265,7 +265,7 @@
type, text, start, end, line = tokens.next()
except StopIteration:
break
-   except TokenError, IndentationError:
+   except (TokenError, IndentationError):
incomplete = True
break



___
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 [16176] trunk/blender/source/blender: a) Forces can be hidden by deflector object now ( need to talk with jahka about particle integration - should be

2008-08-18 Thread Daniel Genrich
Revision: 16176
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16176
Author:   genscher
Date: 2008-08-18 16:41:24 +0200 (Mon, 18 Aug 2008)

Log Message:
---
a) Forces can be hidden by deflector object now (need to talk with jahka about 
particle integration - should be copy-paste) see 
http://dldw.de/tmp/index.php?file=w2.blend (press play button in timeline and 
change the absorption value ob the cube) b) fixed deflector/collision bug with 
continues physics c) cloth wind/forces uses masses now d) even faster collision 
object gathering e) have fun ;)

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_collision.h
trunk/blender/source/blender/blenkernel/intern/collision.c
trunk/blender/source/blender/blenkernel/intern/effect.c
trunk/blender/source/blender/blenkernel/intern/implicit.c
trunk/blender/source/blender/blenkernel/intern/modifier.c
trunk/blender/source/blender/blenkernel/intern/particle_system.c
trunk/blender/source/blender/makesdna/DNA_modifier_types.h
trunk/blender/source/blender/src/buttons_object.c

Modified: trunk/blender/source/blender/blenkernel/BKE_collision.h
===
--- trunk/blender/source/blender/blenkernel/BKE_collision.h 2008-08-18 
14:33:26 UTC (rev 16175)
+++ trunk/blender/source/blender/blenkernel/BKE_collision.h 2008-08-18 
14:41:24 UTC (rev 16176)
@@ -119,8 +119,10 @@
 /
 // used in modifier.c from collision.c
 /
+
 BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, 
MVert *x, unsigned int numverts, float epsilon );
 void bvhtree_update_from_mvert ( BVHTree * bvhtree, MFace *faces, int 
numfaces, MVert *x, MVert *xnew, int numverts, int moving );
+
 /
 
 LinkNode *BLI_linklist_append_fast ( LinkNode **listp, void *ptr );
@@ -134,6 +136,15 @@
 void interpolateOnTriangle ( float to[3], float v1[3], float v2[3], float 
v3[3], double w1, double w2, double w3 );
 
 /
+// used in effect.c
+/
+CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj);
 
+/
+
+
+
+/
+
 #endif
 

Modified: trunk/blender/source/blender/blenkernel/intern/collision.c
===
--- trunk/blender/source/blender/blenkernel/intern/collision.c  2008-08-18 
14:33:26 UTC (rev 16175)
+++ trunk/blender/source/blender/blenkernel/intern/collision.c  2008-08-18 
14:41:24 UTC (rev 16176)
@@ -31,10 +31,11 @@
 
 #include BKE_cloth.h
 
+#include DNA_cloth_types.h
 #include DNA_group_types.h
+#include DNA_mesh_types.h
 #include DNA_object_types.h
-#include DNA_cloth_types.h
-#include DNA_mesh_types.h
+#include DNA_object_force.h
 #include DNA_scene_types.h
 
 #include BKE_DerivedMesh.h
@@ -1307,10 +1308,35 @@
for ( base = G.scene-base.first; base; base = base-next )
{
coll_ob = base-object;
-   collmd = ( CollisionModifierData * ) modifiers_findByType ( 
coll_ob, eModifierType_Collision );
-   
-   if ( !collmd )
+   
+   if(coll_ob-pd  coll_ob-pd-deflect)
{
+   collmd = ( CollisionModifierData * ) 
modifiers_findByType ( coll_ob, eModifierType_Collision );
+   }
+   
+   if ( collmd )
+   {
+   if(coll_ob == self)
+   continue;
+   
+   if(numobj = maxobj)
+   {
+   // realloc
+   int oldmax = maxobj;
+   CollisionModifierData **tmp;
+   maxobj *= 2;
+   tmp = MEM_callocN(sizeof(CollisionModifierData 
*)*maxobj, CollisionObjectsArray);
+   memcpy(tmp, objs, sizeof(CollisionModifierData 
*)*oldmax);
+   MEM_freeN(objs);
+   objs = tmp;
+   
+   }
+   
+   objs[numobj] = collmd;
+   numobj++;
+   }
+   else
+   {
if ( coll_ob-dup_group )
{
GroupObject *go;
@@ -1319,9 +1345,13 @@
for ( go= group-gobject.first; go; go= 
go-next )
{
coll_ob = go-ob;
+   collmd = NULL;

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16177] branches/soc-2008-quorn/source/ blender/src/drawtext.c: Made modification alert slightly less intrusive and added Ignore option.

2008-08-18 Thread Ian Thompson
Revision: 16177
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16177
Author:   quorn
Date: 2008-08-18 19:08:25 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Made modification alert slightly less intrusive and added Ignore option.

Modified Paths:
--
branches/soc-2008-quorn/source/blender/src/drawtext.c

Modified: branches/soc-2008-quorn/source/blender/src/drawtext.c
===
--- branches/soc-2008-quorn/source/blender/src/drawtext.c   2008-08-18 
14:41:24 UTC (rev 16176)
+++ branches/soc-2008-quorn/source/blender/src/drawtext.c   2008-08-18 
17:08:25 UTC (rev 16177)
@@ -1792,6 +1792,26 @@
return 0;
 }
 
+void txt_ignore_modified(Text *text) {
+   struct stat st;
+   int result;
+   char file[FILE_MAXDIR+FILE_MAXFILE];
+
+   if (!text || !text-name) return;
+
+   BLI_strncpy(file, text-name, FILE_MAXDIR+FILE_MAXFILE);
+   BLI_convertstringcode(file, G.sce);
+
+   if (!BLI_exists(file)) return;
+
+   result = stat(file, st);
+   
+   if(result == -1 || (st.st_mode  S_IFMT) != S_IFREG)
+   return;
+
+   text-mtime= st.st_mtime;
+}
+
 static void save_mem_text(char *str)
 {
SpaceText *st= curarea-spacedata.first;
@@ -2621,6 +2641,65 @@
return swallow;
 }
 
+static short do_modification_check(SpaceText *st) {
+   Text *text= st-text;
+
+   if (last_check_time  PIL_check_seconds_timer() - 2.0) {
+   switch (txt_file_modified(text)) {
+   case 1:
+   /* Modified locally and externally, ahhh. Offer more 
possibilites. */
+   if (text-flags  TXT_ISDIRTY) {
+   switch (pupmenu(File Modified Outside and 
Inside Blender %t|Load outside changes (ignore local changes) %x0|Save local 
changes (ignore outside changes) %x1|Make text internal (separate copy) %x2)) {
+   case 0:
+   reopen_text(text);
+   if (st-showsyntax) txt_format_text(st);
+   return 1;
+   case 1:
+   txt_write_file(text);
+   return 1;
+   case 2:
+   text-flags |= TXT_ISMEM | TXT_ISDIRTY 
| TXT_ISTMP;
+   MEM_freeN(text-name);
+   text-name= NULL;
+   return 1;
+   }
+   } else {
+   switch (pupmenu(File Modified Outside Blender 
%t|Reload from disk %x0|Make text internal (separate copy) %x1|Ignore %x2)) {
+   case 0:
+   reopen_text(text);
+   if (st-showsyntax) txt_format_text(st);
+   return 1;
+   case 1:
+   text-flags |= TXT_ISMEM | TXT_ISDIRTY 
| TXT_ISTMP;
+   MEM_freeN(text-name);
+   text-name= NULL;
+   return 1;
+   case 2:
+   txt_ignore_modified(text);
+   return 1;
+   }
+   }
+   break;
+   case 2:
+   switch (pupmenu(File Deleted Outside Blender %t|Make 
text internal %x0|Recreate file %x1)) {
+   case 0:
+   text-flags |= TXT_ISMEM | TXT_ISDIRTY | 
TXT_ISTMP;
+   MEM_freeN(text-name);
+   text-name= NULL;
+   return 1;
+   case 1:
+   txt_write_file(text);
+   return 1;
+   }
+   break;
+   default:
+   break;
+   }
+   last_check_time = PIL_check_seconds_timer();
+   }
+   return 0;
+}
+
 void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
unsigned short event= evt-event;
@@ -3229,62 +3308,7 @@
}
}
 
-   if (last_check_time  PIL_check_seconds_timer() - 10.0) {
-   switch (txt_file_modified(text)) {
-   case 1:
-   /* Modified locally and externally, ahhh. Offer more 
possibilites. */
-   if (text-flags  TXT_ISDIRTY) {
-   switch (pupmenu(File Modified Outside and 
Inside Blender %t|Load 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16179] branches/soc-2008-unclezeiv/source /blender: indirect lighting, big WIP commit:

2008-08-18 Thread Davide Vercelli
Revision: 16179
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16179
Author:   unclezeiv
Date: 2008-08-18 20:22:06 +0200 (Mon, 18 Aug 2008)

Log Message:
---
indirect lighting, big WIP commit:
- code to sample surface colors for indirect lights, this allows color bleeding 
(warning: contains ugly hacks to please/tame the internal render api)
- experimental/simplistic code to support second bounce
- toggle to render only indirect lighting (useful for testing)

please note that this code *has* a couple of known bugs

also corrected some former bugs:
- wrong random cosine weighted direction
- while copying matrices from area lights, scale should not be taken into 
account

Modified Paths:
--
branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_scene_types.h
branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c
branches/soc-2008-unclezeiv/source/blender/render/intern/source/shadeinput.c
branches/soc-2008-unclezeiv/source/blender/src/buttons_scene.c

Modified: branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_scene_types.h
===
--- branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_scene_types.h   
2008-08-18 18:16:32 UTC (rev 16178)
+++ branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_scene_types.h   
2008-08-18 18:22:06 UTC (rev 16179)
@@ -319,7 +319,7 @@
short lightcuts_env_map;
short lightcuts_indirect;
float lightcuts_indir_fac;
-   short lightcuts_random_dirs;
+   short lightcuts_options;
short lightcuts_color_weight;
 } RenderData;
 

Modified: 
branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c
===
--- branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c 
2008-08-18 18:16:32 UTC (rev 16178)
+++ branches/soc-2008-unclezeiv/source/blender/render/intern/source/lightcuts.c 
2008-08-18 18:22:06 UTC (rev 16179)
@@ -73,6 +73,10 @@
 #define FALLOFF_MIX3
 #define FALLOFF_SLIDER 3
 
+#define LC_OPT_RANDOM_DIRS 0x01
+#define LC_OPT_ONLY_INDIR  0x02
+#define LC_OPT_2ND_BOUNCE  0x04
+
 /*
  * This is a table to select the worst falloff for a cluster, given the
  * falloff types of its children.
@@ -165,10 +169,13 @@
int stat_samples;
int stat_cut_size;
int stat_rays_shot;
+   int stat_discard_nohit;
+   int stat_discard_black;
+   int stat_discard_nan;
float scene_diag;
float indir_fac;
int do_indir;
-   int random_dirs;
+   int options;

double start_time;
double tree_creation_time;
@@ -687,7 +694,7 @@
MEM_freeN(nearest);
 }
 
-static void init_lamp(Render * re, LampRen * lar)
+static void lamp_init(Render * re, LampRen * lar)
 {
/* float xs, ys, dist, distkw; */
/* TODO: what is xs ys ?? where are they used? */
@@ -813,17 +820,29 @@
*/
 }
 
+static void lamp_delete(LampRen * lar)
+{
+   MEM_freeN(lar-shadsamp);
+   MEM_freeN(lar);
+}
+
 static void create_lamp_oriented(Render * re, LampRen * lar, LampRen * orig)
 {
-   init_lamp(re, lar);
+   lamp_init(re, lar);
lar-dist= orig-dist;
lar-distkw= lar-dist * lar-dist; /* who uses this? */

lar-lay= orig-lay;
/* same as original area light */
VECCOPY(lar-vec, orig-vec);
-   Mat3CpyMat3(lar-imat, orig-imat);
+   
Mat3CpyMat3(lar-mat, orig-mat);
+   /* but we don't want to preserve scale */
+   Normalize(lar-mat[0]);
+   Normalize(lar-mat[1]);
+   Normalize(lar-mat[2]);
+   Mat3Inv(lar-imat, lar-mat);
+   
lar-type = LA_SPOT;
 }
 
@@ -886,7 +905,7 @@
gonew-ob= 0;

lar = (LampRen *)MEM_callocN(sizeof(LampRen), lampren);
-   init_lamp(re, lar);
+   lamp_init(re, lar);
lar-type = LA_SUN;

lar-lay= 0x; /* XXX: check */
@@ -1031,92 +1050,238 @@
dir[2]= sqrtf(1 - sin_th * sin_th);

/* uniformly weighted angle around axis Z */
-   phi= BLI_frand() * M_PI;
+   phi= 2.0 * BLI_frand() * M_PI;
dir[0]= cosf(phi) * sin_th;
dir[1]= sinf(phi) * sin_th;
 }
 
-static void add_virtual_point_light(Render * re, LightcutsData *lcd, LampRen 
*orig, float *col)
+/* XXX: terrible hack currently needed by get_bounce_color */
+extern struct Render R;
+
+static float get_bounce_color(LightcutsData *lcd, int obi, VlakRen *vla, float 
*co, LampRen *lar, float *col, short isect)
 {
-   GroupObject *gonew;
+   ShadeInput shitmp, *shi= shitmp;
+   ShadeResult shr;
+   Group light_override;
+   GroupObject go;
+   float savecol[3], energy, max_col;
+   int max_idx;
+   
+   /* hack: increase current 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16180] branches/soc-2008-unclezeiv: svn merge -r 16066:16179 https://svn.blender.org/svnroot/bf-blender/trunk/ blender

2008-08-18 Thread Davide Vercelli
Revision: 16180
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16180
Author:   unclezeiv
Date: 2008-08-18 20:33:04 +0200 (Mon, 18 Aug 2008)

Log Message:
---
svn merge -r 16066:16179 
https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--
branches/soc-2008-unclezeiv/CMakeLists.txt
branches/soc-2008-unclezeiv/intern/guardedalloc/intern/mallocn.c
branches/soc-2008-unclezeiv/intern/guardedalloc/intern/mmap_win.c

branches/soc-2008-unclezeiv/intern/guardedalloc/make/msvc_7_0/guardedalloc.vcproj
branches/soc-2008-unclezeiv/intern/guardedalloc/mmap_win.h
branches/soc-2008-unclezeiv/intern/opennl/make/msvc_7_0/opennl.vcproj
branches/soc-2008-unclezeiv/intern/opennl/superlu/smemory.c

branches/soc-2008-unclezeiv/projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
branches/soc-2008-unclezeiv/projectfiles_vc7/kernel/system/SYS_system.vcproj
branches/soc-2008-unclezeiv/release/VERSION
branches/soc-2008-unclezeiv/release/datafiles/datatoc.c
branches/soc-2008-unclezeiv/release/datafiles/splash.jpg
branches/soc-2008-unclezeiv/source/blender/blenkernel/BKE_blender.h
branches/soc-2008-unclezeiv/source/blender/blenkernel/BKE_collision.h
branches/soc-2008-unclezeiv/source/blender/blenkernel/BKE_customdata.h
branches/soc-2008-unclezeiv/source/blender/blenkernel/BKE_effect.h
branches/soc-2008-unclezeiv/source/blender/blenkernel/BKE_endian.h
branches/soc-2008-unclezeiv/source/blender/blenkernel/BKE_utildefines.h
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/CCGSubSurf.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/DerivedMesh.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/cloth.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/collision.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/displist.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/effect.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/icons.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/image.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/implicit.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/ipo.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/modifier.c

branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/particle_system.c
branches/soc-2008-unclezeiv/source/blender/blenkernel/intern/sca.c
branches/soc-2008-unclezeiv/source/blender/blenlib/BLI_editVert.h
branches/soc-2008-unclezeiv/source/blender/blenlib/BLI_rand.h
branches/soc-2008-unclezeiv/source/blender/blenlib/intern/BLI_ghash.c
branches/soc-2008-unclezeiv/source/blender/blenlib/intern/BLI_kdopbvh.c
branches/soc-2008-unclezeiv/source/blender/blenlib/intern/fileops.c
branches/soc-2008-unclezeiv/source/blender/blenlib/intern/psfont.c
branches/soc-2008-unclezeiv/source/blender/blenlib/intern/rand.c
branches/soc-2008-unclezeiv/source/blender/blenlib/intern/util.c
branches/soc-2008-unclezeiv/source/blender/blenloader/BLO_sys_types.h
branches/soc-2008-unclezeiv/source/blender/blenloader/intern/genfile.c
branches/soc-2008-unclezeiv/source/blender/blenloader/intern/readblenentry.c
branches/soc-2008-unclezeiv/source/blender/blenloader/intern/readfile.c
branches/soc-2008-unclezeiv/source/blender/blenloader/intern/writefile.c
branches/soc-2008-unclezeiv/source/blender/blenpluginapi/intern/pluginapi.c
branches/soc-2008-unclezeiv/source/blender/imbuf/intern/cineon/cineonlib.c
branches/soc-2008-unclezeiv/source/blender/imbuf/intern/cineon/dpxlib.c

branches/soc-2008-unclezeiv/source/blender/imbuf/intern/cineon/logImageCore.h
branches/soc-2008-unclezeiv/source/blender/imbuf/intern/cineon/logmemfile.c
branches/soc-2008-unclezeiv/source/blender/imbuf/intern/cineon/logmemfile.h
branches/soc-2008-unclezeiv/source/blender/imbuf/intern/scaling.c
branches/soc-2008-unclezeiv/source/blender/include/BIF_meshtools.h
branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_ipo_types.h
branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_modifier_types.h
branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_object_force.h
branches/soc-2008-unclezeiv/source/blender/makesdna/DNA_sensor_types.h
branches/soc-2008-unclezeiv/source/blender/makesdna/intern/makesdna.c
branches/soc-2008-unclezeiv/source/blender/python/api2_2x/Draw.c
branches/soc-2008-unclezeiv/source/blender/python/api2_2x/Text3d.c
branches/soc-2008-unclezeiv/source/blender/python/api2_2x/doc/Mathutils.py
branches/soc-2008-unclezeiv/source/blender/python/api2_2x/doc/Text3d.py
branches/soc-2008-unclezeiv/source/blender/python/api2_2x/vector.c
branches/soc-2008-unclezeiv/source/blender/python/api2_2x/vector.h

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16181] branches/soc-2008-jaguarandi/ source/blender/blenlib/intern/BLI_kdopbvh.c: Implemented a find_nearest with heaps.

2008-08-18 Thread André Pinto
Revision: 16181
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16181
Author:   jaguarandi
Date: 2008-08-18 21:31:40 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Implemented a find_nearest with heaps. This reachs a minimal number of distance 
queries.
But the cost of maintaining the heap seems to be very high.

For now DFS with local heuristics gets better times.. so BVHTree still uses 
that.

Modified Paths:
--
branches/soc-2008-jaguarandi/source/blender/blenlib/intern/BLI_kdopbvh.c

Modified: 
branches/soc-2008-jaguarandi/source/blender/blenlib/intern/BLI_kdopbvh.c
===
--- branches/soc-2008-jaguarandi/source/blender/blenlib/intern/BLI_kdopbvh.c
2008-08-18 18:33:04 UTC (rev 16180)
+++ branches/soc-2008-jaguarandi/source/blender/blenlib/intern/BLI_kdopbvh.c
2008-08-18 19:31:40 UTC (rev 16181)
@@ -46,6 +46,7 @@
 
 
 #define MAX_TREETYPE 32
+#define DEFAULT_FIND_NEAREST_HEAP_SIZE 1024
 
 typedef struct BVHNode
 {
@@ -119,6 +120,72 @@
 {0, 1.0, -1.0}
 };
 
+/*
+ * Generic push and pop heap
+ */
+#define PUSH_HEAP_BODY(HEAP_TYPE,PRIORITY,heap,heap_size)  \
+{  
\
+   HEAP_TYPE element = heap[heap_size-1];  \
+   int child = heap_size-1;
\
+   while(child != 0)   
\
+   {   
\
+   int parent = (child-1) / 2; 
\
+   if(PRIORITY(element, heap[parent])) \
+   {   
\
+   heap[child] = heap[parent]; 
\
+   child = parent; 
\
+   }   
\
+   else break; 
\
+   }   
\
+   heap[child] = element;  
\
+}
+
+#define POP_HEAP_BODY(HEAP_TYPE, PRIORITY,heap,heap_size)  \
+{  
\
+   HEAP_TYPE element = heap[heap_size-1];  \
+   int parent = 0; 
\
+   while(parent  (heap_size-1)/2 )\
+   {   
\
+   int child2 = (parent+1)*2;  
\
+   if(PRIORITY(heap[child2-1], heap[child2]))  \
+   --child2;   
\
+   
\
+   if(PRIORITY(element, heap[child2])) \
+   break;  
\
+   
\
+   heap[parent] = heap[child2];\
+   parent = child2;
\
+   }   
\
+   heap[parent] = element; 
\
+}
+
+int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int 
*max_size, int size_per_item)
+{
+   int   new_max_size = *max_size * 2;
+   void *new_memblock = NULL;
+
+   if(new_size = *max_size)
+   return TRUE;
+
+   if(*memblock == local_memblock)
+   {
+   new_memblock = malloc( size_per_item * new_max_size );
+   memcpy( new_memblock, *memblock, size_per_item * *max_size );
+   }
+   else
+   new_memblock = realloc(*memblock, size_per_item * new_max_size 
);
+
+   if(new_memblock)
+   {
+   *memblock = new_memblock;
+   *max_size = new_max_size;
+   return TRUE;
+   }
+   else
+   return FALSE;
+}
+
+
 
//
 // Introsort 
 // with permission deriven from the following Java code:
@@ -1131,15 +1198,18 @@
 }
 
 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16182] trunk/blender/source/blender/ blenkernel: Little tweaks so 0 wind results in 0 noise, also removed double-mass dependancy in cloth

2008-08-18 Thread Daniel Genrich
Revision: 16182
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16182
Author:   genscher
Date: 2008-08-18 21:32:21 +0200 (Mon, 18 Aug 2008)

Log Message:
---
Little tweaks so 0 wind results in 0 noise, also removed double-mass dependancy 
in cloth

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_effect.h
trunk/blender/source/blender/blenkernel/intern/effect.c
trunk/blender/source/blender/blenkernel/intern/implicit.c

Modified: trunk/blender/source/blender/blenkernel/BKE_effect.h
===
--- trunk/blender/source/blender/blenkernel/BKE_effect.h2008-08-18 
19:31:40 UTC (rev 16181)
+++ trunk/blender/source/blender/blenkernel/BKE_effect.h2008-08-18 
19:32:21 UTC (rev 16182)
@@ -66,7 +66,7 @@
 void   pdDoEffectors(struct ListBase *lb, float *opco, float 
*force, float *speed, float cur_time, float loc_time, unsigned int flags);
 
 /* required for particle_system.c */
-void do_physical_effector(short type, float force_val, float distance, float 
falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float 
*velocity, float *field, int planar, struct RNG *rng, float noise);
+void do_physical_effector(short type, float force_val, float distance, float 
falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float 
*velocity, float *field, int planar, struct RNG *rng, float noise_factor);
 float effector_falloff(struct PartDeflect *pd, float *eff_velocity, float 
*vec_to_part);
 
 

Modified: trunk/blender/source/blender/blenkernel/intern/effect.c
===
--- trunk/blender/source/blender/blenkernel/intern/effect.c 2008-08-18 
19:31:40 UTC (rev 16181)
+++ trunk/blender/source/blender/blenkernel/intern/effect.c 2008-08-18 
19:32:21 UTC (rev 16182)
@@ -315,12 +315,12 @@
return falloff;
 }
 
-void do_physical_effector(short type, float force_val, float distance, float 
falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float 
*velocity, float *field, int planar, struct RNG *rng, float noise)
+void do_physical_effector(short type, float force_val, float distance, float 
falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float 
*velocity, float *field, int planar, struct RNG *rng, float noise_factor)
 {
float mag_vec[3]={0,0,0};
float temp[3], temp2[3];
float eff_vel[3];
-   float wind = 0;
+   float noise = 0;
 
VecCopyf(eff_vel,eff_velocity);
Normalize(eff_vel);
@@ -329,11 +329,11 @@
case PFIELD_WIND:
VECCOPY(mag_vec,eff_vel);

-   // add wind noise here
-   if(noise 0.0f)
-   wind = wind_func(rng, noise);
-
-   VecMulf(mag_vec,(force_val+wind)*falloff);
+   // add wind noise here, only if we have wind
+   if((noise_factor 0.0f)  (force_val  FLT_EPSILON))
+   noise = wind_func(rng, noise_factor);
+   
+   VecMulf(mag_vec,(force_val+noise)*falloff);
VecAddf(field,field,mag_vec);
break;
 

Modified: trunk/blender/source/blender/blenkernel/intern/implicit.c
===
--- trunk/blender/source/blender/blenkernel/intern/implicit.c   2008-08-18 
19:31:40 UTC (rev 16181)
+++ trunk/blender/source/blender/blenkernel/intern/implicit.c   2008-08-18 
19:32:21 UTC (rev 16182)
@@ -1452,6 +1452,7 @@
float triunnormal[3]={0,0,0}; // 
not-normalized-triangle normal
float tmp[3]={0,0,0};
float factor = (mfaces[i].v4) ? 0.25 : 1.0 / 3.0;
+   factor *= 0.02;

// calculate face normal
if(mfaces[i].v4)
@@ -1465,24 +1466,24 @@
// add wind from v1
VECCOPY(tmp, trinormal);
VecMulf(tmp, 
calculateVertexWindForce(winvec[mfaces[i].v1], triunnormal));
-   VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], tmp, 
factor*verts[mfaces[i].v1].mass);
+   VECADDS(lF[mfaces[i].v1], lF[mfaces[i].v1], tmp, 
factor);

// add wind from v2
VECCOPY(tmp, trinormal);
VecMulf(tmp, 
calculateVertexWindForce(winvec[mfaces[i].v2], triunnormal));
-   VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], tmp, 
factor*verts[mfaces[i].v2].mass);
+   VECADDS(lF[mfaces[i].v2], lF[mfaces[i].v2], tmp, 
factor);

  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16183] branches/harmonic-skeleton/source/ blender: Make subgraph tagging use own index, to not interfere with flagging used to prevent backtracking i

2008-08-18 Thread Martin Poirier
Revision: 16183
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16183
Author:   theeth
Date: 2008-08-19 00:22:56 +0200 (Tue, 19 Aug 2008)

Log Message:
---
Make subgraph tagging use own index, to not interfere with flagging used to 
prevent backtracking in different other functions

Better deal with chains starting with control bones

Modified Paths:
--
branches/harmonic-skeleton/source/blender/blenlib/BLI_graph.h
branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c
branches/harmonic-skeleton/source/blender/include/reeb.h
branches/harmonic-skeleton/source/blender/src/autoarmature.c
branches/harmonic-skeleton/source/blender/src/reeb.c

Modified: branches/harmonic-skeleton/source/blender/blenlib/BLI_graph.h
===
--- branches/harmonic-skeleton/source/blender/blenlib/BLI_graph.h   
2008-08-18 19:32:21 UTC (rev 16182)
+++ branches/harmonic-skeleton/source/blender/blenlib/BLI_graph.h   
2008-08-18 22:22:56 UTC (rev 16183)
@@ -40,6 +40,8 @@
 
int degree;
struct BArc **arcs;
+   
+   int subgraph_index;
 
int symmetry_level;
int symmetry_flag;
@@ -70,6 +72,8 @@
 void BLI_freeNode(BGraph *graph, BNode *node);
 void BLI_removeNode(BGraph *graph, BNode *node);
 
+void BLI_removeArc(BGraph *graph, BArc *arc);
+
 void BLI_flagNodes(BGraph *graph, int flag);
 void BLI_flagArcs(BGraph *graph, int flag);
 
@@ -84,7 +88,7 @@
 
 #define SHAPE_RADIX 10 /* each shape level is encoded this base */
 
-int BLI_subtreeShape(BNode *node, BArc *rootArc, int include_root);
+int BLI_subtreeShape(BGraph *graph, BNode *node, BArc *rootArc, int 
include_root);
 float BLI_subtreeLength(BNode *node);
 void BLI_calcGraphLength(BGraph *graph);
 

Modified: branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c
===
--- branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c
2008-08-18 19:32:21 UTC (rev 16182)
+++ branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c
2008-08-18 22:22:56 UTC (rev 16183)
@@ -64,6 +64,16 @@
return (arc-head == node) ? arc-tail : arc-head;
 }
 
+void BLI_removeArc(BGraph *graph, BArc *arc)
+{
+   if (graph-free_arc)
+   {
+   graph-free_arc(arc);
+   }
+
+   BLI_freelinkN(graph-arcs, arc);
+}
+
 void BLI_flagNodes(BGraph *graph, int flag)
 {
BNode *node;
@@ -236,12 +246,12 @@
 
 void flagSubgraph(BNode *node, int subgraph)
 {
-   if (node-flag == 0)
+   if (node-subgraph_index == 0)
{
BArc *arc;
int i;

-   node-flag = subgraph;
+   node-subgraph_index = subgraph;

for(i = 0; i  node-degree; i++)
{
@@ -261,11 +271,14 @@
BLI_buildAdjacencyList(graph);
}

-   BLI_flagNodes(graph, 0);
+   for(node = graph-nodes.first; node; node = node-next)
+   {
+   node-subgraph_index = 0;
+   }

for (node = graph-nodes.first; node; node = node-next)
{
-   if (node-flag == 0)
+   if (node-subgraph_index == 0)
{
subgraph++;
flagSubgraph(node, subgraph);
@@ -360,14 +373,16 @@
 
 /*** GRAPH AS TREE FUNCTIONS 
***/
 
-int BLI_subtreeShape(BNode *node, BArc *rootArc, int include_root)
+int subtreeShape(BNode *node, BArc *rootArc, int include_root)
 {
int depth = 0;

+   node-flag = 1;
+   
if (include_root)
{
BNode *newNode = BLI_otherNode(rootArc, node);
-   return BLI_subtreeShape(newNode, rootArc, 0);
+   return subtreeShape(newNode, rootArc, 0);
}
else
{
@@ -383,12 +398,12 @@
for(i = 0; i  node-degree; i++)
{
BArc *arc = node-arcs[i];
+   BNode *newNode = BLI_otherNode(arc, node);

-   /* only arcs that go down the tree */
-   if (arc != rootArc)
+   /* stop immediate and cyclic backtracking */
+   if (arc != rootArc  newNode-flag == 0)
{
-   BNode *newNode = BLI_otherNode(arc, 
node);
-   depth += BLI_subtreeShape(newNode, arc, 
0);
+   depth += subtreeShape(newNode, arc, 0);
}
}
}
@@ -397,6 +412,12 @@
}
 }
 
+int 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16184] trunk/blender/source/blender/ python/api2_2x: Python API

2008-08-18 Thread Ken Hughes
Revision: 16184
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16184
Author:   khughes
Date: 2008-08-19 00:39:55 +0200 (Tue, 19 Aug 2008)

Log Message:
---
Python API
--
Add Material.enabledTextures attribute; this allows users to enable and
disable textures assigned to a material.

Modified Paths:
--
trunk/blender/source/blender/python/api2_2x/Material.c
trunk/blender/source/blender/python/api2_2x/doc/Material.py

Modified: trunk/blender/source/blender/python/api2_2x/Material.c
===
--- trunk/blender/source/blender/python/api2_2x/Material.c  2008-08-18 
22:22:56 UTC (rev 16183)
+++ trunk/blender/source/blender/python/api2_2x/Material.c  2008-08-18 
22:39:55 UTC (rev 16184)
@@ -554,6 +554,7 @@
 static int Material_setSssFront( BPy_Material * self, PyObject * value );
 static int Material_setSssBack( BPy_Material * self, PyObject * value );
 static int Material_setSssBack( BPy_Material * self, PyObject * value );
+static int Material_setTexChannel( BPy_Material * self, PyObject * value );
 
 static PyObject *Material_getColorComponent( BPy_Material * self,
void * closure );
@@ -633,6 +634,7 @@
 static PyObject *Material_getFilter( BPy_Material * self );
 static PyObject *Material_getTranslucency( BPy_Material * self );
 static PyObject *Material_getTextures( BPy_Material * self );
+static PyObject *Material_getTexChannel( BPy_Material * self );
 static PyObject *Material_clearIpo( BPy_Material * self );
 
 static PyObject *Material_setTexture( BPy_Material * self, PyObject * args );
@@ -1140,8 +1142,12 @@
 NULL},
{lightGroup,
 (getter)Material_getLightGroup, (setter)Material_setLightGroup,
-Set the light group for this material,
+The light group for this material,
 NULL},
+   {enabledTextures,
+(getter)Material_getTexChannel, (setter)Material_setTexChannel,
+Enabled texture channels for this material,
+NULL},
{R,
 (getter)Material_getColorComponent, (setter)Material_setColorComponent,
 Diffuse color red component,
@@ -1517,6 +1523,36 @@
return Group_CreatePyObject( self-material-group );
 }
 
+static PyObject *Material_getTexChannel( BPy_Material * self )
+{
+   int i;
+short mask = 1;
+   PyObject *list = PyList_New(0);
+   if( !list )
+   return EXPP_ReturnPyObjError( PyExc_MemoryError,
+   PyList_New() failed );
+
+   for( i = 0, mask = 1; i  MAX_MTEX ; ++i, mask = 1 ) {
+   if( self-material-mtex[i]  (mask  self-material-septex) 
== 0 ) {
+   PyObject * val = PyInt_FromLong(i);
+   if( !val ) {
+   Py_DECREF( list );
+   return EXPP_ReturnPyObjError( PyExc_MemoryError,
+   PyInt_FromLong() failed );
+   }
+   if( PyList_Append( list, val )  0 ) {
+   Py_DECREF( val );
+   Py_DECREF( list );
+   return EXPP_ReturnPyObjError( 
PyExc_RuntimeError,
+   PyList_Append() failed );
+   }
+   Py_DECREF( val );
+   }
+   }
+
+   return list;
+}
+
 static PyObject *Material_getHaloSize( BPy_Material * self )
 {
return PyFloat_FromDouble( ( double ) self-material-hasize );
@@ -1982,6 +2018,57 @@
return GenericLib_assignData(value, (void **) self-material-group, 
NULL, 1, ID_GR, 0);
 }
 
+static int Material_setTexChannel( BPy_Material * self, PyObject * value )
+{
+   int i, mask;
+   short septex = 0;
+   int result = 1;
+
+   /* fail if input is not a standard sequence */
+   if( !PyList_Check( value )  !PyTuple_Check( value ) )
+   return EXPP_ReturnIntError( PyExc_TypeError,
+   expected tuple or list of 
integers );
+
+   /* get a fast sequence; in Python 2.5, this just return the original
+* list or tuple and INCREFs it, so we must DECREF */
+   value = PySequence_Fast( value,  );
+
+   /* set the disable bit for each existing texture */
+   for( i= 0, mask= 1; i  MAX_MTEX; ++i, mask = 1 )
+   if( self-material-mtex[i] != NULL )
+   septex |= mask;
+
+   /* check the list, and build new septex value */
+   for( i= PySequence_Size(value)-1; i = 0; --i ) {
+   long ival;
+   PyObject *item = PySequence_Fast_GET_ITEM( value, i );
+   if( !PyInt_Check( item ) ) {
+   PyErr_SetString ( PyExc_TypeError,
+   expected 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16185] trunk/blender/source/gameengine/ BlenderRoutines/BL_KetsjiEmbedStart.cpp: BGE Blend file loading was using BLO_read_from_memory which meant re

2008-08-18 Thread Campbell Barton
Revision: 16185
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16185
Author:   campbellbarton
Date: 2008-08-19 01:48:59 +0200 (Tue, 19 Aug 2008)

Log Message:
---
BGE Blend file loading was using BLO_read_from_memory which meant relative 
linked libraries could not be found.
This is odd because BLO_read_from_file was commented out with //this doesn't 
work anymore for relative paths, so use BLO_read_from_memory instead
Undoing Erwins changes from r7497, just use normal file loading. From the 
commit log its not clear if he means relative filenames or relative linked libs 
but from testing both work now.

Modified Paths:
--
trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp

Modified: 
trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
===
--- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 
2008-08-18 22:39:55 UTC (rev 16184)
+++ trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 
2008-08-18 23:48:59 UTC (rev 16185)
@@ -90,33 +90,10 @@
 
 static BlendFileData *load_game_data(char *filename) {
BlendReadError error;
-   //this doesn't work anymore for relative paths, so use 
BLO_read_from_memory instead
-   //BlendFileData *bfd= BLO_read_from_file(filename, error);
-   FILE* file = fopen(filename,rb);
-   BlendFileData *bfd  = 0;
-   if (file)
-   {
-   fseek(file, 0L, SEEK_END);
-   int len= ftell(file);
-   fseek(file, 0L, SEEK_SET);  
-   char* filebuffer= new char[len];//MEM_mallocN(len, 
text_buffer);
-   int sizeread = fread(filebuffer,len,1,file);
-   if (sizeread==1){
-   bfd = BLO_read_from_memory(filebuffer, len, error);
-   } else {
-   error = BRE_UNABLE_TO_READ;
-   }
-   fclose(file);
-   // the memory is not released in BLO_read_from_memory, must do 
it here
-   delete filebuffer;
-   } else {
-   error = BRE_UNABLE_TO_OPEN;
-   }
-
+   BlendFileData *bfd= BLO_read_from_file(filename, error);
if (!bfd) {
printf(Loading %s failed: %s\n, filename, 
BLO_bre_as_string(error));
}
-   
return bfd;
 }
 


___
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 [16186] branches/apricot/source: svn merge -r16170:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender

2008-08-18 Thread Campbell Barton
Revision: 16186
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16186
Author:   campbellbarton
Date: 2008-08-19 06:00:22 +0200 (Tue, 19 Aug 2008)

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

Modified Paths:
--
branches/apricot/source/blender/blenkernel/BKE_collision.h
branches/apricot/source/blender/blenkernel/BKE_effect.h
branches/apricot/source/blender/blenkernel/intern/collision.c
branches/apricot/source/blender/blenkernel/intern/effect.c
branches/apricot/source/blender/blenkernel/intern/implicit.c
branches/apricot/source/blender/blenkernel/intern/modifier.c
branches/apricot/source/blender/blenkernel/intern/particle_system.c
branches/apricot/source/blender/makesdna/DNA_modifier_types.h
branches/apricot/source/blender/python/api2_2x/Material.c
branches/apricot/source/blender/python/api2_2x/Text3d.c
branches/apricot/source/blender/python/api2_2x/doc/Material.py
branches/apricot/source/blender/python/api2_2x/doc/Text3d.py
branches/apricot/source/blender/src/buttons_object.c
branches/apricot/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp

Modified: branches/apricot/source/blender/blenkernel/BKE_collision.h
===
--- branches/apricot/source/blender/blenkernel/BKE_collision.h  2008-08-18 
23:48:59 UTC (rev 16185)
+++ branches/apricot/source/blender/blenkernel/BKE_collision.h  2008-08-19 
04:00:22 UTC (rev 16186)
@@ -119,8 +119,10 @@
 /
 // used in modifier.c from collision.c
 /
+
 BVHTree *bvhtree_build_from_mvert ( MFace *mfaces, unsigned int numfaces, 
MVert *x, unsigned int numverts, float epsilon );
 void bvhtree_update_from_mvert ( BVHTree * bvhtree, MFace *faces, int 
numfaces, MVert *x, MVert *xnew, int numverts, int moving );
+
 /
 
 LinkNode *BLI_linklist_append_fast ( LinkNode **listp, void *ptr );
@@ -134,6 +136,15 @@
 void interpolateOnTriangle ( float to[3], float v1[3], float v2[3], float 
v3[3], double w1, double w2, double w3 );
 
 /
+// used in effect.c
+/
+CollisionModifierData **get_collisionobjects(Object *self, int *numcollobj);
 
+/
+
+
+
+/
+
 #endif
 

Modified: branches/apricot/source/blender/blenkernel/BKE_effect.h
===
--- branches/apricot/source/blender/blenkernel/BKE_effect.h 2008-08-18 
23:48:59 UTC (rev 16185)
+++ branches/apricot/source/blender/blenkernel/BKE_effect.h 2008-08-19 
04:00:22 UTC (rev 16186)
@@ -66,7 +66,7 @@
 void   pdDoEffectors(struct ListBase *lb, float *opco, float 
*force, float *speed, float cur_time, float loc_time, unsigned int flags);
 
 /* required for particle_system.c */
-void do_physical_effector(short type, float force_val, float distance, float 
falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float 
*velocity, float *field, int planar, struct RNG *rng, float noise);
+void do_physical_effector(short type, float force_val, float distance, float 
falloff, float size, float damp, float *eff_velocity, float *vec_to_part, float 
*velocity, float *field, int planar, struct RNG *rng, float noise_factor);
 float effector_falloff(struct PartDeflect *pd, float *eff_velocity, float 
*vec_to_part);
 
 

Modified: branches/apricot/source/blender/blenkernel/intern/collision.c
===
--- branches/apricot/source/blender/blenkernel/intern/collision.c   
2008-08-18 23:48:59 UTC (rev 16185)
+++ branches/apricot/source/blender/blenkernel/intern/collision.c   
2008-08-19 04:00:22 UTC (rev 16186)
@@ -31,10 +31,11 @@
 
 #include BKE_cloth.h
 
+#include DNA_cloth_types.h
 #include DNA_group_types.h
+#include DNA_mesh_types.h
 #include DNA_object_types.h
-#include DNA_cloth_types.h
-#include DNA_mesh_types.h
+#include DNA_object_force.h
 #include DNA_scene_types.h
 
 #include BKE_DerivedMesh.h
@@ -1307,10 +1308,35 @@
for ( base = G.scene-base.first; base; base = base-next )
{
coll_ob = base-object;
-   collmd = ( CollisionModifierData * ) modifiers_findByType ( 
coll_ob, eModifierType_Collision );
-   
-   if ( !collmd )
+   
+   if(coll_ob-pd  coll_ob-pd-deflect)
{
+   collmd = ( CollisionModifierData * ) 
modifiers_findByType ( coll_ob, eModifierType_Collision );
+   }
+   
+   if ( collmd )
+   {
+   if(coll_ob == self)
+