[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15930] trunk/blender/source/blender/ blenlib/intern/BLI_kdopbvh.c: Little speedup for kdop-bvh

2008-08-03 Thread Daniel Genrich
Revision: 15930
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15930
Author:   genscher
Date: 2008-08-03 13:40:09 +0200 (Sun, 03 Aug 2008)

Log Message:
---
Little speedup for kdop-bvh

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

Modified: trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
===
--- trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c   2008-08-03 
02:02:15 UTC (rev 15929)
+++ trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c   2008-08-03 
11:40:09 UTC (rev 15930)
@@ -484,15 +484,14 @@
}
 }
 
-static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, 
char lastaxis)
+static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end)
 {
-   char laxis;
int i, tend;
BVHNode *tnode;
int slice = (end-start+tree->tree_type-1)/tree->tree_type;  
//division rounded up

// Determine which axis to split along
-   laxis = get_largest_axis(node->bv);
+   char laxis = get_largest_axis(node->bv);

// split nodes along longest axis
for (i=0; start < end; start += slice, i++) //i counts the current child
@@ -515,7 +514,7 @@
if(tend != end)
partition_nth_element(tree->nodes, start, end, 
tend, laxis);
refit_kdop_hull(tree, tnode, start, tend);
-   bvh_div_nodes(tree, tnode, start, tend, laxis);
+   bvh_div_nodes(tree, tnode, start, tend);
}
node->totnode++;
}
@@ -586,7 +585,7 @@
// refit root bvh node
refit_kdop_hull(tree, tree->nodes[tree->totleaf], 0, tree->totleaf);
// create + balance tree
-   bvh_div_nodes(tree, tree->nodes[tree->totleaf], 0, tree->totleaf, 0);
+   bvh_div_nodes(tree, tree->nodes[tree->totleaf], 0, tree->totleaf);

// verify_tree(tree);
 }


___
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 [15931] trunk/blender/source/blender/src/ drawgpencil.c: Grease Pencil Drawing:

2008-08-03 Thread Joshua Leung
Revision: 15931
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15931
Author:   aligorith
Date: 2008-08-03 13:55:45 +0200 (Sun, 03 Aug 2008)

Log Message:
---
Grease Pencil Drawing:

Some WIP code for 'nicer' drawing of thick 2d-strokes that will hopefully 
result in smoother lines, particularly with abrupt direction changes. Currently 
the code is hidden behind the rt button (for rt != 0), as in some cases, it 
still looks rather bad.

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

Modified: trunk/blender/source/blender/src/drawgpencil.c
===
--- trunk/blender/source/blender/src/drawgpencil.c  2008-08-03 11:40:09 UTC 
(rev 15930)
+++ trunk/blender/source/blender/src/drawgpencil.c  2008-08-03 11:55:45 UTC 
(rev 15931)
@@ -310,6 +310,8 @@
 /* ** */
 /* GREASE PENCIL DRAWING */
 
+/* - General Defines -- */
+
 /* flags for sflag */
 enum {
GP_DRAWDATA_NOSTATUS= (1<<0),   /* don't draw status info */
@@ -317,7 +319,9 @@
GP_DRAWDATA_ONLYV2D = (1<<2),   /* only draw 'canvas' 
strokes */
 };
 
-/* draw stroke in buffer */
+/* - Tool Buffer Drawing -- */
+
+/* draw stroke defined in buffer (simple ogl lines/points for now, as dotted 
lines) */
 static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short 
thickness, short dflag, short sflag)
 {
tGPspoint *pt;
@@ -377,115 +381,232 @@
}
 }
 
