[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17591] branches/blender2.5/blender/source /blender: * add beginning of Material RNA and Nodetree+Node RNA

2008-11-26 Thread Nathan Letwory
Revision: 17591
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17591
Author:   jesterking
Date: 2008-11-27 01:23:22 +0100 (Thu, 27 Nov 2008)

Log Message:
---
* add beginning of Material RNA and Nodetree+Node RNA

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesdna/DNA_material_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c

Added Paths:
---
branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_nodetree.c

Modified: 
branches/blender2.5/blender/source/blender/makesdna/DNA_material_types.h
===
--- branches/blender2.5/blender/source/blender/makesdna/DNA_material_types.h
2008-11-26 23:57:44 UTC (rev 17590)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_material_types.h
2008-11-27 00:23:22 UTC (rev 17591)
@@ -41,7 +41,6 @@
 
 struct MTex;
 struct Ipo;
-struct Material;
 struct ColorBand;
 struct Group;
 struct bNodeTree;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c   
2008-11-26 23:57:44 UTC (rev 17590)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c   
2008-11-27 00:23:22 UTC (rev 17591)
@@ -862,6 +862,8 @@
{"rna_ID.c", RNA_def_ID},
{"rna_main.c", RNA_def_main},
{"rna_mesh.c", RNA_def_mesh},
+   {"rna_nodetree.c", RNA_def_nodetree},
+   {"rna_material.c", RNA_def_material},
{"rna_object.c", RNA_def_object},
{"rna_rna.c", RNA_def_rna},
{"rna_scene.c", RNA_def_scene},

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h   
2008-11-26 23:57:44 UTC (rev 17590)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h   
2008-11-27 00:23:22 UTC (rev 17591)
@@ -85,6 +85,8 @@
 void RNA_def_main(struct BlenderRNA *brna);
 void RNA_def_mesh(struct BlenderRNA *brna);
 void RNA_def_object(struct BlenderRNA *brna);
+void RNA_def_nodetree(struct BlenderRNA *brna);
+void RNA_def_material(struct BlenderRNA *brna);
 void RNA_def_rna(struct BlenderRNA *brna);
 void RNA_def_scene(struct BlenderRNA *brna);
 void RNA_def_wm(struct BlenderRNA *brna);

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c   
2008-11-26 23:57:44 UTC (rev 17590)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c   
2008-11-27 00:23:22 UTC (rev 17591)
@@ -79,12 +79,16 @@
rna_iterator_listbase_begin(iter, &bmain->mball, NULL);
 }
 
+#endif
+
 static void rna_Main_mat_begin(CollectionPropertyIterator *iter, PointerRNA 
*ptr)
 {
Main *bmain= (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->mat, NULL);
 }
 
+#if 0
+
 static void rna_Main_tex_begin(CollectionPropertyIterator *iter, PointerRNA 
*ptr)
 {
Main *bmain= (Main*)ptr->data;
@@ -177,12 +181,16 @@
rna_iterator_listbase_begin(iter, &bmain->action, NULL);
 }
 
+#endif
+
 static void rna_Main_nodetree_begin(CollectionPropertyIterator *iter, 
PointerRNA *ptr)
 {
Main *bmain= (Main*)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->nodetree, NULL);
 }
 
