[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16267] trunk/blender/source: BGE bugfix, ipo actuator's foce option didnt check that the object was dynamic.

2008-08-27 Thread Campbell Barton
Revision: 16267
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16267
Author:   campbellbarton
Date: 2008-08-27 08:02:10 +0200 (Wed, 27 Aug 2008)

Log Message:
---
BGE bugfix, ipo actuator's foce option didnt check that the object was dynamic.

Modified Paths:
--
trunk/blender/source/blender/src/buttons_logic.c
trunk/blender/source/gameengine/Ketsji/KX_IPO_SGController.cpp

Modified: trunk/blender/source/blender/src/buttons_logic.c
===
--- trunk/blender/source/blender/src/buttons_logic.c2008-08-27 03:41:29 UTC 
(rev 16266)
+++ trunk/blender/source/blender/src/buttons_logic.c2008-08-27 06:02:10 UTC 
(rev 16267)
@@ -1857,7 +1857,7 @@
but = uiDefButBitS(block, TOG, ACT_IPOFORCE, 
ACT_IPOFORCE, 
Force, xco+10+(width-20)/2, yco-24, 
(width-20)/4-10, 19, 
ia-flag, 0, 0, 0, 0, 
-   Convert Ipo to force. Force is applied in 
global or local coordinate according to Local flag); 
+   Apply Ipo as a global or local force depending 
on the local option (dynamic objects only)); 
uiButSetFunc(but, change_ipo_actuator, but, ia);
 
