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

View File

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

View File

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

View File

@ -130,7 +130,7 @@ void create_swapped_rotation_matrix(
float rz; float rz;
/* Apply transformation */ /* Apply transformation */
switch(mode) { switch (mode) {
case ABC_ZUP_FROM_YUP: case ABC_ZUP_FROM_YUP:
ry = -euler[2]; ry = -euler[2];
rz = euler[1]; 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); copy_m4_m3(dst_mat, dst_rot);
/* Apply translation */ /* Apply translation */
switch(mode) { switch (mode) {
case ABC_ZUP_FROM_YUP: case ABC_ZUP_FROM_YUP:
copy_zup_from_yup(dst_mat[3], src_trans); copy_zup_from_yup(dst_mat[3], src_trans);
break; break;

View File

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

View File

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

View File

@ -1092,7 +1092,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
/* For hair, sort by origindex (allows optimization's in rendering), */ /* For hair, sort by origindex (allows optimization's in rendering), */
/* however with virtual parents the children need to be in random order. */ /* 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; int *orig_index = NULL;
if (from == PART_FROM_VERT) { if (from == PART_FROM_VERT) {

View File

@ -1000,7 +1000,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
part=psys->part; part=psys->part;
/* get precise emitter matrix if particle is born */ /* 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); evaluate_emitter_anim(sim->scene, sim->ob, pa->time);
psys->flag |= PSYS_OB_ANIM_RESTORE; psys->flag |= PSYS_OB_ANIM_RESTORE;
@ -1183,7 +1183,7 @@ static void set_keyed_keys(ParticleSimulationData *sim)
key->time = pa->time; 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++; k++;
ksim.psys->flag |= keyed_flag; ksim.psys->flag |= keyed_flag;

View File

@ -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) 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) if (for_render)
return min_ii(r->simplify_subsurf_render, lvl); return min_ii(r->simplify_subsurf_render, lvl);
else else

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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, bUnit_AsString(distvec, sizeof(distvec), dist * t->scene->unit.scale_length, 4, t->scene->unit.system,
B_UNIT_LENGTH, do_split, false); B_UNIT_LENGTH, do_split, false);
} }
else if (dist > 1e10f || dist < -1e10f) { else if (dist > 1e10f || dist < -1e10f) {
/* prevent string buffer overflow */ /* prevent string buffer overflow */
BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4e", dist); BLI_snprintf(distvec, NUM_STR_REP_LEN, "%.4e", dist);
} }

View File

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

View File

@ -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 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)); 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); return vec2(tint, 0.0);
} }
else if(mortar_smooth == 0.0) { else if (mortar_smooth == 0.0) {
return vec2(tint, 1.0); return vec2(tint, 1.0);
} }
else { else {

View File

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

View File

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

View File

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