[Bf-blender-cvs] [5927e4cba45] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object

2018-07-23 Thread Antonio Vazquez
Commit: 5927e4cba45b23113d98d073060679495d27d327
Author: Antonio Vazquez
Date:   Mon Jul 23 09:53:01 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB5927e4cba45b23113d98d073060679495d27d327

Merge branch 'blender2.8' into greasepencil-object

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [610013da700] greasepencil-object: Clenup: Remove old unused code

2018-07-23 Thread Antonio Vazquez
Commit: 610013da700aa9502ac9c2e572162e1169fb9c4a
Author: Antonio Vazquez
Date:   Mon Jul 23 10:13:41 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB610013da700aa9502ac9c2e572162e1169fb9c4a

Clenup: Remove old unused code

===

M   source/blender/editors/transform/transform_conversions.c

===

diff --git a/source/blender/editors/transform/transform_conversions.c 
b/source/blender/editors/transform/transform_conversions.c
index 09b34e660c6..3cbb951287d 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -8286,15 +8286,6 @@ static void createTransGPencil(bContext *C, TransInfo *t)
bGPDspoint *pt;
int i;
 
-#if 0  /* XXX: this isn't needed anymore; cannot calculate center this way or 
is_prop_edit breaks */
-   const float ninv = 1.0f 
/ gps->totpoints;
-   float center[3] = { 
0.0f };
-
-   /* compute midpoint of 
stroke */
-   for (i = 0, pt = 
gps->points; i < gps->totpoints; i++, pt++) {
-   
madd_v3_v3v3fl(center, center, &pt->x, ninv);
-   }
-#endif
/* save falloff factor 
*/

gps->runtime.multi_frame_falloff = falloff;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d432a239ade] blender2.8: Outliner Keymap: E key to Exclude collections from View Layer

2018-07-23 Thread Pablo Vazquez
Commit: d432a239adee7e04b264303ec7e3ef6ffc8ce403
Author: Pablo Vazquez
Date:   Mon Jul 23 11:20:31 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd432a239adee7e04b264303ec7e3ef6ffc8ce403

Outliner Keymap: E key to Exclude collections from View Layer

Alt+E to include.

===

M   source/blender/editors/space_outliner/outliner_ops.c

===

diff --git a/source/blender/editors/space_outliner/outliner_ops.c 
b/source/blender/editors/space_outliner/outliner_ops.c
index 0dd492839c9..8b4ae029876 100644
--- a/source/blender/editors/space_outliner/outliner_ops.c
+++ b/source/blender/editors/space_outliner/outliner_ops.c
@@ -570,6 +570,9 @@ void outliner_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "OBJECT_OT_move_to_collection", MKEY, 
KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "OBJECT_OT_link_to_collection", MKEY, 
KM_PRESS, KM_SHIFT, 0);
 
+   WM_keymap_add_item(keymap, "OUTLINER_OT_collection_exclude_set", EKEY, 
KM_PRESS, 0, 0);
+   WM_keymap_add_item(keymap, "OUTLINER_OT_collection_include_set", EKEY, 
KM_PRESS, KM_ALT, 0);
+
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_clear", HKEY, 
KM_PRESS, KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "select", false);
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, 
KM_PRESS, 0, 0);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [96abec41ccf] blender2.8: Cleanup: comments and UI descriptions for cursor snapping

2018-07-23 Thread Ines Almeida
Commit: 96abec41ccf0a58b085095640faadf36c5d9ed9a
Author: Ines Almeida
Date:   Sun May 27 10:33:34 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB96abec41ccf0a58b085095640faadf36c5d9ed9a

Cleanup: comments and UI descriptions for cursor snapping

===

M   source/blender/editors/space_view3d/view3d_snap.c

===