-/* draw a given stroke */
-static void gp_draw_stroke (bGPDspoint *points, int totpoints, short 
thickness, short dflag, short sflag, short debug, int winx, int winy)
+/* - Existing Strokes Drawing (3D and Point) -- */
+
+/* draw a given stroke - just a single dot (only one point) */
+static void gp_draw_stroke_point (bGPDspoint *points, short sflag, int winx, 
int winy)
 {
+   /* draw point */
+   if (sflag & GP_STROKE_3DSPACE) {
+   glBegin(GL_POINTS);
+   glVertex3f(points->x, points->y, points->z);
+   glEnd();
+   }
+   else if (sflag & GP_STROKE_2DSPACE) {
+   glBegin(GL_POINTS);
+   glVertex2f(points->x, points->y);
+   glEnd();
+   }
+   else {
+   const float x= (points->x / 1000 * winx);
+   const float y= (points->y / 1000 * winy);
+   
+   glBegin(GL_POINTS);
+   glVertex2f(x, y);
+   glEnd();
+   }
+}
+
+/* draw a given stroke in 3d (i.e. in 3d-space), using simple ogl lines */
+static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short 
thickness, short dflag, short sflag, short debug, int winx, int winy)
+{
bGPDspoint *pt;
+   float oldpressure = 0.0f;
int i;

-   /* error checking */
-   if ((points == NULL) || (totpoints <= 0))
-   return;
-   
-   /* check if stroke can be drawn */
-   if ((dflag & GP_DRAWDATA_ONLY3D) && !(sflag & GP_STROKE_3DSPACE))
-   return;
-   if (!(dflag & GP_DRAWDATA_ONLY3D) && (sflag & GP_STROKE_3DSPACE))
-   return;
-   if ((dflag & GP_DRAWDATA_ONLYV2D) && !(sflag & GP_STROKE_2DSPACE))
-   return;
-   if (!(dflag & GP_DRAWDATA_ONLYV2D) && (sflag & GP_STROKE_2DSPACE))
-   return;
-   
-   /* if drawing a single point, draw it larger */
-   if (totpoints == 1) {   
-   /* draw point */
-   if (sflag & GP_STROKE_3DSPACE) {
-   glBegin(GL_POINTS);
-   glVertex3f(points->x, points->y, points->z);
+   /* draw stroke curve */
+   glBegin(GL_LINE_STRIP);
+   for (i=0, pt=points; i < totpoints && pt; i++, pt++) {
+   if (fabs(pt->pressure - oldpressure) > 0.2f) {
glEnd();
-   }
-   else if (sflag & GP_STROKE_2DSPACE) {
-   glBegin(GL_POINTS);
-   glVertex2f(points->x, points->y);
-   glEnd();
-   }
-   else {
-   const float x= (points->x / 1000 * winx);
-   const float y= (points->y / 1000 * winy);
+   glLineWidth(pt->pressure * thickness);
+   glBegin(GL_LINE_STRIP);

-   glBegin(GL_POINTS);
-   glVertex2f(x, y);
-   glEnd();
+   glVertex3f(pt->x, pt->y, pt->z);
+   
+   oldpressure = pt->pressure;
}
+   else
+   glVertex3f(pt->x, pt->y, pt->z);
}
-   else {
-   float oldpressure = 0.0f;
+   glEnd();
+ 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15932] branches/apricot: apricot branch: svn merge -r15868:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender

2008-08-03 Thread Brecht Van Lommel
Revision: 15932
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15932
Author:   blendix
Date: 2008-08-03 16:46:34 +0200 (Sun, 03 Aug 2008)

Log Message:
---
apricot branch: svn merge -r15868:HEAD 
https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--
branches/apricot/bin/.blender/.Blanguages
branches/apricot/intern/boolop/SConscript
branches/apricot/intern/boolop/intern/BOP_Edge.cpp
branches/apricot/intern/boolop/intern/BOP_Edge.h
branches/apricot/intern/boolop/intern/BOP_Face.cpp
branches/apricot/intern/boolop/intern/BOP_Face.h
branches/apricot/intern/boolop/intern/BOP_Interface.cpp
branches/apricot/intern/boolop/intern/BOP_Merge.cpp
branches/apricot/intern/boolop/intern/BOP_Merge.h
branches/apricot/intern/boolop/intern/BOP_Mesh.cpp
branches/apricot/intern/boolop/intern/BOP_Mesh.h
branches/apricot/intern/boolop/intern/BOP_Tag.h
branches/apricot/intern/boolop/intern/BOP_Vertex.cpp
branches/apricot/intern/boolop/intern/BOP_Vertex.h
branches/apricot/intern/bsp/SConscript

branches/apricot/projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj
branches/apricot/projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj

branches/apricot/projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Sumo/PHY_Sumo.vcproj
branches/apricot/release/scripts/bpymodules/colladaImEx/collada.py
branches/apricot/release/scripts/bpymodules/colladaImEx/translator.py
branches/apricot/release/scripts/bpymodules/colladaImEx/xmlUtils.py
branches/apricot/source/blender/blenkernel/BKE_texture.h
branches/apricot/source/blender/blenkernel/intern/collision.c
branches/apricot/source/blender/blenkernel/intern/texture.c
branches/apricot/source/blender/blenlib/intern/BLI_kdopbvh.c
branches/apricot/source/blender/blenlib/intern/boxpack2d.c
branches/apricot/source/blender/blenloader/intern/writefile.c
branches/apricot/source/blender/include/BDR_gpencil.h
branches/apricot/source/blender/include/BIF_editview.h
branches/apricot/source/blender/makesdna/DNA_gpencil_types.h
branches/apricot/source/blender/src/buttons_logic.c
branches/apricot/source/blender/src/drawgpencil.c
branches/apricot/source/blender/src/editimasel.c
branches/apricot/source/blender/src/editipo.c
branches/apricot/source/blender/src/editobject.c
branches/apricot/source/blender/src/editview.c
branches/apricot/source/blender/src/gpencil.c
branches/apricot/source/blender/src/header_info.c
branches/apricot/source/blender/src/header_ipo.c
branches/apricot/source/blender/src/header_view3d.c
branches/apricot/source/blender/src/meshlaplacian.c
branches/apricot/source/blender/src/space.c
branches/apricot/source/blender/src/toolbox.c
branches/apricot/source/gameengine/Converter/BL_ActionActuator.cpp
branches/apricot/source/gameengine/Converter/BL_ArmatureObject.cpp
branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp
branches/apricot/source/gameengine/Converter/KX_ConvertSensors.cpp
branches/apricot/source/gameengine/GameLogic/SCA_ActuatorEventManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_ActuatorEventManager.h
branches/apricot/source/gameengine/GameLogic/SCA_AlwaysEventManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_AlwaysEventManager.h
branches/apricot/source/gameengine/GameLogic/SCA_EventManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_EventManager.h
branches/apricot/source/gameengine/GameLogic/SCA_IObject.cpp
branches/apricot/source/gameengine/GameLogic/SCA_ISensor.cpp
branches/apricot/source/gameengine/GameLogic/SCA_ISensor.h
branches/apricot/source/gameengine/GameLogic/SCA_JoystickManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_JoystickManager.h
branches/apricot/source/gameengine/GameLogic/SCA_KeyboardManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_KeyboardManager.h
branches/apricot/source/gameengine/GameLogic/SCA_LogicManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_MouseManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_MouseManager.h
branches/apricot/source/gameengine/GameLogic/SCA_PropertyEventManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_PropertyEventManager.h
branches/apricot/source/gameengine/GameLogic/SCA_RandomEventManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_RandomEventManager.h
branches/apricot/source/gameengine/GameLogic/SCA_TimeEventManager.cpp
branches/apricot/source/gameengine/GameLogic/SCA_TimeEventManager.h
branches/apricot/source/gameengine/GamePlayer/common/windows/GPW_Canvas.h

branches/apricot/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.cpp
branches/apricot/source/gameengine/Ketsji/KXNetwork/KX_NetworkEventManager.h
branches/apricot/

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15933] trunk/blender/source/blender/src/ editseq.c: == Sequencer ==

2008-08-03 Thread Peter Schlaile
Revision: 15933
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15933
Author:   schlaile
Date: 2008-08-03 17:35:56 +0200 (Sun, 03 Aug 2008)

Log Message:
---
== Sequencer ==

This fixes:
[#17413] Sequencer: Blender crashes pressing R on a color strip 

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

Modified: trunk/blender/source/blender/src/editseq.c
===
--- trunk/blender/source/blender/src/editseq.c  2008-08-03 14:46:34 UTC (rev 
15932)
+++ trunk/blender/source/blender/src/editseq.c  2008-08-03 15:35:56 UTC (rev 
15933)
@@ -644,6 +644,7 @@
 
 static int seq_is_predecessor(Sequence *pred, Sequence *seq)
 {
+   if (!pred) return 0;
if(pred == seq) return 0;
else if(seq_is_parent(pred, seq)) return 1;
else if(pred->seq1 && seq_is_predecessor(pred->seq1, seq)) return 1;


___
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 [15934] branches/soc-2008-jaguarandi/ source/blender: added openmp support for bvhtree build (max processes = tree_type)

2008-08-03 Thread André Pinto
Revision: 15934
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15934
Author:   jaguarandi
Date: 2008-08-03 17:37:24 +0200 (Sun, 03 Aug 2008)

Log Message:
---
added openmp support for bvhtree build (max processes = tree_type)

Modified Paths:
--
branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c
branches/soc-2008-jaguarandi/source/blender/blenlib/intern/BLI_kdopbvh.c
branches/soc-2008-jaguarandi/source/blender/makesdna/DNA_constraint_types.h

Modified: 
branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c
===
--- branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c  
2008-08-03 15:35:56 UTC (rev 15933)
+++ branches/soc-2008-jaguarandi/source/blender/blenkernel/intern/shrinkwrap.c  
2008-08-03 15:37:24 UTC (rev 15934)
@@ -1024,7 +1024,7 @@
break;
 
case MOD_SHRINKWRAP_NORMAL:
-   shrinkwrap_calc_normal_projection(&calc);
+   BENCH(shrinkwrap_calc_normal_projection(&calc));
break;
 
case MOD_SHRINKWRAP_NEAREST_VERTEX:

Modified: 
branches/soc-2008-jaguarandi/source/blender/blenlib/intern/BLI_kdopbvh.c
===
--- branches/soc-2008-jaguarandi/source/blender/blenlib/intern/BLI_kdopbvh.c
2008-08-03 15:35:56 UTC (rev 15933)
+++ branches/soc-2008-jaguarandi/source/blender/blenlib/intern/BLI_kdopbvh.c
2008-08-03 15:37:24 UTC (rev 15934)
@@ -28,8 +28,9 @@
 
 #include "math.h"
 #include 
-#include  
+#include 
 #include 
+#include 
 
 #include "MEM_guardedalloc.h"
 
@@ -294,10 +295,32 @@
}
 }
 
+// calculate max number of branches
+int needed_branches(int tree_type, int leafs)
+{
+#if 1
+   //Worst case scenary  ( return max(0, leafs-tree_type)+1 )
+   if(leafs <= tree_type)
+   return 1;
+   else
+   return leafs-tree_type+1;
+
+#else
+   //If our bvh kdop is "almost perfect"
+   //TODO i dont trust the float arithmetic in here (and I am not sure 
this formula is according to our splitting method)
+   int i, numbranches = 0;
+   for(i = 1; i <= 
(int)ceil((float)((float)log(leafs)/(float)log(tree_type))); i++)
+   numbranches += (pow(tree_type, i) / tree_type);
+
+   return numbranches;
+#endif
+}
+   
+
 BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
 {
BVHTree *tree;
-   int numbranches=0, i;
+   int numnodes, i;

// theres not support for trees below binary-trees :P
if(tree_type < 2)
@@ -343,26 +366,25 @@
}
 
 
-   // calculate max number of branches, our bvh kdop is "almost 
perfect"
-   for(i = 1; i <= 
(int)ceil((float)((float)log(maxsize)/(float)log(tree_type))); i++)
-   numbranches += (pow(tree_type, i) / tree_type);
+   //Allocate arrays
+   numnodes = maxsize + needed_branches(tree_type, maxsize) + 
tree_type;
+
+   tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode 
*)*numnodes, "BVHNodes");