+#if 0
+
 static void rna_Main_brush_begin(CollectionPropertyIterator *iter, PointerRNA 
*ptr)
 {
Main *bmain= (Main*)ptr->data;
@@ -211,14 +219,15 @@
const char *lists[][5]= {
{"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene 
datablocks."},
{"objects", "Object", "rna_Main_object_begin", "Objects", 
"Object datablocks."},
+   {"materials", "Material", "rna_Main_mat_begin", "Materials", 
"Material datablocks."},
+   {"nodetrees", "bNodeTree", "rna_Main_nodetree_begin", "Node 
Trees", "Nodetree datablocks."},
{"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh 
datablocks."}, 
{"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp 
datablocks."},
{"windowmanagers", "WindowManager", "rna_Main_wm_begin", 
"Window Managers", "Window manager datablocks."},
{NULL, NULL, NULL, NUL

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17590] branches/projection-paint/source/ blender/src/imagepaint.c: minor changes, (some comments and less warnings)

2008-11-26 Thread Campbell Barton
Revision: 17590
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17590
Author:   campbellbarton
Date: 2008-11-27 00:57:44 +0100 (Thu, 27 Nov 2008)

Log Message:
---
minor changes, (some comments and less warnings)

Modified Paths:
--
branches/projection-paint/source/blender/src/imagepaint.c

Modified: branches/projection-paint/source/blender/src/imagepaint.c
===
--- branches/projection-paint/source/blender/src/imagepaint.c   2008-11-26 
23:50:42 UTC (rev 17589)
+++ branches/projection-paint/source/blender/src/imagepaint.c   2008-11-26 
23:57:44 UTC (rev 17590)
@@ -1000,7 +1000,7 @@
LinkNode *node;
int face_index;
int i, i1, i2;
-   int i1_fidx = -1, i2_fidx = -1; /* indexi in face */
+   int i1_fidx = -1, i2_fidx = -1; /* index in face */
MFace *mf;
MTFace *tf;
const MFace *orig_mf = ps->dm_mface + orig_face;  
@@ -1014,19 +1014,23 @@
face_index = (int)node->link;
if (face_index != orig_face) {
mf = ps->dm_mface + face_index;
+   /* could check if the 2 faces images match here,
+* but then there wouldn't be a way to return the 
opposite face's info */

+   
/* We need to know the order of the verts in the 
adjacent face 
 * set the i1_fidx and i2_fidx to (0,1,2,3) */
-   i = mf->v4 ? 3:2;
-   do {
-   if (i1 == (*(&mf->v1 + i))) {
-   i1_fidx = i;
-   } else if (i2 == (*(&mf->v1 + i))) {
-   i2_fidx = i;
-   }
-   
-   } while (i--);
+   if  (mf->v1==i1)i1_fidx 
= 0;
+   else if (mf->v2==i1)i1_fidx = 1;
+   else if (mf->v3==i1)i1_fidx = 2;
+   else if (mf->v4 && mf->v4==i1)  i1_fidx = 3;

+   if  (mf->v1==i2)i2_fidx 
= 0;
+   else if (mf->v2==i2)i2_fidx = 1;
+   else if (mf->v3==i2)i2_fidx = 2;
+   else if (mf->v4 && mf->v4==i2)  i2_fidx = 3;
+   
+   /* Only need to check if 'i2_fidx' is valid because we 
know i1_fidx is the same vert on both faces */
if (i2_fidx != -1) {
/* This IS an adjacent face!, now lets check if 
the UVs are ok */
tf = ps->dm_mtface + face_index;
@@ -1193,15 +1197,10 @@
 static void project_face_seams_init(const ProjPaintState *ps, const int 
face_index, const int is_quad)
 {
int other_face, other_fidx; /* vars for the other face, we also set its 
flag */
-   int fidx1, fidx2;
+   int fidx1 = is_quad ? 3 : 2;
+   int fidx2 = 0; /* next fidx in the face (0,1,2,3) -> (1,2,3,0) or 
(0,1,2) -> (1,2,0) for a tri */

-   fidx1 = is_quad ? 3 : 2;
do {
-   if (is_quad)
-   fidx2 = (fidx1==3) ? 0 : fidx1+1; /* next fidx in the 
face (0,1,2,3) -> (1,2,3,0) */
-   else
-   fidx2 = (fidx1==2) ? 0 : fidx1+1; /* next fidx in the 
face (0,1,2) -> (1,2,0) */
-   
if ((ps->faceSeamFlags[face_index] & (1dm_mtface_clone + 
face_index;
-   float *uvCo1, *uvCo2, *uvCo3;

-   uvCo1 =  tf_other->uv[0];
-   if (side==1) {
-   uvCo2 =  tf_other->uv[2];
-   uvCo3 =  tf_other->uv[3];
-   } else {
-   uvCo2 =  tf_other->uv[1];
-   uvCo3 =  tf_other->uv[2];
-   }
-   
if (tf_other->tpage && ( ibuf_other = 
BKE_image_get_ibuf((Image *)tf_other->tpage, NULL) )) {
/* BKE_image_get_ibuf - TODO - this may be slow 
*/
-   
+   
+   float *uvCo1, *uvCo2, *uvCo3;
float uv_other[2], x, y;

+   uvCo1 =  (float *)tf_other->uv[0];
+

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17589] branches/animsys2/source/blender: AnimSys2: UserPref for Default Interpolation of newly created IPO-Curves

2008-11-26 Thread Joshua Leung
Revision: 17589
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17589
Author:   aligorith
Date: 2008-11-27 00:50:42 +0100 (Thu, 27 Nov 2008)

Log Message:
---
AnimSys2: UserPref for Default Interpolation of newly created IPO-Curves

This setting can be found under 'Edit Methods'. By default, 'Bezier' 
interpolation is still used, but this can be changed to another option.

Modified Paths:
--
branches/animsys2/source/blender/makesdna/DNA_userdef_types.h
branches/animsys2/source/blender/src/editipo.c
branches/animsys2/source/blender/src/keyframing.c
branches/animsys2/source/blender/src/space.c
branches/animsys2/source/blender/src/usiblender.c

Modified: branches/animsys2/source/blender/makesdna/DNA_userdef_types.h
===
--- branches/animsys2/source/blender/makesdna/DNA_userdef_types.h   
2008-11-26 23:13:59 UTC (rev 17588)
+++ branches/animsys2/source/blender/makesdna/DNA_userdef_types.h   
2008-11-26 23:50:42 UTC (rev 17589)
@@ -207,7 +207,7 @@
short smooth_viewtx;/* miliseconds to spend spinning the view */
short glreslimit;
short ndof_pan, ndof_rotate;
-   short curssize, pad;
+   short curssize, ipo_new;
 // char pad[8];
char versemaster[160];
char verseuser[160];

Modified: branches/animsys2/source/blender/src/editipo.c
===
--- branches/animsys2/source/blender/src/editipo.c  2008-11-26 23:13:59 UTC 
(rev 17588)
+++ branches/animsys2/source/blender/src/editipo.c  2008-11-26 23:50:42 UTC 
(rev 17589)
@@ -2043,6 +2043,7 @@
if ((icu==NULL) && (add)) {
icu= MEM_callocN(sizeof(IpoCurve), "ipocurve");

+   /* set default settings */
icu->flag |= (IPO_VISIBLE|IPO_AUTO_HORIZ);
if (ipo->curve.first==NULL) 
icu->flag |= IPO_ACTIVE;/* first one 
added active */
@@ -2052,8 +2053,13 @@

set_icu_vars(icu);

+   /* default curve interpolation - from userpref */
+   icu->ipo= U.ipo_new;
+   
+   /* add curve to IPO-block */
BLI_addtail(&ipo->curve, icu);

+   /* special type-dependent stuff */
switch (GS(from->name)) {
case ID_SEQ: {
Sequence *seq= (Sequence *)from;

Modified: branches/animsys2/source/blender/src/keyframing.c
===
--- branches/animsys2/source/blender/src/keyframing.c   2008-11-26 23:13:59 UTC 
(rev 17588)
+++ branches/animsys2/source/blender/src/keyframing.c   2008-11-26 23:50:42 UTC 
(rev 17589)
@@ -185,7 +185,7 @@
 *  - keyframe to be added would replace one of the existing ones 
on bounds
 */
if ((arraylen <= 0) || (array == NULL)) {
-   printf("Warning: binarysearch_bezt_index encountered invalid 
array \n");
+   printf("Warning: binarysearch_bezt_index() encountered invalid 
array \n");
return 0;
}
else {
@@ -235,7 +235,7 @@

/* print error if loop-limit exceeded */
if (loopbreaker == (maxloop-1)) {
-   printf("Error: binarysearch_bezt_index was taking too long \n");
+   printf("Error: binarysearch_bezt_index() was taking too long 
\n");

// include debug info 
printf("\tround = %d: start = %d, end = %d, arraylen = %d \n", 
loopbreaker, start, end, arraylen);

Modified: branches/animsys2/source/blender/src/space.c
===
--- branches/animsys2/source/blender/src/space.c2008-11-26 23:13:59 UTC 
(rev 17588)
+++ branches/animsys2/source/blender/src/space.c2008-11-26 23:50:42 UTC 
(rev 17589)
@@ -3614,8 +3614,8 @@
uiBut *uibut;
static short cur_light=0;
float fac, col[3];
-   short xpos, ypos, ypostab,  buth, rspace, dx, y1, y2, y3, y4, y5, y6, 
y7;
-   short y2label, y3label, y4label, y5label, y6label, y7label;
+   short xpos, ypos, ypostab,  buth, rspace, dx, y1, y2, y3, y4, y5, y6, 
y7, y8;
+   short y2label, y3label, y4label, y5label, y6label, y7label, y8label;
short spref, mpref, lpref, smfileselbut;
short edgsp, midsp;
char naam[32];
@@ -3667,6 +3667,7 @@
y5 = ypos+4*(buth+rspace);
y6 = ypos+5*(buth+rspace);
y7 = ypos+6*(buth+rspace);
+   y8 = ypos+7*(buth+rspace);
 
 
y2label = y2-2; /* adjustments to offset t

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17588] branches/blender2.5/blender/source /blender/makesrna/intern/rna_scene.c: Added access for start/ end frames in RNA.

2008-11-26 Thread Joshua Leung
Revision: 17588
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17588
Author:   aligorith
Date: 2008-11-27 00:13:59 +0100 (Thu, 27 Nov 2008)

Log Message:
---
Added access for start/end frames in RNA. 

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c  
2008-11-26 22:52:01 UTC (rev 17587)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c  
2008-11-26 23:13:59 UTC (rev 17588)
@@ -55,6 +55,20 @@
}
 }
 
+static void rna_Scene_start_frame_set(PointerRNA *ptr, int value)
+{
+   Scene *data= (Scene*)ptr->data;
+   CLAMP(value, 1, data->r.efra);
+   data->r.sfra= value;
+}
+
+static void rna_Scene_end_frame_set(PointerRNA *ptr, int value)
+{
+   Scene *data= (Scene*)ptr->data;
+   CLAMP(value, data->r.sfra, 30);
+   data->r.efra= value;
+}
+
 #else
 
 void RNA_def_scene(BlenderRNA *brna)
@@ -105,6 +119,18 @@
RNA_def_property_int_sdna(prop, NULL, "r.cfra");
RNA_def_property_range(prop, MINFRAME, MAXFRAME);
RNA_def_property_ui_text(prop, "Current Frame", "Current frame.");
+   
+   prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
+   RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
+   RNA_def_property_int_sdna(prop, NULL, "r.sfra");
+   RNA_def_property_int_funcs(prop, NULL, "rna_Scene_start_frame_set", 
NULL);
+   RNA_def_property_ui_text(prop, "Start Frame", "Start frame.");
+   
+   prop= RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
+   RNA_def_property_flag(prop, PROP_NOT_DRIVEABLE);
+   RNA_def_property_int_sdna(prop, NULL, "r.efra");
+   RNA_def_property_int_funcs(prop, NULL, "rna_Scene_end_frame_set", NULL);
+   RNA_def_property_ui_text(prop, "End Frame", "End frame.");
 
prop= RNA_def_property(srna, "stamp_note", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");


___
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 [17587] branches/blender2.5/blender/source /blender/makesrna:

2008-11-26 Thread Brecht Van Lommel
Revision: 17587
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17587
Author:   blendix
Date: 2008-11-26 23:52:01 +0100 (Wed, 26 Nov 2008)

Log Message:
---

RNA

* Added support for auto generating enum properties that are defined as
  bitflags mixed with other flags (use for shadow type in la->mode now).

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_lamp.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
2008-11-26 22:24:26 UTC (rev 17586)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
2008-11-26 22:52:01 UTC (rev 17587)
@@ -54,7 +54,7 @@
 void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, 
const char *propname);
 void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, 
const char *propname);
 void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, 
const char *propname);
-void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, 
const char *propname);
+void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, 
const char *propname, int bitflags);
 void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, 
const char *propname);
 void RNA_def_property_collection_sdna(PropertyRNA *prop, const char 
*structname, const char *propname, const char *lengthpropname);
 

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c   
2008-11-26 22:24:26 UTC (rev 17586)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c   
2008-11-26 22:52:01 UTC (rev 17587)
@@ -44,6 +44,8 @@
 #endif
 #endif
 
+/* Sorting */
+
 int cmp_struct(const void *a, const void *b)
 {
const StructRNA *structa= *(const StructRNA**)a;
@@ -146,6 +148,17 @@
}
 }
 
+static int rna_enum_bitmask(PropertyRNA *prop)
+{
+   EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop;
+   int a, mask= 0;
+
+   for(a=0; atotitem; a++)
+   mask |= eprop->item[a].value;
+   
+   return mask;
+}
+
 static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA 
*prop, PropertyDefRNA *dp)
 {
char *func;
@@ -202,6 +215,8 @@
fprintf(f, "%s *data= (%s*)ptr->data;\n", 
dp->dnastructname, dp->dnastructname);
if(prop->type == PROP_BOOLEAN && dp->booleanbit)
fprintf(f, "return (((data->%s) & 
%d) != 0);\n", dp->dnaname, dp->booleanbit);
+   else if(prop->type == PROP_ENUM && 
dp->enumbitflags)
+   fprintf(f, "return ((data->%s) & 
%d);\n", dp->dnaname, rna_enum_bitmask(prop));
else
fprintf(f, "return 
(%s)(data->%s);\n", rna_type_type(prop), dp->dnaname);
fprintf(f, "}\n\n");
@@ -306,6 +321,10 @@
fprintf(f, "if(value) data->%s |= 
%d;\n", dp->dnaname, dp->booleanbit);
fprintf(f, "else data->%s &= 
~%d;\n", dp->dnaname, dp->booleanbit);
}
+   else if(prop->type == PROP_ENUM && 
dp->enumbitflags) {
+   fprintf(f, "data->%s &= ~%d;\n", 
dp->dnaname, rna_enum_bitmask(prop));
+   fprintf(f, "data->%s |= value;\n", 
dp->dnaname, rna_enum_bitmask(prop));
+   }
else {
rna_clamp_value(f, prop);
fprintf(f, "data->%s= value;\n", 
dp->dnaname);

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c 
2008-11-26 22:24:26 UTC (rev 17586)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c 
2008-11-26 22:52:01 UTC (rev 17587)
@@ -519,7 +519,7 @@
}
case

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17586] branches/blender2.5/blender/source /blender/makesrna/intern:

2008-11-26 Thread Brecht Van Lommel
Revision: 17586
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17586
Author:   blendix
Date: 2008-11-26 23:24:26 +0100 (Wed, 26 Nov 2008)

Log Message:
---

RNA

* Made auto collection wrapping work for ** arrays.
  (Mesh.mats, still points to ID since there is no Material yet).
* Added sorting of RNA structs/properties before writing.

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/intern/SConscript
branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/SConscript
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/SConscript   
2008-11-26 17:47:42 UTC (rev 17585)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/SConscript   
2008-11-26 22:24:26 UTC (rev 17586)
@@ -3,7 +3,7 @@
 import os
 
 Import ('env')
-cflags = '-Wall'
+cflags = ''
 defines = []
 root_build_dir=env['BF_BUILDDIR']
 

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c   
2008-11-26 17:47:42 UTC (rev 17585)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c   
2008-11-26 22:24:26 UTC (rev 17586)
@@ -44,6 +44,56 @@
 #endif
 #endif
 
+int cmp_struct(const void *a, const void *b)
+{
+   const StructRNA *structa= *(const StructRNA**)a;
+   const StructRNA *structb= *(const StructRNA**)b;
+
+   return strcmp(structa->identifier, structb->identifier);
+}
+
+int cmp_property(const void *a, const void *b)
+{
+   const PropertyRNA *propa= *(const PropertyRNA**)a;
+   const PropertyRNA *propb= *(const PropertyRNA**)b;
+
+   if(strcmp(propa->identifier, "rna_type") == 0) return -1;
+   else if(strcmp(propb->identifier, "rna_type") == 0) return 1;
+
+   if(strcmp(propa->identifier, "name") == 0) return -1;
+   else if(strcmp(propb->identifier, "name") == 0) return 1;
+
+   return strcmp(propa->name, propb->name);
+}
+
+void rna_sortlist(ListBase *listbase, int(*cmp)(const void*, const void*))
+{
+   Link *link;
+   void **array;
+   int a, size;
+   
+   if(listbase->first == listbase->last)
+   return;
+
+   for(size=0, link=listbase->first; link; link=link->next)
+   size++;
+
+   array= MEM_mallocN(sizeof(void*)*size, "rna_sortlist");
+   for(a=0, link=listbase->first; link; link=link->next, a++)
+   array[a]= link;
+
+   qsort(array, size, sizeof(void*), cmp);
+
+   listbase->first= listbase->last= NULL;
+   for(a=0; anext= link->prev= NULL;
+   rna_addtail(listbase, link);
+   }
+
+   MEM_freeN(array);
+}
+
 /* Preprocessing */
 
 static void rna_print_c_string(FILE *f, const char *str)
@@ -499,6 +549,16 @@
rna_def_property_funcs(f, dp);
 }
 
+static void rna_sort(BlenderRNA *brna)
+{
+   StructRNA *srna;
+
+   rna_sortlist(&brna->structs, cmp_struct);
+
+   for(srna=brna->structs.first; srna; srna=srna->next)
+   rna_sortlist(&srna->properties, cmp_property);
+}
+
 static const char *rna_property_structname(PropertyType type)
 {
switch(type) {
@@ -830,6 +890,7 @@
fprintf(f, "\n");
 
rna_auto_functions(f);
+   rna_sort(brna);
 
for(srna=brna->structs.first; srna; srna=srna->next)
rna_generate_struct(brna, srna, f);

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2008-11-26 17:47:42 UTC (rev 17585)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2008-11-26 22:24:26 UTC (rev 17586)
@@ -1106,6 +1106,14 @@
return internal->ptr;
 }
 
+void *rna_iterator_array_dereference_get(CollectionPropertyIterator *iter)
+{
+   ArrayIterator *internal= iter->internal;
+
+   /* for ** arrays */
+   return *(void**)(internal->ptr);
+}
+
 void rna_iterator_array_end(CollectionPropertyIterator *iter)
 {
MEM_freeN(iter->internal);

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c 
2008-11-26 17:47:42 UTC (rev 17585)
+++ branch

[Bf-blender-cvs] about 2.5 code

2008-11-26 Thread Joilnen Batista Leite
I was reading 2.5 source and folowing the functions, I see 
inside WM_init, initbuttons that calls UI_init.
Maybe would be more sure if initbuttons was called ui_init.


Joilnen


  
___
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 [17585] trunk/blender/source/gameengine/ VideoTexture: VideoTexture: new ImageRender class for Render To Texture

2008-11-26 Thread Benoit Bolsee
Revision: 17585
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17585
Author:   ben2610
Date: 2008-11-26 18:47:42 +0100 (Wed, 26 Nov 2008)

Log Message:
---
VideoTexture: new ImageRender class for Render To Texture

The new class VideoTexture.ImageRender() is available to perform
render to texture in the GE.

Constructor:

  VideoTexture.ImageRender(scene,cam)
cam  : camera object that will be used for the render.
   It must be an inactive camera.
scene: reference to the scene that will be rendered.
   The camera must be part of that scene.
  Returns an object that can be used as a source of a VideoTexture.Texture 
object

Methods: none

Attributes:

  background: 
 4-tuple representing the background color of the rendering
 as RGBA color components, each component being an integer 
 between 0 and 255. 
 Default value = [0,0,255,255] (=saturated blue)
 Note: athough the alpha component can be specified, it is not
   supported at the moment, the alpha channel of the rendered
   texture will always be 255. You can however introduce an
   alpha channel by appending a FilterBlueScreen() filter, it
   will set the alpha to 0 (transparent) on all pixels that were
   not rendered.

  capsize:
 2-tuple representing the size of the render area as [x,y] number of pixels.
 Default value = largest rectangle with power of 2 dimensions that fits in 
the canvas 
 You may want to reduce the render area to increase performance. For 
example,
 a render area of [256,128] is probably sufficient to implement a car inner 
mirror.
 For best performance, use power of 2 dimensions and don't set any filter: 
this
 allows direct transfer between the GPU frame buffer and texture memory
 without going through the host.

  alpha: 
 Boolean indicating if the render alpha channel should be copied to the 
texture.
 Default value: False
 Experimental, do not use.

  whole:
 Boolean indicating if the entire canvas should be used for the rendering. 
 Default value: False
 Note: There is no reason to set this attribute to True: the rendering will
   in any case be scaled down to the largest rectangle with power of 2
   dimensions before transfering to the texture.

Attributes inherited from the ImageBase class:

  image : image binary data, read-only
  size  : [x,y] size of the texture, read-only
  scale : set to True for fast scale down in case the render area dimensions 
are not power of 2
  flip  : set to True for vertical flip. 
  filter: set a post-processing filter on the render.

Notes:

* Aspect Ratio
For consistent results in Blender and Blenderplayer, the same aspect ratio used
by Blender to draw the camera viewport (Scene(F10)->Format tab->Size X/Size Y) 
is also used during the rendering. You can control the portion of the scene that
will be rendered by "looking through the camera": the zone inside the outer 
dotted 
rectangle will be rendered to the texture.
In order to reproduce the scene without X/Y distortion, you must apply the 
texture
on an object or portion of object that has the same aspect ratio.

* Order of rendering
The rendereing is performed when you call the refresh() method of the parent 
Texture object. This happens outside the normal frame rendering and will have 
no 
effect on it.
However, if you want to use ImageViewport and ImageRender at the same time, be 
sure to refresh the viewport texture before the render texture because the 
latter
will destroy the frame buffer that is used by the former to update the texture.

* Scene status
The meshes are not updated during the render to texture: the rendered texture
is one frame late to the rendered frame with regards to mesh deformation.

* Example:

  cont = GameLogic.getCurrentController()
  # object that receives the texture
  obj = contr.getOwner()
  scene = GameLogic.getCurrentScene()
  # camera used for the render
  tvcam = scene.getObjectList()['OBtvcam']
  # assume obj has some faces UV assigned to tv.png
  matID = VideoTexture.materialID(obj, 'IMtv.png')
  GameLogic.tv = VideoTexture.Texture(obj, matID)
  GameLogic.tv.source = VideoTexture.ImageRender(scene,tvcam)
  GameLogic.tv.source.capsize = [256,256]
  # to render the texture, just call GameLogic.tv.refresh(True) on each frame.

You can download a demo game (with a video file) here:

  http://home.scarlet.be/~tsi46445/blender/VideoTextureDemo.zip

For those who have already downloaded the demo, you can just update the blend 
file:

  http://home.scarlet.be/~tsi46445/blender/VideoTextureDemo.blend

Modified Paths:
--
trunk/blender/source/gameengine/VideoTexture/ImageRender.cpp
trunk/blender/source/gameengine/VideoTexture/ImageRender.h
trunk/blender/source/gameengine/VideoTexture/ImageViewport.cpp
trunk/blender/source/gameengine/VideoTexture/ImageViewport.h
tru

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17584] trunk/blender/source/gameengine: BGE update: helper functions for VideoTexture render to texture feature.

2008-11-26 Thread Benoit Bolsee
Revision: 17584
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17584
Author:   ben2610
Date: 2008-11-26 18:38:54 +0100 (Wed, 26 Nov 2008)

Log Message:
---
BGE update: helper functions for VideoTexture render to texture feature.

Modified Paths:
--
trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.h
trunk/blender/source/gameengine/Rasterizer/RAS_FramingManager.h
trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h

trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h

Modified: trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.h
===
--- trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.h2008-11-26 
17:35:53 UTC (rev 17583)
+++ trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.h2008-11-26 
17:38:54 UTC (rev 17584)
@@ -184,7 +184,6 @@
voidRenderDebugProperties();
voidRenderShadowBuffers(KX_Scene 
*scene);
voidSetBackGround(KX_WorldInfo* 
worldinfo);
-   voidSetWorldSettings(KX_WorldInfo* 
worldinfo);
voidDoSound(KX_Scene* scene);
 
 public:
@@ -193,6 +192,7 @@
virtual ~KX_KetsjiEngine();
 
// set the devices and stuff. the client must take care of creating 
these
+   voidSetWorldSettings(KX_WorldInfo* worldinfo);
voidSetKeyboardDevice(SCA_IInputDevice* 
keyboarddevice);
voidSetMouseDevice(SCA_IInputDevice* mousedevice);
voidSetNetworkDevice(NG_NetworkDeviceInterface* 
networkdevice);
@@ -205,6 +205,8 @@
voidSetGame2IpoMode(bool game2ipo,int startFrame);
 
RAS_IRasterizer*GetRasterizer(){return m_rasterizer;};
+   RAS_ICanvas*GetCanvas(){return m_canvas;};
+   RAS_IRenderTools*   GetRenderTools(){return m_rendertools;};
 
///returns true if an update happened to indicate -> Render
boolNextFrame();

Modified: trunk/blender/source/gameengine/Rasterizer/RAS_FramingManager.h
===
--- trunk/blender/source/gameengine/Rasterizer/RAS_FramingManager.h 
2008-11-26 17:35:53 UTC (rev 17583)
+++ trunk/blender/source/gameengine/Rasterizer/RAS_FramingManager.h 
2008-11-26 17:38:54 UTC (rev 17584)
@@ -212,9 +212,6 @@
RAS_FrameFrustum &frustum
);
 
-
-private :
-
static
void
ComputeDefaultFrustum(
@@ -225,6 +222,8 @@
RAS_FrameFrustum & frustum
);  
 
+private :
+
static
void
ComputeBestFitViewRect(

Modified: trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h
===
--- trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h
2008-11-26 17:35:53 UTC (rev 17583)
+++ trunk/blender/source/gameengine/Rasterizer/RAS_IRasterizer.h
2008-11-26 17:38:54 UTC (rev 17584)
@@ -200,6 +200,7 @@
 * @return true if stereo mode is enabled.
 */
virtual boolStereo()=0;
+virtual StereoMode GetStereoMode()=0;
virtual boolInterlacedStereo()=0;
/**
 * Sets which eye buffer subsequent primitives will be rendered to.

Modified: 
trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
===
--- 
trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
2008-11-26 17:35:53 UTC (rev 17583)
+++ 
trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
2008-11-26 17:38:54 UTC (rev 17584)
@@ -406,15 +406,17 @@
break;
}
 }
-

 void RAS_OpenGLRasterizer::SetStereoMode(const StereoMode stereomode)
 {
m_stereomode = stereomode;
 }
 
+RAS_IRasterizer::StereoMode RAS_OpenGLRasterizer::GetStereoMode()
+{
+   return m_stereomode;
+}
 
-
 bool RAS_OpenGLRasterizer::Stereo()
 {
if(m_stereomode == RAS_STEREO_NOSTEREO)
@@ -775,7 +777,7 @@
float frustnear,
float frustfar,
float focallength,
-   bool
+   bool 
 ){
MT_Matrix4x4 result;
double mat[16];

Modified: 
trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
===
--- 
trunk/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17583] trunk/blender/source/gameengine/ Ketsji/KX_Scene.cpp: BGE bug fix: culling algorithm didn' t used the correct camera.

2008-11-26 Thread Benoit Bolsee
Revision: 17583
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17583
Author:   ben2610
Date: 2008-11-26 18:35:53 +0100 (Wed, 26 Nov 2008)

Log Message:
---
BGE bug fix: culling algorithm didn't used the correct camera.

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

Modified: trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp
===
--- trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp 2008-11-26 17:34:10 UTC 
(rev 17582)
+++ trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp 2008-11-26 17:35:53 UTC 
(rev 17583)
@@ -1249,7 +1249,7 @@
// If the camera is inside this node, then the object is visible.
if (!vis)
{
-   vis = gameobj->GetSGNode()->inside( 
GetActiveCamera()->GetCameraLocation() );
+   vis = gameobj->GetSGNode()->inside( cam->GetCameraLocation() );
}

// Test the object's bound sphere against the view frustum.


___
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 [17582] trunk/blender/projectfiles_vc9/ blender/nodes/nodes.vcproj: MSVC9 project file update for TEX nodes

2008-11-26 Thread Benoit Bolsee
Revision: 17582
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17582
Author:   ben2610
Date: 2008-11-26 18:34:10 +0100 (Wed, 26 Nov 2008)

Log Message:
---
MSVC9 project file update for TEX nodes

Modified Paths:
--
trunk/blender/projectfiles_vc9/blender/nodes/nodes.vcproj

Modified: trunk/blender/projectfiles_vc9/blender/nodes/nodes.vcproj
===
--- trunk/blender/projectfiles_vc9/blender/nodes/nodes.vcproj   2008-11-26 
17:23:22 UTC (rev 17581)
+++ trunk/blender/projectfiles_vc9/blender/nodes/nodes.vcproj   2008-11-26 
17:34:10 UTC (rev 17582)
@@ -616,10 +616,18 @@
>


+   
+   


+   
+   



___
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 [17581] trunk/blender/projectfiles_vc9: MSVC9 project file update for blenderplayer

2008-11-26 Thread Benoit Bolsee
Revision: 17581
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17581
Author:   ben2610
Date: 2008-11-26 18:23:22 +0100 (Wed, 26 Nov 2008)

Log Message:
---
MSVC9 project file update for blenderplayer

Modified Paths:
--
trunk/blender/projectfiles_vc9/blender/blender.sln
trunk/blender/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj

Modified: trunk/blender/projectfiles_vc9/blender/blender.sln
===
--- trunk/blender/projectfiles_vc9/blender/blender.sln  2008-11-26 13:07:24 UTC 
(rev 17580)
+++ trunk/blender/projectfiles_vc9/blender/blender.sln  2008-11-26 17:23:22 UTC 
(rev 17581)
@@ -151,6 +151,7 @@
{415BFD6E-64CF-422B-AF88-C07F040A7292} = 
{415BFD6E-64CF-422B-AF88-C07F040A7292}
{670EC17A-0548-4BBF-A27B-636C7C188139} = 
{670EC17A-0548-4BBF-A27B-636C7C188139}
{4C3AB78A-52CA-4276-A041-39776E52D8C8} = 
{4C3AB78A-52CA-4276-A041-39776E52D8C8}
+   {E784098D-3ED8-433A-9353-9679415DDDC5} = 
{E784098D-3ED8-433A-9353-9679415DDDC5}
{6B801390-5F95-4F07-81A7-97FBA046AACC} = 
{6B801390-5F95-4F07-81A7-97FBA046AACC}
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = 
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
{76D90B92-ECC7-409C-9F98-A8814B90F3C0} = 
{76D90B92-ECC7-409C-9F98-A8814B90F3C0}
@@ -167,13 +168,16 @@
{E90C7BC2-CF30-4A60-A8F2-0050D592E358} = 
{E90C7BC2-CF30-4A60-A8F2-0050D592E358}
{8B8D4FC3-3234-4E54-8376-5AB83D00D164} = 
{8B8D4FC3-3234-4E54-8376-5AB83D00D164}
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74} = 
{4B6AFCC5-968C-424A-8F20-76E41B3BEF74}
+   {0112CAD5-3584-412A-A2E5-1315A00437B4} = 
{0112CAD5-3584-412A-A2E5-1315A00437B4}
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA} = 
{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}
{E86B7BDE-C33C-4E55-9433-E74C141D7538} = 
{E86B7BDE-C33C-4E55-9433-E74C141D7538}
{32CC75E2-EE85-45E6-8E3D-513F58464F43} = 
{32CC75E2-EE85-45E6-8E3D-513F58464F43}
{9A307EE5-CD77-47BC-BD87-62508C7E19D8} = 
{9A307EE5-CD77-47BC-BD87-62508C7E19D8}
{AB590CED-F71F-4A17-A89B-18583ECD633D} = 
{AB590CED-F71F-4A17-A89B-18583ECD633D}
+   {B83C6BED-11EC-46C8-AFFA-121EEDE94373} = 
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9} = 
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}
{B789C2F3-279E-4A85-8F0A-7F7AC068E598} = 
{B789C2F3-279E-4A85-8F0A-7F7AC068E598}
+   {524264F4-DF21-4B79-847F-E7CA643ECD0B} = 
{524264F4-DF21-4B79-847F-E7CA643ECD0B}
EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KX_blenderhook", 
"..\gameengine\blenderhook\KX_blenderhook.vcproj", 
"{8154A59A-CAED-403D-AB94-BC4E7C032666}"
@@ -621,19 +625,25 @@
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Blender 
Release|Win32.ActiveCfg = Blender Release|Win32
{0112CAD5-3584-412A-A2E5-1315A00437B4}.Blender 
Release|Win32.Build.0 = Blender Release|Win32
{0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer 
Debug|Win32.ActiveCfg = Blender Debug|Win32
+   {0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer 
Debug|Win32.Build.0 = Blender Debug|Win32
{0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer 
Release|Win32.ActiveCfg = Blender Release|Win32
+   {0112CAD5-3584-412A-A2E5-1315A00437B4}.BlenderPlayer 
Release|Win32.Build.0 = Blender Release|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Blender 
Debug|Win32.ActiveCfg = Blender Debug|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Blender 
Debug|Win32.Build.0 = Blender Debug|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Blender 
Release|Win32.ActiveCfg = Blender Release|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.Blender 
Release|Win32.Build.0 = Blender Release|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer 
Debug|Win32.ActiveCfg = Blender Debug|Win32
+   {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer 
Debug|Win32.Build.0 = Blender Debug|Win32
{B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer 
Release|Win32.ActiveCfg = Blender Release|Win32
+   {B83C6BED-11EC-46C8-AFFA-121EEDE94373}.BlenderPlayer 
Release|Win32.Build.0 = Blender Release|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Blender 
Debug|Win32.ActiveCfg = Blender Debug|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Blender 
Debug|Win32.Build.0 = Blender Debug|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Blender 
Release|Win32.ActiveCfg = Blender Release|Win32
{524264F4-DF21-4B79-847F-E7CA643ECD0B}.Blender 
Release|Win32.Build.0 = Blender Release|Win32
{524264F4-DF21-

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17580] trunk/blender/source/blender: 2 things:

2008-11-26 Thread Robin Allen
Revision: 17580
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17580
Author:   kakbarnf
Date: 2008-11-26 14:07:24 +0100 (Wed, 26 Nov 2008)

Log Message:
---
2 things:

* Patch #17998
* tex_input_vec now takes 3-vector as first argument (was 4-vector).

Modified Paths:
--
trunk/blender/source/blender/blenkernel/BKE_node.h
trunk/blender/source/blender/blenkernel/intern/node.c
trunk/blender/source/blender/nodes/TEX_node.h
trunk/blender/source/blender/nodes/intern/TEX_util.c

Added Paths:
---
trunk/blender/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
trunk/blender/source/blender/nodes/intern/TEX_nodes/TEX_distance.c

Modified: trunk/blender/source/blender/blenkernel/BKE_node.h
===
--- trunk/blender/source/blender/blenkernel/BKE_node.h  2008-11-26 11:01:56 UTC 
(rev 17579)
+++ trunk/blender/source/blender/blenkernel/BKE_node.h  2008-11-26 13:07:24 UTC 
(rev 17580)
@@ -401,6 +401,8 @@
 #define TEX_NODE_ROTATE 114
 #define TEX_NODE_VIEWER 115
 #define TEX_NODE_TRANSLATE  116
+#define TEX_NODE_COORD  117
+#define TEX_NODE_DISTANCE   118
 
 /* 201-299 reserved. Use like this: TEX_NODE_PROC + TEX_CLOUDS, etc */
 #define TEX_NODE_PROC  200

Modified: trunk/blender/source/blender/blenkernel/intern/node.c
===
--- trunk/blender/source/blender/blenkernel/intern/node.c   2008-11-26 
11:01:56 UTC (rev 17579)
+++ trunk/blender/source/blender/blenkernel/intern/node.c   2008-11-26 
13:07:24 UTC (rev 17580)
@@ -2886,6 +2886,8 @@
nodeRegisterType(ntypelist, &tex_node_curve_time);
nodeRegisterType(ntypelist, &tex_node_invert);
nodeRegisterType(ntypelist, &tex_node_hue_sat);
+   nodeRegisterType(ntypelist, &tex_node_coord);
+   nodeRegisterType(ntypelist, &tex_node_distance);

nodeRegisterType(ntypelist, &tex_node_output);
nodeRegisterType(ntypelist, &tex_node_viewer);

Modified: trunk/blender/source/blender/nodes/TEX_node.h
===
--- trunk/blender/source/blender/nodes/TEX_node.h   2008-11-26 11:01:56 UTC 
(rev 17579)
+++ trunk/blender/source/blender/nodes/TEX_node.h   2008-11-26 13:07:24 UTC 
(rev 17580)
@@ -52,6 +52,8 @@
 extern bNodeType tex_node_curve_time;
 extern bNodeType tex_node_invert;
 extern bNodeType tex_node_hue_sat;
+extern bNodeType tex_node_coord;
+extern bNodeType tex_node_distance;
 
 extern bNodeType tex_node_rotate;
 extern bNodeType tex_node_translate;

Added: trunk/blender/source/blender/nodes/intern/TEX_nodes/TEX_coord.c
===
--- trunk/blender/source/blender/nodes/intern/TEX_nodes/TEX_coord.c 
(rev 0)
+++ trunk/blender/source/blender/nodes/intern/TEX_nodes/TEX_coord.c 
2008-11-26 13:07:24 UTC (rev 17580)
@@ -0,0 +1,66 @@
+/**
+ *
+ * * BEGIN GPL LICENSE BLOCK *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Mathias Panzenböck (panzi) <[EMAIL PROTECTED]>.
+ *
+ * * END GPL LICENSE BLOCK *
+ */
+
+#include "../TEX_util.h"
+
+static bNodeSocketType outputs[]= { 
+   { SOCK_VECTOR, 0, "Coordinates", 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f },
+   { -1, 0, "" }
+};
+
+static void vectorfn(float *out, float *coord, bNode *node, bNodeStack **in, 
short thread)
+{
+   out[0] = coord[0];
+   out[1] = coord[1];
+   out[2] = coord[2];
+}
+
+static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
+{
+   tex_output(node, in, out[0], &vectorfn);
+   
+   tex_do_preview(node, out[0], data);
+}
+
+bNodeType tex_node_coord= {
+   /* *next,*prev */   NULL, NULL,
+   /* type code   */   TEX_NODE_COORD,
+   /* name*/   "Coordinates",
+   /* width+range */   120, 110, 160,
+   /* class+opts  */   NODE_CLASS_INPUT, NODE_OPTIONS,
+   /* input sock  */   NULL,
+   /* output sock */   outputs,

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17579] branches/animsys2/source/blender: AnimSys2: Finishing off dopesheet and NLA issues

2008-11-26 Thread Joshua Leung
Revision: 17579
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17579
Author:   aligorith
Date: 2008-11-26 12:01:56 +0100 (Wed, 26 Nov 2008)

Log Message:
---
AnimSys2: Finishing off dopesheet and NLA issues

* Added scaling support to the column-select tools 
* Fixed the Action keyframe summary that's included in the Object summaries, so 
that it shows with NLA scaling
* Made a few irrelevant entries in the menus be hidden too

Modified Paths:
--
branches/animsys2/source/blender/include/BDR_drawaction.h
branches/animsys2/source/blender/src/drawaction.c
branches/animsys2/source/blender/src/editaction.c
branches/animsys2/source/blender/src/header_action.c

Modified: branches/animsys2/source/blender/include/BDR_drawaction.h
===
--- branches/animsys2/source/blender/include/BDR_drawaction.h   2008-11-26 
06:14:41 UTC (rev 17578)
+++ branches/animsys2/source/blender/include/BDR_drawaction.h   2008-11-26 
11:01:56 UTC (rev 17579)
@@ -95,6 +95,7 @@
 void ipo_to_keylist(struct Ipo *ipo, ListBase *keys, ListBase *blocks, 
ActKeysInc *aki);
 void agroup_to_keylist(struct bActionGroup *agrp, ListBase *keys, ListBase 
*blocks, ActKeysInc *aki);
 void action_to_keylist(struct bAction *act, ListBase *keys, ListBase *blocks, 
ActKeysInc *aki);
+void action_nlascaled_to_keylist(struct Object *ob, struct bAction *act, 
ListBase *keys, ListBase *blocks, ActKeysInc *aki);
 void ob_to_keylist(struct Object *ob, ListBase *keys, ListBase *blocks, 
ActKeysInc *aki);
 void gpl_to_keylist(struct bGPDlayer *gpl, ListBase *keys, ListBase *blocks, 
ActKeysInc *aki);
 

Modified: branches/animsys2/source/blender/src/drawaction.c
===
--- branches/animsys2/source/blender/src/drawaction.c   2008-11-26 06:14:41 UTC 
(rev 17578)
+++ branches/animsys2/source/blender/src/drawaction.c   2008-11-26 11:01:56 UTC 
(rev 17579)
@@ -121,29 +121,21 @@
 
 #define XIC 20
 #define YIC 20
-
-   /* lets make the rvk sliders */
-
+   
+   /* lets make the shapekey sliders */
+   
/* reset the damn myortho2 or the sliders won't draw/redraw
 * correctly *grumble*
 */
mywinset(curarea->win);
myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, 
G.v2d->cur.ymax);
-
+   
 sprintf(str, "actionbuttonswin %d", curarea->win);
 block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS, UI_HELV, 
curarea->win);
 
x = NAMEWIDTH + 1;
 y = 0.0f;
-
-   /* make the little 'open the sliders' widget */
-   // should eventually be removed
-BIF_ThemeColor(TH_FACE); // this slot was open... (???... Aligorith)
-   glRects(2, (short)y + 2*CHANNELHEIGHT - 2, ACTWIDTH - 2, (short)y + 
CHANNELHEIGHT + 2);
-   glColor3ub(0, 0, 0);
-   glRasterPos2f(4, y + CHANNELHEIGHT + 6);
-   BMF_DrawString(G.font, "Sliders");
-
+   
uiBlockSetEmboss(block, UI_EMBOSSN);
 
if (!(G.saction->flag & SACTION_SLIDERS)) {
@@ -156,7 +148,6 @@
  "Show action window sliders");
/* no hilite, the winmatrix is not correct later on... */
uiButSetFlag(but, UI_NO_HILITE);
-
}
else {
but= uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR, 
@@ -2092,7 +2083,7 @@
/* get filterflag */
if (ads)
filterflag= ads->filterflag;
-   else if (aki && aki->actmode == -1) /* only set like this by 
NLA */
+   else if ((aki) && (aki->actmode == -1)) /* only set like this 
by NLA */
filterflag= ADS_FILTER_NLADUMMY;
else
filterflag= 0;
@@ -2102,10 +2093,8 @@
ipo_to_keylist(ob->ipo, keys, blocks, aki);

/* Add action keyframes */
-   // FIXME: we may need to apply NLA-scaling here...
-   if ((ob->action) && !(filterflag & ADS_FILTER_NOACTS)) {
-   action_to_keylist(ob->action, keys, blocks, aki);
-   }
+   if ((ob->action) && !(filterflag & ADS_FILTER_NOACTS))
+   action_nlascaled_to_keylist(ob, ob->action, keys, 
blocks, aki);

/* Add shapekey keyframes (only if dopesheet allows, if it is 
available) */
if ((key && key->ipo) && !(filterflag & ADS_FILTER_NOSHAPEKEYS))
@@ -2284,6 +2273,52 @@
}
 }
 
+void action_nlascaled_to_keylist(Object *ob, bAction *act, ListBase *keys, 
ListBase *blocks, ActKeysInc *aki)
+{
+   bActionChannel *achan;
+   bConstraintChannel *conchan;
+   Object *oldob= NULL;
+   
+   /* although apply and clearing NLA-scaling pre-post creating keylist 
does impact on performance,
+* the effects should