[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18632] branches/blender2.5/blender/source /blender: 2.5: WM Compositing

2009-01-22 Thread Brecht Van Lommel
Revision: 18632
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18632
Author:   blendix
Date: 2009-01-23 04:52:52 +0100 (Fri, 23 Jan 2009)

Log Message:
---
2.5: WM Compositing

* Triple Buffer is now more complete:
  - Proper handling of window resize, duplicate, etc.
  - It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
  - It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
  - Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.

* Testing can be done by setting the "Window Draw Method" in the
  User Preferences in the outliner. "Overlap" is still default,
  since "Triple Buffer" has not been tested on computers other than
  mine, would like to avoid crashing Blender on startup in case
  there is a common bug, but it's ready for testing now.

  - For reference "Full" draws the full window each time.
  - "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
  - Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.

* Partial Redraw was added. ED_region_tag_redraw_partial takes a
  rect in window coordinates to define a subarea of the region.
  On region draw it will then set glScissor to a smaller area, and
  ar->drawrct will always be set to either the partial or full
  window rect. The latter can then be used for clipping in the 3D
  view or clipping interface drawing. Neither is implemented yet.

Modified Paths:
--
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
branches/blender2.5/blender/source/blender/editors/include/ED_screen.h

branches/blender2.5/blender/source/blender/editors/interface/interface_regions.c
branches/blender2.5/blender/source/blender/editors/screen/area.c
branches/blender2.5/blender/source/blender/makesdna/DNA_screen_types.h
branches/blender2.5/blender/source/blender/makesdna/DNA_userdef_types.h

branches/blender2.5/blender/source/blender/makesdna/DNA_windowmanager_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_userdef.c
branches/blender2.5/blender/source/blender/windowmanager/WM_api.h
branches/blender2.5/blender/source/blender/windowmanager/intern/wm.c
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_draw.c

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_gesture.c

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_subwindow.c
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_window.c
branches/blender2.5/blender/source/blender/windowmanager/wm_event_system.h

Added Paths:
---
branches/blender2.5/blender/source/blender/windowmanager/wm_draw.h

Modified: 
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
===
--- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 
2009-01-23 03:41:05 UTC (rev 18631)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 
2009-01-23 03:52:52 UTC (rev 18632)
@@ -4007,8 +4007,9 @@
win->handlers.first= win->handlers.last= NULL;
win->subwindows.first= win->subwindows.last= NULL;
 
-   win->drawtex= 0;
-   win->drawmethod= 0;
+   win->drawdata= NULL;
+   win->drawmethod= -1;
+   win->drawfail= 0;
}

wm->operators.first= wm->operators.last= NULL;
@@ -4459,6 +4460,8 @@
ar->swinid= 0;
ar->type= NULL;
ar->swap= 0;
+   ar->do_draw= 0;
+   memset(&ar->drawrct, 0, sizeof(ar->drawrct));
 }
 
 /* for the saved 2.50 files without regiondata */
@@ -4497,6 +4500,7 @@
sc->context= NULL;
 
sc->mainwin= sc->subwinactive= 0;   /* indices */
+   sc->swap= 0;

/* hacky patch... but people have been saving files with the 
verse-blender,
   causing the handler to keep running for ever, with no means to 
disable it */

Modified: branches/blender2.5/blender/source/blender/editors/include/ED_screen.h
===
--- branches/blender2.5/blender/source/blender/editors/include/ED_screen.h  
2009-01-23 03:41:05 UTC (rev 18631)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_screen.h

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18631] branches/blender2.5/blender/source /blender/blenkernel/intern/ipo.c: Animato: Added conversions for Camera data and Texture IPO's

2009-01-22 Thread Joshua Leung
Revision: 18631
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18631
Author:   aligorith
Date: 2009-01-23 04:41:05 +0100 (Fri, 23 Jan 2009)

Log Message:
---
Animato: Added conversions for Camera data and Texture IPO's

Most of the settings have been converted, however, there are a few which are 
not easy to convert.

* For textures:
- tex->noisedepth  - undefined in RNA?
- tex->noisetype   - undefined in RNA?
- tex->stype   - undefined in RNA?
- tex->noise_basis2 - is noted in RNA as undefined... 

* For Cameras:
- "CAM_LENS" define was used for either 'ortho_scale', or 'lens' depending on 
camera type. This is currently difficult to ascertain using current code... 
I'll revisit this later
- cam->YF_aperature - undefined in RNA 
- cam->YF_dofdist - undefined in RNA

Modified Paths:
--
branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c
===
--- branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c  
2009-01-23 03:07:07 UTC (rev 18630)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c  
2009-01-23 03:41:05 UTC (rev 18631)
@@ -264,6 +264,125 @@
return buf;
 }
 
