diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-03 05:30:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-03 05:30:21 +0400 |
commit | 075fee4d58a65b4313bb7e984ae195690f4c7bfd (patch) | |
tree | e801da2591eda34a4c4c7fd5436ff476353b1c55 /source | |
parent | 68cc7e168207c4c519f54f7e0f7f638768386cd0 (diff) | |
parent | 050963b6a9529e0abdd597d163ddc4343c0b15c2 (diff) |
svn merge ^/trunk/blender -r43830:43864
Diffstat (limited to 'source')
27 files changed, 351 insertions, 264 deletions
diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index 7f321abf48e..a67a06ef9fb 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -69,9 +69,9 @@ void init_colorband(struct ColorBand *coba, int rangetype); struct ColorBand *add_colorband(int rangetype); int do_colorband(const struct ColorBand *coba, float in, float out[4]); void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size); -int vergcband(const void *a1, const void *a2); struct CBData *colorband_element_add(struct ColorBand *coba, float position); int colorband_element_remove(struct ColorBand *coba, int index); +void colorband_update_sort(struct ColorBand *coba); void default_tex(struct Tex *tex); struct Tex *add_texture(const char *name); diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index efeacabdba9..4c2c05e473f 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -224,6 +224,50 @@ void constraints_clear_evalob (bConstraintOb *cob) /* -------------- Space-Conversion API -------------- */ +static void constraint_pchan_diff_mat(bPoseChannel *pchan, float diff_mat[4][4]) +{ + if (pchan->parent) { + float offs_bone[4][4]; + + /* construct offs_bone the same way it is done in armature.c */ + copy_m4_m3(offs_bone, pchan->bone->bone_mat); + copy_v3_v3(offs_bone[3], pchan->bone->head); + offs_bone[3][1] += pchan->bone->parent->length; + + if (pchan->bone->flag & BONE_HINGE) { + /* pose_mat = par_pose-space_location * chan_mat */ + float tmat[4][4]; + + /* the rotation of the parent restposition */ + copy_m4_m4(tmat, pchan->bone->parent->arm_mat); + + /* the location of actual parent transform */ + copy_v3_v3(tmat[3], offs_bone[3]); + zero_v3(offs_bone[3]); + mul_m4_v3(pchan->parent->pose_mat, tmat[3]); + + mult_m4_m4m4(diff_mat, tmat, offs_bone); + } + else { + /* pose_mat = par_pose_mat * bone_mat * chan_mat */ + if (pchan->bone->flag & BONE_NO_SCALE) { + float tmat[4][4]; + copy_m4_m4(tmat, pchan->parent->pose_mat); + normalize_m4(tmat); + mult_m4_m4m4(diff_mat, tmat, offs_bone); + } + else { + mult_m4_m4m4(diff_mat, pchan->parent->pose_mat, offs_bone); + } + } + } + else { + /* pose_mat = chan_mat * arm_mat */ + copy_m4_m4(diff_mat, pchan->bone->arm_mat); + } +} + + /* This function is responsible for the correct transformations/conversions * of a matrix from one space to another for constraint evaluation. * For now, this is only implemented for Objects and PoseChannels. @@ -267,40 +311,10 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4 /* pose to local */ else if (to == CONSTRAINT_SPACE_LOCAL) { if (pchan->bone) { - if (pchan->parent) { - float offs_bone[4][4]; - - /* construct offs_bone the same way it is done in armature.c */ - copy_m4_m3(offs_bone, pchan->bone->bone_mat); - copy_v3_v3(offs_bone[3], pchan->bone->head); - offs_bone[3][1]+= pchan->bone->parent->length; - - if (pchan->bone->flag & BONE_HINGE) { - /* pose_mat = par_pose-space_location * chan_mat */ - float tmat[4][4]; - - /* the rotation of the parent restposition */ - copy_m4_m4(tmat, pchan->bone->parent->arm_mat); - - /* the location of actual parent transform */ - copy_v3_v3(tmat[3], offs_bone[3]); - offs_bone[3][0]= offs_bone[3][1]= offs_bone[3][2]= 0.0f; - mul_m4_v3(pchan->parent->pose_mat, tmat[3]); - - mult_m4_m4m4(diff_mat, tmat, offs_bone); - invert_m4_m4(imat, diff_mat); - } - else { - /* pose_mat = par_pose_mat * bone_mat * chan_mat */ - mult_m4_m4m4(diff_mat, pchan->parent->pose_mat, offs_bone); - invert_m4_m4(imat, diff_mat); - } - } - else { - /* pose_mat = chan_mat * arm_mat */ - invert_m4_m4(imat, pchan->bone->arm_mat); - } - + constraint_pchan_diff_mat(pchan, diff_mat); + + invert_m4_m4(imat, diff_mat); + copy_m4_m4(tempmat, mat); mult_m4_m4m4(mat, imat, tempmat); @@ -325,44 +339,11 @@ void constraint_mat_convertspace (Object *ob, bPoseChannel *pchan, float mat[][4 { /* local to pose - do inverse procedure that was done for pose to local */ if (pchan->bone) { - /* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */ - if (pchan->parent) { - float offs_bone[4][4]; - - /* construct offs_bone the same way it is done in armature.c */ - copy_m4_m3(offs_bone, pchan->bone->bone_mat); - copy_v3_v3(offs_bone[3], pchan->bone->head); - offs_bone[3][1]+= pchan->bone->parent->length; - - if (pchan->bone->flag & BONE_HINGE) { - /* pose_mat = par_pose-space_location * chan_mat */ - float tmat[4][4]; - - /* the rotation of the parent restposition */ - copy_m4_m4(tmat, pchan->bone->parent->arm_mat); - - /* the location of actual parent transform */ - copy_v3_v3(tmat[3], offs_bone[3]); - zero_v3(offs_bone[3]); - mul_m4_v3(pchan->parent->pose_mat, tmat[3]); - - mult_m4_m4m4(diff_mat, tmat, offs_bone); - copy_m4_m4(tempmat, mat); - mult_m4_m4m4(mat, diff_mat, tempmat); - } - else { - /* pose_mat = par_pose_mat * bone_mat * chan_mat */ - mult_m4_m4m4(diff_mat, pchan->parent->pose_mat, offs_bone); - copy_m4_m4(tempmat, mat); - mult_m4_m4m4(mat, diff_mat, tempmat); - } - } - else { - copy_m4_m4(diff_mat, pchan->bone->arm_mat); - - copy_m4_m4(tempmat, mat); - mult_m4_m4m4(mat, diff_mat, tempmat); - } + /* we need the posespace_matrix = local_matrix + (parent_posespace_matrix + restpos) */ + constraint_pchan_diff_mat(pchan, diff_mat); + + copy_m4_m4(tempmat, mat); + mult_m4_m4m4(mat, diff_mat, tempmat); } /* use pose-space as stepping stone for other spaces */ diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index c2c6f8d5b92..5661ab63f1a 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1181,6 +1181,60 @@ void makeDispListSurf(Scene *scene, Object *ob, ListBase *dispbase, forRender, originalVerts, deformedVerts); } +static void rotateBevelPiece(Curve *cu, BevPoint *bevp, DispList *dlb, float widfac, float fac, float **data_r) +{ + float *fp, *data = *data_r; + int b; + + fp = dlb->verts; + for (b = 0; b<dlb->nr; b++,fp += 3,data += 3) { + if(cu->flag & CU_3D) { + float vec[3]; + + vec[0] = fp[1]+widfac; + vec[1] = fp[2]; + vec[2 ]= 0.0; + + mul_qt_v3(bevp->quat, vec); + + data[0] = bevp->vec[0] + fac*vec[0]; + data[1] = bevp->vec[1] + fac*vec[1]; + data[2] = bevp->vec[2] + fac*vec[2]; + } + else { + data[0] = bevp->vec[0] + fac*(widfac+fp[1])*bevp->sina; + data[1] = bevp->vec[1] + fac*(widfac+fp[1])*bevp->cosa; + data[2] = bevp->vec[2] + fac*fp[2]; + } + } + + *data_r = data; +} + +static void fillBevelCap(Curve *cu, Nurb *nu, BevPoint *bevp, DispList *dlb, float fac, float widfac, ListBase *dispbase) +{ + DispList *dl; + float *data; + + dl= MEM_callocN(sizeof(DispList), "makeDispListbev2"); + dl->verts= data= MEM_callocN(3*sizeof(float)*dlb->nr, "dlverts"); + + dl->type= DL_POLY; + + dl->parts= 1; + dl->nr= dlb->nr; + dl->col= nu->mat_nr; + dl->charidx= nu->charidx; + + /* dl->rt will be used as flag for render face and */ + /* CU_2D conflicts with R_NOPUNOFLIP */ + dl->rt= nu->flag & ~CU_2D; + + rotateBevelPiece(cu, bevp, dlb, widfac, fac, &data); + + BLI_addtail(dispbase, dl); +} + static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispbase, DerivedMesh **derivedFinal, int forRender, int forOrco) { @@ -1225,9 +1279,9 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba for (; bl && nu; bl=bl->next,nu=nu->next) { DispList *dl; - float *fp1, *data; + float *data; BevPoint *bevp; - int a,b; + int a; if (bl->nr) { /* blank bevel lists can happen */ @@ -1264,9 +1318,10 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba } else { DispList *dlb; + ListBase bottom_capbase = {NULL, NULL}; + ListBase top_capbase = {NULL, NULL}; for (dlb=dlbev.first; dlb; dlb=dlb->next) { - /* for each part of the bevel use a separate displblock */ dl= MEM_callocN(sizeof(DispList), "makeDispListbev1"); dl->verts= data= MEM_callocN(3*sizeof(float)*dlb->nr*bl->nr, "dlverts"); @@ -1304,33 +1359,27 @@ static void do_makeDispListCurveTypes(Scene *scene, Object *ob, ListBase *dispba dl->bevelSplitFlag[a>>5] |= 1<<(a&0x1F); } - /* rotate bevel piece and write in data */ - fp1= dlb->verts; - for (b=0; b<dlb->nr; b++,fp1+=3,data+=3) { - if(cu->flag & CU_3D) { - float vec[3]; - - vec[0]= fp1[1]+widfac; - vec[1]= fp1[2]; - vec[2]= 0.0; - - mul_qt_v3(bevp->quat, vec); - - data[0]= bevp->vec[0] + fac*vec[0]; - data[1]= bevp->vec[1] + fac*vec[1]; - data[2]= bevp->vec[2] + fac*vec[2]; - } - else { - data[0]= bevp->vec[0] + fac*(widfac+fp1[1])*bevp->sina; - data[1]= bevp->vec[1] + fac*(widfac+fp1[1])*bevp->cosa; - data[2]= bevp->vec[2] + fac*fp1[2]; - } + /* rotate bevel piece and write in data */ + rotateBevelPiece(cu, bevp, dlb, widfac, fac, &data); + + if (cu->bevobj && (cu->flag & CU_FILL_CAPS)) { + if (a == 0) + fillBevelCap(cu, nu, bevp, dlb, fac, widfac, &bottom_capbase); + else if (a == bl->nr - 1) + fillBevelCap(cu, nu, bevp, dlb, fac, widfac, &top_capbase); } } - + /* gl array drawing: using indices */ displist_surf_indices(dl); } + + if(bottom_capbase.first) { + filldisplist(&bottom_capbase, dispbase, 1); + filldisplist(&top_capbase, dispbase, 0); + freedisplist(&bottom_capbase); + freedisplist(&top_capbase); + } } } diff --git a/source/blender/blenkernel/intern/navmesh_conversion.c b/source/blender/blenkernel/intern/navmesh_conversion.c index 72523ae54e0..4c9c0a3a1fc 100644 --- a/source/blender/blenkernel/intern/navmesh_conversion.c +++ b/source/blender/blenkernel/intern/navmesh_conversion.c @@ -344,7 +344,7 @@ int buildNavMeshData(const int nverts, const float* verts, int *vertsPerPoly_r, int **dtrisToPolysMap_r, int **dtrisToTrisMap_r) { - int *trisMapping = MEM_callocN(sizeof(int)*ntris, "buildNavMeshData trisMapping"); + int *trisMapping; int i; struct SortContext context; int validTriStart, prevPolyIdx, curPolyIdx, newPolyIdx, prevpolyidx; @@ -360,6 +360,8 @@ int buildNavMeshData(const int nverts, const float* verts, return 0; } + trisMapping = MEM_callocN(sizeof(int)*ntris, "buildNavMeshData trisMapping"); + //sort the triangles by polygon idx for (i=0; i<ntris; i++) trisMapping[i]=i; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 08b53115919..d18a71d3c55 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -745,7 +745,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range) seq->scene = sce; } - seq->len= seq->scene->r.efra - seq->scene->r.sfra + 1; + seq->len= (seq->scene)? seq->scene->r.efra - seq->scene->r.sfra + 1: 0; seq->len -= seq->anim_startofs; seq->len -= seq->anim_endofs; if (seq->len < 0) { diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 88858c9ff51..4c40dca3365 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -478,10 +478,28 @@ int vergcband(const void *a1, const void *a2) return 0; } -CBData *colorband_element_add(struct ColorBand *coba, float position) +void colorband_update_sort(ColorBand *coba) { int a; + + if(coba->tot<2) + return; + + for(a=0; a<coba->tot; a++) + coba->data[a].cur= a; + + qsort(coba->data, coba->tot, sizeof(CBData), vergcband); + for(a=0; a<coba->tot; a++) { + if(coba->data[a].cur==coba->cur) { + coba->cur= a; + break; + } + } +} + +CBData *colorband_element_add(struct ColorBand *coba, float position) +{ if(coba->tot==MAXCOLORBAND) { return NULL; } @@ -503,17 +521,7 @@ CBData *colorband_element_add(struct ColorBand *coba, float position) coba->tot++; coba->cur = coba->tot-1; - for(a = 0; a < coba->tot; a++) - coba->data[a].cur = a; - - qsort(coba->data, coba->tot, sizeof(CBData), vergcband); - - for(a = 0; a < coba->tot; a++) { - if(coba->data[a].cur == coba->cur) { - coba->cur = a; - break; - } - } + colorband_update_sort(coba); return coba->data + coba->cur; } diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index c4eacff11c5..8dffb17a19f 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -65,6 +65,7 @@ void GeometryExporter::operator()(Object *ob) #endif Mesh *me = (Mesh*)ob->data; std::string geom_id = get_geometry_id(ob); + std::string geom_name = id_name(ob->data); std::vector<Normal> nor; std::vector<Face> norind; @@ -78,7 +79,7 @@ void GeometryExporter::operator()(Object *ob) create_normals(nor, norind, me); // openMesh(geoId, geoName, meshId) - openMesh(geom_id); + openMesh(geom_id, geom_name); // writes <source> for vertex coords createVertsSource(geom_id, me); diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index a7c37d371e5..8ac7406462d 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1529,7 +1529,7 @@ static int animchannels_setflag_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - +/* duplicate of 'ANIM_OT_channels_setting_toggle' for menu title only, weak! */ static void ANIM_OT_channels_setting_enable (wmOperatorType *ot) { /* identifiers */ @@ -1551,7 +1551,7 @@ static void ANIM_OT_channels_setting_enable (wmOperatorType *ot) /* setting to set */ ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); } - +/* duplicate of 'ANIM_OT_channels_setting_toggle' for menu title only, weak! */ static void ANIM_OT_channels_setting_disable (wmOperatorType *ot) { /* identifiers */ @@ -1574,28 +1574,6 @@ static void ANIM_OT_channels_setting_disable (wmOperatorType *ot) ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); } -static void ANIM_OT_channels_setting_invert (wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Invert Channel Setting"; - ot->idname= "ANIM_OT_channels_setting_toggle"; - ot->description= "Invert specified setting on all selected animation channels"; - - /* api callbacks */ - ot->invoke= WM_menu_invoke; - ot->exec= animchannels_setflag_exec; - ot->poll= animedit_poll_channels_active; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* props */ - /* flag-setting mode */ - RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_INVERT, "Mode", ""); - /* setting to set */ - ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); -} - static void ANIM_OT_channels_setting_toggle (wmOperatorType *ot) { /* identifiers */ @@ -2401,7 +2379,6 @@ void ED_operatortypes_animchannels(void) WM_operatortype_append(ANIM_OT_channels_setting_enable); WM_operatortype_append(ANIM_OT_channels_setting_disable); - WM_operatortype_append(ANIM_OT_channels_setting_invert); WM_operatortype_append(ANIM_OT_channels_setting_toggle); WM_operatortype_append(ANIM_OT_channels_delete); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index cfb375c2558..cadc57c9881 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3607,31 +3607,6 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle } -static int verg_colorband(const void *a1, const void *a2) -{ - const CBData *x1=a1, *x2=a2; - - if( x1->pos > x2->pos ) return 1; - else if( x1->pos < x2->pos) return -1; - return WM_UI_HANDLER_CONTINUE; -} - -static void ui_colorband_update(ColorBand *coba) -{ - int a; - - if(coba->tot<2) return; - - for(a=0; a<coba->tot; a++) coba->data[a].cur= a; - qsort(coba->data, coba->tot, sizeof(CBData), verg_colorband); - for(a=0; a<coba->tot; a++) { - if(coba->data[a].cur==coba->cur) { - coba->cur= a; - break; - } - } -} - static int ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx) { float dx; @@ -3644,7 +3619,7 @@ static int ui_numedit_but_COLORBAND(uiBut *but, uiHandleButtonData *data, int mx data->dragcbd->pos += dx; CLAMP(data->dragcbd->pos, 0.0f, 1.0f); - ui_colorband_update(data->coba); + colorband_update_sort(data->coba); data->dragcbd= data->coba->data + data->coba->cur; /* because qsort */ data->draglastx= mx; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 3093a4d40f9..55e89ea4428 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1305,6 +1305,16 @@ static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v) rna_update_cb(C, cb_v, NULL); } +static void colorband_update_cb(bContext *UNUSED(C), void *bt_v, void *coba_v) +{ + uiBut *bt= bt_v; + ColorBand *coba= coba_v; + + /* sneaky update here, we need to sort the colorband points to be in order, + however the RNA pointer then is wrong, so we update it */ + colorband_update_sort(coba); + bt->rnapoin.data = coba->data + coba->cur; +} /* offset aligns from bottom, standard width 300, height 115 */ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand *coba, int xoffs, int yoffs, RNAUpdateCb *cb) @@ -1348,7 +1358,11 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand PointerRNA ptr; RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr); row= uiLayoutRow(layout, 0); + uiItemR(row, &ptr, "position", 0, "Pos", ICON_NONE); + bt= block->buttons.last; + uiButSetFunc(bt, colorband_update_cb, bt, coba); + uiItemR(row, &ptr, "color", 0, "", ICON_NONE); } diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index b1a25d093d2..26516bcda99 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -43,6 +43,7 @@ #include "BKE_context.h" #include "BKE_global.h" #include "BKE_main.h" +#include "BKE_report.h" #include "WM_api.h" #include "WM_types.h" @@ -160,6 +161,11 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event) FileBrowseOp *fbo; char *str; + if (CTX_wm_space_file(C)) { + BKE_report(op->reports, RPT_ERROR, "Can't activate a file selector, one already open"); + return OPERATOR_CANCELLED; + } + uiFileBrowseContextProperty(C, &ptr, &prop); if(!prop) diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 935dda864bf..6a9c2755330 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -3417,15 +3417,15 @@ static int clean_tracks_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even { SpaceClip *sc= CTX_wm_space_clip(C); MovieClip *clip= ED_space_clip(sc); - int frames= RNA_int_get(op->ptr, "frames"); - float error= RNA_float_get(op->ptr, "error"); - int action= RNA_enum_get(op->ptr, "action"); - if(frames==0 && error==0 && action==0) { + if(!RNA_struct_property_is_set(op->ptr, "frames")) RNA_int_set(op->ptr, "frames", clip->tracking.settings.clean_frames); + + if(!RNA_struct_property_is_set(op->ptr, "error")) RNA_float_set(op->ptr, "error", clip->tracking.settings.clean_error); + + if(!RNA_struct_property_is_set(op->ptr, "action")) RNA_enum_set(op->ptr, "action", clip->tracking.settings.clean_action); - } return clean_tracks_exec(C, op); } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 776cad6d89c..416fbd58a30 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2361,12 +2361,17 @@ void flushTransSeq(TransInfo *t) if (ELEM(t->mode, TFM_SEQ_SLIDE, TFM_TIME_TRANSLATE)) { /* originally TFM_TIME_EXTEND, transform changes */ /* Special annoying case here, need to calc metas with TFM_TIME_EXTEND only */ - seq= seqbasep->first; - while(seq) { - if (seq->type == SEQ_META && seq->flag & SELECT) + /* calc all meta's then effects [#27953] */ + for (seq = seqbasep->first; seq; seq = seq->next) { + if (seq->type == SEQ_META && seq->flag & SELECT) { calc_sequence(t->scene, seq); - seq= seq->next; + } + } + for (seq = seqbasep->first; seq; seq = seq->next) { + if (seq->seq1 || seq->seq2 || seq->seq3) { + calc_sequence(t->scene, seq); + } } } diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index ffcc516f393..455738c840b 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -260,6 +260,7 @@ typedef struct Curve { #define CU_DS_EXPAND 2048 #define CU_PATH_RADIUS 4096 /* make use of the path radius if this is enabled (default for new curves) */ #define CU_DEFORM_FILL 8192 /* fill 2d curve after deformation */ +#define CU_FILL_CAPS 16384 /* fill bevel caps */ /* twist mode */ #define CU_TWIST_Z_UP 0 diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index a3825531b19..8a1c56abedf 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -78,24 +78,24 @@ EnumPropertyItem constraint_type_items[] ={ {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem target_space_pchan_items[] = { - {0, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"}, - {2, "POSE", 0, "Pose Space", "The transformation of the target is only evaluated in the Pose Space, the target armature object transformation is ignored"}, - {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The transformation of the target bone is evaluated relative its local coordinate system, with the parent transformation added"}, - {1, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"}, + {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"}, + {CONSTRAINT_SPACE_POSE, "POSE", 0, "Pose Space", "The transformation of the target is only evaluated in the Pose Space, the target armature object transformation is ignored"}, + {CONSTRAINT_SPACE_PARLOCAL, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The transformation of the target bone is evaluated relative its local coordinate system, with the parent transformation added"}, + {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem owner_space_pchan_items[] = { - {0, "WORLD", 0, "World Space", "The constraint is applied relative to the world coordinate system"}, - {2, "POSE", 0, "Pose Space", "The constraint is applied in Pose Space, the object transformation is ignored"}, - {3, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The constraint is applied relative to the local coordinate system of the object, with the parent transformation added"}, - {1, "LOCAL", 0, "Local Space", "The constraint is applied relative to the local coordinate sytem of the object"}, + {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space", "The constraint is applied relative to the world coordinate system"}, + {CONSTRAINT_SPACE_POSE, "POSE", 0, "Pose Space", "The constraint is applied in Pose Space, the object transformation is ignored"}, + {CONSTRAINT_SPACE_PARLOCAL, "LOCAL_WITH_PARENT", 0, "Local With Parent", "The constraint is applied relative to the local coordinate system of the object, with the parent transformation added"}, + {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The constraint is applied relative to the local coordinate sytem of the object"}, {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME static EnumPropertyItem space_object_items[] = { - {0, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"}, - {1, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"}, + {CONSTRAINT_SPACE_WORLD, "WORLD", 0, "World Space", "The transformation of the target is evaluated relative to the world coordinate system"}, + {CONSTRAINT_SPACE_LOCAL, "LOCAL", 0, "Local Space", "The transformation of the target is evaluated relative to its local coordinate system"}, {0, NULL, 0, NULL, NULL}}; #include "BKE_animsys.h" diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 5fd67efba1d..088f2dba0bb 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1386,9 +1386,14 @@ static void rna_def_curve(BlenderRNA *brna) prop= RNA_def_property(srna, "use_fill_deform", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_DEFORM_FILL); - RNA_def_property_ui_text(prop, "Fill deformed", "Fill curve after applying shape keys and all modifiers"); + RNA_def_property_ui_text(prop, "Fill Deformed", "Fill curve after applying shape keys and all modifiers"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + + prop= RNA_def_property(srna, "use_fill_caps", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FILL_CAPS); + RNA_def_property_ui_text(prop, "Fill Caps", "Fill caps for bevelled curves"); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + /* texture space */ prop= RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "texflag", CU_AUTOSPACE); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 52a4a1db36b..8ae597f2d1c 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -295,43 +295,44 @@ EnumPropertyItem event_type_items[] = { {TIMER1, "TIMER1", 0, "Timer 1", ""}, {TIMER2, "TIMER2", 0, "Timer 2", ""}, {0, "", 0, NULL, NULL}, + {NDOF_MOTION, "NDOF_MOTION", 0, "NDOF Motion", ""}, /* buttons on all 3dconnexion devices */ - {NDOF_BUTTON_MENU, "NDOF_BUTTON_MENU", 0, "Menu", ""}, - {NDOF_BUTTON_FIT, "NDOF_BUTTON_FIT", 0, "Fit", ""}, + {NDOF_BUTTON_MENU, "NDOF_BUTTON_MENU", 0, "NDOF Menu", ""}, + {NDOF_BUTTON_FIT, "NDOF_BUTTON_FIT", 0, "NDOF Fit", ""}, /* view buttons */ - {NDOF_BUTTON_TOP, "NDOF_BUTTON_TOP", 0, "Top", ""}, - {NDOF_BUTTON_BOTTOM, "NDOF_BUTTON_BOTTOM", 0, "Bottom", ""}, - {NDOF_BUTTON_LEFT, "NDOF_BUTTON_LEFT", 0, "Left", ""}, - {NDOF_BUTTON_RIGHT, "NDOF_BUTTON_RIGHT", 0, "Right", ""}, - {NDOF_BUTTON_FRONT, "NDOF_BUTTON_FRONT", 0, "Front", ""}, - {NDOF_BUTTON_BACK, "NDOF_BUTTON_BACK", 0, "Back", ""}, + {NDOF_BUTTON_TOP, "NDOF_BUTTON_TOP", 0, "NDOF Top", ""}, + {NDOF_BUTTON_BOTTOM, "NDOF_BUTTON_BOTTOM", 0, "NDOF Bottom", ""}, + {NDOF_BUTTON_LEFT, "NDOF_BUTTON_LEFT", 0, "NDOF Left", ""}, + {NDOF_BUTTON_RIGHT, "NDOF_BUTTON_RIGHT", 0, "NDOF Right", ""}, + {NDOF_BUTTON_FRONT, "NDOF_BUTTON_FRONT", 0, "NDOF Front", ""}, + {NDOF_BUTTON_BACK, "NDOF_BUTTON_BACK", 0, "NDOF Back", ""}, /* more views */ - {NDOF_BUTTON_ISO1, "NDOF_BUTTON_ISO1", 0, "ISO 1", ""}, - {NDOF_BUTTON_ISO2, "NDOF_BUTTON_ISO2", 0, "ISO 2", ""}, + {NDOF_BUTTON_ISO1, "NDOF_BUTTON_ISO1", 0, "NDOF ISO 1", ""}, + {NDOF_BUTTON_ISO2, "NDOF_BUTTON_ISO2", 0, "NDOF ISO 2", ""}, /* 90 degree rotations */ - {NDOF_BUTTON_ROLL_CW, "NDOF_BUTTON_ROLL_CW", 0, "Roll CW", ""}, - {NDOF_BUTTON_ROLL_CCW, "NDOF_BUTTON_ROLL_CCW", 0, "Roll CCW", ""}, - {NDOF_BUTTON_SPIN_CW, "NDOF_BUTTON_SPIN_CW", 0, "Spin CW", ""}, - {NDOF_BUTTON_SPIN_CCW, "NDOF_BUTTON_SPIN_CCW", 0, "Spin CCW", ""}, - {NDOF_BUTTON_TILT_CW, "NDOF_BUTTON_TILT_CW", 0, "Tilt CW", ""}, - {NDOF_BUTTON_TILT_CCW, "NDOF_BUTTON_TILT_CCW", 0, "Tilt CCW", ""}, + {NDOF_BUTTON_ROLL_CW, "NDOF_BUTTON_ROLL_CW", 0, "NDOF Roll CW", ""}, + {NDOF_BUTTON_ROLL_CCW, "NDOF_BUTTON_ROLL_CCW", 0, "NDOF Roll CCW", ""}, + {NDOF_BUTTON_SPIN_CW, "NDOF_BUTTON_SPIN_CW", 0, "NDOF Spin CW", ""}, + {NDOF_BUTTON_SPIN_CCW, "NDOF_BUTTON_SPIN_CCW", 0, "NDOF Spin CCW", ""}, + {NDOF_BUTTON_TILT_CW, "NDOF_BUTTON_TILT_CW", 0, "NDOF Tilt CW", ""}, + {NDOF_BUTTON_TILT_CCW, "NDOF_BUTTON_TILT_CCW", 0, "NDOF Tilt CCW", ""}, /* device control */ - {NDOF_BUTTON_ROTATE, "NDOF_BUTTON_ROTATE", 0, "Rotate", ""}, - {NDOF_BUTTON_PANZOOM, "NDOF_BUTTON_PANZOOM", 0, "Pan/Zoom", ""}, - {NDOF_BUTTON_DOMINANT, "NDOF_BUTTON_DOMINANT", 0, "Dominant", ""}, - {NDOF_BUTTON_PLUS, "NDOF_BUTTON_PLUS", 0, "Plus", ""}, - {NDOF_BUTTON_MINUS, "NDOF_BUTTON_MINUS", 0, "Minus", ""}, + {NDOF_BUTTON_ROTATE, "NDOF_BUTTON_ROTATE", 0, "NDOF Rotate", ""}, + {NDOF_BUTTON_PANZOOM, "NDOF_BUTTON_PANZOOM", 0, "NDOF Pan/Zoom", ""}, + {NDOF_BUTTON_DOMINANT, "NDOF_BUTTON_DOMINANT", 0, "NDOF Dominant", ""}, + {NDOF_BUTTON_PLUS, "NDOF_BUTTON_PLUS", 0, "NDOF Plus", ""}, + {NDOF_BUTTON_MINUS, "NDOF_BUTTON_MINUS", 0, "NDOF Minus", ""}, /* general-purpose buttons */ - {NDOF_BUTTON_1, "NDOF_BUTTON_1", 0, "Button 1", ""}, - {NDOF_BUTTON_2, "NDOF_BUTTON_2", 0, "Button 2", ""}, - {NDOF_BUTTON_3, "NDOF_BUTTON_3", 0, "Button 3", ""}, - {NDOF_BUTTON_4, "NDOF_BUTTON_4", 0, "Button 4", ""}, - {NDOF_BUTTON_5, "NDOF_BUTTON_5", 0, "Button 5", ""}, - {NDOF_BUTTON_6, "NDOF_BUTTON_6", 0, "Button 6", ""}, - {NDOF_BUTTON_7, "NDOF_BUTTON_7", 0, "Button 7", ""}, - {NDOF_BUTTON_8, "NDOF_BUTTON_8", 0, "Button 8", ""}, - {NDOF_BUTTON_9, "NDOF_BUTTON_9", 0, "Button 9", ""}, - {NDOF_BUTTON_10, "NDOF_BUTTON_10", 0, "Button 10", ""}, + {NDOF_BUTTON_1, "NDOF_BUTTON_1", 0, "NDOF Button 1", ""}, + {NDOF_BUTTON_2, "NDOF_BUTTON_2", 0, "NDOF Button 2", ""}, + {NDOF_BUTTON_3, "NDOF_BUTTON_3", 0, "NDOF Button 3", ""}, + {NDOF_BUTTON_4, "NDOF_BUTTON_4", 0, "NDOF Button 4", ""}, + {NDOF_BUTTON_5, "NDOF_BUTTON_5", 0, "NDOF Button 5", ""}, + {NDOF_BUTTON_6, "NDOF_BUTTON_6", 0, "NDOF Button 6", ""}, + {NDOF_BUTTON_7, "NDOF_BUTTON_7", 0, "NDOF Button 7", ""}, + {NDOF_BUTTON_8, "NDOF_BUTTON_8", 0, "NDOF Button 8", ""}, + {NDOF_BUTTON_9, "NDOF_BUTTON_9", 0, "NDOF Button 9", ""}, + {NDOF_BUTTON_10, "NDOF_BUTTON_10", 0, "NDOF Button 10", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem keymap_propvalue_items[] = { @@ -1050,6 +1051,9 @@ static StructRNA *rna_Operator_register(Main *bmain, ReportList *reports, void * rna_Operator_unregister(bmain, ot->ext.srna); } + /* XXX, this doubles up with the operator name [#29666] + * for now just remove from dir(bpy.types) */ + /* create a new operator type */ dummyot.ext.srna= RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator"); RNA_def_struct_flag(dummyot.ext.srna, STRUCT_NO_IDPROPERTIES); /* operator properties are registered separately */ @@ -1126,7 +1130,10 @@ static StructRNA *rna_MacroOperator_register(Main *bmain, ReportList *reports, v rna_Operator_unregister(bmain, ot->ext.srna); } - /* create a new menu type */ + /* XXX, this doubles up with the operator name [#29666] + * for now just remove from dir(bpy.types) */ + + /* create a new operator type */ dummyot.ext.srna= RNA_def_struct(&BLENDER_RNA, dummyot.idname, "Operator"); dummyot.ext.data= data; dummyot.ext.call= call; diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index b25cf1916c6..9dc560afb0f 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -152,9 +152,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd) void fluidsim_free(FluidsimModifierData *fluidmd) { -#ifdef WITH_MOD_FLUID - if(fluidmd) - { + if(fluidmd) { if(fluidmd->fss->meshVelocities) { MEM_freeN(fluidmd->fss->meshVelocities); @@ -162,16 +160,13 @@ void fluidsim_free(FluidsimModifierData *fluidmd) } MEM_freeN(fluidmd->fss); } -#else - (void)fluidmd; /* unused */ -#endif return; } #ifdef WITH_MOD_FLUID /* read .bobj.gz file into a fluidsimDerivedMesh struct */ -static DerivedMesh *fluidsim_read_obj(const char *filename) +static DerivedMesh *fluidsim_read_obj(const char *filename, const MPoly *mp_example) { int wri = 0,i; int gotBytes; @@ -184,6 +179,9 @@ static DerivedMesh *fluidsim_read_obj(const char *filename) short *normals, *no_s; float no[3]; + const short mp_mat_nr = mp_example->mat_nr; + const char mp_flag = mp_example->flag; + // ------------------------------------------------ // get numverts + numfaces first // ------------------------------------------------ @@ -289,6 +287,10 @@ static DerivedMesh *fluidsim_read_obj(const char *filename) gotBytes = gzread(gzf, face, sizeof(int) * 3); + /* initialize from existing face */ + mp->mat_nr = mp_mat_nr; + mp->flag = mp_flag; + mp->loopstart = i * 3; mp->totloop = 3; @@ -444,8 +446,7 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim FluidsimSettings *fss = fluidmd->fss; DerivedMesh *dm = NULL; MPoly *mpoly; - int numpolys; - int mat_nr, flag, i; + MPoly mp_example = {0}; if(!useRenderParams) { displaymode = fss->guiDisplayMode; @@ -473,7 +474,15 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim BLI_path_abs(targetFile, modifier_path_relbase(ob)); BLI_path_frame(targetFile, curFrame, 0); // fixed #frame-no - dm = fluidsim_read_obj(targetFile); + // assign material + flags to new dm + // if there's no faces in original dm, keep materials and flags unchanged + mpoly = orgdm->getPolyArray(orgdm); + if (mpoly) { + mp_example = *mpoly; + } + /* else leave NULL'd */ + + dm = fluidsim_read_obj(targetFile, &mp_example); if(!dm) { @@ -494,21 +503,6 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim return NULL; } - // assign material + flags to new dm - mpoly = orgdm->getPolyArray(orgdm); - if(mpoly) { - mat_nr = mpoly[0].mat_nr; - flag = mpoly[0].flag; - - mpoly = dm->getPolyArray(dm); - numpolys = dm->getNumPolys(dm); - for(i=0; i<numpolys; i++) - { - mpoly[i].mat_nr = mat_nr; - mpoly[i].flag = flag; - } - } - // load vertex velocities, if they exist... // TODO? use generate flag as loading flag as well? // warning, needs original .bobj.gz mesh loading filename diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index bfb79ea6531..11e79fdee2a 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -6298,6 +6298,8 @@ static struct PyMethodDef pyrna_basetype_methods[] = { {NULL, NULL, 0, NULL} }; +/* used to call ..._keys() direct, but we need to filter out operator subclasses */ +#if 0 static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self) { PyObject *list; @@ -6318,6 +6320,34 @@ static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self) return list; } +#else + +static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self) +{ + PyObject *ret = PyList_New(0); + PyObject *item; + + RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) { + StructRNA *srna = itemptr.data; + StructRNA *srna_base = RNA_struct_base(itemptr.data); + /* skip own operators, these double up [#29666] */ + if (srna_base == &RNA_Operator) { + /* do nothing */ + } + else { + /* add to python list */ + item = PyUnicode_FromString(RNA_struct_identifier(srna)); + PyList_Append(ret, item); + Py_DECREF(item); + } + } + RNA_PROP_END; + + return ret; +} + +#endif + static PyTypeObject pyrna_basetype_Type = BLANK_PYTHON_TYPE; PyObject *BPY_rna_types(void) diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 5848e6e8c75..0ca8878c96a 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -174,7 +174,7 @@ static PyObject *C_Vector_Range(PyObject *cls, PyObject *args) case 2: if (start >= stop) { PyErr_SetString(PyExc_RuntimeError, - "Start value is larger" + "Start value is larger " "than the stop value"); return NULL; } @@ -184,16 +184,27 @@ static PyObject *C_Vector_Range(PyObject *cls, PyObject *args) default: if (start >= stop) { PyErr_SetString(PyExc_RuntimeError, - "Start value is larger" + "Start value is larger " "than the stop value"); return NULL; } - size = (stop - start)/step; - if (size%step) - size++; + + size = (stop - start); + + if ((size % step) != 0) + size += step; + + size /= step; + break; } + if (size < 2) { + PyErr_SetString(PyExc_RuntimeError, + "Vector(): invalid size"); + return NULL; + } + vec = PyMem_Malloc(size * sizeof(float)); if (vec == NULL) { diff --git a/source/blender/python/rna_dump.py b/source/blender/python/rna_dump.py index df902886f30..489f011e693 100644 --- a/source/blender/python/rna_dump.py +++ b/source/blender/python/rna_dump.py @@ -79,7 +79,7 @@ def seek(r, txt, recurs): except: keys = None - if keys != None: + if keys is not None: if PRINT_DATA: print(txt + '.keys() - ' + str(r.keys())) diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 604ba189dcf..100b12aa169 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1745,7 +1745,7 @@ static int check_valid_camera(Scene *scene, Object *camera_override) check_comp= 0; while(seq) { - if(seq->type == SEQ_SCENE) { + if(seq->type == SEQ_SCENE && seq->scene) { if(!seq->scene_camera) { if(!seq->scene->camera && !scene_find_camera(seq->scene)) { if(seq->scene == scene) { diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index a46b3791693..0d5aed7dadb 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -212,9 +212,9 @@ void fillrect(int *rect, int x, int y, int val) } /* based on Liang&Barsky, for clipping of pyramidical volume */ -static short cliptestf(float p, float q, float *u1, float *u2) +static short cliptestf(float a, float b, float c, float d, float *u1, float *u2) { - float r; + float p= a + b, q= c + d, r; if(p<0.0f) { if(q<p) return 0; @@ -854,20 +854,20 @@ static int clipline(float v1[4], float v2[4]) /* return 0: do not draw */ filled in with zbufwire correctly when rendering in parts. otherwise you see line endings at edges... */ - if(cliptestf(-dz-dw, v1[3]+v1[2], &u1,&u2)) { - if(cliptestf(dz-dw, v1[3]-v1[2], &u1,&u2)) { + if(cliptestf(-dz, -dw, v1[3], v1[2], &u1,&u2)) { + if(cliptestf(dz, -dw, v1[3], -v1[2], &u1,&u2)) { dx= v2[0]-v1[0]; dz= 1.01f*(v2[3]-v1[3]); v13= 1.01f*v1[3]; - if(cliptestf(-dx-dz, v1[0]+v13, &u1,&u2)) { - if(cliptestf(dx-dz, v13-v1[0], &u1,&u2)) { + if(cliptestf(-dx, -dz, v1[0], v13, &u1,&u2)) { + if(cliptestf(dx, -dz, v13, -v1[0], &u1,&u2)) { dy= v2[1]-v1[1]; - if(cliptestf(-dy-dz, v1[1]+v13, &u1,&u2)) { - if(cliptestf(dy-dz, v13-v1[1], &u1,&u2)) { + if(cliptestf(-dy, -dz, v1[1], v13, &u1,&u2)) { + if(cliptestf(dy, -dz, v13, -v1[1], &u1,&u2)) { if(u2<1.0f) { v2[0]= v1[0]+u2*dx; @@ -1628,8 +1628,8 @@ static void clippyra(float *labda, float *v1, float *v2, int *b2, int *b3, int a * who would have thought that of L&B! */ - if(cliptestf(-da-dw, v13+v1[a], &u1,&u2)) { - if(cliptestf(da-dw, v13-v1[a], &u1,&u2)) { + if(cliptestf(-da, -dw, v13, v1[a], &u1,&u2)) { + if(cliptestf(da, -dw, v13, -v1[a], &u1,&u2)) { *b3=1; if(u2<1.0f) { labda[1]= u2; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 079833f693f..621e5449223 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2684,9 +2684,11 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U } event.utf8_buf[0]= '\0'; } - else if (event.ascii<32 && event.ascii > 0) { - event.ascii= '\0'; - /* TODO. should this also zero utf8?, dont for now, campbell */ + else { + if (event.ascii<32 && event.ascii > 0) + event.ascii= '\0'; + if (event.utf8_buf[0]<32 && event.utf8_buf[0] > 0) + event.utf8_buf[0]= '\0'; } if (event.utf8_buf[0]) { diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp index 3b63c85feea..e6f8d7175dc 100644 --- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp +++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp @@ -248,7 +248,7 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts, } //create tris - polys = new unsigned short[npolys*3*2]; + polys = (unsigned short*)MEM_callocN(sizeof(unsigned short)*3*2*npolys, "BuildVertIndArrays polys"); memset(polys, 0xff, sizeof(unsigned short)*3*2*npolys); unsigned short *poly = polys; RAS_Polygon* raspoly; diff --git a/source/tests/bl_mesh_modifiers.py b/source/tests/bl_mesh_modifiers.py index 917ccbc0d24..0495f5d9f98 100644 --- a/source/tests/bl_mesh_modifiers.py +++ b/source/tests/bl_mesh_modifiers.py @@ -74,7 +74,7 @@ def render_gl(context, filepath, shade): def render_gl_all_modes(context, obj, filepath=""): - assert(obj != None) + assert(obj is not None) assert(filepath != "") scene = context.scene diff --git a/source/tests/bl_run_operators.py b/source/tests/bl_run_operators.py index b64055df252..b3781e94696 100644 --- a/source/tests/bl_run_operators.py +++ b/source/tests/bl_run_operators.py @@ -37,6 +37,7 @@ op_blacklist = ( "render.render", "*.*_export", "*.*_import", + "wm.blenderplayer_start", "wm.url_open", "wm.doc_view", "wm.path_open", @@ -137,7 +138,25 @@ def ctx_weightpaint(): bpy.ops.object.mode_set(mode='WEIGHT_PAINT') +def bpy_check_type_duplicates(): + # non essential sanity check + bl_types = dir(bpy.types) + bl_types_unique = set(bl_types) + + if len(bl_types) != len(bl_types_unique): + print("Error, found duplicates in 'bpy.types'") + for t in sorted(bl_types_unique): + tot = bl_types.count(t) + if tot > 1: + print(" '%s', %d" % (t, tot)) + import sys + sys.exit(1) + + def main(): + + bpy_check_type_duplicates() + # bpy.ops.wm.read_factory_settings() import bpy operators = [] |