Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-08-19 13:05:34 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-08-19 13:05:34 +0400
commitbeffaa293ee2b111f256b989bd038460bde1eea0 (patch)
tree9dbb83497da3cc5ed65d902666d094729c50f21e /source/blender/editors/util
parenta14febc70a0f8cb1ec8082600104a6629b0a20ee (diff)
Made modifiers_getVirtualModifierList safe for threading
Move static variables to context filling in by this fcuntion and owned by a callee function. This ensures no conflicts between threads happens because of static variables used in this function. Also moved modifier types and virtual modifiers data to a function called from creator. This is needed to be sure all the information is properly initialied to the time when threads starts to use this data. -- svn merge -r57899:57900 ^/branches/soc-2013-depsgraph_mt
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r--source/blender/editors/util/crazyspace.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c
index bed8aaaddf2..721a7a3b855 100644
--- a/source/blender/editors/util/crazyspace.c
+++ b/source/blender/editors/util/crazyspace.c
@@ -260,11 +260,12 @@ int editbmesh_get_first_deform_matrices(Scene *scene, Object *ob, BMEditMesh *em
int i, a, numleft = 0, numVerts = 0;
int cageIndex = modifiers_getCageIndex(scene, ob, NULL, 1);
float (*defmats)[3][3] = NULL, (*deformedVerts)[3] = NULL;
+ VirtualModifierData virtualModifierData;
modifiers_clearErrors(ob);
dm = NULL;
- md = modifiers_getVirtualModifierList(ob);
+ md = modifiers_getVirtualModifierList(ob, &virtualModifierData);
/* compute the deformation matrices and coordinates for the first
* modifiers with on cage editing that are enabled and support computing
@@ -314,6 +315,7 @@ int sculpt_get_first_deform_matrices(Scene *scene, Object *ob, float (**deformma
MultiresModifierData *mmd = get_multires_modifier(scene, ob, 0);
int has_multires = mmd != NULL && mmd->sculptlvl > 0;
int numleft = 0;
+ VirtualModifierData virtualModifierData;
if (has_multires) {
*deformmats = NULL;
@@ -322,7 +324,7 @@ int sculpt_get_first_deform_matrices(Scene *scene, Object *ob, float (**deformma
}
dm = NULL;
- md = modifiers_getVirtualModifierList(ob);
+ md = modifiers_getVirtualModifierList(ob, &virtualModifierData);
for (; md; md = md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
@@ -375,7 +377,8 @@ void crazyspace_build_sculpt(Scene *scene, Object *ob, float (**deformmats)[3][3
float (*origVerts)[3] = MEM_dupallocN(deformedVerts);
float *quats = NULL;
int i, deformed = 0;
- ModifierData *md = modifiers_getVirtualModifierList(ob);
+ VirtualModifierData virtualModifierData;
+ ModifierData *md = modifiers_getVirtualModifierList(ob, &virtualModifierData);
Mesh *me = (Mesh *)ob->data;
for (; md; md = md->next) {