[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32716] branches/bmesh/blender/source: commit of wip copy to work on other comuter
Joseph Eagar
joeedh at gmail.com
Tue Oct 26 21:13:17 CEST 2010
Revision: 32716
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32716
Author: joeedh
Date: 2010-10-26 21:13:17 +0200 (Tue, 26 Oct 2010)
Log Message:
-----------
commit of wip copy to work on other comuter
Modified Paths:
--------------
branches/bmesh/blender/source/blender/blenkernel/BKE_context.h
branches/bmesh/blender/source/blender/blenkernel/intern/context.c
branches/bmesh/blender/source/blender/bmesh/operators/createops.c
branches/bmesh/blender/source/blender/windowmanager/intern/wm_event_system.c
branches/bmesh/blender/source/creator/creator.c
Modified: branches/bmesh/blender/source/blender/blenkernel/BKE_context.h
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/BKE_context.h 2010-10-26 16:55:38 UTC (rev 32715)
+++ branches/bmesh/blender/source/blender/blenkernel/BKE_context.h 2010-10-26 19:13:17 UTC (rev 32716)
@@ -261,6 +261,16 @@
int CTX_data_selected_pose_bones(const bContext *C, ListBase *list);
int CTX_data_visible_pose_bones(const bContext *C, ListBase *list);
+#ifdef EVENT_RECORDER
+#include <stdio.h>
+
+int CTX_rec_events(bContext *C);
+FILE *CTX_rec_file(bContext *C);
+int CTX_set_events_path(bContext *C, char *path);
+int CTX_play_events(bContext *C, char **playpath);
+
+#endif
+
#ifdef __cplusplus
}
#endif
Modified: branches/bmesh/blender/source/blender/blenkernel/intern/context.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/context.c 2010-10-26 16:55:38 UTC (rev 32715)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/context.c 2010-10-26 19:13:17 UTC (rev 32716)
@@ -80,6 +80,11 @@
struct {
int render;
} eval;
+
+#ifdef EVENT_RECORDER
+ int evtrec, evtplay;
+ char evtplaypath[300];
+#endif
};
/* context */
@@ -100,6 +105,34 @@
return newC;
}
+#ifdef EVENT_RECORDER
+int CTX_rec_events(bContext *C)
+{
+ return C->evtrec;
+}
+
+FILE *CTX_rec_file(bContext *C)
+{
+ static FILE *f = NULL;
+ if (!f)
+ f = fopen("eventlog.txt", "wb");
+ return f;
+}
+
+int CTX_set_events_path(bContext *C, char *path)
+{
+ if (!path)
+ C->evtplaypath[0] = 0;
+}
+
+int CTX_play_events(bContext *C, char **playpath)
+{
+ *playpath = C->evtplaypath[0] ? C->evtplaypath : NULL;
+
+ return C->evtplaypath[0];
+}
+#endif
+
void CTX_free(bContext *C)
{
MEM_freeN(C);
Modified: branches/bmesh/blender/source/blender/bmesh/operators/createops.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/operators/createops.c 2010-10-26 16:55:38 UTC (rev 32715)
+++ branches/bmesh/blender/source/blender/bmesh/operators/createops.c 2010-10-26 19:13:17 UTC (rev 32716)
@@ -397,6 +397,8 @@
copy_v3_v3(vdata[BMINDEX_GET(v2)].sco, vec1);
}
+ BLI_srandom(0);
+
/*first, ensure no 0 or 180 angles between adjacent
(and that adjacent's adjacent) edges*/
for (i=0, k=0; i<totedge; i++) {
@@ -451,7 +453,7 @@
}
copy_v3_v3(vdata[BMINDEX_GET(v)].offco, cent);
- copy_v3_v3(v->co, cent);
+ //copy_v3_v3(v->co, cent);
/*now, sort edges so the triangle fan of all edges
has a consistent normal. this is the same as
Modified: branches/bmesh/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- branches/bmesh/blender/source/blender/windowmanager/intern/wm_event_system.c 2010-10-26 16:55:38 UTC (rev 32715)
+++ branches/bmesh/blender/source/blender/windowmanager/intern/wm_event_system.c 2010-10-26 19:13:17 UTC (rev 32716)
@@ -1585,6 +1585,11 @@
wmWindowManager *wm= CTX_wm_manager(C);
wmWindow *win;
+#ifdef EVENT_RECORDER
+ FILE *file = NULL;
+ char *fpath = NULL;
+#endif
+
for(win= wm->windows.first; win; win= win->next) {
wmEvent *event;
@@ -1621,9 +1626,44 @@
}
}
+ #ifdef EVENT_RECORDER
+ if (CTX_play_events(C, &fpath) && fpath) {
+ wmEvent evt;
+
+ file = fopen(fpath, "rb");
+ while (!feof(file)) {
+ char buf1[6];
+ fread(buf1, sizeof(*buf1), 1, file);
+ buf1[5] = 0;
+ if (!strcasecmp(buf1, "event")) {
+ fprintf(stderr, "EEK! bad event playback file!!");
+ break;
+ }
+
+ fread(&evt, sizeof(*event), 1, file);
+
+ wm_event_add(win, &evt);
+ }
+
+ fclose(file);
+ CTX_set_events_path(C, NULL);
+ }
+ #endif
+
while( (event= win->queue.first) ) {
int action = WM_HANDLER_CONTINUE;
-
+
+ #ifdef EVENT_RECORDER
+ if (CTX_rec_events(C) && !CTX_play_events(C, NULL)) {
+ FILE *file = CTX_rec_file(C);
+
+ fwrite(event, sizeof(*event), 1, file);
+ fprintf(file, "event");
+ fflush(event);
+ }
+
+ #endif
+
if((G.f & G_DEBUG) && event && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE))
printf("pass on evt %d val %d\n", event->type, event->val);
Modified: branches/bmesh/blender/source/creator/creator.c
===================================================================
--- branches/bmesh/blender/source/creator/creator.c 2010-10-26 16:55:38 UTC (rev 32715)
+++ branches/bmesh/blender/source/creator/creator.c 2010-10-26 19:13:17 UTC (rev 32716)
@@ -235,7 +235,9 @@
printf ("Misc Options:\n");
BLI_argsPrintArgDoc(ba, "--debug");
BLI_argsPrintArgDoc(ba, "--debug-fpe");
-
+#ifdef EVENT_RECORDER
+ BLI_argsPrintArgDoc(ba, "--runmacro");
+#endif
printf("\n");
BLI_argsPrintArgDoc(ba, "-nojoystick");
@@ -798,6 +800,18 @@
}
}
+#ifdef EVENT_RECORDER
+static int set_macro_playback(int argc, char **argv, void *data)
+{
+ bContext *C = data;
+
+ if (argc < 2)
+ return;
+
+ CTX_set_events_path(C, argv[1]);
+}
+#endif
+
static int set_end_frame(int argc, char **argv, void *data)
{
bContext *C = data;
@@ -983,6 +997,10 @@
/* end argument processing after -- */
BLI_argsAdd(ba, -1, "--", NULL, "\n\tEnds option processing, following arguments passed unchanged. Access via python's sys.argv", end_arguments, NULL);
BLI_argsAdd(ba, 1, "--no_crash_handler", NULL, "disable crash handler", nocrashhandler, NULL);
+
+#ifdef EVENT_RECORDER
+ BLI_argsAdd(ba, 1, "--eventmacro", NULL, "<file>\n\tevent macro", set_macro_playback, NULL);
+#endif
/* first pass: background mode, disable python and commands that exit after usage */
BLI_argsAdd(ba, 1, "-h", "--help", "\n\tPrint this help text and exit", print_help, ba);
More information about the Bf-blender-cvs
mailing list