+/* Texture types */
+static char *texture_adrcodes_to_paths (int adrcode, int *array_index)
+{
+   /* set array index like this in-case nothing sets it correctly  */
+   *array_index= 0;
+   
+   /* result depends on adrcode */
+   switch (adrcode) {
+   case TE_NSIZE:
+   return "noise_size";
+   case TE_TURB:
+   return "turbulence";
+   
+   case TE_NDEPTH: // XXX texture RNA undefined
+   //poin= &(tex->noisedepth); *type= IPO_SHORT; break;
+   break;
+   case TE_NTYPE: // XXX texture RNA undefined
+   //poin= &(tex->noisetype); *type= IPO_SHORT; break;
+   break;
+   
+   case TE_N_BAS1:
+   return "noise_basis";
+   case TE_N_BAS2:
+   return "noise_basis"; // XXX this is not yet defined in 
RNA...
+   
+   /* voronoi */
+   case TE_VNW1:
+   *array_index= 0; return "feature_weights";
+   case TE_VNW2:
+   *array_index= 1; return "feature_weights";
+   case TE_VNW3:
+   *array_index= 2; return "feature_weights";
+   case TE_VNW4:
+   *array_index= 3; return "feature_weights";
+   case TE_VNMEXP:
+   return "minkovsky_exponent";
+   case TE_VN_DISTM:
+   return "distance_metric";
+   case TE_VN_COLT:
+   return "color_type";
+   
+   /* distorted noise / voronoi */
+   case TE_ISCA:
+   return "noise_intensity";
+   
+   /* distorted noise */
+   case TE_DISTA:
+   return "distortion_amount";
+   
+   /* musgrave */
+   case TE_MG_TYP: // XXX texture RNA undefined
+   //  poin= &(tex->stype); *type= IPO_SHORT; break;
+   break;
+   case TE_MGH:
+   return "highest_dimension";
+   case TE_MG_LAC:
+   return "lacunarity";
+   case TE_MG_OCT:
+   return "octaves";
+   case TE_MG_OFF:
+   return "offset";
+   case TE_MG_GAIN:
+   return "gain";
+   
+   case TE_COL_R:
+   *array_index= 0; return "rgb_factor";
+   case TE_COL_G:
+   *array_index= 1; return "rgb_factor";
+   case TE_COL_B:
+   *array_index= 2; return "rgb_factor";
+   
+   case TE_BRIGHT:
+   return "brightness";
+   case TE_CONTRA:
+   return "constrast";
+   }
+   
+   return NULL;
+}
+
+/* Camera Types */
+static char *camera_adrcodes_to_paths (int adrcode, int *array_index)
+{
+   /* set array index like this in-case nothing sets it correctly  */
+   *array_index= 0;
+   
+   /* result depends on adrcode */
+   switch (adrcode) {
+   case CAM_LENS:
+#if 0 // XXX this cannot be resolved easily... perhaps we assume camera is 
perspective (works for most cases...
+   if (ca->type == CAM_ORTHO)
+   return "ortho_s

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18630] branches/blender2.5/blender/source /blender/editors/mesh: remove doubles op, ton: is this working properly?

2009-01-22 Thread Shaul Kedem
Revision: 18630
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18630
Author:   shul
Date: 2009-01-23 04:07:07 +0100 (Fri, 23 Jan 2009)

Log Message:
---
remove doubles op, ton: is this working properly?

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
branches/blender2.5/blender/source/blender/editors/mesh/mesh_intern.h
branches/blender2.5/blender/source/blender/editors/mesh/mesh_ops.c

Modified: 
branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
===
--- branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
2009-01-23 02:59:21 UTC (rev 18629)
+++ branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
2009-01-23 03:07:07 UTC (rev 18630)
@@ -487,6 +487,32 @@
return a;   /* amount */
 }
 
+static int removedoublesflag_exec(bContext *C, wmOperator *op)
+{
+   Object *obedit= CTX_data_edit_object(C);
+   Scene *scene = CTX_data_scene(C);
+   EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
+
+   removedoublesflag(em,1,0,scene->toolsettings->doublimit);
+   
+   ED_undo_push(C, "Remove Doubles");  // Note this will become 
depricated 
+   WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
+   
+   return OPERATOR_FINISHED;   
+}
+
+void MESH_OT_removedoublesflag(wmOperatorType *ot)
+{
+   /* identifiers */
+   ot->name= "Remove Doubles";
+   ot->idname= "MESH_OT_removedoublesflag";
+   
+   /* api callbacks */
+   ot->exec= removedoublesflag_exec;
+   ot->poll= ED_operator_editmesh;
+}
+
+// XXX is this needed?
 /* called from buttons */
 static void xsortvert_flag__doSetX(void *userData, EditVert *eve, int x, int 
y, int index)
 {

Modified: branches/blender2.5/blender/source/blender/editors/mesh/mesh_intern.h
===
--- branches/blender2.5/blender/source/blender/editors/mesh/mesh_intern.h   
2009-01-23 02:59:21 UTC (rev 18629)
+++ branches/blender2.5/blender/source/blender/editors/mesh/mesh_intern.h   
2009-01-23 03:07:07 UTC (rev 18630)
@@ -215,6 +215,7 @@
 void MESH_OT_subdivide_multi(struct wmOperatorType *ot);
 void MESH_OT_subdivide_multi_fractal(struct wmOperatorType *ot);
 void MESH_OT_subdivide_smooth(struct wmOperatorType *ot);
+void MESH_OT_removedoublesflag(struct wmOperatorType *ot);
 
 #endif // MESH_INTERN_H
 

Modified: branches/blender2.5/blender/source/blender/editors/mesh/mesh_ops.c
===
--- branches/blender2.5/blender/source/blender/editors/mesh/mesh_ops.c  
2009-01-23 02:59:21 UTC (rev 18629)
+++ branches/blender2.5/blender/source/blender/editors/mesh/mesh_ops.c  
2009-01-23 03:07:07 UTC (rev 18630)
@@ -131,6 +131,7 @@
WM_operatortype_append(MESH_OT_add_primitive_uv_sphere);
WM_operatortype_append(MESH_OT_add_primitive_ico_sphere);
WM_operatortype_append(MESH_OT_add_duplicate);
+   WM_operatortype_append(MESH_OT_removedoublesflag);
 
 }
 
@@ -166,6 +167,7 @@
/*WM_keymap_add_item(keymap, "MESH_OT_subdivide_multi", WKEY, KM_PRESS, 
KM_CTRL|KM_SHIFT, 0);
WM_keymap_add_item(keymap, "MESH_OT_subdivide_multi_fractal", WKEY, 
KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "MESH_OT_subdivide_smooth", WKEY, KM_PRESS, 
KM_CTRL|KM_ALT, 0);*/
+   WM_keymap_add_item(keymap, "MESH_OT_removedoublesflag", VKEY, KM_PRESS, 
KM_CTRL, 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 [18629] branches/blender2.5/blender/source /blender: Animato:

2009-01-22 Thread Joshua Leung
Revision: 18629
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18629
Author:   aligorith
Date: 2009-01-23 03:59:21 +0100 (Fri, 23 Jan 2009)

Log Message:
---
Animato:

* Removed a few excessive debug prints
* Fixed crash on loading "Frankie" from BBB due to missing check for Driver 
without a target

Modified Paths:
--
branches/blender2.5/blender/source/blender/blenkernel/intern/depsgraph.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c

Modified: 
branches/blender2.5/blender/source/blender/blenkernel/intern/depsgraph.c
===
--- branches/blender2.5/blender/source/blender/blenkernel/intern/depsgraph.c
2009-01-23 02:50:04 UTC (rev 18628)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/depsgraph.c
2009-01-23 02:59:21 UTC (rev 18629)
@@ -346,7 +346,7 @@
else if (driver->type == DRIVER_TYPE_ROTDIFF) {
// XXX rotational difference 
}
-   else {
+   else if (driver->id) {
/* normal channel-drives-channel */
node1 = dag_get_node(dag, driver->id);  // XXX we 
assume that id is an object...


Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2009-01-23 02:50:04 UTC (rev 18628)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2009-01-23 02:59:21 UTC (rev 18629)
@@ -1469,17 +1469,14 @@
return 0;
 
len= strlen(token);
-   printf("RNA path identifier strlen = %d \n", len);
-
+   
/* check for "" to see if it is a string */
if(len >= 2 && token[0] == '"' && token[len-1] == '"') {
/* strip away "" */
token[len-1]= 0;
-   printf("RNA path identifier - string %s \n", 
token+1);
RNA_property_collection_lookup_string(&curptr, 
prop, token+1, &nextptr);
}
else {
-   printf("RNA path identifier - int %s \n", 
token);
/* otherwise do int lookup */
intkey= atoi(token);
RNA_property_collection_lookup_int(&curptr, 
prop, intkey, &nextptr);


___
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 [18628] branches/blender2.5/blender/source /blender: Animato Bugfixes:

2009-01-22 Thread Joshua Leung
Revision: 18628
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18628
Author:   aligorith
Date: 2009-01-23 03:50:04 +0100 (Fri, 23 Jan 2009)

Log Message:
---
Animato Bugfixes:

* Fixed bug in with RNA-paths. String identifiers (i.e. 
some_collection["somekey"]) were not getting handled at all due to wrong 
indices it seems. I don't know of any other code using this, so hopefully there 
aren't any unintended bugs caused by this. 
This means that bone animation now works again.

* Added a few more sanity checks to file-reading code, and heaps of extra 
prints everywhere else for debugging purposes (these will be removed in due 
course).

Modified Paths:
--
branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c
branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c
branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h

branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c
===
--- branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c  
2009-01-22 18:09:59 UTC (rev 18627)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c  
2009-01-23 02:50:04 UTC (rev 18628)
@@ -484,29 +484,35 @@
 *  - beztriples are more likely to be encountered as they are 
keyframes (the other type wasn't used yet)
 */
// XXX we need to cope with the nasty old 'bitflag' curves... that will 
be a task for later
+   // XXX we also need to correct values for object-rotation curves
fcu->totvert= icu->totvert;

if (icu->bezt) {
+   BezTriple *dst, *src;
+   
/* allocate new array for keyframes/beztriples */
fcu->bezt= MEM_callocN(sizeof(BezTriple)*fcu->totvert, 
"BezTriples");

-   /* check if we need to set interpolation settings (thus doing 
it the 'slow' way) */
-   if (icu->ipo != IPO_MIXED) {
-   BezTriple *dst, *src;
+   /* loop through copying all BezTriples individually, as we need 
to modify a few things */
+   for (dst=fcu->bezt, src=icu->bezt; i < fcu->totvert; i++, 
dst++, src++) {
+   /* firstly, copy BezTriple data */
+   *dst= *src;

-   /* loop through copying all BezTriples, as we need to 
set interpolation settings too */
-   for (dst=fcu->bezt, src=icu->bezt; i < fcu->totvert; 
i++, dst++, src++) {
-   /* firstly, copy BezTriple data */
-   *dst= *src;
+   /* now copy interpolation from curve (if not already 
set) */
+   if (icu->ipo != IPO_MIXED)
+   dst->ipo= icu->ipo;

-   /* now copy interpolation from curve */
-   dst->ipo= icu->ipo;
+   /* correct values for object rotation curves - they 
were degrees/10 */
+   // XXX for now, just make them into degrees 
+   if ((icu->blocktype == ID_OB) && ELEM3(icu->adrcode, 
OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) {
+   dst->vec[0][0] *= 10.0f;
+   dst->vec[1][0] *= 10.0f;
+   dst->vec[2][0] *= 10.0f;
}
}
-   else {
-   /* interpolation already set (from AnimSys2 branch) */
-   memcpy(fcu->bezt, icu->bezt, 
sizeof(BezTriple)*fcu->totvert);
-   }
+   
+   /* free this data now */
+   MEM_freeN(icu->bezt);
}
else if (icu->bp) {
/* TODO: need to convert from BPoint type to the more compact 
FPoint type... but not priority, since no data used this */
@@ -568,7 +574,6 @@
 static void ipo_to_animdata (ID *id, Ipo *ipo, char *actname, char *constname)
 {
AnimData *adt= BKE_animdata_from_id(id);
-   bAction *act= adt->action;
//bActionGroup *grp;
IpoCurve *icu, *icn;
FCurve *fcu;
@@ -576,6 +581,10 @@
/* sanity check */
if ELEM(NULL, id, ipo)
return;
+   if (adt == NULL) {
+   printf("ERROR ipo_to_animdata(): adt invalid \n");
+   return;
+   }

printf("ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s  
curves:%d \n", 
id->name+2, ipo->id.name+2, (actname)?actname:"", 
(constname)?constname:"", 
@@ -609,11 +618,13 @@
/* conve

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18627] branches/blender2.5/blender/ projectfiles_vc9/blender: 2.5 MSVC9 projectfiles

2009-01-22 Thread Andrea Weikert
Revision: 18627
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18627
Author:   elubie
Date: 2009-01-22 19:09:59 +0100 (Thu, 22 Jan 2009)

Log Message:
---
2.5 MSVC9 projectfiles 
updates: 
* windowmanager/wm_jos.c
* editors/datafiles/preview.blend.c

Modified Paths:
--

branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj

branches/blender2.5/blender/projectfiles_vc9/blender/windowmanager/windowmanager.vcproj

Modified: 
branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj
===
--- 
branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj  
2009-01-22 17:40:47 UTC (rev 18626)
+++ 
branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj  
2009-01-22 18:09:59 UTC (rev 18627)
@@ -327,6 +327,10 @@
>


+   
+   


Modified: 
branches/blender2.5/blender/projectfiles_vc9/blender/windowmanager/windowmanager.vcproj
===
--- 
branches/blender2.5/blender/projectfiles_vc9/blender/windowmanager/windowmanager.vcproj
 2009-01-22 17:40:47 UTC (rev 18626)
+++ 
branches/blender2.5/blender/projectfiles_vc9/blender/windowmanager/windowmanager.vcproj
 2009-01-22 18:09:59 UTC (rev 18627)
@@ -197,6 +197,10 @@
>


+   
+   



___
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 [18626] trunk/blender/source/gameengine: BGE API cleanup: shape action actuator.

2009-01-22 Thread Benoit Bolsee
Revision: 18626
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18626
Author:   ben2610
Date: 2009-01-22 18:40:47 +0100 (Thu, 22 Jan 2009)

Log Message:
---
BGE API cleanup: shape action actuator.

Modified Paths:
--
trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
trunk/blender/source/gameengine/Converter/BL_ActionActuator.h
trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp
trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.h
trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
trunk/blender/source/gameengine/PyDoc/BL_ActionActuator.py
trunk/blender/source/gameengine/PyDoc/BL_ShapeActionActuator.py

Modified: trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp
===
--- trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 
2009-01-22 15:52:04 UTC (rev 18625)
+++ trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 
2009-01-22 17:40:47 UTC (rev 18626)
@@ -39,10 +39,9 @@
 #include "BL_SkinDeformer.h"
 #include "KX_GameObject.h"
 #include "STR_HashedString.h"
-#include "DNA_action_types.h"
 #include "DNA_nla_types.h"
-#include "DNA_actuator_types.h"
 #include "BKE_action.h"
+#include "DNA_action_types.h"
 #include "DNA_armature_types.h"
 #include "MEM_guardedalloc.h"
 #include "BLI_blenlib.h"
@@ -51,7 +50,6 @@
 #include "BKE_utildefines.h"
 #include "FloatValue.h"
 #include "PyObjectPlus.h"
-
 #include "blendef.h"
 
 #ifdef HAVE_CONFIG_H
@@ -843,11 +841,11 @@
 }
 
switch (typeArg) {
-   case KX_ACT_ACTION_PLAY:
-   case KX_ACT_ACTION_FLIPPER:
-   case KX_ACT_ACTION_LOOPSTOP:
-   case KX_ACT_ACTION_LOOPEND:
-   case KX_ACT_ACTION_PROPERTY:
+   case ACT_ACTION_PLAY:
+   case ACT_ACTION_FLIPPER:
+   case ACT_ACTION_LOOP_STOP:
+   case ACT_ACTION_LOOP_END:
+   case ACT_ACTION_FROM_PROP:
m_playtype = typeArg;
break;
default:
@@ -1033,7 +1031,7 @@
KX_PYATTRIBUTE_STRING_RW("frameProperty", 0, 31, false, 
BL_ActionActuator, m_framepropname),
KX_PYATTRIBUTE_BOOL_RW("continue", BL_ActionActuator, m_end_reset),
KX_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, 
BL_ActionActuator, m_blendframe, CheckBlendTime),
-   
KX_PYATTRIBUTE_ENUM_RW_CHECK("type",0,100,false,BL_ActionActuator,m_playtype,CheckType),
+   
KX_PYATTRIBUTE_SHORT_RW_CHECK("type",0,100,false,BL_ActionActuator,m_playtype,CheckType),
{ NULL }//Sentinel
 };
 

Modified: trunk/blender/source/gameengine/Converter/BL_ActionActuator.h
===
--- trunk/blender/source/gameengine/Converter/BL_ActionActuator.h   
2009-01-22 15:52:04 UTC (rev 18625)
+++ trunk/blender/source/gameengine/Converter/BL_ActionActuator.h   
2009-01-22 17:40:47 UTC (rev 18626)
@@ -32,6 +32,7 @@
 
 #include "GEN_HashedPtr.h"
 #include "SCA_IActuator.h"
+#include "DNA_actuator_types.h"
 #include "MT_Point3.h"
 
 class BL_ActionActuator : public SCA_IActuator  
@@ -112,15 +113,6 @@
virtual PyObject* _getattr(const STR_String& attr);
virtual int _setattr(const STR_String& attr, PyObject* value);
 
-   enum ActionActType
-   {
-   KX_ACT_ACTION_PLAY = 0,
-   KX_ACT_ACTION_FLIPPER = 2,
-   KX_ACT_ACTION_LOOPSTOP,
-   KX_ACT_ACTION_LOOPEND,
-   KX_ACT_ACTION_PROPERTY = 6
-   };
-
/* attribute check */
static int CheckFrame(void *self, const PyAttributeDef*)
{
@@ -138,7 +130,7 @@
{
BL_ActionActuator* act = 
reinterpret_cast(self);
 
-   if (act->m_blendframe < act->m_blendin)
+   if (act->m_blendframe > act->m_blendin)
act->m_blendframe = act->m_blendin;
 
return 0;
@@ -149,11 +141,11 @@
BL_ActionActuator* act = 
reinterpret_cast(self);
 
switch (act->m_playtype) {
-   case KX_ACT_ACTION_PLAY:
-   case KX_ACT_ACTION_FLIPPER:
-   case KX_ACT_ACTION_LOOPSTOP:
-   case KX_ACT_ACTION_LOOPEND:
-   case KX_ACT_ACTION_PROPERTY:
+   case ACT_ACTION_PLAY:
+   case ACT_ACTION_FLIPPER:
+   case ACT_ACTION_LOOP_STOP:
+   case ACT_ACTION_LOOP_END:
+   case ACT_ACTION_FROM_PROP:
return 0;
default:
PyErr_SetString(PyExc_ValueError, "invalid type 
supplied");

Modified: trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp
===
--- trunk/blender/source/gameengin

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18625] branches/blender2.5/blender/source /blender: New Operators, duplicate is shift+d, Add operators are accessible from the header.

2009-01-22 Thread Campbell Barton
Revision: 18625
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18625
Author:   campbellbarton
Date: 2009-01-22 16:52:04 +0100 (Thu, 22 Jan 2009)

Log Message:
---
New Operators, duplicate is shift+d, Add operators are accessible from the 
header.
SEQUENCER_OT_add_duplicate(mode=1)  
SEQUENCER_OT_add_image_strip(name='', start_frame=0, channel=1, filename='', 
replace_sel=True)  
SEQUENCER_OT_add_movie_strip(name='', start_frame=0, channel=1, filename='', 
replace_sel=True)  
SEQUENCER_OT_add_sound_strip(name='', start_frame=0, channel=1, filename='', 
replace_sel=True)

Some of these use the file selector, Note that sound isn't working yet because 
editsound.c functions are not yet in 2.5 and Operators dont have a way to 
recieve an array of strings so SEQUENCER_OT_add_image_strip only adds 1 image 
at the moment.

Modified Paths:
--

branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_add.c

branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_edit.c

branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_header.c

branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_intern.h

branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_ops.c

branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_select.c
branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c

Modified: 
branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_add.c
===
--- 
branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_add.c
  2009-01-22 15:46:35 UTC (rev 18624)
+++ 
branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_add.c
  2009-01-22 15:52:04 UTC (rev 18625)
@@ -83,6 +83,7 @@
 #include "ED_types.h"
 #include "ED_screen.h"
 #include "ED_util.h"
+#include "ED_fileselect.h"
 
 #include "UI_interface.h"
 #include "UI_resources.h"
@@ -95,14 +96,14 @@
 static void error() {}
 static void waitcursor() {}
 static void activate_fileselect() {}
-static void std_rmouse_transform() {}
-static int get_mbut() {return 0;}
+
+
 static int pupmenu() {return 0;}
 static int pupmenu_col() {return 0;}
-static int okee() {return 0;}
-static void *find_nearest_marker() {return NULL;}
-static void deselect_markers() {}
-static void transform_markers() {}
+
+
+
+
 static void transform_seq_nomarker() {}


@@ -947,26 +948,58 @@
 }
 
 
+/* Generic functions, reused by add strip operators */
+static void sequencer_generic_props__internal(wmOperatorType *ot, int 
do_filename, int do_endframe)
+{
+   RNA_def_string(ot->srna, "name", "", MAX_ID_NAME-2, "Name", "Name of 
the new sequence strip");
+   RNA_def_int(ot->srna, "start_frame", 0, INT_MIN, INT_MAX, "Start 
Frame", "Start frame of the sequence strip", INT_MIN, INT_MAX);
+   
+   if (do_endframe)
+   RNA_def_int(ot->srna, "end_frame", 0, INT_MIN, INT_MAX, "End 
Frame", "End frame for the color strip", INT_MIN, INT_MAX); /* not useual since 
most strips have a fixed length */
+   
+   RNA_def_int(ot->srna, "channel", 1, 1, MAXSEQ, "Channel", "Channel to 
place this strip into", 1, MAXSEQ);
+   
+   if (do_filename)
+   RNA_def_string(ot->srna, "filename", "", FILE_MAX, "Scene 
Name", "full path to load the strip data from");
+   
+   RNA_def_boolean(ot->srna, "replace_sel", 1, "Replace Selection", 
"replace the current selection");
+}
 
+static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, 
wmEvent *event, int do_endframe)
+{
+   ARegion *ar= CTX_wm_region(C);
+   View2D *v2d= UI_view2d_fromcontext(C);
+   
+   short mval[2];  
+   float mval_v2d[2];
 
+   mval[0]= event->x - ar->winrct.xmin;
+   mval[1]= event->y - ar->winrct.ymin;
+   
+   UI_view2d_region_to_view(v2d, mval[0], mval[1], &mval_v2d[0], 
&mval_v2d[1]);
+   
+   RNA_int_set(op->ptr, "channel", (int)mval_v2d[1]+0.5f);
+   RNA_int_set(op->ptr, "start_frame", (int)mval_v2d[0]);
+   if (do_endframe)
+   RNA_int_set(op->ptr, "end_frame", (int)mval_v2d[0] + 25); // 
XXX arbitary but ok for now.
+   
+}
 
+static void sequencer_generic_filesel__internal(bContext *C, wmOperator *op, 
char *title, char *path)
+{  
+   SpaceFile *sfile;
 
+   ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_FILE);
 
+   /* settings for filebrowser */
+   sfile= (SpaceFile*)CTX_wm_space_data(C);
+   sfile->op = op;
+   ED_fileselect_set_params(sfile, FILE_BLENDER, title, path, 0, 0, 0);
 
+   /* screen and area have been reset already in ED_screen_full_newspace */
+}
 
-
-
-
-
-
-
-static const cha

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18624] branches/blender2.5/blender/source /blender: 2.5

2009-01-22 Thread Ton Roosendaal
Revision: 18624
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18624
Author:   ton
Date: 2009-01-22 16:46:35 +0100 (Thu, 22 Jan 2009)

Log Message:
---
2.5

- warning cleanup (wrong casts, unused vars, missing protos)
- removed old cruft from node_edit.c
- cleaned wm_jobs.c a bit

Modified Paths:
--

branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c
branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
branches/blender2.5/blender/source/blender/editors/preview/previewrender.c
branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c
branches/blender2.5/blender/source/blender/windowmanager/WM_api.h
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_draw.c
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_jobs.c

Modified: 
branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c
===
--- 
branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c   
2009-01-22 14:59:49 UTC (rev 18623)
+++ 
branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c   
2009-01-22 15:46:35 UTC (rev 18624)
@@ -392,7 +392,7 @@
 
 void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks, ActKeysInc 
*aki)
 {
-   Key *key= ob_get_key(ob);
+// Key *key= ob_get_key(ob);
 
if (ob) {
bDopeSheet *ads= (aki)? (aki->ads) : NULL;

Modified: 
branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
===
--- branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
2009-01-22 14:59:49 UTC (rev 18623)
+++ branches/blender2.5/blender/source/blender/editors/mesh/editmesh_tools.c
2009-01-22 15:46:35 UTC (rev 18624)
@@ -89,6 +89,8 @@
 #include "ED_util.h"
 #include "ED_screen.h"
 
+#include "UI_interface.h"
+
 #include "mesh_intern.h"
 
 /* XXX */
@@ -6410,8 +6412,6 @@
 
 static int subdivs_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
-   wmWindowManager *wm= CTX_wm_manager(C);
-   wmOperator *lastop;
int items;
char *menu, *p;


Modified: 
branches/blender2.5/blender/source/blender/editors/preview/previewrender.c
===
--- branches/blender2.5/blender/source/blender/editors/preview/previewrender.c  
2009-01-22 14:59:49 UTC (rev 18623)
+++ branches/blender2.5/blender/source/blender/editors/preview/previewrender.c  
2009-01-22 15:46:35 UTC (rev 18624)
@@ -996,7 +996,6 @@
 {
ShaderPreview *sp= customdata;
Render *re;
-   RenderStats *rstats;
Scene *sce;
char name [32];
 
@@ -1034,12 +1033,6 @@
RE_test_break_cb(re, sp, shader_preview_break);
}
 
-   /* enforce preview image clear */
-// if(GS(sp->id->name)==ID_MA) {
-// Material *ma= (Material *)sp->id;
-// ntreeClearPreview(ma->nodetree);
-// }
-
/* entire cycle for render engine */
RE_SetCamera(re, sce->camera);
RE_Database_FromScene(re, sce, 1);
@@ -1054,17 +1047,6 @@
//  ri->rect= 
MEM_mallocN(sizeof(int)*ri->pr_rectx*ri->pr_recty, "BIF_previewrender");
//RE_ResultGet32(re, ri->rect);
}
-   else {
-   rstats= RE_GetStats(re);
-   
-   if(rstats->totpart==rstats->partsdone && rstats->partsdone) {
-   // allqueues
-   }
-   else {
-   //  if(pr_method==PR_DRAW_RENDER && 
qtest())
-   //  
addafterqueue(area->win, RENDERPREVIEW, 1);
-   }
-   }
 
/* unassign the pointers, reset vars */
preview_prepare_scene(sp->scene, GS(sp->id->name), NULL);
@@ -1101,7 +1083,7 @@
/* setup job */
WM_jobs_customdata(steve, sp, shader_preview_free);
WM_jobs_timer(steve, 0.1, NC_MATERIAL);
-   WM_jobs_callbacks(steve, shader_preview_startjob, NULL, 
shader_preview_update);
+   WM_jobs_callbacks(steve, shader_preview_startjob, 
shader_preview_update);

WM_jobs_start(steve);
 }

Modified: 
branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c
===
--- branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c   
2009-01-22 14:59:49 UTC (rev 18623)
+++ branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c   
2009-01-22 15:46:35 UTC (rev 18624)
@@ -62,44 +62,15 @@
 #include "ED_previewrender.h"
 
 #include "BIF_gl.h"
-/*#include "BIF_cursors.h"
-#include "BIF_editview.h"
-#include "BIF_graphics.h"
-#include "BIF_imasel.h"
-#include "

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18623] branches/blender2.5/blender/source /blender: 2.5

2009-01-22 Thread Ton Roosendaal
Revision: 18623
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18623
Author:   ton
Date: 2009-01-22 15:59:49 +0100 (Thu, 22 Jan 2009)

Log Message:
---
2.5

Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
  of components to get it work:
  - customdata, free callback for it
  - timer step, notifier code
  - start callback, update callback
- Once started, each job runs an own timer, and will for
  every time step check necessary updates, or close the
  job when ready. 
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
  it will prevent multiple jobs to enter the stack. 
  Instead it will re-use a running job, signal it to stop
  and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
  under construction. 
  Fun: BLI_addtail(&wm->jobs, steve); :)

Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see 
  previews update even while dragging sliders!
- Currently it only starts when you change a node setting.

Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.

Also:
- bug in region initialize (do_versions) showed channel list in
  node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
  way! This is for later to work on anyway. 
- recoded Render API callbacks so it gets handlers passed on, 
  no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
  of stuff from code soon.

Modified Paths:
--
branches/blender2.5/blender/source/blender/blenkernel/intern/node.c
branches/blender2.5/blender/source/blender/blenkernel/intern/screen.c
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c

branches/blender2.5/blender/source/blender/editors/include/ED_previewrender.h

branches/blender2.5/blender/source/blender/editors/interface/interface_regions.c
branches/blender2.5/blender/source/blender/editors/mesh/meshtools.c
branches/blender2.5/blender/source/blender/editors/object/object_edit.c
branches/blender2.5/blender/source/blender/editors/preview/previewrender.c

branches/blender2.5/blender/source/blender/editors/space_image/image_render.c
branches/blender2.5/blender/source/blender/editors/space_node/node_draw.c
branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c
branches/blender2.5/blender/source/blender/editors/space_node/space_node.c
branches/blender2.5/blender/source/blender/makesdna/DNA_node_types.h

branches/blender2.5/blender/source/blender/makesdna/DNA_windowmanager_types.h
branches/blender2.5/blender/source/blender/nodes/intern/Makefile

branches/blender2.5/blender/source/blender/radiosity/intern/source/radrender.c

branches/blender2.5/blender/source/blender/render/extern/include/RE_pipeline.h

branches/blender2.5/blender/source/blender/render/intern/include/render_types.h

branches/blender2.5/blender/source/blender/render/intern/source/convertblender.c
branches/blender2.5/blender/source/blender/render/intern/source/envmap.c
branches/blender2.5/blender/source/blender/render/intern/source/occlusion.c
branches/blender2.5/blender/source/blender/render/intern/source/pipeline.c
branches/blender2.5/blender/source/blender/render/intern/source/rayshade.c
branches/blender2.5/blender/source/blender/render/intern/source/rendercore.c
branches/blender2.5/blender/source/blender/render/intern/source/shadbuf.c
branches/blender2.5/blender/source/blender/render/intern/source/sss.c
branches/blender2.5/blender/source/blender/render/intern/source/strand.c
branches/blender2.5/blender/source/blender/render/intern/source/zbuf.c
branches/blender2.5/blender/source/blender/windowmanager/WM_api.h

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_init_exit.c

branches/blender2.5/blender/source/blender/windowmanager/intern/wm_operators.c
branches/blender2.5/blender/source/blender/windowmanager/wm.h
branches/blender2.5/blender/source/blender/windowmanager/wm_event_types.h
branches/blender2.5/blender/source/blender/yafray/intern/export_File.cpp
branches/blender2.5/blender/source/blender/yafray/intern/export_Plugin.cpp

Added Paths:
---
branches/blender2.5/blender/source/blender/editors/datafiles/preview.blend.c
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_jobs.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/node.c
===
--- branches/blender2.5/blender/source/blender/blenkernel/in

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18622] branches/bmesh/blender/source/ blender/bmesh: destruction of previous slot api.

2009-01-22 Thread Joseph Eagar
Revision: 18622
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18622
Author:   joeedh
Date: 2009-01-22 14:59:30 +0100 (Thu, 22 Jan 2009)

Log Message:
---
destruction of previous slot api. if it returns, it'll
be in the form of functions that return pointer
references to the slot data or something.

Modified Paths:
--
branches/bmesh/blender/source/blender/bmesh/bmesh.h
branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h
branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
branches/bmesh/blender/source/blender/bmesh/operators/dissolveops.c
branches/bmesh/blender/source/blender/bmesh/operators/subdivideop.c
branches/bmesh/blender/source/blender/bmesh/operators/triangulateop.c

Modified: branches/bmesh/blender/source/blender/bmesh/bmesh.h
===
--- branches/bmesh/blender/source/blender/bmesh/bmesh.h 2009-01-22 12:34:52 UTC 
(rev 18621)
+++ branches/bmesh/blender/source/blender/bmesh/bmesh.h 2009-01-22 13:59:30 UTC 
(rev 18622)
@@ -107,7 +107,6 @@
void *data;
 } BMNode;
 
-struct bmop_error;
 typedef struct BMesh {
ListBase verts, edges, polys;
struct BLI_mempool *vpool;
@@ -126,7 +125,7 @@
struct BLI_mempool *flagpool;   
/*memory pool for dynamically allocated flag layers*/
int stackdepth; 
/*current depth of operator stack*/
int totflags, walkers;  
/*total number of tool flag layers*/
-   ListBase errorstack; /*privately used by the operator error reporting 
system*/
+   ListBase errorstack;
 } BMesh;
 
 typedef struct BMVert {

Modified: branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h
===
--- branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h   
2009-01-22 12:34:52 UTC (rev 18621)
+++ branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h   
2009-01-22 13:59:30 UTC (rev 18622)
@@ -30,30 +30,6 @@
} data;
 }BMOpSlot;
 
-/*these macros are used for iterating over slot buffers.
-  for example:
-  int i;
-
-  for (ptr=BMOS_IterNewP(i, slot); ptr; ptr=BMOS_IterStepP(i, slot)) {
-  }
-
-  int ival;
-  for (ival=BMOS_IterNewI(i, slot); !BMOS_IterDoneI(i, slot); 
ival=BMOS_IterStepI(i, slot) {
-  }
-*/
-/*remember, the ',' operator executes all expressions seperated by ','
-  (left to right) but uses the value of the right-most one.*/
-#define BMOS_IterNewP(stateint, slot)  (stateint = 0, slot->len>0 ? 
*(void**)slot->data.p : NULL)
-#define BMOS_IterStepP(stateint, slot) (stateint++,stateint>=slot->len ? NULL 
: ((void**)slot->data.buf)[stateint])
-
-#define BMOS_IterNewF(stateint, slot)  (stateint = 0, slot->len>0 ? 
*(float*)slot->data.p : NULL)
-#define BMOS_IterDoneF(stateint, slot) (stateint >= slot->len)
-#define BMOS_IterStepF(stateint, slot) (stateint++,stateint>=slot->len ? NULL 
: ((float*)slot->data.buf)[stateint])
-
-#define BMOS_IterNewI(stateint, slot)  (stateint = 0, slot->len>0 ? 
*(int*)slot->data.p : NULL)
-#define BMOS_IterDoneI(stateint, slot) (stateint >= slot->len)
-#define BMOS_IterStepI(stateint, slot) (stateint++,stateint>=slot->len ? NULL 
: ((int*)slot->data.buf)[stateint])
-
 /*operators represent logical, executable mesh modules.*/
 #define BMOP_MAX_SLOTS 16  /*way more than 
probably needed*/
 
@@ -108,15 +84,13 @@
 /*-- error code defines ---*/
 
 /*error messages*/
-#define BMERR_SELF_INTERSECTING1
+#define BMERR_SELF_INTERSECTING1
 
 static char *bmop_error_messages[] = {
-   0,
-   "Self intersection error",
+   0,
+   "Self intersection error",
 };
 
-#define BMERR_TOTAL (sizeof(error_messages) / sizeof(void*) - 1)
-
 /*begin operator defines (see bmesh_opdefines.c too)*/
 /*split op*/
 #define BMOP_SPLIT 0

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
===
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
2009-01-22 12:34:52 UTC (rev 18621)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
2009-01-22 13:59:30 UTC (rev 18622)
@@ -2,7 +2,6 @@
 
 #include "BLI_memarena.h"
 #include "BLI_mempool.h"
-#include "BLI_blenlib.h"
 
 #include "BKE_utildefines.h"
 
@@ -32,46 +31,6 @@
sizeof(void*)   /* pointer buffer */
 };
 
-/*error system*/
-typedef struct bmop_error {
-   struct bmop_error *next, *prev;
-   int errorcode;
-   char *msg;
-} bmop_error;
-
-void BMOP_RaiseError(BMesh *bm, int errcode, char *msg)
-{
-   bmop_error *err = MEM_callocN(sizeof(bmop_error), "bmop_error");
-   e

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18621] branches/bmesh/blender/source/ blender/bmesh/intern: changed bmesh_api_set/getindex to be just macros, and shortened to bmesh_api_get/seti

2009-01-22 Thread Joseph Eagar
Revision: 18621
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18621
Author:   joeedh
Date: 2009-01-22 13:34:52 +0100 (Thu, 22 Jan 2009)

Log Message:
---
changed bmesh_api_set/getindex to be just macros, and shortened to 
bmesh_api_get/seti

Modified Paths:
--
branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c
branches/bmesh/blender/source/blender/bmesh/intern/bmesh_private.h

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c
===
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c 
2009-01-22 12:29:08 UTC (rev 18620)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c 
2009-01-22 12:34:52 UTC (rev 18621)
@@ -49,22 +49,6 @@
printf("BM modelling error!");
 }
 
-#ifndef bmesh_api_setindex
-/*NOTE: ensure different parts of the API do not conflict
-  on using this!*/
-void bmesh_api_setindex(BMesh *bm, BMHeader *head, int i)
-{
-   head->flags[bm->stackdepth-1].pflag = i;
-}
-#endif
-
-#ifndef bmesh_api_getindex
-int bmesh_api_getindex(BMesh *bm, BMHeader *head)
-{
-   return head->flags[bm->stackdepth-1].pflag;
-}
-#endif
-
 /*
  * BMESH SET SYSFLAG
  *

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_private.h
===
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_private.h  
2009-01-22 12:29:08 UTC (rev 18620)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_private.h  
2009-01-22 12:34:52 UTC (rev 18621)
@@ -59,16 +59,11 @@
 int bmesh_test_sysflag(struct BMHeader *element, int flag);
 
 /*NOTE: ensure different parts of the API do not conflict
-  on using this!*/
-/*used to access the index member of the current flag layer.
-  actual functions are only defined if the below macro versions
-  are not.*/
-void bmesh_api_setindex(BMesh *bm, BMHeader *head, int i);
-int bmesh_api_getindex(BMesh *bm, BMHeader *head);
+  on using this!  sets and gets the API index member 
+  of the current flag layer.*/
+#define bmesh_api_seti(bm, head, i) ((head)->flags[bm->stackdepth-1].pflag = i)
+#define bmesh_api_geti(bm, head) ((head)->flags[bm->stackdepth-1].pflag)
 
-#define bmesh_api_setindex(bm, head, i) ((head)->flags[bm->stackdepth-1].pflag 
= i)
-#define bmesh_api_getindex(bm, head) ((head)->flags[bm->stackdepth-1].pflag)
-
 /*Polygon Utilities ? FIXME... where do these each go?*/
 /*newedgeflag sets a flag layer flag, obviously not the header flag.*/
 void BM_Triangulate_Face(BMesh *bm, BMFace *f, float (*projectverts)[3], int 
newedgeflag, int newfaceflag);


___
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 [18620] branches/bmesh/blender/source/ blender/bmesh: added operator slot iterators

2009-01-22 Thread Joseph Eagar
Revision: 18620
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18620
Author:   joeedh
Date: 2009-01-22 13:29:08 +0100 (Thu, 22 Jan 2009)

Log Message:
---
added operator slot iterators

Modified Paths:
--
branches/bmesh/blender/source/blender/bmesh/bmesh.h
branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h
branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
branches/bmesh/blender/source/blender/bmesh/operators/dissolveops.c
branches/bmesh/blender/source/blender/bmesh/operators/subdivideop.c
branches/bmesh/blender/source/blender/bmesh/operators/triangulateop.c

Modified: branches/bmesh/blender/source/blender/bmesh/bmesh.h
===
--- branches/bmesh/blender/source/blender/bmesh/bmesh.h 2009-01-22 10:53:22 UTC 
(rev 18619)
+++ branches/bmesh/blender/source/blender/bmesh/bmesh.h 2009-01-22 12:29:08 UTC 
(rev 18620)
@@ -107,7 +107,7 @@
void *data;
 } BMNode;
 
-struct Scene;
+struct bmop_error;
 typedef struct BMesh {
ListBase verts, edges, polys;
struct BLI_mempool *vpool;
@@ -126,6 +126,7 @@
struct BLI_mempool *flagpool;   
/*memory pool for dynamically allocated flag layers*/
int stackdepth; 
/*current depth of operator stack*/
int totflags, walkers;  
/*total number of tool flag layers*/
+   ListBase errorstack; /*privately used by the operator error reporting 
system*/
 } BMesh;
 
 typedef struct BMVert {

Modified: branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h
===
--- branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h   
2009-01-22 10:53:22 UTC (rev 18619)
+++ branches/bmesh/blender/source/blender/bmesh/bmesh_operators.h   
2009-01-22 12:29:08 UTC (rev 18620)
@@ -30,6 +30,30 @@
} data;
 }BMOpSlot;
 
+/*these macros are used for iterating over slot buffers.
+  for example:
+  int i;
+
+  for (ptr=BMOS_IterNewP(i, slot); ptr; ptr=BMOS_IterStepP(i, slot)) {
+  }
+
+  int ival;
+  for (ival=BMOS_IterNewI(i, slot); !BMOS_IterDoneI(i, slot); 
ival=BMOS_IterStepI(i, slot) {
+  }
+*/
+/*remember, the ',' operator executes all expressions seperated by ','
+  (left to right) but uses the value of the right-most one.*/
+#define BMOS_IterNewP(stateint, slot)  (stateint = 0, slot->len>0 ? 
*(void**)slot->data.p : NULL)
+#define BMOS_IterStepP(stateint, slot) (stateint++,stateint>=slot->len ? NULL 
: ((void**)slot->data.buf)[stateint])
+
+#define BMOS_IterNewF(stateint, slot)  (stateint = 0, slot->len>0 ? 
*(float*)slot->data.p : NULL)
+#define BMOS_IterDoneF(stateint, slot) (stateint >= slot->len)
+#define BMOS_IterStepF(stateint, slot) (stateint++,stateint>=slot->len ? NULL 
: ((float*)slot->data.buf)[stateint])
+
+#define BMOS_IterNewI(stateint, slot)  (stateint = 0, slot->len>0 ? 
*(int*)slot->data.p : NULL)
+#define BMOS_IterDoneI(stateint, slot) (stateint >= slot->len)
+#define BMOS_IterStepI(stateint, slot) (stateint++,stateint>=slot->len ? NULL 
: ((int*)slot->data.buf)[stateint])
+
 /*operators represent logical, executable mesh modules.*/
 #define BMOP_MAX_SLOTS 16  /*way more than 
