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:
authorDalai Felinto <dfelinto@gmail.com>2017-11-23 18:51:49 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-11-23 19:58:01 +0300
commitb79b8478ee3bb1b115c5d6b8bdb0cc74d5169955 (patch)
treed67b529dc95488186255631660d3251cfb5da5da /source/blender/editors/physics
parent2f9df08aa8eaad1127f1b44aed518e1beaf91df7 (diff)
Cleanup: Rename ViewLayer *sl > ViewLayer *view_layer
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r--source/blender/editors/physics/dynamicpaint_ops.c4
-rw-r--r--source/blender/editors/physics/particle_edit.c180
-rw-r--r--source/blender/editors/physics/particle_object.c46
-rw-r--r--source/blender/editors/physics/physics_fluid.c16
-rw-r--r--source/blender/editors/physics/rigidbody_constraint.c8
5 files changed, 127 insertions, 127 deletions
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index 79162955480..e068b898345 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -460,7 +460,7 @@ static int dynamicpaint_bake_exec(struct bContext *C, struct wmOperator *op)
DynamicPaintCanvasSettings *canvas;
Object *ob = ED_object_context(C);
Scene *scene = CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
EvaluationContext *eval_ctx = MEM_mallocN(sizeof(*eval_ctx), "EvaluationContext");
CTX_data_eval_ctx(C, eval_ctx);
@@ -491,7 +491,7 @@ static int dynamicpaint_bake_exec(struct bContext *C, struct wmOperator *op)
DynamicPaintBakeJob *job = MEM_mallocN(sizeof(DynamicPaintBakeJob), "DynamicPaintBakeJob");
job->bmain = CTX_data_main(C);
job->scene = scene;
- job->view_layer = sl;
+ job->view_layer = view_layer;
job->depsgraph = CTX_data_depsgraph(C);
job->ob = ob;
job->canvas = canvas;
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 0ed360405d8..53bc289d378 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -87,7 +87,7 @@
#include "physics_intern.h"
void PE_create_particle_edit(
- const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, Object *ob,
+ const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer, Object *ob,
PointCache *cache, ParticleSystem *psys);
void PTCacheUndo_clear(PTCacheEdit *edit);
void recalc_lengths(PTCacheEdit *edit);
@@ -114,26 +114,26 @@ void update_world_cos(Object *ob, PTCacheEdit *edit);
int PE_poll(bContext *C)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
- if (!scene || !sl || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT))
+ if (!scene || !view_layer || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT))
return 0;
- return (PE_get_current(scene, sl, ob) != NULL);
+ return (PE_get_current(scene, view_layer, ob) != NULL);
}
int PE_hair_poll(bContext *C)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
PTCacheEdit *edit;
if (!scene || !ob || !(ob->mode & OB_MODE_PARTICLE_EDIT))
return 0;
- edit= PE_get_current(scene, sl, ob);
+ edit= PE_get_current(scene, view_layer, ob);
return (edit && edit->psys);
}
@@ -219,7 +219,7 @@ static float pe_brush_size_get(const Scene *UNUSED(scene), ParticleBrushData *br
* note: this function runs on poll, therefor it can runs many times a second
* keep it fast! */
static PTCacheEdit *pe_get_current(
- const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, Object *ob, int create)
+ const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer, Object *ob, int create)
{
ParticleEditSettings *pset= PE_settings(scene);
PTCacheEdit *edit = NULL;
@@ -230,7 +230,7 @@ static PTCacheEdit *pe_get_current(
return NULL;
pset->scene = scene;
- pset->view_layer = sl;
+ pset->view_layer = view_layer;
pset->object = ob;
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
@@ -259,18 +259,18 @@ static PTCacheEdit *pe_get_current(
if (psys->part && psys->part->type == PART_HAIR) {
if (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED) {
if (create && !psys->pointcache->edit)
- PE_create_particle_edit(eval_ctx, scene, sl, ob, pid->cache, NULL);
+ PE_create_particle_edit(eval_ctx, scene, view_layer, ob, pid->cache, NULL);
edit = pid->cache->edit;
}
else {
if (create && !psys->edit && psys->flag & PSYS_HAIR_DONE)
- PE_create_particle_edit(eval_ctx, scene, sl, ob, NULL, psys);
+ PE_create_particle_edit(eval_ctx, scene, view_layer, ob, NULL, psys);
edit = psys->edit;
}
}
else {
if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
- PE_create_particle_edit(eval_ctx, scene, sl, ob, pid->cache, psys);
+ PE_create_particle_edit(eval_ctx, scene, view_layer, ob, pid->cache, psys);
edit = pid->cache->edit;
}
@@ -281,7 +281,7 @@ static PTCacheEdit *pe_get_current(
if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) {
pset->flag |= PE_FADE_TIME;
// NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB;
- PE_create_particle_edit(eval_ctx, scene, sl, ob, pid->cache, NULL);
+ PE_create_particle_edit(eval_ctx, scene, view_layer, ob, pid->cache, NULL);
}
edit = pid->cache->edit;
break;
@@ -290,7 +290,7 @@ static PTCacheEdit *pe_get_current(
if (create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) {
pset->flag |= PE_FADE_TIME;
// NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB;
- PE_create_particle_edit(eval_ctx, scene, sl, ob, pid->cache, NULL);
+ PE_create_particle_edit(eval_ctx, scene, view_layer, ob, pid->cache, NULL);
}
edit = pid->cache->edit;
break;
@@ -305,9 +305,9 @@ static PTCacheEdit *pe_get_current(
return edit;
}
-PTCacheEdit *PE_get_current(Scene *scene, ViewLayer *sl, Object *ob)
+PTCacheEdit *PE_get_current(Scene *scene, ViewLayer *view_layer, Object *ob)
{
- return pe_get_current(NULL, scene, sl, ob, 0);
+ return pe_get_current(NULL, scene, view_layer, ob, 0);
}
PTCacheEdit *PE_create_current(const EvaluationContext *eval_ctx, Scene *scene, Object *ob)
@@ -1163,9 +1163,9 @@ void recalc_emitter_field(Object *ob, ParticleSystem *psys)
BLI_kdtree_balance(edit->emitter_field);
}
-static void PE_update_selection(const bContext *C, Scene *scene, ViewLayer *sl, Object *ob, int useflag)
+static void PE_update_selection(const bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, int useflag)
{
- PTCacheEdit *edit = PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit = PE_get_current(scene, view_layer, ob);
HairKey *hkey;
EvaluationContext eval_ctx;
POINT_P; KEY_K;
@@ -1273,12 +1273,12 @@ static void update_velocities(PTCacheEdit *edit)
}
}
-void PE_update_object(const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, Object *ob, int useflag)
+void PE_update_object(const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer, Object *ob, int useflag)
{
/* use this to do partial particle updates, not usable when adding or
* removing, then a full redo is necessary and calling this may crash */
ParticleEditSettings *pset= PE_settings(scene);
- PTCacheEdit *edit = PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit = PE_get_current(scene, view_layer, ob);
POINT_P;
if (!edit)
@@ -1413,9 +1413,9 @@ static void select_action_apply(PTCacheEditPoint *point, PTCacheEditKey *key, in
static int pe_select_all_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
POINT_P; KEY_K;
int action = RNA_enum_get(op->ptr, "action");
@@ -1438,7 +1438,7 @@ static int pe_select_all_exec(bContext *C, wmOperator *op)
}
}
- PE_update_selection(C, scene, sl, ob, 1);
+ PE_update_selection(C, scene, view_layer, ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
@@ -1467,9 +1467,9 @@ int PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool deselec
{
PEData data;
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
POINT_P; KEY_K;
if (!PE_start_edit(edit))
@@ -1496,7 +1496,7 @@ int PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool deselec
else
for_mouse_hit_keys(&data, toggle_key_select, 1);
- PE_update_selection(C, scene, sl, ob, 1);
+ PE_update_selection(C, scene, view_layer, ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob);
return OPERATOR_FINISHED;
@@ -1641,7 +1641,7 @@ static int select_random_exec(bContext *C, wmOperator *op)
PEData data;
int type;
Scene *scene;
- ViewLayer *sl;
+ ViewLayer *view_layer;
Object *ob;
/* used by LOOP_VISIBLE_POINTS, LOOP_VISIBLE_KEYS and LOOP_KEYS */
@@ -1661,9 +1661,9 @@ static int select_random_exec(bContext *C, wmOperator *op)
PE_set_data(C, &data);
data.select_action = SEL_SELECT;
scene = CTX_data_scene(C);
- sl = CTX_data_view_layer(C);
+ view_layer = CTX_data_view_layer(C);
ob = CTX_data_active_object(C);
- edit = PE_get_current(scene, sl, ob);
+ edit = PE_get_current(scene, view_layer, ob);
rng = BLI_rng_new_srandom(seed);
@@ -1780,9 +1780,9 @@ void PE_deselect_all_visible(PTCacheEdit *edit)
int PE_border_select(bContext *C, rcti *rect, bool select, bool extend)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
PEData data;
if (!PE_start_edit(edit))
@@ -1797,7 +1797,7 @@ int PE_border_select(bContext *C, rcti *rect, bool select, bool extend)
for_mouse_hit_keys(&data, select_key, 0);
- PE_update_selection(C, scene, sl, ob, 1);
+ PE_update_selection(C, scene, view_layer, ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
@@ -1808,9 +1808,9 @@ int PE_border_select(bContext *C, rcti *rect, bool select, bool extend)
int PE_circle_select(bContext *C, int selecting, const int mval[2], float rad)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
PEData data;
if (!PE_start_edit(edit))
@@ -1823,7 +1823,7 @@ int PE_circle_select(bContext *C, int selecting, const int mval[2], float rad)
for_mouse_hit_keys(&data, select_key, 0);
- PE_update_selection(C, scene, sl, ob, 1);
+ PE_update_selection(C, scene, view_layer, ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
@@ -1834,11 +1834,11 @@ int PE_circle_select(bContext *C, int selecting, const int mval[2], float rad)
int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, bool extend, bool select)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
ARegion *ar= CTX_wm_region(C);
ParticleEditSettings *pset= PE_settings(scene);
- PTCacheEdit *edit = PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit = PE_get_current(scene, view_layer, ob);
ParticleSystem *psys = edit->psys;
ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
POINT_P; KEY_K;
@@ -1912,7 +1912,7 @@ int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, bool
}
}
- PE_update_selection(C, scene, sl, ob, 1);
+ PE_update_selection(C, scene, view_layer, ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
@@ -1924,8 +1924,8 @@ static int hide_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
POINT_P; KEY_K;
if (RNA_enum_get(op->ptr, "unselected")) {
@@ -1947,7 +1947,7 @@ static int hide_exec(bContext *C, wmOperator *op)
}
}
- PE_update_selection(C, scene, sl, ob, 1);
+ PE_update_selection(C, scene, view_layer, ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
@@ -1977,8 +1977,8 @@ static int reveal_exec(bContext *C, wmOperator *op)
{
Object *ob= CTX_data_active_object(C);
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
const bool select = RNA_boolean_get(op->ptr, "select");
POINT_P; KEY_K;
@@ -1993,7 +1993,7 @@ static int reveal_exec(bContext *C, wmOperator *op)
}
}
- PE_update_selection(C, scene, sl, ob, 1);
+ PE_update_selection(C, scene, view_layer, ob, 1);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
@@ -2245,9 +2245,9 @@ void PARTICLE_OT_rekey(wmOperatorType *ot)
RNA_def_int(ot->srna, "keys_number", 2, 2, INT_MAX, "Number of Keys", "", 2, 100);
}
-static void rekey_particle_to_time(const bContext *C, Scene *scene, ViewLayer *sl, Object *ob, int pa_index, float path_time)
+static void rekey_particle_to_time(const bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, int pa_index, float path_time)
{
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
ParticleSystem *psys;
ParticleSimulationData sim = {0};
ParticleData *pa;
@@ -2587,9 +2587,9 @@ void PARTICLE_OT_subdivide(wmOperatorType *ot)
static int remove_doubles_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
ParticleSystem *psys = edit->psys;
ParticleSystemModifierData *psmd;
KDTree *tree;
@@ -2680,10 +2680,10 @@ void PARTICLE_OT_remove_doubles(wmOperatorType *ot)
static int weight_set_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
ParticleEditSettings *pset= PE_settings(scene);
Object *ob= CTX_data_active_object(C);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
ParticleSystem *psys = edit->psys;
POINT_P;
KEY_K;
@@ -2840,11 +2840,11 @@ void PARTICLE_OT_delete(wmOperatorType *ot)
/*************************** mirror operator **************************/
-static void PE_mirror_x(Scene *scene, ViewLayer *sl, Object *ob, int tagged)
+static void PE_mirror_x(Scene *scene, ViewLayer *view_layer, Object *ob, int tagged)
{
Mesh *me= (Mesh *)(ob->data);
ParticleSystemModifierData *psmd;
- PTCacheEdit *edit = PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit = PE_get_current(scene, view_layer, ob);
ParticleSystem *psys = edit->psys;
ParticleData *pa, *newpa, *new_pars;
PTCacheEditPoint *newpoint, *new_points;
@@ -2991,11 +2991,11 @@ static void PE_mirror_x(Scene *scene, ViewLayer *sl, Object *ob, int tagged)
static int mirror_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
- PE_mirror_x(scene, sl, ob, 0);
+ PE_mirror_x(scene, view_layer, ob, 0);
update_world_cos(ob, edit);
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
@@ -3768,7 +3768,7 @@ static int brush_add(const bContext *C, PEData *data, short number)
typedef struct BrushEdit {
Scene *scene;
- ViewLayer *sl;
+ ViewLayer *view_layer;
Object *ob;
PTCacheEdit *edit;
@@ -3783,10 +3783,10 @@ typedef struct BrushEdit {
static int brush_edit_init(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= CTX_data_active_object(C);
ParticleEditSettings *pset= PE_settings(scene);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
ARegion *ar= CTX_wm_region(C);
BrushEdit *bedit;
float min[3], max[3];
@@ -3796,7 +3796,7 @@ static int brush_edit_init(bContext *C, wmOperator *op)
/* set the 'distance factor' for grabbing (used in comb etc) */
INIT_MINMAX(min, max);
- PE_minmax(scene, sl, min, max);
+ PE_minmax(scene, view_layer, min, max);
mid_v3_v3v3(min, min, max);
bedit= MEM_callocN(sizeof(BrushEdit), "BrushEdit");
@@ -3804,7 +3804,7 @@ static int brush_edit_init(bContext *C, wmOperator *op)
op->customdata= bedit;
bedit->scene= scene;
- bedit->sl = sl;
+ bedit->view_layer = view_layer;
bedit->ob= ob;
bedit->edit= edit;
@@ -3820,7 +3820,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
{
BrushEdit *bedit= op->customdata;
Scene *scene= bedit->scene;
- ViewLayer *sl = bedit->sl;
+ ViewLayer *view_layer = bedit->view_layer;
Object *ob= bedit->ob;
PTCacheEdit *edit= bedit->edit;
ParticleEditSettings *pset= PE_settings(scene);
@@ -4014,14 +4014,14 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
if (ELEM(pset->brushtype, PE_BRUSH_ADD, PE_BRUSH_CUT) && (added || removed)) {
if (pset->brushtype == PE_BRUSH_ADD && pe_x_mirror(ob))
- PE_mirror_x(scene, sl, ob, 1);
+ PE_mirror_x(scene, view_layer, ob, 1);
update_world_cos(ob, edit);
psys_free_path_cache(NULL, edit);
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
- PE_update_object(&eval_ctx, scene, sl, ob, 1);
+ PE_update_object(&eval_ctx, scene, view_layer, ob, 1);
}
}
@@ -4246,10 +4246,10 @@ static void shape_cut(PEData *data, int pa_index)
static int shape_cut_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = CTX_data_active_object(C);
ParticleEditSettings *pset = PE_settings(scene);
- PTCacheEdit *edit = PE_get_current(scene, sl, ob);
+ PTCacheEdit *edit = PE_get_current(scene, view_layer, ob);
Object *shapeob = pset->shape_object;
int selected = count_selected_keys(scene, edit);
int lock_root = pset->flag & PE_LOCK_FIRST;
@@ -4288,7 +4288,7 @@ static int shape_cut_exec(bContext *C, wmOperator *UNUSED(op))
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
else {
- PE_update_object(&eval_ctx, scene, sl, ob, 1);
+ PE_update_object(&eval_ctx, scene, view_layer, ob, 1);
}
if (edit->psys) {
@@ -4461,9 +4461,9 @@ static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo)
}
}
-void PE_undo_push(Scene *scene, ViewLayer *sl, const char *str)
+void PE_undo_push(Scene *scene, ViewLayer *view_layer, const char *str)
{
- PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, OBACT(view_layer));
PTCacheUndo *undo;
int nr;
@@ -4503,9 +4503,9 @@ void PE_undo_push(Scene *scene, ViewLayer *sl, const char *str)
make_PTCacheUndo(edit, edit->curundo);
}
-void PE_undo_step(Scene *scene, ViewLayer *sl, int step)
+void PE_undo_step(Scene *scene, ViewLayer *view_layer, int step)
{
- PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, OBACT(view_layer));
if (!edit) return;
@@ -4536,12 +4536,12 @@ void PE_undo_step(Scene *scene, ViewLayer *sl, int step)
}
}
- DEG_id_tag_update(&OBACT(sl)->id, OB_RECALC_DATA);
+ DEG_id_tag_update(&OBACT(view_layer)->id, OB_RECALC_DATA);
}
-bool PE_undo_is_valid(Scene *scene, ViewLayer *sl)
+bool PE_undo_is_valid(Scene *scene, ViewLayer *view_layer)
{
- PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, OBACT(view_layer));
if (edit) {
return (edit->undo.last != edit->undo.first);
@@ -4564,19 +4564,19 @@ void PTCacheUndo_clear(PTCacheEdit *edit)
edit->curundo= NULL;
}
-void PE_undo(Scene *scene, ViewLayer *sl)
+void PE_undo(Scene *scene, ViewLayer *view_layer)
{
- PE_undo_step(scene, sl, 1);
+ PE_undo_step(scene, view_layer, 1);
}
-void PE_redo(Scene *scene, ViewLayer *sl)
+void PE_redo(Scene *scene, ViewLayer *view_layer)
{
- PE_undo_step(scene, sl, -1);
+ PE_undo_step(scene, view_layer, -1);
}
-void PE_undo_number(Scene *scene, ViewLayer *sl, int nr)
+void PE_undo_number(Scene *scene, ViewLayer *view_layer, int nr)
{
- PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, OBACT(view_layer));
PTCacheUndo *undo;
int a=0;
@@ -4584,15 +4584,15 @@ void PE_undo_number(Scene *scene, ViewLayer *sl, int nr)
if (a==nr) break;
}
edit->curundo= undo;
- PE_undo_step(scene, sl, 0);
+ PE_undo_step(scene, view_layer, 0);
}
/* get name of undo item, return null if no item with this index */
/* if active pointer, set it to 1 if true */
-const char *PE_undo_get_name(Scene *scene, ViewLayer *sl, int nr, bool *r_active)
+const char *PE_undo_get_name(Scene *scene, ViewLayer *view_layer, int nr, bool *r_active)
{
- PTCacheEdit *edit= PE_get_current(scene, sl, OBACT(sl));
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, OBACT(view_layer));
PTCacheUndo *undo;
if (r_active) *r_active = false;
@@ -4611,10 +4611,10 @@ const char *PE_undo_get_name(Scene *scene, ViewLayer *sl, int nr, bool *r_active
/************************ utilities ******************************/
-int PE_minmax(Scene *scene, ViewLayer *sl, float min[3], float max[3])
+int PE_minmax(Scene *scene, ViewLayer *view_layer, float min[3], float max[3])
{
- Object *ob= OBACT(sl);
- PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ Object *ob= OBACT(view_layer);
+ PTCacheEdit *edit= PE_get_current(scene, view_layer, ob);
ParticleSystem *psys;
ParticleSystemModifierData *psmd = NULL;
POINT_P; KEY_K;
@@ -4652,7 +4652,7 @@ int PE_minmax(Scene *scene, ViewLayer *sl, float min[3], float max[3])
/* initialize needed data for bake edit */
void PE_create_particle_edit(
- const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, Object *ob, PointCache *cache, ParticleSystem *psys)
+ const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer, Object *ob, PointCache *cache, ParticleSystem *psys)
{
PTCacheEdit *edit;
ParticleSystemModifierData *psmd = (psys) ? psys_get_modifier(ob, psys) : NULL;
@@ -4753,10 +4753,10 @@ void PE_create_particle_edit(
recalc_lengths(edit);
if (psys && !cache)
recalc_emitter_field(ob, psys);
- PE_update_object(eval_ctx, scene, sl, ob, 1);
+ PE_update_object(eval_ctx, scene, view_layer, ob, 1);
PTCacheUndo_clear(edit);
- PE_undo_push(scene, sl, "Original");
+ PE_undo_push(scene, view_layer, "Original");
}
}
@@ -4966,8 +4966,8 @@ static int unify_length_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
- PTCacheEdit *edit = PE_get_current(scene, sl, ob);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
+ PTCacheEdit *edit = PE_get_current(scene, view_layer, ob);
float average_length = calculate_average_length(edit);
if (average_length == 0.0f) {
@@ -4978,7 +4978,7 @@ static int unify_length_exec(bContext *C, wmOperator *UNUSED(op))
EvaluationContext eval_ctx;
CTX_data_eval_ctx(C, &eval_ctx);
- PE_update_object(&eval_ctx, scene, sl, ob, 1);
+ PE_update_object(&eval_ctx, scene, view_layer, ob, 1);
if (edit->psys) {
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
}
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 8979630e834..4fee14dc71d 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -71,7 +71,7 @@
#include "physics_intern.h"
-extern void PE_create_particle_edit(const bContext *C, Scene *scene, ViewLayer *sl, Object *ob, PointCache *cache, ParticleSystem *psys);
+extern void PE_create_particle_edit(const bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, PointCache *cache, ParticleSystem *psys);
extern void PTCacheUndo_clear(PTCacheEdit *edit);
extern void recalc_lengths(PTCacheEdit *edit);
extern void recalc_emitter_field(Object *ob, ParticleSystem *psys);
@@ -135,7 +135,7 @@ static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = ED_object_context(C);
Scene *scene = CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
int mode_orig;
if (!scene || !ob)
@@ -149,7 +149,7 @@ static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op))
*/
if (mode_orig & OB_MODE_PARTICLE_EDIT) {
if ((ob->mode & OB_MODE_PARTICLE_EDIT) == 0) {
- if (sl->basact && sl->basact->object == ob) {
+ if (view_layer->basact && view_layer->basact->object == ob) {
WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL);
}
}
@@ -569,7 +569,7 @@ void PARTICLE_OT_dupliob_move_down(wmOperatorType *ot)
/************************ connect/disconnect hair operators *********************/
static void disconnect_hair(
- const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl,
+ const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer,
Object *ob, ParticleSystem *psys)
{
ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
@@ -616,13 +616,13 @@ static void disconnect_hair(
if (ELEM(pset->brushtype, PE_BRUSH_ADD, PE_BRUSH_PUFF))
pset->brushtype = PE_BRUSH_NONE;
- PE_update_object(eval_ctx, scene, sl, ob, 0);
+ PE_update_object(eval_ctx, scene, view_layer, ob, 0);
}
static int disconnect_hair_exec(bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= ED_object_context(C);
ParticleSystem *psys= NULL;
const bool all = RNA_boolean_get(op->ptr, "all");
@@ -635,12 +635,12 @@ static int disconnect_hair_exec(bContext *C, wmOperator *op)
if (all) {
for (psys=ob->particlesystem.first; psys; psys=psys->next) {
- disconnect_hair(&eval_ctx, scene, sl, ob, psys);
+ disconnect_hair(&eval_ctx, scene, view_layer, ob, psys);
}
}
else {
psys = psys_get_current(ob);
- disconnect_hair(&eval_ctx, scene, sl, ob, psys);
+ disconnect_hair(&eval_ctx, scene, view_layer, ob, psys);
}
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -667,7 +667,7 @@ void PARTICLE_OT_disconnect_hair(wmOperatorType *ot)
* from/to_mat : additional transform for from/to particles (e.g. for using object space copying)
*/
static bool remap_hair_emitter(
- const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl, Object *ob, ParticleSystem *psys,
+ const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer, Object *ob, ParticleSystem *psys,
Object *target_ob, ParticleSystem *target_psys, PTCacheEdit *target_edit,
float from_mat[4][4], float to_mat[4][4], bool from_global, bool to_global)
{
@@ -853,13 +853,13 @@ static bool remap_hair_emitter(
psys_free_path_cache(target_psys, target_edit);
- PE_update_object(eval_ctx, scene, sl, target_ob, 0);
+ PE_update_object(eval_ctx, scene, view_layer, target_ob, 0);
return true;
}
static bool connect_hair(
- const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl,
+ const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer,
Object *ob, ParticleSystem *psys)
{
bool ok;
@@ -868,7 +868,7 @@ static bool connect_hair(
return false;
ok = remap_hair_emitter(
- eval_ctx, scene, sl, ob, psys, ob, psys, psys->edit,
+ eval_ctx, scene, view_layer, ob, psys, ob, psys, psys->edit,
ob->obmat, ob->obmat, psys->flag & PSYS_GLOBAL_HAIR, false);
psys->flag &= ~PSYS_GLOBAL_HAIR;
@@ -879,7 +879,7 @@ static int connect_hair_exec(bContext *C, wmOperator *op)
{
EvaluationContext eval_ctx;
Scene *scene= CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob= ED_object_context(C);
ParticleSystem *psys= NULL;
const bool all = RNA_boolean_get(op->ptr, "all");
@@ -892,12 +892,12 @@ static int connect_hair_exec(bContext *C, wmOperator *op)
if (all) {
for (psys=ob->particlesystem.first; psys; psys=psys->next) {
- any_connected |= connect_hair(&eval_ctx, scene, sl, ob, psys);
+ any_connected |= connect_hair(&eval_ctx, scene, view_layer, ob, psys);
}
}
else {
psys = psys_get_current(ob);
- any_connected |= connect_hair(&eval_ctx, scene, sl, ob, psys);
+ any_connected |= connect_hair(&eval_ctx, scene, view_layer, ob, psys);
}
if (!any_connected) {
@@ -934,7 +934,7 @@ typedef enum eCopyParticlesSpace {
} eCopyParticlesSpace;
static void copy_particle_edit(
- const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *sl,
+ const EvaluationContext *eval_ctx, Scene *scene, ViewLayer *view_layer,
Object *ob, ParticleSystem *psys, ParticleSystem *psys_from)
{
PTCacheEdit *edit_from = psys_from->edit, *edit;
@@ -985,10 +985,10 @@ static void copy_particle_edit(
recalc_lengths(edit);
recalc_emitter_field(ob, psys);
- PE_update_object(eval_ctx, scene, sl, ob, true);
+ PE_update_object(eval_ctx, scene, view_layer, ob, true);
PTCacheUndo_clear(edit);
- PE_undo_push(scene, sl, "Original");
+ PE_undo_push(scene, view_layer, "Original");
}
static void remove_particle_systems_from_object(Object *ob_to)
@@ -1018,7 +1018,7 @@ static void remove_particle_systems_from_object(Object *ob_to)
/* single_psys_from is optional, if NULL all psys of ob_from are copied */
static bool copy_particle_systems_to_object(const bContext *C,
Scene *scene,
- ViewLayer *sl,
+ ViewLayer *view_layer,
Object *ob_from,
ParticleSystem *single_psys_from,
Object *ob_to,
@@ -1103,7 +1103,7 @@ static bool copy_particle_systems_to_object(const bContext *C,
DM_ensure_tessface(psmd->dm_final);
if (psys_from->edit) {
- copy_particle_edit(&eval_ctx, scene, sl, ob_to, psys, psys_from);
+ copy_particle_edit(&eval_ctx, scene, view_layer, ob_to, psys, psys_from);
}
if (duplicate_settings) {
@@ -1139,7 +1139,7 @@ static bool copy_particle_systems_to_object(const bContext *C,
}
if (ob_from != ob_to) {
remap_hair_emitter(
- &eval_ctx, scene, sl, ob_from, psys_from, ob_to, psys, psys->edit,
+ &eval_ctx, scene, view_layer, ob_from, psys_from, ob_to, psys, psys->edit,
from_mat, to_mat, psys_from->flag & PSYS_GLOBAL_HAIR, psys->flag & PSYS_GLOBAL_HAIR);
}
@@ -1174,7 +1174,7 @@ static int copy_particle_systems_exec(bContext *C, wmOperator *op)
const bool remove_target_particles = RNA_boolean_get(op->ptr, "remove_target_particles");
const bool use_active = RNA_boolean_get(op->ptr, "use_active");
Scene *scene = CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob_from = ED_object_active_context(C);
ParticleSystem *psys_from = use_active ? CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem).data : NULL;
@@ -1189,7 +1189,7 @@ static int copy_particle_systems_exec(bContext *C, wmOperator *op)
remove_particle_systems_from_object(ob_to);
changed = true;
}
- if (copy_particle_systems_to_object(C, scene, sl, ob_from, psys_from, ob_to, space, false))
+ if (copy_particle_systems_to_object(C, scene, view_layer, ob_from, psys_from, ob_to, space, false))
changed = true;
else
fail++;
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index bfacd709c73..12e01228e1e 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -331,7 +331,7 @@ static void free_all_fluidobject_channels(ListBase *fobjects)
static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), FluidsimSettings *domainSettings, FluidAnimChannels *channels, ListBase *fobjects)
{
Scene *scene = CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
EvaluationContext eval_ctx;
Base *base;
@@ -350,7 +350,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid
channels->DomainTime = MEM_callocN(length * (CHANNEL_FLOAT+1) * sizeof(float), "channel DomainTime");
/* allocate fluid objects */
- for (base = FIRSTBASE(sl); base; base = base->next) {
+ for (base = FIRSTBASE(view_layer); base; base = base->next) {
Object *ob = base->object;
FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
@@ -409,7 +409,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid
/* Modifying the global scene isn't nice, but we can do it in
* this part of the process before a threaded job is created */
scene->r.cfra = (int)eval_time;
- ED_update_for_newframe(CTX_data_main(C), scene, sl, depsgraph);
+ ED_update_for_newframe(CTX_data_main(C), scene, view_layer, depsgraph);
/* now scene data should be current according to animation system, so we fill the channels */
@@ -580,14 +580,14 @@ static void export_fluid_objects(const bContext *C, ListBase *fobjects, Scene *s
}
}
-static int fluid_validate_scene(ReportList *reports, ViewLayer *sl, Object *fsDomain)
+static int fluid_validate_scene(ReportList *reports, ViewLayer *view_layer, Object *fsDomain)
{
Base *base;
Object *newdomain = NULL;
int channelObjCount = 0;
int fluidInputCount = 0;
- for (base = FIRSTBASE(sl); base; base = base->next) {
+ for (base = FIRSTBASE(view_layer); base; base = base->next) {
Object *ob = base->object;
FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim);
@@ -846,7 +846,7 @@ static void fluidsim_delete_until_lastframe(FluidsimSettings *fss, const char *r
static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, short do_job)
{
Scene *scene = CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
int i;
FluidsimSettings *domainSettings;
@@ -894,7 +894,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
}
/* check scene for sane object/modifier settings */
- if (!fluid_validate_scene(reports, sl, fsDomain)) {
+ if (!fluid_validate_scene(reports, view_layer, fsDomain)) {
fluidbake_free_data(channels, fobjects, fsset, fb);
return 0;
}
@@ -959,7 +959,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* reset to original current frame */
scene->r.cfra = origFrame;
- ED_update_for_newframe(CTX_data_main(C), scene, sl, depsgraph);
+ ED_update_for_newframe(CTX_data_main(C), scene, view_layer, depsgraph);
/* ******** init domain object's matrix ******** */
copy_m4_m4(domainMat, fsDomain->obmat);
diff --git a/source/blender/editors/physics/rigidbody_constraint.c b/source/blender/editors/physics/rigidbody_constraint.c
index c454f2dedca..f77e164ba16 100644
--- a/source/blender/editors/physics/rigidbody_constraint.c
+++ b/source/blender/editors/physics/rigidbody_constraint.c
@@ -119,9 +119,9 @@ static int rigidbody_con_add_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
RigidBodyWorld *rbw = BKE_rigidbody_get_world(scene);
- Object *ob = OBACT(sl);
+ Object *ob = OBACT(view_layer);
int type = RNA_enum_get(op->ptr, "type");
bool changed;
@@ -169,8 +169,8 @@ static int rigidbody_con_remove_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
- ViewLayer *sl = CTX_data_view_layer(C);
- Object *ob = OBACT(sl);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
+ Object *ob = OBACT(view_layer);
/* apply to active object */
if (ELEM(NULL, ob, ob->rigidbody_constraint)) {