diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-05-05 13:44:52 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-05-05 13:44:52 +0300 |
commit | 8b8792e7b8aa04c33d2b57c79a6d24bf03b699fb (patch) | |
tree | 575027326d925d9e2028ce7c24f384d48a0bd067 | |
parent | a7388d650a8b0045aee680ca38cc02fc021ebbc3 (diff) | |
parent | 5b6838129f022102518b7cd8cabec3823c3749a8 (diff) |
Merge branch 'master' into blender2.8
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 21 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 17 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 5 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_warp.c | 4 |
8 files changed, 39 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 0c1af5dcbe8..6f04be653d1 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -981,6 +981,11 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float return; } + if ((armOb->pose->flag & POSE_RECALC) != 0) { + printf("ERROR! Trying to evaluate influence of armature '%s' which needs Pose recalc!", armOb->id.name); + BLI_assert(0); + } + invert_m4_m4(obinv, target->obmat); copy_m4_m4(premat, target->obmat); mul_m4_m4m4(postmat, obinv, armOb->obmat); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 64c888943f4..93ac50a9324 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1947,7 +1947,7 @@ void BKE_library_make_local( /* Note: Keeping both version of the code (old one being safer, since it still has checks against unused IDs) * for now, we can remove old one once it has been tested for some time in master... */ -#if 1 +#if 0 /* Step 5: proxy 'remapping' hack. */ for (LinkNode *it = copied_ids; it; it = it->next) { /* Attempt to re-link copied proxy objects. This allows appending of an entire scene @@ -2117,9 +2117,26 @@ void BKE_library_make_local( #ifdef DEBUG_TIME printf("Step 6: Try to find circle dependencies between indirectly-linked-only datablocks: Done.\n"); - TIMEIT_END(make_local); + TIMEIT_VALUE_PRINT(make_local); +#endif + #endif + /* This is probably more of a hack than something we should do here, but... + * Issue is, the whole copying + remapping done in complex cases above may leave pose channels of armatures + * in complete invalid state (more precisely, the bone pointers of the pchans - very crappy cross-datablocks + * relationship), se we tag it to be fully recomputed, but this does not seems to be enough in some cases, + * and evaluation code ends up trying to evaluate a not-yet-updated armature object's deformations. + * Try "make all local" in 04_01_H.lighting.blend from Agent327 without this, e.g. */ + for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + if (ob->data != NULL && ob->type == OB_ARMATURE && ob->pose != NULL && ob->pose->flag & POSE_RECALC) { + BKE_pose_rebuild(ob, ob->data); + } + } + +#ifdef DEBUG_TIME + printf("Hack: Forcefully rebuild armature object poses: Done.\n"); + TIMEIT_VALUE_PRINT(make_local); #endif BKE_main_id_clear_newpoins(bmain); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 904067839e2..ee15413b4d0 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -699,7 +699,7 @@ void UI_but_func_search_set( int UI_searchbox_size_y(void); int UI_searchbox_size_x(void); /* check if a string is in an existing search box */ -int UI_search_items_find_index(uiSearchItems *items, const char *name, const size_t offset); +int UI_search_items_find_index(uiSearchItems *items, const char *name); void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg); void UI_block_func_butmenu_set(uiBlock *block, uiMenuHandleFunc func, void *arg); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 75ccdece799..e1ca6c60a74 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -4370,7 +4370,7 @@ void UI_but_func_search_set( if (0 == (but->block->flag & UI_BLOCK_LOOP)) { /* skip empty buttons, not all buttons need input, we only show invalid */ if (but->drawstr[0]) - ui_but_search_refresh(but, false); + ui_but_search_refresh(but); } } diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 29808d84818..68bb48f66fb 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -606,7 +606,7 @@ int ui_searchbox_autocomplete(struct bContext *C, struct ARegion *ar, uiBut *but void ui_searchbox_event(struct bContext *C, struct ARegion *ar, uiBut *but, const struct wmEvent *event); bool ui_searchbox_apply(uiBut *but, struct ARegion *ar); void ui_searchbox_free(struct bContext *C, struct ARegion *ar); -void ui_but_search_refresh(uiBut *but, const bool is_template_ID); +void ui_but_search_refresh(uiBut *but); uiBlock *ui_popup_block_refresh( struct bContext *C, uiPopupBlockHandle *handle, diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index b1f3482e109..ed8c3a50875 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -813,11 +813,11 @@ int UI_searchbox_size_x(void) return 12 * UI_UNIT_X; } -int UI_search_items_find_index(uiSearchItems *items, const char *name, const size_t offset) +int UI_search_items_find_index(uiSearchItems *items, const char *name) { int i; for (i = 0; i < items->totitem; i++) { - if (STREQ(name, items->names[i] + offset)) { + if (STREQ(name, items->names[i])) { return i; } } @@ -896,7 +896,7 @@ static void ui_searchbox_butrect(rcti *r_rect, uiSearchboxData *data, int itemnr int ui_searchbox_find_index(ARegion *ar, const char *name) { uiSearchboxData *data = ar->regiondata; - return UI_search_items_find_index(&data->items, name, 0); + return UI_search_items_find_index(&data->items, name); } /* x and y in screencoords */ @@ -1425,14 +1425,14 @@ void ui_searchbox_free(bContext *C, ARegion *ar) /* sets red alert if button holds a string it can't find */ /* XXX weak: search_func adds all partial matches... */ -void ui_but_search_refresh(uiBut *but, const bool is_template_ID) +void ui_but_search_refresh(uiBut *but) { uiSearchItems *items; int x1; - /* possibly very large lists (such as ID datablocks), - * only validate string and pointer RNA buts */ - if (but->rnaprop && !ELEM(RNA_property_type(but->rnaprop), PROP_STRING, PROP_POINTER)) { + /* possibly very large lists (such as ID datablocks) only + * only validate string RNA buts (not pointers) */ + if (but->rnaprop && RNA_property_type(but->rnaprop) != PROP_STRING) { return; } @@ -1452,8 +1452,7 @@ void ui_but_search_refresh(uiBut *but, const bool is_template_ID) UI_but_flag_enable(but, UI_BUT_REDALERT); } else if (items->more == 0) { - const size_t offset = is_template_ID ? 3 : 0; - if (UI_search_items_find_index(items, but->drawstr, offset) == -1) { + if (UI_search_items_find_index(items, but->drawstr) == -1) { UI_but_flag_enable(but, UI_BUT_REDALERT); } } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 6efaeb88205..e3a71feb1a9 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -467,11 +467,6 @@ static void template_ID( but = uiDefButR(block, UI_BTYPE_TEXT, 0, name, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, RNA_struct_ui_description(type)); UI_but_funcN_set(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME)); - - but->search_func = id_search_cb; - but->search_arg = template; - ui_but_search_refresh(but, true); - if (user_alert) UI_but_flag_enable(but, UI_BUT_REDALERT); if (id->lib) { diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index 9abe768726e..c9a9e20df23 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -64,6 +64,10 @@ static void copyData(ModifierData *md, ModifierData *target) WarpModifierData *wmd = (WarpModifierData *) md; WarpModifierData *twmd = (WarpModifierData *) target; + if (twmd->curfalloff != NULL) { + curvemapping_free(twmd->curfalloff); + } + modifier_copyData_generic(md, target); twmd->curfalloff = curvemapping_copy(wmd->curfalloff); |