[Bf-blender-cvs] [9615d6f44a1] greasepencil-object: GP: Primitive, add noise to box and circle

2018-12-11 Thread Charlie Jolly
Commit: 9615d6f44a1bb1aeca2bce8eb4972291ea0e1565
Author: Charlie Jolly
Date:   Tue Dec 11 14:36:10 2018 +
Branches: greasepencil-object
https://developer.blender.org/rB9615d6f44a1bb1aeca2bce8eb4972291ea0e1565

GP: Primitive, add noise to box and circle

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index bd6668ca9e1..19091242b50 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -102,10 +102,16 @@
 #define SELECT_CP2 3
 #define SELECT_END 4
 
+<<< HEAD
 #define BIG_SIZE_CTL15
 #define MID_SIZE_CTL10
 #define SMALL_SIZE_CTL   8 
 
+===
+#define BIG_SIZE_CTL10
+#define MID_SIZE_CTL15
+#define SMALL_SIZE_CTL  20 
+>>> GP: Primitive, add noise to box and circle
   /*  */
   /* Core/Shared Utilities */
 
@@ -221,7 +227,7 @@ static bool gpencil_primitive_add_poll(bContext *C)
 
 /* Allocate memory to stroke, adds MAX_EDGES on every call */
 static void gpencil_primitive_allocate_memory(tGPDprimitive *tgpi) {
-   tgpi->point_count += (MAX_EDGES + 1);
+   tgpi->point_count += (tgpi->type == GP_STROKE_BOX) ? (MAX_EDGES * 4 + 
1) : (MAX_EDGES + 1);
bGPDstroke *gpsf = tgpi->gpf->strokes.first;
gpsf->points = MEM_reallocN(gpsf->points, sizeof(bGPDspoint) * 
tgpi->point_count);
if (gpsf->dvert != NULL)
@@ -299,6 +305,13 @@ static void gp_primitive_set_initdata(bContext *C, 
tGPDprimitive *tgpi)
 
 }
 
+/* add new segment to curve */
+static void gpencil_primitive_add_segment(tGPDprimitive *tgpi)
+{
+   tgpi->tot_stored_edges += tgpi->tot_edges;
+   gpencil_primitive_allocate_memory(tgpi);
+}
+
 /* Helper: set control point */
 static void gp_primitive_set_cp(tGPDprimitive *tgpi, float p[2], float 
color[4], int size)
 {
@@ -322,7 +335,7 @@ static void gpencil_primitive_status_indicators(bContext 
*C, tGPDprimitive *tgpi
char msg_str[UI_MAX_DRAW_STR];
 
if (tgpi->type == GP_STROKE_BOX) {
-   BLI_strncpy(msg_str, IFACE_("Rectangle: ESC/RMB to cancel, LMB 
set origin, Enter/LMB to confirm, Shift to square, Alt to center"), 
UI_MAX_DRAW_STR);
+   BLI_strncpy(msg_str, IFACE_("Rectangle: ESC/RMB to cancel, LMB 
set origin, Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to 
square, Alt to center"), UI_MAX_DRAW_STR);
}
else if (tgpi->type == GP_STROKE_LINE) {
BLI_strncpy(msg_str, IFACE_("Line: ESC/RMB to cancel, LMB set 
origin, Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to align, 
Alt to center"), UI_MAX_DRAW_STR);
@@ -377,21 +390,35 @@ static void gpencil_primitive_status_indicators(bContext 
*C, tGPDprimitive *tgpi
 /* create a rectangle */
 static void gp_primitive_rectangle(tGPDprimitive *tgpi, tGPspoint *points2D)
 {
-   BLI_assert(tgpi->tot_edges == 4);
-
+   float coords[5][2];
+
+   coords[0][0] = tgpi->start[0];
+   coords[0][1] = tgpi->start[1];
+   coords[1][0] = tgpi->end[0];
+   coords[1][1] = tgpi->start[1];
+   coords[2][0] = tgpi->end[0];
+   coords[2][1] = tgpi->end[1];
+   coords[3][0] = tgpi->start[0];
+   coords[3][1] = tgpi->end[1];
+   coords[4][0] = tgpi->start[0];
+   coords[4][1] = tgpi->start[1];
+
+   const float step = 1.0f / (float)(tgpi->tot_edges);
int i = tgpi->tot_stored_edges;
 
-   points2D[i].x = tgpi->start[0];
-   points2D[i].y = tgpi->start[1];
-
-   points2D[i + 1].x = tgpi->end[0];
-   points2D[i + 1].y = tgpi->start[1];
-
-   points2D[i + 2].x = tgpi->end[0];
-   points2D[i + 2].y = tgpi->end[1];
+   for (int j = 0; j < 4; j++) {
+   float a = 0.0f;
+   for (int k = 0; k < tgpi->tot_edges; k++) {
+   tGPspoint *p2d = [i];
+   interp_v2_v2v2(>x, coords[j], coords[j + 1], a);
+   a += step;
+   i++;
+   }
+   }
 
-   points2D[i + 3].x = tgpi->start[0];
-   points2D[i + 3].y = tgpi->end[1];
+   float color[4];
+   UI_GetThemeColor4fv(TH_REDALERT, color);
+   gp_primitive_set_cp(tgpi, tgpi->origin, color, 10);
 }
 
 /* create a line */
@@ -423,7 +450,6 @@ static void gp_primitive_line(tGPDprimitive *tgpi, 
tGPspoint *points2D)
gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
 #endif  
}
-
 }
 
 /* unused at the moment */
@@ -442,7 +468,6 @@ void interp_v2_v2v2v2_quadratic(
 static void gp_primitive_arc(tGPDprimitive *tgpi, tGPspoint *points2D)
 {
const int totpoints = (tgpi->tot_edges + tgpi->tot_stored_edges);
-   
const float step = M_PI_2 / 

[Bf-blender-cvs] [0ed319cb0c1] greasepencil-object: GP: Add number of divisions in bottom message for Boxes

2018-12-11 Thread Antonioya
Commit: 0ed319cb0c1ae9b28037047060914d30fe67f9e1
Author: Antonioya
Date:   Tue Dec 11 17:29:24 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB0ed319cb0c1ae9b28037047060914d30fe67f9e1

GP: Add number of divisions in bottom message for Boxes

It was impossible to see the number of divisions used.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 01b97c10e65..78d00abc0b7 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -344,7 +344,7 @@ static void gpencil_primitive_status_indicators(bContext 
*C, tGPDprimitive *tgpi
BLI_strncpy(msg_str, IFACE_("Circle: ESC/RMB to cancel, 
Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to 
center"), UI_MAX_DRAW_STR);
}
 
-   if (ELEM(tgpi->type, GP_STROKE_CIRCLE, GP_STROKE_ARC, GP_STROKE_LINE)) {
+   if (ELEM(tgpi->type, GP_STROKE_CIRCLE, GP_STROKE_ARC, GP_STROKE_LINE, 
GP_STROKE_BOX)) {
if (hasNumInput(>num)) {
char str_offs[NUM_STR_REP_LEN];

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


[Bf-blender-cvs] [7567700b156] greasepencil-object: GP: Remove cyclic option

2018-12-11 Thread Charlie Jolly
Commit: 7567700b1567a3c16dce297477932540348ef9b4
Author: Charlie Jolly
Date:   Tue Dec 11 16:48:34 2018 +
Branches: greasepencil-object
https://developer.blender.org/rB7567700b1567a3c16dce297477932540348ef9b4

GP: Remove cyclic option

Not compatible with new brush drawing.

===

M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/editors/gpencil/gpencil_primitive.c

===

diff --git a/source/blender/editors/gpencil/gpencil_intern.h 
b/source/blender/editors/gpencil/gpencil_intern.h
index 9e8660943d5..bc1ad680ab4 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -156,7 +156,6 @@ typedef struct tGPDprimitive {
struct bGPDframe *gpf;/* frame */
int type; /* type of primitive */
bool curve;   /* type of primitive is a curve */
-   short cyclic; /* cyclic option */
short flip;   /* flip option */
tGPspoint *points;/* array of data-points for stroke */
int point_count;  /* number of edges allocated */
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 4cdad0b9c5e..2468353f5e9 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -128,9 +128,6 @@ static void gp_session_validatebuffer(tGPDprimitive *p)
/* reset flags */
gpd->runtime.sbuffer_sflag = 0;
gpd->runtime.sbuffer_sflag |= GP_STROKE_3DSPACE;
-   if (p->cyclic) {
-   gpd->runtime.sbuffer_sflag |= GP_STROKE_CYCLIC;
-   }
 }
 
 static void gp_init_colors(tGPDprimitive *p)
@@ -268,12 +265,9 @@ static void gp_primitive_set_initdata(bContext *C, 
tGPDprimitive *tgpi)
gps->flag |= GP_STROKE_RECALC_CACHES;
gps->flag &= ~GP_STROKE_SELECT;
/* the polygon must be closed, so enabled cyclic */
-   if (tgpi->type != GP_STROKE_LINE && tgpi->type != GP_STROKE_ARC) {
+   if (ELEM(tgpi->type,GP_STROKE_BOX ,GP_STROKE_CIRCLE))
gps->flag |= GP_STROKE_CYCLIC;
-   }
-   else {
-   gps->flag &= ~GP_STROKE_CYCLIC;
-   }
+
gps->flag |= GP_STROKE_3DSPACE;
 
gps->mat_nr = BKE_gpencil_get_material_index(tgpi->ob, tgpi->mat) - 1;
@@ -581,15 +575,12 @@ static void gp_primitive_update_strokes(bContext *C, 
tGPDprimitive *tgpi)
tGPspoint *points2D = tgpi->points;
switch (tgpi->type) {
case GP_STROKE_BOX:
-   tgpi->cyclic = true;
gp_primitive_rectangle(tgpi, points2D);
break;
case GP_STROKE_LINE:
-   tgpi->cyclic = false;
gp_primitive_line(tgpi, points2D);
break;
case GP_STROKE_CIRCLE:
-   tgpi->cyclic = true;
gp_primitive_circle(tgpi, points2D);
break;
case GP_STROKE_ARC:
@@ -601,13 +592,6 @@ static void gp_primitive_update_strokes(bContext *C, 
tGPDprimitive *tgpi)
break;
}
 
-   if (ELEM(tgpi->type, GP_STROKE_ARC, GP_STROKE_BEZIER)) {
-   if (tgpi->cyclic)
-   gps->flag |= GP_STROKE_CYCLIC;
-   else
-   gps->flag &= ~GP_STROKE_CYCLIC;
-   }   
-
/* convert screen-coordinates to 3D coordinates */
gp_session_validatebuffer(tgpi);
gp_init_colors(tgpi);
@@ -1289,16 +1273,6 @@ static int gpencil_primitive_modal(bContext *C, 
wmOperator *op, const wmEvent *e
/* canceled! */
return OPERATOR_CANCELLED;
}
-   case CKEY:
-   {
-   if ((event->val == KM_RELEASE) && tgpi->type == 
GP_STROKE_ARC) {
-   tgpi->cyclic ^= 1;
-
-   /* update screen */
-   gpencil_primitive_update(C, op, tgpi);
-   }
-   break;
-   }
case FKEY:
{
if ((event->val == KM_RELEASE) && tgpi->type == 
GP_STROKE_ARC) {

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


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

2018-12-11 Thread Sergey Sharybin
Commit: 4d115f21595d255f2d335d2f307ee822b381ea54
Author: Sergey Sharybin
Date:   Tue Dec 11 15:56:04 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB4d115f21595d255f2d335d2f307ee822b381ea54

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] [522fab74a42] greasepencil-object: GP: Change control points size and remove in line

2018-12-11 Thread Antonioya
Commit: 522fab74a42637e62ac24bae13d89cdb7b14f77c
Author: Antonioya
Date:   Tue Dec 11 16:34:57 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB522fab74a42637e62ac24bae13d89cdb7b14f77c

GP: Change control points size and remove in line

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 312fe93c85b..bd6668ca9e1 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -102,9 +102,9 @@
 #define SELECT_CP2 3
 #define SELECT_END 4
 
-#define BIG_SIZE_CTL10
-#define MID_SIZE_CTL15
-#define SMALL_SIZE_CTL  20 
+#define BIG_SIZE_CTL15
+#define MID_SIZE_CTL10
+#define SMALL_SIZE_CTL   8 
 
   /*  */
   /* Core/Shared Utilities */
@@ -417,9 +417,11 @@ static void gp_primitive_line(tGPDprimitive *tgpi, 
tGPspoint *points2D)
a += step;
}
 
+#if 0 /* GPXX Do we need this? */
float color[4];
UI_GetThemeColor4fv(TH_REDALERT, color);
gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
+#endif  
}
 
 }

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


[Bf-blender-cvs] [0c4be6546cf] greasepencil-object: Merge branch 'greasepencil-object' of git.blender.org:blender into greasepencil-object

2018-12-11 Thread Antonioya
Commit: 0c4be6546cf3ff16cabd59381c115ba6fc4e5377
Author: Antonioya
Date:   Tue Dec 11 18:08:06 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB0c4be6546cf3ff16cabd59381c115ba6fc4e5377

Merge branch 'greasepencil-object' of git.blender.org:blender into 
greasepencil-object

 Conflicts:
source/blender/editors/gpencil/gpencil_primitive.c

===



===



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


[Bf-blender-cvs] [66d8bfb85c6] master: Update code to be compatible with OIIO 2.0

2018-12-11 Thread Sergey Sharybin
Commit: 66d8bfb85c61aafe3bad2edf0e7b4d9d694ee2e7
Author: Sergey Sharybin
Date:   Tue Dec 11 12:17:26 2018 +0100
Branches: master
https://developer.blender.org/rB66d8bfb85c61aafe3bad2edf0e7b4d9d694ee2e7

Update code to be compatible with OIIO 2.0

There are some changes in API of OpenImageIO, but those are quite
simple to keep working with older and newer library versions.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4064

===

M   intern/cycles/blender/blender_python.cpp
M   intern/cycles/graph/node_xml.cpp
M   intern/cycles/render/attribute.cpp
M   intern/cycles/render/image.cpp
M   intern/cycles/render/image.h
A   intern/cycles/util/util_unique_ptr.h
M   source/blender/imbuf/intern/oiio/openimageio_api.cpp

===

diff --git a/intern/cycles/blender/blender_python.cpp 
b/intern/cycles/blender/blender_python.cpp
index 8b3bec56d1f..d9ff95b2578 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -500,7 +500,7 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, 
PyObject *args)
socket_type = "NodeSocketString";
data_type = BL::NodeSocket::type_STRING;
if(param->validdefault)
-   default_string = param->sdefault[0];
+   default_string = 
param->sdefault[0].string();
}
else
continue;
diff --git a/intern/cycles/graph/node_xml.cpp b/intern/cycles/graph/node_xml.cpp
index b7a28b427e5..f228da282e9 100644
--- a/intern/cycles/graph/node_xml.cpp
+++ b/intern/cycles/graph/node_xml.cpp
@@ -250,7 +250,7 @@ void xml_read_node(XMLReader& reader, Node *node, xml_node 
xml_node)
}
}
 
-   if(node->name)
+   if(!node->name.empty())
reader.node_map[node->name] = node;
 }
 
diff --git a/intern/cycles/render/attribute.cpp 
b/intern/cycles/render/attribute.cpp
index a7450849195..ca167a7c722 100644
--- a/intern/cycles/render/attribute.cpp
+++ b/intern/cycles/render/attribute.cpp
@@ -663,7 +663,7 @@ void AttributeRequestSet::add(AttributeRequestSet& reqs)
 
 void AttributeRequestSet::add_standard(ustring name)
 {
-   if(!name) {
+   if(name.empty()) {
return;
}
 
diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index e6ef19cc3be..a8e6f41e57a 100644
--- a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -24,6 +24,7 @@
 #include "util/util_path.h"
 #include "util/util_progress.h"
 #include "util/util_texture.h"
+#include "util/util_unique_ptr.h"
 
 #ifdef WITH_OSL
 #include 
@@ -194,7 +195,7 @@ bool ImageManager::get_image_metadata(const string& 
filename,
return false;
}
 
-   ImageInput *in = ImageInput::create(filename);
+   unique_ptr in(ImageInput::create(filename));
 
if(!in) {
return false;
@@ -202,7 +203,6 @@ bool ImageManager::get_image_metadata(const string& 
filename,
 
ImageSpec spec;
if(!in->open(filename, spec)) {
-   delete in;
return false;
}
 
@@ -270,7 +270,6 @@ bool ImageManager::get_image_metadata(const string& 
filename,
}
 
in->close();
-   delete in;
 
return true;
 }
@@ -455,7 +454,7 @@ void ImageManager::tag_reload_image(const string& filename,
 }
 
 bool ImageManager::file_load_image_generic(Image *img,
-   ImageInput **in)
+   unique_ptr *in)
 {
if(img->filename == "")
return false;
@@ -467,7 +466,7 @@ bool ImageManager::file_load_image_generic(Image *img,
}
 
/* load image from file through OIIO */
-   *in = ImageInput::create(img->filename);
+   *in = unique_ptr(ImageInput::create(img->filename));
 
if(!*in)
return false;
@@ -479,8 +478,6 @@ bool ImageManager::file_load_image_generic(Image *img,
config.attribute("oiio:UnassociatedAlpha", 1);
 
if(!(*in)->open(img->filename, spec, config)) {
-   delete *in;
-   *in = NULL;
return false;
}
}
@@ -494,10 +491,7 @@ bool ImageManager::file_load_image_generic(Image *img,
if(!(img->metadata.channels >= 1 && img->metadata.channels <= 4)) {
if(*in) {
(*in)->close();
-   delete *in;
-   *in = NULL;
}
-
return false;
}
 
@@ -512,7 +506,7 @@ bool 

[Bf-blender-cvs] [ca7fd606dae] greasepencil-object: GP: Merge errors

2018-12-11 Thread Charlie Jolly
Commit: ca7fd606dae1260f6764adbb2f7b0ec02bdb1f70
Author: Charlie Jolly
Date:   Tue Dec 11 15:47:32 2018 +
Branches: greasepencil-object
https://developer.blender.org/rBca7fd606dae1260f6764adbb2f7b0ec02bdb1f70

GP: Merge errors

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 19091242b50..56ed792b9b9 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -102,16 +102,10 @@
 #define SELECT_CP2 3
 #define SELECT_END 4
 
-<<< HEAD
 #define BIG_SIZE_CTL15
 #define MID_SIZE_CTL10
 #define SMALL_SIZE_CTL   8 
 
-===
-#define BIG_SIZE_CTL10
-#define MID_SIZE_CTL15
-#define SMALL_SIZE_CTL  20 
->>> GP: Primitive, add noise to box and circle
   /*  */
   /* Core/Shared Utilities */

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


[Bf-blender-cvs] [8e2f2137460] greasepencil-object: GP: Remove "Close" from Bottom text

2018-12-11 Thread Antonioya
Commit: 8e2f2137460e45f5a3c89f8af3369782ac1c9efa
Author: Antonioya
Date:   Tue Dec 11 18:42:14 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB8e2f2137460e45f5a3c89f8af3369782ac1c9efa

GP: Remove "Close" from Bottom text

This was missing in previous commit.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 6131e1ac5a5..381673c8e46 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -329,10 +329,10 @@ static void gpencil_primitive_status_indicators(bContext 
*C, tGPDprimitive *tgpi
BLI_strncpy(msg_str, IFACE_("Line: ESC/RMB to cancel, LMB set 
origin, Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to align, 
Alt to center"), UI_MAX_DRAW_STR);
}
else if (tgpi->type == GP_STROKE_ARC) {
-   BLI_strncpy(msg_str, IFACE_("Arc: ESC/RMB to cancel, Enter/LMB 
to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center, F 
to flip, C to Close"), UI_MAX_DRAW_STR);
+   BLI_strncpy(msg_str, IFACE_("Arc: ESC/RMB to cancel, Enter/LMB 
to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center, F 
to flip"), UI_MAX_DRAW_STR);
}
else if (tgpi->type == GP_STROKE_CURVE) {
-   BLI_strncpy(msg_str, IFACE_("Curve: ESC/RMB to cancel, 
Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to 
center, C to Close"), UI_MAX_DRAW_STR);
+   BLI_strncpy(msg_str, IFACE_("Curve: ESC/RMB to cancel, 
Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to 
center"), UI_MAX_DRAW_STR);
}
else {
BLI_strncpy(msg_str, IFACE_("Circle: ESC/RMB to cancel, 
Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to 
center"), UI_MAX_DRAW_STR);

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


[Bf-blender-cvs] [7a5080de0bb] greasepencil-object: GP: Fix memory leak

2018-12-11 Thread Antonioya
Commit: 7a5080de0bbeb1aaf9772ba63491ca953e65c2b3
Author: Antonioya
Date:   Tue Dec 11 16:24:07 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB7a5080de0bbeb1aaf9772ba63491ca953e65c2b3

GP: Fix memory leak

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 41f9a2daadd..312fe93c85b 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -819,6 +819,12 @@ static void gpencil_primitive_exit(bContext *C, wmOperator 
*op)
/* finally, free memory used by temp data */
BKE_gpencil_free_strokes(tgpi->gpf);
MEM_SAFE_FREE(tgpi->gpf);
+
+   /* free random seed */
+   if (tgpi->rng != NULL) {
+   BLI_rng_free(tgpi->rng);
+   }
+
MEM_freeN(tgpi);
}

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


[Bf-blender-cvs] [2475d76dd98] greasepencil-object: GP: Remove Radius control point in Circles

2018-12-11 Thread Antonioya
Commit: 2475d76dd986d04b145740af98befbd93856ad0d
Author: Antonioya
Date:   Tue Dec 11 17:40:49 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB2475d76dd986d04b145740af98befbd93856ad0d

GP: Remove Radius control point in Circles

This only adds complexity and don't communicate the information of the radius 
in a easy way, so it's better keep UI as clean as possible.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index ff4828a9de6..4cdad0b9c5e 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -556,7 +556,6 @@ static void gp_primitive_circle(tGPDprimitive *tgpi, 
tGPspoint *points2D)
UI_GetThemeColor4fv(TH_REDALERT, color);
gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
gp_primitive_set_cp(tgpi, center, color, MID_SIZE_CTL);
-   gp_primitive_set_cp(tgpi, radius, color, MID_SIZE_CTL);
 }
 
 /* Helper: Update shape of the stroke */

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


[Bf-blender-cvs] [2a6bc4a82cb] blender2.8: Fix T58266 : Bottom half of meshes are transparent with eevee render

2018-12-11 Thread Clément Foucault
Commit: 2a6bc4a82cb3201ac623512e3f9f53f3890ecae2
Author: Clément Foucault
Date:   Tue Dec 11 13:29:32 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB2a6bc4a82cb3201ac623512e3f9f53f3890ecae2

Fix T58266 : Bottom half of meshes are transparent with eevee render

===

M   source/blender/draw/engines/eevee/eevee_effects.c
M   source/blender/draw/engines/eevee/eevee_occlusion.c

===

diff --git a/source/blender/draw/engines/eevee/eevee_effects.c 
b/source/blender/draw/engines/eevee/eevee_effects.c
index 48a73ccef18..787957a4a33 100644
--- a/source/blender/draw/engines/eevee/eevee_effects.c
+++ b/source/blender/draw/engines/eevee/eevee_effects.c
@@ -460,10 +460,10 @@ void EEVEE_create_minmax_buffer(EEVEE_Data *vedata, 
GPUTexture *depth_src, int l
/* Restore */
GPU_framebuffer_bind(fbl->main_fb);
 
-   if (GPU_mip_render_workaround()) {
-   /* Fix dot corruption on intel HD5XX/HD6XX series.
-* It seems affected drivers are the same that needs
-* GPU_mip_render_workaround. */
+   if (GPU_mip_render_workaround() ||
+   GPU_type_matches(GPU_DEVICE_INTEL_UHD, GPU_OS_WIN, GPU_DRIVER_ANY))
+   {
+   /* Fix dot corruption on intel HD5XX/HD6XX series. */
GPU_flush();
}
 }
diff --git a/source/blender/draw/engines/eevee/eevee_occlusion.c 
b/source/blender/draw/engines/eevee/eevee_occlusion.c
index 03aee102136..3763e13533d 100644
--- a/source/blender/draw/engines/eevee/eevee_occlusion.c
+++ b/source/blender/draw/engines/eevee/eevee_occlusion.c
@@ -253,10 +253,10 @@ void EEVEE_occlusion_compute(
DRW_draw_pass(psl->ao_horizon_search);
}
 
-   if (GPU_mip_render_workaround()) {
-   /* Fix dot corruption on intel HD5XX/HD6XX series.
-* It seems affected drivers are the same that needs
-* GPU_mip_render_workaround. */
+   if (GPU_mip_render_workaround() ||
+   GPU_type_matches(GPU_DEVICE_INTEL_UHD, GPU_OS_WIN, 
GPU_DRIVER_ANY))
+   {
+   /* Fix dot corruption on intel HD5XX/HD6XX series. */
GPU_flush();
}

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


[Bf-blender-cvs] [4de5478409e] blender2.8: Edit Mesh: Make edit cage stick to the mesh when possible

2018-12-11 Thread Clément Foucault
Commit: 4de5478409ea3b7749de46ff28bedceb79b6b481
Author: Clément Foucault
Date:   Tue Dec 11 18:21:12 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB4de5478409ea3b7749de46ff28bedceb79b6b481

Edit Mesh: Make edit cage stick to the mesh when possible

and correctly offset it when it's not possible, otherwise we get zfighting.

===

M   source/blender/draw/modes/edit_mesh_mode.c
M   source/blender/draw/modes/shaders/edit_mesh_overlay_vert.glsl

===

diff --git a/source/blender/draw/modes/edit_mesh_mode.c 
b/source/blender/draw/modes/edit_mesh_mode.c
index 7dc3f3af3e6..8455cf83946 100644
--- a/source/blender/draw/modes/edit_mesh_mode.c
+++ b/source/blender/draw/modes/edit_mesh_mode.c
@@ -38,6 +38,7 @@
 
 #include "edit_mesh_mode_intern.h" /* own include */
 
+#include "BKE_editmesh.h"
 #include "BKE_object.h"
 
 #include "BLI_dynstr.h"
@@ -135,17 +136,14 @@ typedef struct EDIT_MESH_PrivateData {
DRWShadingGroup *vnormals_shgrp;
DRWShadingGroup *lnormals_shgrp;
 
-   DRWShadingGroup *face_overlay_shgrp;
-   DRWShadingGroup *verts_overlay_shgrp;
-   DRWShadingGroup *ledges_overlay_shgrp;
-   DRWShadingGroup *lverts_overlay_shgrp;
-   DRWShadingGroup *facedot_overlay_shgrp;
-
-   DRWShadingGroup *face_occluded_shgrp;
-   DRWShadingGroup *verts_occluded_shgrp;
-   DRWShadingGroup *ledges_occluded_shgrp;
-   DRWShadingGroup *lverts_occluded_shgrp;
-   DRWShadingGroup *facedot_occluded_shgrp;
+   DRWShadingGroup *face_shgrp;
+   DRWShadingGroup *face_cage_shgrp;
+
+   DRWShadingGroup *verts_shgrp;
+   DRWShadingGroup *ledges_shgrp;
+   DRWShadingGroup *lverts_shgrp;
+   DRWShadingGroup *facedot_shgrp;
+
DRWShadingGroup *facefill_occluded_shgrp;
 
int data_mask[4];
@@ -337,7 +335,8 @@ static void EDIT_MESH_engine_init(void *vedata)
 static DRWPass *edit_mesh_create_overlay_pass(
 float *face_alpha, float *edge_width_scale, int *data_mask, bool 
do_edges, bool xray,
 DRWState statemod,
-DRWShadingGroup **r_face_shgrp, DRWShadingGroup **r_verts_shgrp, 
DRWShadingGroup **r_ledges_shgrp,
+DRWShadingGroup **r_face_shgrp, DRWShadingGroup **r_face_cage_shgrp,
+DRWShadingGroup **r_verts_shgrp, DRWShadingGroup **r_ledges_shgrp,
 DRWShadingGroup **r_lverts_shgrp, DRWShadingGroup **r_facedot_shgrp)
 {
GPUShader *tri_sh, *ledge_sh;
@@ -391,6 +390,9 @@ static DRWPass *edit_mesh_create_overlay_pass(
/* To be able to use triple load. */
DRW_shgroup_state_enable(*r_face_shgrp, 
DRW_STATE_FIRST_VERTEX_CONVENTION);
}
+   /* Cage geom needs to be offseted to avoid Z-fighting. */
+   *r_face_cage_shgrp = DRW_shgroup_create_sub(*r_face_shgrp);
+   DRW_shgroup_state_enable(*r_face_cage_shgrp, DRW_STATE_OFFSET_NEGATIVE);
 
*r_ledges_shgrp = DRW_shgroup_create(ledge_sh, pass);
DRW_shgroup_uniform_block(*r_ledges_shgrp, "globalsBlock", globals_ubo);
@@ -526,22 +528,24 @@ static void EDIT_MESH_cache_init(void *vedata)
psl->edit_face_overlay = edit_mesh_create_overlay_pass(
_mod, >g_data->edge_width_scale, 
stl->g_data->data_mask, stl->g_data->do_edges, false,
DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND,
-   >g_data->face_overlay_shgrp,
-   >g_data->verts_overlay_shgrp,
-   >g_data->ledges_overlay_shgrp,
-   >g_data->lverts_overlay_shgrp,
-   >g_data->facedot_overlay_shgrp);
+   >g_data->face_shgrp,
+   >g_data->face_cage_shgrp,
+   >g_data->verts_shgrp,
+   >g_data->ledges_shgrp,
+   >g_data->lverts_shgrp,
+   >g_data->facedot_shgrp);
}
else {
/* We render all wires with depth and opaque to a new fbo and 
blend the result based on depth values */
psl->edit_face_occluded = edit_mesh_create_overlay_pass(
, >g_data->edge_width_scale, 
stl->g_data->data_mask, stl->g_data->do_edges, true,
DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WRITE_DEPTH,
-   >g_data->face_occluded_shgrp,
-   >g_data->verts_occluded_shgrp,
-   >g_data->ledges_occluded_shgrp,
-   >g_data->lverts_occluded_shgrp,
-   >g_data->facedot_occluded_shgrp);
+   >g_data->face_shgrp,
+   >g_data->face_cage_shgrp,
+   >g_data->verts_shgrp,
+   >g_data->ledges_shgrp,
+   >g_data->lverts_shgrp,
+   >g_data->facedot_shgrp);
 
  

[Bf-blender-cvs] [1b8e1bb6351] blender2.8: DRW: Add polygon offset mode.

2018-12-11 Thread Clément Foucault
Commit: 1b8e1bb6351415912d7106bca6488c6c0dd50cc3
Author: Clément Foucault
Date:   Tue Dec 11 18:18:36 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB1b8e1bb6351415912d7106bca6488c6c0dd50cc3

DRW: Add polygon offset mode.

===

M   source/blender/draw/intern/DRW_render.h
M   source/blender/draw/intern/draw_manager_exec.c

===

diff --git a/source/blender/draw/intern/DRW_render.h 
b/source/blender/draw/intern/DRW_render.h
index 519c907a6a4..89aa55c56b2 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -283,8 +283,8 @@ typedef enum {
DRW_STATE_CULL_FRONT= (1 << 9),
DRW_STATE_WIRE  = (1 << 10),
DRW_STATE_POINT = (1 << 11),
-   /* DRW_STATE_STIPPLE_2 = (1 << 12), */ /* Not used */
-   /* DRW_STATE_STIPPLE_3 = (1 << 13), */ /* Not used */
+   DRW_STATE_OFFSET_POSITIVE = (1 << 12), /* Polygon offset. Does not work 
with lines and points. */
+   DRW_STATE_OFFSET_NEGATIVE = (1 << 13), /* Polygon offset. Does not work 
with lines and points. */
/* DRW_STATE_STIPPLE_4 = (1 << 14), */ /* Not used */
DRW_STATE_BLEND = (1 << 15),
DRW_STATE_ADDITIVE  = (1 << 16),
diff --git a/source/blender/draw/intern/draw_manager_exec.c 
b/source/blender/draw/intern/draw_manager_exec.c
index 8eefd058719..985c4a73775 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -342,6 +342,32 @@ void drw_state_set(DRWState state)
}
}
 
+   /* Polygon Offset */
+   {
+   int test;
+   if (CHANGED_ANY_STORE_VAR(
+   DRW_STATE_OFFSET_POSITIVE |
+   DRW_STATE_OFFSET_NEGATIVE,
+   test)) {
+   if (test) {
+   glEnable(GL_POLYGON_OFFSET_FILL);
+   /* Stencil Write */
+   if ((state & DRW_STATE_OFFSET_POSITIVE) != 0) {
+   glPolygonOffset(1.0f, 1.0f);
+   }
+   else if ((state & DRW_STATE_OFFSET_NEGATIVE) != 
0) {
+   glPolygonOffset(-1.0f, -1.0f);
+   }
+   else {
+   BLI_assert(0);
+   }
+   }
+   else {
+   glDisable(GL_POLYGON_OFFSET_FILL);
+   }
+   }
+   }
+
 #undef CHANGED_TO
 #undef CHANGED_ANY
 #undef CHANGED_ANY_STORE_VAR

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


[Bf-blender-cvs] [5734e0c2f8c] greasepencil-object: GP: Fix box and circle cyclic on preview stroke

2018-12-11 Thread Charlie Jolly
Commit: 5734e0c2f8cdf5411d025b6c3c0a1058965d1bd9
Author: Charlie Jolly
Date:   Tue Dec 11 17:43:06 2018 +
Branches: greasepencil-object
https://developer.blender.org/rB5734e0c2f8cdf5411d025b6c3c0a1058965d1bd9

GP: Fix box and circle cyclic on preview stroke

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 381673c8e46..af5632acfe3 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -128,6 +128,9 @@ static void gp_session_validatebuffer(tGPDprimitive *p)
/* reset flags */
gpd->runtime.sbuffer_sflag = 0;
gpd->runtime.sbuffer_sflag |= GP_STROKE_3DSPACE;
+
+   if (ELEM(p->type, GP_STROKE_BOX, GP_STROKE_CIRCLE))
+   gpd->runtime.sbuffer_sflag |= GP_STROKE_CYCLIC;
 }
 
 static void gp_init_colors(tGPDprimitive *p)

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


[Bf-blender-cvs] [4370bc0c6ef] greasepencil-object: GP: Change constants by define for Ctrl points size

2018-12-11 Thread Antonioya
Commit: 4370bc0c6ef6e7225040ad8c9e75aff8545d3061
Author: Antonioya
Date:   Tue Dec 11 16:18:53 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB4370bc0c6ef6e7225040ad8c9e75aff8545d3061

GP: Change constants by define for Ctrl points size

This makes changes easier and can be replace by variables or parameters easily.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 8dceff29b2f..41f9a2daadd 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -102,6 +102,10 @@
 #define SELECT_CP2 3
 #define SELECT_END 4
 
+#define BIG_SIZE_CTL10
+#define MID_SIZE_CTL15
+#define SMALL_SIZE_CTL  20 
+
   /*  */
   /* Core/Shared Utilities */
 
@@ -415,7 +419,7 @@ static void gp_primitive_line(tGPDprimitive *tgpi, 
tGPspoint *points2D)
 
float color[4];
UI_GetThemeColor4fv(TH_REDALERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->origin, color, 10);
+   gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
}
 
 }
@@ -464,10 +468,10 @@ static void gp_primitive_arc(tGPDprimitive *tgpi, 
tGPspoint *points2D)
}
float color[4];
UI_GetThemeColor4fv(TH_ACTIVE_VERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->start, color, 20);
-   gp_primitive_set_cp(tgpi, tgpi->end, color, 20);
+   gp_primitive_set_cp(tgpi, tgpi->start, color, BIG_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, tgpi->end, color, BIG_SIZE_CTL);
UI_GetThemeColor4fv(TH_REDALERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->origin, color, 10);
+   gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
 }
 
 /* create a bezier */
@@ -493,13 +497,13 @@ static void gp_primitive_bezier(tGPDprimitive *tgpi, 
tGPspoint *points2D)
}
float color[4];
UI_GetThemeColor4fv(TH_ACTIVE_VERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->start, color, 20);
-   gp_primitive_set_cp(tgpi, tgpi->end, color, 20);
+   gp_primitive_set_cp(tgpi, tgpi->start, color, BIG_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, tgpi->end, color, BIG_SIZE_CTL);
UI_GetThemeColor4fv(TH_REDALERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->origin, color, 10);
+   gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
UI_GetThemeColor4fv(TH_GP_VERTEX_SELECT, color);
-   gp_primitive_set_cp(tgpi, tgpi->cp1, color, 20);
-   gp_primitive_set_cp(tgpi, tgpi->cp2, color, 20);
+   gp_primitive_set_cp(tgpi, tgpi->cp1, color, BIG_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, tgpi->cp2, color, BIG_SIZE_CTL);
 }
 
 /* create a circle */
@@ -525,12 +529,12 @@ static void gp_primitive_circle(tGPDprimitive *tgpi, 
tGPspoint *points2D)
}
float color[4];
UI_GetThemeColor4fv(TH_ACTIVE_VERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->start, color, 20);
-   gp_primitive_set_cp(tgpi, tgpi->end, color, 20);
+   gp_primitive_set_cp(tgpi, tgpi->start, color, BIG_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, tgpi->end, color, BIG_SIZE_CTL);
UI_GetThemeColor4fv(TH_REDALERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->origin, color, 10);
-   gp_primitive_set_cp(tgpi, center, color, 15);
-   gp_primitive_set_cp(tgpi, radius, color, 15);
+   gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, center, color, MID_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, radius, color, MID_SIZE_CTL);
 
 }

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


[Bf-blender-cvs] [5e8cd30db1b] greasepencil-object: GP: Restore origin point for Lines

2018-12-11 Thread Antonioya
Commit: 5e8cd30db1b991286581866b6e18b9e4bb3d58cd
Author: Antonioya
Date:   Tue Dec 11 17:21:01 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB5e8cd30db1b991286581866b6e18b9e4bb3d58cd

GP: Restore origin point for Lines

Maybe is good tohave where is the origin of the line

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 56ed792b9b9..01b97c10e65 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -438,11 +438,9 @@ static void gp_primitive_line(tGPDprimitive *tgpi, 
tGPspoint *points2D)
a += step;
}
 
-#if 0 /* GPXX Do we need this? */
float color[4];
UI_GetThemeColor4fv(TH_REDALERT, color);
gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
-#endif  
}
 }

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


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

2018-12-11 Thread Antonioya
Commit: 85e253a934fb906be84e9b87a9c0fb6834dfa74f
Author: Antonioya
Date:   Tue Dec 11 15:51:26 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB85e253a934fb906be84e9b87a9c0fb6834dfa74f

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] [4886ab72ef8] greasepencil-object: GP: Test moving origin point to start control point for Arcs and Curves

2018-12-11 Thread Antonioya
Commit: 4886ab72ef8377f987959c60c50e4959e3046647
Author: Antonioya
Date:   Tue Dec 11 17:37:28 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB4886ab72ef8377f987959c60c50e4959e3046647

GP: Test moving origin point to start control point for Arcs and Curves

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 78d00abc0b7..ff4828a9de6 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -489,8 +489,9 @@ static void gp_primitive_arc(tGPDprimitive *tgpi, tGPspoint 
*points2D)
UI_GetThemeColor4fv(TH_ACTIVE_VERT, color);
gp_primitive_set_cp(tgpi, tgpi->start, color, BIG_SIZE_CTL);
gp_primitive_set_cp(tgpi, tgpi->end, color, BIG_SIZE_CTL);
+   /* origin point follows start control point */
UI_GetThemeColor4fv(TH_REDALERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, tgpi->start, color, SMALL_SIZE_CTL);
 }
 
 /* create a bezier */
@@ -518,11 +519,13 @@ static void gp_primitive_bezier(tGPDprimitive *tgpi, 
tGPspoint *points2D)
UI_GetThemeColor4fv(TH_ACTIVE_VERT, color);
gp_primitive_set_cp(tgpi, tgpi->start, color, BIG_SIZE_CTL);
gp_primitive_set_cp(tgpi, tgpi->end, color, BIG_SIZE_CTL);
+   /* origin point follows start control point */
UI_GetThemeColor4fv(TH_REDALERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, tgpi->start, color, SMALL_SIZE_CTL);
+
UI_GetThemeColor4fv(TH_GP_VERTEX_SELECT, color);
-   gp_primitive_set_cp(tgpi, tgpi->cp1, color, BIG_SIZE_CTL);
-   gp_primitive_set_cp(tgpi, tgpi->cp2, color, BIG_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, tgpi->cp1, color, BIG_SIZE_CTL * 0.9f);
+   gp_primitive_set_cp(tgpi, tgpi->cp2, color, BIG_SIZE_CTL * 0.9f);
 }
 
 /* create a circle */

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


[Bf-blender-cvs] [fcb0e8c75f2] greasepencil-object: GP: Cleanup. Rename Beziers to Curve

2018-12-11 Thread Antonioya
Commit: fcb0e8c75f265218fa9c1f767a8234aafd3842a4
Author: Antonioya
Date:   Tue Dec 11 18:05:29 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBfcb0e8c75f265218fa9c1f767a8234aafd3842a4

GP: Cleanup. Rename Beziers to Curve

Beziers name can be misunderstood for users. Curve is more generic.

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M   release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M   release/scripts/startup/bl_ui/space_topbar.py
M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/editors/gpencil/gpencil_primitive.c

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 0ada09a9199..310dd4f0923 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -5707,13 +5707,13 @@ def km_3d_view_tool_gpencil_paint_arc(params):
 ]},
 )
 
-def km_3d_view_tool_gpencil_paint_bezier(params):
+def km_3d_view_tool_gpencil_paint_curve(params):
 return (
-"3D View Tool: Gpencil Paint, Bezier",
+"3D View Tool: Gpencil Paint, Curve",
 {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
 {"items": [
 ("gpencil.primitive", {"type": params.tool_tweak, "value": 'ANY'},
- {"properties": [("type", 'BEZIER'), ("wait_for_input", False)]}),
+ {"properties": [("type", 'CURVE'), ("wait_for_input", False)]}),
 ]},
 )  
 
@@ -5990,7 +5990,7 @@ def generate_keymaps(params=None):
 km_3d_view_tool_gpencil_paint_box(params),
 km_3d_view_tool_gpencil_paint_circle(params),
 km_3d_view_tool_gpencil_paint_arc(params),
-km_3d_view_tool_gpencil_paint_bezier(params),
+km_3d_view_tool_gpencil_paint_curve(params),
 km_3d_view_tool_gpencil_edit_select(params),
 km_3d_view_tool_gpencil_edit_select_box(params),
 km_3d_view_tool_gpencil_edit_select_circle(params),
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 e21022345f7..2cb554c2c50 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -645,7 +645,7 @@ class GPENCIL_MT_gpencil_draw_specials(Menu):
 layout.operator("gpencil.primitive", text="Rectangle", 
icon='UV_FACESEL').type = 'BOX'
 layout.operator("gpencil.primitive", text="Circle", 
icon='ANTIALIASED').type = 'CIRCLE'
 layout.operator("gpencil.primitive", text="Arc", 
icon='SPHERECURVE').type = 'ARC'
-layout.operator("gpencil.primitive", text="Bezier", 
icon='CURVE_BEZCURVE').type = 'BEZIER'
+layout.operator("gpencil.primitive", text="Curve", 
icon='CURVE_BEZCURVE').type = 'CURVE'
 
 
 class GPENCIL_MT_gpencil_draw_delete(Menu):
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py 
b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 6fdee5d18ff..fd36abab411 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1079,10 +1079,10 @@ class _defs_gpencil_paint:

 
 @ToolDef.from_fn
-def bezier():
+def curve():
 return dict(
-text="Bezier",
-icon="ops.gpencil.primitive_bezier",
+text="Curve",
+icon="ops.gpencil.primitive_curve",
 cursor='CROSSHAIR',
 widget=None,
 keymap=(),
@@ -1594,7 +1594,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, 
Panel):
 _defs_gpencil_paint.box,
 _defs_gpencil_paint.circle,
 _defs_gpencil_paint.arc,
-_defs_gpencil_paint.bezier,
+_defs_gpencil_paint.curve,
 ],
 'GPENCIL_EDIT': [
 *_tools_gpencil_select,
diff --git a/release/scripts/startup/bl_ui/space_topbar.py 
b/release/scripts/startup/bl_ui/space_topbar.py
index 7e21eff8dba..a8eaa3f3c34 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -301,7 +301,7 @@ class _draw_left_context_mode:
 return
 
 is_paint = True
-if (tool.name in {"Line", "Box", "Circle", "Arc", "Bezier"}):
+if (tool.name in {"Line", "Box", "Circle", "Arc", "Curve"}):
 is_paint = False
 elif (not tool.has_datablock):
 return
@@ -375,7 +375,7 @@ class _draw_left_context_mode:
 
 draw_color_selector()
 
-

[Bf-blender-cvs] [ba8d6ca3dd9] master: dependencies windows: Replace pthreads-win32 2.9.1 with pthreads4w 3.0.0

2018-12-11 Thread Ray Molenkamp
Commit: ba8d6ca3dd92eed5d679caa28f5446cd07b8a112
Author: Ray Molenkamp
Date:   Tue Dec 11 15:12:56 2018 -0700
Branches: master
https://developer.blender.org/rBba8d6ca3dd92eed5d679caa28f5446cd07b8a112

dependencies windows: Replace pthreads-win32 2.9.1 with pthreads4w 3.0.0

maintenance seems to have stopped for pthreads-win32

===

M   build_files/build_environment/cmake/blosc.cmake
M   build_files/build_environment/cmake/openvdb.cmake
M   build_files/build_environment/cmake/pthreads.cmake
M   build_files/build_environment/cmake/versions.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   source/creator/CMakeLists.txt

===

diff --git a/build_files/build_environment/cmake/blosc.cmake 
b/build_files/build_environment/cmake/blosc.cmake
index 18f258357c9..1cbf97063c0 100644
--- a/build_files/build_environment/cmake/blosc.cmake
+++ b/build_files/build_environment/cmake/blosc.cmake
@@ -23,7 +23,7 @@ set(BLOSC_EXTRA_ARGS
-DBUILD_BENCHMARKS=OFF
-DCMAKE_DEBUG_POSTFIX=_d
-DThreads_FOUND=1
-   -DPTHREAD_LIBS=${LIBDIR}/pthreads/lib/pthreadVC2.lib
+   -DPTHREAD_LIBS=${LIBDIR}/pthreads/lib/pthreadVC3.lib
-DPTHREAD_INCLUDE_DIR=${LIBDIR}/pthreads/inc
-DDEACTIVATE_SNAPPY=ON
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
diff --git a/build_files/build_environment/cmake/openvdb.cmake 
b/build_files/build_environment/cmake/openvdb.cmake
index ccdc00ee0d8..11456facbb2 100644
--- a/build_files/build_environment/cmake/openvdb.cmake
+++ b/build_files/build_environment/cmake/openvdb.cmake
@@ -55,7 +55,7 @@ if(WIN32)
# needs to link pthreads due to it being a blosc dependency
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS}
-DOPENEXR_NAMESPACE_VERSIONING=OFF
-   -DEXTRA_LIBS:FILEPATH=${LIBDIR}/pthreads/lib/pthreadVC2.lib
+   -DEXTRA_LIBS:FILEPATH=${LIBDIR}/pthreads/lib/pthreadVC3.lib
)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS}
diff --git a/build_files/build_environment/cmake/pthreads.cmake 
b/build_files/build_environment/cmake/pthreads.cmake
index 66246c5ee90..364ccb6cefe 100644
--- a/build_files/build_environment/cmake/pthreads.cmake
+++ b/build_files/build_environment/cmake/pthreads.cmake
@@ -20,9 +20,9 @@ if(WIN32)
set(PTHREAD_XCFLAGS /MD)
 
if(MSVC14) # vs2015 has timespec
-   set(PTHREAD_CPPFLAGS "/I. /DHAVE_PTW32_CONFIG_H 
/D_TIMESPEC_DEFINED ")
+   set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H 
/D_TIMESPEC_DEFINED ")
else() # everything before doesn't
-   set(PTHREAD_CPPFLAGS "/I. /DHAVE_PTW32_CONFIG_H ")
+   set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H ")
endif()
 
set(PTHREADS_BUILD cd 
${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC /e 
CPPFLAGS=${PTHREAD_CPPFLAGS} /e XCFLAGS=${PTHREAD_XCFLAGS} /e 
XLIBS=/NODEFAULTLIB:msvcr)
@@ -30,17 +30,17 @@ if(WIN32)
ExternalProject_Add(external_pthreads
URL ${PTHREADS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
-   URL_HASH SHA512=${PTHREADS_SHA512}
+   URL_HASH MD5=${PTHREADS_HASH}
PREFIX ${BUILD_DIR}/pthreads
CONFIGURE_COMMAND echo .
-   PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d 
${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff
BUILD_COMMAND ${PTHREADS_BUILD}
INSTALL_COMMAND COMMAND
-   ${CMAKE_COMMAND} -E copy 
${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2.dll 
${LIBDIR}/pthreads/lib/pthreadVC2.dll &&
-   ${CMAKE_COMMAND} -E copy 
${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2${LIBEXT} 
${LIBDIR}/pthreads/lib/pthreadVC2${LIBEXT} &&
+   ${CMAKE_COMMAND} -E copy 
${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC3.dll 
${LIBDIR}/pthreads/lib/pthreadVC3.dll &&
+   ${CMAKE_COMMAND} -E copy 
${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC3${LIBEXT} 
${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} &&
${CMAKE_COMMAND} -E copy 
${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h 
${LIBDIR}/pthreads/inc/pthread.h &&
${CMAKE_COMMAND} -E copy 
${BUILD_DIR}/pthreads/src/external_pthreads/sched.h 
${LIBDIR}/pthreads/inc/sched.h &&
-   ${CMAKE_COMMAND} -E copy 
${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h 
${LIBDIR}/pthreads/inc/semaphore.h
+   ${CMAKE_COMMAND} -E copy 

[Bf-blender-cvs] [6871402614f] blender2.8: Fix Cycles baking active/cage

2018-12-11 Thread Dalai Felinto
Commit: 6871402614f48ef9c454d057c544ed43abeb87ae
Author: Dalai Felinto
Date:   Fri Dec 7 17:01:45 2018 -0200
Branches: blender2.8
https://developer.blender.org/rB6871402614f48ef9c454d057c544ed43abeb87ae

Fix Cycles baking active/cage

Basically what we address here is to make sure the active object and the cage
are not interferring with the baking result (e.g., when baking Combined).

To do so, we take advantage of the fact that we create our own depsgraph
for baking. So now we can change the cowed objects, instead of the
original ones.

Note: There is still a way to get a crash. If you try to bake from
selected to active when is_cage, but with no cage object, we get an
assert:

```
BLI_assert failed: //source/blender/blenkernel/intern/DerivedMesh.c
mesh_calc_modifiers(), at
(((Mesh *)ob->data)->id.tag & LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT) == 0
```

We can bypass this by passing ob_low instead of ob_low_eval to
bake_mesh_new_from_object on object_bake_api.c:847 . But then the edge
split modifier change will take no effect.

===

M   source/blender/editors/object/object_bake_api.c
M   source/blender/render/extern/include/RE_bake.h

===

diff --git a/source/blender/editors/object/object_bake_api.c 
b/source/blender/editors/object/object_bake_api.c
index 90bb853e9d4..0bff5cb83cb 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -62,6 +62,7 @@
 
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_build.h"
+#include "DEG_depsgraph_query.h"
 
 #include "RE_engine.h"
 #include "RE_pipeline.h"
@@ -653,19 +654,20 @@ static int bake(
 const char *custom_cage, const char *filepath, const int width, const 
int height,
 const char *identifier, ScrArea *sa, const char *uv_layer)
 {
+   /* We build a depsgraph for the baking, so we don't need to change the 
original data to adjust visibility and modifiers. */
Depsgraph *depsgraph = DEG_graph_new(scene, view_layer, 
DAG_EVAL_RENDER);
+   DEG_graph_build_from_view_layer(depsgraph, bmain, scene, view_layer);
 
int op_result = OPERATOR_CANCELLED;
bool ok = false;
 
Object *ob_cage = NULL;
+   Object *ob_cage_eval = NULL;
+   Object *ob_low_eval = NULL;
 
BakeHighPolyData *highpoly = NULL;
int tot_highpoly = 0;
 
-   char restrict_flag_low = ob_low->restrictflag;
-   char restrict_flag_cage = 0;
-
Mesh *me_low = NULL;
Mesh *me_cage = NULL;
 
@@ -777,8 +779,9 @@ static int bake(
goto cleanup;
}
else {
-   restrict_flag_cage = ob_cage->restrictflag;
-   ob_cage->restrictflag |= OB_RESTRICT_RENDER;
+   ob_cage_eval = 
DEG_get_evaluated_object(depsgraph, ob_cage);
+   ob_cage_eval->restrictflag |= 
OB_RESTRICT_RENDER;
+   ob_cage_eval->base_flag &= ~(BASE_VISIBLE | 
BASE_ENABLED_RENDER);
}
}
}
@@ -797,8 +800,8 @@ static int bake(
}
 
/* Make sure depsgraph is up to date. */
-   DEG_graph_build_from_view_layer(depsgraph, bmain, scene, view_layer);
BKE_scene_graph_update_tagged(depsgraph, bmain);
+   ob_low_eval = DEG_get_evaluated_object(depsgraph, ob_low);
 
/* get the mesh as it arrives in the renderer */
me_low = bake_mesh_new_from_object(depsgraph, bmain, scene, ob_low);
@@ -810,8 +813,6 @@ static int bake(
 
if (is_selected_to_active) {
CollectionPointerLink *link;
-   ModifierData *md, *nmd;
-   ListBase modifiers_tmp, modifiers_original;
int i = 0;
 
/* prepare cage mesh */
@@ -825,30 +826,25 @@ static int bake(
}
}
else if (is_cage) {
-   modifiers_original = ob_low->modifiers;
-   BLI_listbase_clear(_tmp);
+   ModifierData *md = ob_low_eval->modifiers.first;
+   while (md) {
+   ModifierData *md_next = md->next;
 
-   for (md = ob_low->modifiers.first; md; md = md->next) {
/* Edge Split cannot be applied in the cage,
 * the cage is supposed to have interpolated 
normals
 * between the faces unless the geometry is 
physically
 * split. So we create a copy of the low poly 
mesh without
 * the eventual edge split.*/
 
-   if (md->type == eModifierType_EdgeSplit)
-   continue;
-
-   

[Bf-blender-cvs] [805bf5d602a] blender2.8: Keymap: add Shift-F1..3 editor shortcuts

2018-12-11 Thread Campbell Barton
Commit: 805bf5d602ac43fd23e6db2865e31b3f3d9cd04c
Author: Campbell Barton
Date:   Wed Dec 12 11:35:30 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB805bf5d602ac43fd23e6db2865e31b3f3d9cd04c

Keymap: add Shift-F1..3 editor shortcuts

Some frequently used editors didn't have F-key access.

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index efa48d69b31..6bce469c7dc 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -300,6 +300,9 @@ def km_window(params):
  {"type": k, "value": 'PRESS', "shift": True},
  {"properties": [("space_type", t)]})
 for k, t in (
+('F1', 'FILE_BROWSER'),
+('F2', 'CLIP_EDITOR'),
+('F3', 'NODE_EDITOR'),
 ('F4', 'CONSOLE'),
 ('F5', 'VIEW_3D'),
 ('F6', 'GRAPH_EDITOR'),

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


[Bf-blender-cvs] [5049322e625] blender2.8: GPUState: Change isolated glLineWidth usage to GPU_line_width

2018-12-11 Thread Clément Foucault
Commit: 5049322e6252617ab9477338bf2f5d3e4d7845d6
Author: Clément Foucault
Date:   Tue Dec 11 23:05:36 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB5049322e6252617ab9477338bf2f5d3e4d7845d6

GPUState: Change isolated glLineWidth usage to GPU_line_width

===

M   source/blender/draw/intern/draw_view.c
M   source/blender/editors/gpencil/gpencil_fill.c
M   source/blender/windowmanager/intern/wm_gesture.c

===

diff --git a/source/blender/draw/intern/draw_view.c 
b/source/blender/draw/intern/draw_view.c
index f56cbd68077..4a890c3be84 100644
--- a/source/blender/draw/intern/draw_view.c
+++ b/source/blender/draw/intern/draw_view.c
@@ -182,7 +182,7 @@ void DRW_draw_cursor(void)
RegionView3D *rv3d = ar->regiondata;
 
/* Draw nice Anti Aliased cursor. */
-   glLineWidth(1.0f);
+   GPU_line_width(1.0f);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
 
diff --git a/source/blender/editors/gpencil/gpencil_fill.c 
b/source/blender/editors/gpencil/gpencil_fill.c
index 6105a6b2523..68f463dbce0 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -70,6 +70,7 @@
 #include "GPU_draw.h"
 #include "GPU_matrix.h"
 #include "GPU_framebuffer.h"
+#include "GPU_state.h"
 
 #include "UI_interface.h"
 
@@ -151,7 +152,7 @@ static void gp_draw_basic_stroke(
immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR);
 
/* draw stroke curve */
-   glLineWidth(1.0f);
+   GPU_line_width(1.0f);
immBeginAtMost(GPU_PRIM_LINE_STRIP, totpoints + cyclic_add);
const bGPDspoint *pt = points;
 
diff --git a/source/blender/windowmanager/intern/wm_gesture.c 
b/source/blender/windowmanager/intern/wm_gesture.c
index 70150e40142..77734a361c1 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -53,6 +53,7 @@
 
 #include "GPU_immediate.h"
 #include "GPU_immediate_util.h"
+#include "GPU_state.h"
 
 #include "BIF_glutil.h"
 
@@ -418,7 +419,7 @@ void wm_gesture_draw(wmWindow *win)
 {
wmGesture *gt = (wmGesture *)win->gesture.first;
 
-   glLineWidth(1.0f);
+   GPU_line_width(1.0f);
for (; gt; gt = gt->next) {
/* all in subwindow space */
wmViewport(>winrct);

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


[Bf-blender-cvs] [c0b7bdd38b9] blender2.8: Revert "Tweak UI message of Ruler tool."

2018-12-11 Thread Campbell Barton
Commit: c0b7bdd38b9fca91f856fa46246995c344814ab7
Author: Campbell Barton
Date:   Wed Dec 12 09:52:49 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBc0b7bdd38b9fca91f856fa46246995c344814ab7

Revert "Tweak UI message of Ruler tool."

This reverts commit 1bf0a4f4d0d8c7e748f40d634aebf55eb37435ba.

This is a bug, clicks shouldn't remove rulers since it's too easy
to accidentally click instead of dragging.

===

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 bb7dd8d2a27..5c930b68dd9 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -97,7 +97,7 @@ class _defs_view3d_generic:
 "Measure distance and angles.\n"
 "\u2022 {} anywhere for new measurement.\n"
 "\u2022 Drag ruler segment to measure an angle.\n"
-"\u2022 Click on one end of the ruler to remove.\n"
+"\u2022 Drag ruler outside the view to remove.\n"
 "\u2022 Ctrl to snap.\n"
 "\u2022 Shift to measure surface thickness"
 ).format(

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


[Bf-blender-cvs] [1569196cf26] greasepencil-object: GP: Change Circle primitive control points

2018-12-11 Thread Charlie Jolly
Commit: 1569196cf2606d6da0c98f0726aba41f0198a5da
Author: Charlie Jolly
Date:   Wed Dec 12 01:08:19 2018 +
Branches: greasepencil-object
https://developer.blender.org/rB1569196cf2606d6da0c98f0726aba41f0198a5da

GP: Change Circle primitive control points

Changed to small red style.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index ddb6fdff29d..0e2f1c366b3 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -545,12 +545,11 @@ static void gp_primitive_circle(tGPDprimitive *tgpi, 
tGPspoint *points2D)
a += step;
}
float color[4];
-   UI_GetThemeColor4fv(TH_ACTIVE_VERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->start, color, BIG_SIZE_CTL);
-   gp_primitive_set_cp(tgpi, tgpi->end, color, BIG_SIZE_CTL);
UI_GetThemeColor4fv(TH_REDALERT, color);
+   gp_primitive_set_cp(tgpi, tgpi->start, color, SMALL_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, tgpi->end, color, SMALL_SIZE_CTL);
gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
-   gp_primitive_set_cp(tgpi, center, color, MID_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, center, color, SMALL_SIZE_CTL);
 }
 
 /* Helper: Update shape of the stroke */

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


[Bf-blender-cvs] [351cd57aa09] greasepencil-object: GP: Editable Arc tool

2018-12-11 Thread Charlie Jolly
Commit: 351cd57aa0908d5f04a705b89e8f708e12c999f5
Author: Charlie Jolly
Date:   Wed Dec 12 00:54:08 2018 +
Branches: greasepencil-object
https://developer.blender.org/rB351cd57aa0908d5f04a705b89e8f708e12c999f5

GP: Editable Arc tool

Arc tool is now editable like the Curve tool.
Unlike the curve (bezier) tool this uses an elliptical function.
Remove flip option as it is no longer needed.

===

M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/editors/gpencil/gpencil_primitive.c

===

diff --git a/source/blender/editors/gpencil/gpencil_intern.h 
b/source/blender/editors/gpencil/gpencil_intern.h
index 8653dad7ff2..fcbfb8af9fd 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -156,7 +156,6 @@ typedef struct tGPDprimitive {
struct bGPDframe *gpf;/* frame */
int type; /* type of primitive */
bool curve;   /* type of primitive is a curve */
-   short flip;   /* flip option */
tGPspoint *points;/* array of data-points for stroke */
int point_count;  /* number of edges allocated */
int tot_stored_edges; /* stored number of polygon edges */
@@ -164,6 +163,7 @@ typedef struct tGPDprimitive {
float origin[2];  /* initial box corner */
float start[2];   /* first box corner */
float end[2]; /* last box corner */
+   float midpoint[2];/* midpoint box corner */
float cp1[2]; /* first control point */
float cp2[2]; /* second control point */
int sel_cp;   /* flag to determine control point is 
selected */
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index af5632acfe3..ddb6fdff29d 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -1,4 +1,4 @@
-/*
+/*
  * * BEGIN GPL LICENSE BLOCK *
  *
  * This program is free software; you can redistribute it and/or
@@ -332,7 +332,7 @@ static void gpencil_primitive_status_indicators(bContext 
*C, tGPDprimitive *tgpi
BLI_strncpy(msg_str, IFACE_("Line: ESC/RMB to cancel, LMB set 
origin, Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to align, 
Alt to center"), UI_MAX_DRAW_STR);
}
else if (tgpi->type == GP_STROKE_ARC) {
-   BLI_strncpy(msg_str, IFACE_("Arc: ESC/RMB to cancel, Enter/LMB 
to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center, F 
to flip"), UI_MAX_DRAW_STR);
+   BLI_strncpy(msg_str, IFACE_("Arc: ESC/RMB to cancel, Enter/LMB 
to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center"), 
UI_MAX_DRAW_STR);
}
else if (tgpi->type == GP_STROKE_CURVE) {
BLI_strncpy(msg_str, IFACE_("Curve: ESC/RMB to cancel, 
Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to 
center"), UI_MAX_DRAW_STR);
@@ -458,28 +458,25 @@ static void gp_primitive_arc(tGPDprimitive *tgpi, 
tGPspoint *points2D)
 {
const int totpoints = (tgpi->tot_edges + tgpi->tot_stored_edges);
const float step = M_PI_2 / (float)(tgpi->tot_edges - 1);
-   float length[2];
float start[2];
float end[2];
-   float origin[2];
+   float cp1[2];
+   float corner[2];
+   float midpoint[2];
float a = 0.0f;
-
+   
copy_v2_v2(start, tgpi->start);
copy_v2_v2(end, tgpi->end);
-   copy_v2_v2(origin, tgpi->origin);
-
-   if (tgpi->flip) {
-   SWAP(int, end[0], start[0]);
-   SWAP(int, end[1], start[1]);
-   }
-
-   length[0] = end[0] - start[0];
-   length[1] = end[1] - start[1];
+   copy_v2_v2(cp1, tgpi->cp1);
+   copy_v2_v2(midpoint, tgpi->midpoint);
 
+   corner[0] = midpoint[0] - (cp1[0] - midpoint[0]);
+   corner[1] = midpoint[1] - (cp1[1] - midpoint[1]);
+   
for (int i = tgpi->tot_stored_edges; i < totpoints; i++) {
tGPspoint *p2d = [i];
-   p2d->x = (start[0] + sinf(a) * length[0]);
-   p2d->y = (end[1] - cosf(a) * length[1]);
+   p2d->x = corner[0] + (end[0] - corner[0]) * sinf(a) + (start[0] 
- corner[0]) * cosf(a);
+   p2d->y = corner[1] + (end[1] - corner[1]) * sinf(a) + (start[1] 
- corner[1]) * cosf(a);
a += step;
}
float color[4];
@@ -489,6 +486,8 @@ static void gp_primitive_arc(tGPDprimitive *tgpi, tGPspoint 
*points2D)
/* origin point follows start control point */

[Bf-blender-cvs] [ff108aac631] blender2.8: Fix rulers being removed on click

2018-12-11 Thread Campbell Barton
Commit: ff108aac631f0f48e138fe4b4b850b2103cb0c57
Author: Campbell Barton
Date:   Wed Dec 12 10:04:24 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBff108aac631f0f48e138fe4b4b850b2103cb0c57

Fix rulers being removed on click

===

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

===

diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c 
b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
index 83db61f9e5a..5623681fec4 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
@@ -912,6 +912,9 @@ static int gizmo_ruler_invoke(
copy_v3_v3(inter->drag_start_co, 
ruler_item_pick->co[inter->co_index]);
}
 
+   /* Should always be true. */
+   inter->inside_region = BLI_rcti_isect_pt_v(>winrct, >x);
+
return OPERATOR_RUNNING_MODAL;
 }

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


[Bf-blender-cvs] [63360df98fb] greasepencil-object: GP: Primitives: Adjust control point styles

2018-12-11 Thread Charlie Jolly
Commit: 63360df98fb81b79adaf8f7d59f872fd0cc9cb3d
Author: Charlie Jolly
Date:   Wed Dec 12 01:19:01 2018 +
Branches: greasepencil-object
https://developer.blender.org/rB63360df98fb81b79adaf8f7d59f872fd0cc9cb3d

GP: Primitives: Adjust control point styles

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 0e2f1c366b3..5a77b176134 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -407,9 +407,11 @@ static void gp_primitive_rectangle(tGPDprimitive *tgpi, 
tGPspoint *points2D)
}
}
 
+   mid_v2_v2v2(tgpi->midpoint, tgpi->start, tgpi->end);
float color[4];
UI_GetThemeColor4fv(TH_REDALERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->origin, color, 10);
+   gp_primitive_set_cp(tgpi, tgpi->origin, color, SMALL_SIZE_CTL);
+   gp_primitive_set_cp(tgpi, tgpi->midpoint, color, SMALL_SIZE_CTL);
 }
 
 /* create a line */
@@ -483,9 +485,6 @@ static void gp_primitive_arc(tGPDprimitive *tgpi, tGPspoint 
*points2D)
UI_GetThemeColor4fv(TH_ACTIVE_VERT, color);
gp_primitive_set_cp(tgpi, tgpi->start, color, BIG_SIZE_CTL);
gp_primitive_set_cp(tgpi, tgpi->end, color, BIG_SIZE_CTL);
-   /* origin point follows start control point */
-   UI_GetThemeColor4fv(TH_REDALERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->start, color, SMALL_SIZE_CTL);
UI_GetThemeColor4fv(TH_GP_VERTEX_SELECT, color);
gp_primitive_set_cp(tgpi, tgpi->cp1, color, BIG_SIZE_CTL * 0.9f);
 }
@@ -515,9 +514,6 @@ static void gp_primitive_bezier(tGPDprimitive *tgpi, 
tGPspoint *points2D)
UI_GetThemeColor4fv(TH_ACTIVE_VERT, color);
gp_primitive_set_cp(tgpi, tgpi->start, color, BIG_SIZE_CTL);
gp_primitive_set_cp(tgpi, tgpi->end, color, BIG_SIZE_CTL);
-   /* origin point follows start control point */
-   UI_GetThemeColor4fv(TH_REDALERT, color);
-   gp_primitive_set_cp(tgpi, tgpi->start, color, SMALL_SIZE_CTL);
UI_GetThemeColor4fv(TH_GP_VERTEX_SELECT, color);
gp_primitive_set_cp(tgpi, tgpi->cp1, color, BIG_SIZE_CTL * 0.9f);
gp_primitive_set_cp(tgpi, tgpi->cp2, color, BIG_SIZE_CTL * 0.9f);

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


[Bf-blender-cvs] [4bf2530952c] blender2.8: FFmpeg: enable multi-threaded encoding of multiple frames, for a ~20% speedup.

2018-12-11 Thread Mal Duffin
Commit: 4bf2530952c0c772f42595fa79a2c0a9a7559314
Author: Mal Duffin
Date:   Tue Dec 11 20:38:01 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB4bf2530952c0c772f42595fa79a2c0a9a7559314

FFmpeg: enable multi-threaded encoding of multiple frames, for a ~20% speedup.

This enables ffmpeg to encode each frame in its own thread. However in most
cases Blender does not pass frames to ffmpeg fast enough to actually use the
more than two threads. In some tests the speed was measured to be about 20%.
If other parts of the video sequencer get optimized, this should improve.

Differential Revision: https://developer.blender.org/D4031

===

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

===

diff --git a/source/blender/blenkernel/intern/writeffmpeg.c 
b/source/blender/blenkernel/intern/writeffmpeg.c
index 06f11301acb..27c26a93bf5 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -543,6 +543,9 @@ static AVStream *alloc_video_stream(FFMpegContext *context, 
RenderData *rd, int
/* Set up the codec context */
 
c = st->codec;
+   c->thread_count = 0;
+   c->thread_type = FF_THREAD_FRAME;
+
c->codec_id = codec_id;
c->codec_type = AVMEDIA_TYPE_VIDEO;
 
@@ -703,6 +706,9 @@ static AVStream *alloc_audio_stream(FFMpegContext *context, 
RenderData *rd, int
st->id = 1;
 
c = st->codec;
+   c->thread_count = 0;
+   c->thread_type = FF_THREAD_FRAME;
+
c->codec_id = codec_id;
c->codec_type = AVMEDIA_TYPE_AUDIO;

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


[Bf-blender-cvs] [d1237d24ca8] blender2.8: Merge remote-tracking branch 'origin/master' into blender2.8

2018-12-11 Thread Ray Molenkamp
Commit: d1237d24ca8e98536c2a2a05c0143b5fe61e8144
Author: Ray Molenkamp
Date:   Tue Dec 11 15:14:00 2018 -0700
Branches: blender2.8
https://developer.blender.org/rBd1237d24ca8e98536c2a2a05c0143b5fe61e8144

Merge remote-tracking branch 'origin/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] [220ab6290e5] blender2.8: Fix toolbar key-accelerator w/ LMB select

2018-12-11 Thread Campbell Barton
Commit: 220ab6290e55a67778d6fbf82467a2170fbee413
Author: Campbell Barton
Date:   Wed Dec 12 09:39:36 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB220ab6290e55a67778d6fbf82467a2170fbee413

Fix toolbar key-accelerator w/ LMB select

Tweak events were masking hotkey access.

Reported in T55162

===

M   release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py

===

diff --git a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py 
b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
index 501b15c3dc3..7f85faa4ba6 100644
--- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
+++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py
@@ -129,7 +129,10 @@ def generate(context, space_type):
 kmi_hack_brush_select.active = False
 
 if use_release_confirm or use_tap_reset:
-kmi_toolbar = 
wm.keyconfigs.find_item_from_operator(idname="wm.toolbar")[1]
+kmi_toolbar = wm.keyconfigs.find_item_from_operator(
+idname="wm.toolbar",
+is_hotkey=True,
+)[1]
 kmi_toolbar_type = None if not kmi_toolbar else kmi_toolbar.type
 if use_tap_reset and kmi_toolbar_type is not None:
 kmi_toolbar_args_type_only = {"type": kmi_toolbar_type}
@@ -148,6 +151,7 @@ def generate(context, space_type):
 context='INVOKE_REGION_WIN',
 # properties={"name": item.text},
 properties=kmi_hack_properties,
+is_hotkey=True,
 )[1]
 if kmi_found:
 use_tap_reset = False
@@ -180,6 +184,7 @@ def generate(context, space_type):
 context='INVOKE_REGION_WIN',
 # properties={"name": item.text},
 properties=kmi_hack_properties,
+is_hotkey=True,
 )[1]
 
 if kmi_found is None:
@@ -200,6 +205,7 @@ def generate(context, space_type):
 idname="paint.brush_select",
 context='INVOKE_REGION_WIN',
 properties=kmi_hack_brush_select_properties,
+is_hotkey=True,
 )[1]
 else:
 print("Unsupported mode:", mode)
@@ -214,6 +220,7 @@ def generate(context, space_type):
 kmi_found = wm.keyconfigs.find_item_from_operator(
 idname=item.operator,
 context='INVOKE_REGION_WIN',
+is_hotkey=True,
 )[1]
 elif item.keymap is not None:
 km = keyconf.keymaps.get(item.keymap[0])
@@ -228,6 +235,7 @@ def generate(context, space_type):
 idname=kmi_first.idname,
 # properties=kmi_first.properties,  # prevents 
matches, don't use.
 context='INVOKE_REGION_WIN',
+is_hotkey=True,
 )[1]
 else:
 kmi_found = None

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


[Bf-blender-cvs] [174acd9ca37] blender2.8: Fix T59210: Measure tool crash w/o overlays/gizmos

2018-12-11 Thread Campbell Barton
Commit: 174acd9ca376a4fb0e4a50d27359ee5f8ac7f3fe
Author: Campbell Barton
Date:   Wed Dec 12 10:44:04 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB174acd9ca376a4fb0e4a50d27359ee5f8ac7f3fe

Fix T59210: Measure tool crash w/o overlays/gizmos

===

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

===

diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c 
b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
index 5623681fec4..ed5a1ab7720 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c
@@ -33,6 +33,7 @@
 #include "BKE_context.h"
 #include "BKE_gpencil.h"
 #include "BKE_main.h"
+#include "BKE_report.h"
 
 #include "BKE_object.h"
 #include "BKE_unit.h"
@@ -1037,12 +1038,19 @@ static bool view3d_ruler_poll(bContext *C)
return true;
 }
 
-static int view3d_ruler_add_invoke(bContext *C, wmOperator *UNUSED(op), const 
wmEvent *event)
+static int view3d_ruler_add_invoke(bContext *C, wmOperator *op, const wmEvent 
*event)
 {
ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d = ar->regiondata;
 
+   if ((v3d->flag2 & V3D_RENDER_OVERRIDE) ||
+   (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL)))
+   {
+   BKE_report(op->reports, RPT_WARNING, "Gizmos hidden in this 
view");
+   return OPERATOR_CANCELLED;
+   }
+
wmGizmoMap *gzmap = ar->gizmo_map;
wmGizmoGroup *gzgroup = WM_gizmomap_group_find(gzmap, 
view3d_gzgt_ruler_id);
const bool use_depth = (v3d->shading.type >= OB_SOLID);

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


[Bf-blender-cvs] [16fc62e15f0] blender2.8: Docs: correct doxy comments

2018-12-11 Thread Campbell Barton
Commit: 16fc62e15f0a749d6d64e784ea048e07d6ea3397
Author: Campbell Barton
Date:   Wed Dec 12 12:17:42 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB16fc62e15f0a749d6d64e784ea048e07d6ea3397

Docs: correct doxy comments

===

M   source/blender/blenkernel/intern/particle.c
M   source/blender/blenlib/intern/math_solvers.c
M   source/blender/blenlib/intern/path_util.c
M   source/blender/editors/space_view3d/view3d_utils.c
M   source/blender/editors/transform/transform_snap_object.c
M   source/blender/gpu/intern/gpu_immediate_util.c
M   source/blender/gpu/intern/gpu_material.c
M   source/blender/windowmanager/gizmo/intern/wm_gizmo.c

===

diff --git a/source/blender/blenkernel/intern/particle.c 
b/source/blender/blenkernel/intern/particle.c
index 5bfadd9b277..d51b39514f4 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1322,13 +1322,13 @@ static void psys_origspace_to_w(OrigSpaceFace *osface, 
int quad, const float w[4
  * Find the final derived mesh tessface for a particle, from its original 
tessface index.
  * This is slow and can be optimized but only for many lookups.
  *
- * \param dm_final final DM, it may not have the same topology as original 
mesh.
- * \param dm_deformed deformed-only DM, it has the exact same topology as 
original mesh.
- * \param findex_orig the input tessface index.
- * \param fw face weights (position of the particle inside the \a findex_orig 
tessface).
- * \param poly_nodes may be NULL, otherwise an array of linked list, one for 
each final DM polygon, containing all
- *   its tessfaces indices.
- * \return the DM tessface index.
+ * \param mesh_final: Final mesh, it may not have the same topology as 
original mesh.
+ * \param mesh_original: Original mesh, use for accessing #MPoly to #MFace 
mapping.
+ * \param findex_orig: The input tessface index.
+ * \param fw: Face weights (position of the particle inside the \a findex_orig 
tessface).
+ * \param poly_nodes: May be NULL, otherwise an array of linked list,
+ * one for each final \a mesh_final polygon, containing all its tessfaces 
indices.
+ * \return The \a mesh_final tessface index.
  */
 int psys_particle_dm_face_lookup(
 Mesh *mesh_final, Mesh *mesh_original,
diff --git a/source/blender/blenlib/intern/math_solvers.c 
b/source/blender/blenlib/intern/math_solvers.c
index 7b9727ead8e..23fd10e0242 100644
--- a/source/blender/blenlib/intern/math_solvers.c
+++ b/source/blender/blenlib/intern/math_solvers.c
@@ -189,7 +189,6 @@ bool BLI_tridiagonal_solve_cyclic(const float *a, const 
float *b, const float *c
  * \param userdata Data for the callbacks.
  * \param epsilon Desired precision.
  * \param max_iterations Limit on the iterations.
- * \param max_corrections Limit on the number of times the correction callback 
can fire before giving up.
  * \param trace Enables logging to console.
  * \param x_init Initial solution vector.
  * \param result Final result.
diff --git a/source/blender/blenlib/intern/path_util.c 
b/source/blender/blenlib/intern/path_util.c
index a7118a583b5..885fb4d9202 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -80,10 +80,10 @@ static bool BLI_path_is_abs(const char *name);
  * Looks for a sequence of decimal digits in string, preceding any filename 
extension,
  * returning the integer value if found, or 0 if not.
  *
- * \param string  String to scan.
- * \param head  Optional area to return copy of part of string prior to 
digits, or before dot if no digits.
- * \param tail  Optional area to return copy of part of string following 
digits, or from dot if no digits.
- * \param numlen  Optional to return number of digits found.
+ * \param string: String to scan.
+ * \param head: Optional area to return copy of part of string prior to 
digits, or before dot if no digits.
+ * \param tail: Optional area to return copy of part of string following 
digits, or from dot if no digits.
+ * \param r_num_len: Optional to return number of digits found.
  */
 int BLI_stringdec(const char *string, char *head, char *tail, ushort 
*r_num_len)
 {
diff --git a/source/blender/editors/space_view3d/view3d_utils.c 
b/source/blender/editors/space_view3d/view3d_utils.c
index a5be2a8cc83..bcfaf9e9afa 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -1333,7 +1333,6 @@ void ED_view3d_to_m4(float mat[4][4], const float ofs[3], 
const float quat[4], c
 
 /**
  * Set the RegionView3D members from an objects transformation and optionally 
lens.
- * \param depsgraph The depsgraph to get the evaluated object for the lens 
calculation.
  * \param ob The object to set the view to.
  * \param ofs The view offset to be set, normally from 

[Bf-blender-cvs] [b87b6e8e289] blender2.8: Fix T59211: Edit-mesh display crashes

2018-12-11 Thread Campbell Barton
Commit: b87b6e8e289cdc15c730341d840ca5fd9836a430
Author: Campbell Barton
Date:   Wed Dec 12 11:12:34 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBb87b6e8e289cdc15c730341d840ca5fd9836a430

Fix T59211: Edit-mesh display crashes

Caused by ae1f563899de4

===

M   source/blender/draw/intern/draw_cache_impl_mesh.c

===

diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c 
b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 508f3d6da69..9438995ec6f 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -949,20 +949,19 @@ static MeshRenderData *mesh_render_data_create_ex(
 }
 
 /* Warning replace mesh pointer. */
-#define MBC_GET_FINAL_MESH(mesh) do { \
+#define MBC_GET_FINAL_MESH(me) \
/* Hack to show the final result. */ \
-   const bool use_em_final = ( \
-   (mesh)->edit_btmesh && \
-   (mesh)->edit_btmesh->mesh_eval_final && \
-   ((mesh)->edit_btmesh->mesh_eval_final->runtime.is_original == 
false)); \
-   Mesh me_fake; \
-   if (use_em_final) { \
-   me_fake = *(mesh)->edit_btmesh->mesh_eval_final; \
-   me_fake.mat = (mesh)->mat; \
-   me_fake.totcol = (mesh)->totcol; \
-   (mesh) = _fake; \
-   } \
-} while (0)
+   const bool _use_em_final = ( \
+   (me)->edit_btmesh && \
+   (me)->edit_btmesh->mesh_eval_final && \
+   ((me)->edit_btmesh->mesh_eval_final->runtime.is_original == 
false)); \
+   Mesh _me_fake; \
+   if (_use_em_final) { \
+   _me_fake = *(me)->edit_btmesh->mesh_eval_final; \
+   _me_fake.mat = (me)->mat; \
+   _me_fake.totcol = (me)->totcol; \
+   (me) = &_me_fake; \
+   } ((void)0)
 
 static void mesh_render_data_free(MeshRenderData *rdata)
 {

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


[Bf-blender-cvs] [73b19bfb275] blender2.8: UI: fix enum icon buttons haveing different size.

2018-12-11 Thread Harley Acheson
Commit: 73b19bfb2756ff562eb936f5a1a30172e85fca6c
Author: Harley Acheson
Date:   Tue Dec 11 11:23:13 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB73b19bfb2756ff562eb936f5a1a30172e85fca6c

UI: fix enum icon buttons haveing different size.

The alignment makes it so the button edges overlap, now one pixel is removed
to account for this.

Differential Revision: https://developer.blender.org/D4063

===

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 8a27fd55d37..c0706ed8450 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -721,7 +721,7 @@ static void ui_item_enum_expand_exec(
if (icon && name[0] && !icon_only)
but = uiDefIconTextButR_prop(block, but_type, 0, icon, 
name, 0, 0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
else if (icon)
-   but = uiDefIconButR_prop(block, but_type, 0, icon, 0, 
0, itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);
+   but = uiDefIconButR_prop(block, but_type, 0, icon, 0, 
0, (is_first) ? itemw : itemw - UI_DPI_FAC, h, ptr, prop, -1, 0, value, -1, -1, 
NULL);
else
but = uiDefButR_prop(block, but_type, 0, name, 0, 0, 
itemw, h, ptr, prop, -1, 0, value, -1, -1, NULL);

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


[Bf-blender-cvs] [bf2e0c75984] blender2.8: GPUState: Remove glLineWidth warnings about size 0x0

2018-12-11 Thread Clément Foucault
Commit: bf2e0c759843e50c85eefd0654e7c4c5efe612d9
Author: Clément Foucault
Date:   Tue Dec 11 21:15:39 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBbf2e0c759843e50c85eefd0654e7c4c5efe612d9

GPUState: Remove glLineWidth warnings about size 0x0

===

M   source/blender/gpu/intern/gpu_state.c

===

diff --git a/source/blender/gpu/intern/gpu_state.c 
b/source/blender/gpu/intern/gpu_state.c
index d06854f669f..767437a0255 100644
--- a/source/blender/gpu/intern/gpu_state.c
+++ b/source/blender/gpu/intern/gpu_state.c
@@ -122,9 +122,7 @@ void GPU_line_width(float width)
float max_size = GPU_max_line_width();
float final_size = width * U.pixelsize;
/* Fix opengl errors on certain platform / drivers. */
-   if (max_size < final_size) {
-   final_size = max_size;
-   }
+   CLAMP(final_size, 1.0f, max_size);
glLineWidth(final_size);
 }

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


[Bf-blender-cvs] [c1b8007cea7] temp-outliner-visibility: Merge remote-tracking branch 'origin/blender2.8' into temp-outliner-visibility

2018-12-11 Thread Dalai Felinto
Commit: c1b8007cea7c6ca3c0475da31d748e234ae94421
Author: Dalai Felinto
Date:   Tue Dec 11 16:23:40 2018 -0200
Branches: temp-outliner-visibility
https://developer.blender.org/rBc1b8007cea7c6ca3c0475da31d748e234ae94421

Merge remote-tracking branch 'origin/blender2.8' into temp-outliner-visibility

===



===

diff --cc source/blender/editors/object/object_edit.c
index 45e45b849ca,efbea1ee30e..392f4fb83d8
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@@ -295,8 -295,7 +295,8 @@@ static int object_hide_collection_exec(
  
BKE_layer_collection_set_visible(scene, view_layer, lc, extend);
  
 +  DEG_relations_tag_update(CTX_data_main(C));
-   DEG_id_tag_update(>id, DEG_TAG_BASE_FLAGS_UPDATE);
+   DEG_id_tag_update(>id, ID_RECALC_BASE_FLAGS);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
  
return OPERATOR_FINISHED;
diff --cc source/blender/editors/space_outliner/outliner_draw.c
index 41052215a8b,6cf7e2ce0a1..a5c3d3fade1
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@@ -280,34 -279,21 +280,34 @@@ static void hidebutton_base_flag_cb(bCo
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = poin;
Base *base = poin2;
 -  bool extend = (CTX_wm_window(C)->eventstate->ctrl == 0);
 -
 -  /* Undo button toggle, let function do it. */
 -  base->flag ^= BASE_HIDDEN;
 -
 -  BKE_base_set_visible(scene, view_layer, base, extend);
 +  Object *ob = base->object;
 +  bool freeze = (CTX_wm_window(C)->eventstate->ctrl != 0);
 +  bool changed_restrict_view = false;
  
 -  if (!extend && (base->flag & BASE_VISIBLE)) {
 -  /* Auto select solo-ed object. */
 -  ED_object_base_select(base, BA_SELECT);
 -  view_layer->basact = base;
 +  if (freeze) {
 +  ob->restrictflag |= OB_RESTRICT_VIEW;
 +  changed_restrict_view = true;
 +  }
 +  else if (ob->restrictflag & OB_RESTRICT_VIEW) {
 +  ob->restrictflag &= ~OB_RESTRICT_VIEW;
 +  base->flag &= ~BASE_HIDDEN;
 +  changed_restrict_view = true;
 +  }
 +  else {
 +  base->flag ^= BASE_HIDDEN;
}
  
 -  DEG_id_tag_update(>id, ID_RECALC_BASE_FLAGS);
 -  WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
 +  if (changed_restrict_view) {
 +  BKE_main_collection_sync(bmain);
-   DEG_id_tag_update(>id, DEG_TAG_COPY_ON_WRITE);
++  DEG_id_tag_update(>id, ID_RECALC_COPY_ON_WRITE);
 +  DEG_relations_tag_update(bmain);
 +  WM_main_add_notifier(NC_OBJECT | ND_DRAW, >id);
 +  }
 +  if (!freeze) {
 +  BKE_layer_collection_sync(scene, view_layer);
-   DEG_id_tag_update(>id, DEG_TAG_BASE_FLAGS_UPDATE);
++  DEG_id_tag_update(>id, ID_RECALC_BASE_FLAGS);
 +  WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
 +  }
  }
  
  static void hidebutton_layer_collection_flag_cb(bContext *C, void *poin, void 
*poin2)
@@@ -315,25 -301,15 +315,25 @@@
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = poin;
LayerCollection *lc = poin2;
 -  bool extend = (CTX_wm_window(C)->eventstate->ctrl == 0);
 +  Collection *collection = lc->collection;
 +  bool freeze = (CTX_wm_window(C)->eventstate->ctrl != 0);
  
 -  /* Undo button toggle, let function do it. */
 -  lc->runtime_flag ^= LAYER_COLLECTION_HAS_VISIBLE_OBJECTS;
 +  if (freeze) {
 +  collection->flag |= COLLECTION_RESTRICT_VIEW;
 +  }
 +  else if (collection->flag & COLLECTION_RESTRICT_VIEW) {
 +  collection->flag &= ~COLLECTION_RESTRICT_VIEW;
 +  lc->flag &= ~LAYER_COLLECTION_RESTRICT_VIEW;
 +  }
 +  else {
 +  lc->flag ^= LAYER_COLLECTION_RESTRICT_VIEW;
 +  }
  
 -  BKE_layer_collection_set_visible(scene, view_layer, lc, extend);
 +  BKE_layer_collection_sync(scene, view_layer);
  
-   DEG_id_tag_update(>id, DEG_TAG_BASE_FLAGS_UPDATE);
+   DEG_id_tag_update(>id, ID_RECALC_BASE_FLAGS);
 -  WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
 +  DEG_relations_tag_update(CTX_data_main(C));
 +  WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL);
  }
  
  static void namebutton_cb(bContext *C, void *tsep, char *oldname)

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


[Bf-blender-cvs] [0ba02c6e9e5] blender2.8: GPUTexture: Add debug output to check what texture was created

2018-12-11 Thread Clément Foucault
Commit: 0ba02c6e9e5459936438c6a0f69b8a2a8336c936
Author: Clément Foucault
Date:   Tue Dec 11 21:14:52 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB0ba02c6e9e5459936438c6a0f69b8a2a8336c936

GPUTexture: Add debug output to check what texture was created

===

M   source/blender/gpu/intern/gpu_texture.c

===

diff --git a/source/blender/gpu/intern/gpu_texture.c 
b/source/blender/gpu/intern/gpu_texture.c
index 0944e5e4e44..052674e7090 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -134,6 +134,49 @@ uint GPU_texture_memory_usage_get(void)
 
 /*  */
 
+static const char *gl_enum_to_str(GLenum e)
+{
+#define ENUM_TO_STRING(e) [GL_##e] = STRINGIFY_ARG(e)
+   static const char *enum_strings[] = {
+   ENUM_TO_STRING(TEXTURE_2D),
+   ENUM_TO_STRING(TEXTURE_2D_ARRAY),
+   ENUM_TO_STRING(TEXTURE_1D),
+   ENUM_TO_STRING(TEXTURE_1D_ARRAY),
+   ENUM_TO_STRING(TEXTURE_3D),
+   ENUM_TO_STRING(TEXTURE_2D_MULTISAMPLE),
+   ENUM_TO_STRING(RGBA32F),
+   ENUM_TO_STRING(RGBA16F),
+   ENUM_TO_STRING(RGBA16),
+   ENUM_TO_STRING(RG32F),
+   ENUM_TO_STRING(RGB16F),
+   ENUM_TO_STRING(RG16F),
+   ENUM_TO_STRING(RG16I),
+   ENUM_TO_STRING(RG16),
+   ENUM_TO_STRING(RGBA8),
+   ENUM_TO_STRING(RGBA8UI),
+   ENUM_TO_STRING(R32F),
+   ENUM_TO_STRING(R32UI),
+   ENUM_TO_STRING(R32I),
+   ENUM_TO_STRING(R16F),
+   ENUM_TO_STRING(R16I),
+   ENUM_TO_STRING(R16UI),
+   ENUM_TO_STRING(RG8),
+   ENUM_TO_STRING(RG16UI),
+   ENUM_TO_STRING(R16),
+   ENUM_TO_STRING(R8),
+   ENUM_TO_STRING(R8UI),
+   ENUM_TO_STRING(R11F_G11F_B10F),
+   ENUM_TO_STRING(DEPTH24_STENCIL8),
+   ENUM_TO_STRING(DEPTH32F_STENCIL8),
+   ENUM_TO_STRING(DEPTH_COMPONENT32F),
+   ENUM_TO_STRING(DEPTH_COMPONENT24),
+   ENUM_TO_STRING(DEPTH_COMPONENT16),
+   };
+#undef ENUM_TO_STRING
+
+   return enum_strings[e];
+}
+
 static int gpu_get_component_count(GPUTextureFormat format)
 {
switch (format) {
@@ -600,11 +643,20 @@ GPUTexture *GPU_texture_create_nD(
float *rescaled_pixels = NULL;
bool valid = gpu_texture_try_alloc(tex, proxy, internalformat, 
data_format, data_type, tex->components, can_rescale,
   pixels, _pixels);
+
+   if (G.debug & G_DEBUG_GPU || !valid) {
+
+   printf("GPUTexture: create : %s, %s, w : %d, h : %d, d : %d, 
comp : %d\n",
+  gl_enum_to_str(tex->target), 
gl_enum_to_str(internalformat), w, h, d, tex->components);
+   }
+
if (!valid) {
-   if (err_out)
-   BLI_snprintf(err_out, 256, "GPUTexture: texture alloc 
failed");
-   else
-   fprintf(stderr, "GPUTexture: texture alloc failed. Not 
enough Video Memory.");
+   if (err_out) {
+   BLI_snprintf(err_out, 256, "GPUTexture: texture alloc 
failed\n");
+   }
+   else {
+   fprintf(stderr, "GPUTexture: texture alloc failed. 
Likely not enough Video Memory.\n");
+   }
GPU_texture_free(tex);
return NULL;
}

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


[Bf-blender-cvs] [70d38a996eb] blender2.8: GPUTexture: Fix memory statistics not working for Multisamples textures

2018-12-11 Thread Clément Foucault
Commit: 70d38a996eb507dd9e35c265153934191ccba855
Author: Clément Foucault
Date:   Tue Dec 11 22:10:16 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB70d38a996eb507dd9e35c265153934191ccba855

GPUTexture: Fix memory statistics not working for Multisamples textures

and also output the vram footprint of the texture at the creation.

Also output the full texture memory usage if alloc fails.

===

M   source/blender/gpu/intern/gpu_texture.c

===

diff --git a/source/blender/gpu/intern/gpu_texture.c 
b/source/blender/gpu/intern/gpu_texture.c
index 052674e7090..75eb17546ac 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -99,7 +99,7 @@ static uint memory_usage;
 static uint gpu_texture_memory_footprint_compute(GPUTexture *tex)
 {
int samp = max_ii(tex->samples, 1);
-   switch (tex->target) {
+   switch (tex->target_base) {
case GL_TEXTURE_1D:
return tex->bytesize * tex->w * samp;
case GL_TEXTURE_1D_ARRAY:
@@ -607,8 +607,6 @@ GPUTexture *GPU_texture_create_nD(
GLenum data_format = gpu_get_gl_dataformat(tex_format, 
>format_flag);
GLenum data_type = gpu_get_gl_datatype(gpu_data_format);
 
-   gpu_texture_memory_footprint_add(tex);
-
/* Generate Texture object */
tex->bindcode = GPU_tex_alloc();
 
@@ -645,9 +643,10 @@ GPUTexture *GPU_texture_create_nD(
   pixels, _pixels);
 
if (G.debug & G_DEBUG_GPU || !valid) {
-
-   printf("GPUTexture: create : %s, %s, w : %d, h : %d, d : %d, 
comp : %d\n",
-  gl_enum_to_str(tex->target), 
gl_enum_to_str(internalformat), w, h, d, tex->components);
+   printf("GPUTexture: create : %s, %s, w : %d, h : %d, d : %d, 
comp : %d, size : %.2f MiB\n",
+  gl_enum_to_str(tex->target), 
gl_enum_to_str(internalformat),
+  w, h, d, tex->components,
+  gpu_texture_memory_footprint_compute(tex) / 1048576.0f);
}
 
if (!valid) {
@@ -656,11 +655,15 @@ GPUTexture *GPU_texture_create_nD(
}
else {
fprintf(stderr, "GPUTexture: texture alloc failed. 
Likely not enough Video Memory.\n");
+   fprintf(stderr, "Current texture memory usage : %.2f 
MiB.\n",
+   
gpu_texture_memory_footprint_compute(tex) / 1048576.0f);
}
GPU_texture_free(tex);
return NULL;
}
 
+   gpu_texture_memory_footprint_add(tex);
+
/* Upload Texture */
const float *pix = (rescaled_pixels) ? rescaled_pixels : pixels;
 
@@ -749,8 +752,6 @@ static GPUTexture *GPU_texture_cube_create(
GLenum data_format = gpu_get_gl_dataformat(tex_format, 
>format_flag);
GLenum data_type = gpu_get_gl_datatype(gpu_data_format);
 
-   gpu_texture_memory_footprint_add(tex);
-
/* Generate Texture object */
tex->bindcode = GPU_tex_alloc();
 
@@ -763,6 +764,8 @@ static GPUTexture *GPU_texture_cube_create(
return NULL;
}
 
+   gpu_texture_memory_footprint_add(tex);
+
glBindTexture(tex->target, tex->bindcode);
 
/* Upload Texture */

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


[Bf-blender-cvs] [c541f3abef1] blender2.8: DRW: Fix redundant texture creation

2018-12-11 Thread Clément Foucault
Commit: c541f3abef105e7a1f3a35c0a070464472d443d7
Author: Clément Foucault
Date:   Tue Dec 11 21:25:17 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBc541f3abef105e7a1f3a35c0a070464472d443d7

DRW: Fix redundant texture creation

===

M   source/blender/draw/intern/draw_common.c

===

diff --git a/source/blender/draw/intern/draw_common.c 
b/source/blender/draw/intern/draw_common.c
index e3fde3d8a5d..35f060bd3ba 100644
--- a/source/blender/draw/intern/draw_common.c
+++ b/source/blender/draw/intern/draw_common.c
@@ -163,29 +163,28 @@ void DRW_globals_update(void)
 
DRW_uniformbuffer_update(globals_ubo, );
 
-   ColorBand ramp = {0};
-   float *colors;
-   int col_size;
+   if (!globals_ramp) {
+   ColorBand ramp = {0};
+   float *colors;
+   int col_size;
 
-   ramp.tot = 3;
-   ramp.data[0].a = 1.0f;
-   ramp.data[0].b = 1.0f;
-   ramp.data[0].pos = 0.0f;
-   ramp.data[1].a = 1.0f;
-   ramp.data[1].g = 1.0f;
-   ramp.data[1].pos = 0.5f;
-   ramp.data[2].a = 1.0f;
-   ramp.data[2].r = 1.0f;
-   ramp.data[2].pos = 1.0f;
+   ramp.tot = 3;
+   ramp.data[0].a = 1.0f;
+   ramp.data[0].b = 1.0f;
+   ramp.data[0].pos = 0.0f;
+   ramp.data[1].a = 1.0f;
+   ramp.data[1].g = 1.0f;
+   ramp.data[1].pos = 0.5f;
+   ramp.data[2].a = 1.0f;
+   ramp.data[2].r = 1.0f;
+   ramp.data[2].pos = 1.0f;
 
-   BKE_colorband_evaluate_table_rgba(, , _size);
+   BKE_colorband_evaluate_table_rgba(, , _size);
 
-   if (globals_ramp) {
-   GPU_texture_free(globals_ramp);
-   }
-   globals_ramp = GPU_texture_create_1D(col_size, GPU_RGBA8, colors, NULL);
+   globals_ramp = GPU_texture_create_1D(col_size, GPU_RGBA8, 
colors, NULL);
 
-   MEM_freeN(colors);
+   MEM_freeN(colors);
+   }
 
/* Weight Painting color ramp texture */
bool user_weight_ramp = (U.flag & USER_CUSTOM_RANGE) != 0;

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


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

2018-12-11 Thread Antonioya
Commit: 03d84f2b2265e73041efcc8e28a872b58b0e1f79
Author: Antonioya
Date:   Tue Dec 11 18:47:55 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB03d84f2b2265e73041efcc8e28a872b58b0e1f79

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] [48a3f97b235] blender2.8: RNA: provide access to bone parent transform math from Python.

2018-12-11 Thread Alexander Gavrilov
Commit: 48a3f97b23501fd33f6e400b7682ea4cb2988a8a
Author: Alexander Gavrilov
Date:   Sat Dec 8 09:17:57 2018 +0300
Branches: blender2.8
https://developer.blender.org/rB48a3f97b23501fd33f6e400b7682ea4cb2988a8a

RNA: provide access to bone parent transform math from Python.

Applying the effect of bone parent is much more complicated than
simple matrix multiplication because of the various flags like
Inherit Scale. Thus it is reasonable to provide access to this
math from Python for complicated rest pose related manipulations.

The simple case of this is handled by Object.convert_space, so
the new method is only needed for complex tasks.

Differential Revision: https://developer.blender.org/D4053

===

M   source/blender/blenkernel/BKE_armature.h
M   source/blender/blenkernel/intern/armature.c
M   source/blender/editors/transform/transform_conversions.c
M   source/blender/makesrna/intern/rna_armature_api.c

===

diff --git a/source/blender/blenkernel/BKE_armature.h 
b/source/blender/blenkernel/BKE_armature.h
index e0e1103fe21..3a29dd0c3cb 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -128,9 +128,26 @@ void BKE_pchan_apply_mat4(struct bPoseChannel *pchan, 
float mat[4][4], bool use_
 void BKE_pchan_to_mat4(struct bPoseChannel *pchan, float chan_mat[4][4]);
 void BKE_pchan_calc_mat(struct bPoseChannel *pchan);
 
-/* Get the "pchan to pose" transform matrix. These matrices apply the effects 
of
+/* Simple helper, computes the offset bone matrix. */
+void BKE_get_offset_bone_mat(struct Bone *bone, float offs_bone[4][4]);
+
+/* Transformation inherited from the parent bone. These matrices apply the 
effects of
  * HINGE/NO_SCALE/NO_LOCAL_LOCATION options over the pchan loc/rot/scale 
transformations. */
-void BKE_pchan_to_pose_mat(struct bPoseChannel *pchan, float 
rotscale_mat[4][4], float loc_mat[4][4]);
+typedef struct BoneParentTransform {
+   float rotscale_mat[4][4];   /* parent effect on rotation & scale 
pose channels */
+   float loc_mat[4][4];/* parent effect on location pose 
channel */
+} BoneParentTransform;
+
+/* Matrix-like algebra operations on the transform */
+void BKE_clear_bone_parent_transform(struct BoneParentTransform *bpt);
+void BKE_invert_bone_parent_transform(struct BoneParentTransform *bpt);
+void BKE_combine_bone_parent_transform(const struct BoneParentTransform *in1, 
const struct BoneParentTransform *in2, struct BoneParentTransform *result);
+
+void BKE_apply_bone_parent_transform(const struct BoneParentTransform *bpt, 
const float inmat[4][4], float outmat[4][4]);
+
+/* Get the current parent transformation for the given pose bone. */
+void BKE_pchan_to_parent_transform(struct bPoseChannel *pchan, struct 
BoneParentTransform *r_bpt);
+void BKE_calc_bone_parent_transform(int bone_flag, const float 
offs_bone[4][4], const float parent_arm_mat[4][4], const float 
parent_pose_mat[4][4], struct BoneParentTransform *r_bpt);
 
 /* Rotation Mode Conversions - Used for PoseChannels + Objects... */
 void BKE_rotMode_change_values(float quat[4], float eul[3], float axis[3], 
float *angle, short oldMode, short newMode);
diff --git a/source/blender/blenkernel/intern/armature.c 
b/source/blender/blenkernel/intern/armature.c
index de4f89fe146..0c63d66bb29 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1459,9 +1459,8 @@ void BKE_armature_loc_world_to_pose(Object *ob, const 
float inloc[3], float outl
 }
 
 /* Simple helper, computes the offset bone matrix.
- * offs_bone = yoffs(b-1) + root(b) + bonemat(b).
- * Not exported, as it is only used in this file currently... */
-static void get_offset_bone_mat(Bone *bone, float offs_bone[4][4])
+ * offs_bone = yoffs(b-1) + root(b) + bonemat(b). */
+void BKE_get_offset_bone_mat(Bone *bone, float offs_bone[4][4])
 {
BLI_assert(bone->parent != NULL);
 
@@ -1492,7 +1491,7 @@ static void get_offset_bone_mat(Bone *bone, float 
offs_bone[4][4])
  *   pose-channel into its local space (i.e. 'visual'-keyframing).
  *   (note: I don't understand that, so I keep it :p --mont29).
  */
-void BKE_pchan_to_pose_mat(bPoseChannel *pchan, float rotscale_mat[4][4], 
float loc_mat[4][4])
+void BKE_pchan_to_parent_transform(bPoseChannel *pchan, BoneParentTransform 
*r_bpt)
 {
Bone *bone, *parbone;
bPoseChannel *parchan;
@@ -1505,109 +1504,142 @@ void BKE_pchan_to_pose_mat(bPoseChannel *pchan, float 
rotscale_mat[4][4], float
if (parchan) {
float offs_bone[4][4];
/* yoffs(b-1) + root(b) + bonemat(b). */
-   get_offset_bone_mat(bone, offs_bone);
+   BKE_get_offset_bone_mat(bone, offs_bone);
 
+   BKE_calc_bone_parent_transform(bone->flag, offs_bone, 
parbone->arm_mat, 

[Bf-blender-cvs] [b7933cc6019] blender2.8: GPUTexture: Add debug print for cubemap textures

2018-12-11 Thread Clément Foucault
Commit: b7933cc60195b5e96878aaab7045db6cf81b2dba
Author: Clément Foucault
Date:   Tue Dec 11 22:30:41 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBb7933cc60195b5e96878aaab7045db6cf81b2dba

GPUTexture: Add debug print for cubemap textures

===

M   source/blender/gpu/intern/gpu_texture.c

===

diff --git a/source/blender/gpu/intern/gpu_texture.c 
b/source/blender/gpu/intern/gpu_texture.c
index 75eb17546ac..d3642c8f31b 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -138,6 +138,7 @@ static const char *gl_enum_to_str(GLenum e)
 {
 #define ENUM_TO_STRING(e) [GL_##e] = STRINGIFY_ARG(e)
static const char *enum_strings[] = {
+   ENUM_TO_STRING(TEXTURE_CUBE_MAP),
ENUM_TO_STRING(TEXTURE_2D),
ENUM_TO_STRING(TEXTURE_2D_ARRAY),
ENUM_TO_STRING(TEXTURE_1D),
@@ -764,6 +765,13 @@ static GPUTexture *GPU_texture_cube_create(
return NULL;
}
 
+   if (G.debug & G_DEBUG_GPU) {
+   printf("GPUTexture: create : %s, %s, w : %d, h : %d, d : %d, 
comp : %d, size : %.2f MiB\n",
+  gl_enum_to_str(tex->target), 
gl_enum_to_str(internalformat),
+  w, w, d, tex->components,
+  gpu_texture_memory_footprint_compute(tex) / 1048576.0f);
+   }
+
gpu_texture_memory_footprint_add(tex);
 
glBindTexture(tex->target, tex->bindcode);

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


[Bf-blender-cvs] [e757c4a3bec] master: Cleanup: use colon separator after parameter

2018-12-11 Thread Campbell Barton
Commit: e757c4a3bec8b0e8d198531a28327332af00a9ba
Author: Campbell Barton
Date:   Wed Dec 12 12:50:58 2018 +1100
Branches: master
https://developer.blender.org/rBe757c4a3bec8b0e8d198531a28327332af00a9ba

Cleanup: use colon separator after parameter

Helps separate variable names from descriptive text.
Was already used in some parts of the code,
double space and dashes were used elsewhere.

===

M   source/blender/alembic/intern/alembic_capi.cc
M   source/blender/blenkernel/BKE_idcode.h
M   source/blender/blenkernel/intern/action.c
M   source/blender/blenkernel/intern/anim.c
M   source/blender/blenkernel/intern/anim_sys.c
M   source/blender/blenkernel/intern/appdir.c
M   source/blender/blenkernel/intern/armature.c
M   source/blender/blenkernel/intern/autoexec.c
M   source/blender/blenkernel/intern/brush.c
M   source/blender/blenkernel/intern/bvhutils.c
M   source/blender/blenkernel/intern/cachefile.c
M   source/blender/blenkernel/intern/camera.c
M   source/blender/blenkernel/intern/cdderivedmesh.c
M   source/blender/blenkernel/intern/colortools.c
M   source/blender/blenkernel/intern/context.c
M   source/blender/blenkernel/intern/curve.c
M   source/blender/blenkernel/intern/customdata.c
M   source/blender/blenkernel/intern/displist.c
M   source/blender/blenkernel/intern/gpencil.c
M   source/blender/blenkernel/intern/group.c
M   source/blender/blenkernel/intern/idcode.c
M   source/blender/blenkernel/intern/idprop.c
M   source/blender/blenkernel/intern/image.c
M   source/blender/blenkernel/intern/key.c
M   source/blender/blenkernel/intern/lamp.c
M   source/blender/blenkernel/intern/lattice.c
M   source/blender/blenkernel/intern/library.c
M   source/blender/blenkernel/intern/library_query.c
M   source/blender/blenkernel/intern/linestyle.c
M   source/blender/blenkernel/intern/mask.c
M   source/blender/blenkernel/intern/material.c
M   source/blender/blenkernel/intern/mball.c
M   source/blender/blenkernel/intern/mesh.c
M   source/blender/blenkernel/intern/mesh_evaluate.c
M   source/blender/blenkernel/intern/mesh_mapping.c
M   source/blender/blenkernel/intern/mesh_validate.c
M   source/blender/blenkernel/intern/modifier.c
M   source/blender/blenkernel/intern/movieclip.c
M   source/blender/blenkernel/intern/nla.c
M   source/blender/blenkernel/intern/node.c
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/object_deform.c
M   source/blender/blenkernel/intern/paint.c
M   source/blender/blenkernel/intern/particle.c
M   source/blender/blenkernel/intern/rigidbody.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenkernel/intern/sound.c
M   source/blender/blenkernel/intern/speaker.c
M   source/blender/blenkernel/intern/text.c
M   source/blender/blenkernel/intern/texture.c
M   source/blender/blenkernel/intern/world.c
M   source/blender/blenlib/BLI_astar.h
M   source/blender/blenlib/PIL_time.h
M   source/blender/blenlib/intern/BLI_dynstr.c
M   source/blender/blenlib/intern/BLI_ghash.c
M   source/blender/blenlib/intern/BLI_kdtree.c
M   source/blender/blenlib/intern/BLI_mempool.c
M   source/blender/blenlib/intern/astar.c
M   source/blender/blenlib/intern/convexhull_2d.c
M   source/blender/blenlib/intern/edgehash.c
M   source/blender/blenlib/intern/fileops.c
M   source/blender/blenlib/intern/freetypefont.c
M   source/blender/blenlib/intern/gsqueue.c
M   source/blender/blenlib/intern/listbase.c
M   source/blender/blenlib/intern/math_base_inline.c
M   source/blender/blenlib/intern/math_geom.c
M   source/blender/blenlib/intern/math_geom_inline.c
M   source/blender/blenlib/intern/math_rotation.c
M   source/blender/blenlib/intern/math_solvers.c
M   source/blender/blenlib/intern/math_statistics.c
M   source/blender/blenlib/intern/path_util.c
M   source/blender/blenlib/intern/string.c
M   source/blender/blenlib/intern/string_utf8.c
M   source/blender/blenlib/intern/string_utils.c
M   source/blender/blenlib/intern/task.c
M   source/blender/blenlib/intern/timecode.c
M   source/blender/blenloader/intern/readblenentry.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/bmesh/intern/bmesh_construct.c
M   source/blender/bmesh/intern/bmesh_core.c
M   source/blender/bmesh/intern/bmesh_mesh_conv.c
M   source/blender/bmesh/intern/bmesh_mods.c
M   source/blender/bmesh/intern/bmesh_operators.c
M   source/blender/bmesh/intern/bmesh_polygon.c
M   source/blender/bmesh/intern/bmesh_query.c
M   source/blender/bmesh/operators/bmo_fill_grid.c
M   source/blender/bmesh/operators/bmo_normals.c
M   

[Bf-blender-cvs] [e3122d34149] blender2.8: startup: default file selector to a useful path

2018-12-11 Thread Campbell Barton
Commit: e3122d34149b9c9ec3f57492c902b71703e002af
Author: Campbell Barton
Date:   Wed Dec 12 16:51:44 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBe3122d34149b9c9ec3f57492c902b71703e002af

startup: default file selector to a useful path

Was initialized to '/home/', use BKE_appdir_folder_default instead.

===

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

===

diff --git a/source/blender/blenloader/intern/versioning_defaults.c 
b/source/blender/blenloader/intern/versioning_defaults.c
index 25946a9fb31..e7244f926ff 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -42,6 +42,7 @@
 #include "DNA_windowmanager_types.h"
 #include "DNA_workspace_types.h"
 
+#include "BKE_appdir.h"
 #include "BKE_brush.h"
 #include "BKE_colortools.h"
 #include "BKE_keyconfig.h"
@@ -121,6 +122,18 @@ void BLO_update_defaults_startup_blend(Main *bmain, const 
char *app_template)
/* grease pencil settings */
v3d->vertex_opacity = 1.0f;
v3d->gp_flag |= 
V3D_GP_SHOW_EDIT_LINES;
+   break;
+   }
+   case SPACE_FILE:
+   {
+   SpaceFile *sfile = (SpaceFile 
*)sl;
+   if (sfile->params) {
+   const char *dir_default 
= BKE_appdir_folder_default();
+   if (dir_default) {
+   
STRNCPY(sfile->params->dir, dir_default);
+   }
+   }
+   break;
}
}
}

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


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

2018-12-11 Thread Campbell Barton
Commit: 49490e5cfbeb2b0b823aa2042401891001870a6e
Author: Campbell Barton
Date:   Wed Dec 12 12:55:20 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB49490e5cfbeb2b0b823aa2042401891001870a6e

Merge branch 'master' into blender2.8

===



===

diff --cc source/blender/alembic/intern/abc_exporter.cc
index d470488937a,9ffed421302..ff1465103eb
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@@ -140,8 -136,8 +140,8 @@@ static bool object_type_is_exportable(S
  /**
   * Returns whether this object should be exported into the Alembic file.
   *
-  * \param settings export settings, used for options like 'selected only'.
-  * \param ob the object's base in question.
+  * \param settings: export settings, used for options like 'selected only'.
 - * \param ob: the object in question.
++ * \param ob: the object's base in question.
   * \param is_duplicated: Normally false; true when the object is instanced
   * into the scene by a dupli-object (e.g. part of a dupligroup).
   * This ignores selection and layer visibility,
diff --cc source/blender/alembic/intern/abc_util.cc
index 53860ab149d,24a508e8292..90dfbd869f7
--- a/source/blender/alembic/intern/abc_util.cc
+++ b/source/blender/alembic/intern/abc_util.cc
@@@ -61,15 -60,6 +61,15 @@@ std::string get_id_name(const ID * cons
return name;
  }
  
 +/**
-  * @brief get_object_dag_path_name returns the name under which the object
++ * \brief get_object_dag_path_name returns the name under which the object
 + *  will be exported in the Alembic file. It is of the form
 + *  "[../grandparent/]parent/object" if dupli_parent is NULL, or
 + *  "dupli_parent/[../grandparent/]parent/object" otherwise.
-  * @param ob
-  * @param dupli_parent
-  * @return
++ * \param ob:
++ * \param dupli_parent:
++ * \return
 + */
  std::string get_object_dag_path_name(const Object * const ob, Object 
*dupli_parent)
  {
std::string name = get_id_name(ob);
diff --cc source/blender/blenkernel/BKE_modifier.h
index 6f3150880fa,2d39ac4d102..9504eff7dec
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@@ -156,22 -159,8 +156,22 @@@ typedef struct ModifierTypeInfo 
  
/* Copy instance data for this modifier type. Should copy all user
 * level settings to the target modifier.
 +   *
-* \param flag  Copying options (see BKE_library.h's LIB_ID_COPY_... 
flags for more).
++   * \param flag: Copying options (see BKE_library.h's LIB_ID_COPY_... 
flags for more).
 */
 -  void (*copyData)(const struct ModifierData *md, struct ModifierData 
*target);
 +  void (*copyData)(const struct ModifierData *md, struct ModifierData 
*target, const int flag);
 +
 +
 +  /* Deform modifier functions */ 
/* DEPRECATED */
 +
 +  void (*deformVerts_DM_removed)(void);
 +  void (*deformMatrices_DM_removed)(void);
 +  void (*deformVertsEM_DM_removed)(void);
 +  void (*deformMatricesEM_DM_removed)(void);
 +
 +  /* Non-deform modifier functions 
*/ /* DEPRECATED */
 +
 +  void (*applyModifier_DM_removed)(void);
  
/* Deform modifier functions */
  
diff --cc source/blender/blenkernel/intern/anim_sys.c
index 8e8000f3ea0,d0262579663..9cdf94b3253
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@@ -266,12 -262,8 +266,12 @@@ void BKE_animdata_free(ID *id, const bo
  
  /* Copying  */
  
 -/* Make a copy of the given AnimData - to be used when copying datablocks */
 -AnimData *BKE_animdata_copy(Main *bmain, AnimData *adt, const bool do_action)
 +/**
 + * Make a copy of the given AnimData - to be used when copying datablocks.
-  * \param flag Control ID pointers management, see 
LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_library.h
++ * \param flag: Control ID pointers management, see 
LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_library.h
 + * \return The copied animdata.
 + */
 +AnimData *BKE_animdata_copy(Main *bmain, AnimData *adt, const int flag)
  {
AnimData *dadt;
  
@@@ -308,11 -296,7 +308,11 @@@
return dadt;
  }
  
 -bool BKE_animdata_copy_id(Main *bmain, ID *id_to, ID *id_from, const bool 
do_action)
 +/**
-  * \param flag Control ID pointers management, see 
LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_library.h
++ * \param flag: Control ID pointers management, see 
LIB_ID_CREATE_.../LIB_ID_COPY_... flags in BKE_library.h
 + * \return true is succesfully copied.
 + */
 +bool BKE_animdata_copy_id(Main *bmain, ID *id_to, ID *id_from, const int flag)
  {
AnimData *adt;
  
diff --cc source/blender/blenkernel/intern/armature.c
index 

[Bf-blender-cvs] [bbb71ccbde0] blender2.8: Fix action-zones showing up as shortcuts

2018-12-11 Thread Campbell Barton
Commit: bbb71ccbde023436a80230f286c1535afe96b753
Author: Campbell Barton
Date:   Wed Dec 12 15:52:34 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBbbb71ccbde023436a80230f286c1535afe96b753

Fix action-zones showing up as shortcuts

Toggle fullscreen area for eg, was showing the action-zone instead of
the key binding.

===

M   source/blender/windowmanager/intern/wm_keymap.c
M   source/blender/windowmanager/wm_event_types.h

===

diff --git a/source/blender/windowmanager/intern/wm_keymap.c 
b/source/blender/windowmanager/intern/wm_keymap.c
index 311f34c0c74..13744aa04af 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -1169,7 +1169,7 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
 
bool kmi_match = false;
 
-   if (STREQ(kmi->idname, opname) && 
WM_key_event_string(kmi->type, false)[0]) {
+   if (STREQ(kmi->idname, opname)) {
if (properties) {
/* example of debugging keymaps 
*/
 #if 0
@@ -1389,12 +1389,24 @@ static wmKeyMapItem *wm_keymap_item_find(
return found;
 }
 
+static bool kmi_filter_is_visible(const wmKeyMap *UNUSED(km), const 
wmKeyMapItem *kmi, void *UNUSED(user_data))
+{
+   return ((WM_key_event_string(kmi->type, false)[0] != '\0') &&
+   (IS_EVENT_ACTIONZONE(kmi->type) == false));
+}
+
 char *WM_key_event_operator_string(
 const bContext *C, const char *opname, int opcontext,
 IDProperty *properties, const bool is_strict,
 char *result, const int result_len)
 {
-   wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, 
properties, is_strict, NULL, NULL);
+   wmKeyMapItem *kmi = wm_keymap_item_find(
+   C, opname, opcontext, properties, is_strict,
+   &(struct wmKeyMapItemFind_Params){
+   .filter_fn = kmi_filter_is_visible,
+   .user_data = NULL,
+   },
+   NULL);
if (kmi) {
WM_keymap_item_to_string(kmi, false, result, result_len);
return result;
@@ -1403,9 +1415,9 @@ char *WM_key_event_operator_string(
return NULL;
 }
 
-static bool kmi_is_hotkey(const wmKeyMap *UNUSED(km), const wmKeyMapItem *kmi, 
void *UNUSED(user_data))
+static bool kmi_filter_is_visible_hotkey(const wmKeyMap *km, const 
wmKeyMapItem *kmi, void *user_data)
 {
-   return ISHOTKEY(kmi->type);
+   return (ISHOTKEY(kmi->type) && kmi_filter_is_visible(km, kmi, 
user_data));
 }
 
 wmKeyMapItem *WM_key_event_operator(
@@ -1415,9 +1427,8 @@ wmKeyMapItem *WM_key_event_operator(
 {
return wm_keymap_item_find(
C, opname, opcontext, properties, true,
-   (is_hotkey == false) ? NULL :
&(struct wmKeyMapItemFind_Params){
-   .filter_fn = kmi_is_hotkey,
+   .filter_fn = is_hotkey ? kmi_filter_is_visible_hotkey : 
kmi_filter_is_visible,
.user_data = NULL,
},
r_keymap);
diff --git a/source/blender/windowmanager/wm_event_types.h 
b/source/blender/windowmanager/wm_event_types.h
index 40a3d148b7b..b2c4c0494ce 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -308,9 +308,11 @@ enum {
TIMERF= 0x011F,  /* last timer */
 
/* Actionzones, tweak, gestures: 0x500x, 0x501x */
+#define EVT_ACTIONZONE_FIRST EVT_ACTIONZONE_AREA
EVT_ACTIONZONE_AREA   = 0x5000,
EVT_ACTIONZONE_REGION = 0x5001,
EVT_ACTIONZONE_FULLSCREEN = 0x5011,
+#define EVT_ACTIONZONE_LAST (EVT_ACTIONZONE_FULLSCREEN + 1)
 
/* NOTE: these values are saved in keymap files, do not change them but 
just add new ones */
 
@@ -374,6 +376,8 @@ enum {
 /* test whether the event is a NDOF event */
 #define ISNDOF(event_type)  ((event_type) >= NDOF_MOTION && (event_type) < 
NDOF_LAST)
 
+#define IS_EVENT_ACTIONZONE(event_type)  ((event_type) >= EVT_ACTIONZONE_FIRST 
&& (event_type) < EVT_ACTIONZONE_LAST)
+
 /* test whether event type is acceptable as hotkey, excluding modifiers */
 #define ISHOTKEY(event_type)  \
((ISKEYBOARD(event_type) || ISMOUSE(event_type) || ISNDOF(event_type)) 
&& \

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


[Bf-blender-cvs] [768e69eb37e] blender2.8: Keymap: refactor keymap item find logic

2018-12-11 Thread Campbell Barton
Commit: 768e69eb37e19d50420fa5de33ae6736d8030c5d
Author: Campbell Barton
Date:   Wed Dec 12 15:35:47 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB768e69eb37e19d50420fa5de33ae6736d8030c5d

Keymap: refactor keymap item find logic

Pass a function to filter items to allow lookups to be more selective.

===

M   source/blender/windowmanager/intern/wm_keymap.c

===

diff --git a/source/blender/windowmanager/intern/wm_keymap.c 
b/source/blender/windowmanager/intern/wm_keymap.c
index 4c00b99e13e..311f34c0c74 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -64,6 +64,12 @@
 #include "wm_event_system.h"
 #include "wm_event_types.h"
 
+
+struct wmKeyMapItemFind_Params {
+   bool (*filter_fn)(const wmKeyMap *km, const wmKeyMapItem *kmi, void 
*user_data);
+   void *user_data;
+};
+
 /*** Keymap Item **
  * Item in a keymap, that maps from an event to an operator or modal map item 
*/
 
@@ -1141,7 +1147,8 @@ char *WM_modalkeymap_operator_items_to_string_buf(
 
 static wmKeyMapItem *wm_keymap_item_find_handlers(
 const bContext *C, ListBase *handlers, const char *opname, int 
UNUSED(opcontext),
-IDProperty *properties, const bool is_strict, const bool is_hotkey,
+IDProperty *properties, const bool is_strict,
+const struct wmKeyMapItemFind_Params *params,
 wmKeyMap **r_keymap)
 {
wmWindowManager *wm = CTX_wm_manager(C);
@@ -1156,15 +1163,13 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
if (keymap && WM_keymap_poll((bContext *)C, keymap)) {
for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
/* skip disabled keymap items [T38447] */
-   if (kmi->flag & KMI_INACTIVE)
+   if (kmi->flag & KMI_INACTIVE) {
continue;
+   }
 
-   if (STREQ(kmi->idname, opname) && 
WM_key_event_string(kmi->type, false)[0]) {
-   if (is_hotkey) {
-   if (!ISHOTKEY(kmi->type))
-   continue;
-   }
+   bool kmi_match = false;
 
+   if (STREQ(kmi->idname, opname) && 
WM_key_event_string(kmi->type, false)[0]) {
if (properties) {
/* example of debugging keymaps 
*/
 #if 0
@@ -1179,8 +1184,7 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
 #endif
 
if (kmi->ptr && 
IDP_EqualsProperties_ex(properties, kmi->ptr->data, is_strict)) {
-   if (r_keymap) *r_keymap 
= keymap;
-   return kmi;
+   kmi_match = true;
}
/* Debug only, helps spotting 
mismatches between menu entries and shortcuts! */
else if (G.debug & G_DEBUG_WM) {
@@ -1219,8 +1223,16 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
}
}
else {
-   if (r_keymap) *r_keymap = 
keymap;
-   return kmi;
+   kmi_match = true;
+   }
+
+   if (kmi_match) {
+   if ((params == NULL) || 
params->filter_fn(keymap, kmi, params->user_data)) {
+   if (r_keymap) {
+   *r_keymap = 
keymap;
+   }
+   return kmi;
+   }
}
}
}
@@ -1234,7 +1246,8 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
 
 static wmKeyMapItem *wm_keymap_item_find_props(
 const bContext *C, const char *opname, int opcontext,
-IDProperty *properties, const bool is_strict, const bool is_hotkey,
+IDProperty *properties, const bool is_strict,
+const struct 

[Bf-blender-cvs] [4ae68d6825a] blender2.8: Fix T59170: Box select ignores modifiers-keys once tool option is set

2018-12-11 Thread Campbell Barton
Commit: 4ae68d6825a03617b6abf2f897690189ec3db3a8
Author: Campbell Barton
Date:   Wed Dec 12 14:26:43 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB4ae68d6825a03617b6abf2f897690189ec3db3a8

Fix T59170: Box select ignores modifiers-keys once tool option is set

- Key-map items properties now override tool-options
  so modifier keys can have different behavior to the default action.

- Box & circle select now have `wait_for_input` properties
  instead of detecting this based on selection options being set or not.
  This relied on the key-map setting properties which may need to be
  initialize from the tool settings.

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   source/blender/windowmanager/intern/wm_gesture_ops.c
M   source/blender/windowmanager/intern/wm_operator_props.c
M   source/blender/windowmanager/intern/wm_toolsystem.c

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 6bce469c7dc..feeb85c9a47 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -235,8 +235,7 @@ def _template_items_tool_select(params, operator, 
cursor_operator):
 def _template_items_tool_select_actions(operator, *, type, value):
 kmi_args = {"type": type, "value": value}
 return [
-(operator, kmi_args,
- {"properties": [("mode", 'SET')]}),
+(operator, kmi_args, None),
 (operator, {**kmi_args, "shift": True},
  {"properties": [("mode", 'ADD')]}),
 (operator, {**kmi_args, "ctrl": True},
@@ -5135,9 +5134,9 @@ def km_3d_view_tool_object_select_circle(params):
 {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
 {"items": [
 ("view3d.select_circle", {"type": params.tool_mouse, "value": 
'PRESS'},
- {"properties": [("deselect", False)]}),
+ {"properties": [("wait_for_input", False)]}),
 ("view3d.select_circle", {"type": params.tool_mouse, "value": 
'PRESS', "ctrl": True},
- {"properties": [("deselect", True)]}),
+ {"properties": [("wait_for_input", False), ("deselect", True)]}),
 ]},
 )
 
diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.c 
b/source/blender/windowmanager/intern/wm_gesture_ops.c
index faaf5f61421..9b5f3b9f738 100644
--- a/source/blender/windowmanager/intern/wm_gesture_ops.c
+++ b/source/blender/windowmanager/intern/wm_gesture_ops.c
@@ -79,7 +79,7 @@ static void gesture_modal_end(bContext *C, wmOperator *op)
}
 }
 
-static void gesture_modal_state_to_operator(wmOperator *op, int modal_state, 
bool check_is_set)
+static void gesture_modal_state_to_operator(wmOperator *op, int modal_state)
 {
PropertyRNA *prop;
 
@@ -87,28 +87,22 @@ static void gesture_modal_state_to_operator(wmOperator *op, 
int modal_state, boo
case GESTURE_MODAL_SELECT:
case GESTURE_MODAL_DESELECT:
if ((prop = RNA_struct_find_property(op->ptr, 
"deselect"))) {
-   if (!check_is_set || 
!RNA_property_is_set(op->ptr, prop)) {
-   RNA_property_boolean_set(op->ptr, prop, 
(modal_state == GESTURE_MODAL_DESELECT));
-   }
+   RNA_property_boolean_set(op->ptr, prop, 
(modal_state == GESTURE_MODAL_DESELECT));
}
if ((prop = RNA_struct_find_property(op->ptr, "mode"))) 
{
-   if (!check_is_set || 
!RNA_property_is_set(op->ptr, prop)) {
-   RNA_property_enum_set(op->ptr, prop, 
(modal_state == GESTURE_MODAL_DESELECT) ? SEL_OP_SUB : SEL_OP_ADD);
-   }
+   RNA_property_enum_set(op->ptr, prop, 
(modal_state == GESTURE_MODAL_DESELECT) ? SEL_OP_SUB : SEL_OP_ADD);
}
break;
case GESTURE_MODAL_IN:
case GESTURE_MODAL_OUT:
if ((prop = RNA_struct_find_property(op->ptr, 
"zoom_out"))) {
-   if (!check_is_set || 
!RNA_property_is_set(op->ptr, prop)) {
-   RNA_property_boolean_set(op->ptr, prop, 
(modal_state == GESTURE_MODAL_OUT));
-   }
+   RNA_property_boolean_set(op->ptr, prop, 
(modal_state == GESTURE_MODAL_OUT));
}
break;
}
 }
 
-static int gesture_modal_state_from_operator(wmOperator *op)
+static int UNUSED_FUNCTION(gesture_modal_state_from_operator)(wmOperator *op)
 {

[Bf-blender-cvs] [e4153946ad1] blender2.8: Fix T59005: no FCurve cleanup in the Timeline

2018-12-11 Thread Philipp Oeser
Commit: e4153946ad1e81c697b8d51d92a3e2f088d0af4d
Author: Philipp Oeser
Date:   Mon Dec 10 17:05:51 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBe4153946ad1e81c697b8d51d92a3e2f088d0af4d

Fix T59005: no FCurve cleanup in the Timeline

as opposed to the 'real' Dopesheet e.g. keyframes were not merged when
placed on the same frame

Reviewers: brecht, aligorith, angavrilov

Maniphest Tasks: T59005

Differential Revision: https://developer.blender.org/D4061

===

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 2b1de15ceae..599bff810da 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -6518,7 +6518,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
 
ob = ac.obact;
 
-   if (ELEM(ac.datatype, ANIMCONT_DOPESHEET, ANIMCONT_SHAPEKEY)) {
+   if (ELEM(ac.datatype, ANIMCONT_DOPESHEET, ANIMCONT_SHAPEKEY, 
ANIMCONT_TIMELINE)) {
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
short filter = (ANIMFILTER_DATA_VISIBLE | 
ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/);

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


[Bf-blender-cvs] [49b5d45118b] blender2.8: Fix T59174: Missing particles update

2018-12-11 Thread Sergey Sharybin
Commit: 49b5d45118b76f7ab0383b30a98192ef6410547b
Author: Sergey Sharybin
Date:   Tue Dec 11 11:15:12 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB49b5d45118b76f7ab0383b30a98192ef6410547b

Fix T59174: Missing particles update

===

M   source/blender/depsgraph/intern/depsgraph_tag.cc

===

diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc 
b/source/blender/depsgraph/intern/depsgraph_tag.cc
index a1083cbfe0a..26a12f42bfc 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -142,6 +142,14 @@ void depsgraph_base_flags_tag_to_component_opcode(
}
 }
 
+eDepsOperation_Code psysTagToOperationCode(IDRecalcFlag tag)
+{
+   if (tag == ID_RECALC_PSYS_RESET) {
+   return DEG_OPCODE_PARTICLE_SETTINGS_RESET;
+   }
+   return DEG_OPCODE_OPERATION;
+}
+
 void depsgraph_tag_to_component_opcode(const ID *id,
IDRecalcFlag tag,
eDepsNode_Type *component_type,
@@ -177,7 +185,8 @@ void depsgraph_tag_to_component_opcode(const ID *id,
 *   but we can survive for now with single 
exception here.
 *   Particles needs reconsideration anyway,
 */
-   *component_type = DEG_NODE_TYPE_PARTICLE_SYSTEM;
+   *component_type = 
DEG_NODE_TYPE_PARTICLE_SETTINGS;
+   *operation_code = psysTagToOperationCode(tag);
}
else {
*component_type = DEG_NODE_TYPE_PARTICLE_SYSTEM;

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


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

2018-12-11 Thread Antonioya
Commit: 90d16657387e09ea6dab0c768ee11bd5d5aca158
Author: Antonioya
Date:   Tue Dec 11 10:32:10 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB90d16657387e09ea6dab0c768ee11bd5d5aca158

Merge branch 'blender2.8' into greasepencil-object

 Conflicts:
source/blender/blenloader/intern/versioning_280.c

===



===

diff --cc source/blender/blenloader/intern/versioning_280.c
index 7f584fdf613,d10d86de2bc..71e4efec80c
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -2501,21 -2502,20 +2502,35 @@@ void blo_do_versions_280(FileData *fd, 
BKE_rigidbody_objects_collection_validate(scene, rbw);
BKE_rigidbody_constraints_collection_validate(scene, 
rbw);
}
+ #endif
+   }
+ 
+   if (!MAIN_VERSION_ATLEAST(bmain, 280, 37)) {
+   for (Camera *ca = bmain->camera.first; ca; ca = ca->id.next) {
+   ca->drawsize *= 2.0f;
+   }
+   for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+   if (ob->type != OB_EMPTY) {
+   if (UNLIKELY(ob->transflag & 
OB_DUPLICOLLECTION)) {
+   
BKE_object_type_set_empty_for_versioning(ob);
+   }
+   }
+   }
 +
 +  /* Grease pencil primitive curve */
 +  if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", 
"CurveMapping", "cur_primitive")) {
 +  for (Scene *scene = bmain->scene.first; scene; scene = 
scene->id.next) {
 +  GP_Sculpt_Settings *gset = 
>toolsettings->gp_sculpt;
 +  if ((gset) && (gset->cur_primitive == NULL)) {
 +  gset->cur_primitive = 
curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 +  
curvemapping_initialize(gset->cur_primitive);
 +  curvemap_reset(gset->cur_primitive->cm,
 +  >cur_primitive->clipr,
 +  CURVE_PRESET_BELL,
 +  CURVEMAP_SLOPE_POSITIVE);
 +  }
 +  }
 +  }
}
  
{

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


[Bf-blender-cvs] [cc1af801165] greasepencil-object: GP: Move Control Points data to Runtime

2018-12-11 Thread Antonioya
Commit: cc1af8011655bc732fac550f32aa16f622525f52
Author: Antonioya
Date:   Tue Dec 11 11:25:33 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBcc1af8011655bc732fac550f32aa16f622525f52

GP: Move Control Points data to Runtime

As we maybe will use these control points in more operators is not logic keep  
them in operator temp data. This makes also possible move drawing to Draw 
Manager.

===

M   source/blender/editors/gpencil/drawgpencil.c
M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/editors/gpencil/gpencil_primitive.c
M   source/blender/editors/include/ED_gpencil.h
M   source/blender/makesdna/DNA_gpencil_types.h

===

diff --git a/source/blender/editors/gpencil/drawgpencil.c 
b/source/blender/editors/gpencil/drawgpencil.c
index 8bcb8a2b4dd..9d3d5c2bd8a 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1441,15 +1441,13 @@ static void gp_primitive_draw_point(const tGPDprimitive 
*tgpi)
//glEnable(GL_BLEND);
immBindBuiltinProgram(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR);
GPU_enable_program_point_size();
-   immBegin(GPU_PRIM_POINTS, tgpi->tot_cp_points);
-
-   tGPcontrolpoint *cps = tgpi->cp_points;
-   for (int i = 0; i < tgpi->tot_cp_points; i++) {
-   tGPcontrolpoint *cp = [i];
-   float ink[4];
-   UI_GetThemeColor4fv(cp->color, ink);
-   ink[3] = 0.5f;
-   immAttr4fv(color, ink);
+   immBegin(GPU_PRIM_POINTS, tgpi->gpd->runtime.tot_cp_points);
+
+   bGPDcontrolpoint *cps = tgpi->gpd->runtime.cp_points;
+   for (int i = 0; i < tgpi->gpd->runtime.tot_cp_points; i++) {
+   bGPDcontrolpoint *cp = [i];
+   cp->color[3] = 0.5f;
+   immAttr4fv(color, cp->color);
immAttr1f(size, (float)cp->size); 
immVertex3fv(pos, >x);
}
diff --git a/source/blender/editors/gpencil/gpencil_intern.h 
b/source/blender/editors/gpencil/gpencil_intern.h
index 76e33246839..9be570c08b4 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -159,8 +159,6 @@ typedef struct tGPDprimitive {
short cyclic; /* cyclic option */
short flip;   /* flip option */
tGPspoint *points;/* array of data-points for stroke */
-   tGPcontrolpoint *cp_points;   /* array of control-points for stroke 
*/
-   int tot_cp_points;/* array of control-points for stroke 
*/
bool draw_cp_points;  /* array of control-points for stroke 
*/
int point_count;  /* number of edges allocated */
int tot_stored_edges; /* stored number of polygon edges */
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index ebfe530da8d..229a5eaa0e6 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -288,15 +288,17 @@ static void gp_primitive_set_initdata(bContext *C, 
tGPDprimitive *tgpi)
 }
 
 /* Helper: set control point */
-static void gp_primitive_set_cp(tGPDprimitive *tgpi, float p[2], int color, 
int size)
+static void gp_primitive_set_cp(tGPDprimitive *tgpi, float p[2], float 
color[4], int size)
 {
-   if (tgpi->tot_cp_points < MAX_CP) {
+   bGPDcontrolpoint *cp_points = tgpi->gpd->runtime.cp_points;
+
+   if (tgpi->gpd->runtime.tot_cp_points < MAX_CP) {
CLAMP(size, 5, 20);
-   tGPcontrolpoint *cp = >cp_points[tgpi->tot_cp_points];
+   bGPDcontrolpoint *cp = 
_points[tgpi->gpd->runtime.tot_cp_points];
copy_v2_v2(>x, p);
-   cp->color = color;
+   copy_v4_v4(cp->color, color);
cp->size = size;
-   tgpi->tot_cp_points += 1;
+   tgpi->gpd->runtime.tot_cp_points += 1;
}
 }
 
@@ -448,10 +450,12 @@ static void gp_primitive_arc(tGPDprimitive *tgpi, 
tGPspoint *points2D)
p2d->y = (end[1] - cosf(a) * length[1]);
a += step;
}
-
-   gp_primitive_set_cp(tgpi, tgpi->start, TH_ACTIVE_VERT, 20);
-   gp_primitive_set_cp(tgpi, tgpi->end, TH_ACTIVE_VERT, 20);
-   gp_primitive_set_cp(tgpi, tgpi->origin, TH_REDALERT, 10);
+   float color[4];
+   UI_GetThemeColor4fv(TH_ACTIVE_VERT, color);
+   gp_primitive_set_cp(tgpi, tgpi->start, color, 20);
+   gp_primitive_set_cp(tgpi, tgpi->end, color, 20);
+   UI_GetThemeColor4fv(TH_REDALERT, color);
+   gp_primitive_set_cp(tgpi, tgpi->origin, color, 10);
 }
 
 /* create a bezier */
@@ -475,12 +479,15 @@ static void 

[Bf-blender-cvs] [2b888f8d21b] greasepencil-object: GP: Line primitive, add support for thickness profile

2018-12-11 Thread Charlie Jolly
Commit: 2b888f8d21be48b29d3722d272ececceafe7d553
Author: Charlie Jolly
Date:   Tue Dec 11 11:01:59 2018 +
Branches: greasepencil-object
https://developer.blender.org/rB2b888f8d21be48b29d3722d272ececceafe7d553

GP: Line primitive, add support for thickness profile

This means that by default lines are drawn with multiple points rather than two.

===

M   release/scripts/startup/bl_ui/space_topbar.py
M   source/blender/editors/gpencil/gpencil_primitive.c

===

diff --git a/release/scripts/startup/bl_ui/space_topbar.py 
b/release/scripts/startup/bl_ui/space_topbar.py
index 55ce35b2f7c..7e21eff8dba 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -375,7 +375,7 @@ class _draw_left_context_mode:
 
 draw_color_selector()
 
-if tool.name in {"Arc", "Bezier"}:
+if tool.name in {"Arc", "Bezier", "Line"}:
 settings = context.tool_settings.gpencil_sculpt
 row = layout.row(align=True)
 row.prop(settings, "use_thickness_curve", text="", 
icon='CURVE_DATA')
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 229a5eaa0e6..6b7c0b02592 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -325,7 +325,7 @@ static void gpencil_primitive_status_indicators(bContext 
*C, tGPDprimitive *tgpi
BLI_strncpy(msg_str, IFACE_("Rectangle: ESC/RMB to cancel, LMB 
set origin, Enter/LMB to confirm, Shift to square, Alt to center"), 
UI_MAX_DRAW_STR);
}
else if (tgpi->type == GP_STROKE_LINE) {
-   BLI_strncpy(msg_str, IFACE_("Line: ESC/RMB to cancel, LMB set 
origin, Enter/LMB to confirm, Alt to center"), UI_MAX_DRAW_STR);
+   BLI_strncpy(msg_str, IFACE_("Line: ESC/RMB to cancel, LMB set 
origin, Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to align, 
Alt to center"), UI_MAX_DRAW_STR);
}
else if (tgpi->type == GP_STROKE_ARC) {
BLI_strncpy(msg_str, IFACE_("Arc: ESC/RMB to cancel, Enter/LMB 
to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to center, F 
to flip, C to Close"), UI_MAX_DRAW_STR);
@@ -337,7 +337,7 @@ static void gpencil_primitive_status_indicators(bContext 
*C, tGPDprimitive *tgpi
BLI_strncpy(msg_str, IFACE_("Circle: ESC/RMB to cancel, 
Enter/LMB to confirm, WHEEL/+- to adjust edge number, Shift to square, Alt to 
center"), UI_MAX_DRAW_STR);
}
 
-   if (tgpi->type == GP_STROKE_CIRCLE || tgpi->type == GP_STROKE_ARC) {
+   if (ELEM(tgpi->type, GP_STROKE_CIRCLE, GP_STROKE_ARC, GP_STROKE_LINE)) {
if (hasNumInput(>num)) {
char str_offs[NUM_STR_REP_LEN];
 
@@ -397,15 +397,31 @@ static void gp_primitive_rectangle(tGPDprimitive *tgpi, 
tGPspoint *points2D)
 /* create a line */
 static void gp_primitive_line(tGPDprimitive *tgpi, tGPspoint *points2D)
 {
-   BLI_assert(tgpi->tot_edges == 2);
+   if (tgpi->tot_edges == 2) {
+   int i = tgpi->tot_stored_edges;
 
-   int i = tgpi->tot_stored_edges;
+   points2D[i].x = tgpi->start[0];
+   points2D[i].y = tgpi->start[1];
 
-   points2D[i].x = tgpi->start[0];
-   points2D[i].y = tgpi->start[1];
+   points2D[i + 1].x = tgpi->end[0];
+   points2D[i + 1].y = tgpi->end[1];
+   }
+   else {
+   const int totpoints = (tgpi->tot_edges + 
tgpi->tot_stored_edges);
+   const float step = 1.0f / (float)(tgpi->tot_edges - 1);
+   float a = 0.0f;
+
+   for (int i = tgpi->tot_stored_edges; i < totpoints; i++) {
+   tGPspoint *p2d = [i];
+   interp_v2_v2v2(>x, tgpi->start, tgpi->end, a);
+   a += step;
+   }
+
+   float color[4];
+   UI_GetThemeColor4fv(TH_REDALERT, color);
+   gp_primitive_set_cp(tgpi, tgpi->origin, color, 10);
+   }
 
-   points2D[i + 1].x = tgpi->end[0];
-   points2D[i + 1].y = tgpi->end[1];
 }
 
 /* unused at the moment */
@@ -661,7 +677,7 @@ static void gp_primitive_update_strokes(bContext *C, 
tGPDprimitive *tgpi)
 
/* calc pressure */
float pressure = 1.0;
-   if (ELEM(tgpi->type, GP_STROKE_ARC, GP_STROKE_BEZIER)) {
+   if (ELEM(tgpi->type, GP_STROKE_ARC, GP_STROKE_BEZIER, 
GP_STROKE_LINE)) {
if (gset->flag & GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE) {
/* normalize value to evaluate curve */
float value = (float)i / (gps->totpoints - 1);
@@ -876,7 +892,7 @@ static 

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

2018-12-11 Thread Antonioya
Commit: 42767c180c4f66682d19aab59cabd6ea4f358331
Author: Antonioya
Date:   Wed Dec 12 08:44:10 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB42767c180c4f66682d19aab59cabd6ea4f358331

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] [49bf43e63ac] greasepencil-object: GP: Fix orange lines in primitives

2018-12-11 Thread Antonioya
Commit: 49bf43e63acd09d1995826a9f85985c278445ce6
Author: Antonioya
Date:   Tue Dec 11 10:18:37 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB49bf43e63acd09d1995826a9f85985c278445ce6

GP: Fix orange lines in primitives

The orange lines must be on top of the stroke. Before, the current stroke was 
drawn in Front, but since we have speed painting functions, we can draw on back.

===

M   source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M   source/blender/draw/engines/gpencil/gpencil_engine.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 3f2e10a7692..590ae825371 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -434,7 +434,7 @@ DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(
DRW_shgroup_uniform_int(grp, "xraymode", (const int *) 
>xray_mode, 1);
}
else {
-   /* for drawing always on front */
+   /* for drawing always on predefined z-depth */
DRW_shgroup_uniform_int(grp, "xraymode", >storage->xray, 
1);
}
 
@@ -527,7 +527,7 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(
DRW_shgroup_uniform_int(grp, "xraymode", (const int 
*)>xray_mode, 1);
}
else {
-   /* for drawing always on front */
+   /* for drawing always on on predefined z-depth */
DRW_shgroup_uniform_int(grp, "xraymode", >storage->xray, 
1);
}
 
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 483d6a80991..11da8f8cffe 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -312,7 +312,7 @@ void GPENCIL_cache_init(void *vedata)
if (!stl->g_data) {
/* Alloc transient pointers */
stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
-   stl->storage->xray = GP_XRAY_FRONT; /* used for drawing */
+   stl->storage->xray = GP_XRAY_BACK; /* used for drawing */
stl->storage->stroke_style = GP_STYLE_STROKE_STYLE_SOLID; /* 
used for drawing */
}
stl->storage->tonemapping = 0;

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


[Bf-blender-cvs] [be493d60b5d] experimental-build: Build test for outliner-visibility patch

2018-12-11 Thread Dalai Felinto
Commit: be493d60b5d6f919e714ce42ec8d2ad1cfec7e21
Author: Dalai Felinto
Date:   Tue Dec 11 16:43:15 2018 -0200
Branches: experimental-build
https://developer.blender.org/rBbe493d60b5d6f919e714ce42ec8d2ad1cfec7e21

Build test for outliner-visibility patch

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/blenkernel/BKE_layer.h
M   source/blender/blenkernel/intern/layer.c
M   source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
M   
source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
M   source/blender/editors/object/object_edit.c
M   source/blender/editors/screen/screen_context.c
M   source/blender/editors/space_outliner/outliner_draw.c
M   source/blender/editors/space_outliner/outliner_intern.h
M   source/blender/editors/space_outliner/outliner_tree.c
M   source/blender/editors/transform/transform_conversions.c
M   source/blender/makesdna/DNA_layer_types.h
M   source/blender/makesrna/intern/rna_layer.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 4fc247cc8f5..a7fe780d1dd 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -4110,11 +4110,8 @@ class VIEW3D_PT_collections(Panel):
 sub = row.split()
 subrow = sub.row(align=True)
 subrow.alignment = 'RIGHT'
-icon = 'HIDE_OFF' if has_visible_objects else 'HIDE_ON'
-props = subrow.operator("object.hide_collection", text="", 
icon=icon, emboss=False)
-props.collection_index = index
-props.toggle = True
-subrow.prop(child.collection, "hide_select", text="", emboss=False)
+subrow.active = collection.is_visible # Parent collection runtime 
visibility
+subrow.prop(child, "hide_viewport", text="", emboss=False)
 
 for child in collection.children:
 index = self._draw_collection(layout, view_layer, child, index)
diff --git a/source/blender/blenkernel/BKE_layer.h 
b/source/blender/blenkernel/BKE_layer.h
index db363148bc8..61d2b03a893 100644
--- a/source/blender/blenkernel/BKE_layer.h
+++ b/source/blender/blenkernel/BKE_layer.h
@@ -113,6 +113,8 @@ bool BKE_layer_collection_objects_select(
 struct ViewLayer *view_layer, struct LayerCollection *lc, bool 
deselect);
 bool BKE_layer_collection_has_selected_objects(
 struct ViewLayer *view_layer, struct LayerCollection *lc);
+bool BKE_layer_collection_has_layer_collection(
+struct LayerCollection *lc_parent, struct LayerCollection *lc_child);
 
 void BKE_base_set_visible(struct Scene *scene, struct ViewLayer *view_layer, 
struct Base *base, bool extend);
 void BKE_layer_collection_set_visible(struct Scene *scene, struct ViewLayer 
*view_layer, struct LayerCollection *lc, bool extend);
diff --git a/source/blender/blenkernel/intern/layer.c 
b/source/blender/blenkernel/intern/layer.c
index bee915567bd..6b0bdd3c740 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -611,7 +611,7 @@ int BKE_layer_collection_findindex(ViewLayer *view_layer, 
const LayerCollection
 static short layer_collection_sync(
 ViewLayer *view_layer, const ListBase *lb_scene,
 ListBase *lb_layer, ListBase *new_object_bases,
-short parent_exclude, short parent_restrict)
+short parent_exclude, short parent_restrict, short 
parent_layer_restrict)
 {
/* TODO: support recovery after removal of intermediate collections, 
reordering, ..
 * For local edits we can make editing operating do the appropriate 
thing, but for
@@ -656,15 +656,17 @@ static short layer_collection_sync(
 
/* Collection restrict is inherited. */
short child_restrict = parent_restrict;
+   short child_layer_restrict = parent_layer_restrict;
if (!(collection->flag & COLLECTION_IS_MASTER)) {
child_restrict |= collection->flag;
+   child_layer_restrict |= lc->flag;
}
 
/* Sync child collections. */
short child_runtime_flag = layer_collection_sync(
view_layer, >children,
>layer_collections, new_object_bases,
-   lc->flag, child_restrict);
+   lc->flag, child_restrict, child_layer_restrict);
 
/* Layer collection exclude is not inherited. */
if (lc->flag & LAYER_COLLECTION_EXCLUDE) {
@@ -675,6 +677,12 @@ static short layer_collection_sync(
lc->runtime_flag = child_runtime_flag;
}
 
+   if (((child_restrict & COLLECTION_RESTRICT_VIEW) == 0) &&
+   

[Bf-blender-cvs] [f0328b464ca] experimental-build: Revert "Build test for outliner-visibility patch"

2018-12-11 Thread Dalai Felinto
Commit: f0328b464ca7f27b8c5768311a00d1b107745c46
Author: Dalai Felinto
Date:   Tue Dec 11 16:43:18 2018 -0200
Branches: experimental-build
https://developer.blender.org/rBf0328b464ca7f27b8c5768311a00d1b107745c46

Revert "Build test for outliner-visibility patch"

This reverts commit be493d60b5d6f919e714ce42ec8d2ad1cfec7e21.

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/blenkernel/BKE_layer.h
M   source/blender/blenkernel/intern/layer.c
M   source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
M   
source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
M   source/blender/editors/object/object_edit.c
M   source/blender/editors/screen/screen_context.c
M   source/blender/editors/space_outliner/outliner_draw.c
M   source/blender/editors/space_outliner/outliner_intern.h
M   source/blender/editors/space_outliner/outliner_tree.c
M   source/blender/editors/transform/transform_conversions.c
M   source/blender/makesdna/DNA_layer_types.h
M   source/blender/makesrna/intern/rna_layer.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index a7fe780d1dd..4fc247cc8f5 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -4110,8 +4110,11 @@ class VIEW3D_PT_collections(Panel):
 sub = row.split()
 subrow = sub.row(align=True)
 subrow.alignment = 'RIGHT'
-subrow.active = collection.is_visible # Parent collection runtime 
visibility
-subrow.prop(child, "hide_viewport", text="", emboss=False)
+icon = 'HIDE_OFF' if has_visible_objects else 'HIDE_ON'
+props = subrow.operator("object.hide_collection", text="", 
icon=icon, emboss=False)
+props.collection_index = index
+props.toggle = True
+subrow.prop(child.collection, "hide_select", text="", emboss=False)
 
 for child in collection.children:
 index = self._draw_collection(layout, view_layer, child, index)
diff --git a/source/blender/blenkernel/BKE_layer.h 
b/source/blender/blenkernel/BKE_layer.h
index 61d2b03a893..db363148bc8 100644
--- a/source/blender/blenkernel/BKE_layer.h
+++ b/source/blender/blenkernel/BKE_layer.h
@@ -113,8 +113,6 @@ bool BKE_layer_collection_objects_select(
 struct ViewLayer *view_layer, struct LayerCollection *lc, bool 
deselect);
 bool BKE_layer_collection_has_selected_objects(
 struct ViewLayer *view_layer, struct LayerCollection *lc);
-bool BKE_layer_collection_has_layer_collection(
-struct LayerCollection *lc_parent, struct LayerCollection *lc_child);
 
 void BKE_base_set_visible(struct Scene *scene, struct ViewLayer *view_layer, 
struct Base *base, bool extend);
 void BKE_layer_collection_set_visible(struct Scene *scene, struct ViewLayer 
*view_layer, struct LayerCollection *lc, bool extend);
diff --git a/source/blender/blenkernel/intern/layer.c 
b/source/blender/blenkernel/intern/layer.c
index 6b0bdd3c740..bee915567bd 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -611,7 +611,7 @@ int BKE_layer_collection_findindex(ViewLayer *view_layer, 
const LayerCollection
 static short layer_collection_sync(
 ViewLayer *view_layer, const ListBase *lb_scene,
 ListBase *lb_layer, ListBase *new_object_bases,
-short parent_exclude, short parent_restrict, short 
parent_layer_restrict)
+short parent_exclude, short parent_restrict)
 {
/* TODO: support recovery after removal of intermediate collections, 
reordering, ..
 * For local edits we can make editing operating do the appropriate 
thing, but for
@@ -656,17 +656,15 @@ static short layer_collection_sync(
 
/* Collection restrict is inherited. */
short child_restrict = parent_restrict;
-   short child_layer_restrict = parent_layer_restrict;
if (!(collection->flag & COLLECTION_IS_MASTER)) {
child_restrict |= collection->flag;
-   child_layer_restrict |= lc->flag;
}
 
/* Sync child collections. */
short child_runtime_flag = layer_collection_sync(
view_layer, >children,
>layer_collections, new_object_bases,
-   lc->flag, child_restrict, child_layer_restrict);
+   lc->flag, child_restrict);
 
/* Layer collection exclude is not inherited. */
if (lc->flag & LAYER_COLLECTION_EXCLUDE) {
@@ -677,12 +675,6 @@ static short layer_collection_sync(
lc->runtime_flag = child_runtime_flag;
}
 
- 

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

2018-12-11 Thread Dalai Felinto
Commit: 0e7bbe614f47792b77e55cd50eb308b818d0a6f8
Author: Dalai Felinto
Date:   Tue Dec 11 16:42:53 2018 -0200
Branches: experimental-build
https://developer.blender.org/rB0e7bbe614f47792b77e55cd50eb308b818d0a6f8

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] [d415b5c7b85] blender2.8: Fix crash in do-versions after recent changes

2018-12-11 Thread Sergey Sharybin
Commit: d415b5c7b85b07ce4e30e4dbe33491df23202cdc
Author: Sergey Sharybin
Date:   Tue Dec 11 12:44:29 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBd415b5c7b85b07ce4e30e4dbe33491df23202cdc

Fix crash in do-versions after recent changes

No one can simply go into a datablock before it was linked.

===

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 abf7c280996..237e1387a4e 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -917,6 +917,20 @@ void do_versions_after_linking_280(Main *bmain)
}
BKE_paint_toolslots_init_from_main(bmain);
}
+
+   if (!MAIN_VERSION_ATLEAST(bmain, 280, 36)) {
+   /* Ensure we get valid rigidbody object/constraint data in 
relevant collections' objects. */
+   for (Scene *scene = bmain->scene.first; scene; scene = 
scene->id.next) {
+   RigidBodyWorld *rbw = scene->rigidbody_world;
+
+   if (rbw == NULL) {
+   continue;
+   }
+
+   BKE_rigidbody_objects_collection_validate(scene, rbw);
+   BKE_rigidbody_constraints_collection_validate(scene, 
rbw);
+   }
+   }
 }
 
 /* NOTE: this version patch is intended for versions < 2.52.2, but was 
initially introduced in 2.27 already.
@@ -2489,18 +2503,6 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
dir[0] = -dir[0];
}
}
-
-   /* Ensure we get valid rigidbody object/constraint data in 
relevant collections' objects. */
-   for (Scene *scene = bmain->scene.first; scene; scene = 
scene->id.next) {
-   RigidBodyWorld *rbw = scene->rigidbody_world;
-
-   if (rbw == NULL) {
-   continue;
-   }
-
-   BKE_rigidbody_objects_collection_validate(scene, rbw);
-   BKE_rigidbody_constraints_collection_validate(scene, 
rbw);
-   }
}
 
if (!MAIN_VERSION_ATLEAST(bmain, 280, 37)) {

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


[Bf-blender-cvs] [48225a46587] blender2.8: Proper fix for building without Bullet

2018-12-11 Thread Sergey Sharybin
Commit: 48225a4658764cb9d56e48c018bef7b266081744
Author: Sergey Sharybin
Date:   Tue Dec 11 12:37:04 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB48225a4658764cb9d56e48c018bef7b266081744

Proper fix for building without Bullet

Stick to an existing way of dealing with disabled feature.

===

M   source/blender/blenkernel/intern/rigidbody.c
M   source/blender/blenloader/CMakeLists.txt
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/makesrna/intern/rna_rigidbody.c

===

diff --git a/source/blender/blenkernel/intern/rigidbody.c 
b/source/blender/blenkernel/intern/rigidbody.c
index 2d035c271d2..22fb863d829 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -1772,6 +1772,8 @@ bool BKE_rigidbody_check_sim_running(RigidBodyWorld *rbw, 
float ctime) { return
 void BKE_rigidbody_cache_reset(RigidBodyWorld *rbw) {}
 void BKE_rigidbody_rebuild_world(Depsgraph *depsgraph, Scene *scene, float 
ctime) {}
 void BKE_rigidbody_do_simulation(Depsgraph *depsgraph, Scene *scene, float 
ctime) {}
+void BKE_rigidbody_objects_collection_validate(Scene *scene, RigidBodyWorld 
*rbw) {}
+void BKE_rigidbody_constraints_collection_validate(Scene *scene, 
RigidBodyWorld *rbw) {}
 
 #if defined(__GNUC__) || defined(__clang__)
 #  pragma GCC diagnostic pop
diff --git a/source/blender/blenloader/CMakeLists.txt 
b/source/blender/blenloader/CMakeLists.txt
index 5edeb8ccbbb..49987cb860c 100644
--- a/source/blender/blenloader/CMakeLists.txt
+++ b/source/blender/blenloader/CMakeLists.txt
@@ -88,10 +88,6 @@ if(WITH_CODEC_FFMPEG)
add_definitions(-DWITH_FFMPEG)
 endif()
 
-if(WITH_BULLET)
-   add_definitions(-DWITH_BULLET)
-endif()
-
 if(WITH_ALEMBIC)
list(APPEND INC
../alembic
diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index d10d86de2bc..abf7c280996 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2490,7 +2490,6 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
}
}
 
-#ifdef WITH_BULLET
/* Ensure we get valid rigidbody object/constraint data in 
relevant collections' objects. */
for (Scene *scene = bmain->scene.first; scene; scene = 
scene->id.next) {
RigidBodyWorld *rbw = scene->rigidbody_world;
@@ -2502,7 +2501,6 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
BKE_rigidbody_objects_collection_validate(scene, rbw);
BKE_rigidbody_constraints_collection_validate(scene, 
rbw);
}
-#endif
}
 
if (!MAIN_VERSION_ATLEAST(bmain, 280, 37)) {
diff --git a/source/blender/makesrna/intern/rna_rigidbody.c 
b/source/blender/makesrna/intern/rna_rigidbody.c
index dfdbed0dafd..98833390b0d 100644
--- a/source/blender/makesrna/intern/rna_rigidbody.c
+++ b/source/blender/makesrna/intern/rna_rigidbody.c
@@ -151,19 +151,15 @@ static void 
rna_RigidBodyWorld_split_impulse_set(PointerRNA *ptr, bool value)
 
 static void rna_RigidBodyWorld_objects_collection_update(Main *bmain, Scene 
*scene, PointerRNA *ptr)
 {
-#ifdef WITH_BULLET
RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
BKE_rigidbody_objects_collection_validate(scene, rbw);
-#endif
rna_RigidBodyWorld_reset(bmain, scene, ptr);
 }
 
 static void rna_RigidBodyWorld_constraints_collection_update(Main *bmain, 
Scene *scene, PointerRNA *ptr)
 {
-#ifdef WITH_BULLET
RigidBodyWorld *rbw = (RigidBodyWorld *)ptr->data;
BKE_rigidbody_constraints_collection_validate(scene, rbw);
-#endif
rna_RigidBodyWorld_reset(bmain, scene, ptr);
 }

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


[Bf-blender-cvs] [1d3756d4f7e] greasepencil-object: GP: Remove orange line in primitives

2018-12-11 Thread Antonioya
Commit: 1d3756d4f7e52e315329fb2422f6eccc8e1d370c
Author: Antonioya
Date:   Tue Dec 11 13:15:01 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB1d3756d4f7e52e315329fb2422f6eccc8e1d370c

GP: Remove orange line in primitives

After adding the preview of real stroke, this does not make sense.

===

M   source/blender/editors/gpencil/drawgpencil.c
M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/editors/gpencil/gpencil_primitive.c

===

diff --git a/source/blender/editors/gpencil/drawgpencil.c 
b/source/blender/editors/gpencil/drawgpencil.c
index 3c81bbf2f7f..c16ea84ec81 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1430,64 +1430,6 @@ void ED_gp_draw_interpolation(const bContext *C, 
tGPDinterpolate *tgpi, const in
glDisable(GL_BLEND);
 }
 
-/* draw interpolate strokes (used only while operator is running) */
-void ED_gp_draw_primitives(const bContext *C, tGPDprimitive *tgpi, const int 
type)
-{
-   tGPDdraw tgpw;
-   ARegion *ar = CTX_wm_region(C);
-   RegionView3D *rv3d = ar->regiondata;
-
-   /* if idle, do not draw */
-   if (tgpi->flag == 0) {
-   return;
-   }
-
-   Object *obact = CTX_data_active_object(C);
-   Depsgraph *depsgraph = CTX_data_depsgraph(C);
-
-   float color[4];
-   UI_GetThemeColor3fv(TH_GP_VERTEX_SELECT, color);
-   color[3] = 0.6f;
-   int dflag = 0;
-   /* if 3d stuff, enable flags */
-   if (type == REGION_DRAW_POST_VIEW) {
-   dflag |= (GP_DRAWDATA_ONLY3D | GP_DRAWDATA_NOSTATUS);
-   }
-
-   tgpw.rv3d = rv3d;
-   tgpw.depsgraph = depsgraph;
-   tgpw.ob = obact;
-   tgpw.gpd = tgpi->gpd;
-   tgpw.offsx = 0;
-   tgpw.offsy = 0;
-   tgpw.winx = tgpi->ar->winx;
-   tgpw.winy = tgpi->ar->winy;
-   tgpw.dflag = dflag;
-
-   /* turn on alpha-blending */
-   GPU_blend(true);
-   /* calculate parent position */
-   ED_gpencil_parent_location(depsgraph, obact, tgpi->gpd, tgpi->gpl, 
tgpw.diff_mat);
-   if (tgpi->gpf) {
-   tgpw.gps = tgpi->gpf->strokes.first;
-   if (tgpw.gps->totpoints > 0) {
-   tgpw.gpl = tgpi->gpl;
-   tgpw.gpf = tgpi->gpf;
-   tgpw.t_gpf = tgpi->gpf;
-
-   tgpw.lthick = tgpi->gpl->line_change;
-   tgpw.opacity = 1.0;
-   copy_v4_v4(tgpw.tintcolor, color);
-   tgpw.onion = true;
-   tgpw.custonion = true;
-
-   gp_draw_strokes();
-   }
-   }
-
-   GPU_blend(false);
-}
-
 /* wrapper to draw strokes for filling operator */
 void ED_gp_draw_fill(tGPDdraw *tgpw)
 {
diff --git a/source/blender/editors/gpencil/gpencil_intern.h 
b/source/blender/editors/gpencil/gpencil_intern.h
index ce7c40fb494..3d271457b12 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -175,14 +175,12 @@ typedef struct tGPDprimitive {
int lock_axis;/* lock to viewport axis */
 
NumInput num; /* numeric input */
-   void *draw_handle_3d; /* handle for drawing strokes while 
operator is running 3d stuff */
 } tGPDprimitive;
 
 
 /* Modal Operator Drawing Callbacks  */
 
 void ED_gp_draw_interpolation(const struct bContext *C, struct tGPDinterpolate 
*tgpi, const int type);
-void ED_gp_draw_primitives(const struct bContext *C, struct tGPDprimitive 
*tgpi, const int type);
 void ED_gp_draw_fill(struct tGPDdraw *tgpw);
 
 /* * */
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index b50151bc102..05f005faf0e 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -302,18 +302,6 @@ static void gp_primitive_set_cp(tGPDprimitive *tgpi, float 
p[2], float color[4],
}
 }
 
-/* --- */
-/* Drawing Callbacks */
-
-/* Drawing callback for modal operator in 3d mode */
-static void gpencil_primitive_draw_3d(const bContext *C, ARegion *UNUSED(ar), 
void *arg)
-{
-   tGPDprimitive *tgpi = (tGPDprimitive *)arg;
-   ED_gp_draw_primitives(C, tgpi, REGION_DRAW_POST_VIEW);
-}
-
-/* --- */
-
 /* Helper: Draw status message while the user is running the operator */
 static void gpencil_primitive_status_indicators(bContext *C, tGPDprimitive 
*tgpi)
 {
@@ -797,11 +785,6 @@ static void gpencil_primitive_exit(bContext *C, wmOperator 
*op)
 
/* don't assume that operator data exists at all */
if (tgpi) {

[Bf-blender-cvs] [39d24ffccb7] master: Cycles: Cleanup, indentation

2018-12-11 Thread Sergey Sharybin
Commit: 39d24ffccb79d5b09a98866357bd9b8e3f77d379
Author: Sergey Sharybin
Date:   Tue Dec 11 12:57:57 2018 +0100
Branches: master
https://developer.blender.org/rB39d24ffccb79d5b09a98866357bd9b8e3f77d379

Cycles: Cleanup, indentation

===

M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/svm.cpp

===

diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 1943f8c3e2b..a1f88dca466 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1713,9 +1713,9 @@ void RGBToBWNode::constant_fold(const ConstantFolder& 
folder)
 void RGBToBWNode::compile(SVMCompiler& compiler)
 {
compiler.add_node(NODE_CONVERT,
-NODE_CONVERT_CF,
-compiler.stack_assign(inputs[0]),
-compiler.stack_assign(outputs[0]));
+ NODE_CONVERT_CF,
+ compiler.stack_assign(inputs[0]),
+ compiler.stack_assign(outputs[0]));
 }
 
 void RGBToBWNode::compile(OSLCompiler& compiler)
diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index b380117e729..fb32f1ba094 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -212,6 +212,9 @@ int SVMCompiler::stack_find_offset(int size)
while(i >= offset)
active_stack.users[i--] = 1;
 
+   if (offset == 255) {
+   abort();
+   }
return offset;
}
}

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


[Bf-blender-cvs] [608504351df] greasepencil-object: GP: Move drawing of control points to Draw Manager

2018-12-11 Thread Antonioya
Commit: 608504351df5894ba3614e4b8d0a747b7e60ebb2
Author: Antonioya
Date:   Tue Dec 11 13:02:55 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB608504351df5894ba3614e4b8d0a747b7e60ebb2

GP: Move drawing of control points to Draw Manager

===

M   source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M   source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M   source/blender/draw/engines/gpencil/gpencil_engine.c
M   source/blender/draw/engines/gpencil/gpencil_engine.h
M   source/blender/editors/gpencil/drawgpencil.c
M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/editors/gpencil/gpencil_primitive.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 0f9ea009699..82c62684e3f 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -384,6 +384,47 @@ GPUBatch *DRW_gpencil_get_buffer_point_geom(bGPdata *gpd, 
short thickness)
return GPU_batch_create_ex(GPU_PRIM_POINTS, vbo, NULL, 
GPU_BATCH_OWNS_VBO);
 }
 
+/* create batch geometry data for current buffer control point shader */
+GPUBatch *DRW_gpencil_get_buffer_ctrlpoint_geom(bGPdata *gpd)
+{
+   bGPDcontrolpoint *cps = gpd->runtime.cp_points;
+   int totpoints = gpd->runtime.tot_cp_points;
+
+   static GPUVertFormat format = { 0 };
+   static uint pos_id, color_id, thickness_id, uvdata_id;
+   if (format.attr_len == 0) {
+   pos_id = GPU_vertformat_attr_add(, "pos", GPU_COMP_F32, 
3, GPU_FETCH_FLOAT);
+   color_id = GPU_vertformat_attr_add(, "color", 
GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
+   thickness_id = GPU_vertformat_attr_add(, "thickness", 
GPU_COMP_F32, 1, GPU_FETCH_FLOAT);
+   uvdata_id = GPU_vertformat_attr_add(, "uvdata", 
GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
+   }
+
+   GPUVertBuf *vbo = GPU_vertbuf_create_with_format();
+   GPU_vertbuf_data_alloc(vbo, totpoints);
+
+   int idx = 0;
+   for (int i = 0; i < gpd->runtime.tot_cp_points; i++) {
+   bGPDcontrolpoint *cp = [i];
+   float color[4];
+   copy_v3_v3(color, cp->color);
+   color[3] = 0.8f;
+   GPU_vertbuf_attr_set(vbo, color_id, idx, color);
+
+   /* transfer both values using the same shader variable */
+   float uvdata[2] = { 0.0f, 0.0f };
+   GPU_vertbuf_attr_set(vbo, uvdata_id, idx, uvdata);
+
+   /* scale size to get more visible points */
+   float size = cp->size * 8.0f;
+   GPU_vertbuf_attr_set(vbo, thickness_id, idx, );
+
+   GPU_vertbuf_attr_set(vbo, pos_id, idx, >x);
+   idx++;
+   }
+
+   return GPU_batch_create_ex(GPU_PRIM_POINTS, vbo, NULL, 
GPU_BATCH_OWNS_VBO);
+}
+
 /* create batch geometry data for current buffer fill shader */
 GPUBatch *DRW_gpencil_get_buffer_fill_geom(bGPdata *gpd)
 {
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 590ae825371..c9b4def0124 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -560,6 +560,39 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(
return grp;
 }
 
+/* create shading group for control points */
+static DRWShadingGroup *DRW_gpencil_shgroup_ctrlpoint_create(
+   GPENCIL_e_data *e_data, GPENCIL_Data *vedata, DRWPass *pass, GPUShader 
*shader, Object *ob,
+   bGPdata *gpd)
+{
+   GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
+   const float *viewport_size = DRW_viewport_size_get();
+
+   /* e_data.gpencil_stroke_sh */
+   DRWShadingGroup *grp = DRW_shgroup_create(shader, pass);
+
+   DRW_shgroup_uniform_vec2(grp, "Viewport", viewport_size, 1);
+   DRW_shgroup_uniform_float(grp, "pixsize", stl->storage->pixsize, 1);
+
+   stl->storage->obj_scale = 1.0f;
+   stl->storage->keep_size = 0;
+   stl->storage->pixfactor = GP_DEFAULT_PIX_FACTOR;
+   stl->storage->mode = GP_STYLE_STROKE_STYLE_SOLID;
+   DRW_shgroup_uniform_float(grp, "objscale", >storage->obj_scale, 1);
+   const int keep = 1;
+   DRW_shgroup_uniform_int(grp, "keep_size", , 1);
+   DRW_shgroup_uniform_int(grp, "color_type", >storage->color_type, 
1);
+   DRW_shgroup_uniform_int(grp, "mode", >storage->mode, 1);
+   DRW_shgroup_uniform_float(grp, "pixfactor", >storage->pixfactor, 
1);
+
+   /* for drawing always on on predefined z-depth */
+   DRW_shgroup_uniform_int(grp, "xraymode", >storage->xray, 1);
+
+   DRW_shgroup_uniform_texture(grp, "myTexture", 

[Bf-blender-cvs] [0a2d9c58ee5] greasepencil-object: GP: Undo change for Buffer z-depth

2018-12-11 Thread Antonioya
Commit: 0a2d9c58ee56d5ba0482249f1ceceee896a554f2
Author: Antonioya
Date:   Tue Dec 11 13:08:23 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB0a2d9c58ee56d5ba0482249f1ceceee896a554f2

GP: Undo change for Buffer z-depth

This breaks the previous fix of orange line, but it's needed for projected 
strokes.

===

M   source/blender/draw/engines/gpencil/gpencil_engine.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c 
b/source/blender/draw/engines/gpencil/gpencil_engine.c
index ad7208cd4be..e99fbeb4a89 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -315,7 +315,7 @@ void GPENCIL_cache_init(void *vedata)
if (!stl->g_data) {
/* Alloc transient pointers */
stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
-   stl->storage->xray = GP_XRAY_BACK; /* used for drawing */
+   stl->storage->xray = GP_XRAY_FRONT; /* used for drawing */
stl->storage->stroke_style = GP_STYLE_STROKE_STYLE_SOLID; /* 
used for drawing */
}
stl->storage->tonemapping = 0;

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


[Bf-blender-cvs] [765795aed7b] master: Fix macOS buildbot build, wrong CUDA version check.

2018-12-11 Thread Brecht Van Lommel
Commit: 765795aed7bfc738eb3c911ce5e5496fd0879a23
Author: Brecht Van Lommel
Date:   Tue Dec 11 14:14:52 2018 +0100
Branches: master
https://developer.blender.org/rB765795aed7bfc738eb3c911ce5e5496fd0879a23

Fix macOS buildbot build, wrong CUDA version check.

===

M   intern/cycles/kernel/CMakeLists.txt

===

diff --git a/intern/cycles/kernel/CMakeLists.txt 
b/intern/cycles/kernel/CMakeLists.txt
index 78e03a7f066..163aacf19f9 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -454,7 +454,7 @@ if(WITH_CYCLES_CUDA_BINARIES)
foreach(arch ${CYCLES_CUDA_BINARIES_ARCH})
if(${arch} MATCHES "sm_2.")
message(STATUS "CUDA binaries for ${arch} are no longer 
supported, skipped.")
-   elseif(${arch} MATCHES "sm_7." AND (${CUDA_VERSION} 
VERSION_LESS 10.0))
+   elseif(${arch} MATCHES "sm_7." AND (${CUDA_VERSION} LESS 100) 
AND (NOT DEFINED CUDA10_NVCC_EXECUTABLE))
message(STATUS "CUDA binaries for ${arch} require CUDA 
10.0+, skipped.")
else()
# Compile regular kernel

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


[Bf-blender-cvs] [b45b082531c] master: Cycles: Remove old nasty workaround

2018-12-11 Thread Sergey Sharybin
Commit: b45b082531ca8d4e2bd7b06616b27b21f42fe542
Author: Sergey Sharybin
Date:   Tue Dec 11 14:33:24 2018 +0100
Branches: master
https://developer.blender.org/rBb45b082531ca8d4e2bd7b06616b27b21f42fe542

Cycles: Remove old nasty workaround

It used to be used for some sort of ignoring automatically
generated bump nodes. But nowadays it causes one of the shaders
in Classroom demo file to be compiled wrong.

===

M   intern/cycles/render/svm.cpp
M   intern/cycles/render/svm.h

===

diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index fb32f1ba094..01fda0a9e01 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -411,31 +411,20 @@ uint SVMCompiler::attribute_standard(ustring name)
return (std)? attribute(std): attribute(name);
 }
 
-bool SVMCompiler::node_skip_input(ShaderNode * /*node*/, ShaderInput *input)
-{
-   /* nasty exception .. */
-   if(current_type == SHADER_TYPE_DISPLACEMENT && input->link && 
input->link->parent->special_type == SHADER_SPECIAL_TYPE_BUMP)
-   return true;
-
-   return false;
-}
-
 void SVMCompiler::find_dependencies(ShaderNodeSet& dependencies,
 const ShaderNodeSet& done,
 ShaderInput *input,
 ShaderNode *skip_node)
 {
ShaderNode *node = (input->link)? input->link->parent: NULL;
-
if(node != NULL &&
   done.find(node) == done.end() &&
   node != skip_node &&
   dependencies.find(node) == dependencies.end())
{
-   foreach(ShaderInput *in, node->inputs)
-   if(!node_skip_input(node, in))
-   find_dependencies(dependencies, done, in, 
skip_node);
-
+   foreach(ShaderInput *in, node->inputs) {
+   find_dependencies(dependencies, done, in, skip_node);
+   }
dependencies.insert(node);
}
 }
@@ -482,18 +471,19 @@ void SVMCompiler::generate_svm_nodes(const ShaderNodeSet& 
nodes,
if(!done_flag[node->id]) {
bool inputs_done = true;
 
-   foreach(ShaderInput *input, node->inputs)
-   if(!node_skip_input(node, input))
-   if(input->link && 
!done_flag[input->link->parent->id])
-   inputs_done = false;
-
+   foreach(ShaderInput *input, node->inputs) {
+   if(input->link && 
!done_flag[input->link->parent->id]) {
+   inputs_done = false;
+   }
+   }
if(inputs_done) {
generate_node(node, done);
done.insert(node);
done_flag[node->id] = true;
}
-   else
+   else {
nodes_done = false;
+   }
}
}
} while(!nodes_done);
@@ -504,7 +494,7 @@ void SVMCompiler::generate_closure_node(ShaderNode *node,
 {
/* execute dependencies for closure */
foreach(ShaderInput *in, node->inputs) {
-   if(!node_skip_input(node, in) && in->link) {
+   if(in->link != NULL) {
ShaderNodeSet dependencies;
find_dependencies(dependencies, state->nodes_done, in);
generate_svm_nodes(dependencies, state);
diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h
index af97a490a87..ddf35602fa6 100644
--- a/intern/cycles/render/svm.h
+++ b/intern/cycles/render/svm.h
@@ -188,8 +188,6 @@ protected:
int stack_size(SocketType::Type type);
void stack_clear_users(ShaderNode *node, ShaderNodeSet& done);
 
-   bool node_skip_input(ShaderNode *node, ShaderInput *input);
-
/* single closure */
void find_dependencies(ShaderNodeSet& dependencies,
   const ShaderNodeSet& done,

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


[Bf-blender-cvs] [ece109dd60a] master: Cycles: Add strict assert when assigning input socket stack offset

2018-12-11 Thread Sergey Sharybin
Commit: ece109dd60ab5e0be5d037b6e3f051afe1bfc47d
Author: Sergey Sharybin
Date:   Tue Dec 11 14:34:28 2018 +0100
Branches: master
https://developer.blender.org/rBece109dd60ab5e0be5d037b6e3f051afe1bfc47d

Cycles: Add strict assert when assigning input socket stack offset

===

M   intern/cycles/render/svm.cpp

===

diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index 01fda0a9e01..656ccbcb70f 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -246,6 +246,7 @@ int SVMCompiler::stack_assign(ShaderInput *input)
if(input->stack_offset == SVM_STACK_INVALID) {
if(input->link) {
/* linked to output -> use output offset */
+   assert(input->link->stack_offset != SVM_STACK_INVALID);
input->stack_offset = input->link->stack_offset;
}
else {

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


[Bf-blender-cvs] [13e7eaee22e] greasepencil-object: GP: Primitive, add brush noise

2018-12-11 Thread Charlie Jolly
Commit: 13e7eaee22e9428d35a3416db5c53bf354baed51
Author: Charlie Jolly
Date:   Tue Dec 11 13:43:49 2018 +
Branches: greasepencil-object
https://developer.blender.org/rB13e7eaee22e9428d35a3416db5c53bf354baed51

GP: Primitive, add brush noise

===

M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/editors/gpencil/gpencil_primitive.c

===

diff --git a/source/blender/editors/gpencil/gpencil_intern.h 
b/source/blender/editors/gpencil/gpencil_intern.h
index 3d271457b12..9e8660943d5 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -173,6 +173,7 @@ typedef struct tGPDprimitive {
float mvalo[2];   /* previous recorded mouse-position */
 
int lock_axis;/* lock to viewport axis */
+   struct RNG *rng;
 
NumInput num; /* numeric input */
 } tGPDprimitive;
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 05f005faf0e..255eef8fe59 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -41,9 +41,12 @@
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 #include "BLI_math.h"
+#include "BLI_rand.h"
 
 #include "BLT_translation.h"
 
+#include "PIL_time.h"
+
 #include "DNA_brush_types.h"
 #include "DNA_gpencil_types.h"
 #include "DNA_meshdata_types.h"
@@ -285,6 +288,11 @@ static void gp_primitive_set_initdata(bContext *C, 
tGPDprimitive *tgpi)
/* allocate memory for storage points */
gpencil_primitive_allocate_memory(tgpi);
 
+   /* Random generator, only init once. */
+   uint rng_seed = (uint)(PIL_check_seconds_timer_i() & UINT_MAX);
+   rng_seed ^= POINTER_AS_UINT(tgpi->origin);
+   tgpi->rng = BLI_rng_new(rng_seed);
+
 }
 
 /* Helper: set control point */
@@ -531,6 +539,7 @@ static void gp_primitive_update_strokes(bContext *C, 
tGPDprimitive *tgpi)
 {
ToolSettings *ts = tgpi->scene->toolsettings;
bGPdata *gpd = tgpi->gpd;
+   Brush *brush = tgpi->brush;
bGPDstroke *gps = tgpi->gpf->strokes.first;
GP_Sculpt_Settings *gset = >gp_sculpt;
int depth_margin = (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 
4 : 0;
@@ -666,13 +675,24 @@ static void gp_primitive_update_strokes(bContext *C, 
tGPDprimitive *tgpi)
/* calc pressure */
float pressure = 1.0;
if (ELEM(tgpi->type, GP_STROKE_ARC, GP_STROKE_BEZIER, 
GP_STROKE_LINE)) {
+   /* apply randomness to pressure */
+   if ((brush->gpencil_settings->flag & 
GP_BRUSH_GROUP_RANDOM))
+   {
+   float rnd = BLI_rng_get_float(tgpi->rng);
+   if (rnd > 0.5f) {
+   pressure -= 
brush->gpencil_settings->draw_random_press * rnd;
+   }
+   else {
+   pressure += 
brush->gpencil_settings->draw_random_press * rnd;
+   }
+   }
+   /* normalize value to evaluate curve */
if (gset->flag & GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE) {
-   /* normalize value to evaluate curve */
float value = (float)i / (gps->totpoints - 1);
float curvef = 
curvemapping_evaluateF(gset->cur_primitive, 0, value);
-   pressure = 1.0f * curvef;
-   CLAMP_MIN(pressure, 0.1f);
+   pressure *= curvef;
}
+   CLAMP_MIN(pressure, 0.1f);
}
 
tpt->pressure = pressure;
@@ -874,7 +894,7 @@ static void gpencil_primitive_init(bContext *C, wmOperator 
*op)
RNA_int_set(op->ptr, "edges", 4);
}
else { /* LINE */
-   RNA_int_set(op->ptr, "edges", 24);
+   RNA_int_set(op->ptr, "edges", 32);
}
 
tgpi->tot_stored_edges = 0;
@@ -1197,6 +1217,7 @@ static int gpencil_primitive_modal(bContext *C, 
wmOperator *op, const wmEvent *e
 
switch (event->type) {
case LEFTMOUSE:
+   {
if ((event->val == KM_PRESS) && (tgpi->flag == IDLE)) {
/* start drawing primitive */
/* TODO: Ignore if not in main region yet */
@@ -1216,6 +1237,7 @@ static int gpencil_primitive_modal(bContext *C, 
wmOperator *op, const wmEvent *e
}
}
break;
+ 

[Bf-blender-cvs] [84b02dc54a8] master: Cleanup: remove accidentally committed debug code.

2018-12-11 Thread Brecht Van Lommel
Commit: 84b02dc54a8c06e963a263e7232e41a993ab21c8
Author: Brecht Van Lommel
Date:   Tue Dec 11 15:18:01 2018 +0100
Branches: master
https://developer.blender.org/rB84b02dc54a8c06e963a263e7232e41a993ab21c8

Cleanup: remove accidentally committed debug code.

===

M   intern/cycles/render/svm.cpp

===

diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index 656ccbcb70f..360b2b461cf 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -212,9 +212,6 @@ int SVMCompiler::stack_find_offset(int size)
while(i >= offset)
active_stack.users[i--] = 1;
 
-   if (offset == 255) {
-   abort();
-   }
return offset;
}
}

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


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

2018-12-11 Thread Brecht Van Lommel
Commit: f60018e425ac5c488789ee15055f89f39e5cbb05
Author: Brecht Van Lommel
Date:   Tue Dec 11 15:18:43 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBf60018e425ac5c488789ee15055f89f39e5cbb05

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] [c438ca96bae] greasepencil-object: GP: Fix control points size when change zoom

2018-12-11 Thread Antonioya
Commit: c438ca96bae6983e10e2bca438c035abbdb350d8
Author: Antonioya
Date:   Tue Dec 11 15:22:16 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc438ca96bae6983e10e2bca438c035abbdb350d8

GP: Fix control points size when change zoom

Also replaced the shader used.

===

M   source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M   source/blender/draw/engines/gpencil/gpencil_draw_utils.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 82c62684e3f..89b08966e9d 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -391,12 +391,11 @@ GPUBatch *DRW_gpencil_get_buffer_ctrlpoint_geom(bGPdata 
*gpd)
int totpoints = gpd->runtime.tot_cp_points;
 
static GPUVertFormat format = { 0 };
-   static uint pos_id, color_id, thickness_id, uvdata_id;
+   static uint pos_id, color_id, size_id;
if (format.attr_len == 0) {
pos_id = GPU_vertformat_attr_add(, "pos", GPU_COMP_F32, 
3, GPU_FETCH_FLOAT);
+   size_id = GPU_vertformat_attr_add(, "size", 
GPU_COMP_F32, 1, GPU_FETCH_FLOAT);
color_id = GPU_vertformat_attr_add(, "color", 
GPU_COMP_F32, 4, GPU_FETCH_FLOAT);
-   thickness_id = GPU_vertformat_attr_add(, "thickness", 
GPU_COMP_F32, 1, GPU_FETCH_FLOAT);
-   uvdata_id = GPU_vertformat_attr_add(, "uvdata", 
GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
}
 
GPUVertBuf *vbo = GPU_vertbuf_create_with_format();
@@ -410,13 +409,9 @@ GPUBatch *DRW_gpencil_get_buffer_ctrlpoint_geom(bGPdata 
*gpd)
color[3] = 0.8f;
GPU_vertbuf_attr_set(vbo, color_id, idx, color);
 
-   /* transfer both values using the same shader variable */
-   float uvdata[2] = { 0.0f, 0.0f };
-   GPU_vertbuf_attr_set(vbo, uvdata_id, idx, uvdata);
-
-   /* scale size to get more visible points */
-   float size = cp->size * 8.0f;
-   GPU_vertbuf_attr_set(vbo, thickness_id, idx, );
+   /* scale size */
+   float size = cp->size * 0.8f;
+   GPU_vertbuf_attr_set(vbo, size_id, idx, );
 
GPU_vertbuf_attr_set(vbo, pos_id, idx, >x);
idx++;
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index c9b4def0124..04acd89d9ac 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -560,39 +560,6 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(
return grp;
 }
 
-/* create shading group for control points */
-static DRWShadingGroup *DRW_gpencil_shgroup_ctrlpoint_create(
-   GPENCIL_e_data *e_data, GPENCIL_Data *vedata, DRWPass *pass, GPUShader 
*shader, Object *ob,
-   bGPdata *gpd)
-{
-   GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
-   const float *viewport_size = DRW_viewport_size_get();
-
-   /* e_data.gpencil_stroke_sh */
-   DRWShadingGroup *grp = DRW_shgroup_create(shader, pass);
-
-   DRW_shgroup_uniform_vec2(grp, "Viewport", viewport_size, 1);
-   DRW_shgroup_uniform_float(grp, "pixsize", stl->storage->pixsize, 1);
-
-   stl->storage->obj_scale = 1.0f;
-   stl->storage->keep_size = 0;
-   stl->storage->pixfactor = GP_DEFAULT_PIX_FACTOR;
-   stl->storage->mode = GP_STYLE_STROKE_STYLE_SOLID;
-   DRW_shgroup_uniform_float(grp, "objscale", >storage->obj_scale, 1);
-   const int keep = 1;
-   DRW_shgroup_uniform_int(grp, "keep_size", , 1);
-   DRW_shgroup_uniform_int(grp, "color_type", >storage->color_type, 
1);
-   DRW_shgroup_uniform_int(grp, "mode", >storage->mode, 1);
-   DRW_shgroup_uniform_float(grp, "pixfactor", >storage->pixfactor, 
1);
-
-   /* for drawing always on on predefined z-depth */
-   DRW_shgroup_uniform_int(grp, "xraymode", >storage->xray, 1);
-
-   DRW_shgroup_uniform_texture(grp, "myTexture", 
e_data->gpencil_blank_texture);
-
-   return grp;
-}
-
 /* add fill vertex info  */
 static void gpencil_add_fill_vertexdata(
 GpencilBatchCache *cache,
@@ -1295,8 +1262,8 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data 
*e_data, void *vedata, T
((gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0))
{
 
-   DRWShadingGroup *shgrp = DRW_gpencil_shgroup_ctrlpoint_create(
-   e_data, vedata, psl->drawing_pass, 
e_data->gpencil_point_sh, NULL, gpd);
+   DRWShadingGroup *shgrp = DRW_shgroup_create(
+   e_data->gpencil_edit_point_sh, psl->drawing_pass);
 

[Bf-blender-cvs] [eb83efb6d1b] blender2.8: Implement BMesh.from_object

2018-12-11 Thread Philipp Oeser
Commit: eb83efb6d1bbbde744a35aa56b33473ad6961132
Author: Philipp Oeser
Date:   Tue Dec 11 13:55:42 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBeb83efb6d1bbbde744a35aa56b33473ad6961132

Implement BMesh.from_object

Fixes T59069

Reviewers: sergey, brecht

Maniphest Tasks: T59069

Differential Revision: https://developer.blender.org/D4065

===

M   source/blender/python/bmesh/bmesh_py_types.c

===

diff --git a/source/blender/python/bmesh/bmesh_py_types.c 
b/source/blender/python/bmesh/bmesh_py_types.c
index ba2167e74a5..236b752a5b7 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -37,8 +37,10 @@
 #include "BKE_customdata.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
+#include "BKE_mesh_runtime.h"
 
 #include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
 
 #include "bmesh.h"
 
@@ -919,7 +921,7 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, 
PyObject *args)
 }
 
 PyDoc_STRVAR(bpy_bmesh_from_object_doc,
-".. method:: from_object(object, scene, deform=True, render=False, cage=False, 
face_normals=True)\n"
+".. method:: from_object(object, depsgraph, deform=True, cage=False, 
face_normals=True)\n"
 "\n"
 "   Initialize this bmesh from existing object datablock (currently only 
meshes are supported).\n"
 "\n"
@@ -927,8 +929,6 @@ PyDoc_STRVAR(bpy_bmesh_from_object_doc,
 "   :type object: :class:`Object`\n"
 "   :arg deform: Apply deformation modifiers.\n"
 "   :type deform: boolean\n"
-"   :arg render: Use render settings.\n"
-"   :type render: boolean\n"
 "   :arg cage: Get the mesh as a deformed cage.\n"
 "   :type cage: boolean\n"
 "   :arg face_normals: Calculate face normals.\n"
@@ -936,32 +936,29 @@ PyDoc_STRVAR(bpy_bmesh_from_object_doc,
 );
 static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, 
PyObject *kw)
 {
-   /* TODO: This doesn't work currently because of missing depsgraph. */
-#if 0
-   static const char *kwlist[] = {"object", "scene", "deform", "render", 
"cage", "face_normals", NULL};
+   static const char *kwlist[] = {"object", "depsgraph", "deform", "cage", 
"face_normals", NULL};
PyObject *py_object;
-   PyObject *py_scene;
-   Object *ob;
-   struct Scene *scene;
+   PyObject *py_depsgraph;
+   Object *ob, *ob_eval;
+   struct Depsgraph *depsgraph;
+   struct Scene *scene_eval;
+   Mesh *me_eval;
BMesh *bm;
bool use_deform = true;
-   bool use_render = false;
bool use_cage   = false;
bool use_fnorm  = true;
-   DerivedMesh *dm;
const int mask = CD_MASK_BMESH;
 
BPY_BM_CHECK_OBJ(self);
 
if (!PyArg_ParseTupleAndKeywords(
-   args, kw, "OO|O&:from_object", (char **)kwlist,
-   _object, _scene,
+   args, kw, "OO|O&:from_object", (char **)kwlist,
+   _object, _depsgraph,
PyC_ParseBool, _deform,
-   PyC_ParseBool, _render,
PyC_ParseBool, _cage,
PyC_ParseBool, _fnorm) ||
-   !(ob= PyC_RNA_AsPointer(py_object, "Object")) ||
-   !(scene = PyC_RNA_AsPointer(py_scene,  "Scene")))
+   !(ob= PyC_RNA_AsPointer(py_object, "Object")) ||
+   !(depsgraph = PyC_RNA_AsPointer(py_depsgraph,  "Depsgraph")))
{
return NULL;
}
@@ -972,52 +969,47 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, 
PyObject *args, PyObject
return NULL;
}
 
+   const bool use_render = DEG_get_mode(depsgraph) == DAG_EVAL_RENDER;
+   scene_eval = DEG_get_evaluated_scene(depsgraph);
+   ob_eval = DEG_get_evaluated_object(depsgraph, ob);
+
/* Write the display mesh into the dummy mesh */
if (use_deform) {
if (use_render) {
if (use_cage) {
PyErr_SetString(PyExc_ValueError,
-   "from_object(...): cage arg is 
unsupported when (render=True)");
+   "from_object(...): cage arg is 
unsupported when dependency graph evaluation mode is RENDER");
return NULL;
}
else {
-   dm = mesh_create_derived_render(scene, ob, 
mask);
+   me_eval = 
mesh_create_eval_final_render(depsgraph, scene_eval, ob_eval, mask);
}
}
else {
if (use_cage) {
-   dm = mesh_get_derived_deform(scene, ob, mask);  
/* ob->derivedDeform */
+   me_eval = mesh_get_eval_deform(depsgraph, 
scene_eval, ob_eval, mask);
}
  

[Bf-blender-cvs] [3e169f02205] greasepencil-object: GP: Fix wrong end cap when finish stroke

2018-12-11 Thread Antonioya
Commit: 3e169f022051a7816eb7c98c57d4d18ef220
Author: Antonioya
Date:   Tue Dec 11 15:37:55 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB3e169f022051a7816eb7c98c57d4d18ef220

GP: Fix wrong end cap when finish stroke

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c 
b/source/blender/editors/gpencil/gpencil_primitive.c
index 255eef8fe59..8dceff29b2f 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -719,6 +719,7 @@ static void gp_primitive_update_strokes(bContext *C, 
tGPDprimitive *tgpi)
pt->strength = tgpi->brush->gpencil_settings->draw_strength;
pt->time = 0.0f;
pt->flag = 0;
+   pt->uv_fac = 1.0f;
 
if (gps->dvert != NULL) {
MDeformVert *dvert = >dvert[i];

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


[Bf-blender-cvs] [54e1d381576] blender2.8: Fix T59001: UV Editor - Crash when hiding all UVs while 3D view is open and sync selection enabled

2018-12-11 Thread Philipp Oeser
Commit: 54e1d3815762ef964a74f179ef846110673e743f
Author: Philipp Oeser
Date:   Tue Dec 11 14:50:03 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB54e1d3815762ef964a74f179ef846110673e743f

Fix T59001: UV Editor - Crash when hiding all UVs while 3D view is open
and sync selection enabled

Reviewers: brecht

Maniphest Tasks: T59001

Differential Revision: https://developer.blender.org/D4066

===

M   source/blender/editors/uvedit/uvedit_ops.c

===

diff --git a/source/blender/editors/uvedit/uvedit_ops.c 
b/source/blender/editors/uvedit/uvedit_ops.c
index db8a9986880..54909610850 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -4105,9 +4105,7 @@ static int uv_hide_exec(bContext *C, wmOperator *op)
 
if (ts->uv_flag & UV_SYNC_SELECTION) {
EDBM_mesh_hide(em, swap);
-
-   DEG_id_tag_update(obedit->data, ID_RECALC_SELECT);
-   WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
+   EDBM_update_generic(em, true, false);
 
return OPERATOR_FINISHED;
}
@@ -4230,8 +4228,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *op)
/* call the mesh function if we are in mesh sync sel */
if (ts->uv_flag & UV_SYNC_SELECTION) {
EDBM_mesh_reveal(em, select);
-   DEG_id_tag_update(obedit->data, ID_RECALC_SELECT);
-   WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
+   EDBM_update_generic(em, true, false);
 
return OPERATOR_FINISHED;
}

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