-   tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode 
*)*(numbranches+maxsize + tree_type), "BVHNodes");
-   
if(!tree->nodes)
{
MEM_freeN(tree);
return NULL;
}

-   tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * 
(numbranches+maxsize + tree_type), "BVHNodeBV");
+   tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * 
numnodes, "BVHNodeBV");
if(!tree->nodebv)
{
MEM_freeN(tree->nodes);
MEM_freeN(tree);
}
 
-   tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * 
tree_type * (numbranches+maxsize + tree_type), "BVHNodeBV");
+   tree->nodechild = (BVHNode**)MEM_callocN(sizeof(BVHNode*) * 
tree_type * numnodes, "BVHNodeBV");
if(!tree->nodechild)
{
MEM_freeN(tree->nodebv);
@@ -370,7 +392,7 @@
MEM_freeN(tree);
}
 
-   tree->nodearray = (BVHNode 
*)MEM_callocN(sizeof(BVHNode)*(numbranches+maxsize + tree_type), 
"BVHNodeArray");
+   tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)* 
numnodes, "BVHNodeArray");

if(!tree->nodearray)
{
@@ -382,7 +404,7 @@
}
 
//link the dynamic bv and child links
-   for(i=0; i< numbranches+maxsize + tree_type; i++)
+   for(i=0; i< numnodes; i++)

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15935] trunk/blender/source/blender/src/ drawseq.c: == Sequencer ==