probably needed*/
 
@@ -73,6 +97,26 @@
 void BMO_Flag_Buffer(struct BMesh *bm, struct BMOperator *op, int slotcode, 
int flag);
 void BMO_HeaderFlag_To_Slot(struct BMesh *bm, struct BMOperator *op, int 
slotcode, int flag, int type);
 
+/*if msg is null, then the default message for the errorcode is used*/
+void BMOP_RaiseError(BMesh *bm, int errcode, char *msg);
+/*returns error code or 0 if no error*/
+int BMOP_GetError(BMesh *bm, char **msg);
+/*returns 1 if there was an error*/
+int BMOP_CheckError(BMesh *bm);
+int BMOP_PopError(BMesh *bm, char **msg);
+
+/*-- error code defines ---*/
+
+/*error messages*/
+#define BMERR_SELF_INTERSECTING1
+
+static char *bmop_error_messages[] = {
+   0,
+   "Self intersection error",
+};
+
+#define BMERR_TOTAL (sizeof(error_messages) / sizeof(void*) - 1)
+
 /*begin operator defines (see bmesh_opdefines.c too)*/
 /*split op*/
 #define BMOP_SPLIT 0

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
===
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
2009-01-22 10:53:22 UTC (rev 18619)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_operators.c
2009-01-22 12:29:08 UTC (rev 18620)
@@ -2,6 +2,7 @@
 
 #include "BLI_memarena.h"
 #include "BLI_mempool.h"
