Added 'Object Location' option to 'object vertices' mode in Point

Density. This brings it consistent with the 'particle system' 
mode, and allows silly things like this a bit easier (especially 
after the last fix and BVH improvements!):

http://mke3.net/blender/devel/rendering/volumetrics/pd_objectloc.mov
This commit is contained in:
Matt Ebb
2008-10-01 07:30:56 +00:00
parent 25236b56a6
commit 2745517ecd
2 changed files with 5 additions and 3 deletions

View File

@@ -120,13 +120,15 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, ObjectRen *o
VertRen *ver= RE_findOrAddVert(obr, i);
VECCOPY(ver_co, ver->co);
Mat4MulVecfl(re->viewinv, ver_co);
if (pd->ob_cache_space == TEX_PD_OBJECTSPACE) {
Mat4MulVecfl(re->viewinv, ver_co);
Mat4MulVecfl(obr->ob->imat, ver_co);
} else if (pd->psys_cache_space == TEX_PD_OBJECTLOC) {
VecSubf(ver_co, ver_co, obr->ob->loc);
} else {
/* TEX_PD_WORLDSPACE */
Mat4MulVecfl(re->viewinv, ver_co);
}
BLI_bvhtree_insert(pd->point_tree, i, ver_co, 1);

View File

@@ -797,7 +797,7 @@ static void texture_panel_pointdensity(Tex *tex)
uiDefBut(block, LABEL, B_NOP, "Cache vertices in:",
X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, "");
uiDefButS(block, MENU, B_TEXREDR_PRV, "Object Space %x1|Global Space %x2",
uiDefButS(block, MENU, B_TEXREDR_PRV, "Object Location %x0|Object Space %x1|Global Space %x2",
X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->ob_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache vertices in");
}
}