but = uiDefButBitS(block, TOG, ACT_IPOADD, ACT_IPOADD, 

Modified: trunk/blender/source/gameengine/Ketsji/KX_IPO_SGController.cpp
===
--- trunk/blender/source/gameengine/Ketsji/KX_IPO_SGController.cpp  
2008-08-27 03:41:29 UTC (rev 16266)
+++ trunk/blender/source/gameengine/Ketsji/KX_IPO_SGController.cpp  
2008-08-27 06:02:10 UTC (rev 16267)
@@ -143,7 +143,7 @@
{
if (m_ipo_as_force == true) 
{
-   if (m_game_object  ob) 
+   if (m_game_object  ob  
m_game_object-GetPhysicsController()) 
{

m_game_object-GetPhysicsController()-ApplyForce(m_ipo_local ?
ob-GetWorldOrientation() * 
m_ipo_xform.GetPosition() :


___
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 [16268] branches/apricot/source/blender/ gpu/intern/gpu_draw.c: divide by zero for texture animation when start and end frames are the same

2008-08-27 Thread Campbell Barton
Revision: 16268
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16268
Author:   campbellbarton
Date: 2008-08-27 09:12:07 +0200 (Wed, 27 Aug 2008)

Log Message:
---
divide by zero for texture animation when start and end frames are the same

Modified Paths:
--
branches/apricot/source/blender/gpu/intern/gpu_draw.c

Modified: branches/apricot/source/blender/gpu/intern/gpu_draw.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_draw.c   2008-08-27 
06:02:10 UTC (rev 16267)
+++ branches/apricot/source/blender/gpu/intern/gpu_draw.c   2008-08-27 
07:12:07 UTC (rev 16268)
@@ -679,7 +679,7 @@
newframe = ima-lastframe+inc;
 
if(newframe  (int)ima-twend) {
-   if(ima-twend-ima-twsta == 0)
+   if(ima-twend-ima-twsta != 0)
newframe = (int)ima-twsta-1 + 
(newframe-ima-twend)%(ima-twend-ima-twsta);
else
newframe = ima-twsta;


___
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 [16269] branches/apricot/source/blender/ gpu/intern: Apricot Branch: still didn't get the glsl obcolor mixing right,

2008-08-27 Thread Brecht Van Lommel
Revision: 16269
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16269
Author:   blendix
Date: 2008-08-27 13:56:11 +0200 (Wed, 27 Aug 2008)

Log Message:
---
Apricot Branch: still didn't get the glsl obcolor mixing right,
forgot why I did it the other way around before (because of alpha),
should work correct now.

Also, noticed I committed a bugfix before without knowing related
to creating material buckets with  65k faces. The fix was provided
by Samuel Anjam, thanks!

Modified Paths:
--
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_material.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-08-27 
07:12:07 UTC (rev 16268)
+++ branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-08-27 
11:56:11 UTC (rev 16269)
@@ -1096,7 +1096,7 @@
GPUNodeLink *emit, *ulinfac, *ulogfac, *mistfac;
Material *ma= shi-mat;
World *world= mat-scene-world;
-   float linfac, logfac, misttype, one = 1.0f;
+   float linfac, logfac, misttype;
 
memset(shr, 0, sizeof(*shr));
 
@@ -1161,10 +1161,10 @@
GPU_link(mat, shade_add, shr-combined, shr-spec, 
shr-combined);
}
 
-   if(ma-shade_flag  MA_OBCOLOR) {
-   mat-obcolalpha = 1;
+   GPU_link(mat, mtex_alpha_to_col, shr-combined, shr-alpha, 
shr-combined);
+
+   if(ma-shade_flag  MA_OBCOLOR)
GPU_link(mat, shade_obcolor, shr-combined, 
GPU_builtin(GPU_OBCOLOR), shr-combined);
-   }
 
if(world  (world-mode  WO_MIST)  !(ma-mode  MA_NOMIST)) {
misttype = world-mistype;
@@ -1179,13 +1179,16 @@
 
if(!(ma-mode  MA_ZTRA)) {
if(world  (GPU_link_changed(shr-alpha) || ma-alpha != 1.0f))
-   GPU_link(mat, shade_world_mix, shr-alpha, 
GPU_uniform(world-horr),
+   GPU_link(mat, shade_world_mix, 
GPU_uniform(world-horr),
shr-combined, shr-combined);
 
-   GPU_link(mat, set_value, GPU_uniform(one), shr-alpha);
+   GPU_link(mat, shade_alpha_opaque, shr-combined, 
shr-combined);
}
 
-   GPU_link(mat, mtex_alpha_to_col, shr-combined, shr-alpha, 
shr-combined);
+   if(ma-shade_flag  MA_OBCOLOR) {
+   mat-obcolalpha = 1;
+   GPU_link(mat, shade_alpha_obcolor, shr-combined, 
GPU_builtin(GPU_OBCOLOR), shr-combined);
+   }
 }
 
 GPUNodeLink *GPU_blender_material(GPUMaterial *mat, Material *ma)

Modified: branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl
===
--- branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl 
2008-08-27 07:12:07 UTC (rev 16268)
+++ branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl 
2008-08-27 11:56:11 UTC (rev 16269)
@@ -1475,7 +1475,7 @@
 
 void shade_obcolor(vec4 col, vec4 obcol, out vec4 outcol)
 {
-   outcol = col*obcol;
+   outcol = vec4(col.rgb*obcol.rgb, col.a);
 }
 
 void ramp_rgbtobw(vec3 color, out float outval)
@@ -1525,9 +1525,19 @@
outfac = (1.0-fac)*(1.0-misi);
 }
 
-void shade_world_mix(float fac, vec3 hor, vec4 col, out vec4 outcol)
+void shade_world_mix(vec3 hor, vec4 col, out vec4 outcol)
 {
-   fac = clamp(fac, 0.0, 1.0);
+   float fac = clamp(col.a, 0.0, 1.0);
outcol = vec4(mix(hor, col.rgb, fac), col.a);
 }
 
+void shade_alpha_opaque(vec4 col, out vec4 outcol)
+{
+   outcol = vec4(col.rgb, 1.0);
+}
+
+void shade_alpha_obcolor(vec4 col, vec4 obcol, out vec4 outcol)
+{
+   outcol = vec4(col.rgb, col.a*obcol.a);
+}
+

Modified: branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c   
2008-08-27 07:12:07 UTC (rev 16268)
+++ branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c   
2008-08-27 11:56:11 UTC (rev 16269)
@@ -1,979 +1,979 @@
 /* DataToC output of file gpu_shader_material_glsl */
 
-int datatoc_gpu_shader_material_glsl_size= 32419;
+int datatoc_gpu_shader_material_glsl_size= 32632;
 char datatoc_gpu_shader_material_glsl[]= {
- 10,102,108,
-111, 97,116, 32,101,120,112, 95, 98,108,101,110,100,101,114, 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,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, 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16270] trunk/blender/source/blender: == Grease Pencil - Conversions + Bugfixes ==

2008-08-27 Thread Joshua Leung
Revision: 16270
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16270
Author:   aligorith
Date: 2008-08-27 15:02:44 +0200 (Wed, 27 Aug 2008)

Log Message:
---
== Grease Pencil - Conversions + Bugfixes ==

* New stuff: Grease Pencil strokes on the active layer can now be converted to 
3d curves (geometry). More work is still needed to make the result look be more 
optimal (i.e. extruded curve)

* Bugfix: Spacing between collapsed layers is more compact now 

Modified Paths:
--
trunk/blender/source/blender/include/BDR_gpencil.h
trunk/blender/source/blender/include/BSE_drawipo.h
trunk/blender/source/blender/src/drawgpencil.c
trunk/blender/source/blender/src/drawipo.c
trunk/blender/source/blender/src/editobject.c
trunk/blender/source/blender/src/gpencil.c

Modified: trunk/blender/source/blender/include/BDR_gpencil.h
===
--- trunk/blender/source/blender/include/BDR_gpencil.h  2008-08-27 11:56:11 UTC 
(rev 16269)
+++ trunk/blender/source/blender/include/BDR_gpencil.h  2008-08-27 13:02:44 UTC 
(rev 16270)
@@ -76,6 +76,9 @@
 void gpencil_delete_operation(short mode);
 void gpencil_delete_menu(void);
 
+void gpencil_convert_operation(short mode);
+void gpencil_convert_menu(void);
+
 //short gpencil_paint(short mousebutton);
 short gpencil_do_paint(struct ScrArea *sa, short mousebutton);
 

Modified: trunk/blender/source/blender/include/BSE_drawipo.h
===
--- trunk/blender/source/blender/include/BSE_drawipo.h  2008-08-27 11:56:11 UTC 
(rev 16269)
+++ trunk/blender/source/blender/include/BSE_drawipo.h  2008-08-27 13:02:44 UTC 
(rev 16270)
@@ -42,6 +42,7 @@
 struct EditIpo;
 struct View2D;
 struct rctf;
+struct SpaceLink;
 
 void calc_ipogrid(void);
 void draw_ipogrid(void);
@@ -50,6 +51,8 @@
 void ipoco_to_areaco   (struct View2D *v2d, float *vec, short *mval);
 void ipoco_to_areaco_noclip(struct View2D *v2d, float *vec, short *mval);
 
+struct View2D *spacelink_get_view2d(struct SpaceLink *sl);
+
 void view2d_do_locks   (struct ScrArea *cursa, int flag);
 void view2d_zoom   (struct View2D *v2d, float factor, int 
winx, int winy);
 void view2d_getscale   (struct View2D *v2d, float *x, float *y);

Modified: trunk/blender/source/blender/src/drawgpencil.c
===
--- trunk/blender/source/blender/src/drawgpencil.c  2008-08-27 11:56:11 UTC 
(rev 16269)
+++ trunk/blender/source/blender/src/drawgpencil.c  2008-08-27 13:02:44 UTC 
(rev 16270)
@@ -177,7 +177,7 @@
if (gpl-flag  (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
char name[256]; /* gpl-info is 128, but we need space for 
'locked/hidden' as well */

-   height= 26;
+   height= 0;

/* visibility button (only if hidden but not locked!) */
if ((gpl-flag  GP_LAYER_HIDE)  !(gpl-flag  
GP_LAYER_LOCKED))

Modified: trunk/blender/source/blender/src/drawipo.c
===
--- trunk/blender/source/blender/src/drawipo.c  2008-08-27 11:56:11 UTC (rev 
16269)
+++ trunk/blender/source/blender/src/drawipo.c  2008-08-27 13:02:44 UTC (rev 
16270)
@@ -442,7 +442,7 @@
else return 1;
 }
 
-static View2D *spacelink_get_view2d(SpaceLink *sl)
+View2D *spacelink_get_view2d(SpaceLink *sl)
 {
if(sl-spacetype==SPACE_IPO) 
return ((SpaceIpo *)sl)-v2d;

Modified: trunk/blender/source/blender/src/editobject.c
===
--- trunk/blender/source/blender/src/editobject.c   2008-08-27 11:56:11 UTC 
(rev 16269)
+++ trunk/blender/source/blender/src/editobject.c   2008-08-27 13:02:44 UTC 
(rev 16270)
@@ -172,6 +172,7 @@
 #include BDR_drawobject.h
 #include BDR_editcurve.h
 #include BDR_unwrapper.h
+#include BDR_gpencil.h
 
 #include time.h
 #include mydevice.h
@@ -2827,7 +2828,10 @@
if(G.scene-id.lib) return;
 
obact= OBACT;
-   if(obact==0) return;
+   if(obact==0) {
+   gpencil_convert_menu();
+   return;
+   }
if(!obact-flag  SELECT) return;
if(G.obedit) return;


Modified: trunk/blender/source/blender/src/gpencil.c
===
--- trunk/blender/source/blender/src/gpencil.c  2008-08-27 11:56:11 UTC (rev 
16269)
+++ trunk/blender/source/blender/src/gpencil.c  2008-08-27 13:02:44 UTC (rev 
16270)
@@ -46,7 +46,9 @@
 #include BLI_blenlib.h
 
 #include DNA_listBase.h
+#include DNA_curve_types.h
 #include DNA_gpencil_types.h
+#include DNA_object_types.h
 #include DNA_scene_types.h
 #include DNA_screen_types.h
 #include DNA_space_types.h
@@ -57,6 +59,7 @@
 #include BKE_global.h
 #include 

Re: [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16270] trunk/blender/source/blender: == Grease Pencil - Conversions + Bugfixes ==

2008-08-27 Thread Joshua Leung
Oops... forgot to note how to use this.

With no objects selected, use the Alt-C hotkey

On Thu, Aug 28, 2008 at 1:02 AM, Joshua Leung [EMAIL PROTECTED] wrote:

 Revision: 16270

 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16270
 Author:   aligorith
 Date: 2008-08-27 15:02:44 +0200 (Wed, 27 Aug 2008)

 Log Message:
 ---
 == Grease Pencil - Conversions + Bugfixes ==

 * New stuff: Grease Pencil strokes on the active layer can now be converted
 to 3d curves (geometry). More work is still needed to make the result look
 be more optimal (i.e. extruded curve)

 * Bugfix: Spacing between collapsed layers is more compact now

 Modified Paths:
 --
trunk/blender/source/blender/include/BDR_gpencil.h
trunk/blender/source/blender/include/BSE_drawipo.h
trunk/blender/source/blender/src/drawgpencil.c
trunk/blender/source/blender/src/drawipo.c
trunk/blender/source/blender/src/editobject.c
trunk/blender/source/blender/src/gpencil.c

 Modified: trunk/blender/source/blender/include/BDR_gpencil.h
 ===
 --- trunk/blender/source/blender/include/BDR_gpencil.h  2008-08-27 11:56:11
 UTC (rev 16269)
 +++ trunk/blender/source/blender/include/BDR_gpencil.h  2008-08-27 13:02:44
 UTC (rev 16270)
 @@ -76,6 +76,9 @@
  void gpencil_delete_operation(short mode);
  void gpencil_delete_menu(void);

 +void gpencil_convert_operation(short mode);
 +void gpencil_convert_menu(void);
 +
  //short gpencil_paint(short mousebutton);
  short gpencil_do_paint(struct ScrArea *sa, short mousebutton);


 Modified: trunk/blender/source/blender/include/BSE_drawipo.h
 ===
 --- trunk/blender/source/blender/include/BSE_drawipo.h  2008-08-27 11:56:11
 UTC (rev 16269)
 +++ trunk/blender/source/blender/include/BSE_drawipo.h  2008-08-27 13:02:44
 UTC (rev 16270)
 @@ -42,6 +42,7 @@
  struct EditIpo;
  struct View2D;
  struct rctf;
 +struct SpaceLink;

  void calc_ipogrid(void);
  void draw_ipogrid(void);
 @@ -50,6 +51,8 @@
  void ipoco_to_areaco   (struct View2D *v2d, float *vec, short
 *mval);
  void ipoco_to_areaco_noclip(struct View2D *v2d, float *vec, short
 *mval);

 +struct View2D *spacelink_get_view2d(struct SpaceLink *sl);
 +
  void view2d_do_locks   (struct ScrArea *cursa, int flag);
  void view2d_zoom   (struct View2D *v2d, float factor,
 int winx, int winy);
  void view2d_getscale   (struct View2D *v2d, float *x, float *y);

 Modified: trunk/blender/source/blender/src/drawgpencil.c
 ===
 --- trunk/blender/source/blender/src/drawgpencil.c  2008-08-27 11:56:11
 UTC (rev 16269)
 +++ trunk/blender/source/blender/src/drawgpencil.c  2008-08-27 13:02:44
 UTC (rev 16270)
 @@ -177,7 +177,7 @@
if (gpl-flag  (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
char name[256]; /* gpl-info is 128, but we need space for
 'locked/hidden' as well */

 -   height= 26;
 +   height= 0;

/* visibility button (only if hidden but not locked!) */
if ((gpl-flag  GP_LAYER_HIDE)  !(gpl-flag 
 GP_LAYER_LOCKED))

 Modified: trunk/blender/source/blender/src/drawipo.c
 ===
 --- trunk/blender/source/blender/src/drawipo.c  2008-08-27 11:56:11 UTC
 (rev 16269)
 +++ trunk/blender/source/blender/src/drawipo.c  2008-08-27 13:02:44 UTC
 (rev 16270)
 @@ -442,7 +442,7 @@
else return 1;
  }

 -static View2D *spacelink_get_view2d(SpaceLink *sl)
 +View2D *spacelink_get_view2d(SpaceLink *sl)
  {
if(sl-spacetype==SPACE_IPO)
return ((SpaceIpo *)sl)-v2d;

 Modified: trunk/blender/source/blender/src/editobject.c
 ===
 --- trunk/blender/source/blender/src/editobject.c   2008-08-27 11:56:11
 UTC (rev 16269)
 +++ trunk/blender/source/blender/src/editobject.c   2008-08-27 13:02:44
 UTC (rev 16270)
 @@ -172,6 +172,7 @@
  #include BDR_drawobject.h
  #include BDR_editcurve.h
  #include BDR_unwrapper.h
 +#include BDR_gpencil.h

  #include time.h
  #include mydevice.h
 @@ -2827,7 +2828,10 @@
if(G.scene-id.lib) return;

obact= OBACT;
 -   if(obact==0) return;
 +   if(obact==0) {
 +   gpencil_convert_menu();
 +   return;
 +   }
if(!obact-flag  SELECT) return;
if(G.obedit) return;


 Modified: trunk/blender/source/blender/src/gpencil.c
 ===
 --- trunk/blender/source/blender/src/gpencil.c  2008-08-27 11:56:11 UTC
 (rev 16269)
 +++ trunk/blender/source/blender/src/gpencil.c  2008-08-27 13:02:44 UTC
 (rev 16270)
 @@ -46,7 +46,9 @@
  #include BLI_blenlib.h

  #include DNA_listBase.h
 +#include DNA_curve_types.h
  #include 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16271] branches/apricot/source/gameengine /Converter/BL_ArmatureObject.cpp: Apricot Branch: bugfix, broke bone parenting with yesterday's commit.

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

Log Message:
---
Apricot Branch: bugfix, broke bone parenting with yesterday's commit.

Modified Paths:
--
branches/apricot/source/gameengine/Converter/BL_ArmatureObject.cpp

Modified: branches/apricot/source/gameengine/Converter/BL_ArmatureObject.cpp
===
--- branches/apricot/source/gameengine/Converter/BL_ArmatureObject.cpp  
2008-08-27 13:02:44 UTC (rev 16270)
+++ branches/apricot/source/gameengine/Converter/BL_ArmatureObject.cpp  
2008-08-27 13:10:16 UTC (rev 16271)
@@ -201,8 +201,8 @@
 {
bPoseChannel *pchan;
 
-   VerifyPose();
-   pchan = get_pose_channel(m_pose, bone-name);
+   ApplyPose();
+   pchan = get_pose_channel(m_objArma-pose, bone-name);
 
if(pchan) {
matrix.setValue(pchan-pose_mat[0][0]);


___
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 [16272] branches/apricot/source/blender/ gpu/intern: Apricot Branch: another fix for obcolor alpha - i can't seem

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

Log Message:
---
Apricot Branch: another fix for obcolor alpha - i can't seem
to get this right :).

Modified Paths:
--
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_material.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-08-27 
13:10:16 UTC (rev 16271)
+++ branches/apricot/source/blender/gpu/intern/gpu_material.c   2008-08-27 
14:18:52 UTC (rev 16272)
@@ -1173,8 +1173,8 @@
GPU_uniform(world-miststa), 
GPU_uniform(world-mistdist),
GPU_uniform(misttype), GPU_uniform(world-misi), 
mistfac);
 
-   GPU_link(mat, mix_blend, mistfac, GPU_uniform(world-horr),
-   shr-combined, shr-combined);
+   GPU_link(mat, mix_blend, mistfac, shr-combined,
+   GPU_uniform(world-horr), shr-combined);
}
 
if(!(ma-mode  MA_ZTRA)) {

Modified: branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl
===
--- branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl 
2008-08-27 13:10:16 UTC (rev 16271)
+++ branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl 
2008-08-27 14:18:52 UTC (rev 16272)
@@ -1522,7 +1522,7 @@
else if(misttype == 1.0);
else fac = sqrt(fac);
 
-   outfac = (1.0-fac)*(1.0-misi);
+   outfac = 1.0 - (1.0-fac)*(1.0-misi);
 }
 
 void shade_world_mix(vec3 hor, vec4 col, out vec4 outcol)

Modified: branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c
===
--- branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c   
2008-08-27 13:10:16 UTC (rev 16271)
+++ branches/apricot/source/blender/gpu/intern/gpu_shader_material.glsl.c   
2008-08-27 14:18:52 UTC (rev 16272)
@@ -1,1016 +1,1016 @@
 /* DataToC output of file gpu_shader_material_glsl */
 
-int datatoc_gpu_shader_material_glsl_size= 32632;
+int datatoc_gpu_shader_material_glsl_size= 32638;
 char datatoc_gpu_shader_material_glsl[]= {
- 10,102,108,111, 97,116, 32,101,120,112, 95, 98,108,101,110,100,101,114, 
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,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,  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16275] trunk/blender: BGE patch: KX_GameObject::rayCast() improvements to have X-Ray option, return true face normal and hit polygon information.

2008-08-27 Thread Benoit Bolsee
Revision: 16275
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16275
Author:   ben2610
Date: 2008-08-27 21:34:19 +0200 (Wed, 27 Aug 2008)

Log Message:
---
BGE patch: KX_GameObject::rayCast() improvements to have X-Ray option, return 
true face normal and hit polygon information.

rayCast(to,from,dist,prop,face,xray,poly):

The face paremeter determines the orientation of the normal: 
  0 or omitted = hit normal is always oriented towards the ray origin (as if 
you casted the ray from outside)
  1 = hit normal is the real face normal (only for mesh object, otherwise face 
has no effect)
The ray has X-Ray capability if xray parameter is 1, otherwise the first object 
hit (other than self object) stops the ray.
The prop and xray parameters interact as follow:
prop off, xray off: return closest hit or no hit if there is no object on 
the full extend of the ray.
prop off, xray on : idem.
prop on,  xray off: return closest hit if it matches prop, no hit otherwise.
prop on,  xray on : return closest hit matching prop or no hit if there is 
no object matching prop on the full extend of the ray.
if poly is 0 or omitted, returns a 3-tuple with object reference, hit point and 
hit normal or (None,None,None) if no hit.
if poly is 1, returns a 4-tuple with in addition a KX_PolyProxy as 4th element.

The KX_PolyProxy object holds information on the polygon hit by the ray: the 
index of the vertex forming the poylgon, material, etc.

Attributes (read-only):
 matname: The name of polygon material, empty if no material.
 material: The material of the polygon
 texture: The texture name of the polygon.
 matid: The material index of the polygon, use this to retrieve vertex proxy 
from mesh proxy
 v1: vertex index of the first vertex of the polygon, use this to retrieve 
vertex proxy from mesh proxy
 v2: vertex index of the second vertex of the polygon, use this to retrieve 
vertex proxy from mesh proxy
 v3: vertex index of the third vertex of the polygon, use this to retrieve 
vertex proxy from mesh proxy
 v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 
vertex
 use this to retrieve vertex proxy from mesh proxy
 visible: visible state of the polygon: 1=visible, 0=invisible
 collide: collide state of the polygon: 1=receives collision, 0=collision free.
Methods:
 getMaterialName(): Returns the polygon material name with MA prefix
 getMaterial(): Returns the polygon material
 getTextureName(): Returns the polygon texture name
 getMaterialIndex(): Returns the material bucket index of the polygon. 
 getNumVertex(): Returns the number of vertex of the polygon.
 isVisible(): Returns whether the polygon is visible or not
 isCollider(): Returns whether the polygon is receives collision or not
 getVertexIndex(vertex): Returns the mesh vertex index of a polygon vertex
 getMesh(): Returns a mesh proxy

New methods of KX_MeshProxy have been implemented to retrieve KX_PolyProxy 
objects:
 getNumPolygons(): Returns the number of polygon in the mesh.
 getPolygon(index): Gets the specified polygon from the mesh.

More details in PyDoc.

Modified Paths:
--
trunk/blender/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
trunk/blender/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
trunk/blender/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
trunk/blender/source/gameengine/Expressions/PyObjectPlus.h
trunk/blender/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
trunk/blender/source/gameengine/GamePlayer/common/GPC_RenderTools.h
trunk/blender/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
trunk/blender/source/gameengine/Ketsji/KX_ConstraintActuator.h
trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
trunk/blender/source/gameengine/Ketsji/KX_GameObject.h
trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp
trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.h
trunk/blender/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
trunk/blender/source/gameengine/Ketsji/KX_MouseFocusSensor.h
trunk/blender/source/gameengine/Ketsji/KX_RayCast.cpp
trunk/blender/source/gameengine/Ketsji/KX_RayCast.h
trunk/blender/source/gameengine/Ketsji/KX_RaySensor.cpp
trunk/blender/source/gameengine/Ketsji/KX_RaySensor.h
trunk/blender/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp
trunk/blender/source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h
trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.h
trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
trunk/blender/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
trunk/blender/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16277] trunk/blender/source/gameengine/ Ketsji/KX_PythonInit.cpp: remove more python functions from builtins that could allow scripts to do bad stuff

2008-08-27 Thread Campbell Barton
Revision: 16277
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=16277
Author:   campbellbarton
Date: 2008-08-28 07:45:20 +0200 (Thu, 28 Aug 2008)

Log Message:
---
remove more python functions from builtins that could allow scripts to do bad 
stuff.  
- reload, file, execfile, compile
These are only removed when running in higher security mode thats not default 
in blender.

Modified Paths:
--
trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp

Modified: trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
===
--- trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp2008-08-27 
19:38:51 UTC (rev 16276)
+++ trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp2008-08-28 
05:45:20 UTC (rev 16277)
@@ -852,14 +852,31 @@
 // override builtin functions import() and open()
 
 
-PyObject *KXpy_open(PyObject *self, PyObject *args)
-{
+PyObject *KXpy_open(PyObject *self, PyObject *args) {
PyErr_SetString(PyExc_RuntimeError, Sandbox: open() function 
disabled!\nGame Scripts should not use this function.);
return NULL;
 }
 
+PyObject *KXpy_reload(PyObject *self, PyObject *args) {
+   PyErr_SetString(PyExc_RuntimeError, Sandbox: reload() function 
disabled!\nGame Scripts should not use this function.);
+   return NULL;
+}
 
+PyObject *KXpy_file(PyObject *self, PyObject *args) {
+   PyErr_SetString(PyExc_RuntimeError, Sandbox: file() function 
disabled!\nGame Scripts should not use this function.);
+   return NULL;
+}
 
+PyObject *KXpy_execfile(PyObject *self, PyObject *args) {
+   PyErr_SetString(PyExc_RuntimeError, Sandbox: execfile() function 
disabled!\nGame Scripts should not use this function.);
+   return NULL;
+}
+
+PyObject *KXpy_compile(PyObject *self, PyObject *args) {
+   PyErr_SetString(PyExc_RuntimeError, Sandbox: compile() function 
disabled!\nGame Scripts should not use this function.);
+   return NULL;
+}
+
 PyObject *KXpy_import(PyObject *self, PyObject *args)
 {
char *name;
@@ -895,20 +912,14 @@
 }
 
 
+static PyMethodDef meth_open[] = {{ open, KXpy_open, METH_VARARGS, 
(disabled)}};
+static PyMethodDef meth_reload[] = {{ reload, KXpy_reload, METH_VARARGS, 
(disabled)}};
+static PyMethodDef meth_file[] = {{ file, KXpy_file, METH_VARARGS, 
(disabled)}};
+static PyMethodDef meth_execfile[] = {{ execfile, KXpy_execfile, 
METH_VARARGS, (disabled)}};
+static PyMethodDef meth_compile[] = {{ compile, KXpy_compile, METH_VARARGS, 
(disabled)}};
 
-static PyMethodDef meth_open[] = {
-   { open, KXpy_open, METH_VARARGS,
-   (disabled)}
-};
+static PyMethodDef meth_import[] = {{ import, KXpy_import, METH_VARARGS, 
our own import}};
 
-
-static PyMethodDef meth_import[] = {
-   { import, KXpy_import, METH_VARARGS,
-   our own import}
-};
-
-
-
 //static PyObject *g_oldopen = 0;
 //static PyObject *g_oldimport = 0;
 //static int g_security = 0;
@@ -918,15 +929,21 @@
 {
 PyObject *m = PyImport_AddModule(__builtin__);
 PyObject *d = PyModule_GetDict(m);
-   PyObject *meth = PyCFunction_New(meth_open, NULL);
 
switch (level) {
case psl_Highest:
//if (!g_security) {
//g_oldopen = PyDict_GetItemString(d, open);
-   PyDict_SetItemString(d, open, meth);
-   meth = PyCFunction_New(meth_import, NULL);
-   PyDict_SetItemString(d, __import__, meth);
+   
+   // functions we cant trust
+   PyDict_SetItemString(d, open, 
PyCFunction_New(meth_open, NULL));
+   PyDict_SetItemString(d, reload, 
PyCFunction_New(meth_reload, NULL));
+   PyDict_SetItemString(d, file, 
PyCFunction_New(meth_file, NULL));
+   PyDict_SetItemString(d, execfile, 
PyCFunction_New(meth_execfile, NULL));
+   PyDict_SetItemString(d, compile, 
PyCFunction_New(meth_compile, NULL));
+   
+   // our own import
+   PyDict_SetItemString(d, __import__, 
PyCFunction_New(meth_import, NULL));
//g_security = level;
//}
break;


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