From ab1600bee50cf2546938dca8837e4c7ba86d78f7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 22 Jan 2012 18:59:06 +0000 Subject: [PATCH 1/3] error in outliner parent patch - was using set string on an enum property. --- source/blender/editors/space_outliner/space_outliner.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 5b20c170362..a040c63b2ab 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -139,9 +139,9 @@ static void outliner_parent_clear_copy(wmDrag *drag, wmDropBox *drop) RNA_string_set(drop->ptr, "dragged_obj", id->name+2); /* Set to simple parent clear type. Avoid menus for drag and drop if possible. - If desired, user can toggle the different "Clear Parent" types in the operator - menu on tool shelf. */ - RNA_string_set(drop->ptr, "type", 0); + * If desired, user can toggle the different "Clear Parent" types in the operator + * menu on tool shelf. */ + RNA_enum_set(drop->ptr, "type", 0); } /* region dropbox definition */ From 008b0e90dd87490763f685d822ffe37d40ede7c7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 22 Jan 2012 19:52:41 +0000 Subject: [PATCH 2/3] minor edit for operator error macro so it can return different values. --- .../editors/interface/interface_layout.c | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index b40c618c301..429cd658dea 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -66,6 +66,14 @@ #define EM_SEPR_X 6 #define EM_SEPR_Y 6 +#define UI_OPERATOR_ERROR_RET(_ot, _opname, return_statement) \ + if (ot == NULL) { \ + ui_item_disabled(layout, _opname); \ + RNA_warning("'%s' unknown operator", _opname); \ + return_statement; \ + } (void)0 \ + + /* uiLayoutRoot */ typedef struct uiLayoutRoot { @@ -690,14 +698,9 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *opname, const char *name, i { wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */ - if(ot) { - return uiItemFullO_ptr(layout, ot, name, icon, properties, context, flag); - } - else { - ui_item_disabled(layout, opname); - RNA_warning("unknown operator '%s'", opname); - return PointerRNA_NULL; - } + UI_OPERATOR_ERROR_RET(ot, opname, return PointerRNA_NULL); + + return uiItemFullO_ptr(layout, ot, name, icon, properties, context, flag); } static const char *ui_menu_enumpropname(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int retval) @@ -842,13 +845,6 @@ void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname) uiItemsFullEnumO(layout, opname, propname, NULL, layout->root->opcontext, 0); } -#define UI_OPERATOR_ERROR_RET(_ot, _opname) \ - if (ot == NULL) { \ - ui_item_disabled(layout, _opname); \ - RNA_warning("'%s' unknown operator", _opname); \ - return; \ - } (void)0 - /* for use in cases where we have */ void uiItemEnumO_value(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value) { @@ -856,7 +852,7 @@ void uiItemEnumO_value(uiLayout *layout, const char *name, int icon, const char PointerRNA ptr; PropertyRNA *prop; - UI_OPERATOR_ERROR_RET(ot, opname); + UI_OPERATOR_ERROR_RET(ot, opname, return); WM_operator_properties_create_ptr(&ptr, ot); @@ -887,7 +883,7 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char EnumPropertyItem *item; int value, free; - UI_OPERATOR_ERROR_RET(ot, opname); + UI_OPERATOR_ERROR_RET(ot, opname, return); WM_operator_properties_create_ptr(&ptr, ot); @@ -925,7 +921,7 @@ void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *op wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */ PointerRNA ptr; - UI_OPERATOR_ERROR_RET(ot, opname); + UI_OPERATOR_ERROR_RET(ot, opname, return); WM_operator_properties_create_ptr(&ptr, ot); RNA_boolean_set(&ptr, propname, value); @@ -938,7 +934,7 @@ void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */ PointerRNA ptr; - UI_OPERATOR_ERROR_RET(ot, opname); + UI_OPERATOR_ERROR_RET(ot, opname, return); WM_operator_properties_create_ptr(&ptr, ot); RNA_int_set(&ptr, propname, value); @@ -951,7 +947,7 @@ void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opna wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */ PointerRNA ptr; - UI_OPERATOR_ERROR_RET(ot, opname); + UI_OPERATOR_ERROR_RET(ot, opname, return); WM_operator_properties_create_ptr(&ptr, ot); RNA_float_set(&ptr, propname, value); @@ -964,7 +960,7 @@ void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opn wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */ PointerRNA ptr; - UI_OPERATOR_ERROR_RET(ot, opname); + UI_OPERATOR_ERROR_RET(ot, opname, return); WM_operator_properties_create_ptr(&ptr, ot); RNA_string_set(&ptr, propname, value); @@ -1608,7 +1604,7 @@ void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname, wmOperatorType *ot = WM_operatortype_find(opname, 0); /* print error next */ MenuItemLevel *lvl; - UI_OPERATOR_ERROR_RET(ot, opname); + UI_OPERATOR_ERROR_RET(ot, opname, return); if(!ot->srna) { ui_item_disabled(layout, opname); From 359e961a12e5c2f6432b8d65a543d2d6e389ba17 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Sun, 22 Jan 2012 20:01:33 +0000 Subject: [PATCH 3/3] restrict stitching of same island uvs to only midpoint, without snapping case --- source/blender/editors/uvedit/uvedit_smart_stitch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 3731d348522..e99a90f34c5 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -290,7 +290,8 @@ static int stitch_check_uvs_stitchable(UvElement *element, UvElement *element_it static int stitch_check_uvs_state_stitchable(UvElement *element, UvElement *element_iter, StitchState *state){ - if(state->snap_islands && element->island == element_iter->island) + if((state->snap_islands && element->island == element_iter->island) || + (!state->midpoints && element->island == element_iter->island)) return 0; return stitch_check_uvs_stitchable(element, element_iter, state); @@ -543,9 +544,8 @@ static void stitch_validate_stichability(UvElement *element, StitchState *state, if(element_iter->separate){ if(element_iter == element) continue; - if(stitch_check_uvs_stitchable(element, element_iter, state)){ - if(((element_iter->island == state->static_island) || (element->island == state->static_island)) && - !((element_iter->island == element->island) && state->snap_islands)){ + if(stitch_check_uvs_state_stitchable(element, element_iter, state)){ + if((element_iter->island == state->static_island) || (element->island == state->static_island)){ element->flag |= STITCH_STITCHABLE; preview->num_stitchable++; stitch_setup_face_preview_for_uv_group(element, state, island_stitch_data);