diff options
author | Diego Borghetti <bdiego@gmail.com> | 2007-06-17 01:03:11 +0400 |
---|---|---|
committer | Diego Borghetti <bdiego@gmail.com> | 2007-06-17 01:03:11 +0400 |
commit | 1347491e3262da395b7efaf331f30e3c6a51f3ce (patch) | |
tree | c12dd9592e9cf6f76d2c320832433db1deb626af /source | |
parent | 6fc5b3cbb568586fcdc6c139abb1aba4d72de24d (diff) |
branches/2-44-stable
Merge from trunk:
revision 10778:10779 (Bugfix #6714)
Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10779
revision 10783:10784
drawmesh.c - change from mal_CanDo that makes lighting work the same as in blender 2.44.
header_view3d.c - smoothview wasnt working with the camera menu
Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10784
revision 10794:10795
Made it that hidden bones should arnt selected armature and posemode
Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10795
revision 10797:10798
Fix for a crash in Blender.Mesh
Link: http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10798
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/util.c | 13 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Mesh.c | 4 | ||||
-rw-r--r-- | source/blender/src/drawmesh.c | 2 | ||||
-rw-r--r-- | source/blender/src/editarmature.c | 10 | ||||
-rw-r--r-- | source/blender/src/editobject.c | 7 | ||||
-rw-r--r-- | source/blender/src/header_view3d.c | 34 |
7 files changed, 60 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 93a3981c4a9..278d49e2198 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -808,6 +808,7 @@ void mball_to_mesh(ListBase *lb, Mesh *me) } } +/* this may fail replacing ob->data, be sure to check ob->type */ void nurbs_to_mesh(Object *ob) { Object *ob1; @@ -847,7 +848,8 @@ void nurbs_to_mesh(Object *ob) dl= dl->next; } if(totvert==0) { - error("can't convert"); + /* error("can't convert"); */ + /* Make Sure you check ob->data is a curve */ return; } diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 38a9a2d7b50..5f8ef796bad 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -242,6 +242,15 @@ static int isffmpeg (char *filename) { do_init_ffmpeg(); + if( BLI_testextensie(filename, ".swf") || + BLI_testextensie(filename, ".jpg") || + BLI_testextensie(filename, ".png") || + BLI_testextensie(filename, ".tga") || + BLI_testextensie(filename, ".bmp") || + BLI_testextensie(filename, ".exr") || + BLI_testextensie(filename, ".cin") || + BLI_testextensie(filename, ".wav")) return 0; + if(av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0) { fprintf(stderr, "isffmpeg: av_open_input_file failed\n"); return 0; @@ -266,8 +275,10 @@ static int isffmpeg (char *filename) { break; } - if(videoStream==-1) + if(videoStream==-1) { + av_close_input_file(pFormatCtx); return 0; + } pCodecCtx = get_codec_from_stream(pFormatCtx->streams[videoStream]); diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c index e81b17e64de..d7c2f8c6228 100644 --- a/source/blender/python/api2_2x/Mesh.c +++ b/source/blender/python/api2_2x/Mesh.c @@ -5671,6 +5671,10 @@ static PyObject *Mesh_getFromObject( BPy_Mesh * self, PyObject * args ) nurbs_to_mesh( tmpobj ); tmpmesh = tmpobj->data; free_libblock_us( &G.main->object, tmpobj ); + + if (ob->type != OB_MESH) + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "cant convert curve to mesh. Does the curve have any segments?" ); break; case OB_MBALL: /* metaballs don't have modifiers, so just convert to mesh */ diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c index cf7cc5a5257..32936172121 100644 --- a/source/blender/src/drawmesh.c +++ b/source/blender/src/drawmesh.c @@ -1021,7 +1021,7 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt) g_draw_tface_mesh_ob = ob; g_draw_tface_mesh_istex = istex; memcpy(g_draw_tface_mesh_obcol, obcol, sizeof(obcol)); - set_draw_settings_cached(1, 0, 0, 1, 0, 0, 0); + set_draw_settings_cached(1, 0, 0, g_draw_tface_mesh_islight, 0, 0, 0); if(dt > OB_SOLID || g_draw_tface_mesh_islight==-1) { bProperty *prop = get_property(ob, "Text"); diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 36240714a6a..db6b25d9bd4 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -1234,15 +1234,15 @@ void deselectall_armature(int toggle, int doundo) sel=0; break; } - } -// } +// } + } } else sel= toggle; /* Set the flags */ for (eBone=G.edbo.first;eBone;eBone=eBone->next){ if (sel==1) { - if(arm->layer & eBone->layer) { + if(arm->layer & eBone->layer && (eBone->flag & BONE_HIDDEN_A)==0) { eBone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); if(eBone->parent) eBone->parent->flag |= (BONE_TIPSEL); @@ -2158,7 +2158,7 @@ void deselectall_posearmature (Object *ob, int test, int doundo) /* Determine if we're selecting or deselecting */ if (test==1) { for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) - if(pchan->bone->layer & arm->layer) + if(pchan->bone->layer & arm->layer && !(pchan->bone->flag & BONE_HIDDEN_P)) if(pchan->bone->flag & BONE_SELECTED) break; @@ -2170,7 +2170,7 @@ void deselectall_posearmature (Object *ob, int test, int doundo) /* Set the flags accordingly */ for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if(pchan->bone->layer & arm->layer) { + if(pchan->bone->layer & arm->layer && !(pchan->bone->flag & BONE_HIDDEN_P)) { if(selectmode==0) pchan->bone->flag &= ~(BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL|BONE_ACTIVE); else if(selectmode==1) pchan->bone->flag |= BONE_SELECTED; else pchan->bone->flag &= ~BONE_ACTIVE; diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 0c42b4c14aa..d362605d63c 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2527,8 +2527,11 @@ static void curvetomesh(Object *ob) if(dl==0) makeDispListCurveTypes(ob, 0); /* force creation */ nurbs_to_mesh(ob); /* also does users */ - - object_free_modifiers(ob); + if (ob->type != OB_MESH) { + error("can't convert curve to mesh"); + } else { + object_free_modifiers(ob); + } } void convertmenu(void) diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 9afd7927833..9bfd39b4428 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -59,6 +59,7 @@ #include "DNA_view3d_types.h" #include "DNA_text_types.h" /* for space handlers */ #include "DNA_texture_types.h" +#include "DNA_userdef_types.h" /* U.smooth_viewtx */ #include "BKE_action.h" #include "BKE_curve.h" @@ -70,6 +71,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_mesh.h" +#include "BKE_utildefines.h" /* for VECCOPY */ #ifdef WITH_VERSE #include "BKE_verse.h" @@ -213,11 +215,35 @@ static void do_view3d_view_camerasmenu(void *arg, int event) i++; if (event==i) { - G.vd->camera= base->object; - handle_view3d_lock(); - G.vd->persp= 2; - G.vd->view= 0; + if (G.vd->camera == base->object && G.vd->persp==2) + return; + + if (U.smooth_viewtx) { + /* move 3d view to camera view */ + float orig_ofs[3], orig_lens = G.vd->lens; + VECCOPY(orig_ofs, G.vd->ofs); + + if (G.vd->camera && G.vd->persp==2) + view_settings_from_ob(G.vd->camera, G.vd->ofs, G.vd->viewquat, &G.vd->dist, &G.vd->lens); + + G.vd->camera = base->object; + handle_view3d_lock(); + G.vd->persp= 2; + G.vd->view= 0; + + smooth_view_to_camera(G.vd); + + /* restore values */ + VECCOPY(G.vd->ofs, orig_ofs); + G.vd->lens = orig_lens; + } else { + G.vd->camera= base->object; + handle_view3d_lock(); + G.vd->persp= 2; + G.vd->view= 0; + } + break; } } } |