diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2008-06-09 00:12:29 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2008-06-09 00:12:29 +0400 |
commit | 07001e708ed59e69871e8b4b096106981d9e6cd7 (patch) | |
tree | 45a035b9d981af9c6e953e85977a3c30a3ec5a29 /source/blender/src | |
parent | 062fb01614be23623fc9ebedc1ca1307ceb9a1bf (diff) | |
parent | 71573cbd55a9088f4f3011da473ad6101fc2b531 (diff) |
soc-2008-mxcurioni: merged changes to revision 15163
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/buttons_object.c | 2 | ||||
-rw-r--r-- | source/blender/src/buttons_scene.c | 15 | ||||
-rw-r--r-- | source/blender/src/drawipo.c | 8 | ||||
-rw-r--r-- | source/blender/src/drawobject.c | 207 | ||||
-rw-r--r-- | source/blender/src/drawseq.c | 2 | ||||
-rw-r--r-- | source/blender/src/drawview.c | 23 | ||||
-rw-r--r-- | source/blender/src/editaction.c | 13 | ||||
-rw-r--r-- | source/blender/src/editarmature.c | 64 | ||||
-rw-r--r-- | source/blender/src/editmesh_tools.c | 3 | ||||
-rw-r--r-- | source/blender/src/editnode.c | 19 | ||||
-rw-r--r-- | source/blender/src/editseq.c | 93 | ||||
-rw-r--r-- | source/blender/src/filesel.c | 2 | ||||
-rw-r--r-- | source/blender/src/fluidsim.c | 33 | ||||
-rw-r--r-- | source/blender/src/interface.c | 1 | ||||
-rw-r--r-- | source/blender/src/meshtools.c | 11 | ||||
-rw-r--r-- | source/blender/src/poseobject.c | 8 | ||||
-rw-r--r-- | source/blender/src/space.c | 2 | ||||
-rw-r--r-- | source/blender/src/toets.c | 4 | ||||
-rw-r--r-- | source/blender/src/transform.c | 45 | ||||
-rw-r--r-- | source/blender/src/transform_conversions.c | 3 | ||||
-rw-r--r-- | source/blender/src/transform_manipulator.c | 49 | ||||
-rw-r--r-- | source/blender/src/view.c | 49 |
22 files changed, 449 insertions, 207 deletions
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index ec2cea46904..f564b671fb0 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -4034,7 +4034,7 @@ static void object_softbodies(Object *ob) uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Aero:", 30,10,60,20, &sb->aeroedge, 0.00, 30000.0, 10, 0, "Make edges 'sail'"); uiDefButS(block, NUM, B_BAKE_CACHE_CHANGE, "Plas:", 90,10,60,20, &sb->plastic, 0.0, 100.0, 10, 0, "Permanent deform"); if(ob->type==OB_MESH) { - uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Be:", 150,10,80,20, &sb->secondspring, 0.0, 10.0, 10, 0, "Bendig Stiffness"); + uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Be:", 150,10,80,20, &sb->secondspring, 0.0, 10.0, 10, 0, "Bending Stiffness"); if (*softflag & OB_SB_QUADS){ uiDefButF(block, NUM, B_BAKE_CACHE_CHANGE, "Sh:", 230,10,80,20, &sb->shearstiff, 0.0, 1.0, 10, 0, "Shear Stiffness"); } diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 89b0864cec5..78b6abb5773 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -2150,6 +2150,10 @@ static void render_panel_bake(void) "Normalized displacement value to fit the 'Dist' range" ); } + + uiDefButS(block, MENU, B_NOP, "Quad Split Order%t|Quad Split Auto%x0|Quad Split A (0,1,2) (0,2,3)%x1|Quad Split B (1,2,3) (1,3,0)%x2", + 10,10,190,20, &G.scene->r.bake_quad_split, 0, 0, 0, 0, "Method to divide quads (use A or B for external applications that use a fixed order)"); + #if 0 uiBlockBeginAlign(block); uiDefButBitS(block, TOG, R_BAKE_OSA, B_DIFF, "OSA", 10,120,190,20, &G.scene->r.bake_flag, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)"); @@ -2161,14 +2165,15 @@ static void render_panel_bake(void) uiBlockBeginAlign(block); uiDefButS(block, ROW,B_REDR,"Full Render", 210,170,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_ALL, 0, 0, ""); uiDefButS(block, ROW,B_REDR,"Ambient Occlusion",210,150,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_AO, 0, 0, ""); - uiDefButS(block, ROW,B_REDR,"Normals", 210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, ""); - uiDefButS(block, ROW,B_REDR,"Textures", 210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, ""); - uiDefButS(block, ROW,B_REDR,"Displacement", 210,90,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_DISPLACEMENT, 0, 0, ""); + uiDefButS(block, ROW,B_REDR,"Shadow", 210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_SHADOW, 0, 0, ""); + uiDefButS(block, ROW,B_REDR,"Normals", 210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, ""); + uiDefButS(block, ROW,B_REDR,"Textures", 210,90,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, ""); + uiDefButS(block, ROW,B_REDR,"Displacement", 210,70,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_DISPLACEMENT, 0, 0, ""); uiBlockEndAlign(block); - uiDefButBitS(block, TOG, R_BAKE_CLEAR, B_DIFF, "Clear", 210,60,120,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Clear Images before baking"); + uiDefButBitS(block, TOG, R_BAKE_CLEAR, B_DIFF, "Clear", 210,40,120,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Clear Images before baking"); - uiDefButS(block, NUM, B_DIFF,"Margin:", 210,30,120,20,&G.scene->r.bake_filter, 0.0, 32.0, 0, 0, "Amount of pixels to extend the baked result with, as post process filter"); + uiDefButS(block, NUM, B_DIFF,"Margin:", 210,10,120,20,&G.scene->r.bake_filter, 0.0, 32.0, 0, 0, "Amount of pixels to extend the baked result with, as post process filter"); } static void render_panel_simplify(void) diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index 521e3ebd981..2018d0e75a6 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -1712,7 +1712,7 @@ static void boundbox_ipo_curves(SpaceIpo *si) /* is used for both read and write... */ static void ipo_editvertex_buts(uiBlock *block, SpaceIpo *si, float min, float max) { - Object *ob= OBACT; + Object *ob; EditIpo *ei; BezTriple *bezt; float median[3]; @@ -1721,6 +1721,12 @@ static void ipo_editvertex_buts(uiBlock *block, SpaceIpo *si, float min, float m median[0]= median[1]= median[2]= 0.0; tot= 0; + /* use G.sipo->from (which should be an object) so that pinning ipo's will still work ok */ + if((G.sipo->from) && (GS(G.sipo->from->name) == ID_OB)) + ob= (Object *)(G.sipo->from); + else + ob= OBACT; + ei= G.sipo->editipo; for(a=0; a<G.sipo->totipo; a++, ei++) { diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 1ee30501a1a..8ed4de8ec01 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -2880,7 +2880,7 @@ static int drawDispList(Base *base, int dt) /* 5. start filling the arrays */ /* 6. draw the arrays */ /* 7. clean up */ -static void draw_new_particle_system(Base *base, ParticleSystem *psys) +static void draw_new_particle_system(Base *base, ParticleSystem *psys, int dt) { View3D *v3d= G.vd; Object *ob=base->object; @@ -2897,7 +2897,7 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) float *vdata=0, *vedata=0, *cdata=0, *ndata=0, *vd=0, *ved=0, *cd=0, *nd=0, xvec[3], yvec[3], zvec[3]; int a, k, k_max=0, totpart, totpoint=0, draw_as, path_nbr=0; int path_possible=0, keys_possible=0, draw_keys=0, totchild=0; - int select=ob->flag&SELECT; + int select=ob->flag&SELECT, create_cdata=0; GLint polygonmode[2]; char val[32]; @@ -2951,8 +2951,10 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) if(select) cpack(0xFFFFFF); - else if((ma) && (part->draw&PART_DRAW_MAT_COL)) + else if((ma) && (part->draw&PART_DRAW_MAT_COL)) { glColor3f(ma->r,ma->g,ma->b); + create_cdata = 1; + } else cpack(0); @@ -3060,19 +3062,25 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) if(draw_as!=PART_DRAW_CIRC){ switch(draw_as){ case PART_DRAW_AXIS: - cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*6*3*sizeof(float), "particle_cdata"); - /* no break! */ case PART_DRAW_CROSS: + if(draw_as!=PART_DRAW_CROSS || create_cdata) + cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*6*3*sizeof(float), "particle_cdata"); vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*6*3*sizeof(float), "particle_vdata"); break; case PART_DRAW_LINE: + if(create_cdata) + cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*2*3*sizeof(float), "particle_cdata"); vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*2*3*sizeof(float), "particle_vdata"); break; case PART_DRAW_BB: + if(create_cdata) + cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*4*3*sizeof(float), "particle_cdata"); vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*4*3*sizeof(float), "particle_vdata"); ndata=MEM_callocN((totpart+totchild)*(path_nbr+1)*4*3*sizeof(float), "particle_vdata"); break; default: + if(create_cdata) + cdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*3*sizeof(float), "particle_cdata"); vdata=MEM_callocN((totpart+totchild)*(path_nbr+1)*3*sizeof(float), "particle_vdata"); } } @@ -3097,9 +3105,17 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) pa_time=(cfra-pa->time)/pa->lifetime; - if((part->flag&PART_ABS_TIME)==0 && part->ipo){ - calc_ipo(part->ipo, 100*pa_time); - execute_ipo((ID *)part, part->ipo); + if((part->flag&PART_ABS_TIME)==0){ + if(ma && ma->ipo){ + /* correction for lifetime */ + calc_ipo(ma->ipo, 100.0f*pa_time); + execute_ipo((ID *)ma, ma->ipo); + } + if(part->ipo) { + /* correction for lifetime */ + calc_ipo(part->ipo, 100*pa_time); + execute_ipo((ID *)part, part->ipo); + } } pa_size=pa->size; @@ -3116,9 +3132,17 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) pa_time=psys_get_child_time(psys,cpa,cfra); - if((part->flag&PART_ABS_TIME)==0 && part->ipo){ - calc_ipo(part->ipo, 100*pa_time); - execute_ipo((ID *)part, part->ipo); + if((part->flag&PART_ABS_TIME)==0) { + if(ma && ma->ipo){ + /* correction for lifetime */ + calc_ipo(ma->ipo, 100.0f*pa_time); + execute_ipo((ID *)ma, ma->ipo); + } + if(part->ipo) { + /* correction for lifetime */ + calc_ipo(part->ipo, 100*pa_time); + execute_ipo((ID *)part, part->ipo); + } } pa_size=psys_get_child_size(psys,cpa,cfra,0); @@ -3156,6 +3180,12 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) switch(draw_as){ case PART_DRAW_DOT: + if(cd) { + cd[0]=ma->r; + cd[1]=ma->g; + cd[2]=ma->b; + cd+=3; + } if(vd){ VECCOPY(vd,state.co) vd+=3; } @@ -3176,7 +3206,15 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) VECCOPY(vec2,state.co); } - else VECSUB(vec2,state.co,vec); + else { + if(cd) { + cd[0]=cd[3]=cd[6]=cd[9]=cd[12]=cd[15]=ma->r; + cd[1]=cd[4]=cd[7]=cd[10]=cd[13]=cd[16]=ma->g; + cd[2]=cd[5]=cd[8]=cd[11]=cd[14]=cd[17]=ma->b; + cd+=18; + } + VECSUB(vec2,state.co,vec); + } VECADD(vec,state.co,vec); VECCOPY(vd,vec); vd+=3; @@ -3214,11 +3252,25 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) VecMulf(vec,VecLength(state.vel)); VECADDFAC(vd,state.co,vec,-part->draw_line[0]); vd+=3; VECADDFAC(vd,state.co,vec,part->draw_line[1]); vd+=3; + if(cd) { + cd[0]=cd[3]=ma->r; + cd[1]=cd[4]=ma->g; + cd[2]=cd[5]=ma->b; + cd+=3; + } break; case PART_DRAW_CIRC: + if(create_cdata) + glColor3f(ma->r,ma->g,ma->b); drawcircball(GL_LINE_LOOP, state.co, pixsize, imat); break; case PART_DRAW_BB: + if(cd) { + cd[0]=cd[3]=cd[6]=cd[9]=ma->r; + cd[1]=cd[4]=cd[7]=cd[10]=ma->g; + cd[2]=cd[5]=cd[8]=cd[11]=ma->b; + cd+=12; + } if(part->draw&PART_DRAW_BB_LOCK && part->bb_align==PART_BB_VIEW){ VECCOPY(xvec,bb_ob->obmat[0]); Normalize(xvec); @@ -3329,14 +3381,24 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) float *cd2=0,*cdata2=0; glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnable(GL_LIGHTING); - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glEnable(GL_COLOR_MATERIAL); + if(dt > OB_WIRE) { + glEnableClientState(GL_NORMAL_ARRAY); - if(part->draw&PART_DRAW_MAT_COL) - glEnableClientState(GL_COLOR_ARRAY); + if(part->draw&PART_DRAW_MAT_COL) + glEnableClientState(GL_COLOR_ARRAY); + + glEnable(GL_LIGHTING); + glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); + glEnable(GL_COLOR_MATERIAL); + } + else { + glDisableClientState(GL_NORMAL_ARRAY); + + glDisable(GL_COLOR_MATERIAL); + glDisable(GL_LIGHTING); + BIF_ThemeColor(TH_WIRE); + } if(totchild && (part->draw&PART_DRAW_PARENT)==0) totpart=0; @@ -3345,9 +3407,13 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) for(a=0, pa=psys->particles; a<totpart; a++, pa++){ path=cache[a]; glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co); - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); - if(part->draw&PART_DRAW_MAT_COL) - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); + + if(dt > OB_WIRE) { + glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); + if(part->draw&PART_DRAW_MAT_COL) + glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); + } + glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1); } @@ -3355,15 +3421,21 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) for(a=0; a<totchild; a++){ path=cache[a]; glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co); - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); - if(part->draw&PART_DRAW_MAT_COL) - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); + + if(dt > OB_WIRE) { + glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); + if(part->draw&PART_DRAW_MAT_COL) + glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); + } + glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1); } - if(part->draw&PART_DRAW_MAT_COL) - glDisable(GL_COLOR_ARRAY); - glDisable(GL_COLOR_MATERIAL); + if(dt > OB_WIRE) { + if(part->draw&PART_DRAW_MAT_COL) + glDisable(GL_COLOR_ARRAY); + glDisable(GL_COLOR_MATERIAL); + } if(cdata2) MEM_freeN(cdata2); @@ -3384,7 +3456,7 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) else glDisableClientState(GL_VERTEX_ARRAY); - if(ndata && MIN2(G.vd->drawtype, ob->dt)>OB_WIRE){ + if(ndata && dt>OB_WIRE){ glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(GL_FLOAT, 0, ndata); glEnable(GL_LIGHTING); @@ -3394,20 +3466,21 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) glDisable(GL_LIGHTING); } + if(cdata){ + glEnableClientState(GL_COLOR_ARRAY); + glColorPointer(3, GL_FLOAT, 0, cdata); + } + switch(draw_as){ case PART_DRAW_AXIS: case PART_DRAW_CROSS: - if(cdata){ - glEnableClientState(GL_COLOR_ARRAY); - glColorPointer(3, GL_FLOAT, 0, cdata); - } glDrawArrays(GL_LINES, 0, 6*totpoint); break; case PART_DRAW_LINE: glDrawArrays(GL_LINES, 0, 2*totpoint); break; case PART_DRAW_BB: - if(MIN2(G.vd->drawtype, ob->dt)<=OB_WIRE) + if(dt<=OB_WIRE) glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); glDrawArrays(GL_QUADS, 0, 4*totpoint); @@ -3461,7 +3534,7 @@ static void draw_new_particle_system(Base *base, ParticleSystem *psys) mymultmatrix(ob->obmat); // bring back local matrix for dtx } -static void draw_particle_edit(Object *ob, ParticleSystem *psys) +static void draw_particle_edit(Object *ob, ParticleSystem *psys, int dt) { ParticleEdit *edit = psys->edit; ParticleData *pa; @@ -3474,6 +3547,7 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys) float nosel_col[3]; char val[32]; + /* create path and child path cache if it doesn't exist already */ if(psys->pathcache==0){ PE_hide_keys_time(psys,CFRA); psys_cache_paths(ob,psys,CFRA,0); @@ -3488,11 +3562,13 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys) else if(!(pset->flag & PE_SHOW_CHILD) && psys->childcache) free_child_path_cache(psys); + /* opengl setup */ if((G.vd->flag & V3D_ZBUF_SELECT)==0) glDisable(GL_DEPTH_TEST); myloadmatrix(G.vd->viewmat); + /* get selection theme colors */ BIF_GetThemeColor3ubv(TH_VERTEX_SELECT, sel); BIF_GetThemeColor3ubv(TH_VERTEX, nosel); sel_col[0]=(float)sel[0]/255.0f; @@ -3506,41 +3582,61 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys) totchild = psys->totchildcache; /* draw paths */ - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); if(timed) glEnable(GL_BLEND); - if(pset->brushtype == PE_BRUSH_WEIGHT){ - glLineWidth(2.0f); + glEnableClientState(GL_VERTEX_ARRAY); + + if(dt > OB_WIRE) { + /* solid shaded with lighting */ + glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_COLOR_ARRAY); + + glEnable(GL_COLOR_MATERIAL); + glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); + } + else { + /* flat wire color */ + glDisableClientState(GL_NORMAL_ARRAY); glDisable(GL_LIGHTING); + BIF_ThemeColor(TH_WIRE); } - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - glEnable(GL_COLOR_MATERIAL); - - for(i=0, pa=psys->particles, path = psys->pathcache; i<totpart; i++, pa++, path++){ - glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->co); - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel); - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col); - - glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1); - } + /* only draw child paths with lighting */ + if(dt > OB_WIRE) + glEnable(GL_LIGHTING); - glEnable(GL_LIGHTING); if(psys->part->draw_as == PART_DRAW_PATH) { for(i=0, path=psys->childcache; i<totchild; i++,path++){ glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->co); - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel); - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col); + if(dt > OB_WIRE) { + glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel); + glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col); + } glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1); } } - glDisable(GL_COLOR_MATERIAL); + if(dt > OB_WIRE) + glDisable(GL_LIGHTING); + + if(pset->brushtype == PE_BRUSH_WEIGHT) { + glLineWidth(2.0f); + glEnableClientState(GL_COLOR_ARRAY); + glDisable(GL_LIGHTING); + } + + /* draw parents last without lighting */ + for(i=0, pa=psys->particles, path = psys->pathcache; i<totpart; i++, pa++, path++){ + glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->co); + if(dt > OB_WIRE) + glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel); + if(dt > OB_WIRE || pset->brushtype == PE_BRUSH_WEIGHT) + glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col); + + glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1); + } /* draw edit vertices */ if(G.scene->selectmode!=SCE_SELECT_PATH){ @@ -3614,6 +3710,7 @@ static void draw_particle_edit(Object *ob, ParticleSystem *psys) glDisable(GL_BLEND); glDisable(GL_LIGHTING); + glDisable(GL_COLOR_MATERIAL); glDisableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glEnable(GL_DEPTH_TEST); @@ -5006,12 +5103,12 @@ void draw_object(Base *base, int flag) glDepthMask(GL_FALSE); for(psys=ob->particlesystem.first; psys; psys=psys->next) - draw_new_particle_system(base, psys); + draw_new_particle_system(base, psys, dt); if(G.f & G_PARTICLEEDIT && ob==OBACT) { psys= PE_get_current(ob); if(psys && !G.obedit && psys_in_edit_mode(psys)) - draw_particle_edit(ob, psys); + draw_particle_edit(ob, psys, dt); } glDepthMask(GL_TRUE); if(col) cpack(col); diff --git a/source/blender/src/drawseq.c b/source/blender/src/drawseq.c index a59ffc05cab..1c2e7e413a2 100644 --- a/source/blender/src/drawseq.c +++ b/source/blender/src/drawseq.c @@ -691,7 +691,7 @@ static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq, int outli /* draw the main strip body */ if (is_single_image) /* single image */ - draw_shadedstrip(seq, col, seq_tx_get_final_left(seq), y1, seq_tx_get_final_right(seq), y2); + draw_shadedstrip(seq, col, seq_tx_get_final_left(seq, 0), y1, seq_tx_get_final_right(seq, 0), y2); else /* normal operation */ draw_shadedstrip(seq, col, x1, y1, x2, y2); diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 52e0d3d6f05..deb7ddc068d 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -2154,6 +2154,7 @@ void do_viewbuts(unsigned short event) } allqueue(REDRAWVIEW3D, 1); allqueue(REDRAWBUTSOBJECT, 0); + allqueue(REDRAWOOPS, 0); } break; @@ -3732,18 +3733,22 @@ int play_anim(int mode) else viewmove(0); } } else if (event==WHEELDOWNMOUSE || (val && event==PADMINUS)) { /* copied from persptoetsen */ - /* this min and max is also in viewmove() */ - if(G.vd->persp==V3D_CAMOB) { - G.vd->camzoom-= 10; - if(G.vd->camzoom<-30) G.vd->camzoom= -30; + if (G.vd) { /* when using the sequencer this can be NULL */ + /* this min and max is also in viewmove() */ + if(G.vd->persp==V3D_CAMOB) { + G.vd->camzoom-= 10; + if(G.vd->camzoom<-30) G.vd->camzoom= -30; + } + else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2f; } - else if(G.vd->dist<10.0*G.vd->far) G.vd->dist*=1.2f; } else if (event==WHEELUPMOUSE || (val && event==PADPLUSKEY)) { /* copied from persptoetsen */ - if(G.vd->persp==V3D_CAMOB) { - G.vd->camzoom+= 10; - if(G.vd->camzoom>300) G.vd->camzoom= 300; + if (G.vd) { + if(G.vd->persp==V3D_CAMOB) { + G.vd->camzoom+= 10; + if(G.vd->camzoom>300) G.vd->camzoom= 300; + } + else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333f; } - else if(G.vd->dist> 0.001*G.vd->grid) G.vd->dist*=.83333f; } else if(event==MKEY) { if(val) add_marker(CFRA-1); } diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 12b9cb8919f..40b6b7ba6fe 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -1485,7 +1485,7 @@ void insertkey_action(void) data= get_action_context(&datatype); if (data == NULL) return; cfra = frame_to_float(CFRA); - + if (datatype == ACTCONT_ACTION) { ListBase act_data = {NULL, NULL}; bActListElem *ale; @@ -1941,6 +1941,7 @@ void paste_actdata () int filter; void *data; short datatype; + Object *ob= OBACT; short no_name= 0; float offset = CFRA - actcopy_firstframe; @@ -2017,7 +2018,7 @@ void paste_actdata () /* loop over curves, pasting keyframes */ for (ico= ipo_src->curve.first; ico; ico= ico->next) { - icu= verify_ipocurve((ID*)OBACT, ico->blocktype, actname, conname, "", ico->adrcode); + icu= verify_ipocurve((ID*)ob, ico->blocktype, actname, conname, "", ico->adrcode); if (icu) { /* just start pasting, with the the first keyframe on the current frame, and so on */ @@ -2045,6 +2046,14 @@ void paste_actdata () /* free temp memory */ BLI_freelistN(&act_data); + /* do depsgraph updates (for 3d-view)? */ + if ((ob) && (G.saction->pin==0)) { + if (ob->type == OB_ARMATURE) + DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA); + else + DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); + } + /* undo and redraw stuff */ allqueue(REDRAWVIEW3D, 0); allspace(REMAKEIPO, 0); diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 172e06f5add..39f93510358 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -2396,6 +2396,7 @@ void fill_bones_armature(void) else if (count == 2) { EditBonePoint *ebp, *ebp2; float head[3], tail[3]; + short headtail = 0; /* check that the points don't belong to the same bone */ ebp= (EditBonePoint *)points.first; @@ -2420,7 +2421,7 @@ void fill_bones_armature(void) float distA, distB; /* get cursor location */ - VECCOPY (curs, give_cursor()); + VECCOPY(curs, give_cursor()); Mat4Invert(G.obedit->imat, G.obedit->obmat); Mat4MulVecfl(G.obedit->imat, curs); @@ -2432,26 +2433,47 @@ void fill_bones_armature(void) distB= VecLength(vecB); /* compare distances - closer one therefore acts as direction for bone to go */ - if (distA < distB) { - VECCOPY(head, ebp2->vec); - VECCOPY(tail, ebp->vec); - } - else { - VECCOPY(head, ebp->vec); - VECCOPY(tail, ebp2->vec); - } + headtail= (distA < distB) ? 2 : 1; } else if (ebp->head_owner) { + headtail = 1; + } + else if (ebp2->head_owner) { + headtail = 2; + } + + /* assign head/tail combinations */ + if (headtail == 2) { VECCOPY(head, ebp->vec); VECCOPY(tail, ebp2->vec); } - else if (ebp2->head_owner) { + else if (headtail == 1) { VECCOPY(head, ebp2->vec); VECCOPY(tail, ebp->vec); } - /* add new bone */ - newbone= add_points_bone(head, tail); + /* add new bone and parent it to the appropriate end */ + if (headtail) { + newbone= add_points_bone(head, tail); + + /* do parenting (will need to set connected flag too) */ + if (headtail == 2) { + /* ebp tail or head - tail gets priority */ + if (ebp->tail_owner) + newbone->parent= ebp->tail_owner; + else + newbone->parent= ebp->head_owner; + } + else { + /* ebp2 tail or head - tail gets priority */ + if (ebp2->tail_owner) + newbone->parent= ebp2->tail_owner; + else + newbone->parent= ebp2->head_owner; + } + + newbone->flag |= BONE_CONNECTED; + } } else { // FIXME.. figure out a method for multiple bones @@ -4097,16 +4119,34 @@ void transform_armature_mirror_update(void) if (eboflip) { /* we assume X-axis flipping for now */ if (ebo->flag & BONE_TIPSEL) { + EditBone *children; + eboflip->tail[0]= -ebo->tail[0]; eboflip->tail[1]= ebo->tail[1]; eboflip->tail[2]= ebo->tail[2]; eboflip->rad_tail= ebo->rad_tail; + + /* Also move connected children, in case children's name aren't mirrored properly */ + for (children=G.edbo.first; children; children=children->next) { + if (children->parent == eboflip && children->flag & BONE_CONNECTED) { + VECCOPY(children->head, eboflip->tail); + children->rad_head = ebo->rad_tail; + } + } } if (ebo->flag & BONE_ROOTSEL) { eboflip->head[0]= -ebo->head[0]; eboflip->head[1]= ebo->head[1]; eboflip->head[2]= ebo->head[2]; eboflip->rad_head= ebo->rad_head; + + /* Also move connected parent, in case parent's name isn't mirrored properly */ + if (eboflip->parent && eboflip->flag & BONE_CONNECTED) + { + EditBone *parent = eboflip->parent; + VECCOPY(parent->tail, eboflip->head); + parent->rad_tail = ebo->rad_head; + } } if (ebo->flag & BONE_SELECTED) { eboflip->dist= ebo->dist; diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index d4ebe181218..f9bb14a08c6 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -4497,8 +4497,7 @@ void bevel_menu() { while(G.editBMesh->options & BME_BEVEL_RUNNING) { options = G.editBMesh->options; res = G.editBMesh->res; - bm = BME_make_mesh(); - bm = BME_editmesh_to_bmesh(G.editMesh, bm); + bm = BME_editmesh_to_bmesh(G.editMesh); BIF_undo_push("Pre-Bevel"); free_editMesh(G.editMesh); BME_bevel(bm,0.1f,res,options,0,0,&td); diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c index afafc4f2590..4c7334c55e0 100644 --- a/source/blender/src/editnode.c +++ b/source/blender/src/editnode.c @@ -166,13 +166,14 @@ static void snode_handle_recalc(SpaceNode *snode) snode->nodetree->test_break= NULL; waitcursor(0); - allqueue(REDRAWNODE, 1); allqueue(REDRAWIMAGE, 1); if(G.scene->r.scemode & R_DOCOMP) { BIF_redraw_render_rect(); /* seems to screwup display? */ mywinset(curarea->win); } } + + allqueue(REDRAWNODE, 1); } } @@ -2381,14 +2382,14 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt) } else { - if(G.qual & LR_CTRLKEY) { - gesture(); - } else { - if(node_add_link(snode)==0) - if(node_mouse_groupheader(snode)==0) - if(node_mouse_select(snode, event)==0) - node_border_link_delete(snode); - } + if(G.qual & LR_CTRLKEY) + if(gesture()) + break; + + if(node_add_link(snode)==0) + if(node_mouse_groupheader(snode)==0) + if(node_mouse_select(snode, event)==0) + node_border_link_delete(snode); } break; diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c index c26e01d994b..4873f5d6688 100644 --- a/source/blender/src/editseq.c +++ b/source/blender/src/editseq.c @@ -184,13 +184,24 @@ int seq_tx_get_end(Sequence *seq) return seq->start+seq->len; } -int seq_tx_get_final_left(Sequence *seq) +int seq_tx_get_final_left(Sequence *seq, int metaclip) { - return (seq->start - seq->startstill) + seq->startofs; + if (metaclip && seq->tmp) { + /* return the range clipped by the parents range */ + return MAX2( seq_tx_get_final_left(seq, 0), seq_tx_get_final_left((Sequence *)seq->tmp, 1) ); + } else { + return (seq->start - seq->startstill) + seq->startofs; + } + } -int seq_tx_get_final_right(Sequence *seq) +int seq_tx_get_final_right(Sequence *seq, int metaclip) { - return ((seq->start+seq->len) + seq->endstill) - seq->endofs; + if (metaclip && seq->tmp) { + /* return the range clipped by the parents range */ + return MIN2( seq_tx_get_final_right(seq, 0), seq_tx_get_final_right((Sequence *)seq->tmp, 1) ); + } else { + return ((seq->start+seq->len) + seq->endstill) - seq->endofs; + } } void seq_tx_set_final_left(Sequence *seq, int val) @@ -260,12 +271,12 @@ static void fix_single_image_seq(Sequence *seq) /* make sure the image is always at the start since there is only one, adjusting its start should be ok */ - left = seq_tx_get_final_left(seq); + left = seq_tx_get_final_left(seq, 0); start = seq->start; if (start != left) { offset = left - start; - seq_tx_set_final_left( seq, seq_tx_get_final_left(seq) - offset ); - seq_tx_set_final_right( seq, seq_tx_get_final_right(seq) - offset ); + seq_tx_set_final_left( seq, seq_tx_get_final_left(seq, 0) - offset ); + seq_tx_set_final_right( seq, seq_tx_get_final_right(seq, 0) - offset ); seq->start += offset; } } @@ -2928,34 +2939,34 @@ static int seq_get_snaplimit(void) static void transform_grab_xlimits(Sequence *seq, int leftflag, int rightflag) { if(leftflag) { - if (seq_tx_get_final_left(seq) >= seq_tx_get_final_right(seq)) { - seq_tx_set_final_left(seq, seq_tx_get_final_right(seq)-1); + if (seq_tx_get_final_left(seq, 0) >= seq_tx_get_final_right(seq, 0)) { + seq_tx_set_final_left(seq, seq_tx_get_final_right(seq, 0)-1); } if (check_single_seq(seq)==0) { - if (seq_tx_get_final_left(seq) >= seq_tx_get_end(seq)) { + if (seq_tx_get_final_left(seq, 0) >= seq_tx_get_end(seq)) { seq_tx_set_final_left(seq, seq_tx_get_end(seq)-1); } /* dosnt work now - TODO */ /* - if (seq_tx_get_start(seq) >= seq_tx_get_final_right(seq)) { + if (seq_tx_get_start(seq) >= seq_tx_get_final_right(seq, 0)) { int ofs; - ofs = seq_tx_get_start(seq) - seq_tx_get_final_right(seq); + ofs = seq_tx_get_start(seq) - seq_tx_get_final_right(seq, 0); seq->start -= ofs; - seq_tx_set_final_left(seq, seq_tx_get_final_left(seq) + ofs ); + seq_tx_set_final_left(seq, seq_tx_get_final_left(seq, 0) + ofs ); }*/ } } if(rightflag) { - if (seq_tx_get_final_right(seq) <= seq_tx_get_final_left(seq)) { - seq_tx_set_final_right(seq, seq_tx_get_final_left(seq)+1); + if (seq_tx_get_final_right(seq, 0) <= seq_tx_get_final_left(seq, 0)) { + seq_tx_set_final_right(seq, seq_tx_get_final_left(seq, 0)+1); } if (check_single_seq(seq)==0) { - if (seq_tx_get_final_right(seq) <= seq_tx_get_start(seq)) { + if (seq_tx_get_final_right(seq, 0) <= seq_tx_get_start(seq)) { seq_tx_set_final_right(seq, seq_tx_get_start(seq)+1); } } @@ -3034,9 +3045,24 @@ void transform_seq(int mode, int context) for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { if((seq->flag & SELECT) && !(seq->depth==0 && seq->flag & SEQ_LOCK)) totstrip++; + /* only needed for extend but can set here anyway since were alredy looping */ + seq->tmp= NULL; } } + /* for extending we need the metastrip clipped left/right values, set the metastrips as parents in seq->tmp */ + if (mode=='e') { + Sequence *meta_seq; + for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { + if (seq->type == SEQ_META) { + for (meta_seq = seq->seqbase.first; meta_seq; meta_seq= meta_seq->next){ + meta_seq->tmp= (void *)seq; + } + } + } + } + + if (sseq->flag & SEQ_MARKER_TRANS) { for(marker= G.scene->markers.first; marker; marker= marker->next) { if(marker->flag & SELECT) totmark++; @@ -3065,8 +3091,8 @@ void transform_seq(int mode, int context) /* for extend only */ if (mode=='e') { - ts->final_left = seq_tx_get_final_left(seq); - ts->final_right = seq_tx_get_final_right(seq); + ts->final_left = seq_tx_get_final_left(seq, 1); + ts->final_right = seq_tx_get_final_right(seq, 1); } ts++; } @@ -3152,9 +3178,9 @@ void transform_seq(int mode, int context) snap_point_num=0; if (last_seq && (last_seq->flag & SELECT)) { /* active seq bounds */ if(seq_tx_check_left(last_seq)) - snap_points[snap_point_num++] = seq_tx_get_final_left(last_seq); + snap_points[snap_point_num++] = seq_tx_get_final_left(last_seq, 0); if(seq_tx_check_right(last_seq)) - snap_points[snap_point_num++] = seq_tx_get_final_right(last_seq); + snap_points[snap_point_num++] = seq_tx_get_final_right(last_seq, 0); } if (totstrip > 1) { /* selection bounds */ @@ -3164,9 +3190,9 @@ void transform_seq(int mode, int context) for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { if(seq->flag & SELECT) { if(seq_tx_check_left(seq)) - bounds_left = MIN2(bounds_left, seq_tx_get_final_left(seq)); + bounds_left = MIN2(bounds_left, seq_tx_get_final_left(seq, 0)); if(seq_tx_check_right(seq)) - bounds_right = MAX2(bounds_right,seq_tx_get_final_right(seq)); + bounds_right = MAX2(bounds_right,seq_tx_get_final_right(seq, 0)); } } @@ -3215,13 +3241,13 @@ void transform_seq(int mode, int context) if (snap_dist && last_seq && seq_tx_check_left(last_seq)) { seq = find_next_prev_sequence(last_seq, 1, 0); /* left */ if(seq && !seq_tx_check_right(seq)) - TESTSNAP(seq_tx_get_final_right(seq)); + TESTSNAP(seq_tx_get_final_right(seq, 0)); } if (snap_dist && last_seq && seq_tx_check_right(last_seq)) { seq = find_next_prev_sequence(last_seq, 2, 0); /* right */ if(seq && !seq_tx_check_left(seq)) - TESTSNAP(seq_tx_get_final_left(seq)); + TESTSNAP(seq_tx_get_final_left(seq, 0)); } #undef TESTSNAP @@ -3243,20 +3269,23 @@ void transform_seq(int mode, int context) for(seq_index=0, seq=seqar[0]; seq_index < totseq_index; seq=seqar[++seq_index]) { if(seq->flag & SELECT && !(seq->depth==0 && seq->flag & SEQ_LOCK)) { int myofs; + /* flag, ignores lefsel/rightsel for nested strips */ + int sel_flag = (seq->depth==0) ? seq->flag : seq->flag & ~(SEQ_LEFTSEL+SEQ_RIGHTSEL); + // SEQ_DEBUG_INFO(seq); /* X Transformation */ - if(seq->flag & SEQ_LEFTSEL) { + if((seq->depth==0) && (sel_flag & SEQ_LEFTSEL)) { myofs = (ts->startofs - ts->startstill); seq_tx_set_final_left(seq, ts->start + (myofs + ix)); } - if(seq->flag & SEQ_RIGHTSEL) { + if((seq->depth==0) && (sel_flag & SEQ_RIGHTSEL)) { myofs = (ts->endstill - ts->endofs); seq_tx_set_final_right(seq, ts->start + seq->len + (myofs + ix)); } - transform_grab_xlimits(seq, seq->flag & SEQ_LEFTSEL, seq->flag & SEQ_RIGHTSEL); + transform_grab_xlimits(seq, sel_flag & SEQ_LEFTSEL, sel_flag & SEQ_RIGHTSEL); - if( (seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))==0 ) { + if( (sel_flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))==0 ) { if(sequence_is_free_transformable(seq)) seq->start= ts->start+ ix; /* Y Transformation */ @@ -3301,8 +3330,8 @@ void transform_seq(int mode, int context) //SEQ_DEBUG_INFO(seq); - final_left = seq_tx_get_final_left(seq); - final_right = seq_tx_get_final_right(seq); + final_left = seq_tx_get_final_left(seq, 1); + final_right = seq_tx_get_final_right(seq, 1); /* Only X Axis moving */ @@ -3592,8 +3621,8 @@ void seq_separate_images(void) BLI_remlink(ed->seqbasep, seq); if(seq->ipo) seq->ipo->id.us--; - start_ofs = cfra = seq_tx_get_final_left(seq); - frame_end = seq_tx_get_final_right(seq); + start_ofs = cfra = seq_tx_get_final_left(seq, 0); + frame_end = seq_tx_get_final_right(seq, 0); while (cfra < frame_end) { /* new seq */ diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index ac1c0fb7dfe..b96f92a3c72 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -1581,7 +1581,7 @@ static void do_filesel_buttons(short event, SpaceFile *sfile) BLI_del_slash(butname); if(sfile->type & FILE_UNIX) { - if (!BLI_exists(butname)) { + if (butname[0] != '\0' && !BLI_exists(butname)) { if (okee("Makedir")) { BLI_recurdir_fileops(butname); if (!BLI_exists(butname)) parent(sfile); diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c index a7361a9ffca..8b9c89656fb 100644 --- a/source/blender/src/fluidsim.c +++ b/source/blender/src/fluidsim.c @@ -481,6 +481,7 @@ void fluidsimBake(struct Object *ob) struct Object *fsDomain = NULL; FluidsimSettings *domainSettings; struct Object *obit = NULL; /* object iterator */ + Base *base; int origFrame = G.scene->r.cfra; char debugStrBuffer[256]; int dirExist = 0; @@ -522,7 +523,7 @@ void fluidsimBake(struct Object *ob) float *channelObjMove[256][3]; // object movments , 0=trans, 1=rot, 2=scale float *channelObjInivel[256]; // initial velocities float *channelObjActive[256]; // obj active channel - + if(getenv(strEnvName)) { int dlevel = atoi(getenv(strEnvName)); elbeemSetDebugLevel(dlevel); @@ -545,7 +546,6 @@ void fluidsimBake(struct Object *ob) /* no object pointer, find in selected ones.. */ if(!ob) { - Base *base; for(base=G.scene->base.first; base; base= base->next) { if ( ((base)->flag & SELECT) // ignore layer setting for now? && ((base)->lay & G.vd->lay) @@ -561,8 +561,26 @@ void fluidsimBake(struct Object *ob) if(!ob) return; } + channelObjCount = 0; + for(base=G.scene->base.first; base; base= base->next) { + obit = base->object; + //{ snprintf(debugStrBuffer,256,"DEBUG object name=%s, type=%d ...\n", obit->id.name, obit->type); elbeemDebugOut(debugStrBuffer); } // DEBUG + if( (obit->fluidsimFlag & OB_FLUIDSIM_ENABLE) && + (obit->type==OB_MESH) && + (obit->fluidsimSettings->type != OB_FLUIDSIM_DOMAIN) && // if has to match 3 places! // CHECKMATCH + (obit->fluidsimSettings->type != OB_FLUIDSIM_PARTICLE) ) { + channelObjCount++; + } + } + + if (channelObjCount>=255) { + pupmenu("Fluidsim Bake Error%t|Cannot bake with more then 256 objects"); + return; + } + /* check if there's another domain... */ - for(obit= G.main->object.first; obit; obit= obit->id.next) { + for(base=G.scene->base.first; base; base= base->next) { + obit = base->object; if((obit->fluidsimFlag & OB_FLUIDSIM_ENABLE)&&(obit->type==OB_MESH)) { if(obit->fluidsimSettings->type == OB_FLUIDSIM_DOMAIN) { if(obit != ob) { @@ -605,7 +623,8 @@ void fluidsimBake(struct Object *ob) // check if theres any fluid // abort baking if not... - for(obit= G.main->object.first; obit; obit= obit->id.next) { + for(base=G.scene->base.first; base; base= base->next) { + obit = base->object; if( (obit->fluidsimFlag & OB_FLUIDSIM_ENABLE) && (obit->type==OB_MESH) && ( (obit->fluidsimSettings->type == OB_FLUIDSIM_FLUID) || @@ -749,7 +768,8 @@ void fluidsimBake(struct Object *ob) // init obj movement channels channelObjCount=0; - for(obit= G.main->object.first; obit; obit= obit->id.next) { + for(base=G.scene->base.first; base; base= base->next) { + obit = base->object; //{ snprintf(debugStrBuffer,256,"DEBUG object name=%s, type=%d ...\n", obit->id.name, obit->type); elbeemDebugOut(debugStrBuffer); } // DEBUG if( (obit->fluidsimFlag & OB_FLUIDSIM_ENABLE) && (obit->type==OB_MESH) && @@ -952,7 +972,8 @@ void fluidsimBake(struct Object *ob) // init objects channelObjCount = 0; - for(obit= G.main->object.first; obit; obit= obit->id.next) { + for(base=G.scene->base.first; base; base= base->next) { + obit = base->object; //{ snprintf(debugStrBuffer,256,"DEBUG object name=%s, type=%d ...\n", obit->id.name, obit->type); elbeemDebugOut(debugStrBuffer); } // DEBUG if( (obit->fluidsimFlag & OB_FLUIDSIM_ENABLE) && // if has to match 3 places! // CHECKMATCH (obit->type==OB_MESH) && diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index ab8e53c3cb3..6582866d9a1 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -3394,6 +3394,7 @@ static int ui_do_but_HSVCUBE(uiBut *but) /* we redraw the entire block */ for (bt= but->block->buttons.first; bt; bt= bt->next) { if(but->poin == bt->poin) VECCOPY(bt->hsv, but->hsv); + ui_check_but(bt); ui_draw_but(bt); } ui_block_flush_back(but->block); diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c index e27e772edee..0f30aef04df 100644 --- a/source/blender/src/meshtools.c +++ b/source/blender/src/meshtools.c @@ -957,6 +957,12 @@ int *mesh_get_x_mirror_faces(Object *ob) mirrormf.v3= mirrorverts[mf->v1]; mirrormf.v4= (mf->v4)? mirrorverts[mf->v4]: 0; + /* make sure v4 is not 0 if a quad */ + if(mf->v4 && mirrormf.v4==0) { + SWAP(int, mirrormf.v1, mirrormf.v3); + SWAP(int, mirrormf.v2, mirrormf.v4); + } + hashmf= BLI_ghash_lookup(fhash, &mirrormf); if(hashmf) { mirrorfaces[a*2]= hashmf - mface; @@ -1020,7 +1026,7 @@ void objects_bake_render_menu(void) { short event; - event= pupmenu("Bake Selected Meshes %t|Full Render %x1|Ambient Occlusion %x2|Normals %x3|Texture Only %x4|Displacement %x5"); + event= pupmenu("Bake Selected Meshes %t|Full Render %x1|Ambient Occlusion %x2|Normals %x3|Texture Only %x4|Displacement %x5|Shadow %x6"); if (event < 1) return; objects_bake_render_ui(event); } @@ -1056,7 +1062,8 @@ void objects_bake_render(short event, char **error_msg) else if(event==2) event= RE_BAKE_AO; else if(event==3) event= RE_BAKE_NORMALS; else if(event==4) event= RE_BAKE_TEXTURE; - else event= RE_BAKE_DISPLACEMENT; + else if(event==5) event= RE_BAKE_DISPLACEMENT; + else event= RE_BAKE_SHADOW; if(event==RE_BAKE_AO) { if(G.scene->world==NULL) { diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 4c97a8fdbdf..dcceea971f7 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -659,6 +659,10 @@ void pose_copy_menu(void) free_constraints(&pchan->constraints); copy_constraints(&pchan->constraints, &pchanact->constraints); pchan->constflag = pchanact->constflag; + + if (ob->pose) { + ob->pose->flag |= POSE_RECALC; + } } break; case 6: /* Transform Locks */ @@ -741,6 +745,10 @@ void pose_copy_menu(void) } BLI_freelistN(&const_copy); update_pose_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */ + + if (ob->pose) { + ob->pose->flag |= POSE_RECALC; + } } DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); // and all its relations diff --git a/source/blender/src/space.c b/source/blender/src/space.c index c8daa2bcea2..f3d0d4f715a 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -5115,7 +5115,7 @@ static void init_seqspace(ScrArea *sa) sseq->v2d.min[0]= 10.0; sseq->v2d.min[1]= 4.0; - sseq->v2d.max[0]= 32000.0; + sseq->v2d.max[0]= MAXFRAMEF; sseq->v2d.max[1]= MAXSEQ; sseq->v2d.minzoom= 0.1f; diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 5b6af61949f..5f80f14d069 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -228,8 +228,8 @@ void persptoetsen(unsigned short event) } else { /* Indicate that this view is not inverted. - * Don't do this for PADMINUS/PADPLUSKEY, though. (jobbe)*/ - if (event != PADMINUS && event != PADPLUSKEY) + * Don't do this for PADMINUS/PADPLUSKEY/PAD5, though. (jobbe)*/ + if (! ELEM3(event, PADMINUS, PADPLUSKEY, PAD5) ) G.vd->flag2 &= ~V3D_OPP_DIRECTION_NAME; diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 10035c61651..4f6c33b0a64 100644 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -135,24 +135,23 @@ static void helpline(TransInfo *t, float *vec) getmouseco_areawin(mval); projectFloatView(t, vecrot, cent); // no overflow in extreme cases - if(cent[0]!=IS_CLIPPED) { - persp(PERSP_WIN); - - glDrawBuffer(GL_FRONT); - - BIF_ThemeColor(TH_WIRE); - - setlinestyle(3); - glBegin(GL_LINE_STRIP); - glVertex2sv(mval); - glVertex2fv(cent); - glEnd(); - setlinestyle(0); - - persp(PERSP_VIEW); - bglFlush(); // flush display for frontbuffer - glDrawBuffer(GL_BACK); - } + + persp(PERSP_WIN); + + glDrawBuffer(GL_FRONT); + + BIF_ThemeColor(TH_WIRE); + + setlinestyle(3); + glBegin(GL_LINE_STRIP); + glVertex2sv(mval); + glVertex2fv(cent); + glEnd(); + setlinestyle(0); + + persp(PERSP_VIEW); + bglFlush(); // flush display for frontbuffer + glDrawBuffer(GL_BACK); } @@ -354,8 +353,9 @@ void convertViewVec(TransInfo *t, float *vec, short dx, short dy) void projectIntView(TransInfo *t, float *vec, int *adr) { - if (t->spacetype==SPACE_VIEW3D) - project_int(vec, adr); + if (t->spacetype==SPACE_VIEW3D) { + project_int_noclip(vec, adr); + } else if(t->spacetype==SPACE_IMAGE) { float aspx, aspy, v[2]; @@ -376,8 +376,9 @@ void projectIntView(TransInfo *t, float *vec, int *adr) void projectFloatView(TransInfo *t, float *vec, float *adr) { - if (t->spacetype==SPACE_VIEW3D) - project_float(vec, adr); + if (t->spacetype==SPACE_VIEW3D) { + project_float_noclip(vec, adr); + } else if(t->spacetype==SPACE_IMAGE) { int a[2]; diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index f69218664ea..dcebf6b7557 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -1365,7 +1365,7 @@ static void createTransCurveVerts(TransInfo *t) tail++; } if( propmode || - ((bezt->f1 & SELECT) && (G.f & G_HIDDENHANDLES)) || + ((bezt->f2 & SELECT) && (G.f & G_HIDDENHANDLES)) || ((bezt->f3 & SELECT) && (G.f & G_HIDDENHANDLES)==0) ) { VECCOPY(td->iloc, bezt->vec[2]); @@ -4054,6 +4054,7 @@ void createTransData(TransInfo *t) t->flag |= T_POINTS; } else { + t->flag &= ~T_PROP_EDIT; /* no proportional edit in object mode */ createTransObject(t); t->flag |= T_OBJECT; } diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c index 5c06aaea890..050360887b4 100644 --- a/source/blender/src/transform_manipulator.c +++ b/source/blender/src/transform_manipulator.c @@ -158,7 +158,7 @@ static void protectflag_to_drawflags(short protectflag, short *drawflags) } /* for pose mode */ -static void stats_pose(View3D *v3d, bPoseChannel *pchan, float *normal, float *plane) +static void stats_pose(View3D *v3d, bPoseChannel *pchan) { Bone *bone= pchan->bone; @@ -166,9 +166,6 @@ static void stats_pose(View3D *v3d, bPoseChannel *pchan, float *normal, float *p if (bone->flag & BONE_TRANSFORM) { calc_tw_center(pchan->pose_head); protectflag_to_drawflags(pchan->protectflag, &v3d->twdrawflag); - - VecAddf(normal, normal, pchan->pose_mat[2]); - VecAddf(plane, plane, pchan->pose_mat[1]); } } } @@ -349,26 +346,24 @@ int calc_manipulator_stats(ScrArea *sa) } } else if(ob && (ob->flag & OB_POSEMODE)) { - bArmature *arm= ob->data; + bArmature *arm = ob->data; bPoseChannel *pchan; int mode; if((ob->lay & G.vd->lay)==0) return 0; - mode= Trans.mode; - Trans.mode= TFM_ROTATION; // mislead counting bones... bah + mode = Trans.mode; + Trans.mode = TFM_ROTATION; // mislead counting bones... bah /* count total, we use same method as transform will do */ Trans.total= 0; count_bone_select(&Trans, arm, &arm->bonebase, 1); - totsel= Trans.total; + totsel = Trans.total; if(totsel) { /* use channels to get stats */ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - stats_pose(v3d, pchan, normal, plane); + stats_pose(v3d, pchan); } - //VecMulf(normal, -1.0); - VecMulf(plane, -1.0); VecMulf(G.scene->twcent, 1.0f/(float)totsel); // centroid! Mat4MulVecfl(ob->obmat, G.scene->twcent); @@ -376,7 +371,7 @@ int calc_manipulator_stats(ScrArea *sa) Mat4MulVecfl(ob->obmat, G.scene->twmax); } /* restore, mode can be TFM_INIT */ - Trans.mode= mode; + Trans.mode = mode; } else if(G.f & (G_VERTEXPAINT + G_TEXTUREPAINT + G_WEIGHTPAINT + G_SCULPTMODE)) { ; @@ -433,7 +428,7 @@ int calc_manipulator_stats(ScrArea *sa) break; case V3D_MANIP_NORMAL: - if(G.obedit) { + if(G.obedit || ob->flag & OB_POSEMODE) { float mat[3][3]; int type; @@ -479,34 +474,6 @@ int calc_manipulator_stats(ScrArea *sa) } break; } - /* pose mode is a bit weird, so keep it separated */ - else if (ob->flag & OB_POSEMODE) - { - strcpy(t->spacename, "normal"); - if(normal[0]!=0.0 || normal[1]!=0.0 || normal[2]!=0.0) { - float imat[3][3], mat[3][3]; - - /* we need the transpose of the inverse for a normal... */ - Mat3CpyMat4(imat, ob->obmat); - - Mat3Inv(mat, imat); - Mat3Transp(mat); - Mat3MulVecfl(mat, normal); - Mat3MulVecfl(mat, plane); - - Normalize(normal); - if(0.0==Normalize(plane)) VECCOPY(plane, mat[1]); - - VECCOPY(mat[2], normal); - Crossf(mat[0], normal, plane); - Crossf(mat[1], mat[2], mat[0]); - - Mat4CpyMat3(v3d->twmat, mat); - Mat4Ortho(v3d->twmat); - - break; - } - } /* no break we define 'normal' as 'local' in Object mode */ case V3D_MANIP_LOCAL: strcpy(t->spacename, "local"); diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 2904ca60a12..f53bcb3a9f7 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -228,6 +228,29 @@ void project_int(float *vec, int *adr) } } +void project_int_noclip(float *vec, int *adr) +{ + float fx, fy, vec4[4]; + + VECCOPY(vec4, vec); + vec4[3]= 1.0; + + Mat4MulVec4fl(G.vd->persmat, vec4); + + if( fabs(vec4[3]) > BL_NEAR_CLIP ) { + fx = (curarea->winx/2)*(1 + vec4[0]/vec4[3]); + fy = (curarea->winy/2)*(1 + vec4[1]/vec4[3]); + + adr[0] = floor(fx); + adr[1] = floor(fy); + } + else + { + adr[0] = curarea->winx / 2; + adr[1] = curarea->winy / 2; + } +} + void project_short_noclip(float *vec, short *adr) { float fx, fy, vec4[4]; @@ -264,8 +287,28 @@ void project_float(float *vec, float *adr) Mat4MulVec4fl(G.vd->persmat, vec4); if( vec4[3]>BL_NEAR_CLIP ) { - adr[0]= (curarea->winx/2.0)+(curarea->winx/2.0)*vec4[0]/vec4[3]; - adr[1]= (curarea->winy/2.0)+(curarea->winy/2.0)*vec4[1]/vec4[3]; + adr[0] = (curarea->winx/2.0)+(curarea->winx/2.0)*vec4[0]/vec4[3]; + adr[1] = (curarea->winy/2.0)+(curarea->winy/2.0)*vec4[1]/vec4[3]; + } +} + +void project_float_noclip(float *vec, float *adr) +{ + float vec4[4]; + + VECCOPY(vec4, vec); + vec4[3]= 1.0; + + Mat4MulVec4fl(G.vd->persmat, vec4); + + if( fabs(vec4[3]) > BL_NEAR_CLIP ) { + adr[0] = (curarea->winx/2.0)+(curarea->winx/2.0)*vec4[0]/vec4[3]; + adr[1] = (curarea->winy/2.0)+(curarea->winy/2.0)*vec4[1]/vec4[3]; + } + else + { + adr[0] = curarea->winx / 2.0f; + adr[1] = curarea->winy / 2.0f; } } @@ -1448,6 +1491,8 @@ void obmat_to_viewmat(Object *ob, short smooth) float bmat[4][4]; float tmat[3][3]; + G.vd->view= 0; /* dont show the grid */ + Mat4CpyMat4(bmat, ob->obmat); Mat4Ortho(bmat); Mat4Invert(G.vd->viewmat, bmat); |