diff --git a/source/blender/editors/space_view3d/view3d_snap.c 
b/source/blender/editors/space_view3d/view3d_snap.c
index 7799854db49..6a8589f5468 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -72,6 +72,7 @@ static bool snap_calc_active_center(bContext *C, const bool 
select_only, float r
 
 /* *** operators  */
 
+/** Snaps every individual object center to its nearest point on the grid. **/
 static int snap_sel_to_grid_exec(bContext *C, wmOperator *UNUSED(op))
 {
Depsgraph *depsgraph = CTX_data_depsgraph(C);
@@ -212,7 +213,7 @@ void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot)
 {
/* identifiers */
ot->name = "Snap Selection to Grid";
-   ot->description = "Snap selected item(s) to nearest grid division";
+   ot->description = "Snap selected item(s) to their nearest grid 
division";
ot->idname = "VIEW3D_OT_snap_selected_to_grid";
 
/* api callbacks */
@@ -225,6 +226,12 @@ void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot)
 
 /* *** */
 
+/** Snaps the selection as a whole (use_offset=true) or each selected object 
to the given location.
+ *
+ * \param snap_target_global: a location in global space to snap to (eg. 3D 
cursor or active object).
+ * \param use_offset: if the selected objects should maintain their relative 
offsets and be snapped by the selection 
+ *pivot point (median, active), or if every object origin 
should be snapped to the given location.
+**/
 static int snap_selected_to_location(bContext *C, const float 
snap_target_global[3], const bool use_offset)
 {
Depsgraph *depsgraph = CTX_data_depsgraph(C);
@@ -434,7 +441,7 @@ void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot)
 {
/* identifiers */
ot->name = "Snap Selection to Cursor";
-   ot->description = "Snap selected item(s) to cursor";
+   ot->description = "Snap selected item(s) to the 3D cursor";
ot->idname = "VIEW3D_OT_snap_selected_to_cursor";
 
/* api callbacks */
@@ -445,9 +452,13 @@ void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
/* rna */
-   RNA_def_boolean(ot->srna, "use_offset", 1, "Offset", "");
+   RNA_def_boolean(ot->srna, "use_offset", 1, "Offset",
+   "If the selection should be snapped as a whole or by each 
object center");
 }
 
+/* *** */
+
+/** Snaps each selected object to the location of the active selected object. 
**/
 static int snap_selected_to_active_exec(bContext *C, wmOperator *op)
 {
float snap_target_global[3];
@@ -478,6 +489,7 @@ void VIEW3D_OT_snap_selected_to_active(wmOperatorType *ot)
 
 /* *** */
 
+/** Snaps the 3D cursor location to its nearest point on the grid. **/
 static int snap_curs_to_grid_exec(bContext *C, wmOperator *UNUSED(op))
 {
Scene *scene = CTX_data_scene(C);
@@ -502,7 +514,7 @@ void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot)
 {
/* identifiers */
ot->name = "Snap Cursor to Grid";
-   ot->description = "Snap cursor to nearest grid division";
+   ot->description = "Snap 3D cursor to the nearest grid division";
ot->idname = "VIEW3D_OT_snap_cursor_to_grid";
 
/* api callbacks */
@@ -515,7 +527,8 @@ void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot)
 
 /*  */
 
-static void bundle_midpoint(Depsgraph *depsgraph, Scene *scene, Object *ob, 
float vec[3])
+/** Returns the center position of a tracking marker visible on the viewport 
(useful to snap to). **/
+static void bundle_midpoint(Depsgraph *depsgraph, Scene *scene, Object *ob, 
float r_vec[3])
 {
MovieClip *clip = BKE_object_movieclip_get(scene, ob, false);
MovieTracking *tracking;
@@ -563,10 +576,11 @@ static void bundle_midpoint(Depsgraph *depsgraph, Scene 
*scene, Object *ob, floa
}
 
if (ok) {
-   mid_v3_v3v3(vec, min, max);
+   mid_v3_v3v3(r_vec, min, max);
}
 }
 
+/** Snaps the 3D cursor location to the median point of the selection. **/
 static bool snap_curs_to_sel_ex(bContext *C, float cursor[3])
 {
Depsgraph *depsgraph = CTX_data_depsgraph(C);
@@ -690,7 +704,7 @@ void VIEW3D_OT_snap_cursor_to_selected(wmOperato

[Bf-blender-cvs] [d7b472c1989] blender2.8: Fix wrong view layer rendered from command line

2018-07-23 Thread Sergey Sharybin
Commit: d7b472c19898a04a4b90da45d2749872ef56bd88
Author: Sergey Sharybin
Date:   Mon Jul 23 11:47:06 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd7b472c19898a04a4b90da45d2749872ef56bd88

Fix wrong view layer rendered from command line

The issue was caused by Render Single Layer option enabled, which is
very handy for artists work, so they can hit F12 and see view layer
they are currently working in a final rendered state. This saves a lot
of time since all the "non-interesting" objects are ignored for such
iterations.

However, for the render farm we need to render view layers which are
explicitly set for render, and ignore active view layer.

Reasonable solution seems to be to ignore the Render Single Layer
option when rendering from the command line. It is really something
more like UI behavior option.

===

M   source/blender/makesrna/intern/rna_scene.c
M   source/blender/render/intern/include/render_result.h

===

diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index dd08be4c943..b44a53fa90b 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -5412,7 +5412,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
 
prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, 
PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
-   RNA_def_property_ui_text(prop, "Render Single Layer", "Only render the 
active layer");
+   RNA_def_property_ui_text(prop, "Render Single Layer", "Only render the 
active layer. Only affects rendering from the interface, ignored for rendering 
from command line");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 
diff --git a/source/blender/render/intern/include/render_result.h 
b/source/blender/render/intern/include/render_result.h
index 3096949b49f..ab7eee128f0 100644
--- a/source/blender/render/intern/include/render_result.h
+++ b/source/blender/render/intern/include/render_result.h
@@ -123,7 +123,7 @@ bool render_result_has_views(struct RenderResult *rr);
 iter_ != NULL;   \
iter_ = iter_->next, nr_++)   \
{ \
-   if ((re_)->r.scemode & R_SINGLE_LAYER) {  \
+   if (!G.background &&  (re_)->r.scemode & R_SINGLE_LAYER) {  \
if (nr_ != re->active_view_layer) {   \
continue; \
} \

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [f0dd7dd4c01] blender2.8: Mark view layer renderability and scene single layer render as non-animatable

2018-07-23 Thread Sergey Sharybin
Commit: f0dd7dd4c01d2c1b2c4d9a6cbec9bfab1566b795
Author: Sergey Sharybin
Date:   Mon Jul 23 11:42:44 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf0dd7dd4c01d2c1b2c4d9a6cbec9bfab1566b795

Mark view layer renderability and scene single layer render as non-animatable

We can not support animation of those flags reliably in the pipeline, so just
mark them as non-animatable.

===

M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index 339d3841b30..dd08be4c943 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -4255,6 +4255,7 @@ static void rna_def_scene_render_view(BlenderRNA *brna)
 
prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "viewflag", 
SCE_VIEW_DISABLE);
+   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Enabled", "Disable or enable the render 
view");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 }
@@ -5412,6 +5413,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, 
PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER);
RNA_def_property_ui_text(prop, "Render Single Layer", "Only render the 
active layer");
+   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
 
/* views (stereoscopy et al) */

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [66fde2d0b57] blender2.8: Fix T55634: Particle Viewport Display affects render visibilty

2018-07-23 Thread Sergey Sharybin
Commit: 66fde2d0b57f2597d38545937640bad8b6f7ed30
Author: Sergey Sharybin
Date:   Mon Jul 23 12:53:46 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB66fde2d0b57f2597d38545937640bad8b6f7ed30

Fix T55634: Particle Viewport Display affects render visibilty

Changed code to follow master behavior closer: ignore draw-as checks
when particles are evaluating for rendering.

===

M   source/blender/blenkernel/intern/particle_system.c

===

diff --git a/source/blender/blenkernel/intern/particle_system.c 
b/source/blender/blenkernel/intern/particle_system.c
index 35c8761f671..cee1c9147b5 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -2941,7 +2941,7 @@ static void psys_update_path_cache(ParticleSimulationData 
*sim, float cfra, cons
skip = 1; /* only hair, keyed and baked stuff can have paths */
else if (part->ren_as != PART_DRAW_PATH && !(part->type==PART_HAIR && 
ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)))
skip = 1; /* particle visualization must be set as path */
-   else {
+   else if (DEG_get_mode(sim->depsgraph) != DAG_EVAL_RENDER) {
if (part->draw_as != PART_DRAW_REND)
skip = 1; /* draw visualization */
else if (psys->pointcache->flag & PTCACHE_BAKING)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [5a05aff73a9] blender2.8: UI: more descriptive tooltip

2018-07-23 Thread Ines Almeida
Commit: 5a05aff73a922f0fdb1a2ea4edb8d139f4ff8d98
Author: Ines Almeida
Date:   Mon Jul 23 13:15:20 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5a05aff73a922f0fdb1a2ea4edb8d139f4ff8d98

UI: more descriptive tooltip

===

M   release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M   release/scripts/startup/bl_ui/space_view3d.py

===

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 a2ccfb4f1b8..55b798d103a 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -728,7 +728,7 @@ class GPENCIL_MT_snap(Menu):
 
 layout.operator("gpencil.snap_to_grid", text="Selection to Grid")
 layout.operator("gpencil.snap_to_cursor", text="Selection to 
Cursor").use_offset = False
-layout.operator("gpencil.snap_to_cursor", text="Selection to Cursor 
(Offset)").use_offset = True
+layout.operator("gpencil.snap_to_cursor", text="Selection to Cursor 
(Keep Offset)").use_offset = True
 
 layout.separator()
 
diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index e8c640721c8..6874055a58f 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -453,7 +453,7 @@ class VIEW3D_MT_snap(Menu):
 
 layout.operator("view3d.snap_selected_to_grid", text="Selection to 
Grid")
 layout.operator("view3d.snap_selected_to_cursor", text="Selection to 
Cursor").use_offset = False
-layout.operator("view3d.snap_selected_to_cursor", text="Selection to 
Cursor (Offset)").use_offset = True
+layout.operator("view3d.snap_selected_to_cursor", text="Selection to 
Cursor (Keep Offset)").use_offset = True
 layout.operator("view3d.snap_selected_to_active", text="Selection to 
Active")
 
 layout.separator()

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [01f5601fe5a] master: Fix build for Intel compiler with C++11.

2018-07-23 Thread Milan Jaros
Commit: 01f5601fe5aee395676ecc743c1b8a48b366f404
Author: Milan Jaros
Date:   Mon Jul 23 14:20:06 2018 +0200
Branches: master
https://developer.blender.org/rB01f5601fe5aee395676ecc743c1b8a48b366f404

Fix build for Intel compiler with C++11.

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index da333286478..4de98860a61 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1615,7 +1615,11 @@ if(WITH_PYTHON)
 endif()
 
 if(WITH_CXX11)
-   if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+   if(
+   CMAKE_COMPILER_IS_GNUCC OR
+   CMAKE_C_COMPILER_ID MATCHES "Clang" OR
+   CMAKE_C_COMPILER_ID MATCHES "Intel"
+   )
# TODO(sergey): Do we want c++11 or gnu-c++11 here?
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(MSVC)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [1333ceca043] blender2.8: Merge branch 'master' into blender2.8

2018-07-23 Thread Brecht Van Lommel
Commit: 1333ceca043ea81f421cee2d37011622058a16e3
Author: Brecht Van Lommel
Date:   Mon Jul 23 14:23:21 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB1333ceca043ea81f421cee2d37011622058a16e3

Merge branch 'master' into blender2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c013752625d] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object

2018-07-23 Thread Antonio Vazquez
Commit: c013752625d20932cf27200353a59a0c1b8345c0
Author: Antonio Vazquez
Date:   Mon Jul 23 15:47:50 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBc013752625d20932cf27200353a59a0c1b8345c0

Merge branch 'blender2.8' into greasepencil-object

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [59286ddcf80] blender2.8: transform_snap_object: Better bvhtree creation management for editing multiple objects.

2018-07-23 Thread Germano
Commit: 59286ddcf80c391094d64dcbbb94640bf73bd0d9
Author: Germano
Date:   Mon Jul 23 11:04:58 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB59286ddcf80c391094d64dcbbb94640bf73bd0d9

transform_snap_object: Better bvhtree creation management for editing multiple 
objects.

- Use the object referenced in `BMEditMesh` as the `ghash` key to save the 
bvhtrees in cache;
- Create a boundbox around edit_mesh to test the snap before creating bvhtree;
- Save the `edit_mesh`s bvhtree in the mesh bvh_cache;

This is a part of the D3504.

===

M   source/blender/blenkernel/BKE_bvhutils.h
M   source/blender/blenkernel/intern/bvhutils.c
M   source/blender/editors/transform/transform_snap_object.c

===

diff --git a/source/blender/blenkernel/BKE_bvhutils.h 
b/source/blender/blenkernel/BKE_bvhutils.h
index d79a7eae53e..a0780a5be54 100644
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@ -102,7 +102,7 @@ typedef struct BVHTreeFromMesh {
  */
 BVHTree *bvhtree_from_editmesh_verts(
 BVHTreeFromEditMesh *data, struct BMEditMesh *em,
-float epsilon, int tree_type, int axis);
+float epsilon, int tree_type, int axis, BVHCache **bvh_cache);
 BVHTree *bvhtree_from_editmesh_verts_ex(
 BVHTreeFromEditMesh *data, struct BMEditMesh *em,
 const BLI_bitmap *mask, int verts_num_active,
@@ -115,7 +115,7 @@ BVHTree *bvhtree_from_mesh_verts_ex(
 
 BVHTree *bvhtree_from_editmesh_edges(
 BVHTreeFromEditMesh *data, struct BMEditMesh *em,
-float epsilon, int tree_type, int axis);
+float epsilon, int tree_type, int axis, BVHCache **bvh_cache);
 BVHTree *bvhtree_from_editmesh_edges_ex(
 BVHTreeFromEditMesh *data, struct BMEditMesh *em,
 const BLI_bitmap *edges_mask, int edges_num_active,
@@ -190,7 +190,9 @@ enum {
BVHTREE_FROM_LOOSEVERTS  = 4,
BVHTREE_FROM_LOOSEEDGES  = 5,
 
-   BVHTREE_FROM_EM_LOOPTRI  = 6,
+   BVHTREE_FROM_EM_VERTS= 6,
+   BVHTREE_FROM_EM_EDGES= 7,
+   BVHTREE_FROM_EM_LOOPTRI  = 8,
 };
 
 
diff --git a/source/blender/blenkernel/intern/bvhutils.c 
b/source/blender/blenkernel/intern/bvhutils.c
index 1a7c4e2a4a0..19ac81b4bb7 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -495,12 +495,39 @@ BVHTree *bvhtree_from_editmesh_verts_ex(
 
 BVHTree *bvhtree_from_editmesh_verts(
 BVHTreeFromEditMesh *data, BMEditMesh *em,
-float epsilon, int tree_type, int axis)
+float epsilon, int tree_type, int axis, BVHCache **bvh_cache)
 {
-   return bvhtree_from_editmesh_verts_ex(
-   data, em,
-   NULL, -1,
-   epsilon, tree_type, axis);
+   if (bvh_cache) {
+   BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_READ);
+   data->cached = bvhcache_find(*bvh_cache, BVHTREE_FROM_EM_VERTS, 
&data->tree);
+   BLI_rw_mutex_unlock(&cache_rwlock);
+
+   if (data->cached == false) {
+   BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_WRITE);
+   data->cached = bvhcache_find(
+   *bvh_cache, BVHTREE_FROM_EM_VERTS, &data->tree);
+   if (data->cached == false) {
+   data->tree = bvhtree_from_editmesh_verts_ex(
+   data, em,
+   NULL, -1,
+   epsilon, tree_type, axis);
+
+   /* Save on cache for later use */
+   /* printf("BVHTree built and saved on 
cache\n"); */
+   bvhcache_insert(
+   bvh_cache, data->tree, 
BVHTREE_FROM_EM_VERTS);
+   }
+   BLI_rw_mutex_unlock(&cache_rwlock);
+   }
+   }
+   else {
+   data->tree = bvhtree_from_editmesh_verts_ex(
+   data, em,
+   NULL, -1,
+   epsilon, tree_type, axis);
+   }
+
+   return data->tree;
 }
 
 /**
@@ -649,12 +676,39 @@ BVHTree *bvhtree_from_editmesh_edges_ex(
 
 BVHTree *bvhtree_from_editmesh_edges(
 BVHTreeFromEditMesh *data, BMEditMesh *em,
-float epsilon, int tree_type, int axis)
+float epsilon, int tree_type, int axis, BVHCache **bvh_cache)
 {
-   return bvhtree_from_editmesh_edges_ex(
-   data, em,
-   NULL, -1,
-   epsilon, tree_type, axis);
+   if (bvh_cache) {
+   BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_READ);
+   data->cached = bvhcache_find(*bvh_cache, BVHTREE_FROM_EM_EDGES, 
&data->tree);
+   BLI_rw_mutex_unlock

[Bf-blender-cvs] [17c3110ae57] blender2.8: Fix large font drawing blurriness in a better way.

2018-07-23 Thread Brecht Van Lommel
Commit: 17c3110ae5776bb4bfb11e240d4623ea9a80e073
Author: Brecht Van Lommel
Date:   Mon Jul 23 16:10:46 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB17c3110ae5776bb4bfb11e240d4623ea9a80e073

Fix large font drawing blurriness in a better way.

GPU_LINEAR is there for shadow font blurring, the real issue was lack of
rounding for the batch offset.

===

M   source/blender/blenfont/intern/blf_font.c
M   source/blender/blenfont/intern/blf_glyph.c

===

diff --git a/source/blender/blenfont/intern/blf_font.c 
b/source/blender/blenfont/intern/blf_font.c
index ea81106e60f..f7a926275a9 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -133,7 +133,8 @@ void blf_batch_draw_begin(FontBLF *font)
 
if (simple_shader) {
/* Offset is applied to each glyph. */
-   copy_v2_v2(g_batch.ofs, font->pos);
+   g_batch.ofs[0] = floorf(font->pos[0]);
+   g_batch.ofs[1] = floorf(font->pos[1]);
}
else {
/* Offset is baked in modelview mat. */
diff --git a/source/blender/blenfont/intern/blf_glyph.c 
b/source/blender/blenfont/intern/blf_glyph.c
index 99be8539d24..f7f1e10a480 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -244,7 +244,7 @@ static void blf_glyph_cache_texture(FontBLF *font, 
GlyphCacheBLF *gc)
gc->textures[gc->texture_current] = tex;
GPU_texture_bind(tex, 0);
GPU_texture_wrap_mode(tex, false);
-   GPU_texture_filters(tex, GPU_NEAREST, GPU_NEAREST);
+   GPU_texture_filters(tex, GPU_NEAREST, GPU_LINEAR);
GPU_texture_unbind(tex);
 }
 
@@ -427,8 +427,8 @@ static void blf_glyph_calc_rect(rctf *rect, GlyphBLF *g, 
float x, float y)
 {
rect->xmin = floorf(x + g->pos_x);
rect->xmax = rect->xmin + (float)g->width;
-   rect->ymin = y + g->pos_y;
-   rect->ymax = y + g->pos_y - (float)g->height;
+   rect->ymin = floorf(y + g->pos_y);
+   rect->ymax = rect->ymin - (float)g->height;
 }
 
 void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [aa6563d3a9b] soc-2018-npr: Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr

2018-07-23 Thread Nick Wu
Commit: aa6563d3a9bd46fd170b6ae493d8db885d2422b7
Author: Nick Wu
Date:   Mon Jul 23 10:55:48 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rBaa6563d3a9bd46fd170b6ae493d8db885d2422b7

Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr

# Conflicts:
#   release/scripts/startup/bl_ui/space_view3d.py
#   source/blender/draw/intern/draw_manager.c

===



===

diff --cc release/scripts/startup/bl_ui/properties_scene.py
index f34c0897457,38bfc6ad294..d8cc00d7afd
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@@ -481,315 -568,8 +568,315 @@@ class SCENE_PT_simplify_render(SceneBut
  col.prop(rd, "simplify_child_particles_render", text="Max Child 
Particles")
  
  
 +class SCENE_PT_viewport_display(SceneButtonsPanel, Panel):
 +bl_label = "Viewport Display"
 +bl_options = {'DEFAULT_CLOSED'}
 +
 +@classmethod
 +def poll(cls, context):
 +return True
 +
 +def draw(self, context):
 +layout = self.layout
 +layout.use_property_split = True
 +scene = context.scene
 +col = layout.column()
 +col.prop(scene.display, "light_direction")
 +col.prop(scene.display, "shadow_shift")
 +
 +class LANPR_linesets(UIList):
 +def draw_item(self, context, layout, data, item, icon, active_data, 
active_propname, index):
 +lineset = item
 +if self.layout_type in {'DEFAULT', 'COMPACT'}:
 +split = layout.split(percentage=0.6)
 +split.label(text="Layer")
 +row = split.row(align=True)
 +row.prop(lineset, "color", text="", icon_value=icon)
 +row.prop(lineset, "thickness", text="", icon_value=icon)
 +elif self.layout_type == 'GRID':
 +layout.alignment = 'CENTER'
 +layout.label("", icon_value=icon)
 +
 +class SCENE_PT_lanpr(SceneButtonsPanel, Panel):
 +COMPAT_ENGINES = {'BLENDER_CLAY'}
 +bl_label = "LANPR"
 +bl_options = {'DEFAULT_CLOSED'}
 +
 +@classmethod
 +def poll(cls, context):
 +return True
 +
 +def draw(self, context):
 +layout = self.layout
 +scene = context.scene
 +lanpr = scene.lanpr
 +active_layer = lanpr.layers.active_layer
 +
 +layout.prop(lanpr, "master_mode", expand=True) 
 +
 +if lanpr.master_mode == "DPIX" or lanpr.master_mode == "SOFTWARE":
 +if lanpr.master_mode == "DPIX":
 +layout.prop(lanpr, "reloaded")
 +
 +rows = 4
 +if lanpr.master_mode == "SOFTWARE":
 +layout.label(text="Enable On Demand:")
 +layout.prop(lanpr,"calculate_intersections", toggle = True, 
text = "Enable Intersection Lines")
 +layout.label(text="RUN:")
 +layout.operator("scene.lanpr_calculate", icon='RENDER_STILL')
 +layout.label(text="Layer Composition:")
 +layout.template_list("LANPR_linesets", "", lanpr, "layers", 
lanpr.layers, "active_layer_index", rows=rows)
 +if active_layer:
 +split = layout.split()
 +col = split.column()
 +col.operator("scene.lanpr_add_line_layer", icon="ZOOMIN")
 +col.operator("scene.lanpr_delete_line_layer", 
icon="ZOOMOUT")
 +col = split.column()
 +col.operator("scene.lanpr_move_line_layer", 
icon="TRIA_UP").direction = "UP"
 +col.operator("scene.lanpr_move_line_layer", 
icon="TRIA_DOWN").direction = "DOWN"
 +layout.operator("scene.lanpr_rebuild_all_commands")
 +else:
 +layout.operator("scene.lanpr_add_line_layer")
 +elif not lanpr.layers.active_layer:
 +layout.operator("scene.lanpr_add_line_layer")
 +
 +else:
 +layout.label(text="Vectorization:")
 +layout.prop(lanpr, "enable_vector_trace", expand = True)
 +
 +#col = layout.column()
 +#col.label(text="Enable:")
 +#row = col.row(align=True)
 +#row.prop(lanpr, "enable_edge_mark", text="Mark", toggle=True)
 +#row.prop(lanpr, "enable_material_seperate", text="Material", 
toggle=True)
 +
 +
 +class SCENE_PT_lanpr_line_types(SceneButtonsPanel, Panel):
 +bl_label = "Types"
 +bl_parent_id = "SCENE_PT_lanpr"
 +COMPAT_ENGINES = {'BLENDER_CLAY'}
 +
 +@classmethod
 +def poll(cls, context):
 +scene = context.scene
 +lanpr = scene.lanpr
 +active_layer = lanpr.layers.active_layer
 +return active_layer and lanpr.master_mode != "SNAKE"
 +
 +def draw(self, context):
 +layout = self.layout
 +scene = context.scene
 +lanpr = scene

[Bf-blender-cvs] [9f344c6b887] soc-2018-npr: Merge and changed GWN APIs into GPU ones.

2018-07-23 Thread Nick Wu
Commit: 9f344c6b887306b42156279deffb5112f88757d1
Author: Nick Wu
Date:   Mon Jul 23 11:34:30 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB9f344c6b887306b42156279deffb5112f88757d1

Merge and changed GWN APIs into GPU ones.

===

M   source/blender/draw/engines/lanpr/lanpr_all.h
M   source/blender/draw/engines/lanpr/lanpr_chain.c
M   source/blender/draw/engines/lanpr/lanpr_dpix.c
M   source/blender/draw/engines/lanpr/lanpr_engine.c
M   source/blender/draw/engines/lanpr/lanpr_ops.c
M   source/blender/draw/engines/lanpr/lanpr_snake.c
M   source/blender/draw/intern/draw_manager.c

===

diff --git a/source/blender/draw/engines/lanpr/lanpr_all.h 
b/source/blender/draw/engines/lanpr/lanpr_all.h
index 158a9057ef3..702c22e1132 100644
--- a/source/blender/draw/engines/lanpr/lanpr_all.h
+++ b/source/blender/draw/engines/lanpr/lanpr_all.h
@@ -215,8 +215,8 @@ typedef struct LANPR_PrivateData {
unsigned i_buf;
unsigned l_buf;
 
-   Gwn_VertFormat snake_gwn_format;
-   Gwn_Batch *snake_batch;
+   GPUVertFormat snake_gwn_format;
+   GPUBatch *snake_batch;
 
ListBase dpix_batch_list;
 
@@ -228,8 +228,8 @@ typedef struct LANPR_StorageList {
 
 typedef struct LANPR_BatchItem {
Link Item;
-   Gwn_Batch *dpix_transform_batch;
-   Gwn_Batch *dpix_preview_batch;
+   GPUBatch *dpix_transform_batch;
+   GPUBatch *dpix_preview_batch;
Object *ob;
 } LANPR_BatchItem;
 
@@ -308,8 +308,8 @@ typedef struct LANPR_RenderBuffer {
 
nListHandle IntersectingVertexBuffer;
 
-   struct Gwn_Batch *DPIXIntersectionTransformBatch;
-   struct Gwn_Batch *DPIXIntersectionBatch;
+   struct GPUBatch *DPIXIntersectionTransformBatch;
+   struct GPUBatch *DPIXIntersectionBatch;
 
/* use own-implemented one */
nStaticMemoryPool RenderDataPool;
@@ -348,7 +348,7 @@ typedef struct LANPR_RenderBuffer {
nListHandle EdgeMarks;
 
nListHandle Chains;
-   Gwn_Batch*  ChainDrawBatch;
+   GPUBatch*  ChainDrawBatch;
DRWShadingGroup* ChainShgrp;
 
SpinLock csInfo;
diff --git a/source/blender/draw/engines/lanpr/lanpr_chain.c 
b/source/blender/draw/engines/lanpr/lanpr_chain.c
index 758493fb1b2..d60c75bd11b 100644
--- a/source/blender/draw/engines/lanpr/lanpr_chain.c
+++ b/source/blender/draw/engines/lanpr/lanpr_chain.c
@@ -279,16 +279,16 @@ void lanpr_ChainGenerateDrawCommand(LANPR_RenderBuffer 
*rb){
float* lengths;
float length_target[2];
 
-static Gwn_VertFormat format = { 0 };
+static GPUVertFormat format = { 0 };
static struct { uint pos, offset, type, level; } attr_id;
if (format.attr_len == 0) {
-   attr_id.pos = GWN_vertformat_attr_add(&format, "pos", 
GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
-attr_id.offset = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 
2, GWN_FETCH_FLOAT);
-   attr_id.type = GWN_vertformat_attr_add(&format, "type", 
GWN_COMP_I32, 1, GWN_FETCH_FLOAT);
-   attr_id.level = GWN_vertformat_attr_add(&format, "level", 
GWN_COMP_I32, 1, GWN_FETCH_INT);
+   attr_id.pos = GPU_vertformat_attr_add(&format, "pos", 
GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+attr_id.offset = GPU_vertformat_attr_add(&format, "uvs", GPU_COMP_F32, 
2, GPU_FETCH_FLOAT);
+   attr_id.type = GPU_vertformat_attr_add(&format, "type", 
GPU_COMP_I32, 1, GPU_FETCH_FLOAT);
+   attr_id.level = GPU_vertformat_attr_add(&format, "level", 
GPU_COMP_I32, 1, GPU_FETCH_INT);
}
 
-   Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
+   GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
 
 for(rlc = rb->Chains.pFirst; rlc;rlc=rlc->Item.pNext){
int count = lanpr_CountChain(rlc);
@@ -296,12 +296,12 @@ void lanpr_ChainGenerateDrawCommand(LANPR_RenderBuffer 
*rb){
vert_count += count;
 }
 
-GWN_vertbuf_data_alloc(vbo, vert_count+1); // serve as end point's adj.
+GPU_vertbuf_data_alloc(vbo, vert_count+1); // serve as end point's adj.
 
lengths = MEM_callocN(sizeof(float)*vert_count, "chain lengths");
 
-Gwn_IndexBufBuilder elb;
-   GWN_indexbuf_init_ex(&elb, GWN_PRIM_LINES_ADJ, vert_count*4, 
vert_count, true);// elem count will not exceed vert_count
+GPUIndexBufBuilder elb;
+   GPU_indexbuf_init_ex(&elb, GPU_PRIM_LINES_ADJ, vert_count*4, 
vert_count, true);// elem count will not exceed vert_count
 
 for(rlc = rb->Chains.pFirst; rlc; rlc=rlc->Item.pNext){
 
@@ -312,25 +312,25 @@ void lanpr_ChainGenerateDrawCommand(LANPR_RenderBuffer 
*rb){
length_target[0] = lengths[i];
length_target[1] = total_length - lengths[i];
 
-GWN_vertbuf_attr_set(vbo, attr_id.pos, i, rlci->pos);
-GWN_v

[Bf-blender-cvs] [e406c678424] soc-2018-npr: Provide a switch to enable chaining or not.

2018-07-23 Thread Nick Wu
Commit: e406c67842479a78b8904671a8e9729fc8a505c7
Author: Nick Wu
Date:   Mon Jul 23 22:33:59 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rBe406c67842479a78b8904671a8e9729fc8a505c7

Provide a switch to enable chaining or not.

===

M   release/scripts/startup/bl_ui/properties_scene.py
M   source/blender/draw/CMakeLists.txt
M   source/blender/draw/engines/lanpr/lanpr_all.h
M   source/blender/draw/engines/lanpr/lanpr_engine.c
M   source/blender/draw/engines/lanpr/lanpr_ops.c
A   source/blender/draw/engines/lanpr/shaders/lanpr_software_chain.geometry
M   
source/blender/draw/engines/lanpr/shaders/lanpr_software_line_width.geometry
M   source/blender/makesdna/DNA_lanpr_types.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/release/scripts/startup/bl_ui/properties_scene.py 
b/release/scripts/startup/bl_ui/properties_scene.py
index d8cc00d7afd..a95ed107725 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -618,10 +618,11 @@ class SCENE_PT_lanpr(SceneButtonsPanel, Panel):
 if lanpr.master_mode == "DPIX":
 layout.prop(lanpr, "reloaded")
 
-rows = 4
 if lanpr.master_mode == "SOFTWARE":
 layout.label(text="Enable On Demand:")
-layout.prop(lanpr,"calculate_intersections", toggle = True, 
text = "Enable Intersection Lines")
+row = layout.row()
+row.prop(lanpr,"calculate_intersections", text = "Intersection 
Lines")
+row.prop(lanpr,"enable_chaining", text = "Chaining (SLOW!)")
 layout.label(text="RUN:")
 layout.operator("scene.lanpr_calculate", icon='RENDER_STILL')
 layout.label(text="Layer Composition:")
diff --git a/source/blender/draw/CMakeLists.txt 
b/source/blender/draw/CMakeLists.txt
index a8c099dcdae..1ed2b724f7a 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -252,6 +252,8 @@ 
data_to_c_simple(engines/lanpr/shaders/lanpr_snake_edge.fragment SRC)
 data_to_c_simple(engines/lanpr/shaders/lanpr_snake_multichannel.fragment SRC)
 data_to_c_simple(engines/lanpr/shaders/lanpr_software_line_width.geometry SRC)
 data_to_c_simple(engines/lanpr/shaders/lanpr_software_scale_compensate.vertex 
SRC)
+data_to_c_simple(engines/lanpr/shaders/lanpr_software_chain.geometry SRC)
+
 
 data_to_c_simple(modes/shaders/common_globals_lib.glsl SRC)
 data_to_c_simple(modes/shaders/common_hair_lib.glsl SRC)
diff --git a/source/blender/draw/engines/lanpr/lanpr_all.h 
b/source/blender/draw/engines/lanpr/lanpr_all.h
index 1b070a54002..b9e5c9d3e30 100644
--- a/source/blender/draw/engines/lanpr/lanpr_all.h
+++ b/source/blender/draw/engines/lanpr/lanpr_all.h
@@ -64,6 +64,7 @@ typedef struct LANPROneTimeInit {
 
/* Software */
GPUShader *software_shader;
+   GPUShader *software_chaining_shader;
 
void *ved;
 
diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c 
b/source/blender/draw/engines/lanpr/lanpr_engine.c
index c7248182520..3c48ec0fae8 100644
--- a/source/blender/draw/engines/lanpr/lanpr_engine.c
+++ b/source/blender/draw/engines/lanpr/lanpr_engine.c
@@ -36,6 +36,7 @@ extern char datatoc_lanpr_line_connection_vertex[];
 extern char datatoc_lanpr_line_connection_fragment[];
 extern char datatoc_lanpr_line_connection_geometry[];
 extern char datatoc_lanpr_software_line_width_geometry[];
+extern char datatoc_lanpr_software_chain_geometry[];
 extern char datatoc_lanpr_atlas_project_passthrough_vertex[];
 extern char datatoc_lanpr_atlas_preview_fragment[];
 extern char datatoc_lanpr_software_scale_compensate_vertex[];
@@ -177,6 +178,15 @@ static void lanpr_engine_init(void *ved){
NULL, NULL);
}
 
+   if (!OneTime.software_chaining_shader) {
+   OneTime.software_chaining_shader =
+   GPU_shader_create(
+   datatoc_lanpr_software_scale_compensate_vertex,
+   datatoc_lanpr_atlas_preview_fragment,
+   datatoc_lanpr_software_chain_geometry,
+   NULL, NULL);
+   }
+
GPU_framebuffer_ensure_config(&fbl->software_ms, {
GPU_ATTACHMENT_TEXTURE(txl->ms_resolve_depth),
GPU_ATTACHMENT_TEXTURE(txl->ms_resolve_color),
@@ -349,23 +359,6 @@ static void lanpr_cache_init(void *vedata){
} elif(lanpr->master_mode == LANPR_MASTER_MODE_SOFTWARE)
{
;
-   /*LANPR_LineLayer *ll;
-   for (ll = lanpr->line_layers.first; ll; ll = ll->next) {
-   ll->shgrp = DRW_shgroup_create(OneTime.software_shade

[Bf-blender-cvs] [1ddd3d60bff] soc-2018-npr: Chain support line types and levels. Still bugs in chaining, hard to find, but results good enough in most of the conditions.

2018-07-23 Thread Nick Wu
Commit: 1ddd3d60bff06729f3bc08544ab8a9392db5ca12
Author: Nick Wu
Date:   Mon Jul 23 17:57:34 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB1ddd3d60bff06729f3bc08544ab8a9392db5ca12

Chain support line types and levels.
Still bugs in chaining, hard to find, but results good enough in most of the 
conditions.

===

M   source/blender/draw/engines/lanpr/lanpr_all.h
M   source/blender/draw/engines/lanpr/lanpr_chain.c
M   source/blender/draw/engines/lanpr/lanpr_engine.c
M   source/blender/draw/engines/lanpr/lanpr_ops.c
M   
source/blender/draw/engines/lanpr/shaders/lanpr_software_line_width.geometry
M   
source/blender/draw/engines/lanpr/shaders/lanpr_software_scale_compensate.vertex

===

diff --git a/source/blender/draw/engines/lanpr/lanpr_all.h 
b/source/blender/draw/engines/lanpr/lanpr_all.h
index 702c22e1132..1b070a54002 100644
--- a/source/blender/draw/engines/lanpr/lanpr_all.h
+++ b/source/blender/draw/engines/lanpr/lanpr_all.h
@@ -424,7 +424,7 @@ typedef struct LANPR_RenderLineSegment {
nListItem Item;
//real Begin, End;  // 0->At[L] 1->At[R]
real at;
-   u8bit OccludeLevel;//after
+   u8bit OcclusionLevel;//after
 }LANPR_RenderLineSegment;
 
 typedef struct LANPR_RenderVert {
@@ -474,7 +474,7 @@ typedef struct LANPR_RenderLineChainItem {
nListItem   Item;
float   pos[3]; // need z value for fading
charLineType;  //  style of [1]   style of [2]
-   charOccludeLevel;  // 
[1]--->[2]>[3]--
+   charOcclusionLevel;  // 
[1]--->[2]>[3]--
 }LANPR_RenderLineChainItem;
 
 typedef struct LANPR_BoundingArea {
diff --git a/source/blender/draw/engines/lanpr/lanpr_chain.c 
b/source/blender/draw/engines/lanpr/lanpr_chain.c
index d60c75bd11b..fbbea5b5578 100644
--- a/source/blender/draw/engines/lanpr/lanpr_chain.c
+++ b/source/blender/draw/engines/lanpr/lanpr_chain.c
@@ -85,9 +85,10 @@ LANPR_RenderLineChainItem* 
lanpr_append_render_line_chain_point(LANPR_RenderBuff
 rlci->pos[0] = x;
 rlci->pos[1] = y;
 rlci->LineType = type&LANPR_EDGE_FLAG_ALL_TYPE;
+   rlci->OcclusionLevel = level;
 lstAppendItem(&rlc->Chain,rlci);
 
-   //printf("a %f %f\n", x, y);
+//printf("a %f,%f %d\n", x, y, level);
 
 return rlci;
 }
@@ -99,9 +100,10 @@ LANPR_RenderLineChainItem* 
lanpr_push_render_line_chain_point(LANPR_RenderBuffer
 rlci->pos[0] = x;
 rlci->pos[1] = y;
 rlci->LineType = type&LANPR_EDGE_FLAG_ALL_TYPE;
+   rlci->OcclusionLevel = level;
 lstPushItem(&rlc->Chain,rlci);
 
-   //printf("p %f %f\n", x, y);
+   //printf("p %f,%f %d\n", x, y, level);
 
 return rlci;
 }
@@ -117,7 +119,7 @@ void 
lanpr_reduce_render_line_chain_recursive(LANPR_RenderLineChain* rlc, LANPR_
 for(rlci = from->Item.pNext; rlci!= to; rlci=next_rlci){
 next_rlci = rlci->Item.pNext;
 
-if(next_rlci && (next_rlci->OccludeLevel!= rlci->OccludeLevel || 
next_rlci->LineType!= rlci->LineType)) continue;
+if(next_rlci && (next_rlci->OcclusionLevel!= rlci->OcclusionLevel || 
next_rlci->LineType!= rlci->LineType)) continue;
 
float dist = dist_to_line_segment_v2(rlci->pos, from->pos, 
to->pos);
if (dist>dist_threshold && dist>max_dist) { max_dist = dist; 
max_rlci = rlci; }
@@ -128,7 +130,7 @@ void 
lanpr_reduce_render_line_chain_recursive(LANPR_RenderLineChain* rlc, LANPR_
if (from->Item.pNext == to) return;
for (rlci = from->Item.pNext; rlci != to; rlci = next_rlci) {
next_rlci = rlci->Item.pNext;
-   if (next_rlci && (next_rlci->OccludeLevel != 
rlci->OccludeLevel || next_rlci->LineType != rlci->LineType)) continue;
+   if (next_rlci && (next_rlci->OcclusionLevel != 
rlci->OcclusionLevel || next_rlci->LineType != rlci->LineType)) continue;
lstRemoveItem(&rlc->Chain, (void*)rlci);
}
}else {
@@ -140,6 +142,7 @@ void 
lanpr_reduce_render_line_chain_recursive(LANPR_RenderLineChain* rlc, LANPR_
 
 void lanpr_ChainFeatureLines_NO_THREAD(LANPR_RenderBuffer *rb, float 
dist_threshold){
 LANPR_RenderLineChain* rlc;
+   LANPR_RenderLineChainItem* rlci;
 LANPR_RenderLine* rl;
 LANPR_BoundingArea* ba;
 LANPR_RenderLineSegment* rls;
@@ -159,31 +162,32 @@ void lanpr_ChainFeatureLines_NO_THREAD(LANPR_RenderBuffer 
*rb, float dist_thresh
 // step 1: grow left
 ba = lanpr_GetPointBoundingArea(rb,rl->L->FrameBufferCoord[0], 
rl->L->FrameBufferCoord[1]);
 new_rv = rl->L;
-
lanpr_push_render_line_chain_point(rb,rlc,new_rv->FrameBufferCoord[0],new_rv->FrameBufferCoord[1],rl->Flags,0);
+   rls = rl->Segments.pFirst

[Bf-blender-cvs] [bb98e83b99e] master: Fix T55668: Volume Keyframe on Cut-ted Metastrip.

2018-07-23 Thread Bastien Montagne
Commit: bb98e83b99e63348e0396a5ffe5bb2a20ff1607a
Author: Bastien Montagne
Date:   Mon Jul 23 17:38:41 2018 +0200
Branches: master
https://developer.blender.org/rBbb98e83b99e63348e0396a5ffe5bb2a20ff1607a

Fix T55668: Volume Keyframe on Cut-ted Metastrip.

We actually still had cases of Meta strip duplication resulting in
non-unique strip names. Quiet surprising this went unoticed for so long. :(

Fixed that bug, and think it was last one (at least, no other case of
SEQ_DUPE_UNIQUE_NAME usage should be broken, I think...), and raised
subversion and updated doversion to run uniquename check on strips on
all previous fileversions.

Note: will have to do that again when merging in 2.8...

===

M   source/blender/blenkernel/BKE_blender_version.h
M   source/blender/blenkernel/BKE_sequencer.h
M   source/blender/blenkernel/intern/sequencer.c
M   source/blender/blenloader/intern/versioning_250.c
M   source/blender/blenloader/intern/versioning_270.c
M   source/blender/editors/space_sequencer/sequencer_edit.c

===

diff --git a/source/blender/blenkernel/BKE_blender_version.h 
b/source/blender/blenkernel/BKE_blender_version.h
index a3da6d5016e..16115203294 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -28,7 +28,7 @@
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION 279
-#define BLENDER_SUBVERSION  5
+#define BLENDER_SUBVERSION  6
 /* Several breakages with 270, e.g. constraint deg vs rad */
 #define BLENDER_MINVERSION  270
 #define BLENDER_MINSUBVERSION   6
diff --git a/source/blender/blenkernel/BKE_sequencer.h 
b/source/blender/blenkernel/BKE_sequencer.h
index 8574e81c4e6..c408597de32 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -392,7 +392,7 @@ typedef struct SeqLoadInfo {
 
 
 /* seq_dupli' flags */
-#define SEQ_DUPE_UNIQUE_NAME(1 << 0)
+#define SEQ_DUPE_UNIQUE_NAME(1 << 0)  /* WARNING: does NOT work when 
duplicating Meta strips! */
 #define SEQ_DUPE_CONTEXT(1 << 1)
 #define SEQ_DUPE_ANIM   (1 << 2)
 #define SEQ_DUPE_ALL(1 << 3) /* otherwise only selected are copied 
*/
diff --git a/source/blender/blenkernel/intern/sequencer.c 
b/source/blender/blenkernel/intern/sequencer.c
index 14119998519..7e4069305f6 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -5517,6 +5517,7 @@ static Sequence *seq_dupli(const Scene *scene_src, Scene 
*scene_dst, Sequence *s
 
if (scene_src == scene_dst) {
if (dupe_flag & SEQ_DUPE_UNIQUE_NAME) {
+   /* TODO this is broken in case of Meta strips recursive 
duplication... Not trivial to fix. */

BKE_sequence_base_unique_name_recursive(&scene_dst->ed->seqbase, seqn);
}
 
diff --git a/source/blender/blenloader/intern/versioning_250.c 
b/source/blender/blenloader/intern/versioning_250.c
index e15d0f50948..28720ef5145 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -633,20 +633,6 @@ static void 
do_version_constraints_radians_degrees_250(ListBase *lb)
}
 }
 
-/* NOTE: this version patch is intended for versions < 2.52.2, but was 
initially introduced in 2.27 already */
-static void do_versions_seq_unique_name_all_strips(Scene *sce, ListBase 
*seqbasep)
-{
-   Sequence * seq = seqbasep->first;
-
-   while (seq) {
-   BKE_sequence_base_unique_name_recursive(&sce->ed->seqbase, seq);
-   if (seq->seqbase.first) {
-   do_versions_seq_unique_name_all_strips(sce, 
&seq->seqbase);
-   }
-   seq = seq->next;
-   }
-}
-
 static void do_version_bone_roll_256(Bone *bone)
 {
Bone *child;
@@ -1326,10 +1312,6 @@ void blo_do_versions_250(FileData *fd, Library *lib, 
Main *bmain)
if (sce->r.mblur_samples == 0)
sce->r.mblur_samples = sce->r.osa;
 
-   if (sce->ed && sce->ed->seqbase.first) {
-   
do_versions_seq_unique_name_all_strips(sce, &sce->ed->seqbase);
-   }
-
sce = sce->id.next;
}
}
diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index 20f2a747fb2..7b787725084 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -308,6 +308,18 @@ static char *replace_bbone_easing_rnapath(char *old_path)
}
 }
 
+/* NOTE: this version

[Bf-blender-cvs] [87090abb952] blender2.8: Eevee: Remove Colored volumetric option.

2018-07-23 Thread Clément Foucault
Commit: 87090abb95263eb2eb830face64777a0eb3e7957
Author: Clément Foucault
Date:   Mon Jul 23 17:40:34 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB87090abb95263eb2eb830face64777a0eb3e7957

Eevee: Remove Colored volumetric option.

This option is not necessary as it uses as much memory as the mono-chromatic
transmistance.

===

M   release/scripts/startup/bl_ui/properties_render.py
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/release/scripts/startup/bl_ui/properties_render.py 
b/release/scripts/startup/bl_ui/properties_render.py
index b1c5edf97e7..83d31ae6114 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -594,8 +594,6 @@ class RENDER_PT_eevee_volumetric(RenderButtonsPanel, Panel):
 sub = col.column()
 sub.active = props.use_volumetric_shadows
 sub.prop(props, "volumetric_shadow_samples", text="Shadow Samples")
-col.separator()
-col.prop(props, "use_volumetric_colored_transmittance")
 
 
 class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel):
diff --git a/source/blender/blenkernel/intern/scene.c 
b/source/blender/blenkernel/intern/scene.c
index 3650fa21c1c..0574eef1a0f 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -878,7 +878,6 @@ void BKE_scene_init(Scene *sce)
 
sce->eevee.flag =
SCE_EEVEE_VOLUMETRIC_LIGHTS |
-   SCE_EEVEE_VOLUMETRIC_COLORED |
SCE_EEVEE_GTAO_BENT_NORMALS |
SCE_EEVEE_GTAO_BOUNCE |
SCE_EEVEE_TAA_REPROJECTION |
diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 09a940436ef..6ac7c719952 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1200,7 +1200,6 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 
scene->eevee.flag =
SCE_EEVEE_VOLUMETRIC_LIGHTS |
-   SCE_EEVEE_VOLUMETRIC_COLORED |
SCE_EEVEE_GTAO_BENT_NORMALS |
SCE_EEVEE_GTAO_BOUNCE |
SCE_EEVEE_TAA_REPROJECTION |
@@ -1258,7 +1257,6 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
EEVEE_GET_BOOL(props, volumetric_enable, 
SCE_EEVEE_VOLUMETRIC_ENABLED);
EEVEE_GET_BOOL(props, volumetric_lights, 
SCE_EEVEE_VOLUMETRIC_LIGHTS);
EEVEE_GET_BOOL(props, volumetric_shadows, 
SCE_EEVEE_VOLUMETRIC_SHADOWS);
-   EEVEE_GET_BOOL(props, 
volumetric_colored_transmittance, SCE_EEVEE_VOLUMETRIC_COLORED);
EEVEE_GET_BOOL(props, gtao_enable, 
SCE_EEVEE_GTAO_ENABLED);
EEVEE_GET_BOOL(props, gtao_use_bent_normals, 
SCE_EEVEE_GTAO_BENT_NORMALS);
EEVEE_GET_BOOL(props, gtao_bounce, 
SCE_EEVEE_GTAO_BOUNCE);
diff --git a/source/blender/makesdna/DNA_scene_types.h 
b/source/blender/makesdna/DNA_scene_types.h
index 16c8d8875c7..a4235a07ed5 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -2096,7 +2096,7 @@ enum {
SCE_EEVEE_VOLUMETRIC_ENABLED= (1 << 0),
SCE_EEVEE_VOLUMETRIC_LIGHTS = (1 << 1),
SCE_EEVEE_VOLUMETRIC_SHADOWS= (1 << 2),
-   SCE_EEVEE_VOLUMETRIC_COLORED= (1 << 3),
+// SCE_EEVEE_VOLUMETRIC_COLORED= (1 << 3), /* Unused */
SCE_EEVEE_GTAO_ENABLED  = (1 << 4),
SCE_EEVEE_GTAO_BENT_NORMALS = (1 << 5),
SCE_EEVEE_GTAO_BOUNCE   = (1 << 6),
diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index b44a53fa90b..096a2d7b8dc 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -6017,12 +6017,6 @@ static void rna_def_scene_eevee(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Volumetric Shadow Samples", "Number of 
samples to compute volumetric shadowing");
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
 
-   prop = RNA_def_property(srna, "use_volumetric_colored_transmittance", 
PROP_BOOLEAN, PROP_NONE);
-   RNA_def_property_boolean_sdna(prop, NULL, "flag", 
SCE_EEVEE_VOLUMETRIC_COLORED);
-   RNA_def_proper

[Bf-blender-cvs] [8876e3aae25] blender2.8: Fix assert when loading file with multiple windows opened

2018-07-23 Thread Clément Foucault
Commit: 8876e3aae25ad0e74baf362413b0fd113aa5b638
Author: Clément Foucault
Date:   Mon Jul 23 17:44:16 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB8876e3aae25ad0e74baf362413b0fd113aa5b638

Fix assert when loading file with multiple windows opened

... or when loading a file when having more windows opened than the file
itself.

===

M   source/blender/windowmanager/intern/wm_files.c
M   source/blender/windowmanager/intern/wm_window.c
M   source/blender/windowmanager/wm_window.h

===

diff --git a/source/blender/windowmanager/intern/wm_files.c 
b/source/blender/windowmanager/intern/wm_files.c
index c191255cd21..02c24aac60e 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -279,6 +279,10 @@ static void wm_window_match_replace_by_file_wm(
wm->initialized = 0;
wm->winactive = NULL;
 
+   /* Clearing drawable of before deleting any context
+* to avoid clearing the wrong wm. */
+   wm_window_clear_drawable(oldwm);
+
/* only first wm in list has ghostwins */
for (wmWindow *win = wm->windows.first; win; win = win->next) {
for (wmWindow *oldwin = oldwm->windows.first; oldwin; oldwin = 
oldwin->next) {
diff --git a/source/blender/windowmanager/intern/wm_window.c 
b/source/blender/windowmanager/intern/wm_window.c
index c1006db34ef..4b26532742b 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -123,7 +123,6 @@ static struct WMInitStruct {
 /*  win open & close  */
 
 static void wm_window_set_drawable(wmWindowManager *wm, wmWindow *win, bool 
activate);
-static void wm_window_clear_drawable(wmWindowManager *wm);
 
 /* XXX this one should correctly check for apple top header...
  * done for Cocoa : returns window contents (and not frame) max size*/
@@ -202,7 +201,6 @@ static void wm_ghostwindow_destroy(wmWindowManager *wm, 
wmWindow *win)
GHOST_DisposeWindow(g_system, win->ghostwin);
win->ghostwin = NULL;
win->gpuctx = NULL;
-
}
 }
 
@@ -1103,7 +1101,7 @@ static void wm_window_set_drawable(wmWindowManager *wm, 
wmWindow *win, bool acti
immActivate();
 }
 
-static void wm_window_clear_drawable(wmWindowManager *wm)
+void wm_window_clear_drawable(wmWindowManager *wm)
 {
if (wm->windrawable) {
BLF_batch_reset();
diff --git a/source/blender/windowmanager/wm_window.h 
b/source/blender/windowmanager/wm_window.h
index 385d61217ad..4fd5d66fb43 100644
--- a/source/blender/windowmanager/wm_window.h
+++ b/source/blender/windowmanager/wm_window.h
@@ -57,6 +57,7 @@ void  wm_window_ghostwindows_remove_invalid(bContext 
*C, wmWindowManager *wm);
 void   wm_window_process_events(const bContext *C);
 void   wm_window_process_events_nosleep(void);
 
+void   wm_window_clear_drawable(wmWindowManager *wm);
 void   wm_window_make_drawable(wmWindowManager *wm, wmWindow *win);
 void   wm_window_reset_drawable(void);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [adbccae4b48] blender2.8: Merge branch 'master' into blender2.8

2018-07-23 Thread Bastien Montagne
Commit: adbccae4b48acdf58d8b715be660ba522a5dfad6
Author: Bastien Montagne
Date:   Mon Jul 23 17:52:52 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBadbccae4b48acdf58d8b715be660ba522a5dfad6

Merge branch 'master' into blender2.8

Note: Moved doversion of VSE strips uniquename to 2.8 versionning area,
and raised accordingly current file subversion, since that bug also
affected previous 2.8 .blend files...

Conflicts:
source/blender/blenkernel/BKE_blender_version.h

===



===

diff --cc source/blender/blenkernel/BKE_blender_version.h
index 8707fe3e11b,16115203294..79ae904c73d
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@@ -27,11 -27,11 +27,11 @@@
  /* these lines are grep'd, watch out for our not-so-awesome regex
   * and keep comment above the defines.
   * Use STRINGIFY() rather than defining with quotes */
 -#define BLENDER_VERSION 279
 -#define BLENDER_SUBVERSION  6
 -/* Several breakages with 270, e.g. constraint deg vs rad */
 -#define BLENDER_MINVERSION  270
 -#define BLENDER_MINSUBVERSION   6
 +#define BLENDER_VERSION 280
- #define BLENDER_SUBVERSION  20
++#define BLENDER_SUBVERSION  21
 +/* Several breakages with 280, e.g. collections vs layers */
 +#define BLENDER_MINVERSION  280
 +#define BLENDER_MINSUBVERSION   0
  
  /* used by packaging tools */
  /* can be left blank, otherwise a,b,c... etc with no quotes */
diff --cc source/blender/blenloader/intern/versioning_250.c
index 973591c49da,28720ef5145..4b628bf816a
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@@ -1028,11 -1309,9 +1014,7 @@@ void blo_do_versions_250(FileData *fd, 
while (sce) {
if (sce->r.frame_step == 0)
sce->r.frame_step = 1;
 -  if (sce->r.mblur_samples == 0)
 -  sce->r.mblur_samples = sce->r.osa;
  
-   if (sce->ed && sce->ed->seqbase.first) {
-   
do_versions_seq_unique_name_all_strips(sce, &sce->ed->seqbase);
-   }
- 
sce = sce->id.next;
}
}
diff --cc source/blender/blenloader/intern/versioning_280.c
index 6ac7c719952,000..79ae95e96e4
mode 100644,00..100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -1,1623 -1,0 +1,1644 @@@
 +/*
 + * * BEGIN GPL LICENSE BLOCK *
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * as published by the Free Software Foundation; either version 2
 + * of the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software Foundation,
 + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 + *
 + * Contributor(s): Dalai Felinto
 + *
 + * * END GPL LICENSE BLOCK *
 + *
 + */
 +
 +/** \file blender/blenloader/intern/versioning_280.c
 + *  \ingroup blenloader
 + */
 +
 +/* allow readfile to use deprecated functionality */
 +#define DNA_DEPRECATED_ALLOW
 +
 +#include 
 +#include 
 +
 +#include "BLI_listbase.h"
 +#include "BLI_math.h"
 +#include "BLI_mempool.h"
 +#include "BLI_string.h"
 +#include "BLI_string_utf8.h"
 +#include "BLI_utildefines.h"
 +
 +#include "DNA_object_types.h"
 +#include "DNA_camera_types.h"
 +#include "DNA_constraint_types.h"
 +#include "DNA_gpu_types.h"
 +#include "DNA_group_types.h"
 +#include "DNA_lamp_types.h"
 +#include "DNA_layer_types.h"
 +#include "DNA_lightprobe_types.h"
 +#include "DNA_material_types.h"
 +#include "DNA_mesh_types.h"
 +#include "DNA_particle_types.h"
 +#include "DNA_rigidbody_types.h"
 +#include "DNA_scene_types.h"
 +#include "DNA_screen_types.h"
 +#include "DNA_view3d_types.h"
 +#include "DNA_genfile.h"
 +#include "DNA_workspace_types.h"
 +
 +#include "BKE_collection.h"
 +#include "BKE_constraint.h"
 +#include "BKE_customdata.h"
 +#include "BKE_freestyle.h"
 +#include "BKE_idprop.h"
 +#include "BKE_image.h"
 +#include "BKE_layer.h"
 +#include "BKE_main.h"
 +#include "BKE_mesh.h"
 +#include "BKE_node.h"
 +#include "BKE_pointcache.h"
 +#include "BKE_report.h"
 +#include "BKE_scene.h"
 +#include "BKE_screen.h"
 +#include "BKE_studiolight.h"
 +#in

[Bf-blender-cvs] [7d6776ba2da] blender2.8: Fix missing header include in previous master merge.

2018-07-23 Thread Bastien Montagne
Commit: 7d6776ba2da7dbac3d80ccef28becf311f93a745
Author: Bastien Montagne
Date:   Mon Jul 23 18:37:29 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB7d6776ba2da7dbac3d80ccef28becf311f93a745

Fix missing header include in previous master merge.

===

M   source/blender/blenloader/intern/versioning_280.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 79ae95e96e4..edeefe35567 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -70,6 +70,7 @@
 #include "BKE_report.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
+#include "BKE_sequencer.h"
 #include "BKE_studiolight.h"
 #include "BKE_workspace.h"

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c28a37b5d1c] blender2.8: UI: Fix flicker in File Browser header

2018-07-23 Thread Pablo Vazquez
Commit: c28a37b5d1ce9ee63e8fb744c759711ba594f434
Author: Pablo Vazquez
Date:   Mon Jul 23 18:41:12 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc28a37b5d1ce9ee63e8fb744c759711ba594f434

UI: Fix flicker in File Browser header

Move running jobs to the beginning of the row.

Thanks @sergey for reporting

===

M   release/scripts/startup/bl_ui/space_filebrowser.py

===

diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py 
b/release/scripts/startup/bl_ui/space_filebrowser.py
index 9d903829bbb..a85dd591b2f 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -56,6 +56,8 @@ class FILEBROWSER_HT_header(Header):
 
 layout.separator_spacer()
 
+layout.template_running_jobs()
+
 if params:
 layout.prop(params, "use_filter", text="", icon='FILTER')
 
@@ -86,8 +88,6 @@ class FILEBROWSER_HT_header(Header):
 row.separator()
 row.prop(params, "filter_search", text="", icon='VIEWZOOM')
 
-layout.template_running_jobs()
-
 
 class FILEBROWSER_UL_dir(UIList):
 def draw_item(self, context, layout, data, item, icon, active_data, 
active_propname, index):

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a50e23ba791] blender2.8: Fix compilation issue after merge.

2018-07-23 Thread Clément Foucault
Commit: a50e23ba791d3a3489c65321d85e567684e89b31
Author: Clément Foucault
Date:   Mon Jul 23 18:56:24 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBa50e23ba791d3a3489c65321d85e567684e89b31

Fix compilation issue after merge.

===

M   source/blender/blenloader/intern/versioning_280.c

===

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index edeefe35567..3a586e49ab3 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1213,7 +1213,6 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
 
scene->eevee.flag =
SCE_EEVEE_VOLUMETRIC_LIGHTS |
-   SCE_EEVEE_VOLUMETRIC_COLORED |
SCE_EEVEE_GTAO_BENT_NORMALS |
SCE_EEVEE_GTAO_BOUNCE |
SCE_EEVEE_TAA_REPROJECTION |
@@ -1271,7 +1270,6 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
EEVEE_GET_BOOL(props, volumetric_enable, 
SCE_EEVEE_VOLUMETRIC_ENABLED);
EEVEE_GET_BOOL(props, volumetric_lights, 
SCE_EEVEE_VOLUMETRIC_LIGHTS);
EEVEE_GET_BOOL(props, volumetric_shadows, 
SCE_EEVEE_VOLUMETRIC_SHADOWS);
-   EEVEE_GET_BOOL(props, 
volumetric_colored_transmittance, SCE_EEVEE_VOLUMETRIC_COLORED);
EEVEE_GET_BOOL(props, gtao_enable, 
SCE_EEVEE_GTAO_ENABLED);
EEVEE_GET_BOOL(props, gtao_use_bent_normals, 
SCE_EEVEE_GTAO_BENT_NORMALS);
EEVEE_GET_BOOL(props, gtao_bounce, 
SCE_EEVEE_GTAO_BOUNCE);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a6a2c045a9b] experimental-build: Merge remote-tracking branch 'origin/blender2.8' into experimental-build

2018-07-23 Thread Lukas Stockner
Commit: a6a2c045a9bec2432067895d250ec3191bbc1b41
Author: Lukas Stockner
Date:   Mon Jul 23 19:01:25 2018 +0200
Branches: experimental-build
https://developer.blender.org/rBa6a2c045a9bec2432067895d250ec3191bbc1b41

Merge remote-tracking branch 'origin/blender2.8' into experimental-build

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0fc72070fe6] experimental-build: Squashed UDIM changes

2018-07-23 Thread Lukas Stockner
Commit: 0fc72070fe6b2008e8c286658a59a2203f2c8553
Author: Lukas Stockner
Date:   Mon Jul 23 19:02:38 2018 +0200
Branches: experimental-build
https://developer.blender.org/rB0fc72070fe6b2008e8c286658a59a2203f2c8553

Squashed UDIM changes

===

M   intern/cycles/blender/blender_mesh.cpp
M   intern/cycles/blender/blender_session.cpp
M   intern/cycles/blender/blender_session.h
M   intern/cycles/blender/blender_shader.cpp
M   intern/cycles/blender/blender_sync.cpp
M   intern/cycles/blender/blender_util.h
M   intern/cycles/kernel/svm/svm.h
M   intern/cycles/kernel/svm/svm_image.h
M   intern/cycles/render/graph.cpp
M   intern/cycles/render/graph.h
M   intern/cycles/render/image.cpp
M   intern/cycles/render/image.h
M   intern/cycles/render/light.cpp
M   intern/cycles/render/mesh.cpp
M   intern/cycles/render/mesh.h
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h
M   intern/cycles/render/scene.h
M   intern/cycles/render/shader.cpp
M   release/scripts/addons
M   release/scripts/addons_contrib
M   release/scripts/startup/bl_ui/space_image.py
M   source/blender/blenfont/BLF_api.h
M   source/blender/blenfont/intern/blf.c
M   source/blender/blenkernel/BKE_image.h
M   source/blender/blenkernel/intern/bpath.c
M   source/blender/blenkernel/intern/image.c
M   source/blender/blenkernel/intern/packedFile.c
M   source/blender/blenlib/BLI_math_vector.h
M   source/blender/blenlib/intern/math_vector_inline.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/compositor/operations/COM_ViewerOperation.cpp
M   source/blender/draw/engines/workbench/workbench_deferred.c
M   source/blender/draw/engines/workbench/workbench_forward.c
M   source/blender/draw/engines/workbench/workbench_materials.c
M   source/blender/draw/engines/workbench/workbench_private.h
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_cache.h
M   source/blender/draw/intern/draw_cache_impl.h
M   source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/draw/intern/draw_manager_data.c
M   source/blender/draw/modes/paint_texture_mode.c
M   source/blender/editors/include/ED_image.h
M   source/blender/editors/include/ED_paint.h
M   source/blender/editors/include/ED_screen.h
M   source/blender/editors/interface/interface_ops.c
M   source/blender/editors/object/object_bake_api.c
M   source/blender/editors/render/render_preview.c
M   source/blender/editors/screen/area.c
M   source/blender/editors/sculpt_paint/paint_image.c
M   source/blender/editors/sculpt_paint/paint_image_2d.c
M   source/blender/editors/sculpt_paint/paint_image_proj.c
M   source/blender/editors/sculpt_paint/paint_intern.h
M   source/blender/editors/space_clip/clip_draw.c
M   source/blender/editors/space_image/image_buttons.c
M   source/blender/editors/space_image/image_draw.c
M   source/blender/editors/space_image/image_edit.c
M   source/blender/editors/space_image/image_intern.h
M   source/blender/editors/space_image/image_ops.c
M   source/blender/editors/space_image/space_image.c
M   source/blender/gpu/GPU_material.h
M   source/blender/gpu/intern/gpu_codegen.c
M   source/blender/gpu/intern/gpu_codegen.h
M   source/blender/gpu/intern/gpu_draw.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/imbuf/IMB_moviecache.h
M   source/blender/imbuf/intern/moviecache.c
M   source/blender/makesdna/DNA_color_types.h
M   source/blender/makesdna/DNA_image_types.h
M   source/blender/makesdna/DNA_space_types.h
M   source/blender/makesrna/intern/rna_image.c
M   source/blender/makesrna/intern/rna_image_api.c
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/nodes/shader/nodes/node_shader_tex_environment.c
M   source/blender/nodes/shader/nodes/node_shader_tex_image.c

===

diff --git a/intern/cycles/blender/blender_mesh.cpp 
b/intern/cycles/blender/blender_mesh.cpp
index 08206dd5521..edb6d04f0bb 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -348,6 +348,7 @@ static void create_mesh_volume_attribute(BL::Object& b_ob,
Attribute::standard_name(std),
b_ob.ptr.data,
animated,
+   0,
frame,
INTERPOLATION_LINEAR,
EXTENSION_CLIP,
diff --git a/intern/cycles/blender/blender_session.cpp 
b/intern/cycles/blender/blender_session.cpp
index cd55155e33b..1f5d67e4064 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycl

[Bf-blender-cvs] [3de43882522] experimental-build: Revert "Squashed UDIM changes"

2018-07-23 Thread Lukas Stockner
Commit: 3de438825228f4d7639e278e9022b0deb8eda21c
Author: Lukas Stockner
Date:   Mon Jul 23 19:03:00 2018 +0200
Branches: experimental-build
https://developer.blender.org/rB3de438825228f4d7639e278e9022b0deb8eda21c

Revert "Squashed UDIM changes"

This reverts commit 0fc72070fe6b2008e8c286658a59a2203f2c8553.

===

M   intern/cycles/blender/blender_mesh.cpp
M   intern/cycles/blender/blender_session.cpp
M   intern/cycles/blender/blender_session.h
M   intern/cycles/blender/blender_shader.cpp
M   intern/cycles/blender/blender_sync.cpp
M   intern/cycles/blender/blender_util.h
M   intern/cycles/kernel/svm/svm.h
M   intern/cycles/kernel/svm/svm_image.h
M   intern/cycles/render/graph.cpp
M   intern/cycles/render/graph.h
M   intern/cycles/render/image.cpp
M   intern/cycles/render/image.h
M   intern/cycles/render/light.cpp
M   intern/cycles/render/mesh.cpp
M   intern/cycles/render/mesh.h
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h
M   intern/cycles/render/scene.h
M   intern/cycles/render/shader.cpp
M   release/scripts/addons
M   release/scripts/addons_contrib
M   release/scripts/startup/bl_ui/space_image.py
M   source/blender/blenfont/BLF_api.h
M   source/blender/blenfont/intern/blf.c
M   source/blender/blenkernel/BKE_image.h
M   source/blender/blenkernel/intern/bpath.c
M   source/blender/blenkernel/intern/image.c
M   source/blender/blenkernel/intern/packedFile.c
M   source/blender/blenlib/BLI_math_vector.h
M   source/blender/blenlib/intern/math_vector_inline.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/compositor/operations/COM_ViewerOperation.cpp
M   source/blender/draw/engines/workbench/workbench_deferred.c
M   source/blender/draw/engines/workbench/workbench_forward.c
M   source/blender/draw/engines/workbench/workbench_materials.c
M   source/blender/draw/engines/workbench/workbench_private.h
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_cache.h
M   source/blender/draw/intern/draw_cache_impl.h
M   source/blender/draw/intern/draw_cache_impl_mesh.c
M   source/blender/draw/intern/draw_manager_data.c
M   source/blender/draw/modes/paint_texture_mode.c
M   source/blender/editors/include/ED_image.h
M   source/blender/editors/include/ED_paint.h
M   source/blender/editors/include/ED_screen.h
M   source/blender/editors/interface/interface_ops.c
M   source/blender/editors/object/object_bake_api.c
M   source/blender/editors/render/render_preview.c
M   source/blender/editors/screen/area.c
M   source/blender/editors/sculpt_paint/paint_image.c
M   source/blender/editors/sculpt_paint/paint_image_2d.c
M   source/blender/editors/sculpt_paint/paint_image_proj.c
M   source/blender/editors/sculpt_paint/paint_intern.h
M   source/blender/editors/space_clip/clip_draw.c
M   source/blender/editors/space_image/image_buttons.c
M   source/blender/editors/space_image/image_draw.c
M   source/blender/editors/space_image/image_edit.c
M   source/blender/editors/space_image/image_intern.h
M   source/blender/editors/space_image/image_ops.c
M   source/blender/editors/space_image/space_image.c
M   source/blender/gpu/GPU_material.h
M   source/blender/gpu/intern/gpu_codegen.c
M   source/blender/gpu/intern/gpu_codegen.h
M   source/blender/gpu/intern/gpu_draw.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/imbuf/IMB_moviecache.h
M   source/blender/imbuf/intern/moviecache.c
M   source/blender/makesdna/DNA_color_types.h
M   source/blender/makesdna/DNA_image_types.h
M   source/blender/makesdna/DNA_space_types.h
M   source/blender/makesrna/intern/rna_image.c
M   source/blender/makesrna/intern/rna_image_api.c
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/nodes/shader/nodes/node_shader_tex_environment.c
M   source/blender/nodes/shader/nodes/node_shader_tex_image.c

===

diff --git a/intern/cycles/blender/blender_mesh.cpp 
b/intern/cycles/blender/blender_mesh.cpp
index edb6d04f0bb..08206dd5521 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -348,7 +348,6 @@ static void create_mesh_volume_attribute(BL::Object& b_ob,
Attribute::standard_name(std),
b_ob.ptr.data,
animated,
-   0,
frame,
INTERPOLATION_LINEAR,
EXTENSION_CLIP,
diff --git a/intern/cycles/blender/blender_session.cpp 
b/intern/cycles/blender/blender_session.cpp
index 1f5d67e4064..cd55155e33b 

[Bf-blender-cvs] [f6eccd367cf] blender2.8: Subsurf: Subdivide polygons to the same resolution

2018-07-23 Thread Sergey Sharybin
Commit: f6eccd367cf7ef504ebeef332b62a86d928f5542
Author: Sergey Sharybin
Date:   Mon Jul 23 18:40:04 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf6eccd367cf7ef504ebeef332b62a86d928f5542

Subsurf: Subdivide polygons to the same resolution

Previously it was ptex faces which were subdividing to the same
resolution. This was looking like more details for non-quad faces,
but was also causing discontinuity in the edge where quad touches
non-quad polygon.

Now ptex faces which are coming from non-quad faces are subdivided
at a half of resolution, matching old behavior and solving
discontinuity problem.

===

M   source/blender/blenkernel/BKE_subdiv.h
M   source/blender/blenkernel/intern/subdiv.c
M   source/blender/blenkernel/intern/subdiv_mesh.c

===

diff --git a/source/blender/blenkernel/BKE_subdiv.h 
b/source/blender/blenkernel/BKE_subdiv.h
index a1792866255..003dc7a37d3 100644
--- a/source/blender/blenkernel/BKE_subdiv.h
+++ b/source/blender/blenkernel/BKE_subdiv.h
@@ -94,26 +94,6 @@ typedef struct Subdiv {
 */
SubdivSettings settings;
 
-   /* Total number of ptex faces on subdivision level 0.
-*
-* Ptex face is what is internally used by OpenSubdiv for evaluator. It 
is
-* a quad face, which corresponds to Blender's legacy Catmull Clark 
grids.
-*
-* Basically, here is a correspondence between polygons and ptex faces:
-* - Triangle consists of 3 PTex faces.
-* - Quad is a single PTex face.
-* - N-gon is N PTex faces.
-*
-* This value is initialized in BKE_subdiv_new_from_FOO() and is 
read-only
-* after this.
-*/
-   int num_ptex_faces;
-
-   /* Indexed by base face index, element indicates total number of ptex 
faces
-* created for preceding base faces.
-*/
-   int *face_ptex_offset;
-
/* Topology refiner includes all the glue logic to feed Blender side
 * topology to OpenSubdiv. It can be shared by both evaluator and GL 
mesh
 * drawer.
diff --git a/source/blender/blenkernel/intern/subdiv.c 
b/source/blender/blenkernel/intern/subdiv.c
index 794da2d3477..0bf969b7de2 100644
--- a/source/blender/blenkernel/intern/subdiv.c
+++ b/source/blender/blenkernel/intern/subdiv.c
@@ -42,23 +42,6 @@
 #  include "opensubdiv_topology_refiner_capi.h"
 #endif
 
-#ifdef WITH_OPENSUBDIV
-static void update_subdiv_after_topology_change(Subdiv *subdiv)
-{
-   /* Count ptex faces. */
-   subdiv->num_ptex_faces = subdiv->topology_refiner->getNumPtexFaces(
-   subdiv->topology_refiner);
-   /* Initialize offset of base faces in ptex indices. */
-   MEM_SAFE_FREE(subdiv->face_ptex_offset);
-   subdiv->face_ptex_offset = MEM_malloc_arrayN(subdiv->num_ptex_faces,
-sizeof(int),
-"subdiv ptex offset");
-   subdiv->topology_refiner->fillFacePtexIndexOffset(
-   subdiv->topology_refiner,
-   subdiv->face_ptex_offset);
-}
-#endif
-
 Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings *settings,
   struct OpenSubdiv_Converter *converter)
 {
@@ -79,7 +62,6 @@ Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings 
*settings,
subdiv->settings = *settings;
subdiv->topology_refiner = osd_topology_refiner;
subdiv->evaluator = NULL;
-   update_subdiv_after_topology_change(subdiv);
BKE_subdiv_stats_end(&stats, 
SUBDIV_STATS_TOPOLOGY_REFINER_CREATION_TIME);
subdiv->stats = stats;
return subdiv;
@@ -113,7 +95,6 @@ void BKE_subdiv_free(Subdiv *subdiv)
if (subdiv->topology_refiner != NULL) {
openSubdiv_deleteTopologyRefiner(subdiv->topology_refiner);
}
-   MEM_SAFE_FREE(subdiv->face_ptex_offset);
MEM_freeN(subdiv);
 #endif
 }
diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c 
b/source/blender/blenkernel/intern/subdiv_mesh.c
index 83f2069ea0f..eb47d9158d3 100644
--- a/source/blender/blenkernel/intern/subdiv_mesh.c
+++ b/source/blender/blenkernel/intern/subdiv_mesh.c
@@ -38,27 +38,40 @@
 
 #include "BKE_mesh.h"
 
-/* TODO(sergey): Somehow move this to subdiv code? */
-static int mpoly_ptex_faces_count_get(const MPoly *mp)
+#include "MEM_guardedalloc.h"
+
+/* 
=
+ * General helpers.
+ */
+
+/* Number of ptex faces for a given polygon. */
+BLI_INLINE int num_ptex_faces_per_poly_get(const MPoly *poly)
 {
-   if (mp->totloop == 4) {
-   return 1;
-   }
-   else {
-   return mp->totloop;
-   }
+   return (poly->totloop == 4) ? 1 : poly->totloop;
 }
 
-static int num_edges_per_ptex_get(const int resolution)

[Bf-blender-cvs] [b466c09c305] blender2.8: Subsurf: Fix wrong vertices index in vertex data interpolation

2018-07-23 Thread Sergey Sharybin
Commit: b466c09c305dfafbe3d15d6564c34f9f874ac0ad
Author: Sergey Sharybin
Date:   Mon Jul 23 19:09:16 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb466c09c305dfafbe3d15d6564c34f9f874ac0ad

Subsurf: Fix wrong vertices index in vertex data interpolation

===

M   source/blender/blenkernel/intern/subdiv_mesh.c

===

diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c 
b/source/blender/blenkernel/intern/subdiv_mesh.c
index eb47d9158d3..ad2e094fa48 100644
--- a/source/blender/blenkernel/intern/subdiv_mesh.c
+++ b/source/blender/blenkernel/intern/subdiv_mesh.c
@@ -355,7 +355,7 @@ static void vertex_interpolation_init(
int *indices = BLI_array_alloca(indices, coarse_poly->totloop);
for (int i = 0; i < coarse_poly->totloop; ++i) {
weights[i] = weight;
-   indices[i] = coarse_poly->loopstart + i;
+   indices[i] = coarse_mloop[coarse_poly->loopstart + i].v;
}
CustomData_interp(&coarse_mesh->vdata,
  &vertex_interpolation->vertex_data_storage,
@@ -395,13 +395,15 @@ static void vertex_interpolation_from_ptex(
 * iteration.
 */
const float weights[2] = {0.5f, 0.5f};
+   const int first_loop_index = loops_of_ptex.first_loop - 
coarse_mloop;
+   const int last_loop_index = loops_of_ptex.last_loop - 
coarse_mloop;
const int first_indices[2] = {
-   coarse_mloop[loops_of_ptex.first_loop - coarse_mloop].v,
-   coarse_mloop[(loops_of_ptex.first_loop + 1 - 
coarse_mloop) %
-   coarse_poly->totloop].v};
-   const int last_indices[2] = {
-   coarse_mloop[loops_of_ptex.last_loop - coarse_mloop].v,
-   coarse_mloop[loops_of_ptex.first_loop - 
coarse_mloop].v};
+   coarse_mloop[first_loop_index].v,
+   coarse_mloop[coarse_poly->loopstart +
+   (first_loop_index - coarse_poly->loopstart + 1) 
%
+   coarse_poly->totloop].v};
+   const int last_indices[2] = {coarse_mloop[first_loop_index].v,
+coarse_mloop[last_loop_index].v};
CustomData_interp(vertex_data,
  &vertex_interpolation->vertex_data_storage,
  first_indices,

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0b99dc1b25d] greasepencil-object: Fix duplication error for Brushes

2018-07-23 Thread Antonio Vazquez
Commit: 0b99dc1b25db6ddd79209ddbd5924755b71a4613
Author: Antonio Vazquez
Date:   Mon Jul 23 17:06:54 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0b99dc1b25db6ddd79209ddbd5924755b71a4613

Fix duplication error for Brushes

This produced an error when create a new brush and a memory leak when closed 
Blender.

===

M   source/blender/blenkernel/intern/brush.c

===

diff --git a/source/blender/blenkernel/intern/brush.c 
b/source/blender/blenkernel/intern/brush.c
index b7ebac2523a..598eb9b5b54 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -562,9 +562,12 @@ void BKE_brush_copy_data(Main *UNUSED(bmain), Brush 
*brush_dst, const Brush *bru
}
 
brush_dst->curve = curvemapping_copy(brush_src->curve);
-   brush_dst->gpencil_settings->curve_sensitivity = 
curvemapping_copy(brush_src->gpencil_settings->curve_sensitivity);
-   brush_dst->gpencil_settings->curve_strength = 
curvemapping_copy(brush_src->gpencil_settings->curve_strength);
-   brush_dst->gpencil_settings->curve_jitter = 
curvemapping_copy(brush_src->gpencil_settings->curve_jitter);
+   if (brush_src->gpencil_settings != NULL) {
+   brush_dst->gpencil_settings = 
MEM_dupallocN(brush_src->gpencil_settings);
+   brush_dst->gpencil_settings->curve_sensitivity = 
curvemapping_copy(brush_src->gpencil_settings->curve_sensitivity);
+   brush_dst->gpencil_settings->curve_strength = 
curvemapping_copy(brush_src->gpencil_settings->curve_strength);
+   brush_dst->gpencil_settings->curve_jitter = 
curvemapping_copy(brush_src->gpencil_settings->curve_jitter);
+   }
 
/* enable fake user by default */
id_fake_user_set(&brush_dst->id);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [0050fc1cb53] greasepencil-object: UI: Improve brush toolbar

2018-07-23 Thread Antonio Vazquez
Commit: 0050fc1cb53cc59dd711bbe650bb1a5afdaccba3
Author: Antonio Vazquez
Date:   Mon Jul 23 20:27:20 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0050fc1cb53cc59dd711bbe650bb1a5afdaccba3

UI: Improve brush toolbar

This is a temp solution to show all brushes and sort by use, not alphabetical.

This will be replace when new tool bar system is in place.

===

M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index ca276d978ed..9eef7265a56 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -59,35 +59,41 @@ def generate_from_brushes_ex(
 )
 )
 else:
-for brush in context.blend_data.brushes:
-if getattr(brush, brush_test_attr):
-category = getattr(brush.gpencil_settings, brush_category_attr)
-name = brush.name
-if name.startswith("Draw "):
-text = name.replace("Draw ", "")
-icon_name = brush.name.lower().replace(" ", "_")
-elif name.startswith("Eraser "):
-text = name.replace("Eraser ", "")
-icon_name = "draw." + brush.name.lower().replace(" ", "_")
-elif name.startswith("Fill "):
-text = name.replace(" Area", "")
-icon_name = "draw_fill"
-else:
-text = name
-icon_name = "draw_pencil"
-
-brush_categories.setdefault(category, []).append(
-ToolDef.from_dict(
-dict(
-text=text,
-icon=icon_prefix + icon_name,
-data_block=name,
-widget=None,
-operator="gpencil.draw",
-draw_settings=draw_settings,
+for e in brush_category_layout:
+main_brush = context.blend_data.brushes[e[0]]
+
+for brush in context.blend_data.brushes:
+if brush.name.startswith(main_brush.name) and getattr(brush, 
brush_test_attr):
+category = getattr(brush.gpencil_settings, 
brush_category_attr)
+name = brush.name
+if name.startswith("Draw "):
+text = name.replace("Draw ", "")
+icon_name = brush.name.lower().replace(" ", "_")
+elif name.startswith("Eraser "):
+text = name.replace("Eraser ", "")
+icon_name = "draw." + brush.name.lower().replace(" ", 
"_")
+elif name.startswith("Fill "):
+text = name.replace(" Area", "")
+icon_name = "draw_fill"
+else:
+text = name
+icon_name = "draw_pencil"
+
+if icon_name[-4:-3] == '.':
+icon_name = icon_name[:-4]
+
+brush_categories.setdefault(category, []).append(
+ToolDef.from_dict(
+dict(
+text=text,
+icon=icon_prefix + icon_name,
+data_block=name,
+widget=None,
+operator="gpencil.draw",
+draw_settings=draw_settings,
+)
 )
 )
-)
 
 def tools_from_brush_group(groups):
 assert(type(groups) is tuple)

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [8ad523b885e] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object

2018-07-23 Thread Antonio Vazquez
Commit: 8ad523b885e53ef13bf43f5e6cf3b0b1b1a3c4a9
Author: Antonio Vazquez
Date:   Mon Jul 23 20:28:04 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB8ad523b885e53ef13bf43f5e6cf3b0b1b1a3c4a9

Merge branch 'blender2.8' into greasepencil-object

===



===

diff --cc source/blender/blenloader/intern/versioning_280.c
index 908456a5498,3a586e49ab3..d26a89a77a3
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -73,11 -70,9 +73,12 @@@
  #include "BKE_report.h"
  #include "BKE_scene.h"
  #include "BKE_screen.h"
+ #include "BKE_sequencer.h"
  #include "BKE_studiolight.h"
  #include "BKE_workspace.h"
 +#include "BKE_gpencil.h"
 +#include "BKE_paint.h"
 +#include "BKE_object.h"
  
  #include "BLO_readfile.h"
  #include "readfile.h"
@@@ -757,9 -752,20 +758,21 @@@ void do_versions_after_linking_280(Mai
}
}
  #endif
 +
  }
  
+ /* NOTE: this version patch is intended for versions < 2.52.2, but was 
initially introduced in 2.27 already.
+  *   But in 2.79 another case generating non-unique names was discovered 
(see T55668, involving Meta strips)... */
+ static void do_versions_seq_unique_name_all_strips(Scene *sce, ListBase 
*seqbasep)
+ {
+   for (Sequence *seq = seqbasep->first; seq != NULL; seq = seq->next) {
+   BKE_sequence_base_unique_name_recursive(&sce->ed->seqbase, seq);
+   if (seq->seqbase.first != NULL) {
+   do_versions_seq_unique_name_all_strips(sce, 
&seq->seqbase);
+   }
+   }
+ }
+ 
  void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
  {
bool use_collection_compat_28 = true;
@@@ -1709,20 -1638,6 +1726,21 @@@

BKE_screen_view3d_shading_init(&scene->display.shading);
}
}
 +  /* initialize grease pencil view data */
 +  if (!DNA_struct_elem_find(fd->filesdna, "SpaceView3D", "float", 
"vertex_opacity")) {
 +  for (bScreen *sc = bmain->screen.first; sc; sc = 
sc->id.next) {
 +  for (ScrArea *sa = sc->areabase.first; sa; sa = 
sa->next) {
 +  for (SpaceLink *sl = 
sa->spacedata.first; sl; sl = sl->next) {
 +  if (sl->spacetype == 
SPACE_VIEW3D) {
 +  View3D *v3d = (View3D 
*)sl;
 +  v3d->vertex_opacity = 
1.0f;
 +  v3d->flag3 |= 
V3D_GP_SHOW_EDIT_LINES;
 +  }
 +  }
 +  }
 +  }
 +  }
 +
}
+ 
  }

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [d3c463b6f5c] greasepencil-object: Fix duplicate Brush in tool bar

2018-07-23 Thread Antonio Vazquez
Commit: d3c463b6f5cde5a25073c2831ef5a8c0697064e3
Author: Antonio Vazquez
Date:   Mon Jul 23 21:17:50 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBd3c463b6f5cde5a25073c2831ef5a8c0697064e3

Fix duplicate Brush in tool bar

===

M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 9eef7265a56..0d2d6445203 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -63,7 +63,10 @@ def generate_from_brushes_ex(
 main_brush = context.blend_data.brushes[e[0]]
 
 for brush in context.blend_data.brushes:
-if brush.name.startswith(main_brush.name) and getattr(brush, 
brush_test_attr):
+bname = brush.name
+if bname[-4:-3] == '.':
+bname = bname[:-4]
+if bname == main_brush.name and getattr(brush, 
brush_test_attr):
 category = getattr(brush.gpencil_settings, 
brush_category_attr)
 name = brush.name
 if name.startswith("Draw "):

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [3f7d07ac971] soc-2018-npr: Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr

2018-07-23 Thread Nick Wu
Commit: 3f7d07ac971088efc5ce51c586f1940e6d12ded5
Author: Nick Wu
Date:   Tue Jul 24 10:12:03 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB3f7d07ac971088efc5ce51c586f1940e6d12ded5

Merge remote-tracking branch 'remotes/origin/blender2.8' into soc-2018-npr

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [4d978cc2e49] master: Cleanup: changes from 2.8

2018-07-23 Thread Campbell Barton
Commit: 4d978cc2e496eb0287b3b828ac105bb767da4bb4
Author: Campbell Barton
Date:   Tue Jul 24 13:54:25 2018 +1000
Branches: master
https://developer.blender.org/rB4d978cc2e496eb0287b3b828ac105bb767da4bb4

Cleanup: changes from 2.8

===

M   source/blender/blenlib/intern/hash_mm3.c
M   source/blender/compositor/nodes/COM_CryptomatteNode.cpp
M   source/blender/compositor/operations/COM_CryptomatteOperation.cpp
M   source/blender/nodes/composite/nodes/node_composite_cryptomatte.c
M   source/blender/nodes/shader/nodes/node_shader_bsdf_hair_principled.c

===

diff --git a/source/blender/blenlib/intern/hash_mm3.c 
b/source/blender/blenlib/intern/hash_mm3.c
index 5ead9ceca63..105c1f46832 100644
--- a/source/blender/blenlib/intern/hash_mm3.c
+++ b/source/blender/blenlib/intern/hash_mm3.c
@@ -92,7 +92,7 @@ BLI_INLINE uint64_t fmix64(uint64_t k)
 
 uint32_t BLI_hash_mm3(const unsigned char *in, size_t len, uint32_t seed)
 {
-   const uint8_t *data = (const uint8_t*)in;
+   const uint8_t *data = (const uint8_t *)in;
const int nblocks = len / 4;
 
uint32_t h1 = seed;
@@ -102,23 +102,23 @@ uint32_t BLI_hash_mm3(const unsigned char *in, size_t 
len, uint32_t seed)
 
/* body */
 
-   const uint32_t *blocks = (const uint32_t *)(data + nblocks*4);
+   const uint32_t *blocks = (const uint32_t *)(data + nblocks * 4);
 
for (int i = -nblocks; i; i++) {
-   uint32_t k1 = getblock32(blocks,i);
+   uint32_t k1 = getblock32(blocks, i);
 
k1 *= c1;
-   k1 = ROTL32(k1,15);
+   k1 = ROTL32(k1, 15);
k1 *= c2;
 
h1 ^= k1;
-   h1 = ROTL32(h1,13);
-   h1 = h1*5+0xe6546b64;
+   h1 = ROTL32(h1, 13);
+   h1 = h1 * 5 + 0xe6546b64;
}
 
/* tail */
 
-   const uint8_t *tail = (const uint8_t*)(data + nblocks*4);
+   const uint8_t *tail = (const uint8_t *)(data + nblocks * 4);
 
uint32_t k1 = 0;
 
@@ -132,10 +132,10 @@ uint32_t BLI_hash_mm3(const unsigned char *in, size_t 
len, uint32_t seed)
case 1:
k1 ^= tail[0];
k1 *= c1;
-   k1 = ROTL32(k1,15);
+   k1 = ROTL32(k1, 15);
k1 *= c2;
h1 ^= k1;
-   };
+   }
 
/* finalization */
 
diff --git a/source/blender/compositor/nodes/COM_CryptomatteNode.cpp 
b/source/blender/compositor/nodes/COM_CryptomatteNode.cpp
index bc115e66c20..5ed66fe45e7 100644
--- a/source/blender/compositor/nodes/COM_CryptomatteNode.cpp
+++ b/source/blender/compositor/nodes/COM_CryptomatteNode.cpp
@@ -62,7 +62,7 @@ void CryptomatteNode::convertToOperations(NodeConverter 
&converter, const Compos
bNode *node = this->getbNode();
NodeCryptomatte *cryptoMatteSettings = (NodeCryptomatte *)node->storage;
 
-   CryptomatteOperation *operation = new 
CryptomatteOperation(getNumberOfInputSockets()-1);
+   CryptomatteOperation *operation = new 
CryptomatteOperation(getNumberOfInputSockets() - 1);
if (cryptoMatteSettings) {
if (cryptoMatteSettings->matte_id) {
/* Split the string by commas, ignoring white space. */
@@ -83,7 +83,7 @@ void CryptomatteNode::convertToOperations(NodeConverter 
&converter, const Compos

operation->addObjectIndex(atof(token.substr(1, token.length() - 2).c_str()));
}
else {
-   uint32_t hash = 
BLI_hash_mm3((const unsigned char*)token.c_str(), token.length(), 0);
+   uint32_t hash = 
BLI_hash_mm3((const unsigned char *)token.c_str(), token.length(), 0);

operation->addObjectIndex(hash_to_float(hash));
}
}
@@ -93,7 +93,7 @@ void CryptomatteNode::convertToOperations(NodeConverter 
&converter, const Compos
 
converter.addOperation(operation);
 
-   for (int i = 0; i < getNumberOfInputSockets()-1; ++i) {
+   for (int i = 0; i < getNumberOfInputSockets() - 1; ++i) {
converter.mapInputSocket(this->getInputSocket(i + 1), 
operation->getInputSocket(i));
}
 
diff --git a/source/blender/compositor/operations/COM_CryptomatteOperation.cpp 
b/source/blender/compositor/operations/COM_CryptomatteOperation.cpp
index 9dd36863d37..f3fa81075c6 100644
--- a/source/blender/compositor/operations/COM_CryptomatteOperation.cpp
+++ b/source/blender/compositor/operations/COM_CryptomatteOperation.cpp
@@ -63,7 +63,7 @@ void CryptomatteOperation::executePixel(float output[4],
  

[Bf-blender-cvs] [d62a48411db] greasepencil-object: Cleanup: Remove need to set colors on each and every annotation point when drawing

2018-07-23 Thread Joshua Leung
Commit: d62a48411db16b74c0c2e6f87a544d0bdfdbbb9b
Author: Joshua Leung
Date:   Fri Jul 20 15:03:15 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rBd62a48411db16b74c0c2e6f87a544d0bdfdbbb9b

Cleanup: Remove need to set colors on each and every annotation point when 
drawing

===

M   source/blender/editors/gpencil/annotate_draw.c

===

diff --git a/source/blender/editors/gpencil/annotate_draw.c 
b/source/blender/editors/gpencil/annotate_draw.c
index 9e5556bffe9..159d840b9f3 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -90,36 +90,7 @@ typedef enum eDrawStrokeFlags {
 } eDrawStrokeFlags;
 
 
-/* conversion utility (float --> normalized unsigned byte) */
-#define F2UB(x) (uchar)(255.0f * x)
-
 /* - Tool Buffer Drawing -- */
-/* helper functions to set color of buffer point */
-// XXX: Remove these
-static void UNUSED_FUNCTION(gp_set_tpoint_varying_color)(
-const tGPspoint *UNUSED(pt), const float ink[4], uint attrib_id)
-{
-   float alpha = ink[3];
-   CLAMP(alpha, GPENCIL_STRENGTH_MIN, 1.0f);
-   immAttrib4ub(attrib_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), 
F2UB(alpha));
-}
-
-static void UNUSED_FUNCTION(gp_set_point_uniform_color)(
-const bGPDspoint *UNUSED(pt), const float ink[4])
-{
-   float alpha = ink[3];
-   CLAMP(alpha, GPENCIL_STRENGTH_MIN, 1.0f);
-   immUniformColor3fvAlpha(ink, alpha);
-}
-
-static void gp_set_point_varying_color(const bGPDspoint *UNUSED(pt), const 
float ink[4], uint attrib_id)
-{
-   float alpha = ink[3];
-   CLAMP(alpha, GPENCIL_STRENGTH_MIN, 1.0f);
-   immAttrib4ub(attrib_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), 
F2UB(alpha));
-}
-
-
 
 /* draw stroke defined in buffer (simple ogl lines/points for now, as dotted 
lines) */
 static void gp_draw_stroke_buffer(const tGPspoint *points, int totpoints, 
short thickness,
@@ -142,16 +113,15 @@ static void gp_draw_stroke_buffer(const tGPspoint 
*points, int totpoints, short
 
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, 
GPU_FETCH_INT_TO_FLOAT);
-   uint color = GPU_vertformat_attr_add(format, "color", GPU_COMP_U8, 4, 
GPU_FETCH_INT_TO_FLOAT_UNIT); // XXX: Just set once
 
const tGPspoint *pt = points;
 
if (totpoints == 1) {
/* if drawing a single point, draw it larger */
GPU_point_size((float)(thickness + 2) * points->pressure);
-   
immBindBuiltinProgram(GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR);
+   
immBindBuiltinProgram(GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA);
+   immUniformColor3fvAlpha(ink, ink[3]);
immBegin(GPU_PRIM_POINTS, 1);
-   immAttrib4ub(color, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), 
F2UB(ink[3]));
immVertex2iv(pos, &pt->x);
}
else {
@@ -159,10 +129,12 @@ static void gp_draw_stroke_buffer(const tGPspoint 
*points, int totpoints, short
 
/* draw stroke curve */
GPU_line_width(max_ff(oldpressure * thickness, 1.0));
-   immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
-   immBeginAtMost(GPU_PRIM_LINE_STRIP, totpoints);
+
+   immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+   immUniformColor3fvAlpha(ink, ink[3]);
 
/* TODO: implement this with a geometry shader to draw one 
continuous tapered stroke */
+   immBeginAtMost(GPU_PRIM_LINE_STRIP, totpoints);
 
for (int i = 0; i < totpoints; i++, pt++) {
/* if there was a significant pressure change, stop the 
curve, change the thickness of the stroke,
@@ -171,7 +143,6 @@ static void gp_draw_stroke_buffer(const tGPspoint *points, 
int totpoints, short
if (fabsf(pt->pressure - oldpressure) > 0.2f) {
/* need to have 2 points to avoid immEnd assert 
error */
if (draw_points < 2) {
-   immAttrib4ub(color, F2UB(ink[0]), 
F2UB(ink[1]), F2UB(ink[2]), F2UB(ink[3]));
immVertex2iv(pos, &(pt - 1)->x);
}
 
@@ -183,7 +154,6 @@ static void gp_draw_stroke_buffer(const tGPspoint *points, 
int totpoints, short
 
/* need to roll-back one point to ensure that 
there are no gaps in the stroke */
if (i != 0) {
-   immAttrib4ub(color, F2UB(ink[0]), 
F2UB(ink[1]), F2UB(ink[2]), F2UB(ink[3]));
immVertex2iv(pos, &(pt - 1)->x);
draw_points++;
   

[Bf-blender-cvs] [1b477901118] greasepencil-object: Cleanup: Whitespace

2018-07-23 Thread Joshua Leung
Commit: 1b47790111844fcd3204f55ad05a6829bf241a89
Author: Joshua Leung
Date:   Fri Jul 20 15:13:34 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rB1b47790111844fcd3204f55ad05a6829bf241a89

Cleanup: Whitespace

===

M   source/blender/gpu/intern/gpu_shader.c
M   source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl

===

diff --git a/source/blender/gpu/intern/gpu_shader.c 
b/source/blender/gpu/intern/gpu_shader.c
index 0ecce7fe6f3..23efb83a034 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -873,8 +873,8 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader 
shader)
  
datatoc_gpu_shader_2D_nodelink_frag_glsl },
 
[GPU_SHADER_GPENCIL_STROKE] = { 
datatoc_gpu_shader_gpencil_stroke_vert_glsl,
-   
datatoc_gpu_shader_gpencil_stroke_frag_glsl,
-   
datatoc_gpu_shader_gpencil_stroke_geom_glsl },
+   
datatoc_gpu_shader_gpencil_stroke_frag_glsl,
+   
datatoc_gpu_shader_gpencil_stroke_geom_glsl },
 
[GPU_SHADER_GPENCIL_FILL] = { 
datatoc_gpu_shader_gpencil_fill_vert_glsl,
  
datatoc_gpu_shader_gpencil_fill_frag_glsl },
diff --git a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl 
b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl
index 6e0c94f58af..3de1bd838b3 100644
--- a/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_gpencil_stroke_geom.glsl
@@ -74,7 +74,7 @@ void main(void)
vec2 miter_a = normalize(n0 + n1);  // miter at start of current 
segment
vec2 miter_b = normalize(n1 + n2);  // miter at end of current segment
 
-/* determine the length of the miter by projecting it onto normal and then 
inverse it */
+   /* determine the length of the miter by projecting it onto normal and 
then inverse it */
float an1 = dot(miter_a, n1);
float bn1 = dot(miter_b, n2);
if (an1 == 0) an1 = 1;

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [c8cf0e10e08] greasepencil-object: Annotations: Show "Stroke Placement" options in the topbar again

2018-07-23 Thread Joshua Leung
Commit: c8cf0e10e08203bb43d0c551c4ecb42a76886326
Author: Joshua Leung
Date:   Tue Jul 24 17:24:25 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rBc8cf0e10e08203bb43d0c551c4ecb42a76886326

Annotations: Show "Stroke Placement" options in the topbar again

We may have to introduce a dedicated setting here for use with the
annotation tools, since the GP Object version is quite different now.

===

M   release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

===

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 4b1b3cdbd62..f972c467182 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -119,7 +119,7 @@ class GreasePencilDrawingToolsPanel:
 col.separator()
 col.separator()
 
-if context.space_data.type in {'VIEW_3D', 'CLIP_EDITOR'}:
+if context.space_data.type in {'CLIP_EDITOR'}:
 col.separator()
 col.label("Data Source:")
 row = col.row(align=True)
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 6f3019d6fff..08cf388870d 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -176,7 +176,7 @@ class _defs_annotate:
 @classmethod
 def draw_settings_common(cls, context, layout, tool):
 user_prefs = context.user_preferences
-#tool_settings = context.tool_settings
+ts = context.tool_settings
 
 # XXX: These context checks are needed for layer-dependent settings,
 # but this breaks for using topbar for 2D editor active tools, etc.
@@ -190,6 +190,19 @@ class _defs_annotate:
 layout.prop(user_prefs.edit, "grease_pencil_default_color", 
text="Color")
 layout.label("Thickness: [...]")
 
+# For 3D view, show the stroke placement settings
+# XXX: How to tell what editor the active tool comes from?
+is_3d_view = True
+if is_3d_view:
+layout.separator()
+
+row = layout.row(align=True)
+row.prop(ts, "gpencil_stroke_placement_view3d", text="Orientation")
+if ts.gpencil_stroke_placement_view3d == 'CURSOR':
+row.prop(ts.gpencil_sculpt, "lockaxis")
+elif ts.gpencil_stroke_placement_view3d in {'SURFACE', 'STROKE'}:
+row.prop(ts, "use_gpencil_stroke_endpoints")
+
 @ToolDef.from_fn
 def scribble():
 def draw_settings(context, layout, tool):

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [dc215a58518] greasepencil-object: Annotation Tools: Use different cursors to indicate that the tools are running

2018-07-23 Thread Joshua Leung
Commit: dc215a585185cbc420a22f81c59186255dfb00de
Author: Joshua Leung
Date:   Tue Jul 24 03:16:46 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rBdc215a585185cbc420a22f81c59186255dfb00de

Annotation Tools: Use different cursors to indicate that the tools are running

===

M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 9668c398658..6f3019d6fff 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -198,6 +198,7 @@ class _defs_annotate:
 return dict(
 text="Annotate",
 icon="ops.gpencil.draw",
+cursor='PAINT_BRUSH',
 keymap=(
 ("gpencil.annotate",
  dict(mode='DRAW', wait_for_input=False),
@@ -214,6 +215,7 @@ class _defs_annotate:
 return dict(
 text="Draw Line",
 icon="ops.gpencil.draw.line",
+cursor='CROSSHAIR',
 keymap=(
 ("gpencil.annotate",
  dict(mode='DRAW_STRAIGHT', wait_for_input=False),
@@ -230,6 +232,7 @@ class _defs_annotate:
 return dict(
 text="Draw Polygon",
 icon="ops.gpencil.draw.poly",
+cursor='CROSSHAIR',
 keymap=(
 ("gpencil.annotate",
  dict(mode='DRAW_POLY', wait_for_input=False),
@@ -248,7 +251,7 @@ class _defs_annotate:
 return dict(
 text="Eraser",
 icon="ops.gpencil.draw.eraser",
-#cursor='...',  # XXX: Always show brush circle when enabled
+cursor='CROSSHAIR', # XXX: Always show brush circle when enabled
 keymap=(
 ("gpencil.annotate",
  dict(mode='ERASER', wait_for_input=False),

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [846f5d8f744] greasepencil-object: Annotations: Dynamically updating layer-color preview icons + "Active Note" enum

2018-07-23 Thread Joshua Leung
Commit: 846f5d8f744601914ba0481dc23ec75c5dc7509d
Author: Joshua Leung
Date:   Tue Jul 24 02:28:35 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rB846f5d8f744601914ba0481dc23ec75c5dc7509d

Annotations: Dynamically updating layer-color preview icons + "Active Note" enum

This adds a new enum with dynamically-generated icons to show previews
for the icons associated with each GP layer used for annotations. This
enum is used as part of the UI for annotations (specifically, in the
topbar settings for the active  tool), making it easier for users to
see what color strokes drawn using the active note/layer will look like.

I ended up needing to create a new icon type in BKE_icons.h so that
we can store references to the layer/color used.

Known issues:
* The icon seems a bit too big, and would look a bit nicer with
  rounded corners. But there are too many issues with the UI roundbox
  functions (e.g. _aa() makes colors too dark, and non-aa versions look
  too rough).

* Changing layer colors doesn't redraw the icons. A manual refresh
  (by mousing over the widget) is needed.

===

M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M   source/blender/blenkernel/BKE_icons.h
M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/blenkernel/intern/icons.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/editors/gpencil/gpencil_utils.c
M   source/blender/editors/interface/interface_icons.c
M   source/blender/makesdna/DNA_gpencil_types.h
M   source/blender/makesrna/intern/rna_gpencil.c

===

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 0d2d6445203..9668c398658 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -184,7 +184,7 @@ class _defs_annotate:
 gpl = context.active_gpencil_layer
 
 if gpd and gpl:
-layout.prop_search(gpd.layers, "active", gpd, "layers", text="")
+layout.prop(gpd.layers, "active_note", text="")
 layout.prop(gpl, "line_change", text="Thickness")  # XXX: Replace 
with proper thickness control
 else:
 layout.prop(user_prefs.edit, "grease_pencil_default_color", 
text="Color")
diff --git a/source/blender/blenkernel/BKE_icons.h 
b/source/blender/blenkernel/BKE_icons.h
index 22897d2ea80..7a5262e0a14 100644
--- a/source/blender/blenkernel/BKE_icons.h
+++ b/source/blender/blenkernel/BKE_icons.h
@@ -43,7 +43,10 @@ enum {
ICON_DATA_PREVIEW,
/** 2D triangles: obj is #Icon_Geom */
ICON_DATA_GEOM,
+   /** Studiolight */
ICON_DATA_STUDIOLIGHT,
+   /** GPencil Layer color preview (annotations): obj is #bGPDlayer */
+   ICON_DATA_GPLAYER,
 };
 
 struct Icon {
@@ -79,6 +82,7 @@ struct ImBuf;
 struct PreviewImage;
 struct ID;
 struct StudioLight;
+struct bGPDlayer;
 
 enum eIconSizes;
 
@@ -87,6 +91,9 @@ void BKE_icons_init(int first_dyn_id);
 /* return icon id for library object or create new icon if not found */
 int BKE_icon_id_ensure(struct ID *id);
 
+/* return icon id for Grease Pencil layer (color preview) or create new icon 
if not found */
+int BKE_icon_gplayer_color_ensure(struct bGPDlayer *gpl);
+
 int BKE_icon_preview_ensure(struct ID *id, struct PreviewImage *preview);
 
 /* retrieve icon for id */
diff --git a/source/blender/blenkernel/intern/gpencil.c 
b/source/blender/blenkernel/intern/gpencil.c
index 424b5955486..de3f891f9f9 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -60,6 +60,7 @@
 #include "BKE_global.h"
 #include "BKE_gpencil.h"
 #include "BKE_colortools.h"
+#include "BKE_icons.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_object.h"
@@ -1031,6 +1032,9 @@ void BKE_gpencil_layer_delete(bGPdata *gpd, bGPDlayer 
*gpl)
/* free layer */
BKE_gpencil_free_frames(gpl);
 
+   /* free icon providing preview of icon color */
+   BKE_icon_delete(gpl->runtime.icon_id);
+
/* free derived data */
BKE_gpencil_clear_derived(gpl);
if (gpl->runtime.derived_data) {
diff --git a/source/blender/blenkernel/intern/icons.c 
b/source/blender/blenkernel/intern/icons.c
index 1c2575dfa52..3a4bf53e22d 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -37,6 +37,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "DNA_brush_types.h"
+#include "DNA_gpencil_types.h"
 #include "DNA_group_types.h"
 #include "DNA_lamp_types.h"
 #include "DNA_material_types.h"
@@ -45,7 +47,6 @@
 #include "DNA_screen_types.h"
 #include "DNA_texture_types.h"
 #include "DNA_world_types.h"
-#include "DNA_brush_types.h"
 
 #include "BLI_utildefines.h"
 #inclu

[Bf-blender-cvs] [091db5fb961] greasepencil-object: Assorted Cleanup/Fixes

2018-07-23 Thread Joshua Leung
Commit: 091db5fb9619887673c3d3b0b717776b6035d163
Author: Joshua Leung
Date:   Tue Jul 24 02:32:45 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rB091db5fb9619887673c3d3b0b717776b6035d163

Assorted Cleanup/Fixes

===

M   source/blender/editors/gpencil/annotate_paint.c
M   source/blender/makesrna/intern/rna_gpencil.c
M   source/blender/nodes/composite/nodes/node_composite_cryptomatte.c

===

diff --git a/source/blender/editors/gpencil/annotate_paint.c 
b/source/blender/editors/gpencil/annotate_paint.c
index 53b842233cf..ec645f0188c 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -458,9 +458,6 @@ static short gp_stroke_addpoint(
return GP_STROKEADD_NORMAL;
}
else if (p->paintmode == GP_PAINTMODE_DRAW_POLY) {
-#if 0
-   bGPDlayer *gpl = BKE_gpencil_layer_getactive(gpd);
-#endif
/* get pointer to destination point */
pt = (tGPspoint *)(gpd->runtime.sbuffer);
 
diff --git a/source/blender/makesrna/intern/rna_gpencil.c 
b/source/blender/makesrna/intern/rna_gpencil.c
index c2f984d2bbe..cf077999c12 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -468,8 +468,8 @@ static void rna_GPencil_stroke_point_add(bGPDstroke 
*stroke, int count, float pr
  sizeof(bGPDspoint) * 
(stroke->totpoints + count),
  "gp_stroke_points");
stroke->dvert = MEM_recallocN_id(stroke->dvert,
-   
  sizeof(MDeformVert) * (stroke->totpoints + count),
-   
  "gp_stroke_weight");
+ sizeof(MDeformVert) * 
(stroke->totpoints + count),
+ "gp_stroke_weight");
 
/* init the pressure and strength values so that old scripts 
won't need to
 * be modified to give these initial values...
diff --git a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c 
b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c
index bf9ab4a5064..af988c0df39 100644
--- a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c
@@ -37,7 +37,7 @@
 
 /* this is taken from the cryptomatte specification 1.0 */
 
-static inline float hash_to_float(uint32_t hash)
+BLI_INLINE float hash_to_float(uint32_t hash)
 {
uint32_t mantissa = hash & ((1 << 23) - 1);
uint32_t exponent = (hash >> 23) & ((1 << 8) - 1);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [77fd0499e41] blender2.8: Merge branch 'master' into blender2.8

2018-07-23 Thread Campbell Barton
Commit: 77fd0499e41e7fd5a86ed7b65b7f386c2fcdb4f0
Author: Campbell Barton
Date:   Tue Jul 24 15:35:01 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB77fd0499e41e7fd5a86ed7b65b7f386c2fcdb4f0

Merge branch 'master' into blender2.8

===



===



___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [a54c30da76d] greasepencil-object: Hacky fix for Mode Switch Pie Menu overflowing to a submenu on GP Objects

2018-07-23 Thread Joshua Leung
Commit: a54c30da76dca5d73c241ac7815820ff7970ba07
Author: Joshua Leung
Date:   Tue Jul 24 17:47:28 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rBa54c30da76dca5d73c241ac7815820ff7970ba07

Hacky fix for Mode Switch Pie Menu overflowing to a submenu on GP Objects

With the introduction of the GP editing modes to the object/workspace
modes enum, this introduced a number of issues for the Ctrl-Tab mode
switching pie menu, e.g.
 * To access any of the GP Editing modes, you had to first navigate to
   the "More" sub-pie, before being able to see these values. In practice,
   this was tricky to use, and not ideal.
 * Particle Editing mode was also moved into a sub-pie by itself

This was due to the following reasons:
 1) Pie Menus for Enums use the "static" enum define to determine
where items should go.  This was done to ensure spatial consistency
of items (e.g. Edit is always in the "east" position).
 2) Each pie menu layout is only allowed to contain 8 items.
(i.e. so that movements can be less precise, corresponding to the
main compass directions only)
 3) The nature of the modes menu means that there is never any situation
where all menu items need to be visible at the same time. Usually,
there are only between 2-5 items in that menu at a time, and at least
6 of the items are only valid for a single object type each.

Several other solutions were tried, but this hack is the simplest fix.

===

M   source/blender/editors/interface/interface_layout.c

===

diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index 82ed4c5acba..89e1a8caec8 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1244,7 +1244,15 @@ void uiItemsFullEnumO(
bool free;
 
if (ui_layout_is_radial(layout)) {
+   /* XXX: While "_all()" guarantees spatial stability, 
it's bad when an enum has > 8 items total,
+* but only a small subset will ever be shown at once 
(e.g. Mode Switch menu, after the 
+* introduction of GP editing modes)
+*/
+#if 0
RNA_property_enum_items_gettexted_all(block->evil_C, 
&ptr, prop, &item_array, &totitem, &free);
+#else
+   RNA_property_enum_items_gettexted(block->evil_C, &ptr, 
prop, &item_array, &totitem, &free);
+#endif
}
else {
RNA_property_enum_items_gettexted(block->evil_C, &ptr, 
prop, &item_array, &totitem, &free);

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs