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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-07 22:11:37 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-07 22:11:37 +0300
commit4ca2581b77112c488938f0a2dc226042e0390b71 (patch)
tree03c0457506781c244182dd4b73d6c4dbfbca658e /source/blender/blenkernel/intern/customdata.c
parent010c99deb271c629742e32f5e7922d357cafc9f3 (diff)
Sculpt Branch:
* Don't allow adding/removing multires levels in editmode. * Customdata code for swapping mdisps restored. * Fix inflate brush crashing with multires. * Smooth and layer brush don't work yet with multires, but at least avoids crashing now. * Fix threading issue with flatten brush.
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 8f167310741..f9997708a50 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -440,29 +440,30 @@ static void mdisps_bilinear(float out[3], float (*disps)[3], int st, float u, fl
}
#endif
+static int mdisp_corners(MDisps *s)
+{
+ /* silly trick because we don't get it from callback */
+ return (s->totdisp % (3*3) == 0)? 3: 4;
+}
+
static void layerSwap_mdisps(void *data, int *ci)
{
- // XXX
-#if 0
MDisps *s = data;
float (*d)[3] = NULL;
- int x, y, st;
+ int corners, cornersize, S;
- if(!(ci[0] == 2 && ci[1] == 3 && ci[2] == 0 && ci[3] == 1)) return;
+ /* this function is untested .. */
+ corners = mdisp_corners(s);
+ cornersize = s->totdisp/corners;
d = MEM_callocN(sizeof(float) * 3 * s->totdisp, "mdisps swap");
- st = sqrt(s->totdisp);
- for(y = 0; y < st; ++y) {
- for(x = 0; x < st; ++x) {
- copy_v3_v3(d[(st - y - 1) * st + (st - x - 1)], s->disps[y * st + x]);
- }
- }
+ for(S = 0; S < corners; S++)
+ memcpy(d + cornersize*S, s->disps + cornersize*ci[S], cornersize*3*sizeof(float));
if(s->disps)
MEM_freeN(s->disps);
s->disps = d;
-#endif
}
static void layerInterp_mdisps(void **sources, float *weights, float *sub_weights,