From 1b86b3c0f4ab84e3b47c04a63a69ffb61dc8660e Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 13 Jan 2020 09:22:00 +0100 Subject: [PATCH 1/4] Fix T73069: Studiolights Studiolights that were just created didn't had the `STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS` flag. Without this flag the studiolight the viewport didn't show the specular highlights and it wasn't possible to switch the highlights on/off in the popover. After reloading the studio lights this was possible. This patch will always set the flag for any newly created, or being edited studiolight, so the workbench render engine is fed with the right data. --- source/blender/blenkernel/intern/studiolight.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index a02ff98a38a..9008348ed3b 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -1668,7 +1668,8 @@ StudioLight *BKE_studiolight_create(const char *path, const float light_ambient[3]) { StudioLight *sl = studiolight_create(STUDIOLIGHT_EXTERNAL_FILE | STUDIOLIGHT_USER_DEFINED | - STUDIOLIGHT_TYPE_STUDIO); + STUDIOLIGHT_TYPE_STUDIO | + STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS); char filename[FILE_MAXFILE]; BLI_split_file_part(path, filename, FILE_MAXFILE); @@ -1688,7 +1689,7 @@ StudioLight *BKE_studiolight_create(const char *path, StudioLight *BKE_studiolight_studio_edit_get(void) { static StudioLight sl = {0}; - sl.flag = STUDIOLIGHT_TYPE_STUDIO; + sl.flag = STUDIOLIGHT_TYPE_STUDIO | STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS; memcpy(sl.light, U.light_param, sizeof(*sl.light) * 4); memcpy(sl.light_ambient, U.light_ambient, sizeof(*sl.light_ambient) * 3); From 44231386e42bc096ef0891e94e70b95263aa80d1 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 13 Jan 2020 10:48:43 +0100 Subject: [PATCH 2/4] Fix T72250: Select Boundary Loop Edge Index display were not showing up after performing "Select Boundary Loops" when in face selection mode. The operation tagged the mesh that the selection was changed, but in the end this didn't do anything within the depsgraph. The fix changes this to recalc the geometry of the object. What also syncs the selectmode flags. A better solution would be to update the select flags only. But that could be done as future work when we have a performance problems. --- source/blender/editors/mesh/editmesh_select.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index ffbcacafd44..6eabb079f4e 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -4957,7 +4957,7 @@ static int edbm_region_to_loop_exec(bContext *C, wmOperator *UNUSED(op)) EDBM_selectmode_to_scene(C); } - DEG_id_tag_update(obedit->data, ID_RECALC_SELECT); + DEG_id_tag_update(&obedit->id, ID_RECALC_GEOMETRY); WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); } MEM_freeN(objects); From 162cb74320303e91da28f103d0f1cd47442946af Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 13 Jan 2020 12:46:54 +0100 Subject: [PATCH 3/4] Fix T67305: Sculptmode Wireframe Coloring When in sculptmode the wireframe coloring should always be disabled. When an object was sculpted but had modifiers this was not detected and the colors were still shown. This fix will disable wireframe coloring for any object that is in sculptmode. --- source/blender/draw/engines/overlay/overlay_wireframe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c index b52434fa6c6..d3c513e5963 100644 --- a/source/blender/draw/engines/overlay/overlay_wireframe.c +++ b/source/blender/draw/engines/overlay/overlay_wireframe.c @@ -167,9 +167,10 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata, /* Don't do that in edit Mesh mode, unless there is a modifier preview. */ if (use_wire && (!is_mesh || (!is_edit_mode || has_edit_mesh_cage))) { + const bool is_sculpt_mode = ((ob->mode & OB_MODE_SCULPT) != 0) && (ob->sculpt != NULL); const bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d) && !DRW_state_is_image_render(); - const bool use_coloring = (use_wire && !is_edit_mode && !use_sculpt_pbvh && + const bool use_coloring = (use_wire && !is_edit_mode && !is_sculpt_mode && !has_edit_mesh_cage); DRWShadingGroup *shgrp = NULL; struct GPUBatch *geom = DRW_cache_object_face_wireframe_get(ob); From dfa3f51e5245a466eb2d5b568f606fc45d533602 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 13 Jan 2020 15:57:15 +0100 Subject: [PATCH 4/4] Fix (unreported) broken PY API doc gen after recent GP changes. As usual... Adding/removing members from context requires updates of the API building script. --- doc/python_api/sphinx_doc_gen.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 278a2700f27..b74ad3c7dc2 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -989,6 +989,7 @@ def pymodule2sphinx(basepath, module_name, module, title): # Changes in Blender will force errors here context_type_map = { # context_member: (RNA type, is_collection) + "active_annotation_layer": ("GPencilLayer", False), "active_base": ("ObjectBase", False), "active_bone": ("EditBone", False), "active_gpencil_frame": ("GreasePencilLayer", True), @@ -998,6 +999,8 @@ context_type_map = { "active_operator": ("Operator", False), "active_pose_bone": ("PoseBone", False), "active_editable_fcurve": ("FCurve", False), + "annotation_data": ("GreasePencil", False), + "annotation_data_owner": ("ID", False), "armature": ("Armature", False), "bone": ("Bone", False), "brush": ("Brush", False),