Merge branch 'master' into blender2.8

This commit is contained in:
Campbell Barton 2017-06-02 15:39:25 +10:00
commit eae486f5e6
19 changed files with 49 additions and 47 deletions

@ -2,13 +2,14 @@
Modal Execution
+++++++++++++++
This operator defines a :class:`Operator.modal` function which running,
handling events until it returns ``{'FINISHED'}`` or ``{'CANCELLED'}``.
This operator defines a :class:`Operator.modal` function that will keep being
run to handle events until it returns ``{'FINISHED'}`` or ``{'CANCELLED'}``.
Grab, Rotate, Scale and Fly-Mode are examples of modal operators.
They are especially useful for interactive tools,
your operator can have its own state where keys toggle options as the operator
runs.
Modal operators run every time a new event is detected, such as a mouse click
or key press. Conversely, when no new events are detected, the modal operator
will not run. Modal operators are especially useful for interactive tools, an
operator can have its own state where keys toggle options as the operator runs.
Grab, Rotate, Scale, and Fly-Mode are examples of modal operators.
:class:`Operator.invoke` is used to initialize the operator as being by
returning ``{'RUNNING_MODAL'}``, initializing the modal loop.

@ -432,7 +432,7 @@ AbcTransformWriter * AbcExporter::createTransformWriter(Object *ob, Object *pare
/* check if we have already created a transform writer for this object */
AbcTransformWriter *my_writer = getXForm(name);
if (my_writer != NULL){
if (my_writer != NULL) {
return my_writer;
}

@ -130,7 +130,7 @@ void create_swapped_rotation_matrix(
float rz;
/* Apply transformation */
switch(mode) {
switch (mode) {
case ABC_ZUP_FROM_YUP:
ry = -euler[2];
rz = euler[1];
@ -205,7 +205,7 @@ void copy_m44_axis_swap(float dst_mat[4][4], float src_mat[4][4], AbcAxisSwapMod
copy_m4_m3(dst_mat, dst_rot);
/* Apply translation */
switch(mode) {
switch (mode) {
case ABC_ZUP_FROM_YUP:
copy_zup_from_yup(dst_mat[3], src_trans);
break;

@ -470,7 +470,8 @@ static std::pair<bool, AbcObjectReader *> visit_object(
else {
if (child_claims_this_object) {
claiming_child_readers.push_back(child_reader);
} else {
}
else {
nonclaiming_child_readers.push_back(child_reader);
}
}

@ -165,7 +165,7 @@ UvVertMap *BKE_mesh_uv_vert_map_create(
vmap->vert[a] = newvlist;
}
if (use_winding) {
if (use_winding) {
MEM_freeN(winding);
}

@ -1092,7 +1092,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
/* For hair, sort by origindex (allows optimization's in rendering), */
/* however with virtual parents the children need to be in random order. */
if (part->type == PART_HAIR && !(part->childtype==PART_CHILD_FACES && part->parents!=0.0f)) {
if (part->type == PART_HAIR && !(part->childtype==PART_CHILD_FACES && part->parents != 0.0f)) {
int *orig_index = NULL;
if (from == PART_FROM_VERT) {

@ -1000,7 +1000,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
part=psys->part;
/* get precise emitter matrix if particle is born */
if (part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) {
if (part->type != PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) {
evaluate_emitter_anim(sim->scene, sim->ob, pa->time);
psys->flag |= PSYS_OB_ANIM_RESTORE;
@ -1183,7 +1183,7 @@ static void set_keyed_keys(ParticleSimulationData *sim)
key->time = pa->time;
}
if (psys->flag & PSYS_KEYED_TIMING && pt->duration!=0.0f)
if (psys->flag & PSYS_KEYED_TIMING && pt->duration != 0.0f)
k++;
ksim.psys->flag |= keyed_flag;

@ -1697,7 +1697,7 @@ bool BKE_scene_remove_render_view(Scene *scene, SceneRenderView *srv)
int get_render_subsurf_level(const RenderData *r, int lvl, bool for_render)
{
if (r->mode & R_SIMPLIFY) {
if (r->mode & R_SIMPLIFY) {
if (for_render)
return min_ii(r->simplify_subsurf_render, lvl);
else

@ -444,7 +444,7 @@ MINLINE void blend_color_vividlight_byte(unsigned char dst[4], unsigned const ch
else if (src2[i] == 0) {
temp = 0;
}
else if (src2[i] > 127) {
else if (src2[i] > 127) {
temp = min_ii(((src1[i]) * 255) / (2 * (255 - src2[i])), 255);
}
else {

@ -139,18 +139,18 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph)
IDDepsNode *id_node = comp_node->owner;
ID *id = id_node->id;
if(id_node->done == 0) {
if (id_node->done == 0) {
deg_editors_id_update(bmain, id);
lib_id_recalc_tag(bmain, id);
/* TODO(sergey): For until we've got proper data nodes in the graph. */
lib_id_recalc_data_tag(bmain, id);
}
if(comp_node->done == 0) {
if (comp_node->done == 0) {
Object *object = NULL;
if (GS(id->name) == ID_OB) {
object = (Object *)id;
if(id_node->done == 0) {
if (id_node->done == 0) {
++num_flushed_objects;
}
}

@ -4162,7 +4162,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
*/
bp = nu->bp;
if (bp[nu->pntsu - 1].f1 & SELECT) {
if (bp[nu->pntsu - 1].f1 & SELECT) {
if (nu2 == NULL) {
nu2 = nu;
}

@ -4442,7 +4442,7 @@ void PE_undo_push(Scene *scene, SceneLayer *sl, const char *str)
undo= undo->prev;
}
if (undo) {
while (edit->undo.first!=undo) {
while (edit->undo.first != undo) {
PTCacheUndo *first= edit->undo.first;
BLI_remlink(&edit->undo, first);
free_PTCacheUndo(first);

@ -328,7 +328,7 @@ static int text_autocomplete_modal(bContext *C, wmOperator *op, const wmEvent *e
if (tools & TOOL_SUGG_LIST) {
texttool_suggest_clear();
}
if (tools & TOOL_DOCUMENT) {
if (tools & TOOL_DOCUMENT) {
texttool_docs_clear();
doc_scroll = 0;
}

@ -4307,7 +4307,7 @@ static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_
bUnit_AsString(distvec, sizeof(distvec), dist * t->scene->unit.scale_length, 4, t->scene->unit.system,
B_UNIT_LENGTH, do_split, false);
}
else if (dist > 1e10f || dist < -1e10f) {
else if (dist > 1e10f || dist < -1e10f) {
/* prevent string buffer overflow */
BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4e", dist);
}

@ -526,7 +526,7 @@ void BlenderStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const
// We'll generate both with tips and without tips
// coordinates, on two different UV layers.
if (ma->mtex[a]->texflag & MTEX_TIPS) {
if (ma->mtex[a]->texflag & MTEX_TIPS) {
BLI_strncpy(ma->mtex[a]->uvname, uvNames[1], sizeof(ma->mtex[a]->uvname));
}
else {

@ -3112,10 +3112,10 @@ vec2 calc_brick_texture(vec3 p, float mortar_size, float mortar_smooth, float bi
float tint = clamp((integer_noise((rownum << 16) + (bricknum & 0xFFFF)) + bias), 0.0, 1.0);
float min_dist = min(min(x, y), min(brick_width - x, row_height - y));
if(min_dist >= mortar_size) {
if (min_dist >= mortar_size) {
return vec2(tint, 0.0);
}
else if(mortar_smooth == 0.0) {
else if (mortar_smooth == 0.0) {
return vec2(tint, 1.0);
}
else {

@ -183,7 +183,7 @@ LogImageFile *dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t buf
if (verbose) printf("DPX: File is LSB.\n");
}
else {
if (verbose) {
if (verbose) {
printf("DPX: Bad magic number %u in \"%s\".\n",
header.fileHeader.magic_num, byteStuff);
}

@ -464,48 +464,48 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
float *fp, *col= NULL;
int pixsize= 3;
if(STREQ(rpass->name, RE_PASSNAME_COMBINED)) {
if (STREQ(rpass->name, RE_PASSNAME_COMBINED)) {
add_filt_fmask(curmask, shr->combined, rpass->rect + 4*offset, rectx);
}
else if(STREQ(rpass->name, RE_PASSNAME_Z)) {
else if (STREQ(rpass->name, RE_PASSNAME_Z)) {
fp = rpass->rect + offset;
*fp = shr->z;
}
else if(STREQ(rpass->name, RE_PASSNAME_RGBA)) {
else if (STREQ(rpass->name, RE_PASSNAME_RGBA)) {
col = shr->col;
pixsize = 4;
}
else if(STREQ(rpass->name, RE_PASSNAME_EMIT)) {
else if (STREQ(rpass->name, RE_PASSNAME_EMIT)) {
col = shr->emit;
}
else if(STREQ(rpass->name, RE_PASSNAME_DIFFUSE)) {
else if (STREQ(rpass->name, RE_PASSNAME_DIFFUSE)) {
col = shr->diff;
}
else if(STREQ(rpass->name, RE_PASSNAME_SPEC)) {
else if (STREQ(rpass->name, RE_PASSNAME_SPEC)) {
col = shr->spec;
}
else if(STREQ(rpass->name, RE_PASSNAME_SHADOW)) {
else if (STREQ(rpass->name, RE_PASSNAME_SHADOW)) {
col = shr->shad;
}
else if(STREQ(rpass->name, RE_PASSNAME_AO)) {
else if (STREQ(rpass->name, RE_PASSNAME_AO)) {
col = shr->ao;
}
else if(STREQ(rpass->name, RE_PASSNAME_ENVIRONMENT)) {
else if (STREQ(rpass->name, RE_PASSNAME_ENVIRONMENT)) {
col = shr->env;
}
else if(STREQ(rpass->name, RE_PASSNAME_INDIRECT)) {
else if (STREQ(rpass->name, RE_PASSNAME_INDIRECT)) {
col = shr->indirect;
}
else if(STREQ(rpass->name, RE_PASSNAME_REFLECT)) {
else if (STREQ(rpass->name, RE_PASSNAME_REFLECT)) {
col = shr->refl;
}
else if(STREQ(rpass->name, RE_PASSNAME_REFRACT)) {
else if (STREQ(rpass->name, RE_PASSNAME_REFRACT)) {
col = shr->refr;
}
else if(STREQ(rpass->name, RE_PASSNAME_NORMAL)) {
else if (STREQ(rpass->name, RE_PASSNAME_NORMAL)) {
col = shr->nor;
}
else if(STREQ(rpass->name, RE_PASSNAME_UV)) {
else if (STREQ(rpass->name, RE_PASSNAME_UV)) {
/* box filter only, gauss will screwup UV too much */
if (shi->totuv) {
float mult = (float)count_mask(curmask)/(float)R.osa;
@ -515,7 +515,7 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
fp[2]+= mult;
}
}
else if(STREQ(rpass->name, RE_PASSNAME_INDEXOB)) {
else if (STREQ(rpass->name, RE_PASSNAME_INDEXOB)) {
/* no filter */
if (shi->vlr) {
fp = rpass->rect + offset;
@ -523,7 +523,7 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
*fp = (float)shi->obr->ob->index;
}
}
else if(STREQ(rpass->name, RE_PASSNAME_INDEXMA)) {
else if (STREQ(rpass->name, RE_PASSNAME_INDEXMA)) {
/* no filter */
if (shi->vlr) {
fp = rpass->rect + offset;
@ -531,12 +531,12 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
*fp = (float)shi->mat->index;
}
}
else if(STREQ(rpass->name, RE_PASSNAME_MIST)) {
else if (STREQ(rpass->name, RE_PASSNAME_MIST)) {
/* */
col = &shr->mist;
pixsize = 1;
}
else if(STREQ(rpass->name, RE_PASSNAME_VECTOR)) {
else if (STREQ(rpass->name, RE_PASSNAME_VECTOR)) {
/* add minimum speed in pixel, no filter */
fp = rpass->rect + 4*offset;
if ( (ABS(shr->winspeed[0]) + ABS(shr->winspeed[1]))< (ABS(fp[0]) + ABS(fp[1])) ) {
@ -548,7 +548,7 @@ static void add_filt_passes(RenderLayer *rl, int curmask, int rectx, int offset,
fp[3] = shr->winspeed[3];
}
}
else if(STREQ(rpass->name, RE_PASSNAME_RAYHITS)) {
else if (STREQ(rpass->name, RE_PASSNAME_RAYHITS)) {
/* */
col = shr->rayhits;
pixsize= 4;

@ -124,7 +124,7 @@ void KX_SoundActuator::play()
AUD_Device_free(device);
// in case of pingpong, we have to free the sound
if(sound != m_sound)
if (sound != m_sound)
AUD_Sound_free(sound);
if (m_handle != NULL) {