diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-01-05 02:31:15 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-01-05 02:31:15 +0300 |
commit | e42e1769b36fddf9b0c161bcb2f7c7f2aeb613eb (patch) | |
tree | 526fbf9de0eeeb48d057816ad85e04901e952b3f | |
parent | 329879239e6fa358e22bf92180e3d5ff9cee9ba1 (diff) | |
parent | 82b9e1e3126a5c9de36d57d2d04edd11f00de9a5 (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/editors/gpencil/drawgpencil.c
18 files changed, 67 insertions, 37 deletions
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' 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/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 2798a2fd0d0..f8e4d1338f9 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2527,7 +2527,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): diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 1daf999e4a9..fce4620294d 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); } diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 4f1f6d963ed..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); @@ -883,9 +882,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/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/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; } diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index d09d441d71b..8a4ba6687cd 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -1487,9 +1487,17 @@ static void gp_draw_data_layers( GP_DRAWFLAG_APPLY((gpl->flag & GP_LAYER_HQ_FILL), GP_DRAWDATA_HQ_FILL); #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/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 d6300b74aea..4560b7cd6e7 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/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; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index ab0cae6822b..67e258669d6 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -339,13 +339,13 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) 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 */ @@ -363,17 +363,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/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)) diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 180dd5577ce..bb526c41049 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); 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); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 97217f749d6..af4fb9d0d8a 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2631,7 +2631,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"); 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); |