+#include "BLI_blenlib.h"
 
 #include "BKE_utildefines.h"
 
@@ -31,6 +32,46 @@
sizeof(void*)   /* point

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18619] branches/blender2.5/blender/source /blender: Animato - Basic version patching support

2009-01-22 Thread Joshua Leung
Revision: 18619
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18619
Author:   aligorith
Date: 2009-01-22 11:53:22 +0100 (Thu, 22 Jan 2009)

Log Message:
---
Animato - Basic version patching support

This is work-in-progress patching support for converting animation saved in old 
system to work in the new one. 

* Only IPOs/Actions directly attached to Objects + Shapekeys are converted for 
now. More types will follow...
* This is currently done as a step outside of do_versions() due to problems 
with various pointers not having been resolved yet, but which are necessary for 
correct resolution of issues such as drivers... However, the current code does 
illustrate how the data should be converted to give best results/compat between 
the two systems.
* Still need to get the converted data working with depsgraph correctly. 
Currently, some of my testfiles work, but the BBB files still don't.

Modified Paths:
--
branches/blender2.5/blender/source/blender/blenkernel/BKE_ipo.h
branches/blender2.5/blender/source/blender/blenkernel/SConscript
branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c
branches/blender2.5/blender/source/blender/blenkernel/intern/blender.c
branches/blender2.5/blender/source/blender/blenkernel/intern/depsgraph.c
branches/blender2.5/blender/source/blender/blenkernel/intern/fcurve.c
branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c
branches/blender2.5/blender/source/blender/blenkernel/intern/key.c
branches/blender2.5/blender/source/blender/blenkernel/intern/library.c
branches/blender2.5/blender/source/blender/blenkernel/intern/object.c
branches/blender2.5/blender/source/blender/blenloader/SConscript
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c

branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c

branches/blender2.5/blender/source/blender/editors/space_action/action_edit.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_pose.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/BKE_ipo.h
===
--- branches/blender2.5/blender/source/blender/blenkernel/BKE_ipo.h 
2009-01-22 07:06:25 UTC (rev 18618)
+++ branches/blender2.5/blender/source/blender/blenkernel/BKE_ipo.h 
2009-01-22 10:53:22 UTC (rev 18619)
@@ -24,7 +24,7 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s): 2008, Joshua Leung (Animation Cleanup)
+ * Contributor(s): 2008,2009  Joshua Leung (Animation Cleanup, Animation 
Systme Recode)
  *
  * * END GPL LICENSE BLOCK *
  */
