Commit: 55e719ec35a10c3f9e7231dee13d4b05aad7d965 Author: Campbell Barton Date: Wed Nov 14 17:12:52 2018 +1100 Branches: blender2.8 https://developer.blender.org/rB55e719ec35a10c3f9e7231dee13d4b05aad7d965
Merge branch 'master' into blender2.8 =================================================================== =================================================================== diff --cc source/blender/blenkernel/BKE_dynamicpaint.h index 537a2946f36,c265672da88..cffadeb5fd9 --- a/source/blender/blenkernel/BKE_dynamicpaint.h +++ b/source/blender/blenkernel/BKE_dynamicpaint.h @@@ -27,14 -27,11 +27,14 @@@ * \ingroup bke */ -struct EvaluationContext; +struct Depsgraph; +struct DynamicPaintCanvasSettings; +struct DynamicPaintModifierData; struct Main; struct Scene; +struct ViewLayer; --/* Actual surface point */ ++/* Actual surface point */ typedef struct PaintSurfaceData { void *format_data; /* special data for each surface "format" */ void *type_data; /* data used by specific surface type */ @@@ -45,7 -42,7 +45,7 @@@ } PaintSurfaceData; --/* Paint type surface point */ ++/* Paint type surface point */ typedef struct PaintPoint { /* Wet paint is handled at effect layer only @@@ -56,7 -53,7 +56,7 @@@ float color[4]; } PaintPoint; --/* height field waves */ ++/* height field waves */ typedef struct PaintWavePoint { float height; diff --cc source/blender/blenkernel/intern/anim.c index 89291b158b7,d5f269b82a8..c3b6041243d --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@@ -347,34 -367,25 +347,34 @@@ static void motionpaths_calc_bake_targe /* for each target, check if it can be baked on the current frame */ for (mpt = targets->first; mpt; mpt = mpt->next) { bMotionPath *mpath = mpt->mpath; - bMotionPathVert *mpv; /* current frame must be within the range the cache works for - * - is inclusive of the first frame, but not the last otherwise we get buffer overruns + * - is inclusive of the first frame, but not the last otherwise we get buffer overruns */ - if ((CFRA < mpath->start_frame) || (CFRA >= mpath->end_frame)) + if ((cframe < mpath->start_frame) || (cframe >= mpath->end_frame)) { continue; + } /* get the relevant cache vert to write to */ - mpv = mpath->points + (CFRA - mpath->start_frame); + bMotionPathVert *mpv = mpath->points + (cframe - mpath->start_frame); - /* pose-channel or object path baking? */ + Object *ob_eval = mpt->ob_eval; + + /* Lookup evaluated pose channel, here because the depsgraph + * evaluation can change them so they are not cached in mpt. */ + bPoseChannel *pchan_eval = NULL; if (mpt->pchan) { + pchan_eval = BKE_pose_channel_find_name(ob_eval->pose, mpt->pchan->name); + } + + /* pose-channel or object path baking? */ + if (pchan_eval) { /* heads or tails */ if (mpath->flag & MOTIONPATH_FLAG_BHEAD) { - copy_v3_v3(mpv->co, mpt->pchan->pose_head); + copy_v3_v3(mpv->co, pchan_eval->pose_head); } else { - copy_v3_v3(mpv->co, mpt->pchan->pose_tail); + copy_v3_v3(mpv->co, pchan_eval->pose_tail); } /* result must be in worldspace */ @@@ -414,18 -399,17 +414,18 @@@ } /* Perform baking of the given object's and/or its bones' transforms to motion paths - * - scene: current scene - * - ob: object whose flagged motionpaths should get calculated - * - recalc: whether we need to + * - scene: current scene + * - ob: object whose flagged motionpaths should get calculated + * - recalc: whether we need to */ /* TODO: include reports pointer? */ -void animviz_calc_motionpaths(Main *bmain, Scene *scene, ListBase *targets) +void animviz_calc_motionpaths(Depsgraph *depsgraph, + Main *bmain, + Scene *scene, + ListBase *targets, + bool restore, + bool current_frame_only) { - MPathTarget *mpt; - int sfra, efra; - int cfra; - /* sanity check */ if (ELEM(NULL, targets, targets->first)) return; diff --cc source/blender/blenkernel/intern/anim_sys.c index d4355546c19,b17bc70c51a..351e765a8ea --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@@ -1971,11 -1969,11 +1971,11 @@@ NlaEvalStrip *nlastrips_ctime_get_strip } /* evaluate strip's evaluation controls - * - skip if no influence (i.e. same effect as muting the strip) - * - negative influence is not supported yet... how would that be defined? + * - skip if no influence (i.e. same effect as muting the strip) + * - negative influence is not supported yet... how would that be defined? */ /* TODO: this sounds a bit hacky having a few isolated F-Curves stuck on some data it operates on... */ - nlastrip_evaluate_controls(estrip, ctime); + nlastrip_evaluate_controls(depsgraph, estrip, ctime); if (estrip->influence <= 0.0f) return NULL; @@@ -2016,9 -2014,9 +2016,9 @@@ /* ---------------------- */ /* find an NlaEvalChannel that matches the given criteria - * - ptr and prop are the RNA data to find a match for + * - ptr and prop are the RNA data to find a match for */ -static NlaEvalChannel *nlaevalchan_find_match(ListBase *channels, PointerRNA *ptr, PropertyRNA *prop, int array_index) +static NlaEvalChannel *nlaevalchan_find_match(ListBase *channels, const PathResolvedRNA *prna) { NlaEvalChannel *nec; @@@ -2031,9 -2029,9 +2031,9 @@@ /* - comparing the PointerRNA's is done by comparing the pointers * to the actual struct the property resides in, since that all the * other data stored in PointerRNA cannot allow us to definitively - * identify the data + * identify the data */ - if ((nec->ptr.data == ptr->data) && (nec->prop == prop) && (nec->index == array_index)) + if ((nec->rna.ptr.data == prna->ptr.data) && (nec->rna.prop == prna->prop) && ELEM(nec->rna.prop_index, -1, prna->prop_index)) return nec; } @@@ -2585,10 -2625,21 +2585,10 @@@ static void animsys_evaluate_nla(Depsgr } /* NLA Evaluation function (mostly for use through do_animdata) - * - All channels that will be affected are not cleared anymore. Instead, we just evaluate into - * some temp channels, where values can be accumulated in one go. + * - All channels that will be affected are not cleared anymore. Instead, we just evaluate into + * some temp channels, where values can be accumulated in one go. */ -static void animsys_calculate_nla(PointerRNA *ptr, AnimData *adt, float ctime) +static void animsys_calculate_nla(Depsgraph *depsgraph, PointerRNA *ptr, AnimData *adt, float ctime) { ListBase echannels = {NULL, NULL}; @@@ -2682,9 -2746,9 +2682,9 @@@ void BKE_animsys_evaluate_animdata(Deps /* evaluate NLA data */ if ((adt->nla_tracks.first) && !(adt->flag & ADT_NLA_EVAL_OFF)) { /* evaluate NLA-stack - * - active action is evaluated as part of the NLA stack as the last item + * - active action is evaluated as part of the NLA stack as the last item */ - animsys_calculate_nla(&id_ptr, adt, ctime); + animsys_calculate_nla(depsgraph, &id_ptr, adt, ctime); } /* evaluate Active Action only */ else if (adt->action) diff --cc source/blender/blenkernel/intern/armature.c index fa5b59b739d,4ad9e9c8205..66106a97566 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@@ -2330,11 -2311,11 +2330,11 @@@ void BKE_pose_where_is(struct Depsgrap } /* 2a. construct the IK tree (standard IK) */ - BIK_initialize_tree(scene, ob, ctime); + BIK_initialize_tree(depsgraph, scene, ob, ctime); /* 2b. construct the Spline IK trees - * - this is not integrated as an IK plugin, since it should be able - * to function in conjunction with standard IK + * - this is not integrated as an IK plugin, since it should be able + * to function in conjunction with standard IK */ BKE_pose_splineik_init_tree(scene, ob, ctime); diff --cc source/blender/blenkernel/intern/armature_update.c index 2d9e2a0d84b,241a842d73f..ce87050f8bf --- a/source/blender/blenkernel/intern/armature_update.c +++ b/source/blender/blenkernel/intern/armature_update.c @@@ -621,10 -602,10 +621,10 @@@ void BKE_pose_eval_init_ik(struct Depsg return; } /* construct the IK tree (standard IK) */ - BIK_initialize_tree(scene, ob, ctime); + BIK_initialize_tree(depsgraph, scene, ob, ctime); /* construct the Spline IK trees - * - this is not integrated as an IK plugin, since it should be able - * to function in conjunction with standard IK + * - this is not integrated as an IK plugin, since it should be able + * to function in conjunction with standard IK */ BKE_pose_splineik_init_tree(scene, ob, ctime); } diff --cc source/blender/blenkernel/intern/constraint.c index dccc959b4ea,66147c44352..e16117745c9 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@@ -434,63 -443,48 +434,63 @@@ static void contarget_get_mesh_mat(Obje weightsum += dw->weight; } } + } + } + else if (em) { + if (CustomData_has_layer(&em->bm->vdata, CD_MDEFORMVERT)) { + BMVert *v; + BMIter iter; - /* calculate averages of normal and coordinates */ - if (weightsum > 0) { - mul_v3_fl(vec, 1.0f / weightsum); - mul_v3_fl(normal, 1.0f / weightsum); - } - + BM_ITER_MESH (v, &iter, em->bm, BM_VERTS_OF_MESH) { + MDeformVert *dv = CustomData_bmesh_get(&em->bm->vdata, v->head.data, CD_MDEFORMVERT); + MDeformWeight *dw = defvert_find_index(dv, defgroup); - /* derive the rotation from the average normal: - * - code taken from transform_manipulator.c, - * calc_manipulator_stats, V3D_MANIP_NORMAL case - */ - /* we need the transpose of the inverse for a normal... */ - copy_m3_m4(imat, ob->obmat); + if (dw && dw->weight > 0.0f) { + madd_v3_v3fl(vec, v->co, dw->weight); + madd_v3_v3fl(normal, v->no, dw->weight); + weightsum += dw->weight; + } + } + } + } + else { + /* No valid edit or evaluated mesh, just abort. */ + return; + } - invert_m3_m3(tmat, imat); - transpose_m3(tmat); - mul_m3_v3(tmat, normal); + /* calculate averages of normal and coordinates */ + if (weightsum > 0) { + mul_v3_fl(vec, 1.0f / weightsum); + mul_v3_fl(normal, 1.0f / weightsum); + } - normalize_v3(normal); - c @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs