Cleanup: style
This commit is contained in:
parent
05588f909a
commit
26ed545276
|
@ -472,17 +472,19 @@ static void eevee_lightbake_create_resources(EEVEE_LightBake *lbake)
|
|||
lbake->lcache = eevee->light_cache;
|
||||
|
||||
/* TODO validate irradiance and reflection cache independently... */
|
||||
if (!EEVEE_lightcache_validate(lbake->lcache, lbake->cube_len, lbake->ref_cube_res, lbake->grid_len, lbake->irr_size))
|
||||
if (!EEVEE_lightcache_validate(
|
||||
lbake->lcache, lbake->cube_len, lbake->ref_cube_res, lbake->grid_len, lbake->irr_size))
|
||||
{
|
||||
eevee->light_cache = lbake->lcache = NULL;
|
||||
}
|
||||
|
||||
if (lbake->lcache == NULL) {
|
||||
lbake->lcache = EEVEE_lightcache_create(lbake->grid_len,
|
||||
lbake->cube_len,
|
||||
lbake->ref_cube_res,
|
||||
lbake->vis_res,
|
||||
lbake->irr_size);
|
||||
lbake->lcache = EEVEE_lightcache_create(
|
||||
lbake->grid_len,
|
||||
lbake->cube_len,
|
||||
lbake->ref_cube_res,
|
||||
lbake->vis_res,
|
||||
lbake->irr_size);
|
||||
lbake->lcache->flag = LIGHTCACHE_UPDATE_WORLD | LIGHTCACHE_UPDATE_CUBE | LIGHTCACHE_UPDATE_GRID;
|
||||
lbake->lcache->vis_res = lbake->vis_res;
|
||||
lbake->own_light_cache = true;
|
||||
|
|
|
@ -691,7 +691,7 @@ static void sample_ball(int sample_ofs, float radius, float rsample[3])
|
|||
|
||||
rsample[2] = ht_point[0] * 2.0f - 1.0f; /* cos theta */
|
||||
|
||||
float r = sqrtf(fmaxf(0.0f, 1.0f - rsample[2]*rsample[2])); /* sin theta */
|
||||
float r = sqrtf(fmaxf(0.0f, 1.0f - rsample[2] * rsample[2])); /* sin theta */
|
||||
|
||||
rsample[0] = r * cosf(omega);
|
||||
rsample[1] = r * sinf(omega);
|
||||
|
@ -742,7 +742,7 @@ static void sample_ellipse(
|
|||
|
||||
|
||||
static void shadow_cube_random_position_set(
|
||||
EEVEE_Light *evli, Lamp *la,
|
||||
EEVEE_Light *evli, Lamp *la,
|
||||
int sample_ofs,
|
||||
float ws_sample_pos[3])
|
||||
{
|
||||
|
|
|
@ -291,11 +291,11 @@ static int lattice_select_more_less(bContext *C, const bool select)
|
|||
for (u = 0; u < lt->pntsu; u++) {
|
||||
if ((bp->hide == 0) && (((bp->f1 & SELECT) == 0) == select)) {
|
||||
if (lattice_test_bitmap_uvw(lt, selpoints, u + 1, v, w, select) ||
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u - 1, v, w, select) ||
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u, v + 1, w, select) ||
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u, v - 1, w, select) ||
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u, v, w + 1, select) ||
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u, v, w - 1, select))
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u - 1, v, w, select) ||
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u, v + 1, w, select) ||
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u, v - 1, w, select) ||
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u, v, w + 1, select) ||
|
||||
lattice_test_bitmap_uvw(lt, selpoints, u, v, w - 1, select))
|
||||
{
|
||||
SET_FLAG_FROM_TEST(bp->f1, select, SELECT);
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ struct GHash;
|
|||
|
||||
bool is_stroke_affected_by_modifier(
|
||||
struct Object *ob, char *mlayername, int mpassindex,
|
||||
int gpl_passindex, int minpoints,
|
||||
int gpl_passindex, int minpoints,
|
||||
bGPDlayer *gpl, bGPDstroke *gps,
|
||||
bool inv1, bool inv2, bool inv3);
|
||||
bool inv1, bool inv2, bool inv3);
|
||||
|
||||
float get_modifier_point_weight(struct MDeformVert *dvert, bool inverse, int def_nr);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/** \file blender/gpencil_modifiers/intern/MOD_gpencilinstance.c
|
||||
/** \file blender/gpencil_modifiers/intern/MOD_gpencilarray.c
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
|
@ -61,10 +61,6 @@
|
|||
#include "MOD_gpencil_util.h"
|
||||
#include "MOD_gpencil_modifiertypes.h"
|
||||
|
||||
#include "DEG_depsgraph.h"
|
||||
#include "DEG_depsgraph_build.h"
|
||||
#include "DEG_depsgraph_query.h"
|
||||
|
||||
static void initData(GpencilModifierData *md)
|
||||
{
|
||||
ArrayGpencilModifierData *gpmd = (ArrayGpencilModifierData *)md;
|
||||
|
@ -177,10 +173,11 @@ static void generate_geometry(
|
|||
/* Record whether this stroke can be used
|
||||
* ATTENTION: The logic here is the inverse of what's used everywhere else!
|
||||
*/
|
||||
if (is_stroke_affected_by_modifier(ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 1, gpl, gps,
|
||||
mmd->flag & GP_ARRAY_INVERT_LAYER, mmd->flag & GP_ARRAY_INVERT_PASS,
|
||||
mmd->flag & GP_ARRAY_INVERT_LAYERPASS))
|
||||
if (is_stroke_affected_by_modifier(
|
||||
ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 1, gpl, gps,
|
||||
mmd->flag & GP_ARRAY_INVERT_LAYER, mmd->flag & GP_ARRAY_INVERT_PASS,
|
||||
mmd->flag & GP_ARRAY_INVERT_LAYERPASS))
|
||||
{
|
||||
valid_strokes[idx] = true;
|
||||
num_valid++;
|
||||
|
|
|
@ -77,10 +77,11 @@ static void deformStroke(
|
|||
ColorGpencilModifierData *mmd = (ColorGpencilModifierData *)md;
|
||||
float hsv[3], factor[3];
|
||||
|
||||
if (!is_stroke_affected_by_modifier(ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 1, gpl, gps,
|
||||
mmd->flag & GP_COLOR_INVERT_LAYER, mmd->flag & GP_COLOR_INVERT_PASS,
|
||||
mmd->flag & GP_COLOR_INVERT_LAYERPASS))
|
||||
if (!is_stroke_affected_by_modifier(
|
||||
ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 1, gpl, gps,
|
||||
mmd->flag & GP_COLOR_INVERT_LAYER, mmd->flag & GP_COLOR_INVERT_PASS,
|
||||
mmd->flag & GP_COLOR_INVERT_LAYERPASS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -208,10 +208,11 @@ static void deformStroke(
|
|||
float dmat[4][4];
|
||||
struct GPHookData_cb tData;
|
||||
|
||||
if (!is_stroke_affected_by_modifier(ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 3, gpl, gps,
|
||||
mmd->flag & GP_HOOK_INVERT_LAYER, mmd->flag & GP_HOOK_INVERT_PASS,
|
||||
mmd->flag & GP_HOOK_INVERT_LAYERPASS))
|
||||
if (!is_stroke_affected_by_modifier(
|
||||
ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 3, gpl, gps,
|
||||
mmd->flag & GP_HOOK_INVERT_LAYER, mmd->flag & GP_HOOK_INVERT_PASS,
|
||||
mmd->flag & GP_HOOK_INVERT_LAYERPASS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -81,10 +81,11 @@ static void deformStroke(
|
|||
LatticeGpencilModifierData *mmd = (LatticeGpencilModifierData *)md;
|
||||
const int def_nr = defgroup_name_index(ob, mmd->vgname);
|
||||
|
||||
if (!is_stroke_affected_by_modifier(ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 3, gpl, gps,
|
||||
mmd->flag & GP_LATTICE_INVERT_LAYER, mmd->flag & GP_LATTICE_INVERT_PASS,
|
||||
mmd->flag & GP_LATTICE_INVERT_LAYERPASS))
|
||||
if (!is_stroke_affected_by_modifier(
|
||||
ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 3, gpl, gps,
|
||||
mmd->flag & GP_LATTICE_INVERT_LAYER, mmd->flag & GP_LATTICE_INVERT_PASS,
|
||||
mmd->flag & GP_LATTICE_INVERT_LAYERPASS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -125,10 +125,10 @@ static void generateStrokes(
|
|||
for (i = 0, gps = gpf->strokes.first; i < tot_strokes; i++, gps = gps->next) {
|
||||
if (is_stroke_affected_by_modifier(
|
||||
ob, mmd->layername, mmd->pass_index, mmd->layer_pass,
|
||||
1, gpl, gps,
|
||||
1, gpl, gps,
|
||||
mmd->flag & GP_MIRROR_INVERT_LAYER,
|
||||
mmd->flag & GP_MIRROR_INVERT_PASS,
|
||||
mmd->flag & GP_MIRROR_INVERT_LAYERPASS))
|
||||
mmd->flag & GP_MIRROR_INVERT_PASS,
|
||||
mmd->flag & GP_MIRROR_INVERT_LAYERPASS))
|
||||
{
|
||||
gps_new = BKE_gpencil_stroke_duplicate(gps);
|
||||
update_position(ob, mmd, gps_new, xi);
|
||||
|
|
|
@ -116,10 +116,11 @@ static void deformStroke(
|
|||
mmd->rng = BLI_rng_new(rng_seed);
|
||||
}
|
||||
|
||||
if (!is_stroke_affected_by_modifier(ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 3, gpl, gps,
|
||||
mmd->flag & GP_NOISE_INVERT_LAYER, mmd->flag & GP_NOISE_INVERT_PASS,
|
||||
mmd->flag & GP_NOISE_INVERT_LAYERPASS))
|
||||
if (!is_stroke_affected_by_modifier(
|
||||
ob,
|
||||
mmd->layername, mmd->pass_index, mmd->layer_pass, 3, gpl, gps,
|
||||
mmd->flag & GP_NOISE_INVERT_LAYER, mmd->flag & GP_NOISE_INVERT_PASS,
|
||||
mmd->flag & GP_NOISE_INVERT_LAYERPASS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue