From 715ca7cbf6d4b6b26a3ecf65de24bda64b1f1709 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 13 Aug 2008 20:33:57 +0000 Subject: starting threading code for retarget nothing working yet, will finish tomorrow at home --- source/blender/src/autoarmature.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/blender/src/autoarmature.c b/source/blender/src/autoarmature.c index e7cd771b1b1..e6bd97f58a5 100644 --- a/source/blender/src/autoarmature.c +++ b/source/blender/src/autoarmature.c @@ -52,6 +52,7 @@ #include "BLI_ghash.h" #include "BLI_graph.h" #include "BLI_rand.h" +#include "BLI_threads.h" #include "BDR_editobject.h" @@ -92,6 +93,7 @@ typedef struct RigGraph { ReebGraph *link_mesh; ListBase controls; + ListBase threads; GHash *bones_map; @@ -149,6 +151,11 @@ typedef struct RigControl { int flag; } RigControl; +typedef struct RetargetParam { + RigGraph *rigg; + RigArc *iarc; +} RetargetParam; + typedef enum { RETARGET_LENGTH, @@ -163,6 +170,8 @@ typedef enum /*******************************************************************************************************/ +void *exec_retargetArctoArc(void *param); + static void RIG_calculateEdgeAngle(RigEdge *edge_first, RigEdge *edge_second); /* two levels */ @@ -249,6 +258,8 @@ static RigGraph *newRigGraph() rg->free_arc = RIG_freeRigArc; rg->free_node = NULL; + BLI_init_threads(&rg->threads, exec_retargetArctoArc, 2); /* fix number of threads */ + return rg; } @@ -1551,6 +1562,19 @@ static void retargetArctoArc(RigGraph *rigg, RigArc *iarc) } } +void *exec_retargetArctoArc(void *param) +{ + RetargetParam *p = (RetargetParam*)param; + retargetArctoArc(p->rigg, p->iarc); + MEM_freeN(param); + + return NULL; +} + +void thread_retargetArctoArc(RigGraph *rigg, RigArc *iarc) +{ +} + static void matchMultiResolutionNode(RigNode *inode, ReebNode *top_node) { ReebNode *enode; -- cgit v1.2.3