From 3c7407163418fd9837951af2c252a918400435bf Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 29 Dec 2016 14:34:39 +1300 Subject: [PATCH 01/10] Fix: Passed wrong last argument to function --- source/blender/python/intern/bpy_rna_anim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 5fbe1ab971a..8a0130babd5 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -252,7 +252,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb NlaStrip *strip = (NlaStrip *)ptr.data; FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index); - result = insert_keyframe_direct(&reports, ptr, prop, fcu, cfra, keytype, index); + result = insert_keyframe_direct(&reports, ptr, prop, fcu, cfra, keytype, options); } else { BKE_reportf(&reports, RPT_ERROR, "Could not resolve path (%s)", path_full); From 8f1f3a0d46df360f0715df5fa6d487f676940e89 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 2 Jan 2017 23:31:35 +1300 Subject: [PATCH 02/10] GPencil: Per-layer option to always show onion skinning Sometimes it can be useful to be able to keep onion skins visible in the OpenGL renders and/or when doing animation playback. In particular, there are two use cases where this is quite useful: 1) For creating a cheap motion-blur effect, especially when the before/after values are also animated. 2) If you've animated a shot with onion skinning enabled, the poses may end up looking odd if the ghosts are not shown (as you may have been accounting for the ghosts when making the compositions). This option can be found as the small "camera" toggle between the "Use Onion Skinning" and "Use Custom Colors" options. --- .../startup/bl_ui/properties_grease_pencil_common.py | 5 ++++- source/blender/editors/gpencil/drawgpencil.c | 12 ++++++++++-- source/blender/makesdna/DNA_gpencil_types.h | 5 ++++- source/blender/makesrna/intern/rna_gpencil.c | 7 +++++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 08e07b8ed93..f8ee7c9a851 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -946,7 +946,10 @@ class GreasePencilDataPanel: row = col.row() row.prop(gpl, "use_onion_skinning") - row.prop(gpl, "use_ghost_custom_colors", text="", icon='COLOR') + sub = row.row(align=True) + icon = 'RESTRICT_RENDER_OFF' if gpl.use_ghosts_always else 'RESTRICT_RENDER_ON' + sub.prop(gpl, "use_ghosts_always", text="", icon=icon) + sub.prop(gpl, "use_ghost_custom_colors", text="", icon='COLOR') split = col.split(percentage=0.5) split.active = gpl.use_onion_skinning diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 9da3c3ee088..2fd574d6523 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -1419,8 +1419,16 @@ static void gp_draw_data_layers( #undef GP_DRAWFLAG_APPLY - /* draw 'onionskins' (frame left + right) */ - if ((gpl->flag & GP_LAYER_ONIONSKIN) && !(dflag & GP_DRAWDATA_NO_ONIONS)) { + /* Draw 'onionskins' (frame left + right) + * - It is only possible to show these if the option is enabled + * - The "no onions" flag prevents ghosts from appearing during animation playback/scrubbing + * and in renders + * - The per-layer "always show" flag however overrides the playback/render restriction, + * allowing artists to selectively turn onionskins on/off during playback + */ + if ((gpl->flag & GP_LAYER_ONIONSKIN) && + ((dflag & GP_DRAWDATA_NO_ONIONS) == 0 || (gpl->flag & GP_LAYER_GHOST_ALWAYS))) + { /* Drawing method - only immediately surrounding (gstep = 0), * or within a frame range on either side (gstep > 0) */ diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 23b73424da5..0364d855f69 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -244,6 +244,7 @@ typedef struct bGPDlayer { float inverse[4][4]; /* inverse matrix (only used if parented) */ char parsubstr[64]; /* String describing subobject info, MAX_ID_NAME-2 */ short partype, pad; + float tintcolor[4]; /* Color used to tint layer, alpha value is used as factor */ float opacity; /* Opacity of the layer */ } bGPDlayer; @@ -275,7 +276,9 @@ typedef enum eGPDlayer_Flag { /* Use high quality fill (instead of buggy legacy OpenGL Fill) */ GP_LAYER_HQ_FILL = (1 << 11), /* Unlock color */ - GP_LAYER_UNLOCK_COLOR = (1 << 12) + GP_LAYER_UNLOCK_COLOR = (1 << 12), + /* always show onion skins (i.e. even during renders/animation playback) */ + GP_LAYER_GHOST_ALWAYS = (1 << 13), } eGPDlayer_Flag; /* Grease-Pencil Annotations - 'DataBlock' */ diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 41a73cfc528..14da990278c 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -1242,6 +1242,13 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "After Color", "Base color for ghosts after the active frame"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); + prop = RNA_def_property(srna, "use_ghosts_always", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_GHOST_ALWAYS); + RNA_def_property_ui_text(prop, "Always Show Ghosts", + "Ghosts are shown in renders and animation playback. Useful for special effects (e.g. motion blur)"); + RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); + + /* Flags */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE); From 65582e75e3eadfe8c9574219fd6a8cb547355526 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 3 Jan 2017 11:42:50 +1300 Subject: [PATCH 03/10] Fix: NLA "Strip Time" setting cannot be edited This is a hacky fix for a regression introduced sometime after 2.76. The "Strip Time" setting on NLA Strips could not be edited without the value immediately jumping back to the current FCurve value (or 0.0 if no keyframes existed); even enabling autokey wouldn't let you key the property. Until we have proper overrides (that only lose their values on frame change), it's best that this setting is editable, even if it does mean it you have to manually change the frame to see the updated values. --- source/blender/makesrna/intern/rna_nla.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 078f6e237f0..e44a6420045 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -663,7 +663,10 @@ static void rna_def_nlastrip(BlenderRNA *brna) prop = RNA_def_property(srna, "strip_time", PROP_FLOAT, PROP_TIME); RNA_def_property_ui_text(prop, "Strip Time", "Frame of referenced Action to evaluate"); - RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, "rna_NlaStrip_update"); + /* XXX: Update temporarily disabled so that the property can be edited at all! + * Even autokey only applies after the curves have been re-evaluated, causing the unkeyed values to be lost + */ + RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_EDITED, /*"rna_NlaStrip_update"*/ NULL); /* TODO: should the animated_influence/time settings be animatable themselves? */ prop = RNA_def_property(srna, "use_animated_influence", PROP_BOOLEAN, PROP_NONE); From ff0221f5d848c2eb1f7e0066c9a5ae2ba1a1b217 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 3 Jan 2017 15:30:59 +0100 Subject: [PATCH 04/10] Fix implicit size_t to int conversion. Seems like it was erroring on some buildbots... --- source/blender/blenlib/intern/string_utf8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 07437862c3e..0ab11810b48 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -93,7 +93,7 @@ int BLI_utf8_invalid_byte(const char *str, int length) /* Note that since we always increase p (and decrease length) by one byte in main loop, we only add/subtract * extra utf8 bytes in code below * (ab number, aka number of bytes remaining in the utf8 sequence after the initial one). */ - ab = utf8_skip_data[c] - 1; + ab = (int)utf8_skip_data[c] - 1; if (length <= ab) { goto utf8_error; } From 3a1b1100af29dfaf1199298ea943965f53f8e682 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Tue, 3 Jan 2017 10:34:05 -0500 Subject: [PATCH 05/10] Revert "Remove double menu entries" This reverts commit e2d7efc9503720770b9652284e25006eecbec8d4. --- release/scripts/startup/bl_ui/space_view3d.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 55fa2c28011..5e936076d0e 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2528,7 +2528,14 @@ class VIEW3D_MT_edit_mesh_edges(Menu): layout.operator("mesh.bevel").vertex_only = False layout.operator("mesh.edge_split") layout.operator("mesh.bridge_edge_loops") + + layout.separator() + layout.operator("transform.edge_slide") + layout.operator("mesh.loop_multi_select", text="Edge Loops").ring = False + layout.operator("mesh.loop_multi_select", text="Edge Rings").ring = True + layout.operator("mesh.loop_to_region") + layout.operator("mesh.region_to_loop") class VIEW3D_MT_edit_mesh_faces(Menu): From c0c48cdacc13742e804b19abb7b9b2049fb1bcbd Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 4 Jan 2017 10:13:28 +0100 Subject: [PATCH 06/10] Fix T50350: Quick Explode time frame problem The settings.frame_start rna was clamping frame start to frame end when frame start was bigger than frame end. The fix is simply to set frame end first --- release/scripts/startup/bl_operators/object_quick_effects.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index cdab380bb9c..ef10e279bb4 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -210,8 +210,9 @@ class QuickExplode(Operator): settings = obj.particle_systems[-1].settings settings.count = self.amount - settings.frame_start = self.frame_start + # first set frame end, to prevent frame start clamping settings.frame_end = self.frame_end - self.frame_duration + settings.frame_start = self.frame_start settings.lifetime = self.frame_duration settings.normal_factor = self.velocity settings.render_type = 'NONE' From 351a9d084f59a6d11be9148830cec86eacb85529 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 4 Jan 2017 10:25:27 +0100 Subject: [PATCH 07/10] Fix T50369: Objects can't be deleted from scene when using "link group objects to scene" Main issue here was that in old usercount system 'user_real' did simply not allow that kind of thing to work. With new pait of 'USER_EXTRA' tags, it becomes possible to handle the case correctly, by merely refining checks about indirectly use objects whene removing them from a scene. Incidently, found another related bug, 'link group objects to scene' was not incrementing objects' usercount - bad, very very bad! --- source/blender/blenkernel/intern/library_remap.c | 3 ++- source/blender/editors/object/object_add.c | 8 +++++--- source/blender/editors/space_outliner/outliner_tools.c | 10 +++++++--- source/blender/makesdna/DNA_ID.h | 1 + 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 4f1f6d963ed..cc7de92c96a 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -883,9 +883,10 @@ void BKE_libblock_free_us(Main *bmain, void *idv) /* test users */ * Since only 'user_one' usage of objects is groups, and only 'real user' usage of objects is scenes, * removing that 'user_one' tag when there is no more real (scene) users of an object ensures it gets * fully unlinked. + * But only for local objects, not linked ones! * Otherwise, there is no real way to get rid of an object anymore - better handling of this is TODO. */ - if ((GS(id->name) == ID_OB) && (id->us == 1)) { + if ((GS(id->name) == ID_OB) && (id->us == 1) && (id->lib == NULL)) { id_us_clear_real(id); } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index f42dafd094c..02b2d8492b4 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1111,7 +1111,9 @@ static void object_delete_check_glsl_update(Object *ob) /* note: now unlinks constraints as well */ void ED_base_object_free_and_unlink(Main *bmain, Scene *scene, Base *base) { - if (BKE_library_ID_is_indirectly_used(bmain, base->object) && ID_REAL_USERS(base->object) <= 1) { + if (BKE_library_ID_is_indirectly_used(bmain, base->object) && + ID_REAL_USERS(base->object) <= 1 && ID_EXTRA_USERS(base->object) == 0) + { /* We cannot delete indirectly used object... */ printf("WARNING, undeletable object '%s', should have been catched before reaching this function!", base->object->id.name + 2); @@ -1145,7 +1147,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) BKE_reportf(op->reports, RPT_WARNING, "Cannot delete indirectly linked object '%s'", base->object->id.name + 2); continue; } - else if (is_indirectly_used && ID_REAL_USERS(base->object) <= 1) { + else if (is_indirectly_used && ID_REAL_USERS(base->object) <= 1 && ID_EXTRA_USERS(base->object) == 0) { BKE_reportf(op->reports, RPT_WARNING, "Cannot delete object '%s' from scene '%s', indirectly used objects need at least one user", base->object->id.name + 2, scene->id.name + 2); @@ -1179,7 +1181,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) if (scene_iter != scene && !ID_IS_LINKED_DATABLOCK(scene_iter)) { base_other = BKE_scene_base_find(scene_iter, base->object); if (base_other) { - if (is_indirectly_used && ID_REAL_USERS(base->object) <= 1) { + if (is_indirectly_used && ID_REAL_USERS(base->object) <= 1 && ID_EXTRA_USERS(base->object) == 0) { BKE_reportf(op->reports, RPT_WARNING, "Cannot delete object '%s' from scene '%s', indirectly used objects need at least one user", base->object->id.name + 2, scene_iter->id.name + 2); diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 7739d241bd3..4eda7977622 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -411,7 +411,9 @@ static void object_delete_cb( BKE_reportf(reports, RPT_WARNING, "Cannot delete indirectly linked object '%s'", base->object->id.name + 2); return; } - else if (BKE_library_ID_is_indirectly_used(bmain, base->object) && ID_REAL_USERS(base->object) <= 1) { + else if (BKE_library_ID_is_indirectly_used(bmain, base->object) && + ID_REAL_USERS(base->object) <= 1 && ID_EXTRA_USERS(base->object) == 0) + { BKE_reportf(reports, RPT_WARNING, "Cannot delete object '%s' from scene '%s', indirectly used objects need at least one user", base->object->id.name + 2, scene->id.name + 2); @@ -525,7 +527,7 @@ static void group_linkobs2scene_cb( if (!base) { /* link to scene */ base = BKE_scene_base_add(scene, gob->ob); - id_lib_extern((ID *)gob->ob); /* in case these are from a linked group */ + id_us_plus(&gob->ob->id); } base->object->flag |= SELECT; base->flag |= SELECT; @@ -842,7 +844,9 @@ static Base *outline_delete_hierarchy(bContext *C, ReportList *reports, Scene *s BKE_reportf(reports, RPT_WARNING, "Cannot delete indirectly linked object '%s'", base->object->id.name + 2); return base_next; } - else if (BKE_library_ID_is_indirectly_used(bmain, base->object) && ID_REAL_USERS(base->object) <= 1) { + else if (BKE_library_ID_is_indirectly_used(bmain, base->object) && + ID_REAL_USERS(base->object) <= 1 && ID_EXTRA_USERS(base->object) == 0) + { BKE_reportf(reports, RPT_WARNING, "Cannot delete object '%s' from scene '%s', indirectly used objects need at least one user", base->object->id.name + 2, scene->id.name + 2); diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index ed719b66eb3..2c6f3d2fc66 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -277,6 +277,7 @@ typedef enum ID_Type { #define ID_FAKE_USERS(id) ((((ID *)id)->flag & LIB_FAKEUSER) ? 1 : 0) #define ID_REAL_USERS(id) (((ID *)id)->us - ID_FAKE_USERS(id)) +#define ID_EXTRA_USERS(id) (((ID *)id)->tag & LIB_TAG_EXTRAUSER ? 1 : 0) #define ID_CHECK_UNDO(id) ((GS((id)->name) != ID_SCR) && (GS((id)->name) != ID_WM)) From a9163f7d222d9d4949987c9690f44bdb6e43f163 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 4 Jan 2017 14:07:38 +0100 Subject: [PATCH 08/10] Fix (IRC reported) bad handling of Text data-block user count. Reported on IRC by dfelinto, thanks. Root of the issue was that opening a new text file would create datablock with one user, when Text editor is actually a 'user one' user. This was leaving Text datablocks in inconsitent user count, and generating asserts in BKE_library area. Also changed a weird piece of code related to that extra user thing in main remapping func. --- source/blender/blenkernel/intern/library_remap.c | 3 +-- source/blender/blenkernel/intern/text.c | 1 + source/blender/editors/space_text/text_ops.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index cc7de92c96a..f76fc628ed0 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -522,8 +522,7 @@ void BKE_libblock_remap_locked( * been incremented for that, we have to decrease once more its user count... unless we had to skip * some 'user_one' cases. */ if ((old_id->tag & LIB_TAG_EXTRAUSER_SET) && !(id_remap_data.status & ID_REMAP_IS_USER_ONE_SKIPPED)) { - id_us_min(old_id); - old_id->tag &= ~LIB_TAG_EXTRAUSER_SET; + id_us_clear_real(old_id); } BLI_assert(old_id->us - skipped_refcounted >= 0); diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 1636042f479..672857e88fe 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -410,6 +410,7 @@ Text *BKE_text_load_ex(Main *bmain, const char *file, const char *relpath, const } ta = BKE_libblock_alloc(bmain, ID_TXT, BLI_path_basename(filepath_abs)); + ta->id.us = 0; BLI_listbase_clear(&ta->lines); ta->curl = ta->sell = NULL; diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 83012eac39e..df3620843ad 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -254,6 +254,7 @@ static int text_open_exec(bContext *C, wmOperator *op) } else if (st) { st->text = text; + id_us_ensure_real(&text->id); st->left = 0; st->top = 0; st->scroll_accum[0] = 0.0f; From b86042f21a8d905bea91af7c04b1265b7517f4cf Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Wed, 4 Jan 2017 19:40:34 +0300 Subject: [PATCH 09/10] Dynamic Paint: Fix random pixel flooding by absolute brush with spread. If a very low wetness absolute alpha brush is used with spread and drying effects enabled, some pixels will rapidly accumulate paint. This happens because paint drying code applies a minimal wetness threshold that causes the paint to instantly dry out. Specifically, every frame the brush adds paint at the specified absolute alpha and wetness set to the minimal threshold, spread drops it below threshold, and finally drying moves all paint to the dry layer. This drastically accelerates the rate of flow of paint into the affected pixels. Fortunately, the reason paint spread actually ends up decreasing wetness turns out to be a simple floating point precision problem, which can be easily fixed by restructuring the affected expression. --- source/blender/blenkernel/intern/dynamicpaint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 66070923153..4d9e314afc4 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -4737,7 +4737,7 @@ static void dynamic_paint_effect_spread_cb(void *userdata, const int index) CLAMP(w_factor, 0.0f, 1.0f); /* mix new wetness and color */ - pPoint->wetness = (1.0f - w_factor) * pPoint->wetness + w_factor * pPoint_prev->wetness; + pPoint->wetness = pPoint->wetness + w_factor * (pPoint_prev->wetness - pPoint->wetness); pPoint->e_color[3] = mixColors(pPoint->e_color, pPoint->e_color[3], pPoint_prev->e_color, pPoint_prev->e_color[3], w_factor); } From 82b9e1e3126a5c9de36d57d2d04edd11f00de9a5 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 5 Jan 2017 00:09:42 +0100 Subject: [PATCH 10/10] Show 'Manipulate Center Points' in weight paint mode If the active object is in weight paint mode, but some armatures in pose mode, 'manipulate center points' still affects the transformation. See bd2034a749a9a9. Also removed redundant check, we basically did the same check for paint modes twice. --- .../editors/space_view3d/view3d_header.c | 23 +++++-------------- source/blender/makesrna/intern/rna_space.c | 2 +- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 0713377d210..bf1bdf68619 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -337,13 +337,13 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) /* Draw type */ uiItemR(layout, &v3dptr, "viewport_shade", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - if (obedit == NULL && is_paint) { - if (ob->mode & OB_MODE_ALL_PAINT) { - /* Only for Weight Paint. makes no sense in other paint modes. */ - row = uiLayoutRow(layout, true); - uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - } + row = uiLayoutRow(layout, true); + uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + if (!ob || ELEM(ob->mode, OB_MODE_OBJECT, OB_MODE_POSE, OB_MODE_WEIGHT_PAINT)) { + uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + } + if (obedit == NULL && is_paint) { /* Manipulators aren't used in paint modes */ if (!ELEM(ob->mode, OB_MODE_SCULPT, OB_MODE_PARTICLE_EDIT)) { /* masks aren't used for sculpt and particle painting */ @@ -361,17 +361,6 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) } } else { - row = uiLayoutRow(layout, true); - uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - - /* pose/object only however we want to allow in weight paint mode too - * so don't be totally strict and just check not-editmode for now - * XXX We never get here when we are in Weight Paint mode - */ - if (obedit == NULL) { - uiItemR(row, &v3dptr, "use_pivot_point_align", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - } - /* Transform widget / manipulators */ row = uiLayoutRow(layout, true); uiItemR(row, &v3dptr, "show_manipulator", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 1feae9e0bca..5e364a3adf1 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2624,7 +2624,7 @@ static void rna_def_space_view3d(BlenderRNA *brna) prop = RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN); - RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object and pose mode only)"); + RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object, pose and weight paint mode only)"); RNA_def_property_ui_icon(prop, ICON_ALIGN, 0); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");