2008-08-03 Thread Peter Schlaile
Revision: 15935
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15935
Author:   schlaile
Date: 2008-08-03 17:45:53 +0200 (Sun, 03 Aug 2008)

Log Message:
---
== Sequencer ==

This fixes:
[#17405] Sequencer: unselected black strips are unreadable
using
[#17418] Fix for bug #17405: unselected black seq strips text unreadable

Thanks to Roelf De Kock for providing the patch and 
mindrones for the bug report :)

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

Modified: trunk/blender/source/blender/src/drawseq.c
===
--- trunk/blender/source/blender/src/drawseq.c  2008-08-03 15:37:24 UTC (rev 
15934)
+++ trunk/blender/source/blender/src/drawseq.c  2008-08-03 15:45:53 UTC (rev 
15935)
@@ -98,7 +98,7 @@
 int no_rightbox=0, no_leftbox= 0;
 static void draw_seq_handle(Sequence *seq, SpaceSeq *sseq, float pixelx, short 
direction);
 static void draw_seq_extensions(Sequence *seq, SpaceSeq *sseq);
-static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float 
y2);
+static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float 
y2, char *background_col);
 static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, 
float x2, float y2);
 static void draw_seq_strip(struct Sequence *seq, struct ScrArea *sa, struct 
SpaceSeq *sseq, int outline_tint, float pixelx);
 
@@ -604,7 +604,7 @@
 }
 
 /* draw info text on a sequence strip */
-static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float 
y2)
+static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float 
y2, char *background_col)
 {
float v1[2], v2[2];
int len, size;
@@ -670,8 +670,13 @@
mval[1]= 1;
areamouseco_to_ipoco(G.v2d, mval, &x1, &x2);

-   if(seq->flag & SELECT) cpack(0xFF);
-   else cpack(0);
+   if(seq->flag & SELECT){
+   cpack(0xFF);
+   }else if int)background_col[0] + (int)background_col[1] + 
(int)background_col[2]) / 3) < 50){
+   cpack(0x505050); /* use lighter text colour for dark background 
*/
+   }else{
+   cpack(0);
+   }
glRasterPos3f(x1,  y1+SEQ_STRIP_OFSBOTTOM, 0.0);
BMF_DrawString(G.font, strp);
 }
@@ -740,7 +745,7 @@
 static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int 
outline_tint, float pixelx)
 {
float x1, x2, y1, y2;
-   char col[3], is_single_image;
+   char col[3], background_col[3], is_single_image;
 
/* we need to know if this is a single image/color or not for drawing */
is_single_image = (char)check_single_seq(seq);
@@ -755,13 +760,14 @@


/* get the correct color per strip type*/
-   get_seq_color3ubv(seq, col);
+   //get_seq_color3ubv(seq, col);
+   get_seq_color3ubv(seq, background_col);

/* draw the main strip body */
if (is_single_image) /* single image */
-   draw_shadedstrip(seq, col, seq_tx_get_final_left(seq, 0), y1, 
seq_tx_get_final_right(seq, 0), y2);
+   draw_shadedstrip(seq, background_col, 
seq_tx_get_final_left(seq, 0), y1, seq_tx_get_final_right(seq, 0), y2);
else /* normal operation */
-   draw_shadedstrip(seq, col, x1, y1, x2, y2);
+   draw_shadedstrip(seq, background_col, x1, y1, x2, y2);

/* draw additional info and controls */
if (seq->type == SEQ_RAM_SOUND)
@@ -814,7 +820,7 @@
 
/* nice text here would require changing the view matrix for texture 
text */
if( (x2-x1) / pixelx > 32) {
-   draw_seq_text(seq, x1, x2, y1, y2);
+   draw_seq_text(seq, x1, x2, y1, y2, background_col);
}
 }
 


___
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 [15936] trunk/blender/source/blender/src/ buttons_scene.c: == Sequencer ==

2008-08-03 Thread Peter Schlaile
Revision: 15936
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15936
Author:   schlaile
Date: 2008-08-03 17:56:35 +0200 (Sun, 03 Aug 2008)