@@ -35,128 +35,19 @@
 extern "C" {
 #endif
 
-   
-/*  IPO-Curve (Bezier) Calculations -- */
-
-// xxx perhaps this should be in curve api not in anim api
-void correct_bezpart(float *v1, float *v2, float *v3, float *v4);
-   
-
-// XXX this file will soon be depreceated...
-#if 0 // XXX old animation system
-
-typedef struct CfraElem {
-   struct CfraElem *next, *prev;
-   float cfra;
-   int sel;
-} CfraElem;
-
+struct Main;
 struct Ipo;
-struct IpoCurve;
-struct MTex;
-struct Material;
-struct Scene;
-struct Object;
-struct Sequence;
-struct ListBase;
-struct BezTriple;
-struct ID;
-struct bPoseChannel;
-struct bActionChannel;
-struct rctf;
 
-/*  Time Management  */
+void do_versions_ipo_to_animato(struct Main *main);
 
-float frame_to_float(struct Scene *scene, int cfra);
+/* - xxx stuff  */
 
-/*  IPO Management -- */
-
-void free_ipo_curve(struct IpoCurve *icu);
 void free_ipo(struct Ipo *ipo);
 
-void ipo_default_v2d_cur(struct Scene *scene, int blocktype, struct rctf *cur);
-
-struct Ipo *add_ipo(struct Scene *scene, char *name, int idcode);
-struct Ipo *copy_ipo(struct Ipo *ipo);
-
-void ipo_idnew(struct Ipo *ipo);
-
-struct IpoCurve *find_ipocurve(struct Ipo *ipo, int adrcode);
-short has_ipo_code(struct Ipo *ipo, int code);
-
-/* -- Make Local -- */
-
-void make_local_obipo(struct Ipo *ipo);
-void make_local_matipo(struct Ipo *ipo);
-void make_local_keyipo(struct Ipo *ipo);
-void make_local_ipo(struct Ipo *ipo);
-
-/*  IPO-Curve Sanity  */
-
-void calchandles_ipocurve(struct IpoCurve *icu);
-void testhandles_ipocurve(struct IpoCurve *icu);
-void sort_time_ipocurve(struct IpoCurve *icu);
-int test_time_ipocurve(struct IpoCurve *icu);
-
-void set_interpolation_ipocurve(struct IpoCurve *icu, short ipo);
-
-/*  IPO-Curve (Bezier) Calculations -- */
-
+// xxx perhaps this should be in curve api not in anim api
 void correct_bezpart(float *v1, float *v2, float *v3, float *v4);
-int findzero(float x, float q0, float q1, float q2, float q3, float *o);
-void berekeny(float f1, float f2, float f3, float f4, float *o, int b);
-