Paint/Sculpt:
More minor cleanups: fixed names and factored out a function that was copy-pasted into paint stroke.
This commit is contained in:
@@ -35,6 +35,23 @@
|
||||
|
||||
#include "paint_intern.h"
|
||||
|
||||
float paint_calc_object_space_radius(ViewContext *vc, float center[3],
|
||||
float pixel_radius)
|
||||
{
|
||||
Object *ob = vc->obact;
|
||||
float delta[3], scale, loc[3];
|
||||
|
||||
mul_v3_m4v3(loc, ob->obmat, center);
|
||||
|
||||
initgrabz(vc->rv3d, loc[0], loc[1], loc[2]);
|
||||
window_to_3d_delta(vc->ar, delta, pixel_radius, 0);
|
||||
|
||||
scale= fabsf(mat4_to_scale(ob->obmat));
|
||||
scale= (scale == 0.0f)? 1.0f: scale;
|
||||
|
||||
return len_v3(delta)/scale;
|
||||
}
|
||||
|
||||
float paint_get_tex_pixel(Brush* br, float u, float v)
|
||||
{
|
||||
TexResult texres;
|
||||
|
||||
Reference in New Issue
Block a user