Log Message:
---
== Sequencer ==

Fixes:
[#15082] Sequencer: for image strips, the Input file field disappears if the 
cursor is out of the selected strip

also it wasn't really a bug, since the file name of image input strips
_has_ to depend on CFRA.

Well, we choose the next possible image strip, which is most likely the thing,
most people expected...

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

Modified: trunk/blender/source/blender/src/buttons_scene.c
===
--- trunk/blender/source/blender/src/buttons_scene.c2008-08-03 15:45:53 UTC 
(rev 15935)
+++ trunk/blender/source/blender/src/buttons_scene.c2008-08-03 15:56:35 UTC 
(rev 15936)
@@ -763,8 +763,17 @@
}
 
if (last_seq->type == SEQ_IMAGE) {
-   StripElem * se = give_stripelem(last_seq, CFRA);
+   int cfra = CFRA;
+   StripElem * se;
 
+   if(last_seq->startdisp >cfra) {
+   cfra = last_seq->startdisp;
+   } else if (last_seq->enddisp <= cfra) {
+   cfra = last_seq->enddisp - 1;
+   }
+
+   se = give_stripelem(last_seq, cfra);
+
if (se) {
uiDefBut(block, TEX, 
 B_SEQ_BUT_RELOAD_FILE, "File: ", 


___
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 [15937] trunk/blender/release/scripts/ import_dxf.py: DXF-importer script.

2008-08-03 Thread Remigiusz Fiedler
Revision: 15937
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15937
Author:   migius
Date: 2008-08-03 17:57:09 +0200 (Sun, 03 Aug 2008)

Log Message:
---
DXF-importer script. Works well with 2.46winXP
Please commit to 2.47 branch
patch history:
 v1.12 - 2008.08.03
 c2 warningfix: relocating of globals: layersmap, oblist 
 c2 modif UI: buttons newScene+targetLayer moved to start panel
 v1.12 - 2008.07.04
 c1 added control Curve's OrderU parameter
 c1 modif UI: preset buttons X-2D-3D moved to start panel
 b6 added handling exception of not registered LAYERs (Hammer-HL-editor DXF 
output)
 b5 rebuild UI: global preset 2D for Curve-Import
 b5 added UI-options: PL-MESH N+N plmesh_flip and normals_out 
 b5 added support for SPLINEs, added control OrderU parameter
 b5 rewrote draw module for NURBS_curve and Bezier_curve
 v1.12 - 2008.06.22
 b4 change versioning system 1.0.12 -> 1.12
 b4 print at start version-info to console
 b3 bugfix: ob.name conflict with existing meshes (different ob.name/mesh.name)

Modified Paths:
--
trunk/blender/release/scripts/import_dxf.py

Modified: trunk/blender/release/scripts/import_dxf.py
===
--- trunk/blender/release/scripts/import_dxf.py 2008-08-03 15:56:35 UTC (rev 
15936)
+++ trunk/blender/release/scripts/import_dxf.py 2008-08-03 15:57:09 UTC (rev 
15937)
@@ -2,15 +2,15 @@
 
 """
 Name: 'Autodesk DXF (.dxf)'
-Blender: 244
+Blender: 246
 Group: 'Import'
 Tooltip: 'Import for DXF geometry data (Drawing eXchange Format).'
 """
 __author__ = 'Kitsu(Ed Blake) & migius(Remigiusz Fiedler)'
-__version__ = '1.0.12 - 2008.06.05 by migius'
+__version__ = '1.12 - 2008.07.04 by migius'
 __url__ = ["http://blenderartists.org/forum/showthread.php?t=84319";,
 "http://wiki.blender.org/index.php/Scripts/Manual/Import/DXF-3D";]
-__email__ = ["Kitsune_e(at)yahoo.com", "migius(at)4d-vectors.de"]
+__email__ = ["migius(at)4d-vectors.de","Kitsune_e(at)yahoo.com"]
 __bpydoc__ = """\
 This script imports objects from DXF (2d/3d) into Blender.
 
@@ -19,7 +19,7 @@
 Enhanced features are:
 - configurable object filtering and geometry manipulation,
 - configurable material pre-processing,
-- DXF-data analyze and raporting.
+- DXF-code analyze and reporting.
 
 Supported DXF r12 objects:
 LINE,
@@ -41,10 +41,10 @@
 
 Supported DXF>r12 objects:
 ELLIPSE,
-LWPOLYLINE (LightWeight Polylines),
-(wip v1.0.12) SPLINE,
-(wip v1.0.13) MLINE,
-(wip v1.0.13) MTEXT
+LWPOLYLINE (LightWeight Polyline),
+SPLINE,
+(wip v1.13) MLINE,
+(wip v1.13) MTEXT
 
 Unsupported objects:
 DXF r12: DIMENSION.
@@ -60,7 +60,7 @@
 Supported scene definition objescts produced with AVE_RENDER:
 scene: selection of lights assigned to the camera,
 lights: DIRECT, OVERHEAD, SH_SPOT,
-(wip v1.0.13 import of AVE_RENDER material definitions)
+(wip v1.13 import of AVE_RENDER material definitions)
 
 Hierarchy:
 Entire DXF BLOCK hierarchy is preserved after import into Blender
@@ -73,7 +73,7 @@
 width,
 color,
 layer,
-(wip v1.0.12: XDATA, grouped status)
+(wip v1.13: XDATA, grouped status)
 It is recommended to use DXF-object properties for assign Blender materials.
 
 Notes:
@@ -109,9 +109,22 @@
  -- bug: Registry recall from hd_cache ?? only win32 bug??
  -- support DXF-definitions of scene, lights and cameras
  -- support ortho mode for VIEWs and VPORTs as cameras 
- -- add support for SPLINEs
 
- v1.0.12: 2008.06.05 by migius
+
+ v1.12 - 2008.08.03 by migius
+ c2 warningfix: relocating of globals: layersmap, oblist 
+ c2 modif UI: buttons newScene+targetLayer moved to start panel
+ v1.12 - 2008.07.04 by migius
+ c1 added control Curve's OrderU parameter
+ c1 modif UI: preset buttons X-2D-3D moved to start panel
+ b6 added handling exception of not registered LAYERs (Hammer-HL-editor DXF 
output)
+ b5 rebuild UI: global preset 2D for Curve-Import
+ b5 added UI-options: PL-MESH N+N plmesh_flip and normals_out 
+ b5 added support for SPLINEs, added control OrderU parameter
+ b5 rewrote draw module for NURBS_curve and Bezier_curve
+ v1.12 - 2008.06.22 by migius
+ b4 change versioning system 1.0.12 -> 1.12
+ b4 print at start version-info to console
  b3 bugfix: ob.name conflict with existing meshes (different ob.name/mesh.name)
  v1.0.12: 2008.05.24 by migius
  b2 added support for LWPOLYLINEs
@@ -310,16 +323,16 @@
#print 'psyco not imported'
pass
 
-print '\n\n\n\n'
-print 'DXF-Importer  *** start ***'   #-
+#try: Curve.orderU
 
+print '\n\n\n'
+print 'DXF-Importer v%s *** start ***' %(__version__)   #-
+
 SCENE = None
 WORLDX = Mathutils.Vector((1,0,0))
 WORLDY = Mathutils.Vector((1,1,0))
 WORLDZ = Mathutils.Vector((0,0,1))
 
-oblist = [] #to be sure, it is an empty list
-
 G_SCALE = 1.0 #(0.0001-1000) global scaling factor for all dxf data
 G_ORIGIN_X = 0.0   #global translation-vector (x,y,z) in DXF units
 G_ORIGIN_Y = 0.0
@@ -335,12 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15938] branches/apricot/source/gameengine /Converter/BL_BlenderDataConversion.cpp: apricot branch: fix a bug with the export of the second uv layer

2008-08-03 Thread Brecht Van Lommel
Revision: 15938
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15938
Author:   blendix
Date: 2008-08-03 18:02:56 +0200 (Sun, 03 Aug 2008)

Log Message:
---
apricot branch: fix a bug with the export of the second uv layer
to the game engine for GLSL.

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

Modified: 
branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp
===
--- branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp   
2008-08-03 15:57:09 UTC (rev 15937)
+++ branches/apricot/source/gameengine/Converter/BL_BlenderDataConversion.cpp   
2008-08-03 16:02:56 UTC (rev 15938)
@@ -644,6 +644,7 @@
for (int vind = 0; vindnum_enabled; vind++)
{
BL_Mapping &map = material->mapping[vind];
+
if (map.uvCoName.IsEmpty())
isFirstSet = false;
else
@@ -673,7 +674,7 @@
isFirstSet = false;
uvName = layer.name;
}
-   else
+   else if(strcmp(layer.name, 
uvName) != 0)
{
uv2[0] = uvSet[0]; 
uv2[1] = uvSet[1];
uv2[2] = uvSet[2]; 
uv2[3] = uvSet[3];


___
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 [15939] trunk/blender/source/blender/imbuf /intern/anim.c: == FFMPEG ==

2008-08-03 Thread Peter Schlaile
Revision: 15939
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15939
Author:   schlaile
Date: 2008-08-03 18:11:57 +0200 (Sun, 03 Aug 2008)

Log Message:
---
== FFMPEG ==

This fixes:
[#16655] Blender crashes when Fraps videos are added to the sequencer

(sorry, color conversion is not supported by swscaler for some reason,
so currently, only the crash is fixed)

Modified Paths:
--
trunk/blender/source/blender/imbuf/intern/anim.c

Modified: trunk/blender/source/blender/imbuf/intern/anim.c
===
--- trunk/blender/source/blender/imbuf/intern/anim.c2008-08-03 16:02:56 UTC 
(rev 15938)
+++ trunk/blender/source/blender/imbuf/intern/anim.c2008-08-03 16:11:57 UTC 
(rev 15939)
@@ -612,6 +612,7 @@
av_free(anim->pFrameRGB);
av_free(anim->pFrameDeinterlaced);
av_free(anim->pFrame);
+   anim->pCodecCtx = NULL;
return -1;
}
 
@@ -639,7 +640,19 @@
PIX_FMT_BGR32,
SWS_FAST_BILINEAR | SWS_PRINT_INFO,
NULL, NULL, NULL);
-   
+   
+   if (!anim->img_convert_ctx) {
+   fprintf (stderr,
+"Can't transform color space??? Bailing out...\n");
+   avcodec_close(anim->pCodecCtx);
+   av_close_input_file(anim->pFormatCtx);
+   av_free(anim->pFrameRGB);
+   av_free(anim->pFrameDeinterlaced);
+   av_free(anim->pFrame);
+   anim->pCodecCtx = NULL;
+   return -1;
+   }
+   
return (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 [15940] trunk/blender/intern/boolop/make/ msvc_7_0/boolop.vcproj: Update MSVC project files for new Boolean Operation file (BOP_Merge2.cpp)

2008-08-03 Thread Benoit Bolsee
Revision: 15940
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15940
Author:   ben2610
Date: 2008-08-03 23:57:52 +0200 (Sun, 03 Aug 2008)

Log Message:
---
Update MSVC project files for new Boolean Operation file (BOP_Merge2.cpp)

Modified Paths:
--
trunk/blender/intern/boolop/make/msvc_7_0/boolop.vcproj

Modified: trunk/blender/intern/boolop/make/msvc_7_0/boolop.vcproj
===
--- trunk/blender/intern/boolop/make/msvc_7_0/boolop.vcproj 2008-08-03 
16:11:57 UTC (rev 15939)
+++ trunk/blender/intern/boolop/make/msvc_7_0/boolop.vcproj 2008-08-03 
21:57:52 UTC (rev 15940)
@@ -279,6 +279,9 @@

RelativePath="..\..\intern\BOP_Merge.cpp">


+   
+   




+   
+   


+   
+   

http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15941] trunk/blender/source/gameengine: BGE patch #17398 approved: implementation of BGE method getVectTo().

2008-08-03 Thread Benoit Bolsee
Revision: 15941
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15941
Author:   ben2610
Date: 2008-08-03 23:59:36 +0200 (Sun, 03 Aug 2008)

Log Message:
---
BGE patch #17398 approved: implementation of BGE method getVectTo().

Modified Paths:
--
trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
trunk/blender/source/gameengine/Ketsji/KX_GameObject.h
trunk/blender/source/gameengine/PyDoc/KX_GameObject.py

Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
===
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-08-03 
21:57:52 UTC (rev 15940)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-08-03 
21:59:36 UTC (rev 15941)
@@ -914,6 +914,7 @@
KX_PYMETHODTABLE(KX_GameObject, rayCastTo),
KX_PYMETHODTABLE(KX_GameObject, rayCast),
KX_PYMETHODTABLE(KX_GameObject, getDistanceTo),
+   KX_PYMETHODTABLE(KX_GameObject, getVectTo),
{NULL,NULL} //Sentinel
 };
 
@@ -1555,6 +1556,57 @@
return NULL;
 }
 
+KX_PYMETHODDEF_DOC(KX_GameObject, getVectTo,
+"getVectTo(other): get vector and the distance to another 
point/KX_GameObject\n"
+"Returns a 3-tuple with (distance,worldVector,localVector)\n")
+{
+   MT_Point3 toPoint, fromPoint;
+   MT_Vector3 toDir, locToDir;
+   MT_Scalar distance;
+
+   PyObject *returnValue = PyTuple_New(3);
+   PyObject *pyother;
+
+   if (!returnValue)
+   {
+   PyErr_SetString(PyExc_MemoryError, "PyTuple_New() failed");
+   return NULL;
+   }
+   if (!PyVecArgTo(args, toPoint))
+   {
+   PyErr_Clear();
+   if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, 
&pyother))
+   {
+   KX_GameObject *other = 
static_cast(pyother);
+   toPoint = other->NodeGetWorldPosition();
+   }else
+   {
+   PyErr_SetString(PyExc_TypeError, "Invalid arguments");
+   return NULL;
+   }
+   }
+
+   fromPoint = NodeGetWorldPosition();
+   toDir = toPoint-fromPoint;
+   distance = toDir.length();
+
+   if (MT_fuzzyZero(distance))
+   {
+   //cout << "getVectTo() Error: Null vector!\n";
+   locToDir = toDir = MT_Vector3(0.0,0.0,0.0);
+   distance = 0.0;
+   } else {
+   toDir.normalize();
+   locToDir = toDir * NodeGetWorldOrientation();
+   }
+
+   PyTuple_SET_ITEM(returnValue, 0, PyFloat_FromDouble(distance));
+   PyTuple_SET_ITEM(returnValue, 1, PyObjectFrom(toDir));
+   PyTuple_SET_ITEM(returnValue, 2, PyObjectFrom(locToDir));
+
+   return returnValue;
+}
+
 bool KX_GameObject::RayHit(KX_ClientObjectInfo* client, MT_Point3& hit_point, 
MT_Vector3& hit_normal, void * const data)
 {
 

Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.h
===
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.h  2008-08-03 
21:57:52 UTC (rev 15940)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.h  2008-08-03 
21:59:36 UTC (rev 15941)
@@ -756,6 +756,7 @@
KX_PYMETHOD_DOC(KX_GameObject,rayCastTo);
KX_PYMETHOD_DOC(KX_GameObject,rayCast);
KX_PYMETHOD_DOC(KX_GameObject,getDistanceTo);
+   KX_PYMETHOD_DOC(KX_GameObject,getVectTo);

 private :
 

Modified: trunk/blender/source/gameengine/PyDoc/KX_GameObject.py
===
--- trunk/blender/source/gameengine/PyDoc/KX_GameObject.py  2008-08-03 
21:57:52 UTC (rev 15940)
+++ trunk/blender/source/gameengine/PyDoc/KX_GameObject.py  2008-08-03 
21:59:36 UTC (rev 15941)
@@ -253,6 +253,16 @@
@type other: L{KX_GameObject} or list [x, y, z]
@rtype: float
"""
+   def getVectTo(other):
+   """
+   Returns the vector and the distance to another object or point.
+   The vector is normalized unless the distance is 0, in which a 
NULL vector is returned.
+   
+   @param other: a point or another L{KX_GameObject} to get the 
vector and distance to.
+   @type other: L{KX_GameObject} or list [x, y, z]
+   @rtype: 3-tuple (float, 3-tuple (x,y,z), 3-tuple (x,y,z))
+   @return: (distance, globalVector(3), localVector(3))
+   """
def rayCastTo(other,dist,prop):
"""
Look towards another point/object and find first object hit 
within dist that matches prop.


___
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 [15942] trunk/blender/source: * KX_GameObject.cpp - error with getMesh(), was returning None rather then an error with invalid args.

2008-08-03 Thread Campbell Barton
Revision: 15942
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15942
Author:   campbellbarton
Date: 2008-08-04 03:57:22 +0200 (Mon, 04 Aug 2008)

Log Message:
---
* KX_GameObject.cpp - error with getMesh(), was returning None rather then an 
error with invalid args. also memory leak with getVectTo() if invalid args were 
given.
* Material.c - functions for get/setRayTransGlossSamples were not being used.
* BPY_interface.c - removed function GetName(), since everything else just uses 
id->name+2.
* header_info.c - added ifdef win32 around copy_game_dll since its not needed 
for other os's yet

Modified Paths:
--
trunk/blender/source/blender/python/BPY_interface.c
trunk/blender/source/blender/python/api2_2x/Material.c
trunk/blender/source/blender/src/header_info.c
trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp

Modified: trunk/blender/source/blender/python/BPY_interface.c
===
--- trunk/blender/source/blender/python/BPY_interface.c 2008-08-03 21:59:36 UTC 
(rev 15941)
+++ trunk/blender/source/blender/python/BPY_interface.c 2008-08-04 01:57:22 UTC 
(rev 15942)
@@ -160,7 +160,6 @@
 * Function prototypes 
 ***/
 PyObject *RunPython( Text * text, PyObject * globaldict );
-char *GetName( Text * text );
 PyObject *CreateGlobalDictionary( void );
 void ReleaseGlobalDictionary( PyObject * dict );
 void DoAllScriptsFromList( ListBase * list, short event );
@@ -651,7 +650,7 @@
}
 
/* Create a new script structure and initialize it: */
-   script = alloc_libblock( &G.main->script, ID_SCRIPT, GetName( text ) );
+   script = alloc_libblock( &G.main->script, ID_SCRIPT, text->id.name+2 );
 
if( !script ) {
printf( "couldn't allocate memory for Script struct!" );
@@ -662,8 +661,7 @@
 * an error after it will call BPY_Err_Handle below, but the text struct
 * will have been deallocated already, so we need to copy its name here.
 */
-   BLI_strncpy( textname, GetName( text ),
-strlen( GetName( text ) ) + 1 );
+   BLI_strncpy( textname, text->id.name+2, 21 );
 
script->id.us = 1;
script->flags = SCRIPT_RUNNING;
@@ -2724,8 +2722,7 @@
buf = txt_to_buf( text );
 
text->compiled =
-   Py_CompileString( buf, GetName( text ),
- Py_file_input );
+   Py_CompileString( buf, text->id.name+2, Py_file_input );
 
MEM_freeN( buf );
 
@@ -2740,15 +2737,6 @@
 }
 
 /*
-* Description: This function returns the value of the name field of the
-*  given Text struct.
-*/
-char *GetName( Text * text )
-{
-   return ( text->id.name + 2 );
-}
-
-/*
 * Description: This function creates a new Python dictionary object.
 */
 PyObject *CreateGlobalDictionary( void )
@@ -2809,7 +2797,7 @@
text = ( Text * ) & ( G.main->text.first );
 
while( text ) {
-   if( !strcmp( txtname, GetName( text ) ) )
+   if( !strcmp( txtname, text->id.name+2 ) )
break;
text = text->id.next;
}
@@ -2822,8 +2810,7 @@
if( !text->compiled ) {
buf = txt_to_buf( text );
text->compiled =
-   Py_CompileString( buf, GetName( text ),
- Py_file_input );
+   Py_CompileString( buf, text->id.name+2, Py_file_input );
MEM_freeN( buf );
 
if( PyErr_Occurred(  ) ) {
@@ -2905,7 +2892,7 @@
/* look up the text object */
text = ( Text * ) & ( G.main->text.first );
while( text ) {
-   if( !strcmp( txtname, GetName( text ) ) )
+   if( !strcmp( txtname, text->id.name+2 ) )
break;
text = text->id.next;
}
@@ -2922,8 +2909,7 @@
 
/* compile the buffer */
buf = txt_to_buf( text );
-   text->compiled = Py_CompileString( buf, GetName( text ),
-   Py_file_input );
+   text->compiled = Py_CompileString( buf, text->id.name+2, Py_file_input 
);
MEM_freeN( buf );
 
/* if compile failed return this error */

Modified: trunk/blender/source/blender/python/api2_2x/Material.c
===
--- trunk/blender/source/blender/python/api2_2x/Material.c  2008-08-03 
21:59:36 UTC (rev 15941)