diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-12 23:00:13 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-12 23:00:13 +0400 |
commit | bcf4491304eeb37dd9f2624c3de86726daddcebd (patch) | |
tree | b07669c75ad9de647df1f787f7c234d49019815b /source/blender | |
parent | 9e8c17206f0f36bbabea8bb85de3253b81801932 (diff) | |
parent | 875f616ab8c0856bef287d1041141ee2f4d986aa (diff) |
Merging r44003 through r44069 from trunk into soc-2011-tomato
Diffstat (limited to 'source/blender')
23 files changed, 297 insertions, 186 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 8752defcc15..a045f47cb40 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -197,7 +197,6 @@ void BLF_dir_free(char **dirs, int count); #define BLF_KERNING_DEFAULT (1<<3) #define BLF_MATRIX (1<<4) #define BLF_ASPECT (1<<5) -#define BLF_TEXFILTER (1<<6) #define BLF_DRAW_STR_DUMMY_MAX 1024 diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index ab7ef8072a9..f0cfcdc97b9 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -54,8 +54,6 @@ #include "blf_internal_types.h" #include "blf_internal.h" -#define _BLF_PADDING 3 -#define _BLF_MIPMAP_LEVELS 3 GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi) { @@ -89,11 +87,7 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font) gc->cur_tex= -1; gc->x_offs= 0; gc->y_offs= 0; - /* Increase padding for each mipmap level: 0->3, 1->4, 2->6, 3->10, ... */ - if (font->flags & BLF_TEXFILTER) - gc->pad= pow(2, _BLF_MIPMAP_LEVELS) + 2; - else - gc->pad= _BLF_PADDING; + gc->pad= 3; gc->num_glyphs= font->face->num_glyphs; gc->rem_glyphs= font->face->num_glyphs; @@ -302,17 +296,13 @@ void blf_glyph_free(GlyphBLF *g) static void blf_texture_draw(float uv[2][2], float dx, float y1, float dx1, float y2) { - /* When a string is being rendered as individual glyphs (as in the game - * engine), the leading edge needs to be raised a fraction to prevent - * z-fighting for kerned characters. - z0r */ - const float twist = (dx1 - dx) * 0.0002f; - + glBegin(GL_QUADS); glTexCoord2f(uv[0][0], uv[0][1]); - glVertex3f(dx, y1, twist); + glVertex2f(dx, y1); glTexCoord2f(uv[0][0], uv[1][1]); - glVertex3f(dx, y2, twist); + glVertex2f(dx, y2); glTexCoord2f(uv[1][0], uv[1][1]); glVertex2f(dx1, y2); @@ -415,15 +405,6 @@ int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y) glBindTexture(GL_TEXTURE_2D, g->tex); glTexSubImage2D(GL_TEXTURE_2D, 0, g->xoff, g->yoff, g->width, g->height, GL_ALPHA, GL_UNSIGNED_BYTE, g->bitmap); - if (font->flags & BLF_TEXFILTER) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, - _BLF_MIPMAP_LEVELS); - glGenerateMipmap(GL_TEXTURE_2D); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR_MIPMAP_LINEAR); - } glPopClientAttrib(); g->uv[0][0]= ((float)g->xoff) / ((float)gc->p2_width); diff --git a/source/blender/blenkernel/BKE_booleanops_mesh.h b/source/blender/blenkernel/BKE_booleanops_mesh.h index 7c989ea17e6..4c4a2dc9998 100644 --- a/source/blender/blenkernel/BKE_booleanops_mesh.h +++ b/source/blender/blenkernel/BKE_booleanops_mesh.h @@ -24,8 +24,8 @@ * * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BKE_PyBooleanOps_h -#define BKE_PyBooleanOps_h +#ifndef BKE_BOOLEANOPS_MESH_H +#define BKE_BOOLEANOPS_MESH_H /** \file BKE_booleanops_mesh.h * \ingroup bke diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index cd3933d3c44..f0b05846670 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -1365,6 +1365,35 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData if(pind->keyed || pind->cache || point_vel) mul_v3_fl(result->vel, 1.f/invdt); } + +static void interpolate_pathcache(ParticleCacheKey *first, float t, ParticleCacheKey *result) +{ + int i=0; + ParticleCacheKey *cur = first; + + /* scale the requested time to fit the entire path even if the path is cut early */ + t *= (first+first->steps)->time; + + while(i<first->steps && cur->time < t) + cur++; + + if(cur->time == t) + *result = *cur; + else { + float dt = (t-(cur-1)->time)/(cur->time-(cur-1)->time); + interp_v3_v3v3(result->co, (cur-1)->co, cur->co, dt); + interp_v3_v3v3(result->vel, (cur-1)->vel, cur->vel, dt); + interp_qt_qtqt(result->rot, (cur-1)->rot, cur->rot, dt); + result->time = t; + } + + /* first is actual base rotation, others are incremental from first */ + if(cur==first || cur-1==first) + copy_qt_qt(result->rot, first->rot); + else + mul_qt_qtqt(result->rot, first->rot, result->rot); +} + /************************************************/ /* Particles on a dm */ /************************************************/ @@ -2648,6 +2677,8 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle /* offset the child from the parent position */ offset_child(cpa, (ParticleKey*)(key[0]+k), par_rot, (ParticleKey*)child, part->childflat, part->childrad); } + + child->time = (float)k/(float)ctx->steps; } /* apply effectors */ @@ -3009,6 +3040,8 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra) if(k==1) copy_v3_v3((ca-1)->vel, ca->vel); + + ca->time = (float)k/(float)steps; } /* First rotation is based on emitting face orientation. * This is way better than having flipping rotations resulting @@ -3089,6 +3122,9 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf if(edit->totcached && !(point->flag & PEP_EDIT_RECALC)) continue; + if(point->totkey == 0) + continue; + ekey = point->keys; pind.keyed = 0; @@ -4013,84 +4049,105 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * CLAMP(t, 0.0f, 1.0f); if(p<totpart){ - pa = psys->particles + p; - pind.keyed = keyed; - pind.cache = cached ? psys->pointcache : NULL; - pind.epoint = NULL; - pind.bspline = (psys->part->flag & PART_HAIR_BSPLINE); - /* pind.dm disabled in editmode means we dont get effectors taken into - * account when subdividing for instance */ - pind.dm = psys_in_edit_mode(sim->scene, psys) ? NULL : psys->hair_out_dm; - init_particle_interpolation(sim->ob, psys, pa, &pind); - do_particle_interpolation(psys, p, pa, t, &pind, state); - - if(pind.dm) { - mul_m4_v3(sim->ob->obmat, state->co); - mul_mat3_m4_v3(sim->ob->obmat, state->vel); - } - else if(!keyed && !cached && !(psys->flag & PSYS_GLOBAL_HAIR)) { - if((pa->flag & PARS_REKEY)==0) { - psys_mat_hair_to_global(sim->ob, sim->psmd->dm, part->from, pa, hairmat); - mul_m4_v3(hairmat, state->co); - mul_mat3_m4_v3(hairmat, state->vel); - - if(sim->psys->effectors && (part->flag & PART_CHILD_GUIDE)==0) { - do_guides(sim->psys->effectors, state, p, state->time); - /* TODO: proper velocity handling */ - } + /* interpolate pathcache directly if it exist */ + if(psys->pathcache) { + ParticleCacheKey result; + interpolate_pathcache(psys->pathcache[p], t, &result); + copy_v3_v3(state->co, result.co); + copy_v3_v3(state->vel, result.vel); + copy_qt_qt(state->rot, result.rot); + } + /* otherwise interpolate with other means */ + else { + pa = psys->particles + p; + + pind.keyed = keyed; + pind.cache = cached ? psys->pointcache : NULL; + pind.epoint = NULL; + pind.bspline = (psys->part->flag & PART_HAIR_BSPLINE); + /* pind.dm disabled in editmode means we dont get effectors taken into + * account when subdividing for instance */ + pind.dm = psys_in_edit_mode(sim->scene, psys) ? NULL : psys->hair_out_dm; + init_particle_interpolation(sim->ob, psys, pa, &pind); + do_particle_interpolation(psys, p, pa, t, &pind, state); + + if(pind.dm) { + mul_m4_v3(sim->ob->obmat, state->co); + mul_mat3_m4_v3(sim->ob->obmat, state->vel); + } + else if(!keyed && !cached && !(psys->flag & PSYS_GLOBAL_HAIR)) { + if((pa->flag & PARS_REKEY)==0) { + psys_mat_hair_to_global(sim->ob, sim->psmd->dm, part->from, pa, hairmat); + mul_m4_v3(hairmat, state->co); + mul_mat3_m4_v3(hairmat, state->vel); + + if(sim->psys->effectors && (part->flag & PART_CHILD_GUIDE)==0) { + do_guides(sim->psys->effectors, state, p, state->time); + /* TODO: proper velocity handling */ + } - if(psys->lattice && edit==0) - calc_latt_deform(psys->lattice, state->co,1.0f); + if(psys->lattice && edit==0) + calc_latt_deform(psys->lattice, state->co,1.0f); + } } } } else if(totchild){ //invert_m4_m4(imat,ob->obmat); - cpa=psys->child+p-totpart; + /* interpolate childcache directly if it exists */ + if(psys->childcache) { + ParticleCacheKey result; + interpolate_pathcache(psys->childcache[p-totpart], t, &result); + copy_v3_v3(state->co, result.co); + copy_v3_v3(state->vel, result.vel); + copy_qt_qt(state->rot, result.rot); + } + else { + cpa=psys->child+p-totpart; - if(state->time < 0.0f) - t = psys_get_child_time(psys, cpa, -state->time, NULL, NULL); + if(state->time < 0.0f) + t = psys_get_child_time(psys, cpa, -state->time, NULL, NULL); - if(totchild && part->childtype==PART_CHILD_FACES){ - /* part->parents could still be 0 so we can't test with totparent */ - between=1; - } - if(between){ - int w = 0; - float foffset; - - /* get parent states */ - while(w<4 && cpa->pa[w]>=0){ - keys[w].time = state->time; - psys_get_particle_on_path(sim, cpa->pa[w], keys+w, 1); - w++; + if(totchild && part->childtype==PART_CHILD_FACES){ + /* part->parents could still be 0 so we can't test with totparent */ + between=1; } + if(between){ + int w = 0; + float foffset; + + /* get parent states */ + while(w<4 && cpa->pa[w]>=0){ + keys[w].time = state->time; + psys_get_particle_on_path(sim, cpa->pa[w], keys+w, 1); + w++; + } - /* get the original coordinates (orco) for texture usage */ - cpa_num=cpa->num; + /* get the original coordinates (orco) for texture usage */ + cpa_num=cpa->num; - foffset= cpa->foffset; - cpa_fuv = cpa->fuv; - cpa_from = PART_FROM_FACE; + foffset= cpa->foffset; + cpa_fuv = cpa->fuv; + cpa_from = PART_FROM_FACE; - psys_particle_on_emitter(psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa->fuv,foffset,co,0,0,0,orco,0); + psys_particle_on_emitter(psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa->fuv,foffset,co,0,0,0,orco,0); - /* we need to save the actual root position of the child for positioning it accurately to the surface of the emitter */ - //copy_v3_v3(cpa_1st,co); + /* we need to save the actual root position of the child for positioning it accurately to the surface of the emitter */ + //copy_v3_v3(cpa_1st,co); - //mul_m4_v3(ob->obmat,cpa_1st); + //mul_m4_v3(ob->obmat,cpa_1st); - pa = psys->particles + cpa->parent; + pa = psys->particles + cpa->parent; - if(part->type == PART_HAIR) - psys_mat_hair_to_global(sim->ob, sim->psmd->dm, psys->part->from, pa, hairmat); - else - unit_m4(hairmat); + if(part->type == PART_HAIR) + psys_mat_hair_to_global(sim->ob, sim->psmd->dm, psys->part->from, pa, hairmat); + else + unit_m4(hairmat); - pa=0; - } - else{ + pa=0; + } + else{ /* get the parent state */ keys->time = state->time; psys_get_particle_on_path(sim, cpa->parent, keys,1); @@ -4114,74 +4171,75 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * } } - /* correct child ipo timing */ -#if 0 // XXX old animation system - if((part->flag&PART_ABS_TIME)==0 && part->ipo){ - calc_ipo(part->ipo, 100.0f*t); - execute_ipo((ID *)part, part->ipo); - } -#endif // XXX old animation system + /* correct child ipo timing */ + #if 0 // XXX old animation system + if((part->flag&PART_ABS_TIME)==0 && part->ipo){ + calc_ipo(part->ipo, 100.0f*t); + execute_ipo((ID *)part, part->ipo); + } + #endif // XXX old animation system - /* get different child parameters from textures & vgroups */ - memset(&ctx, 0, sizeof(ParticleThreadContext)); - ctx.sim = *sim; - ctx.dm = psmd->dm; - ctx.ma = ma; - /* TODO: assign vertex groups */ - get_child_modifier_parameters(part, &ctx, cpa, cpa_from, cpa_num, cpa_fuv, orco, &ptex); - - if(between){ - int w=0; + /* get different child parameters from textures & vgroups */ + memset(&ctx, 0, sizeof(ParticleThreadContext)); + ctx.sim = *sim; + ctx.dm = psmd->dm; + ctx.ma = ma; + /* TODO: assign vertex groups */ + get_child_modifier_parameters(part, &ctx, cpa, cpa_from, cpa_num, cpa_fuv, orco, &ptex); + + if(between){ + int w=0; + + state->co[0] = state->co[1] = state->co[2] = 0.0f; + state->vel[0] = state->vel[1] = state->vel[2] = 0.0f; + + /* child position is the weighted sum of parent positions */ + while(w<4 && cpa->pa[w]>=0){ + state->co[0] += cpa->w[w] * keys[w].co[0]; + state->co[1] += cpa->w[w] * keys[w].co[1]; + state->co[2] += cpa->w[w] * keys[w].co[2]; + + state->vel[0] += cpa->w[w] * keys[w].vel[0]; + state->vel[1] += cpa->w[w] * keys[w].vel[1]; + state->vel[2] += cpa->w[w] * keys[w].vel[2]; + w++; + } + /* apply offset for correct positioning */ + //add_v3_v3(state->co, cpa_1st); + } + else{ + /* offset the child from the parent position */ + offset_child(cpa, keys, keys->rot, state, part->childflat, part->childrad); + } - state->co[0] = state->co[1] = state->co[2] = 0.0f; - state->vel[0] = state->vel[1] = state->vel[2] = 0.0f; + par = keys; - /* child position is the weighted sum of parent positions */ - while(w<4 && cpa->pa[w]>=0){ - state->co[0] += cpa->w[w] * keys[w].co[0]; - state->co[1] += cpa->w[w] * keys[w].co[1]; - state->co[2] += cpa->w[w] * keys[w].co[2]; - - state->vel[0] += cpa->w[w] * keys[w].vel[0]; - state->vel[1] += cpa->w[w] * keys[w].vel[1]; - state->vel[2] += cpa->w[w] * keys[w].vel[2]; - w++; - } - /* apply offset for correct positioning */ - //add_v3_v3(state->co, cpa_1st); - } - else{ - /* offset the child from the parent position */ - offset_child(cpa, keys, keys->rot, state, part->childflat, part->childrad); - } + if(vel) + copy_particle_key(&tstate, state, 1); - par = keys; + /* apply different deformations to the child path */ + do_child_modifiers(sim, &ptex, par, par->rot, cpa, orco, hairmat, state, t); - if(vel) - copy_particle_key(&tstate, state, 1); + /* try to estimate correct velocity */ + if(vel){ + ParticleKey tstate; + float length = len_v3(state->vel); - /* apply different deformations to the child path */ - do_child_modifiers(sim, &ptex, par, par->rot, cpa, orco, hairmat, state, t); - - /* try to estimate correct velocity */ - if(vel){ - ParticleKey tstate; - float length = len_v3(state->vel); - - if(t>=0.001f){ - tstate.time=t-0.001f; - psys_get_particle_on_path(sim,p,&tstate,0); - sub_v3_v3v3(state->vel,state->co,tstate.co); - normalize_v3(state->vel); - } - else{ - tstate.time=t+0.001f; - psys_get_particle_on_path(sim,p,&tstate,0); - sub_v3_v3v3(state->vel,tstate.co,state->co); - normalize_v3(state->vel); - } + if(t>=0.001f){ + tstate.time=t-0.001f; + psys_get_particle_on_path(sim,p,&tstate,0); + sub_v3_v3v3(state->vel,state->co,tstate.co); + normalize_v3(state->vel); + } + else{ + tstate.time=t+0.001f; + psys_get_particle_on_path(sim,p,&tstate,0); + sub_v3_v3v3(state->vel,tstate.co,state->co); + normalize_v3(state->vel); + } - mul_v3_fl(state->vel, length); + mul_v3_fl(state->vel, length); + } } } } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 5a64da7354e..c00101c98ab 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3407,6 +3407,7 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra) ParticleSystem *psys = sim->psys; ParticleSettings *part = psys->part; ParticleEditSettings *pset = &sim->scene->toolsettings->particle; + Base *base; int distr=0, alloc=0, skip=0; if((psys->part->childtype && psys->totchild != get_psys_tot_child(sim->scene, psys)) || psys->recalc&PSYS_RECALC_RESET) @@ -3449,6 +3450,19 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra) } } + + /* particle instance modifier with "path" option need cached paths even if particle system doesn't */ + for (base = sim->scene->base.first; base; base= base->next) { + ModifierData *md = modifiers_findByType(base->object, eModifierType_ParticleInstance); + if(md) { + ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *)md; + if(pimd->flag & eParticleInstanceFlag_Path && pimd->ob == sim->ob && pimd->psys == (psys - (ParticleSystem*)sim->ob->particlesystem.first)) { + skip = 0; + break; + } + } + } + if(!skip) { psys_cache_paths(sim, cfra); @@ -4414,6 +4428,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys) if(psys->totpart == 0 && part->totpart == 0) { psys_free_path_cache(psys, NULL); free_hair(ob, psys, 0); + psys->flag |= PSYS_HAIR_DONE; } /* (re-)create hair */ else if(hair_needs_recalc(psys)) { diff --git a/source/blender/blenlib/BLI_callbacks.h b/source/blender/blenlib/BLI_callbacks.h index 7e4fad54cda..201ada45acf 100644 --- a/source/blender/blenlib/BLI_callbacks.h +++ b/source/blender/blenlib/BLI_callbacks.h @@ -29,7 +29,6 @@ * \ingroup bli */ - #ifndef BLI_CALLBACKS_H #define BLI_CALLBACKS_H @@ -64,12 +63,11 @@ typedef struct { void BLI_exec_cb(struct Main *main, struct ID *self, eCbEvent evt); void BLI_add_cb(bCallbackFuncStore *funcstore, eCbEvent evt); -#endif - - void BLI_cb_init(void); void BLI_cb_finalize(void); /* This is blenlib internal only, unrelated to above */ void callLocalErrorCallBack(const char* msg); + +#endif /* BLI_CALLBACKS_H */ diff --git a/source/blender/blenlib/BLI_graph.h b/source/blender/blenlib/BLI_graph.h index f625c7bb2d4..056bba71dea 100644 --- a/source/blender/blenlib/BLI_graph.h +++ b/source/blender/blenlib/BLI_graph.h @@ -1,3 +1,27 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2008 Blender Foundation. + * All rights reserved. + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ #ifndef BLI_GRAPH_H_ #define BLI_GRAPH_H_ diff --git a/source/blender/collada/TransformWriter.cpp b/source/blender/collada/TransformWriter.cpp index a2bca6733e1..c806cd48587 100644 --- a/source/blender/collada/TransformWriter.cpp +++ b/source/blender/collada/TransformWriter.cpp @@ -103,8 +103,7 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob) if(ob->parentinv[i%4][i/4] != f) add_parinv = true; } - // Eat this 3ds Max et friends - if(add_parinv) + if(add_parinv && ob->parent) { double dmat[4][4]; UnitConverter converter; diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index a70db7ad235..5eacef1478a 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -590,9 +590,9 @@ static void ui_theme_init_new(bTheme *btheme) /* initialize default theme - Note: when you add new colors, created & saved themes need initialized - use function below, init_userdef_do_versions() -*/ + * Note: when you add new colors, created & saved themes need initialized + * use function below, init_userdef_do_versions() + */ void ui_theme_init_default(void) { bTheme *btheme; @@ -613,7 +613,9 @@ void ui_theme_init_default(void) /* UI buttons */ ui_widget_color_init(&btheme->tui); btheme->tui.iconfile[0]= 0; - + btheme->tui.panel.show_header = FALSE; + SETCOL(btheme->tui.panel.header, 0, 0, 0, 25); + /* Bone Color Sets */ ui_theme_init_boneColorSets(btheme); diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index b10fbaf69b7..09ae5e08d60 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -403,6 +403,10 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event) free_editMesh(me->edit_mesh); MEM_freeN(me->edit_mesh); me->edit_mesh= NULL; + + /* load_editMesh free's pointers used by CustomData layers which might be used by DerivedMesh too, + * so signal to re-create DerivedMesh here (sergey) */ + DAG_id_tag_update(&me->id, 0); } /* dummie drop support; ensure view shows a result :) */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 0d724dc1b28..2c652df93a0 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -44,6 +44,7 @@ #include "DNA_curve_types.h" #include "DNA_scene_types.h" #include "DNA_meta_types.h" +#include "DNA_userdef_types.h" #include "BKE_context.h" #include "BKE_customdata.h" @@ -1821,8 +1822,9 @@ static int frame_offset_exec(bContext *C, wmOperator *op) delta = RNA_int_get(op->ptr, "delta"); - scene->r.cfra += delta; - scene->r.subframe = 0.f; + CFRA += delta; + FRAMENUMBER_MIN_CLAMP(CFRA); + SUBFRA = 0.f; sound_seek_scene(bmain, scene); diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index eaa04a1e09e..942e1024c05 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -441,15 +441,15 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar uiBlockSetEmboss(block, UI_EMBOSSN); restrict_bool= group_restrict_flag(gr, OB_RESTRICT_VIEW); - bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_VIEW_ON : ICON_RESTRICT_VIEW_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, NULL, 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); + bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_VIEW_ON : ICON_RESTRICT_VIEW_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, NULL, 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); uiButSetFunc(bt, restrictbutton_gr_restrict_view, scene, gr); restrict_bool= group_restrict_flag(gr, OB_RESTRICT_SELECT); - bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_SELECT_ON : ICON_RESTRICT_SELECT_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, NULL, 0, 0, 0, 0, "Restrict/Allow selection in the 3D View"); + bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_SELECT_ON : ICON_RESTRICT_SELECT_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, NULL, 0, 0, 0, 0, "Restrict/Allow selection in the 3D View"); uiButSetFunc(bt, restrictbutton_gr_restrict_select, scene, gr); restrict_bool= group_restrict_flag(gr, OB_RESTRICT_RENDER); - bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_RENDER_ON : ICON_RESTRICT_RENDER_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, NULL, 0, 0, 0, 0, "Restrict/Allow renderability"); + bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_RENDER_ON : ICON_RESTRICT_RENDER_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (int)te->ys, UI_UNIT_X-1, UI_UNIT_Y-1, NULL, 0, 0, 0, 0, "Restrict/Allow renderability"); uiButSetFunc(bt, restrictbutton_gr_restrict_render, scene, gr); uiBlockSetEmboss(block, UI_EMBOSS); diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 562cbf45e86..eb910b0b0b5 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -500,7 +500,7 @@ static int outliner_toggle_renderability_exec(bContext *C, wmOperator *UNUSED(op outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_renderability_cb); - ED_region_tag_redraw(ar); + WM_event_add_notifier(C, NC_SCENE|ND_OB_RENDER, scene); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index a040c63b2ab..ebbe28e62fa 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -265,6 +265,7 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn) case NC_ANIMATION: switch(wmn->data) { case ND_NLA_ACTCHANGE: + case ND_KEYFRAME: ED_region_tag_redraw(ar); break; case ND_ANIMCHAN: diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 66aefc72f33..03fd22d1045 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -325,20 +325,22 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad RNA_string_get(&itemptr, "name", file_only); BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only); - seq= seq_load_func(C, ed->seqbasep, &seq_load); - - if(overlap == FALSE) { - if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + seq = seq_load_func(C, ed->seqbasep, &seq_load); + if (seq) { + if(overlap == FALSE) { + if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + } } } RNA_END; } else { /* single file */ - seq= seq_load_func(C, ed->seqbasep, &seq_load); - - if(overlap == FALSE) { - if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + seq = seq_load_func(C, ed->seqbasep, &seq_load); + if (seq) { + if(overlap == FALSE) { + if(seq_test_overlap(ed->seqbasep, seq)) shuffle_seq(ed->seqbasep, seq, scene); + } } } @@ -711,7 +713,8 @@ static int sequencer_add_effect_strip_invoke(bContext *C, wmOperator *op, wmEven if (is_type_set && type==SEQ_PLUGIN) { /* only plugins need the file selector */ - return WM_operator_filesel(C, op, event); + WM_event_add_fileselect(C, op); + return OPERATOR_RUNNING_MODAL; } else { return sequencer_add_effect_strip_exec(C, op); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 59802f2cf58..926faeb417e 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -598,9 +598,6 @@ int GPU_verify_image(Image *ima, ImageUser *iuser, int tftile, int compare, int if(use_high_bit_depth) { fscalerect= MEM_mallocN(rectw*recth*sizeof(*fscalerect)*4, "fscalerect"); gluScaleImage(GL_RGBA, tpx, tpy, GL_FLOAT, frect, rectw, recth, GL_FLOAT, fscalerect); - /* frect will refer to ibuf->rect_float when not color converting. We don't want to free that */ - if(do_color_management) - MEM_freeN(frect); frect = fscalerect; } diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index a6672130dc3..a3e3eb19a5b 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -174,7 +174,8 @@ void GPU_extensions_init(void) strstr(renderer, "R5") || strstr(renderer, "RV5") || strstr(renderer, "RS600") || strstr(renderer, "RS690") || strstr(renderer, "RS740") || strstr(renderer, "X1") || - strstr(renderer, "X2")) + strstr(renderer, "X2") || strstr(renderer, "Radeon 9") || + strstr(renderer, "RADEON 9")) GG.npotdisabled = 1; } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index cb4151d8aee..80ddc023250 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1976,6 +1976,11 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); + prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES); + RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); + /* grease pencil */ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "gpd"); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index bc7f446d815..f7c85583150 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2080,6 +2080,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Name of the theme"); RNA_def_struct_name_property(srna, prop); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); /* XXX: for now putting this in presets is silly - its just Default */ prop= RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "active_theme_area"); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 8ae597f2d1c..4f8f301dcbd 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -67,6 +67,14 @@ EnumPropertyItem event_value_items[] = { {KM_RELEASE, "RELEASE", 0, "Release", ""}, {KM_CLICK, "CLICK", 0, "Click", ""}, {KM_DBL_CLICK, "DOUBLE_CLICK", 0, "Double Click", ""}, + {EVT_GESTURE_N, "NORTH", 0, "North", ""}, + {EVT_GESTURE_NE, "NORTH_EAST", 0, "North-East", ""}, + {EVT_GESTURE_E, "EAST", 0, "East", ""}, + {EVT_GESTURE_SE, "SOUTH_EAST", 0, "South-East", ""}, + {EVT_GESTURE_S, "SOUTH", 0, "South", ""}, + {EVT_GESTURE_SW, "SOUTH_WEST", 0, "South-West", ""}, + {EVT_GESTURE_W, "WEST", 0, "West", ""}, + {EVT_GESTURE_NW, "NORTH_WEST", 0, "North-West", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem event_tweak_type_items[]= { diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt index c6cb6584973..fabaa6624d4 100644 --- a/source/blender/modifiers/CMakeLists.txt +++ b/source/blender/modifiers/CMakeLists.txt @@ -12,7 +12,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # The Original Code is Copyright (C) 2006, Blender Foundation # All rights reserved. diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index b18be28ac7f..d00d76f6f6b 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -789,8 +789,8 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, float cfra; /* float timestep; */ int *facepa=emd->facepa; - int totdup=0,totvert=0,totface=0,totpart=0; - int i, v; + int totdup=0,totvert=0,totface=0,totpart=0,delface=0; + int i, v, u; unsigned int ed_v1, ed_v2, mindex=0; MTFace *mtface = NULL, *mtf; @@ -812,6 +812,18 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, vertpahash= BLI_edgehash_new(); for (i=0; i<totface; i++) { + if(facepa[i]!=totpart) + { + pa=pars+facepa[i]; + + if((pa->alive==PARS_UNBORN && (emd->flag&eExplodeFlag_Unborn)==0) + || (pa->alive==PARS_ALIVE && (emd->flag&eExplodeFlag_Alive)==0) + || (pa->alive==PARS_DEAD && (emd->flag&eExplodeFlag_Dead)==0)) { + delface++; + continue; + } + } + /* do mindex + totvert to ensure the vertex index to be the first * with BLI_edgehashIterator_getKey */ if(facepa[i]==totpart || cfra < (pars+facepa[i])->time) @@ -838,7 +850,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, BLI_edgehashIterator_free(ehi); /* the final duplicated vertices */ - explode= CDDM_from_template(dm, totdup, 0,totface); + explode= CDDM_from_template(dm, totdup, 0,totface-delface); mtface = CustomData_get_layer_named(&explode->faceData, CD_MTFACE, emd->uvname); /*dupvert= CDDM_get_verts(explode);*/ @@ -893,7 +905,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, BLI_edgehashIterator_free(ehi); /*map new vertices to faces*/ - for (i=0; i<totface; i++) { + for (i=0,u=0; i<totface; i++) { MFace source; int orig_v4; @@ -907,7 +919,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, } dm->getFace(dm,i,&source); - mf=CDDM_get_face(explode,i); + mf=CDDM_get_face(explode,u); orig_v4 = source.v4; @@ -922,7 +934,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, if(source.v4) source.v4 = edgecut_get(vertpahash, source.v4, mindex); - DM_copy_face_data(dm,explode,i,i,1); + DM_copy_face_data(dm,explode,i,u,1); *mf = source; @@ -932,13 +944,14 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd, /* Clamp to this range to avoid flipping to the other side of the coordinates. */ CLAMP(age, 0.001f, 0.999f); - mtf = mtface + i; + mtf = mtface + u; mtf->uv[0][0] = mtf->uv[1][0] = mtf->uv[2][0] = mtf->uv[3][0] = age; mtf->uv[0][1] = mtf->uv[1][1] = mtf->uv[2][1] = mtf->uv[3][1] = 0.5f; } - test_index_face(mf, &explode->faceData, i, (orig_v4 ? 4 : 3)); + test_index_face(mf, &explode->faceData, u, (orig_v4 ? 4 : 3)); + u++; } /* cleanup */ diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index dec701d5fc3..765df7afcf9 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -1497,7 +1497,7 @@ int column_vector_multiplication(float r_vec[MAX_DIMENSIONS], VectorObject *vec, vec_cpy[3] = 1.0f; } else { - PyErr_SetString(PyExc_TypeError, + PyErr_SetString(PyExc_ValueError, "matrix * vector: " "len(matrix.col) and len(vector) must be the same, " "except for 4x4 matrix * 3D vector."); |