[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15466] branches/fluidcontrol: Another addition of time values, yet some things to follow

2008-07-07 Thread Daniel Genrich
Revision: 15466
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15466
Author:   genscher
Date: 2008-07-07 11:23:12 +0200 (Mon, 07 Jul 2008)

Log Message:
---
Another addition of time values, yet some things to follow

Modified Paths:
--
branches/fluidcontrol/intern/elbeem/extern/elbeem.h
branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp
branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.h
branches/fluidcontrol/intern/elbeem/intern/solver_control.cpp
branches/fluidcontrol/source/blender/makesdna/DNA_object_fluidsim.h
branches/fluidcontrol/source/blender/src/buttons_object.c
branches/fluidcontrol/source/blender/src/fluidsim.c

Modified: branches/fluidcontrol/intern/elbeem/extern/elbeem.h
===
--- branches/fluidcontrol/intern/elbeem/extern/elbeem.h 2008-07-07 06:13:58 UTC 
(rev 15465)
+++ branches/fluidcontrol/intern/elbeem/extern/elbeem.h 2008-07-07 09:23:12 UTC 
(rev 15466)
@@ -160,6 +160,9 @@
const char *name;

/* fluid control settings */
+   float cpsTimeStart;
+   float cpsTimeEnd;
+   
// TODO dg: change to channels
float attractforceStrength;
float attractforceRadius;

Modified: branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp
===
--- branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp   2008-07-07 
06:13:58 UTC (rev 15465)
+++ branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp   2008-07-07 
09:23:12 UTC (rev 15466)
@@ -161,6 +161,9 @@
mesh->name = "[unnamed]";

/* fluid control settings */
+   mesh->cpsTimeStart = 0;
+   mesh->cpsTimeEnd = 0;
+   
mesh->attractforceStrength = 0;
mesh->attractforceRadius = 0;
mesh->velocityforceStrength = 0;
@@ -206,6 +209,8 @@
obj->setGeoImpactFactor(mesh->obstacleImpactFactor);

/* fluid control features */
+   obj->setCpsTimeStart(mesh->cpsTimeStart);
+   obj->setCpsTimeEnd(mesh->cpsTimeEnd);
obj->setAttractForceStrength(mesh->attractforceStrength);
obj->setAttractForceRadius(mesh->attractforceRadius);
obj->setVelocityForceStrength(mesh->velocityforceStrength);

Modified: branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.h
===
--- branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.h 
2008-07-07 06:13:58 UTC (rev 15465)
+++ branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.h 
2008-07-07 09:23:12 UTC (rev 15466)
@@ -102,6 +102,14 @@
/* fluid control features */
//
/*! Set/get the particle control set attract force strength */
+   inline float getCpsTimeStart() const { return mCpsTimeStart; }
+   inline void setCpsTimeStart(float set) { mCpsTimeStart=set; }
+   
+   /*! Set/get the particle control set attract force strength */
+   inline float getCpsTimeEnd() const { return mCpsTimeEnd; }
+   inline void setCpsTimeEnd(float set) { mCpsTimeEnd=set; }
+   
+   /*! Set/get the particle control set attract force strength */
inline float getAttractForceStrength() const { return 
mAttractforceStrength; }
inline void setAttractForceStrength(float set) { 
mAttractforceStrength=set; }

@@ -225,6 +233,9 @@
AnimChannel mcGeoActive;

/* fluid control settings */
+   float mCpsTimeStart;
+   float mCpsTimeEnd
+   ;
// TODO dg: change to channels
float mAttractforceStrength;
float mAttractforceRadius;

Modified: branches/fluidcontrol/intern/elbeem/intern/solver_control.cpp
===
--- branches/fluidcontrol/intern/elbeem/intern/solver_control.cpp   
2008-07-07 06:13:58 UTC (rev 15465)
+++ branches/fluidcontrol/intern/elbeem/intern/solver_control.cpp   
2008-07-07 09:23:12 UTC (rev 15466)
@@ -239,6 +239,9 @@
cset->mcForceVel = 
AnimChannel(obj->getVelocityForceStrength());
cset->mcRadiusVel = 
AnimChannel(obj->getVelocityForceRadius());
 
+   cset->mCparts->setCPSTimeStart(obj->getCpsTimeStart());
+   cset->mCparts->setCPSTimeEnd(obj->getCpsTimeEnd());
+   
// this value can be left at 0.5:
cset->mCparts->setCPSMvmWeightFac(0.5);
 

Modified: branches/fluidcontrol/source/blender/makesdna/DNA_object_fluidsim.h
=

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

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

Log Message:
---
Apricot Branch: GLSL


* Added a separate "Layer" option for lamp shadows, that only
  restricts which objects cast shadow, instead of receive light
  and shadow.
* Added exp/log compatibility for GLSL versions < 1.10.
* Check for depth texture extension before using it.

Modified Paths:
--
branches/apricot/source/blender/gpu/intern/gpu_codegen.c
branches/apricot/source/blender/gpu/intern/gpu_extensions.c
branches/apricot/source/blender/gpu/intern/gpu_material.c
branches/apricot/source/blender/makesdna/DNA_lamp_types.h
branches/apricot/source/blender/python/api2_2x/Lamp.c
branches/apricot/source/blender/render/intern/include/render_types.h
branches/apricot/source/blender/render/intern/source/rayshade.c
branches/apricot/source/blender/render/intern/source/shadbuf.c
branches/apricot/source/blender/render/intern/source/zbuf.c
branches/apricot/source/blender/src/buttons_shading.c
branches/apricot/source/blender/src/drawview.c

Added Paths:
---
branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl
branches/apricot/source/blender/gpu/intern/gpu_shader_vertex.glsl
branches/apricot/source/blender/gpu/intern/gpu_shader_vertex.glsl.c

Removed Paths:
-
branches/apricot/source/blender/gpu/intern/material_shaders.glsl
branches/apricot/source/blender/gpu/intern/material_vertex_shader.glsl
branches/apricot/source/blender/gpu/intern/material_vertex_shader.glsl.c

Modified: branches/apricot/source/blender/gpu/intern/gpu_codegen.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-07 
09:23:12 UTC (rev 15466)
+++ branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-07 
10:52:09 UTC (rev 15467)
@@ -51,8 +51,6 @@
 #include "GPU_extensions.h"
 
 #include "gpu_codegen.h"
-#include "material_vertex_shader.glsl.c"
-#include "material_shaders.glsl.c"
 
 #include 
 #include 
@@ -66,6 +64,9 @@
 #endif
 #endif
 
