diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-14 03:02:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-14 03:08:34 +0300 |
commit | 5e8dbafb5b211f9a2c7de5580a7e83254706521b (patch) | |
tree | 3d24a17ec7508ce349f0dcd26ee476835c2f7a17 /source/blender/editors/physics/particle_boids.c | |
parent | efdc0959b17fba969b25bcbf7318322a01d791d0 (diff) | |
parent | 98f4a8eedf218c240adbac586fed02cfe51e01a9 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/physics/particle_boids.c')
-rw-r--r-- | source/blender/editors/physics/particle_boids.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c index ac031079434..f1e0fd39014 100644 --- a/source/blender/editors/physics/particle_boids.c +++ b/source/blender/editors/physics/particle_boids.c @@ -59,7 +59,7 @@ static int rule_add_exec(bContext *C, wmOperator *op) { PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_settings", &RNA_ParticleSettings); ParticleSettings *part = ptr.data; - int type= RNA_enum_get(op->ptr, "type"); + int type = RNA_enum_get(op->ptr, "type"); BoidRule *rule; BoidState *state; @@ -69,7 +69,7 @@ static int rule_add_exec(bContext *C, wmOperator *op) state = boid_get_current_state(part->boids); - for (rule=state->rules.first; rule; rule=rule->next) + for (rule = state->rules.first; rule; rule = rule->next) rule->flag &= ~BOIDRULE_CURRENT; rule = boid_new_rule(type); @@ -77,7 +77,7 @@ static int rule_add_exec(bContext *C, wmOperator *op) BLI_addtail(&state->rules, rule); - DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); + DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET); return OPERATOR_FINISHED; } @@ -94,7 +94,7 @@ void BOID_OT_rule_add(wmOperatorType *ot) ot->exec = rule_add_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_boidrule_type_items, 0, "Type", ""); } @@ -111,7 +111,7 @@ static int rule_del_exec(bContext *C, wmOperator *UNUSED(op)) state = boid_get_current_state(part->boids); - for (rule=state->rules.first; rule; rule=rule->next) { + for (rule = state->rules.first; rule; rule = rule->next) { if (rule->flag & BOIDRULE_CURRENT) { BLI_remlink(&state->rules, rule); MEM_freeN(rule); @@ -124,7 +124,7 @@ static int rule_del_exec(bContext *C, wmOperator *UNUSED(op)) rule->flag |= BOIDRULE_CURRENT; DEG_relations_tag_update(bmain); - DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); + DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET); return OPERATOR_FINISHED; } @@ -140,7 +140,7 @@ void BOID_OT_rule_del(wmOperatorType *ot) ot->exec = rule_del_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } /************************ move up/down boid rule operators *********************/ @@ -155,12 +155,12 @@ static int rule_move_up_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; state = boid_get_current_state(part->boids); - for (rule = state->rules.first; rule; rule=rule->next) { + for (rule = state->rules.first; rule; rule = rule->next) { if (rule->flag & BOIDRULE_CURRENT && rule->prev) { BLI_remlink(&state->rules, rule); BLI_insertlinkbefore(&state->rules, rule->prev, rule); - DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); + DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET); break; } } @@ -177,7 +177,7 @@ void BOID_OT_rule_move_up(wmOperatorType *ot) ot->exec = rule_move_up_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } static int rule_move_down_exec(bContext *C, wmOperator *UNUSED(op)) @@ -191,12 +191,12 @@ static int rule_move_down_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; state = boid_get_current_state(part->boids); - for (rule = state->rules.first; rule; rule=rule->next) { + for (rule = state->rules.first; rule; rule = rule->next) { if (rule->flag & BOIDRULE_CURRENT && rule->next) { BLI_remlink(&state->rules, rule); BLI_insertlinkafter(&state->rules, rule->next, rule); - DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); + DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET); break; } } @@ -213,7 +213,7 @@ void BOID_OT_rule_move_down(wmOperatorType *ot) ot->exec = rule_move_down_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } @@ -227,7 +227,7 @@ static int state_add_exec(bContext *C, wmOperator *UNUSED(op)) if (!part || part->phystype != PART_PHYS_BOIDS) return OPERATOR_CANCELLED; - for (state=part->boids->states.first; state; state=state->next) + for (state = part->boids->states.first; state; state = state->next) state->flag &= ~BOIDSTATE_CURRENT; state = boid_new_state(part->boids); @@ -249,7 +249,7 @@ void BOID_OT_state_add(wmOperatorType *ot) ot->exec = state_add_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } static int state_del_exec(bContext *C, wmOperator *UNUSED(op)) { @@ -261,7 +261,7 @@ static int state_del_exec(bContext *C, wmOperator *UNUSED(op)) if (!part || part->phystype != PART_PHYS_BOIDS) return OPERATOR_CANCELLED; - for (state=part->boids->states.first; state; state=state->next) { + for (state = part->boids->states.first; state; state = state->next) { if (state->flag & BOIDSTATE_CURRENT) { BLI_remlink(&part->boids->states, state); MEM_freeN(state); @@ -280,7 +280,7 @@ static int state_del_exec(bContext *C, wmOperator *UNUSED(op)) state->flag |= BOIDSTATE_CURRENT; DEG_relations_tag_update(bmain); - DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); + DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET); return OPERATOR_FINISHED; } @@ -296,7 +296,7 @@ void BOID_OT_state_del(wmOperatorType *ot) ot->exec = state_del_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } /************************ move up/down boid state operators *********************/ @@ -312,7 +312,7 @@ static int state_move_up_exec(bContext *C, wmOperator *UNUSED(op)) boids = part->boids; - for (state = boids->states.first; state; state=state->next) { + for (state = boids->states.first; state; state = state->next) { if (state->flag & BOIDSTATE_CURRENT && state->prev) { BLI_remlink(&boids->states, state); BLI_insertlinkbefore(&boids->states, state->prev, state); @@ -332,7 +332,7 @@ void BOID_OT_state_move_up(wmOperatorType *ot) ot->exec = state_move_up_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } static int state_move_down_exec(bContext *C, wmOperator *UNUSED(op)) @@ -347,11 +347,11 @@ static int state_move_down_exec(bContext *C, wmOperator *UNUSED(op)) boids = part->boids; - for (state = boids->states.first; state; state=state->next) { + for (state = boids->states.first; state; state = state->next) { if (state->flag & BOIDSTATE_CURRENT && state->next) { BLI_remlink(&boids->states, state); BLI_insertlinkafter(&boids->states, state->next, state); - DEG_id_tag_update(&part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); + DEG_id_tag_update(&part->id, OB_RECALC_DATA | PSYS_RECALC_RESET); break; } } @@ -368,5 +368,5 @@ void BOID_OT_state_move_down(wmOperatorType *ot) ot->exec = state_move_down_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } |