diff options
Diffstat (limited to 'source/blender/blenkernel/intern/implicit.c')
-rw-r--r-- | source/blender/blenkernel/intern/implicit.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index f56b94c97ce..72edef1766b 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -110,6 +110,10 @@ double itval() return t2-t1; } #endif + +/* callbacks for errors and interrupts and some goo */ +static int (*CT_localInterruptCallBack)(void) = NULL; + /* #define C99 #ifdef C99 @@ -1525,6 +1529,10 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase step += dt; if(effectors) pdEndEffectors(effectors); + + /* ask for user break */ + if (CT_localInterruptCallBack && CT_localInterruptCallBack()) + return 0; } for(i = 0; i < numverts; i++) @@ -1569,3 +1577,9 @@ void implicit_set_positions (ClothModifierData *clmd) if(G.rt > 0) printf("implicit_set_positions\n"); } + +/* Cloth global visible functions */ +void clmdSetInterruptCallBack(int (*f)(void)) +{ + CT_localInterruptCallBack = f; +} |