+extern char datatoc_gpu_shader_material_glsl[];
+extern char datatoc_gpu_shader_vertex_glsl[];
+
 /* structs and defines */
 
 typedef enum GPUDataSource {
@@ -344,9 +345,9 @@
 {
if(!FUNCTION_HASH) {
FUNCTION_HASH = BLI_ghash_new(BLI_ghashutil_strhash, 
BLI_ghashutil_strcmp);
-   gpu_parse_functions_string(FUNCTION_HASH, 
datatoc_material_shaders_glsl);
+   gpu_parse_functions_string(FUNCTION_HASH, 
datatoc_gpu_shader_material_glsl);
FUNCTION_PROTOTYPES = 
gpu_generate_function_prototyps(FUNCTION_HASH);
-   FUNCTION_LIB = 
GPU_shader_create_lib(datatoc_material_shaders_glsl);
+   FUNCTION_LIB = 
GPU_shader_create_lib(datatoc_gpu_shader_material_glsl);
}
 
return (GPUFunction*)BLI_ghash_lookup(FUNCTION_HASH, name);
@@ -698,7 +699,7 @@
}
 
BLI_dynstr_append(ds, "\n");
-   BLI_dynstr_append(ds, datatoc_material_vertex_shader_glsl);
+   BLI_dynstr_append(ds, datatoc_gpu_shader_vertex_glsl);
 
for (node=nodes->first; node; node=node->next)
for (input=node->inputs.first; input; input=input->next)

Modified: branches/apricot/source/blender/gpu/intern/gpu_extensions.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_extensions.c 2008-07-07 
09:23:12 UTC (rev 15466)
+++ branches/apricot/source/blender/gpu/intern/gpu_extensions.c 2008-07-07 
10:52:09 UTC (rev 15467)
@@ -260,6 +260,9 @@
GLenum type, format;
void *pixels = NULL;
 
+   if(depth && !GLEW_ARB_depth_texture)
+   return NULL;
+
tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
tex->w = tex->realw = w;
tex->h = tex->realh = h;
@@ -285,10 +288,10 @@
tex->number = 0;
glBindTexture(tex->target, tex->bindcode);
 
-   if(depth) { /* TODO extensions */
+   if(depth) {
type = GL_UNSIGNED_BYTE;
format = GL_DEPTH_COMPONENT;
-   tex->internalformat = GL_DEPTH_COMPONENT16;
+   tex->internalformat = GL_DEPTH_COMPONENT;
}
else if (halffloat && (GLEW_ARB_texture_float || 
GLEW_ATI_texture_float)) {
type = GL_FLOAT;

Modified: branches/apricot/source/blender/gpu/intern/gpu_material.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-07-07 
09:23:12 UTC (rev 15466)
+++ branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-07-07 
10:52:09 UTC (rev 15467)
@@ -1184,9 +1184,9 @@
 
 int GPU_lamp_shadow_layer(GPULamp *lamp)
 {
-   if(lamp->fb && lamp->tex && (la

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

2008-07-07 Thread Brecht Van Lommel
Revision: 15468
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15468
Author:   blendix
Date: 2008-07-07 13:58:09 +0200 (Mon, 07 Jul 2008)

Log Message:
---
Apricot Branch: GLSL


* Forgot to add/remove file in list commit.
* Game engine shadow optimization, don't use shaders for
  drawing into shadow buffer.

Modified Paths:
--
branches/apricot/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
branches/apricot/source/gameengine/Rasterizer/RAS_IRasterizer.h
branches/apricot/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp

branches/apricot/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

branches/apricot/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp

Added Paths:
---
branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c

Removed Paths:
-
branches/apricot/source/blender/gpu/intern/material_shaders.glsl.c

Added: branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c   
(rev 0)
+++ branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c   
2008-07-07 11:58:09 UTC (rev 15468)
@@ -0,0 +1,1055 @@
+/* DataToC output of file  */
+
+int datatoc_gpu_shader_material_glsl_size= 33564;
+char datatoc_gpu_shader_material_glsl[]= {
+ 10, 35,105,102, 32, 95, 95, 86, 69, 82, 83, 73, 79, 78, 95, 95, 32, 60, 32, 
49, 49, 48, 10, 10,102,108,111, 97,
+116, 32,101,120,112, 40,102,108,111, 97,116, 32,102, 41, 10,123, 10,  
9,114,101,116,117,114,110, 32,112,111,119, 40, 50, 46, 55,
+ 49, 56, 50, 56, 49, 56, 50, 56, 52, 54, 44, 32,102, 41, 59, 10,125, 10, 
10,102,108,111, 97,116, 32,108,111,103, 40,102,108,111,
+ 97,116, 32,102, 41, 10,123, 10,  9,114,101,116,117,114,110, 32,108,111,103, 
50, 40,102, 41, 47,108,111,103, 50, 40, 50, 46, 55,
+ 49, 56, 50, 56, 49, 56, 50, 56, 52, 54, 41, 59, 10,125, 10, 10, 
35,101,110,100,105,102, 10, 10,118,111,105,100, 32,114,103, 98,
+ 95,116,111, 95,104,115,118, 40,118,101, 99, 52, 32,114,103, 98, 44, 
32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,
+108, 41, 10,123, 10,  9,102,108,111, 97,116, 32, 99,109, 97,120, 44, 32, 
99,109,105,110, 44, 32,104, 44, 32,115, 44, 32,118, 44,
+ 32, 99,100,101,108,116, 97, 59, 10,  9,118,101, 99, 51, 32, 99, 59, 10, 10,  
9, 99,109, 97,120, 32, 61, 32,109, 97,120, 40,114,
+103, 98, 91, 48, 93, 44, 32,109, 97,120, 40,114,103, 98, 91, 49, 93, 44, 
32,114,103, 98, 91, 50, 93, 41, 41, 59, 10,  9, 99,109,
+105,110, 32, 61, 32,109,105,110, 40,114,103, 98, 91, 48, 93, 44, 
32,109,105,110, 40,114,103, 98, 91, 49, 93, 44, 32,114,103, 98,
+ 91, 50, 93, 41, 41, 59, 10,  9, 99,100,101,108,116, 97, 32, 61, 32, 99,109, 
97,120, 45, 99,109,105,110, 59, 10, 10,  9,118, 32,
+ 61, 32, 99,109, 97,120, 59, 10,  9,105,102, 32, 40, 99,109, 97,120, 33, 61, 
48, 46, 48, 41, 10,  9,  9,115, 32, 61, 32, 99,100,
+101,108,116, 97, 47, 99,109, 97,120, 59, 10,  9,101,108,115,101, 32,123, 10,  
9,  9,115, 32, 61, 32, 48, 46, 48, 59, 10,  9,  9,
+104, 32, 61, 32, 48, 46, 48, 59, 10,  9,125, 10, 10,  9,105,102, 32, 40,115, 
32, 61, 61, 32, 48, 46, 48, 41, 32,123, 10,  9,  9,
+104, 32, 61, 32, 48, 46, 48, 59, 10,  9,125, 10,  9,101,108,115,101, 32,123, 
10,  9,  9, 99, 32, 61, 32, 40,118,101, 99, 51, 40,
+ 99,109, 97,120, 44, 32, 99,109, 97,120, 44, 32, 99,109, 97,120, 41, 32, 45, 
32,114,103, 98, 46,120,121,122, 41, 47, 99,100,101,
+108,116, 97, 59, 10, 10,  9,  9,105,102, 32, 40,114,103, 98, 46,120, 61, 61, 
99,109, 97,120, 41, 32,104, 32, 61, 32, 99, 91, 50,
+ 93, 32, 45, 32, 99, 91, 49, 93, 59, 10,  9,  9,101,108,115,101, 32,105,102, 
32, 40,114,103, 98, 46,121, 61, 61, 99,109, 97,120,
+ 41, 32,104, 32, 61, 32, 50, 46, 48, 32, 43, 32, 99, 91, 48, 93, 32, 45, 32, 
32, 99, 91, 50, 93, 59, 10,  9,  9,101,108,115,101,
+ 32,104, 32, 61, 32, 52, 46, 48, 32, 43, 32, 99, 91, 49, 93, 32, 45, 32, 99, 
91, 48, 93, 59, 10, 10,  9,  9,104, 32, 47, 61, 32,
+ 54, 46, 48, 59, 10, 10,  9,  9,105,102, 32, 40,104, 60, 48, 46, 48, 41, 10,  
9,  9,  9,104, 32, 43, 61, 32, 49, 46, 48, 59, 10,
+  9,125, 10, 10,  9,111,117,116, 99,111,108, 32, 61, 32,118,101, 99, 52, 
40,104, 44, 32,115, 44, 32,118, 44, 32,114,103, 98, 46,
+119, 41, 59, 10,125, 10, 10,118,111,105,100, 32,104,115,118, 95,116,111, 
95,114,103, 98, 40,118,101, 99, 52, 32,104,115,118, 44,
+ 32,111,117,116, 32,118,101, 99, 52, 32,111,117,116, 99,111,108, 41, 10,123, 
10,  9,102,108,111, 97,116, 32,105, 44, 32,102, 44,
+ 32,112, 44, 32,113, 44, 32,116, 44, 32,104, 44, 32,115, 44, 32,118, 59, 10,  
9,118,101, 99, 51, 32,114,103, 98, 59, 10, 10,  9,
+104, 32, 61, 32,104,115,118, 91, 48, 93, 59, 10,  9,115, 32, 61, 
32,104,115,118, 91, 49, 93, 59, 10,  9,118, 32, 61, 32,104,115,
+118, 91, 50, 93, 59, 10, 10,  9,105,102, 40,115, 61, 6

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

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

Log Message:
---
Apricot Branch
==

Some optimizations:
* Only Apply mesh deformer if the mesh is actually modified, once
  per frame, this was done too often before.
* GLSL shader binding is now faster, only goes over dynamics inputs
  instead of all of them, and frees more memory after compiling too.

Modified Paths:
--
branches/apricot/source/blender/gpu/intern/gpu_codegen.c
branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.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
branches/apricot/source/gameengine/Ketsji/KX_Scene.cpp

Modified: branches/apricot/source/blender/gpu/intern/gpu_codegen.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-07 
11:58:09 UTC (rev 15468)
+++ branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-07 
13:57:29 UTC (rev 15469)
@@ -152,13 +152,14 @@
char attribname[32];/* attribute name */
int attribfirst;/* this is the first one that is bound 
*/
GPUBuiltin builtin; /* builtin uniform */
+
+   char shadername[32];/* name in shader */
 } GPUInput;
 
 struct GPUPass {
struct GPUPass *next, *prev;
 
-   ListBase nodes;
-   int firstbind;
+   ListBase inputs;
struct GPUOutput *output;
struct GPUShader *shader;
 };
@@ -730,92 +731,121 @@
return pass->shader;
 }
 
-void GPU_pass_bind(GPUPass *pass)
+void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes)
 {
+   GPUShader *shader = pass->shader;
GPUNode *node;
-   GPUInput *input;
-   GPUShader *shader = pass->shader;
-   ListBase *nodes = &pass->nodes;
-   DynStr *ds;
-   char *name;
+   GPUInput *next, *input;
+   ListBase *inputs = &pass->inputs;
+   int extract;
 
-   if (!shader)
+   memset(inputs, 0, sizeof(*inputs));
+
+   if(!shader)
return;
 
-   /* create textures first, otherwise messes up multitexture state for
-* following textures*/
-   for (node=nodes->first; node; node=node->next)
-   for (input=node->inputs.first; input; input=input->next)
-   if (input->ima)
-   input->tex = 
GPU_texture_from_blender(input->ima, input->iuser);
-
GPU_shader_bind(shader);
 
for (node=nodes->first; node; node=node->next) {
-   for (input=node->inputs.first; input; input=input->next) {
+   for (input=node->inputs.first; input; input=next) {
+   next = input->next;
+
/* attributes don't need to be bound, they already have
 * an id that the drawing functions will use */
if(input->source == GPU_SOURCE_ATTRIB ||
   input->source == GPU_SOURCE_BUILTIN)
continue;
 
-   /* pass samplers and uniforms to opengl */
-   if (input->link)
-   input->tex = NULL; /* input->link->tex; */
-
-   ds = BLI_dynstr_new();
-   if (input->tex)
-   BLI_dynstr_printf(ds, "samp%d", input->texid);
+   if (input->ima || input->tex)
+   snprintf(input->shadername, 
sizeof(input->shadername), "samp%d", input->texid);
else
-   BLI_dynstr_printf(ds, "unf%d", input->id);
-   name = BLI_dynstr_get_cstring(ds);
-   BLI_dynstr_free(ds);
+   snprintf(input->shadername, 
sizeof(input->shadername), "unf%d", input->id);
 
-   if (input->tex) {
-   if (input->bindtex) {
-   if(pass->firstbind);
-   GPU_texture_bind(input->tex, 
input->texid);
-   GPU_shader_uniform_texture(shader, 
name, input->tex);
-   }
+   /* pass non-dynamic uniforms to opengl */
+   extract = 0;
+
+   if(input->ima || input->tex) {
+   if (input->bindtex)
+   extract = 1;
}
  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15470] branches/fluidcontrol: WIP commit to introduce channels

2008-07-07 Thread Daniel Genrich
Revision: 15470
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15470
Author:   genscher
Date: 2008-07-07 16:36:33 +0200 (Mon, 07 Jul 2008)

Log Message:
---
WIP commit to introduce channels

Modified Paths:
--
branches/fluidcontrol/intern/elbeem/extern/elbeem.h
branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp
branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp
branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.h
branches/fluidcontrol/intern/elbeem/intern/solver_control.cpp
branches/fluidcontrol/intern/elbeem/intern/solver_init.cpp
branches/fluidcontrol/source/blender/blenkernel/intern/ipo.c
branches/fluidcontrol/source/blender/makesdna/DNA_ipo_types.h
branches/fluidcontrol/source/blender/src/editipo.c
branches/fluidcontrol/source/blender/src/editipo_lib.c
branches/fluidcontrol/source/blender/src/fluidsim.c

Modified: branches/fluidcontrol/intern/elbeem/extern/elbeem.h
===
--- branches/fluidcontrol/intern/elbeem/extern/elbeem.h 2008-07-07 13:57:29 UTC 
(rev 15469)
+++ branches/fluidcontrol/intern/elbeem/extern/elbeem.h 2008-07-07 14:36:33 UTC 
(rev 15470)
@@ -163,11 +163,14 @@
float cpsTimeStart;
float cpsTimeEnd;

-   // TODO dg: change to channels
-   float attractforceStrength;
-   float attractforceRadius;
-   float velocityforceStrength;
-   float velocityforceRadius;
+   int channelSizeAttractforceStrength;
+   float *channelAttractforceStrength;
+   int channelSizeAttractforceRadius;
+   float *channelAttractforceRadius;
+   int channelSizeVelocityforceStrength;
+   float *channelVelocityforceStrength;
+   int channelSizeVelocityforceRadius;
+   float *channelVelocityforceRadius;
 } elbeemMesh;
 
 // API functions

Modified: branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp
===
--- branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp   2008-07-07 
13:57:29 UTC (rev 15469)
+++ branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp   2008-07-07 
14:36:33 UTC (rev 15470)
@@ -164,10 +164,14 @@
mesh->cpsTimeStart = 0;
mesh->cpsTimeEnd = 0;

-   mesh->attractforceStrength = 0;
-   mesh->attractforceRadius = 0;
-   mesh->velocityforceStrength = 0;
-   mesh->velocityforceRadius = 0;
+   mesh->channelSizeAttractforceStrength = 0;
+   mesh->channelAttractforceStrength = NULL;
+   mesh->channelSizeAttractforceRadius = 0;
+   mesh->channelAttractforceRadius = NULL;
+   mesh->channelSizeVelocityforceStrength = 0;
+   mesh->channelVelocityforceStrength = NULL;
+   mesh->channelSizeVelocityforceRadius = 0;
+   mesh->channelVelocityforceRadius = NULL;
 }
 
 int globalMeshCounter = 1;
@@ -211,10 +215,6 @@
/* fluid control features */
obj->setCpsTimeStart(mesh->cpsTimeStart);
obj->setCpsTimeEnd(mesh->cpsTimeEnd);
-   obj->setAttractForceStrength(mesh->attractforceStrength);
-   obj->setAttractForceRadius(mesh->attractforceRadius);
-   obj->setVelocityForceStrength(mesh->velocityforceStrength);
-   obj->setVelocityForceRadius(mesh->velocityforceRadius);


if((mesh->volumeInitTypevolumeInitType>VOLUMEINIT_BOTH))
 mesh->volumeInitType = VOLUMEINIT_VOLUME;
obj->setVolumeInit(mesh->volumeInitType);
@@ -224,7 +224,11 @@
mesh->channelSizeRotation,mesh->channelRotation, 
mesh->channelSizeScale,   mesh->channelScale,
mesh->channelSizeActive,  mesh->channelActive,
-   mesh->channelSizeInitialVel,  mesh->channelInitialVel
+   mesh->channelSizeInitialVel,  mesh->channelInitialVel,
+   mesh->channelSizeAttractforceStrength,  
mesh->channelAttractforceStrength,
+   mesh->channelSizeAttractforceRadius,  
mesh->channelAttractforceRadius,
+   mesh->channelSizeVelocityforceStrength,  
mesh->channelVelocityforceStrength,
+   mesh->channelSizeVelocityforceRadius,  
mesh->channelVelocityforceRadius
);
obj->setLocalCoordInivel( mesh->localInivelCoords );
 

Modified: branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp
===
--- branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp   
2008-07-07 13:57:29 UTC (rev 15469)
+++ branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp   
2008-07-07 14:36:33 UTC (rev 15470)
@@ -41,7 +41,8 @@
mCachedMovPoints(), mCachedMovNormals(),
mTriangleDivs1(), mTriangleDivs2(), mTriangleDivs3(),
mMovPntsInited(-100.0), mMaxMovPnt(-1),
-   mcGeoActive(1.)
+   mcGeo

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

2008-07-07 Thread Brecht Van Lommel
Revision: 15471
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15471
Author:   blendix
Date: 2008-07-07 17:12:42 +0200 (Mon, 07 Jul 2008)

Log Message:
---
Apricot Branch:
Bugfix to make custom glsl shaders work with blender glsl shaders.

Modified Paths:
--
branches/apricot/source/blender/gpu/intern/gpu_codegen.c
branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp
branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp

Modified: branches/apricot/source/blender/gpu/intern/gpu_codegen.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-07 
14:36:33 UTC (rev 15470)
+++ branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-07 
15:12:42 UTC (rev 15471)
@@ -141,19 +141,19 @@
int definetex;  /* input is responsible for defining 
the pixel? */
int textarget;  /* GL_TEXTURE_* */
 
+   struct Image *ima;  /* image */
+   struct ImageUser *iuser;/* image user */
+   float *dynamicvec;  /* vector data in case it is dynamic */
+   GPUTexture *tex;/* input texture, only set at runtime */
+   char shadername[32];/* name in shader */
+
float vec[16];  /* vector data */
-   float *dynamicvec;  /* vector data in case it is dynamic */
GPUNodeLink *link;
-   GPUTexture *tex;/* input texture, only set at runtime */
int dynamictex; /* dynamic? */
-   struct Image *ima;  /* image */
-   struct ImageUser *iuser;/* image user */
int attribtype; /* attribute type */
char attribname[32];/* attribute name */
int attribfirst;/* this is the first one that is bound 
*/
GPUBuiltin builtin; /* builtin uniform */
-
-   char shadername[32];/* name in shader */
 } GPUInput;
 
 struct GPUPass {
@@ -676,7 +676,7 @@
code = BLI_dynstr_get_cstring(ds);
BLI_dynstr_free(ds);
 
-   if(G.f & G_DEBUG) printf("%s\n", code);
+   //if(G.f & G_DEBUG) printf("%s\n", code);
 
return code;
 }
@@ -719,7 +719,7 @@
 
BLI_dynstr_free(ds);
 
-   if(G.f & G_DEBUG) printf("%s\n", code);
+   //if(G.f & G_DEBUG) printf("%s\n", code);
 
return code;
 }

Modified: branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp
===
--- branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp  
2008-07-07 14:36:33 UTC (rev 15470)
+++ branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp  
2008-07-07 15:12:42 UTC (rev 15471)
@@ -75,6 +75,8 @@
GPUVertexAttribs attribs;
int i, attrib_num;
 
+   ras->SetAttribNum(0);
+
if(!mGPUMat)
return;
 

Modified: branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
===
--- branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
2008-07-07 14:36:33 UTC (rev 15470)
+++ branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
2008-07-07 15:12:42 UTC (rev 15471)
@@ -128,32 +128,31 @@
// when material are reused between objects
return;

-   if(mMaterial->glslmat) {
+   if(mMaterial->glslmat)
SetBlenderGLSLShader();
-   }
-   else {
-   // for each unique material...
-   int i;
-   for(i=0; inum_enabled; i++) {
-   if( mMaterial->mapping[i].mapping & USEENV ) {
-   if(!GLEW_ARB_texture_cube_map) {
-   spit("CubeMap textures not supported");
-   continue;
-   }
-   if(!mTextures[i].InitCubeMap(i, 
mMaterial->cubemap[i] ) )
+
+   // for each unique material...
+   int i;
+   for(i=0; inum_enabled; i++) {
+   if( mMaterial->mapping[i].mapping & USEENV ) {
+   if(!GLEW_ARB_texture_cube_map) {
+   spit("CubeMap textures not supported");
+   continue;
+   }
+   if(!mTextures[i].InitCubeMap(i, mMaterial->cubemap[i] ) 
)
+   spit("unable to initialize image("img[i] ) {
+   if( ! mTextures[i].InitFromImage(i, 
mMaterial->img[i], (mMaterial->flag[i] &MIPMAP)!=0 ))
  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15472] branches/apricot/source: Apricot Branch: two minor optimizations to avoid unneeded shader

2008-07-07 Thread Brecht Van Lommel
Revision: 15472
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15472
Author:   blendix
Date: 2008-07-07 19:14:44 +0200 (Mon, 07 Jul 2008)

Log Message:
---
Apricot Branch: two minor optimizations to avoid unneeded shader
and opengl light state changes.

Modified Paths:
--
branches/apricot/source/blender/gpu/intern/gpu_material.c
branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp
branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.h
branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.h
branches/apricot/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
branches/apricot/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
branches/apricot/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp

Modified: branches/apricot/source/blender/gpu/intern/gpu_material.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-07-07 
15:12:42 UTC (rev 15471)
+++ branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-07-07 
17:14:44 UTC (rev 15472)
@@ -1184,7 +1184,7 @@
 
 int GPU_lamp_shadow_layer(GPULamp *lamp)
 {
-   if(lamp->fb && lamp->tex && (lamp->mode & LA_LAYER|LA_LAYER_SHADOW))
+   if(lamp->fb && lamp->tex && (lamp->mode & (LA_LAYER|LA_LAYER_SHADOW)))
return lamp->lay;
else
return -1;

Modified: branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp
===
--- branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp  
2008-07-07 15:12:42 UTC (rev 15471)
+++ branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.cpp  
2008-07-07 17:14:44 UTC (rev 15472)
@@ -137,4 +137,10 @@
GPU_material_bind_uniforms(mGPUMat, obmat, viewmat);
 }
 
+bool BL_BlenderShader::Identical(BL_BlenderShader *blshader)
+{
+   /* to avoid unneeded state switches */
+   return (blshader && mGPUMat == blshader->mGPUMat && mLightLayer == 
blshader->mLightLayer);
+}
+
 // eof

Modified: branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.h
===
--- branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.h
2008-07-07 15:12:42 UTC (rev 15471)
+++ branches/apricot/source/gameengine/Ketsji/BL_BlenderShader.h
2008-07-07 17:14:44 UTC (rev 15472)
@@ -10,6 +10,8 @@
 #include "MT_Tuple3.h"
 #include "MT_Tuple4.h"
 
+#include "RAS_IPolygonMaterial.h"
+
 struct Material;
 class BL_Material;
 
@@ -36,6 +38,8 @@
int GetAttribNum();
void SetAttribs(class RAS_IRasterizer* ras, const BL_Material *mat);
void Update(const class KX_MeshSlot & ms, class RAS_IRasterizer* rasty);
+
+   bool Identical(BL_BlenderShader *blshader);
 };
 
 #endif//__BL_GPUSHADER_H__

Modified: branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
===
--- branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
2008-07-07 15:12:42 UTC (rev 15471)
+++ branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
2008-07-07 17:14:44 UTC (rev 15472)
@@ -238,8 +238,9 @@
return;
}
 
-   BL_Texture::DisableAllTextures();
-   if(mBlenderShader != mLastBlenderShader) {
+   if(!mBlenderShader->Identical(mLastBlenderShader)) {
+   BL_Texture::DisableAllTextures();
+
if(mLastBlenderShader)
mLastBlenderShader->SetProg(false);
 
@@ -484,6 +485,18 @@
return dopass;
 }
 
+bool KX_BlenderMaterial::UsesLighting(RAS_IRasterizer *rasty) const
+{
+   if(!RAS_IPolyMaterial::UsesLighting(rasty))
+   return false;
+
+   if(mShader && mShader->Ok());
+   else if(mBlenderShader && mBlenderShader->Ok())
+   return false;
+   
+   return true;
+}
+
 void KX_BlenderMaterial::ActivateMeshSlot(const KX_MeshSlot & ms, 
RAS_IRasterizer* rasty) const
 {
if(mShader && GLEW_ARB_shader_objects)

Modified: branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.h
===
--- branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.h  
2008-07-07 15:12:42 UTC (rev 15471)
+++ branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.h  
2008-07-07 17:14:44 UTC (rev 15472)
@@ -107,6 +107,7 @@
void ActivatGLMaterials( RAS_IRasterizer* rasty )const;
void ActivateTexGen( RAS_IRasterizer *ras ) const;
 
+   bool UsesLighting(RAS_IRasterizer *rasty) const;
 
// message centers
voidsetTexData( bool enable,RAS_IRasterizer *ras);

Modified: branches/apricot/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15473] branches/harmonic-skeleton/source/ blender: Reeb multiresolution filtering, now with more than one level

2008-07-07 Thread Martin Poirier
Revision: 15473
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15473
Author:   theeth
Date: 2008-07-07 19:27:22 +0200 (Mon, 07 Jul 2008)

Log Message:
---
Reeb multiresolution filtering, now with more than one level

Modified Paths:
--
branches/harmonic-skeleton/source/blender/include/reeb.h
branches/harmonic-skeleton/source/blender/makesdna/DNA_scene_types.h
branches/harmonic-skeleton/source/blender/src/autoarmature.c
branches/harmonic-skeleton/source/blender/src/buttons_editing.c
branches/harmonic-skeleton/source/blender/src/reeb.c

Modified: branches/harmonic-skeleton/source/blender/include/reeb.h
===
--- branches/harmonic-skeleton/source/blender/include/reeb.h2008-07-07 
17:14:44 UTC (rev 15472)
+++ branches/harmonic-skeleton/source/blender/include/reeb.h2008-07-07 
17:27:22 UTC (rev 15473)
@@ -158,6 +158,7 @@
 
 /*** PUBLIC */
 ReebGraph *BIF_ReebGraphFromEditMesh(void);
+ReebGraph *BIF_ReebGraphMultiFromEditMesh(void);
 
 void BIF_GlobalReebGraphFromEditMesh(void);
 void BIF_GlobalReebFree(void);

Modified: branches/harmonic-skeleton/source/blender/makesdna/DNA_scene_types.h
===
--- branches/harmonic-skeleton/source/blender/makesdna/DNA_scene_types.h
2008-07-07 17:14:44 UTC (rev 15472)
+++ branches/harmonic-skeleton/source/blender/makesdna/DNA_scene_types.h
2008-07-07 17:27:22 UTC (rev 15473)
@@ -440,7 +440,10 @@
char  skgen_postpro;
char  skgen_postpro_passes;
char  skgen_subdivisions[3];
+   char  skgen_multi_level;

+   char tpad[7];
+   
/* Alt+RMB option */
char edge_mode;
 } ToolSettings;

Modified: branches/harmonic-skeleton/source/blender/src/autoarmature.c
===
--- branches/harmonic-skeleton/source/blender/src/autoarmature.c
2008-07-07 17:14:44 UTC (rev 15472)
+++ branches/harmonic-skeleton/source/blender/src/autoarmature.c
2008-07-07 17:27:22 UTC (rev 15473)
@@ -1354,10 +1354,12 @@
Base *base;
ReebGraph *reebg;

-   reebg = BIF_ReebGraphFromEditMesh();
+   //reebg = BIF_ReebGraphFromEditMesh();
+   //BLI_markdownSymmetry((BGraph*)reebg, reebg->nodes.first, 
G.scene->toolsettings->skgen_symmetry_limit);

-   BLI_markdownSymmetry((BGraph*)reebg, reebg->nodes.first, 
G.scene->toolsettings->skgen_symmetry_limit);
+   reebg = BIF_ReebGraphMultiFromEditMesh();

+   
printf("Reeb Graph created\n");
 
base= FIRSTBASE;

Modified: branches/harmonic-skeleton/source/blender/src/buttons_editing.c
===
--- branches/harmonic-skeleton/source/blender/src/buttons_editing.c 
2008-07-07 17:14:44 UTC (rev 15472)
+++ branches/harmonic-skeleton/source/blender/src/buttons_editing.c 
2008-07-07 17:27:22 UTC (rev 15473)
@@ -5036,6 +5036,8 @@
uiDefButBitS(block, TOG, SKGEN_DISP_LENGTH, REDRAWVIEW3D,   
"Length",   1025, 60, 83,19, 
&G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Show Length");
uiDefButBitS(block, TOG, SKGEN_DISP_WEIGHT, REDRAWVIEW3D,   
"Weight",   1108, 60, 83,19, 
&G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Show Weight");
uiDefButBitS(block, TOG, SKGEN_DISP_ORIG, REDRAWVIEW3D, 
"Original", 1191, 60, 84,19, 
&G.scene->toolsettings->skgen_options, 0, 0, 0, 0, "Show Original 
Graph");
+
+   uiDefButC(block, NUM, REDRAWVIEW3D, 
"Level:",   1025, 40, 125,19, 
&G.scene->toolsettings->skgen_multi_level, 0, 5, 1, 0,"Specify the level to 
draw");
 }
 
 static void editing_panel_mesh_skgen_retarget(Object *ob, Mesh *me)

Modified: branches/harmonic-skeleton/source/blender/src/reeb.c
===
--- branches/harmonic-skeleton/source/blender/src/reeb.c2008-07-07 
17:14:44 UTC (rev 15472)
+++ branches/harmonic-skeleton/source/blender/src/reeb.c2008-07-07 
17:27:22 UTC (rev 15473)
@@ -2066,13 +2066,16 @@
countfaces++;
if (countfaces % 100 == 0)
{
-   printf("face %i of %i\n", countfaces, totfaces);
+   printf("\rface %i of %i", countfaces, totfaces);
verifyFaces(rg);
}
 #endif
}
-   
}
+   
+   printf("\n");
+   
+   
BLI_listbase_from_dlist(dlist, &rg->nodes);

removeNormalNodes(rg);
@@ -2466,1

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15474] branches/fluidcontrol: Some channel fixes for fc

2008-07-07 Thread Daniel Genrich
Revision: 15474
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15474
Author:   genscher
Date: 2008-07-07 22:28:56 +0200 (Mon, 07 Jul 2008)

Log Message:
---
Some channel fixes for fc

Modified Paths:
--
branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp
branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp
branches/fluidcontrol/source/blender/src/fluidsim.c

Modified: branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp
===
--- branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp   2008-07-07 
17:27:22 UTC (rev 15473)
+++ branches/fluidcontrol/intern/elbeem/intern/elbeem.cpp   2008-07-07 
20:28:56 UTC (rev 15474)
@@ -219,6 +219,7 @@

if((mesh->volumeInitTypevolumeInitType>VOLUMEINIT_BOTH))
 mesh->volumeInitType = VOLUMEINIT_VOLUME;
obj->setVolumeInit(mesh->volumeInitType);
// use channel instead, obj->setInitialVelocity( 
ntlVec3Gfx(mesh->iniVelocity[0], mesh->iniVelocity[1], mesh->iniVelocity[2]) );
+   
obj->initChannels(
mesh->channelSizeTranslation, mesh->channelTranslation, 
mesh->channelSizeRotation,mesh->channelRotation, 

Modified: branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp
===
--- branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp   
2008-07-07 17:27:22 UTC (rev 15473)
+++ branches/fluidcontrol/intern/elbeem/intern/ntl_geometryobject.cpp   
2008-07-07 20:28:56 UTC (rev 15474)
@@ -351,10 +351,10 @@
if((ivel)&&(nIvel>0)) {ADD_CHANNEL_VEC(mcInitialVelocity, nIvel, 
ivel); }

/* fluid control channels */
-   if((attrFStr)&&(nAttrFStr>0)) {   printf("added!\n");   
ADD_CHANNEL_FLOAT(mcAttrFStr, nAttrFStr, attrFStr); }
-   if((attrFRad)&&(nAttrFRad>0)) {  ADD_CHANNEL_FLOAT(mcAttrFRad, 
nAttrFRad, attrFRad); }
-   if((velFStr)&&(nVelFStr>0)) {  ADD_CHANNEL_FLOAT(mcVelFStr, nAct, 
velFStr); }
-   if((velFRad)&&(nVelFRad>0)) {  ADD_CHANNEL_FLOAT(mcVelFRad, 
nVelFRad, velFRad); }
+   if((attrFStr)&&(nAttrFStr>0)) { ADD_CHANNEL_FLOAT(mcAttrFStr, 
nAttrFStr, attrFStr); }
+   if((attrFRad)&&(nAttrFRad>0)) { ADD_CHANNEL_FLOAT(mcAttrFRad, 
nAttrFRad, attrFRad); }
+   if((velFStr)&&(nVelFStr>0)) {   ADD_CHANNEL_FLOAT(mcVelFStr, nAct, 
velFStr); }
+   if((velFRad)&&(nVelFRad>0)) {   ADD_CHANNEL_FLOAT(mcVelFRad, nVelFRad, 
velFRad); }
 
checkIsAnimated();


Modified: branches/fluidcontrol/source/blender/src/fluidsim.c
===
--- branches/fluidcontrol/source/blender/src/fluidsim.c 2008-07-07 17:27:22 UTC 
(rev 15473)
+++ branches/fluidcontrol/source/blender/src/fluidsim.c 2008-07-07 20:28:56 UTC 
(rev 15474)
@@ -1065,7 +1065,7 @@
fsmesh.obstaclePartslip = 
obit->fluidsimSettings->partSlipValue;
fsmesh.volumeInitType = 
obit->fluidsimSettings->volumeInitType;
fsmesh.obstacleImpactFactor = 
obit->fluidsimSettings->surfaceSmoothing; // misused value
-   
+   /*
if(fsmesh.type == OB_FLUIDSIM_CONTROL)
{
// control fluids will get exported as 
whole
@@ -1079,12 +1079,12 @@
fsmesh.channelSizeVelocityforceRadius = 
fsmesh.channelSizeAttractforceStrength 
= allchannelSize;

-   fsmesh.channelAttractforceRadius = 
channelAttractforceStrength[o];
+   fsmesh.channelAttractforceStrength = 
channelAttractforceStrength[o];
fsmesh.channelAttractforceRadius = 
channelAttractforceRadius[o];
fsmesh.channelVelocityforceStrength = 
channelVelocityforceStrength[o];
fsmesh.channelVelocityforceRadius = 
channelVelocityforceRadius[o];
}
-   else
+   else*/
{
// set channels to 0
fsmesh.channelAttractforceStrength =


___
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 [15475] branches/harmonic-skeleton/source/ blender: First draft: Use multiresolution graph for retargetting ( enables bypassing small appendages that

2008-07-07 Thread Martin Poirier
Revision: 15475
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15475
Author:   theeth
Date: 2008-07-07 22:31:53 +0200 (Mon, 07 Jul 2008)

Log Message:
---
First draft: Use multiresolution graph for retargetting (enables bypassing 
small appendages that don't correspond to anything on the armature).

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/buttons_editing.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-07-07 20:28:56 UTC (rev 15474)
+++ branches/harmonic-skeleton/source/blender/blenlib/BLI_graph.h   
2008-07-07 20:31:53 UTC (rev 15475)
@@ -78,6 +78,8 @@
 
 int BLI_FlagSubgraphs(BGraph *graph);
 
+int BLI_subtreeShape(BNode *node, BArc *rootArc, int include_root);
+
 void BLI_replaceNode(BGraph *graph, BNode *node_src, BNode *node_replaced);
 void BLI_removeDoubleNodes(BGraph *graph, float limit);
 

Modified: branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c
===
--- branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c
2008-07-07 20:28:56 UTC (rev 15474)
+++ branches/harmonic-skeleton/source/blender/blenlib/intern/graph.c
2008-07-07 20:31:53 UTC (rev 15475)
@@ -321,34 +321,40 @@
 
 /*** GRAPH AS TREE FUNCTIONS 
***/
 
-int BLI_subtreeShape(BNode *node, BArc *rootArc)
+int BLI_subtreeShape(BNode *node, BArc *rootArc, int include_root)
 {
int depth = 0;

-   /* Base case, no arcs leading away */
-   if (node->arcs == NULL || *(node->arcs) == NULL)
+   if (include_root)
{
-   return 0;
+   BNode *newNode = BLI_otherNode(rootArc, node);
+   depth = BLI_subtreeShape(newNode, rootArc, 0);
}
else
{
-   int i;
-
-   for(i = 0; i < node->degree; i++)
+   /* Base case, no arcs leading away */
+   if (node->arcs == NULL || *(node->arcs) == NULL)
{
-   BArc *arc = node->arcs[i];
-   
-   /* only arcs that go down the tree */
-   if (arc != rootArc)
+   return 0;
+   }
+   else
+   {
+   int i;
+   
+   for(i = 0; i < node->degree; i++)
{
-   BNode *newNode = BLI_otherNode(arc, node);
-   //depth = MAX2(depth, BLI_subtreeShape(newNode, 
arc));
-   depth += BLI_subtreeShape(newNode, arc);
+   BArc *arc = node->arcs[i];
+   
+   /* only arcs that go down the tree */
+   if (arc != rootArc)
+   {
+   BNode *newNode = BLI_otherNode(arc, 
node);
+   depth += BLI_subtreeShape(newNode, arc, 
0);
+   }
}
}
}

-   //return depth + 1;
return 10 * depth + 1;
 }
 
@@ -776,7 +782,7 @@
BNode *connectedNode = BLI_otherNode(connectedArc, 
node);

/* symmetry level is positive value, negative values is 
subtree depth */
-   connectedArc->symmetry_level = 
-BLI_subtreeShape(connectedNode, connectedArc);
+   connectedArc->symmetry_level = 
-BLI_subtreeShape(connectedNode, connectedArc, 0);
}
}
 

Modified: branches/harmonic-skeleton/source/blender/include/reeb.h
===
--- branches/harmonic-skeleton/source/blender/include/reeb.h2008-07-07 
20:28:56 UTC (rev 15474)
+++ branches/harmonic-skeleton/source/blender/include/reeb.h2008-07-07 
20:31:53 UTC (rev 15475)
@@ -163,6 +163,8 @@
 void BIF_GlobalReebGraphFromEditMesh(void);
 void BIF_GlobalReebFree(void);
 
+ReebNode *BIF_otherNodeFromIndex(ReebArc *arc, ReebNode *node);
+
 void REEB_freeGraph(ReebGraph *rg);
 void REEB_exportGraph(ReebGraph *rg, int count);
 void REEB_draw();

Modified: branches/harmonic-skeleton/source/blender/src/autoarmature.c

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15476] branches/fluidcontrol/source/ blender/src/editipo.c: Correct IPOs again, have yet to find a resolution how to hide some unsused IPOs

2008-07-07 Thread Daniel Genrich
Revision: 15476
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15476
Author:   genscher
Date: 2008-07-07 23:04:20 +0200 (Mon, 07 Jul 2008)

Log Message:
---
Correct IPOs again, have yet to find a resolution how to hide some unsused IPOs

Modified Paths:
--
branches/fluidcontrol/source/blender/src/editipo.c

Modified: branches/fluidcontrol/source/blender/src/editipo.c
===
--- branches/fluidcontrol/source/blender/src/editipo.c  2008-07-07 20:31:53 UTC 
(rev 15475)
+++ branches/fluidcontrol/source/blender/src/editipo.c  2008-07-07 21:04:20 UTC 
(rev 15476)
@@ -499,21 +499,23 @@
int ipo_start_index = 0;

// we don't need all fluid ipos for all types! - dg
+   /*
if(fss->type == OB_FLUIDSIM_CONTROL)
{
numipos = 4; // there are 4 fluid control ipos
ipo_start_index = 9;

}
-   else if(fss->type == OB_FLUIDSIM_DOMAIN)
+   else */
+   if(fss->type == OB_FLUIDSIM_DOMAIN)
{
numipos = 5; // there are 5 ipos for fluid domains
-   }
+   }/*
else
{
numipos = 4; // there are 4 for the rest
ipo_start_index = 5;
-   }
+   }*/

ei= si->editipo= MEM_callocN(numipos*sizeof(EditIpo), 
"fluidsim_editipo");
si->totipo = numipos;


___
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 [15477] trunk/blender/source/blender/src/ buttons_logic.c: own mistake with drawing used state bits.

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

Log Message:
---
own mistake with drawing used state bits.
Other minor changes and removed some warnings.

Modified Paths:
--
trunk/blender/source/blender/src/buttons_logic.c

Modified: trunk/blender/source/blender/src/buttons_logic.c
===
--- trunk/blender/source/blender/src/buttons_logic.c2008-07-07 21:04:20 UTC 
(rev 15476)
+++ trunk/blender/source/blender/src/buttons_logic.c2008-07-07 21:04:30 UTC 
(rev 15477)
@@ -1560,7 +1560,6 @@
 static void change_object_actuator(void *act, void *arg)
 {
bObjectActuator *oa = act;
-   int i;
 
if (oa->type != oa->otype) {
switch (oa->type) {
@@ -1679,7 +1678,7 @@
uiDefButF(block, NUM, 0, "",
xco+45+2*wval, yco-148, wval, 19, oa->angularvelocity+2, -1.0, 1.0, 10, 
0, "");

uiDefBut(block, LABEL, 0, "damp",   xco, 
yco-171, 45, 19, NULL, 0, 0, 0, 0, "Number of frames to reach the target 
velocity");
-   uiDefButI(block, NUM, 0, "",xco+45, 
yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, "");
+   uiDefButS(block, NUM, 0, "",xco+45, 
yco-171, wval, 19, &oa->damping, 0.0, 1000.0, 100, 0, "");
 
uiDefButBitS(block, TOG, ACT_FORCE_LOCAL, 0, 
"L",   xco+45+3*wval, yco-45, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, 
"Local transformation");
uiDefButBitS(block, TOG, ACT_TORQUE_LOCAL, 0, 
"L",  xco+45+3*wval, yco-64, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, 
"Local transformation");
@@ -1816,11 +1815,11 @@
uiDefButI(block, NUM, 0, 
"Sta",  xco+20, yco-44, 
(width-100)/2, 19, 
&ia->sta, 0.0, MAXFRAMEF, 0, 0, 
-   "Start frame");
+   "Start frame, (subtract 1 to match 
blenders frame numbers)");
uiDefButI(block, NUM, 0, 
"End",  xco+18+(width-90)/2, 
yco-44, (width-100)/2, 19, 
&ia->end, 0.0, MAXFRAMEF, 0, 0, 
-   "End frame");
+   "End frame, (subtract 1 to match 
blenders frame numbers)");

uiDefButBitS(block, TOG, ACT_IPOFORCE, B_REDR, 
"Force", xco+width-78, yco-44, 43, 19, 
@@ -1967,7 +1966,7 @@
glRects(xco, yco-ysize, xco+width, yco);
uiEmboss((float)xco, (float)yco-ysize, 
(float)xco+width, (float)yco, 1);
 
-   uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", 
xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Add this Object (cant be 
on an visible layer)");
+   uiDefIDPoinBut(block, test_obpoin_but, ID_OB, 1, "OB:", 
xco+10, yco-44, (width-20)/2, 19, &(eoa->ob), "Add this Object and all 
its children (cant be on an visible layer)");
uiDefButI(block, NUM, 0, "Time:",   
xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &eoa->time, 0.0, 2000.0, 0, 0, 
"Duration the new Object lives");
 
wval= (width-60)/3;
@@ -2248,7 +2247,7 @@
uiDefBut(block, TEX, 0, "Prop: ",   xco+20, 
yco-44, width-40, 19, ga->name, 0.0, 31.0, 0, 0, "Use this property to define 
the Group position");
}
else {
-   uiDefButI(block, NUM, 0, "Sta", xco+20, yco-44, 
(width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame");
+   uiDefButI(block, NUM, 0, "State",   xco+20, 
yco-44, (width-40)/2, 19, &ga->sta, 0.0, 2500.0, 0, 0, "Start frame");
uiDefButI(block, NUM, 0, "End", 
xco+20+(width-40)/2, yco-44, (width-40)/2, 19, &ga->end, 0.0, 2500.0, 0, 0, 
"End frame");
}
yco-= ysize;
@@ -3171,7 +3170,7 @@
uiButSetFunc(but, check_object_state, 
but, &(ob->state));
}
for (stbit=0; stbit<5; stbit++) {
-   but = uiDefButBitI(block, 
controller_state_mask&(1<<(stbit+offset)) ? BUT_TOGDUAL:TOG, 
1<<(stbit+offset+15), stbit+offset+15, "",   
(short)(xco+35+12*stbit+13*offset), yco-12, 12, 12, (int *)&(ob->state), 0, 0, 
0, 0, get_state_name(o

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15478] branches/apricot/source/blender: svn merge -r14639:14688 https://svn.blender.org/svnroot/bf-blender/trunk /blender/

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

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

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

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

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

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

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15479] branches/apricot/source/blender/ gpu/intern: Apricot Branch: GLSL

2008-07-07 Thread Brecht Van Lommel
Revision: 15479
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15479
Author:   blendix
Date: 2008-07-07 23:25:10 +0200 (Mon, 07 Jul 2008)

Log Message:
---
Apricot Branch: GLSL


* Second attemp at solving exp/log incompatibility, some compilers
  don't seem to properly support preprocessor defines?
* Some simple optimizations to skip diffuse/specular/emit if they
  are set to zero.

Modified Paths:
--
branches/apricot/source/blender/gpu/intern/gpu_codegen.c
branches/apricot/source/blender/gpu/intern/gpu_codegen.h
branches/apricot/source/blender/gpu/intern/gpu_material.c
branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl
branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c

Modified: branches/apricot/source/blender/gpu/intern/gpu_codegen.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-07 
21:18:30 UTC (rev 15478)
+++ branches/apricot/source/blender/gpu/intern/gpu_codegen.c2008-07-07 
21:25:10 UTC (rev 15479)
@@ -894,6 +894,20 @@
 static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, int type)
 {
GPUInput *input;
+   GPUNode *outnode;
+   char *name;
+
+   if(link->output) {
+   outnode = link->output->node;
+   name = outnode->name;
+
+   if(strcmp(name, "set_value")==0 || strcmp(name, "set_rgb")==0) {
+   input = MEM_dupallocN(outnode->inputs.first);
+   input->type = type;
+   BLI_addtail(&node->inputs, input);
+   return;
+   }
+   }

input = MEM_callocN(sizeof(GPUInput), "GPUInput");
input->node = node;
@@ -1280,6 +1294,27 @@
return 1;
 }
 
+int GPU_link_changed(GPUNodeLink *link)
+{
+   GPUNode *node;
+   GPUInput *input;
+   char *name;
+
+   if(link->output) {
+   node = link->output->node;
+   name = node->name;
+
+   if(strcmp(name, "set_value")==0 || strcmp(name, "set_rgb")==0) {
+   input = node->inputs.first;
+   return (input->link != NULL);
+   }
+
+   return 1;
+   }
+   else
+   return 0;
+}
+
 /* Pass create/free */
 
 void gpu_nodes_tag(GPUNodeLink *link)

Modified: branches/apricot/source/blender/gpu/intern/gpu_codegen.h
===
--- branches/apricot/source/blender/gpu/intern/gpu_codegen.h2008-07-07 
21:18:30 UTC (rev 15478)
+++ branches/apricot/source/blender/gpu/intern/gpu_codegen.h2008-07-07 
21:25:10 UTC (rev 15479)
@@ -80,6 +80,7 @@
 
 char *GPU_builtin_name(GPUBuiltin builtin);
 void gpu_material_add_node(struct GPUMaterial *material, struct GPUNode *node);
+int GPU_link_changed(struct GPUNodeLink *link);
 
 #endif
 

Modified: branches/apricot/source/blender/gpu/intern/gpu_material.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-07-07 
21:18:30 UTC (rev 15478)
+++ branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-07-07 
21:25:10 UTC (rev 15479)
@@ -579,13 +579,16 @@
else
GPU_link(mat, "set_value", GPU_uniform(&one), &shadfac);
 
-   if(!(lamp->mode & LA_NO_DIFF)) {
-   GPUNodeLink *rgb;
-   GPU_link(mat, "shade_mul_value", i, 
GPU_dynamic_uniform(lamp->dyncol), &rgb);
-   add_to_diffuse(mat, ma, shi, is, rgb, &shr->diff);
+   if(GPU_link_changed(shi->refl) || ma->ref != 0.0f) {
+   if(!(lamp->mode & LA_NO_DIFF)) {
+   GPUNodeLink *rgb;
+   GPU_link(mat, "shade_mul_value", i, 
GPU_dynamic_uniform(lamp->dyncol), &rgb);
+   add_to_diffuse(mat, ma, shi, is, rgb, &shr->diff);
+   }
}
 
-   if(!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW)) {
+   if(!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW) &&
+  (GPU_link_changed(shi->spec) || ma->spec != 0.0f)) {
if(lamp->type == LA_HEMI) {
GPU_link(mat, "shade_hemi_spec", vn, lv, view, 
GPU_uniform(&ma->spec), shi->har, visifac, &t);
GPU_link(mat, "shade_add_spec", t, 
GPU_dynamic_uniform(lamp->dyncol), shi->specrgb, &outcol);
@@ -955,12 +958,16 @@
shr->alpha = shi->alpha;
}
else {
-   if((ma->mode & (MA_VERTEXCOL|MA_VERTEXCOLP))== MA_VERTEXCOL) {
-   GPU_link(mat, "shade_add", shi->emit, shi->vcol, &emit);
-   GPU_link(mat, "shade_mul", emit, shi->rgb, &shr->diff);
+   if(GPU_link_changed(shi->emit) || ma->emit != 0.0f) {
+   if((

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15480] trunk/blender/intern/ghost/intern/ GHOST_SystemWin32.cpp: patch from res2k to stop the blender window being upscaled on vista.

2008-07-07 Thread Campbell Barton
Revision: 15480
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15480
Author:   campbellbarton
Date: 2008-07-08 00:11:11 +0200 (Tue, 08 Jul 2008)

Log Message:
---
patch from res2k to stop the blender window being upscaled on vista.

Modified Paths:
--
trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp
===
--- trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp 2008-07-07 
21:25:10 UTC (rev 15479)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp 2008-07-07 
22:11:11 UTC (rev 15480)
@@ -302,6 +302,15 @@
 {
GHOST_TSuccess success = GHOST_System::init();
 
+   /* Disable scaling on high DPI displays on Vista */
+   HMODULE user32 = ::LoadLibraryA("user32.dll");
+   typedef BOOL (WINAPI * LPFNSETPROCESSDPIAWARE)();
+   LPFNSETPROCESSDPIAWARE SetProcessDPIAware =
+   (LPFNSETPROCESSDPIAWARE)GetProcAddress(user32, 
"SetProcessDPIAware");
+   if (SetProcessDPIAware)
+   SetProcessDPIAware();
+   FreeLibrary(user32);
+
// Determine whether this system has a high frequency performance 
counter. */
m_hasPerformanceCounter = 
::QueryPerformanceFrequency((LARGE_INTEGER*)&m_freq) == TRUE;
if (m_hasPerformanceCounter) {


___
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 [15481] trunk/blender/source/blender: -> UV and VCOL support for bevel (editmode)

2008-07-07 Thread Geoffrey Bantle
Revision: 15481
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15481
Author:   briggs
Date: 2008-07-08 04:22:37 +0200 (Tue, 08 Jul 2008)

Log Message:
---
-> UV and VCOL support for bevel (editmode)

BMesh and the bevel code now support UVs/VCOLS.
The offset is fixed at this time, but will be
made dynamic later.

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_customdata.h
trunk/blender/source/blender/blenkernel/intern/BME_conversions.c
trunk/blender/source/blender/blenkernel/intern/BME_eulers.c
trunk/blender/source/blender/blenkernel/intern/BME_structure.c
trunk/blender/source/blender/blenkernel/intern/BME_tools.c
trunk/blender/source/blender/blenkernel/intern/customdata.c
trunk/blender/source/blender/blenlib/BLI_mempool.h
trunk/blender/source/blender/blenlib/intern/BLI_mempool.c

Modified: trunk/blender/source/blender/blenkernel/BKE_customdata.h
===
--- trunk/blender/source/blender/blenkernel/BKE_customdata.h2008-07-07 
22:11:11 UTC (rev 15480)
+++ trunk/blender/source/blender/blenkernel/BKE_customdata.h2008-07-08 
02:22:37 UTC (rev 15481)
@@ -41,6 +41,7 @@
 extern const CustomDataMask CD_MASK_EDITMESH;
 extern const CustomDataMask CD_MASK_DERIVEDMESH;
 extern const CustomDataMask CD_MASK_BMESH;
+extern const CustomDataMask CD_MASK_FACECORNERS;
 
 /* for ORIGINDEX layer type, indicates no original index for this element */
 #define ORIGINDEX_NONE -1
@@ -264,4 +265,8 @@
 /* for file reading compatibility, returns false if the layer was freed,
only after this test passes, layer->data should be assigned */
 int CustomData_verify_versions(struct CustomData *data, int index);
+
+void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData 
*pdata, struct CustomData *ldata);
+void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData 
*pdata, struct CustomData *ldata);
+void CustomData_bmesh_init_pool(struct CustomData *data, int allocsize);
 #endif

Modified: trunk/blender/source/blender/blenkernel/intern/BME_conversions.c
===
--- trunk/blender/source/blender/blenkernel/intern/BME_conversions.c
2008-07-07 22:11:11 UTC (rev 15480)
+++ trunk/blender/source/blender/blenkernel/intern/BME_conversions.c
2008-07-08 02:22:37 UTC (rev 15481)
@@ -55,14 +55,104 @@
 #include "bmesh_private.h"
 
 #include "BSE_edit.h"
-/*Converts an EditMesh to a BME_Mesh.*/
-static void bmesh_init_cdPool(CustomData *data, int allocsize){
-   if(data->totlayer)data->pool = BLI_mempool_create(data->totsize, 
allocsize, allocsize);
+
+static void BME_corners_to_loops(BME_Mesh *bm, CustomData *facedata, void 
*face_block, BME_Poly *f,int numCol, int numTex){
+   int i, j;
+   BME_Loop *l;
+   MTFace *texface;
+   MTexPoly *texpoly;
+   MCol *mcol;
+   MLoopCol *mloopcol;
+   MLoopUV *mloopuv;
+
+   for(i=0; i < numTex; i++){
+   texface = CustomData_em_get_n(facedata, face_block, CD_MTFACE, 
i);
+   texpoly = CustomData_bmesh_get_n(&bm->pdata, f->data, 
CD_MTEXPOLY, i);
+   
+   texpoly->tpage = texface->tpage;
+   texpoly->flag = texface->flag;
+   texpoly->transp = texface->transp;
+   texpoly->mode = texface->mode;
+   texpoly->tile = texface->tile;
+   texpoly->unwrap = texface->unwrap;
+
+   j = 0;
+   l = f->loopbase;
+   do{
+   mloopuv = CustomData_bmesh_get_n(&bm->ldata, l->data, 
CD_MLOOPUV, i);
+   mloopuv->uv[0] = texface->uv[j][0];
+   mloopuv->uv[1] = texface->uv[j][1];
+   j++;
+   l = l->next;
+   }while(l!=f->loopbase);
+
+   }
+   for(i=0; i < numCol; i++){
+   mcol = CustomData_em_get_n(facedata, face_block, CD_MCOL, i);
+   j = 0;
+   l = f->loopbase;
+   do{
+   mloopcol = CustomData_bmesh_get_n(&bm->ldata, l->data, 
CD_MLOOPCOL, i);
+   mloopcol->r = mcol[j].r;
+   mloopcol->g = mcol[j].g;
+   mloopcol->b = mcol[j].b;
+   mloopcol->a = mcol[j].a;
+   j++;
+   l = l->next;
+   }while(l!=f->loopbase);
+   }
 }
 
+static void BME_loops_to_corners(BME_Mesh *bm, CustomData *facedata, void 
*face_block, BME_Poly *f,int numCol, int numTex){
+   int i, j;
+   BME_Loop *l;
+   MTFace *texface;
+   MTexPoly *texpoly;
+   MCol *mcol;
+   MLoopCol *mloopcol;
+   MLoopUV *mloopuv;
+
+   for(i=0; i < numTex; i++){
+   texface = CustomData_em_get_n(facedata, face_block, CD_MTFACE, 
i);
+   t