[Bf-blender-cvs] [0356c8f25b9] master: Cleanup: remove edit-mode check in vertex coordinate access

2019-08-21 Thread Campbell Barton
Commit: 0356c8f25b96bf9d8c677e51ad5106b5295cb37f
Author: Campbell Barton
Date:   Thu Aug 22 13:20:05 2019 +1000
Branches: master
https://developer.blender.org/rB0356c8f25b96bf9d8c677e51ad5106b5295cb37f

Cleanup: remove edit-mode check in vertex coordinate access

This makes the function more predictable since other object
types don't access edit-mode data.

===

M   source/blender/blenkernel/BKE_lattice.h
M   source/blender/blenkernel/intern/lattice.c

===

diff --git a/source/blender/blenkernel/BKE_lattice.h 
b/source/blender/blenkernel/BKE_lattice.h
index fbb98b290f0..8395b182171 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -89,6 +89,7 @@ void armature_deform_verts(struct Object *armOb,
struct bGPDstroke *gps);
 
 float (*BKE_lattice_vert_coords_alloc(const struct Lattice *lt, int 
*r_vert_len))[3];
+void BKE_lattice_vert_coords_get(const struct Lattice *lt, float 
(*vert_coords)[3]);
 void BKE_lattice_vert_coords_apply(struct Lattice *lt, const float 
(*vert_coords)[3]);
 void BKE_lattice_modifiers_calc(struct Depsgraph *depsgraph,
 struct Scene *scene,
diff --git a/source/blender/blenkernel/intern/lattice.c 
b/source/blender/blenkernel/intern/lattice.c
index 64ba02db30d..0ceca1206f6 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -1057,22 +1057,19 @@ void outside_lattice(Lattice *lt)
   }
 }
 
-float (*BKE_lattice_vert_coords_alloc(const Lattice *lt, int *r_vert_len))[3]
+void BKE_lattice_vert_coords_get(const Lattice *lt, float (*vert_coords)[3])
 {
-  int vert_len;
-  float(*vert_coords)[3];
-
-  if (lt->editlatt) {
-lt = lt->editlatt->latt;
-  }
-  vert_len = *r_vert_len = lt->pntsu * lt->pntsv * lt->pntsw;
-
-  vert_coords = MEM_mallocN(sizeof(*vert_coords) * vert_len, __func__);
-
+  const int vert_len = lt->pntsu * lt->pntsv * lt->pntsw;
   for (int i = 0; i < vert_len; i++) {
 copy_v3_v3(vert_coords[i], lt->def[i].vec);
   }
+}
 
+float (*BKE_lattice_vert_coords_alloc(const Lattice *lt, int *r_vert_len))[3]
+{
+  const int vert_len = *r_vert_len = lt->pntsu * lt->pntsv * lt->pntsw;
+  float(*vert_coords)[3] = MEM_mallocN(sizeof(*vert_coords) * vert_len, 
__func__);
+  BKE_lattice_vert_coords_get(lt, vert_coords);
   return vert_coords;
 }
 
@@ -1123,7 +1120,11 @@ void BKE_lattice_modifiers_calc(struct Depsgraph 
*depsgraph, Scene *scene, Objec
 }
 
 if (!vert_coords) {
-  vert_coords = BKE_lattice_vert_coords_alloc(ob_orig->data, );
+  Lattice *lt_orig = ob_orig->data;
+  if (lt_orig->editlatt) {
+lt_orig = lt_orig->editlatt->latt;
+  }
+  vert_coords = BKE_lattice_vert_coords_alloc(lt_orig, );
 }
 mti->deformVerts(md, , NULL, vert_coords, numVerts);
   }
@@ -1137,7 +1138,11 @@ void BKE_lattice_modifiers_calc(struct Depsgraph 
*depsgraph, Scene *scene, Objec
   else {
 /* Displist won't do anything; this is just for posterity's sake until we 
remove it. */
 if (!vert_coords) {
-  vert_coords = BKE_lattice_vert_coords_alloc(ob_orig->data, );
+  Lattice *lt_orig = ob_orig->data;
+  if (lt_orig->editlatt) {
+lt_orig = lt_orig->editlatt->latt;
+  }
+  vert_coords = BKE_lattice_vert_coords_alloc(lt_orig, );
 }
 
 DispList *dl = MEM_callocN(sizeof(*dl), "lt_dl");

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


[Bf-blender-cvs] [c2442541a62] master: Cleanup: typo in last commit

2019-08-21 Thread Campbell Barton
Commit: c2442541a62e48bd10499438c84d20bf21cac2c0
Author: Campbell Barton
Date:   Thu Aug 22 09:13:17 2019 +1000
Branches: master
https://developer.blender.org/rBc2442541a62e48bd10499438c84d20bf21cac2c0

Cleanup: typo in last commit

===

M   source/blender/blenkernel/BKE_curve.h
M   source/blender/blenkernel/intern/curve.c
M   source/blender/blenkernel/intern/displist.c
M   source/blender/editors/object/object_modifier.c

===

diff --git a/source/blender/blenkernel/BKE_curve.h 
b/source/blender/blenkernel/BKE_curve.h
index 623d0df1618..67efeea02cb 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -127,7 +127,7 @@ void BKE_curve_nurb_vert_active_validate(struct Curve *cu);
 float (*BKE_curve_nurbs_vert_coords_alloc(struct ListBase *lb, int 
*r_vert_len))[3];
 void BKE_curve_nurbs_vert_coords_get(struct ListBase *lb, float 
(*vert_coords)[3], int vert_len);
 
-void BK_curve_nurbs_vert_coords_apply(struct ListBase *lb, const float 
(*vert_coords)[3]);
+void BKE_curve_nurbs_vert_coords_apply(struct ListBase *lb, const float 
(*vert_coords)[3]);
 
 float (*BKE_curve_nurbs_key_vert_coords_alloc(struct ListBase *lb,
   float *key,
diff --git a/source/blender/blenkernel/intern/curve.c 
b/source/blender/blenkernel/intern/curve.c
index 24a9d5dc199..1f21d796220 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -4641,7 +4641,7 @@ float (*BKE_curve_nurbs_vert_coords_alloc(ListBase *lb, 
int *r_vert_len))[3]
   return vert_coords;
 }
 
-void BK_curve_nurbs_vert_coords_apply(ListBase *lb, const float 
(*vert_coords)[3])
+void BKE_curve_nurbs_vert_coords_apply(ListBase *lb, const float 
(*vert_coords)[3])
 {
   const float *co = vert_coords[0];
 
diff --git a/source/blender/blenkernel/intern/displist.c 
b/source/blender/blenkernel/intern/displist.c
index d2a62b3c2f8..bc235768bc7 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -920,7 +920,7 @@ static void curve_calc_modifiers_pre(
   }
 
   if (deformedVerts) {
-BK_curve_nurbs_vert_coords_apply(nurb, deformedVerts);
+BKE_curve_nurbs_vert_coords_apply(nurb, deformedVerts);
 MEM_freeN(deformedVerts);
   }
   if (keyVerts) { /* these are not passed through modifier stack */
diff --git a/source/blender/editors/object/object_modifier.c 
b/source/blender/editors/object/object_modifier.c
index 8275a1eb5c4..58a072d9e5f 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -716,7 +716,7 @@ static int modifier_apply_obdata(
 
 vertexCos = BKE_curve_nurbs_vert_coords_alloc(_eval->nurb, 
);
 mti->deformVerts(md_eval, , NULL, vertexCos, numVerts);
-BK_curve_nurbs_vert_coords_apply(>nurb, vertexCos);
+BKE_curve_nurbs_vert_coords_apply(>nurb, vertexCos);
 
 MEM_freeN(vertexCos);

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


[Bf-blender-cvs] [189aa32a3ac] master: Cleanup: vertex coordinate access, naming & minor changes

2019-08-21 Thread Campbell Barton
Commit: 189aa32a3ac0e949275d16ffb19576a1306d1780
Author: Campbell Barton
Date:   Thu Aug 22 06:28:35 2019 +1000
Branches: master
https://developer.blender.org/rB189aa32a3ac0e949275d16ffb19576a1306d1780

Cleanup: vertex coordinate access, naming & minor changes

This also splits vertex access and allocation so it's possible
to copy coordinates into an existing array without allocating it.

===

M   source/blender/blenkernel/BKE_DerivedMesh.h
M   source/blender/blenkernel/BKE_curve.h
M   source/blender/blenkernel/BKE_editmesh.h
M   source/blender/blenkernel/BKE_lattice.h
M   source/blender/blenkernel/BKE_mesh.h
M   source/blender/blenkernel/BKE_pbvh.h
M   source/blender/blenkernel/intern/DerivedMesh.c
M   source/blender/blenkernel/intern/crazyspace.c
M   source/blender/blenkernel/intern/curve.c
M   source/blender/blenkernel/intern/displist.c
M   source/blender/blenkernel/intern/editderivedmesh.c
M   source/blender/blenkernel/intern/editmesh.c
M   source/blender/blenkernel/intern/lattice.c
M   source/blender/blenkernel/intern/mesh.c
M   source/blender/blenkernel/intern/mesh_convert.c
M   source/blender/blenkernel/intern/mesh_remap.c
M   source/blender/blenkernel/intern/multires_reshape.c
M   source/blender/blenkernel/intern/paint.c
M   source/blender/blenkernel/intern/particle_system.c
M   source/blender/blenkernel/intern/pbvh.c
M   source/blender/draw/intern/draw_cache_impl_displist.c
M   source/blender/editors/mesh/editmesh_knife.c
M   source/blender/editors/object/object_modifier.c
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/editors/sculpt_paint/sculpt_undo.c
M   source/blender/modifiers/intern/MOD_cloth.c
M   source/blender/modifiers/intern/MOD_collision.c
M   source/blender/modifiers/intern/MOD_correctivesmooth.c
M   source/blender/modifiers/intern/MOD_fluidsim_util.c
M   source/blender/modifiers/intern/MOD_meshdeform.c
M   source/blender/modifiers/intern/MOD_particlesystem.c
M   source/blender/modifiers/intern/MOD_surface.c
M   source/blender/modifiers/intern/MOD_util.c
M   source/blender/modifiers/intern/MOD_uvproject.c
M   source/blender/modifiers/intern/MOD_weightvgproximity.c

===

diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h 
b/source/blender/blenkernel/BKE_DerivedMesh.h
index bc115fec35a..c866809b7c0 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -393,7 +393,7 @@ struct Mesh *editbmesh_get_eval_cage_and_final(struct 
Depsgraph *depsgraph,
const struct 
CustomData_MeshMasks *dataMask,
struct Mesh **r_final);
 
-float (*editbmesh_get_vertex_cos(struct BMEditMesh *em, int *r_numVerts))[3];
+float (*editbmesh_vert_coords_alloc(struct BMEditMesh *em, int 
*r_vert_len))[3];
 bool editbmesh_modifier_is_enabled(struct Scene *scene,
struct ModifierData *md,
bool has_prev_mesh);
diff --git a/source/blender/blenkernel/BKE_curve.h 
b/source/blender/blenkernel/BKE_curve.h
index dff38f6b609..623d0df1618 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -124,11 +124,15 @@ void BKE_curve_nurb_vert_active_set(struct Curve *cu, 
const struct Nurb *nu, con
 bool BKE_curve_nurb_vert_active_get(struct Curve *cu, struct Nurb **r_nu, void 
**r_vert);
 void BKE_curve_nurb_vert_active_validate(struct Curve *cu);
 
-float (*BKE_curve_nurbs_vertexCos_get(struct ListBase *lb, int 
*r_numVerts))[3];
-void BK_curve_nurbs_vertexCos_apply(struct ListBase *lb, const float 
(*vertexCos)[3]);
+float (*BKE_curve_nurbs_vert_coords_alloc(struct ListBase *lb, int 
*r_vert_len))[3];
+void BKE_curve_nurbs_vert_coords_get(struct ListBase *lb, float 
(*vert_coords)[3], int vert_len);
 
-float (*BKE_curve_nurbs_keyVertexCos_get(struct ListBase *lb, float *key))[3];
-void BKE_curve_nurbs_keyVertexTilts_apply(struct ListBase *lb, float *key);
+void BK_curve_nurbs_vert_coords_apply(struct ListBase *lb, const float 
(*vert_coords)[3]);
+
+float (*BKE_curve_nurbs_key_vert_coords_alloc(struct ListBase *lb,
+  float *key,
+  int *r_vert_len))[3];
+void BKE_curve_nurbs_key_vert_tilts_apply(struct ListBase *lb, float *key);
 
 void BKE_curve_editNurb_keyIndex_delCV(struct GHash *keyindex, const void *cv);
 void BKE_curve_editNurb_keyIndex_free(struct GHash **keyindex);
diff --git a/source/blender/blenkernel/BKE_editmesh.h 
b/source/blender/blenkernel/BKE_editmesh.h
index b7280c702d2..6e4132cbc35 100644
--- a/source/blender/blenkernel/BKE_editmesh.h
+++ 

[Bf-blender-cvs] [e88970db82b] soc-2019-openxr: Don't create a DirectX swap-chain

2019-08-21 Thread Julian Eisel
Commit: e88970db82b2a8114e849172204ed630224e5517
Author: Julian Eisel
Date:   Wed Aug 21 20:58:59 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rBe88970db82b2a8114e849172204ed630224e5517

Don't create a DirectX swap-chain

We only render offscreen anyway. There's no point in creating a
swap-chain. This simplifies things quite a bit.

===

M   intern/ghost/intern/GHOST_ContextD3D.cpp
M   intern/ghost/intern/GHOST_ContextD3D.h

===

diff --git a/intern/ghost/intern/GHOST_ContextD3D.cpp 
b/intern/ghost/intern/GHOST_ContextD3D.cpp
index 6568fcf4252..a0668b2d985 100644
--- a/intern/ghost/intern/GHOST_ContextD3D.cpp
+++ b/intern/ghost/intern/GHOST_ContextD3D.cpp
@@ -30,7 +30,7 @@
 //#define USE_DRAW_D3D_TEST_TRIANGLE
 
 HMODULE GHOST_ContextD3D::s_d3d_lib = NULL;
-PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN 
GHOST_ContextD3D::s_D3D11CreateDeviceAndSwapChainFn = NULL;
+PFN_D3D11_CREATE_DEVICE GHOST_ContextD3D::s_D3D11CreateDeviceFn = NULL;
 
 #ifdef USE_DRAW_D3D_TEST_TRIANGLE
 static void drawTestTriangle(ID3D11Device *m_device,
@@ -46,8 +46,6 @@ GHOST_ContextD3D::GHOST_ContextD3D(bool stereoVisual, HWND 
hWnd)
 
 GHOST_ContextD3D::~GHOST_ContextD3D()
 {
-  m_swapchain->Release();
-  m_backbuffer_view->Release();
   m_device->Release();
   m_device_ctx->ClearState();
   m_device_ctx->Release();
@@ -55,8 +53,7 @@ GHOST_ContextD3D::~GHOST_ContextD3D()
 
 GHOST_TSuccess GHOST_ContextD3D::swapBuffers()
 {
-  HRESULT res = m_swapchain->Present(0, 0);
-  return (res == S_OK) ? GHOST_kSuccess : GHOST_kFailure;
+  return GHOST_kSuccess;
 }
 
 GHOST_TSuccess GHOST_ContextD3D::activateDrawingContext()
@@ -98,43 +95,6 @@ GHOST_TSuccess 
GHOST_ContextD3D::setDefaultFramebufferSize(GHOST_TUns32 width, G
   return GHOST_kSuccess;
 }
 
-GHOST_TSuccess GHOST_ContextD3D::updateSwapchain(GHOST_TUns32 width, 
GHOST_TUns32 height)
-{
-  HRESULT hres;
-  DXGI_SWAP_CHAIN_DESC swapchain_desc;
-
-  m_swapchain->GetDesc(_desc);
-
-  if ((swapchain_desc.BufferDesc.Width == width) && 
(swapchain_desc.BufferDesc.Height == height)) {
-// Nothing to do.
-return GHOST_kSuccess;
-  }
-
-#define CHECK_HRES \
-  if (hres != S_OK) { \
-printf("Error updating swapchain (error code %x): %s line %i\n", hres, 
__FILE__, __LINE__); \
-  } \
-  (void)0
-
-  m_device_ctx->OMSetRenderTargets(0, nullptr, nullptr);
-
-  m_backbuffer_view->Release();
-  m_device_ctx->ClearState();
-
-  hres = m_swapchain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, 0);
-  CHECK_HRES;
-
-  ID3D11Texture2D *buf;
-  hres = m_swapchain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void **));
-  CHECK_HRES;
-
-  hres = m_device->CreateRenderTargetView(buf, NULL, _backbuffer_view);
-  CHECK_HRES;
-  buf->Release();
-
-  return GHOST_kSuccess;
-}
-
 GHOST_TSuccess GHOST_ContextD3D::setupD3DLib()
 {
   if (s_d3d_lib == NULL) {
@@ -148,14 +108,14 @@ GHOST_TSuccess GHOST_ContextD3D::setupD3DLib()
 }
   }
 
-  if (s_D3D11CreateDeviceAndSwapChainFn == NULL) {
-s_D3D11CreateDeviceAndSwapChainFn = 
(PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN)GetProcAddress(
-s_d3d_lib, "D3D11CreateDeviceAndSwapChain");
+  if (s_D3D11CreateDeviceFn == NULL) {
+s_D3D11CreateDeviceFn = (PFN_D3D11_CREATE_DEVICE)GetProcAddress(s_d3d_lib,
+
"D3D11CreateDevice");
 
-WIN32_CHK(s_D3D11CreateDeviceAndSwapChainFn != NULL);
+WIN32_CHK(s_D3D11CreateDeviceFn != NULL);
 
-if (s_D3D11CreateDeviceAndSwapChainFn == NULL) {
-  fprintf(stderr, "GetProcAddress(s_d3d_lib, 
\"D3D11CreateDeviceAndSwapChain\") failed!\n");
+if (s_D3D11CreateDeviceFn == NULL) {
+  fprintf(stderr, "GetProcAddress(s_d3d_lib, \"D3D11CreateDevice\") 
failed!\n");
   return GHOST_kFailure;
 }
   }
@@ -169,38 +129,19 @@ GHOST_TSuccess 
GHOST_ContextD3D::initializeDrawingContext()
 return GHOST_kFailure;
   }
 
-  DXGI_SWAP_CHAIN_DESC sd{};
-
-  sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
-  sd.SampleDesc.Count = 1;
-  sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
-  sd.BufferCount = 3;
-  sd.OutputWindow = m_hWnd;
-  sd.Windowed = TRUE;
-  sd.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
-
-  HRESULT hres = s_D3D11CreateDeviceAndSwapChainFn(NULL,
-   D3D_DRIVER_TYPE_HARDWARE,
-   NULL,
-   // 
D3D11_CREATE_DEVICE_DEBUG,
-   0,
-   NULL,
-   0,
-   D3D11_SDK_VERSION,
-   ,
-   _swapchain,
-   _device,
-  

[Bf-blender-cvs] [20b0b36479a] soc-2019-openxr: DirectX: Create an own render-target, don't use swapchain for blitting

2019-08-21 Thread Julian Eisel
Commit: 20b0b36479aae60952a557fa125e2136a8e05992
Author: Julian Eisel
Date:   Wed Aug 21 20:40:13 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB20b0b36479aae60952a557fa125e2136a8e05992

DirectX: Create an own render-target, don't use swapchain for blitting

===

M   intern/ghost/intern/GHOST_ContextD3D.cpp

===

diff --git a/intern/ghost/intern/GHOST_ContextD3D.cpp 
b/intern/ghost/intern/GHOST_ContextD3D.cpp
index e9253216d9a..6568fcf4252 100644
--- a/intern/ghost/intern/GHOST_ContextD3D.cpp
+++ b/intern/ghost/intern/GHOST_ContextD3D.cpp
@@ -215,8 +215,7 @@ GHOST_TSuccess 
GHOST_ContextD3D::blitOpenGLOffscreenContext(GHOST_Context * /*of
 GHOST_TInt32 
height)
 {
   if (updateSwapchain(width, height) == GHOST_kSuccess) {
-GHOST_SharedOpenGLResource *shared_res = createSharedOpenGLResource(
-width, height, m_backbuffer_view);
+GHOST_SharedOpenGLResource *shared_res = createSharedOpenGLResource(width, 
height);
 
 if (shared_res) {
   GHOST_TSuccess ret = blitFromOpenGLContext(shared_res, width, height);

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


[Bf-blender-cvs] [4a2d1953f3c] master: Cleanup: use doxy groups

2019-08-21 Thread Campbell Barton
Commit: 4a2d1953f3ca3e1160a3ce767df15e481658bdf6
Author: Campbell Barton
Date:   Thu Aug 22 04:56:18 2019 +1000
Branches: master
https://developer.blender.org/rB4a2d1953f3ca3e1160a3ce767df15e481658bdf6

Cleanup: use doxy groups

===

M   source/blender/editors/object/object_transform.c

===

diff --git a/source/blender/editors/object/object_transform.c 
b/source/blender/editors/object/object_transform.c
index 975aa0f5bac..9b39c5b2a88 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -77,7 +77,9 @@
 
 #include "object_intern.h"
 
-/*** Clear Transformation /
+/*  */
+/** \name Clear Transformation Utilities
+ * \{ */
 
 /* clear location of object */
 static void object_clear_loc(Object *ob, const bool clear_delta)
@@ -284,8 +286,6 @@ static void object_clear_scale(Object *ob, const bool 
clear_delta)
   }
 }
 
-/* --- */
-
 /* generic exec for clear-transform operators */
 static int object_clear_transform_generic_exec(bContext *C,
wmOperator *op,
@@ -329,7 +329,11 @@ static int object_clear_transform_generic_exec(bContext *C,
   return OPERATOR_FINISHED;
 }
 
-/* --- */
+/** \} */
+
+/*  */
+/** \name Clear Location Operator
+ * \{ */
 
 static int object_location_clear_exec(bContext *C, wmOperator *op)
 {
@@ -359,6 +363,12 @@ void OBJECT_OT_location_clear(wmOperatorType *ot)
   "Clear delta location in addition to clearing the normal location 
transform");
 }
 
+/** \} */
+
+/*  */
+/** \name Clear Rotation Operator
+ * \{ */
+
 static int object_rotation_clear_exec(bContext *C, wmOperator *op)
 {
   return object_clear_transform_generic_exec(C, op, object_clear_rot, 
ANIM_KS_ROTATION_ID);
@@ -387,6 +397,12 @@ void OBJECT_OT_rotation_clear(wmOperatorType *ot)
   "Clear delta rotation in addition to clearing the normal rotation 
transform");
 }
 
+/** \} */
+
+/*  */
+/** \name Clear Scale Operator
+ * \{ */
+
 static int object_scale_clear_exec(bContext *C, wmOperator *op)
 {
   return object_clear_transform_generic_exec(C, op, object_clear_scale, 
ANIM_KS_SCALING_ID);
@@ -415,7 +431,11 @@ void OBJECT_OT_scale_clear(wmOperatorType *ot)
   "Clear delta scale in addition to clearing the normal scale transform");
 }
 
-/* --- */
+/** \} */
+
+/*  */
+/** \name Clear Origin Operator
+ * \{ */
 
 static int object_origin_clear_exec(bContext *C, wmOperator *UNUSED(op))
 {
@@ -457,7 +477,11 @@ void OBJECT_OT_origin_clear(wmOperatorType *ot)
   ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-/*** Apply Transformation /
+/** \} */
+
+/*  */
+/** \name Apply Transformation Operator
+ * \{ */
 
 /* use this when the loc/size/rot of the parent has changed but the children
  * should stay in the same place, e.g. for apply-size-rot or object center */
@@ -960,7 +984,11 @@ void OBJECT_OT_transform_apply(wmOperatorType *ot)
   "Modify properties such as curve vertex radius, font size 
and bone envelope");
 }
 
-/* Set Object Center /
+/** \} */
+
+/*  */
+/** \name Set Object Center Operator
+ * \{ */
 
 enum {
   GEOMETRY_TO_ORIGIN = 0,
@@ -1152,7 +1180,8 @@ static int object_origin_set_exec(bContext *C, wmOperator 
*op)
   else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
 Curve *cu = ob->data;
 
-if (centermode == ORIGIN_TO_CURSOR) { /* done */
+if (centermode == ORIGIN_TO_CURSOR) {
+  /* done */
 }
 else if (around == V3D_AROUND_CENTER_MEDIAN) {
   BKE_curve_center_median(cu, cent);
@@ -1244,7 +1273,8 @@ static int object_origin_set_exec(bContext *C, wmOperator 
*op)
   else if (ob->type == OB_MBALL) {
 MetaBall *mb = ob->data;
 
-if (centermode == ORIGIN_TO_CURSOR) { /* done */
+if (centermode == ORIGIN_TO_CURSOR) {
+  /* done */
 }
 else if (around == V3D_AROUND_CENTER_MEDIAN) {
   BKE_mball_center_median(mb, cent);
@@ -1270,7 +1300,8 @@ static int object_origin_set_exec(bContext *C, wmOperator 
*op)
   else if (ob->type == OB_LATTICE) {
 Lattice *lt = ob->data;
 
-if (centermode == ORIGIN_TO_CURSOR) { /* done */
+if (centermode == ORIGIN_TO_CURSOR) {

[Bf-blender-cvs] [e6f8f189023] master: Cleanup: clang-format

2019-08-21 Thread Campbell Barton
Commit: e6f8f189023d1472f77797789e0c2bea78716df6
Author: Campbell Barton
Date:   Thu Aug 22 04:36:04 2019 +1000
Branches: master
https://developer.blender.org/rBe6f8f189023d1472f77797789e0c2bea78716df6

Cleanup: clang-format

===

M   source/blender/editors/armature/armature_utils.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl

===

diff --git a/source/blender/editors/armature/armature_utils.c 
b/source/blender/editors/armature/armature_utils.c
index 63b55a3f1b8..cd299906b4c 100644
--- a/source/blender/editors/armature/armature_utils.c
+++ b/source/blender/editors/armature/armature_utils.c
@@ -381,8 +381,12 @@ void armature_tag_unselect(bArmature *arm)
 
 void ED_armature_ebone_transform_mirror_update(bArmature *arm, EditBone *ebo, 
bool check_select)
 {
-  /* TODO When this function is called by property updates, cancelling the 
value change will not restore mirrored bone correctly. */
-  /* Currently check_select==true when this function is called from a 
transform operator, eg. from 3d viewport. */
+  /* TODO When this function is called by property updates,
+   * cancelling the value change will not restore mirrored bone correctly. */
+
+  /* Currently check_select==true when this function is called from a 
transform operator,
+   * eg. from 3d viewport. */
+
   /* no layer check, correct mirror is more important */
   if (!check_select || ebo->flag & (BONE_TIPSEL | BONE_ROOTSEL)) {
 EditBone *eboflip = ED_armature_ebone_get_mirrored(arm->edbo, ebo);
@@ -440,7 +444,8 @@ void ED_armature_ebone_transform_mirror_update(bArmature 
*arm, EditBone *ebo, bo
 
   if (!check_select || ebo->flag & BONE_SELECTED) {
 /* Mirror bone body properties (both head and tail are selected). */
-/* TODO: These values can also be changed from pose mode, so only 
mirroring them in edit mode is not ideal. */
+/* TODO: These values can also be changed from pose mode,
+ * so only mirroring them in edit mode is not ideal. */
 eboflip->dist = ebo->dist;
 eboflip->weight = ebo->weight;
 
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl 
b/source/blender/gpu/shaders/gpu_shader_material.glsl
index 5ec24ec7086..acd28789364 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -400,7 +400,8 @@ void map_range(
   }
 }
 
-vec3 safe_divide(vec3 a, vec3 b) {
+vec3 safe_divide(vec3 a, vec3 b)
+{
   return vec3((b.x != 0.0) ? a.x / b.x : 0.0,
   (b.y != 0.0) ? a.y / b.y : 0.0,
   (b.z != 0.0) ? a.z / b.z : 0.0);

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


[Bf-blender-cvs] [3036c1fed18] greasepencil-object: Merge branch 'master' into greasepencil-object

2019-08-21 Thread Antonio Vazquez
Commit: 3036c1fed183640291213c44654d744d56ea958b
Author: Antonio Vazquez
Date:   Wed Aug 21 20:39:34 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB3036c1fed183640291213c44654d744d56ea958b

Merge branch 'master' 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] [2c77f2deac7] soc-2019-openxr: Remove GHOST API functions for OpenGL offscreen blitting

2019-08-21 Thread Julian Eisel
Commit: 2c77f2deac7b3a3728be394e53f699c6fd03aa88
Author: Julian Eisel
Date:   Wed Aug 21 20:36:40 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB2c77f2deac7b3a3728be394e53f699c6fd03aa88

Remove GHOST API functions for OpenGL offscreen blitting

These were previously used to blit from a offscreen (non-OpenGL)
context, into an onscreen one. We do this differently, and only within
GHOST_XrGraphicsBinding now, so this can be removed.

===

M   intern/ghost/GHOST_C-api.h
M   intern/ghost/GHOST_IContext.h
M   intern/ghost/GHOST_IWindow.h
M   intern/ghost/intern/GHOST_C-api.cpp
M   intern/ghost/intern/GHOST_Context.h
M   intern/ghost/intern/GHOST_ContextD3D.cpp
M   intern/ghost/intern/GHOST_ContextD3D.h
M   intern/ghost/intern/GHOST_Window.cpp
M   intern/ghost/intern/GHOST_Window.h
M   intern/ghost/intern/GHOST_XrGraphicsBinding.cpp

===

diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 84bad87e654..03cf3a1c7a0 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -197,15 +197,6 @@ GHOST_TSuccess 
GHOST_DisposeDirectXContext(GHOST_SystemHandle systemhandle,
GHOST_ContextHandle contexthandle);
 #endif
 
-GHOST_TSuccess GHOST_BlitOpenGLOffscreenContext(GHOST_WindowHandle 
windowhandle,
-GHOST_ContextHandle 
offscreen_contexthandle);
-
-extern GHOST_TSuccess GHOST_ContextBlitOpenGLOffscreenContext(
-GHOST_ContextHandle onscreen_contexthandle,
-GHOST_ContextHandle offscreen_contexthandle,
-GHOST_TInt32 width,
-GHOST_TInt32 height);
-
 extern GHOST_ContextHandle GHOST_GetWindowContext(GHOST_WindowHandle 
windowhandle);
 
 /**
diff --git a/intern/ghost/GHOST_IContext.h b/intern/ghost/GHOST_IContext.h
index 3bad8db115f..d114df428b0 100644
--- a/intern/ghost/GHOST_IContext.h
+++ b/intern/ghost/GHOST_IContext.h
@@ -56,10 +56,6 @@ class GHOST_IContext {
*/
   virtual GHOST_TSuccess releaseDrawingContext() = 0;
 
-  virtual GHOST_TSuccess blitOpenGLOffscreenContext(class GHOST_Context 
*offscreen,
-GHOST_TInt32 width,
-GHOST_TInt32 height) = 0;
-
   virtual unsigned int getDefaultFramebuffer() = 0;
 
   virtual GHOST_TSuccess swapBuffers() = 0;
diff --git a/intern/ghost/GHOST_IWindow.h b/intern/ghost/GHOST_IWindow.h
index 212e7ff8d13..547ae1d3ec3 100644
--- a/intern/ghost/GHOST_IWindow.h
+++ b/intern/ghost/GHOST_IWindow.h
@@ -79,8 +79,6 @@ class GHOST_IWindow {
 
   virtual class GHOST_IContext *getDrawingContext() = 0;
 
-  virtual GHOST_TSuccess blitOpenGLOffscreenContext(GHOST_IContext *offscreen) 
= 0;
-
   /**
* Sets the title displayed in the title bar.
* \param title The title to display in the title bar.
diff --git a/intern/ghost/intern/GHOST_C-api.cpp 
b/intern/ghost/intern/GHOST_C-api.cpp
index 778daf83d32..898378460c6 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -150,25 +150,6 @@ GHOST_TSuccess 
GHOST_DisposeDirectXContext(GHOST_SystemHandle systemhandle,
 
 #endif
 
-GHOST_TSuccess GHOST_BlitOpenGLOffscreenContext(GHOST_WindowHandle 
windowhandle,
-GHOST_ContextHandle 
offscreen_contexthandle)
-{
-  GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
-
-  return window->blitOpenGLOffscreenContext((GHOST_IContext 
*)offscreen_contexthandle);
-}
-
-GHOST_TSuccess GHOST_ContextBlitOpenGLOffscreenContext(GHOST_ContextHandle 
onscreen_contexthandle,
-   GHOST_ContextHandle 
offscreen_contexthandle,
-   GHOST_TInt32 width,
-   GHOST_TInt32 height)
-{
-  GHOST_IContext *context = (GHOST_IContext *)onscreen_contexthandle;
-
-  return context->blitOpenGLOffscreenContext(
-  (class GHOST_Context *)offscreen_contexthandle, width, height);
-}
-
 GHOST_ContextHandle GHOST_GetWindowContext(GHOST_WindowHandle windowhandle)
 {
   GHOST_IWindow *window = (GHOST_IWindow *)windowhandle;
diff --git a/intern/ghost/intern/GHOST_Context.h 
b/intern/ghost/intern/GHOST_Context.h
index 0bc2aa21119..af801112bda 100644
--- a/intern/ghost/intern/GHOST_Context.h
+++ b/intern/ghost/intern/GHOST_Context.h
@@ -146,9 +146,9 @@ class GHOST_Context : public GHOST_IContext {
 return GHOST_kFailure;
   }
 
-  GHOST_TSuccess blitOpenGLOffscreenContext(GHOST_Context *offscreen,
-GHOST_TInt32 width,
-GHOST_TInt32 height);
+  virtual GHOST_TSuccess blitOpenGLOffscreenContext(GHOST_Context *offscreen,
+

[Bf-blender-cvs] [e83f0922011] master: Shading: Add Volume Info node.

2019-08-21 Thread OmarSquircleArt
Commit: e83f0922011243a0085975fe41930ed34bb6c009
Author: OmarSquircleArt
Date:   Wed Aug 21 20:22:24 2019 +0200
Branches: master
https://developer.blender.org/rBe83f0922011243a0085975fe41930ed34bb6c009

Shading: Add Volume Info node.

The Volume Info node provides the Color, Desnity, Flame, and Temperature
of smoke domains.

Reviewers: brecht

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

===

M   intern/cycles/blender/blender_shader.cpp
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h
M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_shader.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/shader/nodes/node_shader_volume_info.c

===

diff --git a/intern/cycles/blender/blender_shader.cpp 
b/intern/cycles/blender/blender_shader.cpp
index fdefe2140bd..720f521c589 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -607,6 +607,9 @@ static ShaderNode *add_node(Scene *scene,
   else if (b_node.is_a(_ShaderNodeHairInfo)) {
 node = new HairInfoNode();
   }
+  else if (b_node.is_a(_ShaderNodeVolumeInfo)) {
+node = new VolumeInfoNode();
+  }
   else if (b_node.is_a(_ShaderNodeBump)) {
 BL::ShaderNodeBump b_bump_node(b_node);
 BumpNode *bump = new BumpNode();
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 6435894d41a..3a5d65039c8 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -4168,6 +4168,90 @@ void HairInfoNode::compile(OSLCompiler )
   compiler.add(this, "node_hair_info");
 }
 
+/* Volume Info */
+
+NODE_DEFINE(VolumeInfoNode)
+{
+  NodeType *type = NodeType::add("volume_info", create, NodeType::SHADER);
+
+  SOCKET_OUT_COLOR(color, "Color");
+  SOCKET_OUT_FLOAT(density, "Density");
+  SOCKET_OUT_FLOAT(flame, "Flame");
+  SOCKET_OUT_FLOAT(temperature, "Temperature");
+
+  return type;
+}
+
+VolumeInfoNode::VolumeInfoNode() : ShaderNode(node_type)
+{
+}
+
+/* The requested attributes are not updated after node expansion.
+ * So we explicitly request the required attributes.
+ */
+void VolumeInfoNode::attributes(Shader *shader, AttributeRequestSet 
*attributes)
+{
+  if (shader->has_volume) {
+if (!output("Color")->links.empty()) {
+  attributes->add(ATTR_STD_VOLUME_COLOR);
+}
+if (!output("Density")->links.empty()) {
+  attributes->add(ATTR_STD_VOLUME_DENSITY);
+}
+if (!output("Flame")->links.empty()) {
+  attributes->add(ATTR_STD_VOLUME_FLAME);
+}
+if (!output("Temperature")->links.empty()) {
+  attributes->add(ATTR_STD_VOLUME_TEMPERATURE);
+}
+attributes->add(ATTR_STD_GENERATED_TRANSFORM);
+  }
+  ShaderNode::attributes(shader, attributes);
+}
+
+void VolumeInfoNode::expand(ShaderGraph *graph)
+{
+  ShaderOutput *color_out = output("Color");
+  if (!color_out->links.empty()) {
+AttributeNode *attr = new AttributeNode();
+attr->attribute = "color";
+graph->add(attr);
+graph->relink(color_out, attr->output("Color"));
+  }
+
+  ShaderOutput *density_out = output("Density");
+  if (!density_out->links.empty()) {
+AttributeNode *attr = new AttributeNode();
+attr->attribute = "density";
+graph->add(attr);
+graph->relink(density_out, attr->output("Fac"));
+  }
+
+  ShaderOutput *flame_out = output("Flame");
+  if (!flame_out->links.empty()) {
+AttributeNode *attr = new AttributeNode();
+attr->attribute = "flame";
+graph->add(attr);
+graph->relink(flame_out, attr->output("Fac"));
+  }
+
+  ShaderOutput *temperature_out = output("Temperature");
+  if (!temperature_out->links.empty()) {
+AttributeNode *attr = new AttributeNode();
+attr->attribute = "temperature";
+graph->add(attr);
+graph->relink(temperature_out, attr->output("Fac"));
+  }
+}
+
+void VolumeInfoNode::compile(SVMCompiler &)
+{
+}
+
+void VolumeInfoNode::compile(OSLCompiler &)
+{
+}
+
 /* Value */
 
 NODE_DEFINE(ValueNode)
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 9c4e643e727..fbed2ff0ef6 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -961,6 +961,21 @@ class HairInfoNode : public ShaderNode {
   }
 };
 
+class VolumeInfoNode : public ShaderNode {
+ public:
+  SHADER_NODE_CLASS(VolumeInfoNode)
+  void attributes(Shader *shader, AttributeRequestSet *attributes);
+  bool has_attribute_dependency()
+  {
+return true;
+  }
+  bool has_spatial_varying()
+  {
+return true;
+  }
+  void expand(ShaderGraph *graph);
+};
+
 class ValueNode : public ShaderNode {
  public:
   SHADER_NODE_CLASS(ValueNode)
diff 

[Bf-blender-cvs] [133dfdd704b] master: Shading: Add White Noise node.

2019-08-21 Thread OmarSquircleArt
Commit: 133dfdd704b6a2a4d46337696773b331a44304ea
Author: OmarSquircleArt
Date:   Wed Aug 21 20:04:09 2019 +0200
Branches: master
https://developer.blender.org/rB133dfdd704b6a2a4d46337696773b331a44304ea

Shading: Add White Noise node.

The White Noise node hashes the input and returns a random number in the
range [0, 1]. The input can be a 1D, 2D, 3D, or a 4D vector.

Reviewers: brecht, JacquesLucke

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

===

M   intern/cycles/blender/blender_curves.cpp
M   intern/cycles/blender/blender_object.cpp
M   intern/cycles/blender/blender_session.cpp
M   intern/cycles/blender/blender_shader.cpp
M   intern/cycles/blender/blender_sync.cpp
M   intern/cycles/kernel/CMakeLists.txt
M   intern/cycles/kernel/kernel_random.h
M   intern/cycles/kernel/osl/osl_services.cpp
M   intern/cycles/kernel/shaders/CMakeLists.txt
A   intern/cycles/kernel/shaders/node_white_noise_texture.osl
M   intern/cycles/kernel/svm/svm.h
M   intern/cycles/kernel/svm/svm_geometry.h
M   intern/cycles/kernel/svm/svm_noise.h
M   intern/cycles/kernel/svm/svm_types.h
A   intern/cycles/kernel/svm/svm_white_noise.h
M   intern/cycles/render/integrator.cpp
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h
M   intern/cycles/util/util_hash.h
M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.c
M   source/blender/editors/space_node/drawnode.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_shader.h
M   source/blender/nodes/NOD_static_types.h
A   source/blender/nodes/shader/nodes/node_shader_tex_white_noise.c

===

diff --git a/intern/cycles/blender/blender_curves.cpp 
b/intern/cycles/blender/blender_curves.cpp
index 29a1408d85d..4dba8ffbe0e 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -656,7 +656,7 @@ static void ExportCurveSegments(Scene *scene, Mesh *mesh, 
ParticleCurveData *CDa
   }
 
   if (attr_random != NULL) {
-attr_random->add(hash_int_01(num_curves));
+attr_random->add(hash_uint2_to_float(num_curves, 0));
   }
 
   mesh->add_curve(num_keys, CData->psys_shader[sys]);
diff --git a/intern/cycles/blender/blender_object.cpp 
b/intern/cycles/blender/blender_object.cpp
index 7ccf8226e5b..ab47da9c1a2 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -217,7 +217,7 @@ void BlenderSync::sync_light(BL::Object _parent,
 light->random_id = random_id;
   }
   else {
-light->random_id = hash_int_2d(hash_string(b_ob.name().c_str()), 0);
+light->random_id = hash_uint2(hash_string(b_ob.name().c_str()), 0);
   }
 
   if (light->type == LIGHT_AREA)
@@ -490,7 +490,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph _depsgraph,
 else {
   object->dupli_generated = make_float3(0.0f, 0.0f, 0.0f);
   object->dupli_uv = make_float2(0.0f, 0.0f);
-  object->random_id = hash_int_2d(hash_string(object->name.c_str()), 0);
+  object->random_id = hash_uint2(hash_string(object->name.c_str()), 0);
 }
 
 object->tag_update(scene);
diff --git a/intern/cycles/blender/blender_session.cpp 
b/intern/cycles/blender/blender_session.cpp
index 047cc82dbfc..9a798a4f979 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -539,8 +539,8 @@ void BlenderSession::render(BL::Depsgraph _depsgraph_)
 /* Make sure all views have different noise patterns. - hardcoded value 
just to make it random
  */
 if (view_index != 0) {
-  scene->integrator->seed += hash_int_2d(scene->integrator->seed,
- hash_int(view_index * 
0xdeadbeef));
+  scene->integrator->seed += hash_uint2(scene->integrator->seed,
+hash_uint2(view_index * 
0xdeadbeef, 0));
   scene->integrator->tag_update(scene);
 }
 
diff --git a/intern/cycles/blender/blender_shader.cpp 
b/intern/cycles/blender/blender_shader.cpp
index 322a1771786..fdefe2140bd 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -844,6 +844,12 @@ static ShaderNode *add_node(Scene *scene,
 }
 node = ies;
   }
+  else if (b_node.is_a(_ShaderNodeTexWhiteNoise)) {
+BL::ShaderNodeTexWhiteNoise b_tex_white_noise_node(b_node);
+WhiteNoiseTextureNode *white_noise_node = new WhiteNoiseTextureNode();
+white_noise_node->dimensions = b_tex_white_noise_node.dimensions();
+node = white_noise_node;
+  }
   else if (b_node.is_a(_ShaderNodeNormalMap)) {
   

[Bf-blender-cvs] [7f4a2fc437c] master: Shading: Add more operators to Vector Math node.

2019-08-21 Thread OmarSquircleArt
Commit: 7f4a2fc437cf9a6decbda152bd7d36ce7a08929f
Author: OmarSquircleArt
Date:   Wed Aug 21 19:36:33 2019 +0200
Branches: master
https://developer.blender.org/rB7f4a2fc437cf9a6decbda152bd7d36ce7a08929f

Shading: Add more operators to Vector Math node.

Add Multiply, Divide, Project, Reflect, Distance, Length, Scale, Snap,
Floor, Ceil, Modulo, Fraction, Absolute, Minimum, and Maximum operators
to the Vector Math node. The Value output has been removed from operators
whose output is a vector, and the other way around. All of those removals
has been handled properly in versioning code.

The patch doesn't include tests for the new operators. Tests will be added
in a later patch.

Reviewers: brecht, JacquesLucke

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

===

M   .clang-format
M   intern/cycles/blender/blender_session.cpp
M   intern/cycles/blender/blender_shader.cpp
M   intern/cycles/kernel/shaders/node_vector_math.osl
M   intern/cycles/kernel/svm/svm_math.h
M   intern/cycles/kernel/svm/svm_math_util.h
M   intern/cycles/kernel/svm/svm_types.h
M   intern/cycles/render/bake.cpp
M   intern/cycles/render/constant_fold.cpp
M   intern/cycles/render/constant_fold.h
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h
M   intern/cycles/subd/subd_dice.cpp
M   intern/cycles/subd/subd_split.cpp
M   intern/cycles/test/render_graph_finalize_test.cpp
M   intern/cycles/util/util_math_float3.h
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/intern/node.c
M   source/blender/blenlib/BLI_listbase.h
M   source/blender/blenloader/intern/versioning_cycles.c
M   source/blender/editors/space_node/drawnode.c
M   source/blender/gpu/shaders/gpu_shader_material.glsl
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/CMakeLists.txt
M   source/blender/nodes/NOD_static_types.h
M   source/blender/nodes/intern/node_util.c
M   source/blender/nodes/intern/node_util.h
M   source/blender/nodes/shader/node_shader_tree.c
M   source/blender/nodes/shader/nodes/node_shader_normal_map.c
D   source/blender/nodes/shader/nodes/node_shader_vectMath.c
A   source/blender/nodes/shader/nodes/node_shader_vector_math.c

===

diff --git a/.clang-format b/.clang-format
index bbbe3f1bac4..b81403c46ce 100644
--- a/.clang-format
+++ b/.clang-format
@@ -224,7 +224,9 @@ ForEachMacros:
   - LISTBASE_CIRCULAR_BACKWARD_BEGIN
   - LISTBASE_CIRCULAR_FORWARD_BEGIN
   - LISTBASE_FOREACH
+  - LISTBASE_FOREACH_BACKWARD
   - LISTBASE_FOREACH_MUTABLE
+  - LISTBASE_FOREACH_BACKWARD_MUTABLE
   - MAN2D_ITER_AXES_BEGIN
   - MAN_ITER_AXES_BEGIN
   - NODE_INSTANCE_HASH_ITER
diff --git a/intern/cycles/blender/blender_session.cpp 
b/intern/cycles/blender/blender_session.cpp
index d38a97dc4ea..047cc82dbfc 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -1481,8 +1481,8 @@ void BlenderSession::update_resumable_tile_manager(int 
num_samples)
 
   /* Round after doing the multiplications with num_chunks and 
num_samples_per_chunk
* to allow for many small chunks. */
-  int rounded_range_start_sample = (int)floor(range_start_sample + 0.5f);
-  int rounded_range_num_samples = max((int)floor(range_num_samples + 0.5f), 1);
+  int rounded_range_start_sample = (int)floorf(range_start_sample + 0.5f);
+  int rounded_range_num_samples = max((int)floorf(range_num_samples + 0.5f), 
1);
 
   /* Make sure we don't overshoot. */
   if (rounded_range_start_sample + rounded_range_num_samples > num_samples) {
diff --git a/intern/cycles/blender/blender_shader.cpp 
b/intern/cycles/blender/blender_shader.cpp
index 626a1dad7db..322a1771786 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -333,9 +333,9 @@ static ShaderNode *add_node(Scene *scene,
   }
   else if (b_node.is_a(_ShaderNodeVectorMath)) {
 BL::ShaderNodeVectorMath b_vector_math_node(b_node);
-VectorMathNode *vmath = new VectorMathNode();
-vmath->type = (NodeVectorMath)b_vector_math_node.operation();
-node = vmath;
+VectorMathNode *vector_math_node = new VectorMathNode();
+vector_math_node->type = 
(NodeVectorMathType)b_vector_math_node.operation();
+node = vector_math_node;
   }
   else if (b_node.is_a(_ShaderNodeVectorTransform)) {
 BL::ShaderNodeVectorTransform b_vector_transform_node(b_node);
diff --git a/intern/cycles/kernel/shaders/node_vector_math.osl 
b/intern/cycles/kernel/shaders/node_vector_math.osl
index 10bb0c7283c..fd5e27aa144 100644
--- a/intern/cycles/kernel/shaders/node_vector_math.osl
+++ b/intern/cycles/kernel/shaders/node_vector_math.osl
@@ -16,34 +16,97 @@
 
 #include "stdosl.h"
 
+float safe_divide(float a, 

[Bf-blender-cvs] [fec7ac7c518] soc-2019-openxr: Refactor OpenGL/DirectX resource sharing for multiple shared resources

2019-08-21 Thread Julian Eisel
Commit: fec7ac7c51896a165ab0a5b19a984f9c2fdba1ce
Author: Julian Eisel
Date:   Wed Aug 21 19:44:08 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rBfec7ac7c51896a165ab0a5b19a984f9c2fdba1ce

Refactor OpenGL/DirectX resource sharing for multiple shared resources

Rather than max. one shared resource per DirectX context, code can now
request a handle for a shared resource and ask the DirectX context to do
operations on that.

===

M   intern/ghost/intern/GHOST_ContextD3D.cpp
M   intern/ghost/intern/GHOST_ContextD3D.h
M   intern/ghost/intern/GHOST_XrGraphicsBinding.cpp

===

diff --git a/intern/ghost/intern/GHOST_ContextD3D.cpp 
b/intern/ghost/intern/GHOST_ContextD3D.cpp
index 8e357a80702..f5fc36a4831 100644
--- a/intern/ghost/intern/GHOST_ContextD3D.cpp
+++ b/intern/ghost/intern/GHOST_ContextD3D.cpp
@@ -27,7 +27,7 @@
 #include "GHOST_ContextWGL.h" /* For shared drawing */
 #include "GHOST_ContextD3D.h"
 
-// #define USE_DRAW_D3D_TEST_TRIANGLE
+//#define USE_DRAW_D3D_TEST_TRIANGLE
 
 HMODULE GHOST_ContextD3D::s_d3d_lib = NULL;
 PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN 
GHOST_ContextD3D::s_D3D11CreateDeviceAndSwapChainFn = NULL;
@@ -35,107 +35,10 @@ PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN 
GHOST_ContextD3D::s_D3D11CreateDeviceAndS
 #ifdef USE_DRAW_D3D_TEST_TRIANGLE
 static void drawTestTriangle(ID3D11Device *m_device,
  ID3D11DeviceContext *m_device_ctx,
- HWND hwnd,
  GHOST_TInt32 width,
  GHOST_TInt32 height);
 #endif
 
-class SharedOpenGLContext {
-  ID3D11Device *m_d3d_device;
-  GHOST_ContextWGL *m_wgl_ctx;
-  /* NV_DX_interop2 requires ID3D11Texture2D as backbuffer when sharing with 
GL_RENDERBUFFER */
-  ID3D11Texture2D *m_d3d_render_target;
-  GLuint m_gl_render_buf;
-
- public:
-  struct SharedData {
-HANDLE device;
-GLuint fbo;
-HANDLE render_buf{nullptr};
-  } m_shared;
-
-  /* XXX Should have a map of render_target items to shared resource data 
(SharedData) to
-   * allow multiple shared surfaces in a context. Current code assumes a 
single one. That would be
-   * an issue if we wanted to use the OpenXR provided textures (changes for 
each eye and each
-   * redraw) and not the constant D3D swapchain texture like now. */
-  SharedOpenGLContext(ID3D11Device *d3d_device,
-  GHOST_ContextWGL *wgl_ctx,
-  ID3D11Texture2D *render_target)
-  : m_d3d_device(d3d_device), m_wgl_ctx(wgl_ctx), 
m_d3d_render_target(render_target)
-  {
-  }
-  ~SharedOpenGLContext()
-  {
-if (m_shared.render_buf) {
-  wglDXUnregisterObjectNV(m_shared.device, m_shared.render_buf);
-}
-if (m_shared.device) {
-  wglDXCloseDeviceNV(m_shared.device);
-}
-glDeleteFramebuffers(1, _shared.fbo);
-glDeleteRenderbuffers(1, _gl_render_buf);
-  }
-
-  void reregisterSharedObject()
-  {
-if (m_shared.render_buf) {
-  wglDXUnregisterObjectNV(m_shared.device, m_shared.render_buf);
-  m_shared.render_buf = nullptr;
-}
-
-m_shared.render_buf = wglDXRegisterObjectNV(m_shared.device,
-m_d3d_render_target,
-m_gl_render_buf,
-GL_RENDERBUFFER,
-WGL_ACCESS_READ_WRITE_NV);
-if (!m_shared.render_buf) {
-  fprintf(stderr, "Error registering shared object using 
wglDXRegisterObjectNV()\n");
-  return;
-}
-  }
-
-  GHOST_TSuccess initialize()
-  {
-m_wgl_ctx->activateDrawingContext();
-
-m_shared.device = wglDXOpenDeviceNV(m_d3d_device);
-if (m_shared.device == NULL) {
-  fprintf(stderr, "Error opening shared device using 
wglDXOpenDeviceNV()\n");
-  return GHOST_kFailure;
-}
-
-/* Build the renderbuffer. */
-glGenRenderbuffers(1, _gl_render_buf);
-glBindRenderbuffer(GL_RENDERBUFFER, m_gl_render_buf);
-
-reregisterSharedObject();
-
-/* Build the framebuffer */
-glGenFramebuffers(1, _shared.fbo);
-glBindFramebuffer(GL_FRAMEBUFFER, m_shared.fbo);
-glFramebufferRenderbuffer(
-GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 
m_gl_render_buf);
-
-return GHOST_kSuccess;
-  }
-  void update(int width, int height)
-  {
-m_wgl_ctx->setDefaultFramebufferSize(width, height);
-m_wgl_ctx->activateDrawingContext();
-/* TODO avoid re-registering if resource to share has not changed. */
-reregisterSharedObject();
-  }
-
-  void beginGLOnly()
-  {
-wglDXLockObjectsNV(m_shared.device, 1, _shared.render_buf);
-  }
-  void endGLOnly()
-  {
-wglDXUnlockObjectsNV(m_shared.device, 1, _shared.render_buf);
-  }
-};
-
 GHOST_ContextD3D::GHOST_ContextD3D(bool stereoVisual, HWND hWnd)
 : 

[Bf-blender-cvs] [6785da095d6] master: Cleanup: remove old Windows scons installer, this is handled by CMake now

2019-08-21 Thread Brecht Van Lommel
Commit: 6785da095d66c341ca14eeec5c02ab6e4ad2454f
Author: Brecht Van Lommel
Date:   Wed Aug 21 17:08:12 2019 +0200
Branches: master
https://developer.blender.org/rB6785da095d66c341ca14eeec5c02ab6e4ad2454f

Cleanup: remove old Windows scons installer, this is handled by CMake now

===

D   release/windows/installer/00.checked.bmp
D   release/windows/installer/00.header.bmp
D   release/windows/installer/00.installer.ico
D   release/windows/installer/00.sconsblender.nsi
D   release/windows/installer/01.installer.bmp

===

diff --git a/release/windows/installer/00.checked.bmp 
b/release/windows/installer/00.checked.bmp
deleted file mode 100644
index 6c2e98d361c..000
Binary files a/release/windows/installer/00.checked.bmp and /dev/null differ
diff --git a/release/windows/installer/00.header.bmp 
b/release/windows/installer/00.header.bmp
deleted file mode 100644
index b631ba73933..000
Binary files a/release/windows/installer/00.header.bmp and /dev/null differ
diff --git a/release/windows/installer/00.installer.ico 
b/release/windows/installer/00.installer.ico
deleted file mode 100644
index 922c9d472d9..000
Binary files a/release/windows/installer/00.installer.ico and /dev/null differ
diff --git a/release/windows/installer/00.sconsblender.nsi 
b/release/windows/installer/00.sconsblender.nsi
deleted file mode 100644
index 2d91b9da7f1..000
--- a/release/windows/installer/00.sconsblender.nsi
+++ /dev/null
@@ -1,240 +0,0 @@
-;
-;
-; Blender Self-Installer for Windows (NSIS - http://nsis.sourceforge.net)
-;
-
-SetCompressor /SOLID lzma
-
-Name "Blender [VERSION]" 
-
-RequestExecutionLevel admin
-
-!include "MUI.nsh"
-!include "WinVer.nsh"
-!include "FileFunc.nsh"
-!include "WordFunc.nsh"
-!include "nsDialogs.nsh"
-!include "x64.nsh"
-
-!define MUI_ABORTWARNING
-
-!define MUI_WELCOMEPAGE_TEXT  "This wizard will guide you through the 
installation of Blender. It is recommended that you close all other 
applications before starting Setup."
-!define MUI_WELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
-!define MUI_HEADERIMAGE
-!define MUI_HEADERIMAGE_BITMAP  "[RELDIR]\00.header.bmp"
-!define MUI_COMPONENTSPAGE_SMALLDESC
-!define MUI_FINISHPAGE_RUN "$INSTDIR\blender.exe"
-!define MUI_CHECKBITMAP "[RELDIR]\00.checked.bmp"
-!define MUI_UNWELCOMEFINISHPAGE_BITMAP "[RELDIR]\01.installer.bmp"
-
-!insertmacro MUI_PAGE_WELCOME
-!insertmacro MUI_PAGE_LICENSE "[DISTDIR]\Copyright.txt"
-!insertmacro MUI_PAGE_COMPONENTS
-
-!insertmacro MUI_PAGE_DIRECTORY
-!insertmacro MUI_PAGE_INSTFILES
-!insertmacro MUI_PAGE_FINISH
-  
-!insertmacro MUI_UNPAGE_WELCOME
-UninstPage custom un.OptionalRemoveConfig un.OptionalRemoveConfigOnLeave
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-!insertmacro MUI_UNPAGE_FINISH
-
-!insertmacro Locate
-!insertmacro VersionCompare
-
-
-Icon "[RELDIR]\00.installer.ico"
-UninstallIcon "[RELDIR]\00.installer.ico"
-
-;
-;Languages
- 
-  !insertmacro MUI_LANGUAGE "English"
-
-;
-;Language Strings
-
-  ;Description
-  LangString DESC_InstallFiles ${LANG_ENGLISH} "Copy all required files to the 
application folder."
-  LangString DESC_StartMenu ${LANG_ENGLISH} "Add shortcut items to the Start 
Menu. (Recommended)"
-  LangString DESC_DesktopShortcut ${LANG_ENGLISH} "Add a shortcut to Blender 
on your desktop."
-  LangString DESC_BlendRegister ${LANG_ENGLISH} "Blender can register itself 
with .blend files to allow double-clicking from Windows Explorer, etc."
-;
-;Data
-
-Caption "Blender [VERSION] Installer"
-OutFile "[DISTDIR]\..\blender-[VERSION]-windows[BITNESS].exe"
-InstallDir $INSTDIR ; $INSTDIR is set inside .onInit
-BrandingText "Blender Foundation | http://www.blender.org;
-ComponentText "This will install Blender [VERSION] on your computer."
-
-VIAddVersionKey "ProductName" "Blender"
-VIAddVersionKey "CompanyName" "http://www.blender.org;
-VIAddVersionKey "FileDescription" "Free open source 3D content creation suite."
-VIAddVersionKey "FileVersion" "[SHORTVERSION].0.0"
-
-VIProductVersion "[SHORTVERSION].0.0"
-
-DirText "Use the field below to specify the folder where you want Blender to 
be copied to. To specify a different folder, type a new name or use the Browse 
button to select an existing folder."
-
-SilentUnInstall normal
-
-Var SHORTVERSION ; This is blender_version_decimal() from path_util.c
-Var BLENDERCONFIG
-Var REMOVECONFIG
-
-; Custom controls
-Var HWND
-
-Var HWND_KEEPCONFIG
-Var HWND_REMOVECONFIG
-
-Function .onInit
-  ClearErrors
-  StrCpy $SHORTVERSION "[SHORTVERSION]"
-
-  ${If} ${RunningX64}
-${If} "[BITNESS]" == "32"
-  StrCpy $INSTDIR "$PROGRAMFILES32\Blender Foundation\Blender" ; Can't use 
InstallDir inside Section
-${ElseIf} "[BITNESS]" == "64"
-  StrCpy $INSTDIR 

[Bf-blender-cvs] [6086a6d9399] master: Cleanup: Fix build error with MSVC

2019-08-21 Thread Lazydodo
Commit: 6086a6d9399e42c3e88b39e5658af9a2ed06cac5
Author: Lazydodo
Date:   Wed Aug 21 10:38:33 2019 -0600
Branches: master
https://developer.blender.org/rB6086a6d9399e42c3e88b39e5658af9a2ed06cac5

Cleanup: Fix build error with MSVC

Previously eigens internal include order somehow implicitly provided
M_PI and friends. The recent eigen version bump broke this implicit
behaviour, better to be explicit that we need the math defines for MSVC.

===

M   intern/iksolver/CMakeLists.txt
M   intern/libmv/CMakeLists.txt
M   intern/libmv/libmv/tracking/track_region.cc
M   intern/libmv/libmv/tracking/track_region.h

===

diff --git a/intern/iksolver/CMakeLists.txt b/intern/iksolver/CMakeLists.txt
index 5e12cdbcc2f..a7a346ccddd 100644
--- a/intern/iksolver/CMakeLists.txt
+++ b/intern/iksolver/CMakeLists.txt
@@ -27,6 +27,10 @@ set(INC_SYS
   ${EIGEN3_INCLUDE_DIRS}
 )
 
+if(WIN32)
+  add_definitions(-D_USE_MATH_DEFINES)
+endif()
+
 set(SRC
   intern/IK_QJacobian.cpp
   intern/IK_QJacobianSolver.cpp
diff --git a/intern/libmv/CMakeLists.txt b/intern/libmv/CMakeLists.txt
index 019364d84df..e16e27368d0 100644
--- a/intern/libmv/CMakeLists.txt
+++ b/intern/libmv/CMakeLists.txt
@@ -38,6 +38,9 @@ set(LIB
 )
 
 if(WITH_LIBMV)
+  if(WIN32)
+add_definitions(-D_USE_MATH_DEFINES)
+  endif()
   add_definitions(${GFLAGS_DEFINES})
   add_definitions(${GLOG_DEFINES})
   add_definitions(${CERES_DEFINES})
diff --git a/intern/libmv/libmv/tracking/track_region.cc 
b/intern/libmv/libmv/tracking/track_region.cc
index ef6dac65236..895c9a1e23d 100644
--- a/intern/libmv/libmv/tracking/track_region.cc
+++ b/intern/libmv/libmv/tracking/track_region.cc
@@ -25,9 +25,6 @@
 // smart coder went through the TODO's and made the suggested performance
 // enhancements.
 
-// Necessary for M_E when building with MSVC.
-#define _USE_MATH_DEFINES
-
 #include "libmv/tracking/track_region.h"
 
 #include 
diff --git a/intern/libmv/libmv/tracking/track_region.h 
b/intern/libmv/libmv/tracking/track_region.h
index be1d8ef3e03..61dce22bcb8 100644
--- a/intern/libmv/libmv/tracking/track_region.h
+++ b/intern/libmv/libmv/tracking/track_region.h
@@ -20,9 +20,6 @@
 
 #ifndef LIBMV_TRACKING_TRACK_REGION_H_
 
-// Necessary for M_E when building with MSVC.
-#define _USE_MATH_DEFINES
-
 #include "libmv/image/image.h"
 #include "libmv/image/sample.h"
 #include "libmv/numeric/numeric.h"

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


[Bf-blender-cvs] [33949188a77] functions: add some comments

2019-08-21 Thread Jacques Lucke
Commit: 33949188a778c4f20aadaf94627d662e62554aae
Author: Jacques Lucke
Date:   Wed Aug 21 17:57:42 2019 +0200
Branches: functions
https://developer.blender.org/rB33949188a778c4f20aadaf94627d662e62554aae

add some comments

===

M   source/blender/blenlib/BLI_allocator.hpp
M   source/blender/blenlib/BLI_array.hpp
M   source/blender/blenlib/BLI_array_ref.hpp

===

diff --git a/source/blender/blenlib/BLI_allocator.hpp 
b/source/blender/blenlib/BLI_allocator.hpp
index 4da905e9e63..24b9c779942 100644
--- a/source/blender/blenlib/BLI_allocator.hpp
+++ b/source/blender/blenlib/BLI_allocator.hpp
@@ -1,3 +1,32 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup bli
+ *
+ * This file offers a couple of memory allocators that can be used with 
containers such as Vector
+ * and Map. Note that these allocators are not designed to work with standard 
containers like
+ * std::vector.
+ *
+ * Also see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html 
for why the standard
+ * allocators are not a good fit applications like Blender. The current 
implementations in this
+ * file are fairly simple still, more complexity can be added when necessary. 
For now they do their
+ * job good enough.
+ */
+
 #pragma once
 
 #include 
diff --git a/source/blender/blenlib/BLI_array.hpp 
b/source/blender/blenlib/BLI_array.hpp
index 4bd9b0e900f..99fcc9a961e 100644
--- a/source/blender/blenlib/BLI_array.hpp
+++ b/source/blender/blenlib/BLI_array.hpp
@@ -1,3 +1,26 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup bli
+ *
+ * This is a container that contains a fixed size array. Note however, the 
size of the array is not
+ * a template argument. Instead it can be specified at the construction time.
+ */
+
 #pragma once
 
 #include "BLI_utildefines.h"
diff --git a/source/blender/blenlib/BLI_array_ref.hpp 
b/source/blender/blenlib/BLI_array_ref.hpp
index fd8f6468f7b..e3d5a3a89ae 100644
--- a/source/blender/blenlib/BLI_array_ref.hpp
+++ b/source/blender/blenlib/BLI_array_ref.hpp
@@ -17,12 +17,19 @@
 /** \file
  * \ingroup bli
  *
- * An ArrayRef references some memory buffer owned
- * by someone else. If possible, functions should take
- * an ArrayRef as input. This allows passing on different
- * kinds of class types without doing unnecessary conversions.
+ * This classes offer a convenient way to work with continuous chunks of 
memory of a certain type.
+ * We differentiate ArrayRef and MutableArrayRef. The elements in the former 
are const while the
+ * elements in the other are not.
  *
- * ArrayRef instances should be passed by value.
+ * Passing array references as parameters has multiple benefits:
+ *   - Less templates are used since the function does not have to work with 
different
+ * container types.
+ *   - It encourages an Struct-of-Arrays data layout which is often benefitial 
when
+ * writing high performance code. Also it makes it easier to reuse code.
+ *   - Array references offer convenient ways of slicing and other operations.
+ *
+ * The instrances of ArrayRef and MutableArrayRef are very small and should be 
passed by value.
+ * Since array references do not own any memory, it is generally not save to 
store them.
  */
 
 #pragma once
@@ -38,6 +45,9 @@
 
 namespace BLI {
 
+/**
+ * References an array of data. The elements in the array should not be 
changed.
+ */
 template class ArrayRef {
  private:
   const T *m_start = nullptr;
@@ -136,11 +146,6 

[Bf-blender-cvs] [b0034fd7a27] functions: more comments

2019-08-21 Thread Jacques Lucke
Commit: b0034fd7a279716aa30b7606c53615c60ae8db5a
Author: Jacques Lucke
Date:   Wed Aug 21 18:24:05 2019 +0200
Branches: functions
https://developer.blender.org/rBb0034fd7a279716aa30b7606c53615c60ae8db5a

more comments

===

M   source/blender/blenlib/BLI_listbase_wrapper.hpp
M   source/blender/blenlib/BLI_map.hpp
M   source/blender/blenlib/BLI_open_addressing.hpp

===

diff --git a/source/blender/blenlib/BLI_listbase_wrapper.hpp 
b/source/blender/blenlib/BLI_listbase_wrapper.hpp
index fdf58d2bbf1..90755d551b1 100644
--- a/source/blender/blenlib/BLI_listbase_wrapper.hpp
+++ b/source/blender/blenlib/BLI_listbase_wrapper.hpp
@@ -17,9 +17,8 @@
 /** \file
  * \ingroup bli
  *
- * The purpose of this wrapper is just to make it more
- * comfortable to iterate of ListBase instances, that
- * are used in many places in Blender.
+ * The purpose of this wrapper is just to make it more comfortable to iterate 
of ListBase
+ * instances, that are used in many places in Blender.
  */
 
 #pragma once
diff --git a/source/blender/blenlib/BLI_map.hpp 
b/source/blender/blenlib/BLI_map.hpp
index 6d30a87f6f0..c7d2a0ef581 100644
--- a/source/blender/blenlib/BLI_map.hpp
+++ b/source/blender/blenlib/BLI_map.hpp
@@ -17,9 +17,10 @@
 /** \file
  * \ingroup bli
  *
- * An unordered map implementation with small object optimization.
- * Similar to Set, this builds on top of Vector
- * and ArrayLookup to reduce what this code has to deal with.
+ * This file provides a map implementation that uses open addressing with 
probing.
+ *
+ * The key and value objects are stored directly in the hash table to avoid 
indirect memory
+ * lookups. Keys and values are stored in groups of four to avoid wasting 
memory due to padding.
  */
 
 #pragma once
@@ -166,6 +167,10 @@ template
  public:
   Map() = default;
 
+  /**
+   * Insert a new key-value-pair in the map.
+   * Asserts when the key existed before.
+   */
   void add_new(const KeyT , const ValueT )
   {
 BLI_assert(!this->contains(key));
@@ -181,6 +186,10 @@ template
 ITER_SLOTS_END(offset);
   }
 
+  /**
+   * Insert a new key-value-pair in the map if the key does not exist yet.
+   * Returns true when the pair was newly inserted, otherwise false.
+   */
   bool add(const KeyT , const ValueT )
   {
 this->ensure_can_add();
@@ -198,6 +207,10 @@ template
 ITER_SLOTS_END(offset);
   }
 
+  /**
+   * Remove the key from the map.
+   * Asserts when the key does not exist in the map.
+   */
   void remove(const KeyT )
   {
 BLI_assert(this->contains(key));
@@ -211,6 +224,10 @@ template
 ITER_SLOTS_END(offset);
   }
 
+  /**
+   * Get the value for the given key and remove it from the map.
+   * Asserts when the key does not exist in the map.
+   */
   ValueT pop(const KeyT )
   {
 BLI_assert(this->contains(key));
@@ -225,6 +242,9 @@ template
 ITER_SLOTS_END(offset);
   }
 
+  /**
+   * Returns true when the key exists in the map, otherwise false.
+   */
   bool contains(const KeyT ) const
   {
 ITER_SLOTS_BEGIN (key, m_array, const, item, offset) {
@@ -238,6 +258,12 @@ template
 ITER_SLOTS_END(offset);
   }
 
+  /**
+   * Check if the key exists in the map.
+   * If it does exist, call the modify function with a reference to the 
corresponding value.
+   * If it does not exist, call the create function and insert a new 
key-value-pair.
+   * Returns true when a new pair was inserted, otherwise false.
+   */
   template
   bool add_or_modify(const KeyT ,
  const CreateValueF _value,
@@ -259,12 +285,20 @@ template
 ITER_SLOTS_END(offset);
   }
 
+  /**
+   * Similar to add, but overrides the value for the key when it exists 
already.
+   */
   bool add_override(const KeyT , const ValueT )
   {
 return this->add_or_modify(
 key, []() { return value; }, [](ValueT _value) { 
old_value = value; });
   }
 
+  /**
+   * Check if the key exists in the map.
+   * Return a pointer to the value, when it exists.
+   * Otherwise return nullptr.
+   */
   const ValueT *lookup_ptr(const KeyT ) const
   {
 ITER_SLOTS_BEGIN (key, m_array, const, item, offset) {
@@ -278,9 +312,15 @@ template
 ITER_SLOTS_END(offset);
   }
 
+  /**
+   * Lookup the value that corresponds to the key.
+   * Asserts when the key does not exist.
+   */
   const ValueT (const KeyT ) const
   {
-return *this->lookup_ptr(key);
+const ValueT *ptr = this->lookup_ptr(key);
+BLI_assert(ptr != nullptr);
+return *ptr;
   }
 
   ValueT *lookup_ptr(const KeyT )
@@ -295,6 +335,11 @@ template
 return const_cast(const_this->lookup(key));
   }
 
+  /**
+   * Check if the key exists in the map.
+   * If it does, return a copy of the value.
+   * Otherwise, return the default value.
+   */
   ValueT lookup_default(const KeyT , ValueT default_value) const
   {
 ValueT *ptr = this->lookup_ptr(key);
@@ -306,6 

[Bf-blender-cvs] [fda6430d6af] functions: improve const correctness in many places

2019-08-21 Thread Jacques Lucke
Commit: fda6430d6af754ebbea7a07424642d5c70f57b5b
Author: Jacques Lucke
Date:   Wed Aug 21 17:38:54 2019 +0200
Branches: functions
https://developer.blender.org/rBfda6430d6af754ebbea7a07424642d5c70f57b5b

improve const correctness in many places

===

M   source/blender/blenkernel/BKE_node_tree.hpp
M   source/blender/blenlib/BLI_array.hpp
M   source/blender/blenlib/BLI_array_ref.hpp
M   source/blender/blenlib/BLI_map.hpp
M   source/blender/blenlib/BLI_monotonic_allocator.hpp
M   source/blender/blenlib/BLI_multi_map.hpp
M   source/blender/blenlib/BLI_refcount.hpp
M   source/blender/blenlib/BLI_set_vector.hpp
M   source/blender/blenlib/BLI_stack.hpp
M   source/blender/blenlib/BLI_task.hpp
M   source/blender/blenlib/BLI_vector.hpp
M   source/blender/functions/backends/cpp/list.hpp
M   source/blender/functions/backends/llvm/build_ir_body.hpp
M   source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp
M   source/blender/functions/core/data_graph.hpp
M   source/blender/functions/core/data_graph_builder.cpp
M   source/blender/functions/core/function.hpp
M   source/blender/functions/frontends/data_flow_nodes/graph_generation.hpp
M   
source/blender/functions/frontends/data_flow_nodes/unlinked_input_groupers.cpp
M   
source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.cpp
M   
source/blender/functions/frontends/data_flow_nodes/unlinked_input_inserters.hpp
M   source/blender/functions/functions/array_execution.cpp
M   source/blender/functions/functions/array_execution.hpp
M   source/blender/functions/functions/auto_vectorization.cpp
M   source/blender/functions/functions/object_input.cpp
M   source/blender/simulations/bparticles/attributes.hpp
M   source/blender/simulations/bparticles/c_wrapper.cpp
M   source/blender/simulations/bparticles/force_interface.hpp
M   source/blender/simulations/bparticles/forces.cpp
M   source/blender/simulations/bparticles/integrator.cpp
M   source/blender/simulations/bparticles/integrator.hpp
M   source/blender/simulations/bparticles/particle_allocator.cpp
M   source/blender/simulations/bparticles/particle_function_builder.cpp
M   source/blender/simulations/bparticles/particle_set.hpp
M   source/blender/simulations/bparticles/particles_container.cpp
M   source/blender/simulations/bparticles/particles_container.hpp
M   source/blender/simulations/bparticles/simulate.cpp
M   source/blender/simulations/bparticles/step_description_interfaces.hpp
M   tests/gtests/blenlib/BLI_array_ref_test.cc

===

diff --git a/source/blender/blenkernel/BKE_node_tree.hpp 
b/source/blender/blenkernel/BKE_node_tree.hpp
index 3892d31e480..e13da37887b 100644
--- a/source/blender/blenkernel/BKE_node_tree.hpp
+++ b/source/blender/blenkernel/BKE_node_tree.hpp
@@ -19,6 +19,7 @@ using BLI::IntrusiveListBaseWrapper;
 using BLI::Map;
 using BLI::MonotonicAllocator;
 using BLI::MultiMap;
+using BLI::MutableArrayRef;
 using BLI::StringRef;
 using BLI::StringRefNull;
 using BLI::Vector;
@@ -94,8 +95,8 @@ class VirtualNode {
   VirtualNodeTree *m_backlink;
   bNodeTree *m_btree;
   bNode *m_bnode;
-  ArrayRef m_inputs;
-  ArrayRef m_outputs;
+  MutableArrayRef m_inputs;
+  MutableArrayRef m_outputs;
 
  public:
   ArrayRef inputs()
@@ -160,8 +161,8 @@ class VirtualSocket {
   bNodeSocket *m_bsocket;
   uint m_id;
 
-  ArrayRef m_direct_links;
-  ArrayRef m_links;
+  MutableArrayRef m_direct_links;
+  MutableArrayRef m_links;
 
  public:
   bool is_input() const
diff --git a/source/blender/blenlib/BLI_array.hpp 
b/source/blender/blenlib/BLI_array.hpp
index 2e299de76dd..4bd9b0e900f 100644
--- a/source/blender/blenlib/BLI_array.hpp
+++ b/source/blender/blenlib/BLI_array.hpp
@@ -90,6 +90,11 @@ template 
class Array {
 return ArrayRef(m_data, m_size);
   }
 
+  operator MutableArrayRef()
+  {
+return MutableArrayRef(m_data, m_size);
+  }
+
   T [](uint index)
   {
 BLI_assert(index < m_size);
@@ -103,12 +108,12 @@ template class Array {
 
   void fill(const T )
   {
-ArrayRef(*this).fill(value);
+MutableArrayRef(*this).fill(value);
   }
 
   void fill_indices(ArrayRef indices, const T )
   {
-ArrayRef(*this).fill_indices(indices, value);
+MutableArrayRef(*this).fill_indices(indices, value);
   }
 
   T *begin()
diff --git a/source/blender/blenlib/BLI_array_ref.hpp 
b/source/blender/blenlib/BLI_array_ref.hpp
index 5ac73ca124b..fd8f6468f7b 100644
--- a/source/blender/blenlib/BLI_array_ref.hpp
+++ b/source/blender/blenlib/BLI_array_ref.hpp
@@ -40,7 +40,7 @@ namespace BLI {
 
 template class ArrayRef {
  private:
-  T *m_start = nullptr;
+  const T *m_start = nullptr;
   uint m_size = 0;
 
  public:
@@ -50,15 +50,11 @@ template class ArrayRef {
*/
   ArrayRef() = default;
 
-  ArrayRef(T 

[Bf-blender-cvs] [700ff7b0731] functions: Merge branch 'master' into functions

2019-08-21 Thread Jacques Lucke
Commit: 700ff7b0731bdeaf0710b40deb7aeefe1770411d
Author: Jacques Lucke
Date:   Wed Aug 21 17:29:22 2019 +0200
Branches: functions
https://developer.blender.org/rB700ff7b0731bdeaf0710b40deb7aeefe1770411d

Merge branch 'master' into functions

===



===



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


[Bf-blender-cvs] [34921e9e567] master: Timeline: refactor cache drawing

2019-08-21 Thread Jacques Lucke
Commit: 34921e9e5671df4f8932ba671ee5703ca4739ecb
Author: Jacques Lucke
Date:   Wed Aug 21 17:21:06 2019 +0200
Branches: master
https://developer.blender.org/rB34921e9e5671df4f8932ba671ee5703ca4739ecb

Timeline: refactor cache drawing

I did this mostly to get to know the point cache from this direction.
This should not change anything from the user perspective.

===

M   source/blender/editors/space_action/action_draw.c

===

diff --git a/source/blender/editors/space_action/action_draw.c 
b/source/blender/editors/space_action/action_draw.c
index a7b6f399187..0c57113956d 100644
--- a/source/blender/editors/space_action/action_draw.c
+++ b/source/blender/editors/space_action/action_draw.c
@@ -352,179 +352,231 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction 
*saction, ARegion *ar)
 /* * */
 /* Timeline - Caches */
 
-void timeline_draw_cache(SpaceAction *saction, Object *ob, Scene *scene)
+static bool timeline_cache_is_hidden_by_setting(SpaceAction *saction, 
PTCacheID *pid)
 {
-  PTCacheID *pid;
-  ListBase pidlist;
-  const float cache_draw_height = (4.0f * UI_DPI_FAC * U.pixelsize);
-  float yoffs = 0.f;
-
-  if (!(saction->cache_display & TIME_CACHE_DISPLAY) || (!ob)) {
-return;
+  switch (pid->type) {
+case PTCACHE_TYPE_SOFTBODY:
+  if ((saction->cache_display & TIME_CACHE_SOFTBODY) == 0) {
+return true;
+  }
+  break;
+case PTCACHE_TYPE_PARTICLES:
+  if ((saction->cache_display & TIME_CACHE_PARTICLES) == 0) {
+return true;
+  }
+  break;
+case PTCACHE_TYPE_CLOTH:
+  if ((saction->cache_display & TIME_CACHE_CLOTH) == 0) {
+return true;
+  }
+  break;
+case PTCACHE_TYPE_SMOKE_DOMAIN:
+case PTCACHE_TYPE_SMOKE_HIGHRES:
+  if ((saction->cache_display & TIME_CACHE_SMOKE) == 0) {
+return true;
+  }
+  break;
+case PTCACHE_TYPE_DYNAMICPAINT:
+  if ((saction->cache_display & TIME_CACHE_DYNAMICPAINT) == 0) {
+return true;
+  }
+  break;
+case PTCACHE_TYPE_RIGIDBODY:
+  if ((saction->cache_display & TIME_CACHE_RIGIDBODY) == 0) {
+return true;
+  }
+  break;
   }
+  return false;
+}
 
-  BKE_ptcache_ids_from_object(, ob, scene, 0);
+static void timeline_cache_color_get(PTCacheID *pid, float color[4])
+{
+  switch (pid->type) {
+case PTCACHE_TYPE_SOFTBODY:
+  color[0] = 1.0;
+  color[1] = 0.4;
+  color[2] = 0.02;
+  color[3] = 0.1;
+  break;
+case PTCACHE_TYPE_PARTICLES:
+  color[0] = 1.0;
+  color[1] = 0.1;
+  color[2] = 0.02;
+  color[3] = 0.1;
+  break;
+case PTCACHE_TYPE_CLOTH:
+  color[0] = 0.1;
+  color[1] = 0.1;
+  color[2] = 0.75;
+  color[3] = 0.1;
+  break;
+case PTCACHE_TYPE_SMOKE_DOMAIN:
+case PTCACHE_TYPE_SMOKE_HIGHRES:
+  color[0] = 0.2;
+  color[1] = 0.2;
+  color[2] = 0.2;
+  color[3] = 0.1;
+  break;
+case PTCACHE_TYPE_DYNAMICPAINT:
+  color[0] = 1.0;
+  color[1] = 0.1;
+  color[2] = 0.75;
+  color[3] = 0.1;
+  break;
+case PTCACHE_TYPE_RIGIDBODY:
+  color[0] = 1.0;
+  color[1] = 0.6;
+  color[2] = 0.0;
+  color[3] = 0.1;
+  break;
+default:
+  color[0] = 1.0;
+  color[1] = 0.0;
+  color[2] = 1.0;
+  color[3] = 0.1;
+  BLI_assert(0);
+  break;
+  }
+}
 
-  uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 
2, GPU_FETCH_FLOAT);
-  immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
+static void timeline_cache_modify_color_based_on_state(PointCache *cache, 
float color[4])
+{
+  if (cache->flag & PTCACHE_BAKED) {
+color[0] -= 0.4f;
+color[1] -= 0.4f;
+color[2] -= 0.4f;
+  }
+  else if (cache->flag & PTCACHE_OUTDATED) {
+color[0] += 0.4f;
+color[1] += 0.4f;
+color[2] += 0.4f;
+  }
+}
 
-  /* iterate over pointcaches on the active object, and draw each one's range 
*/
-  for (pid = pidlist.first; pid; pid = pid->next) {
-float col[4];
+static bool timeline_cache_find_next_cached_segment(PointCache *cache,
+int search_start_frame,
+int *r_segment_start,
+int *r_segment_end)
+{
+  int offset = cache->startframe;
+  int current = search_start_frame;
 
-switch (pid->type) {
-  case PTCACHE_TYPE_SOFTBODY:
-if (!(saction->cache_display & TIME_CACHE_SOFTBODY)) {
-  continue;
-}
-break;
-  case PTCACHE_TYPE_PARTICLES:
-if (!(saction->cache_display & TIME_CACHE_PARTICLES)) {
-  continue;
-}
-break;
-  case PTCACHE_TYPE_CLOTH:
-if (!(saction->cache_display & TIME_CACHE_CLOTH)) {
-  

[Bf-blender-cvs] [654fd58270a] master: Cleanup: minor error in assert message in libOverride collection code.

2019-08-21 Thread Bastien Montagne
Commit: 654fd58270ac9cfb0b0ac5f2d6605355bf76b6be
Author: Bastien Montagne
Date:   Wed Aug 21 17:10:10 2019 +0200
Branches: master
https://developer.blender.org/rB654fd58270ac9cfb0b0ac5f2d6605355bf76b6be

Cleanup: minor error in assert message in libOverride collection code.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_collection.c 
b/source/blender/makesrna/intern/rna_collection.c
index 4700df5352f..15d73aae0ae 100644
--- a/source/blender/makesrna/intern/rna_collection.c
+++ b/source/blender/makesrna/intern/rna_collection.c
@@ -234,7 +234,7 @@ static bool rna_Collection_children_override_apply(Main 
*bmain,

IDOverrideLibraryPropertyOperation *opop)
 {
   BLI_assert(opop->operation == IDOVERRIDE_LIBRARY_OP_REPLACE &&
- "Unsupported RNA override operation on collections' objects");
+ "Unsupported RNA override operation on collections' children");
   UNUSED_VARS_NDEBUG(opop);
 
   Collection *coll_dst = ptr_dst->id.data;

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


[Bf-blender-cvs] [922da6dfb40] master: LibOverride: Fix inverted logic in RNA collection operation application.

2019-08-21 Thread Bastien Montagne
Commit: 922da6dfb400514f03145b7a96c15d978fb7141c
Author: Bastien Montagne
Date:   Wed Aug 21 17:10:40 2019 +0200
Branches: master
https://developer.blender.org/rB922da6dfb400514f03145b7a96c15d978fb7141c

LibOverride: Fix inverted logic in RNA collection operation application.

Note to self: need to recheck the namings of whole override code,
currently this is way to confusing and inconsistent.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_access.c 
b/source/blender/makesrna/intern/rna_access.c
index b78a3304cc7..fb3aad8ddba 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -8871,45 +8871,41 @@ static void rna_property_override_apply_ex(Main *bmain,
   RNA_POINTER_INVALIDATE(_ptr_item_storage);
   if (opop->subitem_local_name != NULL) {
 RNA_property_collection_lookup_string(
-ptr_local, prop_local, opop->subitem_local_name, 
_ptr_item_local);
+ptr_override, prop_override, opop->subitem_local_name, 
_ptr_item_override);
 if (opop->subitem_reference_name != NULL) {
-  RNA_property_collection_lookup_string(ptr_override,
-prop_override,
-opop->subitem_reference_name,
-_ptr_item_override);
+  RNA_property_collection_lookup_string(
+  ptr_local, prop_local, opop->subitem_reference_name, 
_ptr_item_local);
 }
 else {
   RNA_property_collection_lookup_string(
-  ptr_override, prop_override, opop->subitem_local_name, 
_ptr_item_override);
+  ptr_local, prop_local, opop->subitem_local_name, 
_ptr_item_local);
 }
   }
   else if (opop->subitem_reference_name != NULL) {
-RNA_property_collection_lookup_string(
-ptr_local, prop_local, opop->subitem_reference_name, 
_ptr_item_local);
 RNA_property_collection_lookup_string(
 ptr_override, prop_override, opop->subitem_reference_name, 
_ptr_item_override);
+RNA_property_collection_lookup_string(
+ptr_local, prop_local, opop->subitem_reference_name, 
_ptr_item_local);
   }
   else if (opop->subitem_local_index != -1) {
 RNA_property_collection_lookup_int(
-ptr_local, prop_local, opop->subitem_local_index, 
_ptr_item_local);
+ptr_override, prop_override, opop->subitem_local_index, 
_ptr_item_override);
 if (opop->subitem_reference_index != -1) {
-  RNA_property_collection_lookup_int(ptr_override,
- prop_override,
- opop->subitem_reference_index,
- _ptr_item_override);
+  RNA_property_collection_lookup_int(
+  ptr_local, prop_local, opop->subitem_reference_index, 
_ptr_item_local);
 }
 else {
   RNA_property_collection_lookup_int(
-  ptr_override, prop_override, opop->subitem_local_index, 
_ptr_item_override);
+  ptr_local, prop_local, opop->subitem_local_index, 
_ptr_item_local);
 }
   }
   else if (opop->subitem_reference_index != -1) {
-RNA_property_collection_lookup_int(
-ptr_local, prop_local, opop->subitem_reference_index, 
_ptr_item_local);
 RNA_property_collection_lookup_int(ptr_override,
prop_override,
opop->subitem_reference_index,
_ptr_item_override);
+RNA_property_collection_lookup_int(
+ptr_local, prop_local, opop->subitem_reference_index, 
_ptr_item_local);
   }
   if (prop_storage != NULL) {
 if (opop->subitem_local_name != NULL) {

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


[Bf-blender-cvs] [b7f8e646c4e] newboolean: Merge from master.

2019-08-21 Thread Howard Trickey
Commit: b7f8e646c4e99cd0a81ddafc694d89d5dcd6758f
Author: Howard Trickey
Date:   Wed Aug 21 10:21:39 2019 -0400
Branches: newboolean
https://developer.blender.org/rBb7f8e646c4e99cd0a81ddafc694d89d5dcd6758f

Merge from master.

===

M   CMakeLists.txt
M   build_files/build_environment/cmake/osl.cmake
M   build_files/build_environment/install_deps.sh
M   build_files/cmake/Modules/FindOpenImageDenoise.cmake
M   build_files/cmake/config/blender_full.cmake
M   build_files/cmake/config/blender_release.cmake
M   build_files/cmake/packaging.cmake
M   build_files/cmake/platform/platform_win32.cmake
M   extern/Eigen3/Eigen/Cholesky
M   extern/Eigen3/Eigen/CholmodSupport
M   extern/Eigen3/Eigen/Core
M   extern/Eigen3/Eigen/Eigen
M   extern/Eigen3/Eigen/Eigenvalues
M   extern/Eigen3/Eigen/Geometry
M   extern/Eigen3/Eigen/Householder
M   extern/Eigen3/Eigen/IterativeLinearSolvers
M   extern/Eigen3/Eigen/Jacobi
M   extern/Eigen3/Eigen/LU
M   extern/Eigen3/Eigen/MetisSupport
M   extern/Eigen3/Eigen/OrderingMethods
M   extern/Eigen3/Eigen/PaStiXSupport
M   extern/Eigen3/Eigen/PardisoSupport
M   extern/Eigen3/Eigen/QR
M   extern/Eigen3/Eigen/QtAlignedMalloc
M   extern/Eigen3/Eigen/SPQRSupport
M   extern/Eigen3/Eigen/SVD
M   extern/Eigen3/Eigen/Sparse
M   extern/Eigen3/Eigen/SparseCholesky
M   extern/Eigen3/Eigen/SparseCore
M   extern/Eigen3/Eigen/SparseLU
M   extern/Eigen3/Eigen/SparseQR
M   extern/Eigen3/Eigen/StdDeque
M   extern/Eigen3/Eigen/StdList
M   extern/Eigen3/Eigen/StdVector
M   extern/Eigen3/Eigen/SuperLUSupport
M   extern/Eigen3/Eigen/UmfPackSupport
M   extern/Eigen3/Eigen/src/Cholesky/LDLT.h
M   extern/Eigen3/Eigen/src/Cholesky/LLT.h
A   extern/Eigen3/Eigen/src/Cholesky/LLT_LAPACKE.h
M   extern/Eigen3/Eigen/src/CholmodSupport/CholmodSupport.h
M   extern/Eigen3/Eigen/src/Core/Array.h
M   extern/Eigen3/Eigen/src/Core/ArrayBase.h
M   extern/Eigen3/Eigen/src/Core/ArrayWrapper.h
M   extern/Eigen3/Eigen/src/Core/Assign.h
A   extern/Eigen3/Eigen/src/Core/AssignEvaluator.h
M   extern/Eigen3/Eigen/src/Core/Assign_MKL.h
M   extern/Eigen3/Eigen/src/Core/BandMatrix.h
M   extern/Eigen3/Eigen/src/Core/Block.h
M   extern/Eigen3/Eigen/src/Core/BooleanRedux.h
M   extern/Eigen3/Eigen/src/Core/CommaInitializer.h
A   extern/Eigen3/Eigen/src/Core/ConditionEstimator.h
A   extern/Eigen3/Eigen/src/Core/CoreEvaluators.h
M   extern/Eigen3/Eigen/src/Core/CoreIterators.h
M   extern/Eigen3/Eigen/src/Core/CwiseBinaryOp.h
M   extern/Eigen3/Eigen/src/Core/CwiseNullaryOp.h
A   extern/Eigen3/Eigen/src/Core/CwiseTernaryOp.h
M   extern/Eigen3/Eigen/src/Core/CwiseUnaryOp.h
M   extern/Eigen3/Eigen/src/Core/CwiseUnaryView.h
M   extern/Eigen3/Eigen/src/Core/DenseBase.h
M   extern/Eigen3/Eigen/src/Core/DenseCoeffsBase.h
M   extern/Eigen3/Eigen/src/Core/DenseStorage.h
M   extern/Eigen3/Eigen/src/Core/Diagonal.h
M   extern/Eigen3/Eigen/src/Core/DiagonalMatrix.h
M   extern/Eigen3/Eigen/src/Core/DiagonalProduct.h
M   extern/Eigen3/Eigen/src/Core/Dot.h
M   extern/Eigen3/Eigen/src/Core/EigenBase.h
M   extern/Eigen3/Eigen/src/Core/ForceAlignedAccess.h
M   extern/Eigen3/Eigen/src/Core/Fuzzy.h
M   extern/Eigen3/Eigen/src/Core/GeneralProduct.h
M   extern/Eigen3/Eigen/src/Core/GenericPacketMath.h
M   extern/Eigen3/Eigen/src/Core/GlobalFunctions.h
M   extern/Eigen3/Eigen/src/Core/IO.h
A   extern/Eigen3/Eigen/src/Core/Inverse.h
M   extern/Eigen3/Eigen/src/Core/Map.h
M   extern/Eigen3/Eigen/src/Core/MapBase.h
M   extern/Eigen3/Eigen/src/Core/MathFunctions.h
A   extern/Eigen3/Eigen/src/Core/MathFunctionsImpl.h
M   extern/Eigen3/Eigen/src/Core/Matrix.h
M   extern/Eigen3/Eigen/src/Core/MatrixBase.h
M   extern/Eigen3/Eigen/src/Core/NestByValue.h
M   extern/Eigen3/Eigen/src/Core/NoAlias.h
M   extern/Eigen3/Eigen/src/Core/NumTraits.h
M   extern/Eigen3/Eigen/src/Core/PermutationMatrix.h
M   extern/Eigen3/Eigen/src/Core/PlainObjectBase.h
M   extern/Eigen3/Eigen/src/Core/Product.h
A   extern/Eigen3/Eigen/src/Core/ProductEvaluators.h
M   extern/Eigen3/Eigen/src/Core/Random.h
M   extern/Eigen3/Eigen/src/Core/Redux.h
M   extern/Eigen3/Eigen/src/Core/Ref.h
M   extern/Eigen3/Eigen/src/Core/Replicate.h
M   extern/Eigen3/Eigen/src/Core/ReturnByValue.h
M   extern/Eigen3/Eigen/src/Core/Reverse.h
M   extern/Eigen3/Eigen/src/Core/Select.h
M   extern/Eigen3/Eigen/src/Core/SelfAdjointView.h
M   extern/Eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h
A   extern/Eigen3/Eigen/src/Core/Solve.h
M   extern/Eigen3/Eigen/src/Core/SolveTriangular.h
A   extern/Eigen3/Eigen/src/Core/SolverBase.h
M   extern/Eigen3/Eigen/src/Core/StableNorm.h
M   

[Bf-blender-cvs] [b386d5594a7] sculpt-mode-features: Mask filter: update only modified nodes

2019-08-21 Thread Pablo Dobarro
Commit: b386d5594a79d4963d17477021d2b2f3a64752cb
Author: Pablo Dobarro
Date:   Wed Aug 21 16:06:26 2019 +0200
Branches: sculpt-mode-features
https://developer.blender.org/rBb386d5594a79d4963d17477021d2b2f3a64752cb

Mask filter: update only modified nodes

===

M   source/blender/editors/sculpt_paint/sculpt.c

===

diff --git a/source/blender/editors/sculpt_paint/sculpt.c 
b/source/blender/editors/sculpt_paint/sculpt.c
index ed09810548d..0284f0f6c9c 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -8945,11 +8945,13 @@ static void mask_filter_task_cb(void *__restrict 
userdata,
   const int mode = data->filter_type;
 
   PBVHVertexIter vd;
+  bool update = false;
 
   BKE_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_UNIQUE)
   {
 float val;
-float contrast, delta, gain, offset, max, min;
+float contrast, delta, gain, offset, max, min, prev_val;
+prev_val = *vd.mask;
 SculptVertexNeighborIter ni;
 switch (mode) {
   case MASK_FILTER_BLUR:
@@ -9021,12 +9023,17 @@ static void mask_filter_task_cb(void *__restrict 
userdata,
 *vd.mask = gain * (*vd.mask) + offset;
 break;
 }
+if (*vd.mask != prev_val) {
+  update = true;
+}
 if (vd.mvert)
   vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
   }
   BKE_pbvh_vertex_iter_end;
 
-  BKE_pbvh_node_mark_redraw(node);
+  if (update) {
+BKE_pbvh_node_mark_redraw(node);
+  }
 }
 
 static int sculpt_mask_filter_invoke(bContext *C, wmOperator *op)

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


[Bf-blender-cvs] [d357e7b0653] master: Fix T68826 Eevee: Multi-Mat not working if switching from Solid shading

2019-08-21 Thread Clément Foucault
Commit: d357e7b0653588d5fb85deec270464778a252406
Author: Clément Foucault
Date:   Wed Aug 21 15:53:57 2019 +0200
Branches: master
https://developer.blender.org/rBd357e7b0653588d5fb85deec270464778a252406

Fix T68826 Eevee: Multi-Mat not working if switching from Solid shading

The correct fix would be to avoid all those hacks but this is needed if
we want to be able to parallelize object vbo extractions.

===

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 884d39343c6..3bf9a03ddeb 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -1088,6 +1088,25 @@ void DRW_mesh_batch_cache_create_requested(
 }
   }
 
+  /* HACK: if MBC_SURF_PER_MAT is requested and ibo.tris is already available, 
it won't have it's
+   * index ranges initialized. So discard ibo.tris in order to recreate it. */
+  if ((batch_requested & MBC_SURF_PER_MAT) != 0 && (cache->batch_ready & 
MBC_SURF_PER_MAT) == 0) {
+FOREACH_MESH_BUFFER_CACHE(cache, mbuffercache)
+{
+  GPU_INDEXBUF_DISCARD_SAFE(mbuffercache->ibo.tris);
+}
+/* Clear all batches that reference ibo.tris. */
+GPU_BATCH_CLEAR_SAFE(cache->batch.surface);
+GPU_BATCH_CLEAR_SAFE(cache->batch.surface_weights);
+GPU_BATCH_CLEAR_SAFE(cache->batch.edit_mesh_analysis);
+GPU_BATCH_CLEAR_SAFE(cache->batch.edit_triangles);
+GPU_BATCH_CLEAR_SAFE(cache->batch.edit_lnor);
+GPU_BATCH_CLEAR_SAFE(cache->batch.edit_selection_faces);
+
+cache->batch_ready &= ~(MBC_SURFACE | MBC_SURFACE_WEIGHTS | 
MBC_EDIT_MESH_ANALYSIS |
+MBC_EDIT_TRIANGLES | MBC_EDIT_LNOR | 
MBC_EDIT_SELECTION_FACES);
+  }
+
   /* Second chance to early out */
   if ((batch_requested & ~cache->batch_ready) == 0) {
 #ifdef DEBUG

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


[Bf-blender-cvs] [8a11e702525] master: GPU: Fix Element index range calculation

2019-08-21 Thread Clément Foucault
Commit: 8a11e702525e3df9d5602045bf905f314cd7abbd
Author: Clément Foucault
Date:   Wed Aug 21 14:47:41 2019 +0200
Branches: master
https://developer.blender.org/rB8a11e702525e3df9d5602045bf905f314cd7abbd

GPU: Fix Element index range calculation

Fix T68880 2D line display is broken

===

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

===

diff --git a/source/blender/gpu/intern/gpu_element.c 
b/source/blender/gpu/intern/gpu_element.c
index 6c9331b4903..3f3f246d6d9 100644
--- a/source/blender/gpu/intern/gpu_element.c
+++ b/source/blender/gpu/intern/gpu_element.c
@@ -267,9 +267,9 @@ static uint index_range(const uint values[], uint 
value_len, uint *min_out, uint
 *max_out = 0;
 return 0;
   }
-  uint min_value = values[0];
-  uint max_value = values[0];
-  for (uint i = 1; i < value_len; ++i) {
+  uint min_value = RESTART_INDEX;
+  uint max_value = 0;
+  for (uint i = 0; i < value_len; ++i) {
 const uint value = values[i];
 if (value == RESTART_INDEX) {
   continue;
@@ -281,9 +281,16 @@ static uint index_range(const uint values[], uint 
value_len, uint *min_out, uint
   max_value = value;
 }
   }
-  *min_out = min_value;
-  *max_out = max_value;
-  return max_value - min_value;
+  if (min_value == RESTART_INDEX) {
+*min_out = 0;
+*max_out = 0;
+return 0;
+  }
+  else {
+*min_out = min_value;
+*max_out = max_value;
+return max_value - min_value;
+  }
 }
 
 static void squeeze_indices_short(GPUIndexBufBuilder *builder,

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


[Bf-blender-cvs] [6f511f67225] functions: Fix raw allocator

2019-08-21 Thread Jacques Lucke
Commit: 6f511f67225ff0745b2cf8580a938b23d9148c4e
Author: Jacques Lucke
Date:   Wed Aug 21 14:44:09 2019 +0200
Branches: functions
https://developer.blender.org/rB6f511f67225ff0745b2cf8580a938b23d9148c4e

Fix raw allocator

This allocator is necessary because sometimes we don't want to use
Blenders guarded allocator. Especially when an object lives longer
than the guarded allocator.

===

M   source/blender/blenlib/BLI_allocator.hpp

===

diff --git a/source/blender/blenlib/BLI_allocator.hpp 
b/source/blender/blenlib/BLI_allocator.hpp
index 89378ff2c40..4da905e9e63 100644
--- a/source/blender/blenlib/BLI_allocator.hpp
+++ b/source/blender/blenlib/BLI_allocator.hpp
@@ -5,6 +5,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_utildefines.h"
+#include "BLI_math_base.h"
 #include "BLI_temporary_allocator.h"
 
 namespace BLI {
@@ -29,20 +30,37 @@ class GuardedAllocator {
 };
 
 class RawAllocator {
+ private:
+  struct MemHead {
+int offset;
+  };
+
  public:
   void *allocate(uint size, const char *UNUSED(name))
   {
-return malloc(size);
+void *ptr = malloc(size + sizeof(MemHead));
+((MemHead *)ptr)->offset = sizeof(MemHead);
+return POINTER_OFFSET(ptr, sizeof(MemHead));
   }
 
   void *allocate_aligned(uint size, uint alignment, const char *UNUSED(name))
   {
-return aligned_alloc(alignment, size);
+BLI_assert(is_power_of_2_i(alignment));
+void *ptr = malloc(size + alignment + sizeof(MemHead));
+void *used_ptr = (void *)((uintptr_t)POINTER_OFFSET(ptr, alignment + 
sizeof(MemHead)) &
+  ~((uintptr_t)alignment - 1));
+uint offset = (uintptr_t)used_ptr - (uintptr_t)ptr;
+BLI_assert(offset >= sizeof(MemHead));
+((MemHead *)used_ptr - 1)->offset = offset;
+return used_ptr;
   }
 
   void deallocate(void *ptr)
   {
-free(ptr);
+MemHead *head = (MemHead *)ptr - 1;
+int offset = -head->offset;
+void *actual_pointer = POINTER_OFFSET(ptr, offset);
+free(actual_pointer);
   }
 };

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


[Bf-blender-cvs] [b19c437eff7] master: Update Eigen to 3.3.7

2019-08-21 Thread Sebastian Parborg
Commit: b19c437eff7f822e68244fd5a48819ebe0506c90
Author: Sebastian Parborg
Date:   Wed Aug 21 14:13:09 2019 +0200
Branches: master
https://developer.blender.org/rBb19c437eff7f822e68244fd5a48819ebe0506c90

Update Eigen to 3.3.7

This is in preparation for the QuadriFlow remesher lib.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5549

===

M   extern/Eigen3/Eigen/Cholesky
M   extern/Eigen3/Eigen/CholmodSupport
M   extern/Eigen3/Eigen/Core
M   extern/Eigen3/Eigen/Eigen
M   extern/Eigen3/Eigen/Eigenvalues
M   extern/Eigen3/Eigen/Geometry
M   extern/Eigen3/Eigen/Householder
M   extern/Eigen3/Eigen/IterativeLinearSolvers
M   extern/Eigen3/Eigen/Jacobi
M   extern/Eigen3/Eigen/LU
M   extern/Eigen3/Eigen/MetisSupport
M   extern/Eigen3/Eigen/OrderingMethods
M   extern/Eigen3/Eigen/PaStiXSupport
M   extern/Eigen3/Eigen/PardisoSupport
M   extern/Eigen3/Eigen/QR
M   extern/Eigen3/Eigen/QtAlignedMalloc
M   extern/Eigen3/Eigen/SPQRSupport
M   extern/Eigen3/Eigen/SVD
M   extern/Eigen3/Eigen/Sparse
M   extern/Eigen3/Eigen/SparseCholesky
M   extern/Eigen3/Eigen/SparseCore
M   extern/Eigen3/Eigen/SparseLU
M   extern/Eigen3/Eigen/SparseQR
M   extern/Eigen3/Eigen/StdDeque
M   extern/Eigen3/Eigen/StdList
M   extern/Eigen3/Eigen/StdVector
M   extern/Eigen3/Eigen/SuperLUSupport
M   extern/Eigen3/Eigen/UmfPackSupport
M   extern/Eigen3/Eigen/src/Cholesky/LDLT.h
M   extern/Eigen3/Eigen/src/Cholesky/LLT.h
A   extern/Eigen3/Eigen/src/Cholesky/LLT_LAPACKE.h
M   extern/Eigen3/Eigen/src/CholmodSupport/CholmodSupport.h
M   extern/Eigen3/Eigen/src/Core/Array.h
M   extern/Eigen3/Eigen/src/Core/ArrayBase.h
M   extern/Eigen3/Eigen/src/Core/ArrayWrapper.h
M   extern/Eigen3/Eigen/src/Core/Assign.h
A   extern/Eigen3/Eigen/src/Core/AssignEvaluator.h
M   extern/Eigen3/Eigen/src/Core/Assign_MKL.h
M   extern/Eigen3/Eigen/src/Core/BandMatrix.h
M   extern/Eigen3/Eigen/src/Core/Block.h
M   extern/Eigen3/Eigen/src/Core/BooleanRedux.h
M   extern/Eigen3/Eigen/src/Core/CommaInitializer.h
A   extern/Eigen3/Eigen/src/Core/ConditionEstimator.h
A   extern/Eigen3/Eigen/src/Core/CoreEvaluators.h
M   extern/Eigen3/Eigen/src/Core/CoreIterators.h
M   extern/Eigen3/Eigen/src/Core/CwiseBinaryOp.h
M   extern/Eigen3/Eigen/src/Core/CwiseNullaryOp.h
A   extern/Eigen3/Eigen/src/Core/CwiseTernaryOp.h
M   extern/Eigen3/Eigen/src/Core/CwiseUnaryOp.h
M   extern/Eigen3/Eigen/src/Core/CwiseUnaryView.h
M   extern/Eigen3/Eigen/src/Core/DenseBase.h
M   extern/Eigen3/Eigen/src/Core/DenseCoeffsBase.h
M   extern/Eigen3/Eigen/src/Core/DenseStorage.h
M   extern/Eigen3/Eigen/src/Core/Diagonal.h
M   extern/Eigen3/Eigen/src/Core/DiagonalMatrix.h
M   extern/Eigen3/Eigen/src/Core/DiagonalProduct.h
M   extern/Eigen3/Eigen/src/Core/Dot.h
M   extern/Eigen3/Eigen/src/Core/EigenBase.h
M   extern/Eigen3/Eigen/src/Core/ForceAlignedAccess.h
M   extern/Eigen3/Eigen/src/Core/Fuzzy.h
M   extern/Eigen3/Eigen/src/Core/GeneralProduct.h
M   extern/Eigen3/Eigen/src/Core/GenericPacketMath.h
M   extern/Eigen3/Eigen/src/Core/GlobalFunctions.h
M   extern/Eigen3/Eigen/src/Core/IO.h
A   extern/Eigen3/Eigen/src/Core/Inverse.h
M   extern/Eigen3/Eigen/src/Core/Map.h
M   extern/Eigen3/Eigen/src/Core/MapBase.h
M   extern/Eigen3/Eigen/src/Core/MathFunctions.h
A   extern/Eigen3/Eigen/src/Core/MathFunctionsImpl.h
M   extern/Eigen3/Eigen/src/Core/Matrix.h
M   extern/Eigen3/Eigen/src/Core/MatrixBase.h
M   extern/Eigen3/Eigen/src/Core/NestByValue.h
M   extern/Eigen3/Eigen/src/Core/NoAlias.h
M   extern/Eigen3/Eigen/src/Core/NumTraits.h
M   extern/Eigen3/Eigen/src/Core/PermutationMatrix.h
M   extern/Eigen3/Eigen/src/Core/PlainObjectBase.h
M   extern/Eigen3/Eigen/src/Core/Product.h
A   extern/Eigen3/Eigen/src/Core/ProductEvaluators.h
M   extern/Eigen3/Eigen/src/Core/Random.h
M   extern/Eigen3/Eigen/src/Core/Redux.h
M   extern/Eigen3/Eigen/src/Core/Ref.h
M   extern/Eigen3/Eigen/src/Core/Replicate.h
M   extern/Eigen3/Eigen/src/Core/ReturnByValue.h
M   extern/Eigen3/Eigen/src/Core/Reverse.h
M   extern/Eigen3/Eigen/src/Core/Select.h
M   extern/Eigen3/Eigen/src/Core/SelfAdjointView.h
M   extern/Eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h
A   extern/Eigen3/Eigen/src/Core/Solve.h
M   extern/Eigen3/Eigen/src/Core/SolveTriangular.h
A   extern/Eigen3/Eigen/src/Core/SolverBase.h
M   extern/Eigen3/Eigen/src/Core/StableNorm.h
M   extern/Eigen3/Eigen/src/Core/Stride.h
M   extern/Eigen3/Eigen/src/Core/Swap.h
M   extern/Eigen3/Eigen/src/Core/Transpose.h
M   extern/Eigen3/Eigen/src/Core/Transpositions.h
M   extern/Eigen3/Eigen/src/Core/TriangularMatrix.h
M   

[Bf-blender-cvs] [1658fd1f7e3] master: Fix T68837 Eevee: Fix "GPU failed to find function math_max" message

2019-08-21 Thread Clément Foucault
Commit: 1658fd1f7e32996bdffa87d90806e99565e8b133
Author: Clément Foucault
Date:   Wed Aug 21 13:39:09 2019 +0200
Branches: master
https://developer.blender.org/rB1658fd1f7e32996bdffa87d90806e99565e8b133

Fix T68837 Eevee: Fix "GPU failed to find function math_max" message

Was a missing rename.

===

M   source/blender/nodes/shader/nodes/node_shader_normal_map.c

===

diff --git a/source/blender/nodes/shader/nodes/node_shader_normal_map.c 
b/source/blender/nodes/shader/nodes/node_shader_normal_map.c
index 4976d038065..3d034372300 100644
--- a/source/blender/nodes/shader/nodes/node_shader_normal_map.c
+++ b/source/blender/nodes/shader/nodes/node_shader_normal_map.c
@@ -58,7 +58,7 @@ static int gpu_shader_normal_map(GPUMaterial *mat,
   GPUNodeLink *realnorm;
   GPUNodeLink *strength;
 
-  float d[4] = {0, 0, 0, 0};
+  float strength_min[4] = {0, 0, 0, 0};
 
   if (in[0].link) {
 strength = in[0].link;
@@ -85,7 +85,7 @@ static int gpu_shader_normal_map(GPUMaterial *mat,
   }
 
   negnorm = GPU_builtin(GPU_WORLD_NORMAL);
-  GPU_link(mat, "math_max", strength, GPU_constant(d), );
+  GPU_link(mat, "math_maximum", strength, GPU_constant(strength_min), 
);
 
   const char *color_to_normal_fnc_name = "color_to_normal_new_shading";
   if (nm->space == SHD_SPACE_BLENDER_OBJECT || nm->space == 
SHD_SPACE_BLENDER_WORLD) {

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


[Bf-blender-cvs] [2a1ec8ec2a8] soc-2019-openxr: Fix missing CMake hint for OpenXR SDK path on linux

2019-08-21 Thread Julian Eisel
Commit: 2a1ec8ec2a816f1a3c3be7c2ebfa868429da38dc
Author: Julian Eisel
Date:   Wed Aug 21 13:23:34 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB2a1ec8ec2a816f1a3c3be7c2ebfa868429da38dc

Fix missing CMake hint for OpenXR SDK path on linux

===

M   build_files/cmake/Modules/FindOpenXR-SDK.cmake

===

diff --git a/build_files/cmake/Modules/FindOpenXR-SDK.cmake 
b/build_files/cmake/Modules/FindOpenXR-SDK.cmake
index 6682f665465..904b4668263 100644
--- a/build_files/cmake/Modules/FindOpenXR-SDK.cmake
+++ b/build_files/cmake/Modules/FindOpenXR-SDK.cmake
@@ -30,6 +30,7 @@ SET(_openxr_sdk_SEARCH_DIRS
   /usr/local
   /sw # Fink
   /opt/local # DarwinPorts
+  /opt/lib/openxr-sdk
 )
 
 FIND_PATH(OPENXR_SDK_INCLUDE_DIR

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


[Bf-blender-cvs] [a9c9a08a32c] greasepencil-object: Merge branch 'master' into greasepencil-object

2019-08-21 Thread Antonio Vazquez
Commit: a9c9a08a32c31511530652cd9411d66f05f33971
Author: Antonio Vazquez
Date:   Wed Aug 21 12:36:51 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rBa9c9a08a32c31511530652cd9411d66f05f33971

Merge branch 'master' 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] [de232f8887b] master: Update CUEW to latest version

2019-08-21 Thread Brecht Van Lommel
Commit: de232f8887b6674bbb01c12d32d1860491b7bdd5
Author: Brecht Van Lommel
Date:   Wed Aug 21 11:49:29 2019 +0200
Branches: master
https://developer.blender.org/rBde232f8887b6674bbb01c12d32d1860491b7bdd5

Update CUEW to latest version

===

M   extern/cuew/include/cuew.h
M   extern/cuew/src/cuew.c

===

diff --git a/extern/cuew/include/cuew.h b/extern/cuew/include/cuew.h
index fa334678e54..0fa0f1291fa 100644
--- a/extern/cuew/include/cuew.h
+++ b/extern/cuew/include/cuew.h
@@ -27,7 +27,7 @@ extern "C" {
 #define CUEW_VERSION_MAJOR 2
 #define CUEW_VERSION_MINOR 0
 
-#define CUDA_VERSION 9010
+#define CUDA_VERSION 9020
 #define CU_IPC_HANDLE_SIZE 64
 #define CU_STREAM_LEGACY ((CUstream)0x1)
 #define CU_STREAM_PER_THREAD ((CUstream)0x2)
@@ -383,6 +383,10 @@ typedef enum CUdevice_attribute_enum {
   CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH = 95,
   CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH = 96,
   CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN = 97,
+  CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES = 98,
+  CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED = 99,
+  CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = 100,
+  CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = 101,
   CU_DEVICE_ATTRIBUTE_MAX,
 } CUdevice_attribute;
 
@@ -408,6 +412,7 @@ typedef enum CUpointer_attribute_enum {
   CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = 6,
   CU_POINTER_ATTRIBUTE_BUFFER_ID = 7,
   CU_POINTER_ATTRIBUTE_IS_MANAGED = 8,
+  CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL = 9,
 } CUpointer_attribute;
 
 typedef enum CUfunction_attribute_enum {
@@ -640,6 +645,7 @@ typedef enum CUdevice_P2PAttribute_enum {
   CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 0x01,
   CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = 0x02,
   CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = 0x03,
+  CU_DEVICE_P2P_ATTRIBUTE_ARRAY_ACCESS_ACCESS_SUPPORTED = 0x04,
 } CUdevice_P2PAttribute;
 
 typedef void (CUDA_CB *CUstreamCallback)(CUstream hStream, CUresult status, 
void* userData);
@@ -888,6 +894,7 @@ typedef CUresult CUDAAPI tcuDriverGetVersion(int* 
driverVersion);
 typedef CUresult CUDAAPI tcuDeviceGet(CUdevice* device, int ordinal);
 typedef CUresult CUDAAPI tcuDeviceGetCount(int* count);
 typedef CUresult CUDAAPI tcuDeviceGetName(char* name, int len, CUdevice dev);
+typedef CUresult CUDAAPI tcuDeviceGetUuid(CUuuid* uuid, CUdevice dev);
 typedef CUresult CUDAAPI tcuDeviceTotalMem_v2(size_t* bytes, CUdevice dev);
 typedef CUresult CUDAAPI tcuDeviceGetAttribute(int* pi, CUdevice_attribute 
attrib, CUdevice dev);
 typedef CUresult CUDAAPI tcuDeviceGetProperties(CUdevprop* prop, CUdevice dev);
@@ -1005,6 +1012,7 @@ typedef CUresult CUDAAPI tcuStreamCreate(CUstream* 
phStream, unsigned int Flags)
 typedef CUresult CUDAAPI tcuStreamCreateWithPriority(CUstream* phStream, 
unsigned int flags, int priority);
 typedef CUresult CUDAAPI tcuStreamGetPriority(CUstream hStream, int* priority);
 typedef CUresult CUDAAPI tcuStreamGetFlags(CUstream hStream, unsigned int* 
flags);
+typedef CUresult CUDAAPI tcuStreamGetCtx(CUstream hStream, CUcontext* pctx);
 typedef CUresult CUDAAPI tcuStreamWaitEvent(CUstream hStream, CUevent hEvent, 
unsigned int Flags);
 typedef CUresult CUDAAPI tcuStreamAddCallback(CUstream hStream, 
CUstreamCallback callback, void* userData, unsigned int flags);
 typedef CUresult CUDAAPI tcuStreamAttachMemAsync(CUstream hStream, CUdeviceptr 
dptr, size_t length, unsigned int flags);
@@ -1127,6 +1135,7 @@ extern tcuDriverGetVersion *cuDriverGetVersion;
 extern tcuDeviceGet *cuDeviceGet;
 extern tcuDeviceGetCount *cuDeviceGetCount;
 extern tcuDeviceGetName *cuDeviceGetName;
+extern tcuDeviceGetUuid *cuDeviceGetUuid;
 extern tcuDeviceTotalMem_v2 *cuDeviceTotalMem_v2;
 extern tcuDeviceGetAttribute *cuDeviceGetAttribute;
 extern tcuDeviceGetProperties *cuDeviceGetProperties;
@@ -1244,6 +1253,7 @@ extern tcuStreamCreate *cuStreamCreate;
 extern tcuStreamCreateWithPriority *cuStreamCreateWithPriority;
 extern tcuStreamGetPriority *cuStreamGetPriority;
 extern tcuStreamGetFlags *cuStreamGetFlags;
+extern tcuStreamGetCtx *cuStreamGetCtx;
 extern tcuStreamWaitEvent *cuStreamWaitEvent;
 extern tcuStreamAddCallback *cuStreamAddCallback;
 extern tcuStreamAttachMemAsync *cuStreamAttachMemAsync;
diff --git a/extern/cuew/src/cuew.c b/extern/cuew/src/cuew.c
index a22f6fda570..1f386c4e5d3 100644
--- a/extern/cuew/src/cuew.c
+++ b/extern/cuew/src/cuew.c
@@ -77,6 +77,7 @@ tcuDriverGetVersion *cuDriverGetVersion;
 tcuDeviceGet *cuDeviceGet;
 tcuDeviceGetCount *cuDeviceGetCount;
 tcuDeviceGetName *cuDeviceGetName;
+tcuDeviceGetUuid *cuDeviceGetUuid;
 tcuDeviceTotalMem_v2 *cuDeviceTotalMem_v2;
 tcuDeviceGetAttribute *cuDeviceGetAttribute;
 tcuDeviceGetProperties *cuDeviceGetProperties;
@@ -194,6 +195,7 @@ tcuStreamCreate *cuStreamCreate;
 tcuStreamCreateWithPriority *cuStreamCreateWithPriority;
 tcuStreamGetPriority 

[Bf-blender-cvs] [ecfe020e6c8] master: Fix T68951: Incrementing int property causes overflow

2019-08-21 Thread Jacques Lucke
Commit: ecfe020e6c8f9ded6a32300b9de43f29e1009c5d
Author: Jacques Lucke
Date:   Wed Aug 21 11:30:27 2019 +0200
Branches: master
https://developer.blender.org/rBecfe020e6c8f9ded6a32300b9de43f29e1009c5d

Fix T68951: Incrementing int property causes overflow

This was probably introduced in rBfdef1a6712b.

===

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

===

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 19eb9699fc8..04b91b12027 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -4800,18 +4800,19 @@ static int ui_do_but_NUM(
   if (click) {
 /* we can click on the side arrows to increment/decrement,
  * or click inside to edit the value directly */
-const float softmin = but->softmin;
-const float softmax = but->softmax;
 
 if (!ui_but_is_float(but)) {
   /* Integer Value. */
   if (but->drawflag & (UI_BUT_ACTIVE_LEFT | UI_BUT_ACTIVE_RIGHT)) {
 button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+
 const int value_step = (int)but->a1;
 BLI_assert(value_step > 0);
+const int softmin = round_fl_to_int_clamp(but->softmin);
+const int softmax = round_fl_to_int_clamp(but->softmax);
 const double value_test = (but->drawflag & UI_BUT_ACTIVE_LEFT) ?
-  (double)max_ii((int)softmin, 
(int)data->value - value_step) :
-  (double)min_ii((int)softmax, 
(int)data->value + value_step);
+  (double)max_ii(softmin, (int)data->value 
- value_step) :
+  (double)min_ii(softmax, (int)data->value 
+ value_step);
 if (value_test != data->value) {
   data->value = (double)value_test;
 }
@@ -4828,11 +4829,14 @@ static int ui_do_but_NUM(
   /* Float Value. */
   if (but->drawflag & (UI_BUT_ACTIVE_LEFT | UI_BUT_ACTIVE_RIGHT)) {
 button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
+
 const double value_step = (double)but->a1 * UI_PRECISION_FLOAT_SCALE;
 BLI_assert(value_step > 0.0f);
 const double value_test = (but->drawflag & UI_BUT_ACTIVE_LEFT) ?
-  (double)max_ff(softmin, 
(float)(data->value - value_step)) :
-  (double)min_ff(softmax, 
(float)(data->value + value_step));
+  (double)max_ff(but->softmin,
+ (float)(data->value - 
value_step)) :
+  (double)min_ff(but->softmax,
+ (float)(data->value + 
value_step));
 if (value_test != data->value) {
   data->value = value_test;
 }

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


[Bf-blender-cvs] [06e2b474902] greasepencil-object: Merge branch 'master' into greasepencil-object

2019-08-21 Thread Antonio Vazquez
Commit: 06e2b474902a786b64f75b3c5f144989360f5780
Author: Antonio Vazquez
Date:   Wed Aug 21 11:15:16 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB06e2b474902a786b64f75b3c5f144989360f5780

Merge branch 'master' 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] [8f50cdd7d5c] master: Fix T68943: GPencil Time modifier gets strange value in offset parameter

2019-08-21 Thread Antonio Vazquez
Commit: 8f50cdd7d5cb43870add1b3e983fed92f84d864a
Author: Antonio Vazquez
Date:   Wed Aug 21 11:05:44 2019 +0200
Branches: master
https://developer.blender.org/rB8f50cdd7d5cb43870add1b3e983fed92f84d864a

Fix T68943: GPencil Time modifier gets strange value in offset parameter

This is due a limitation in the RNA property when the range is too extreme. As 
we don't need that, the value was set to SHRT_MAX frames as maximum offset.

Also fixed the same problem in other modules of Grease Pencil.

===

M   source/blender/makesrna/intern/rna_gpencil.c
M   source/blender/makesrna/intern/rna_gpencil_modifier.c
M   source/blender/makesrna/intern/rna_shader_fx.c

===

diff --git a/source/blender/makesrna/intern/rna_gpencil.c 
b/source/blender/makesrna/intern/rna_gpencil.c
index c88ceb070ab..5313607d4ea 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1649,7 +1649,7 @@ static void rna_def_gpencil_grid(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "lines", PROP_INT, PROP_NONE);
   RNA_def_property_int_sdna(prop, NULL, "lines");
-  RNA_def_property_range(prop, 0, INT_MAX);
+  RNA_def_property_range(prop, 0, SHRT_MAX);
   RNA_def_property_int_default(prop, GP_DEFAULT_GRID_LINES);
   RNA_def_property_ui_text(
   prop, "Grid Subdivisions", "Number of subdivisions in each side of 
symmetry line");
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c 
b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 617b4eb7e4a..21eaaf9dd50 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -1023,7 +1023,7 @@ static void rna_def_modifier_gpenciltime(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
   RNA_def_property_int_sdna(prop, NULL, "offset");
-  RNA_def_property_range(prop, -INT_MAX, INT_MAX);
+  RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
   RNA_def_property_ui_text(
   prop, "Frame Offset", "Number of frames to offset original keyframe 
number or frame to fix");
   RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
@@ -1256,7 +1256,7 @@ static void rna_def_modifier_gpencilinstance(BlenderRNA 
*brna)
   RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
 
   prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE);
-  RNA_def_property_range(prop, 1, INT_MAX);
+  RNA_def_property_range(prop, 1, SHRT_MAX);
   RNA_def_property_ui_range(prop, 1, 50, 1, -1);
   RNA_def_property_ui_text(prop, "Count", "Number of items");
   RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
@@ -1321,7 +1321,7 @@ static void rna_def_modifier_gpencilinstance(BlenderRNA 
*brna)
 
   prop = RNA_def_property(srna, "replace_material", PROP_INT, PROP_NONE);
   RNA_def_property_int_sdna(prop, NULL, "mat_rpl");
-  RNA_def_property_range(prop, 0, INT_MAX);
+  RNA_def_property_range(prop, 0, SHRT_MAX);
   RNA_def_property_ui_text(
   prop,
   "Material",
diff --git a/source/blender/makesrna/intern/rna_shader_fx.c 
b/source/blender/makesrna/intern/rna_shader_fx.c
index f29033df3f7..98c80efee0f 100644
--- a/source/blender/makesrna/intern/rna_shader_fx.c
+++ b/source/blender/makesrna/intern/rna_shader_fx.c
@@ -212,7 +212,7 @@ static void rna_def_shader_fx_blur(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "factor", PROP_INT, PROP_PIXEL);
   RNA_def_property_int_sdna(prop, NULL, "radius");
-  RNA_def_property_range(prop, 0, INT_MAX);
+  RNA_def_property_range(prop, 0, SHRT_MAX);
   RNA_def_property_ui_text(prop, "Factor", "Factor of Blur");
   RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, 
"rna_ShaderFx_update");
 
@@ -329,7 +329,7 @@ static void rna_def_shader_fx_pixel(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
   RNA_def_property_int_sdna(prop, NULL, "size");
-  RNA_def_property_range(prop, 1, INT_MAX);
+  RNA_def_property_range(prop, 1, SHRT_MAX);
   RNA_def_property_array(prop, 2);
   RNA_def_property_ui_text(prop, "Size", "Pixel size");
   RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, 
"rna_ShaderFx_update");
@@ -359,7 +359,7 @@ static void rna_def_shader_fx_rim(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "offset", PROP_INT, PROP_PIXEL);
   RNA_def_property_int_sdna(prop, NULL, "offset");
-  RNA_def_property_range(prop, -INT_MAX, INT_MAX);
+  RNA_def_property_range(prop, SHRT_MIN, SHRT_MAX);
   RNA_def_property_ui_text(prop, "Offset", "Offset of the rim");
   RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, 
"rna_ShaderFx_update");
 
@@ -385,7 +385,7 @@ static void rna_def_shader_fx_rim(BlenderRNA *brna)
 
   prop = RNA_def_property(srna, "blur", PROP_INT, PROP_PIXEL);
   RNA_def_property_int_sdna(prop, NULL, "blur");
-  RNA_def_property_range(prop, 0, INT_MAX);
+  

[Bf-blender-cvs] [6e8a76c96a6] master: UI: Don't left align operator buttons in toolbars

2019-08-21 Thread Julian Eisel
Commit: 6e8a76c96a61d716c02aab4a7ca2ac40d2ae63ff
Author: Julian Eisel
Date:   Wed Aug 21 10:32:23 2019 +0200
Branches: master
https://developer.blender.org/rB6e8a76c96a61d716c02aab4a7ca2ac40d2ae63ff

UI: Don't left align operator buttons in toolbars

This hack would make operator (push down) buttons without icons align
their text to the left in toolbars. Everywhere else in Blender, we
center it by default.

We barely use operator buttons in toolbars anymore. Even if we do and
there's a good reason to make text left aligned, it's better to use
`uiLayout.alignment = 'LEFT'` to achieve the same effect, but without
lowish-level hacks for a specific region type.

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

===

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 78eed98eb77..e9b9411e1bd 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1180,11 +1180,6 @@ static uiBut *uiItemFullO_ptr_ex(uiLayout *layout,
 
   assert(but->optype != NULL);
 
-  /* text alignment for toolbar buttons */
-  if ((layout->root->type == UI_LAYOUT_TOOLBAR) && !icon) {
-but->drawflag |= UI_BUT_TEXT_LEFT;
-  }
-
   if (flag & UI_ITEM_R_NO_BG) {
 layout->emboss = prev_emboss;
   }

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


[Bf-blender-cvs] [f041d2f1163] master: Fix T65671: Armature X-Mirror inconsistencies

2019-08-21 Thread Demeter Dzadik
Commit: f041d2f1163c36d9831b223d61e5740f43c00a13
Author: Demeter Dzadik
Date:   Wed Aug 21 09:59:11 2019 +0200
Branches: master
https://developer.blender.org/rBf041d2f1163c36d9831b223d61e5740f43c00a13

Fix T65671: Armature X-Mirror inconsistencies

This fixes bendy bone properties not being mirrored correctly

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5408

===

M   source/blender/editors/armature/armature_utils.c
M   source/blender/editors/include/ED_armature.h
M   source/blender/editors/transform/transform.h
M   source/blender/editors/transform/transform_conversions.c
M   source/blender/makesrna/intern/rna_armature.c

===

diff --git a/source/blender/editors/armature/armature_utils.c 
b/source/blender/editors/armature/armature_utils.c
index d8777b7e0b7..63b55a3f1b8 100644
--- a/source/blender/editors/armature/armature_utils.c
+++ b/source/blender/editors/armature/armature_utils.c
@@ -381,23 +381,33 @@ void armature_tag_unselect(bArmature *arm)
 
 void ED_armature_ebone_transform_mirror_update(bArmature *arm, EditBone *ebo, 
bool check_select)
 {
+  /* TODO When this function is called by property updates, cancelling the 
value change will not restore mirrored bone correctly. */
+  /* Currently check_select==true when this function is called from a 
transform operator, eg. from 3d viewport. */
   /* no layer check, correct mirror is more important */
   if (!check_select || ebo->flag & (BONE_TIPSEL | BONE_ROOTSEL)) {
 EditBone *eboflip = ED_armature_ebone_get_mirrored(arm->edbo, ebo);
 if (eboflip) {
-  /* we assume X-axis flipping for now */
-  if (check_select && ebo->flag & BONE_TIPSEL) {
-EditBone *children;
+  /* We assume X-axis flipping for now. */
+
+  /* Always mirror roll, since it can be changed by moving either head or 
tail. */
+  eboflip->roll = -ebo->roll;
+
+  if (!check_select || ebo->flag & BONE_TIPSEL) {
+/* Mirror tail properties. */
 
 eboflip->tail[0] = -ebo->tail[0];
 eboflip->tail[1] = ebo->tail[1];
 eboflip->tail[2] = ebo->tail[2];
 eboflip->rad_tail = ebo->rad_tail;
-eboflip->roll = -ebo->roll;
 eboflip->curve_out_x = -ebo->curve_out_x;
+eboflip->curve_out_y = ebo->curve_out_y;
+eboflip->scale_out_x = ebo->scale_out_x;
+eboflip->scale_out_y = ebo->scale_out_y;
+eboflip->ease2 = ebo->ease2;
 eboflip->roll2 = -ebo->roll2;
 
-/* Also move connected children, in case children's name aren't 
mirrored properly */
+/* Also move connected children, in case children's name aren't 
mirrored properly. */
+EditBone *children;
 for (children = arm->edbo->first; children; children = children->next) 
{
   if (children->parent == eboflip && children->flag & BONE_CONNECTED) {
 copy_v3_v3(children->head, eboflip->tail);
@@ -405,32 +415,38 @@ void ED_armature_ebone_transform_mirror_update(bArmature 
*arm, EditBone *ebo, bo
   }
 }
   }
+
   if (!check_select || ebo->flag & BONE_ROOTSEL) {
+/* Mirror head properties. */
 eboflip->head[0] = -ebo->head[0];
 eboflip->head[1] = ebo->head[1];
 eboflip->head[2] = ebo->head[2];
 eboflip->rad_head = ebo->rad_head;
-eboflip->roll = -ebo->roll;
+
 eboflip->curve_in_x = -ebo->curve_in_x;
+eboflip->curve_in_y = ebo->curve_in_y;
+eboflip->scale_in_x = ebo->scale_in_x;
+eboflip->scale_in_y = ebo->scale_in_y;
+eboflip->ease1 = ebo->ease1;
 eboflip->roll1 = -ebo->roll1;
 
-/* Also move connected parent, in case parent's name isn't mirrored 
properly */
+/* Also move connected parent, in case parent's name isn't mirrored 
properly. */
 if (eboflip->parent && eboflip->flag & BONE_CONNECTED) {
   EditBone *parent = eboflip->parent;
   copy_v3_v3(parent->tail, eboflip->head);
   parent->rad_tail = ebo->rad_head;
 }
   }
+
   if (!check_select || ebo->flag & BONE_SELECTED) {
+/* Mirror bone body properties (both head and tail are selected). */
+/* TODO: These values can also be changed from pose mode, so only 
mirroring them in edit mode is not ideal. */
 eboflip->dist = ebo->dist;
-eboflip->roll = -ebo->roll;
+eboflip->weight = ebo->weight;
+
+eboflip->segments = ebo->segments;
 eboflip->xwidth = ebo->xwidth;
 eboflip->zwidth = ebo->zwidth;
-
-eboflip->curve_in_x = -ebo->curve_in_x;
-eboflip->curve_out_x = -ebo->curve_out_x;
-eboflip->roll1 = -ebo->roll1;
-eboflip->roll2 = -ebo->roll2;
   }
 }
   }
diff --git a/source/blender/editors/include/ED_armature.h 
b/source/blender/editors/include/ED_armature.h
index 

[Bf-blender-cvs] [7f79bc3054b] functions: Merge branch 'master' into functions

2019-08-21 Thread Jacques Lucke
Commit: 7f79bc3054bc849405ed73960eb3117cd15d2e1f
Author: Jacques Lucke
Date:   Wed Aug 21 09:27:24 2019 +0200
Branches: functions
https://developer.blender.org/rB7f79bc3054bc849405ed73960eb3117cd15d2e1f

Merge branch 'master' into functions

===



===



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


[Bf-blender-cvs] [3d8f1586973] master: GPencil: add new filter by material to modifiers

2019-08-21 Thread Matias Mendiola
Commit: 3d8f1586973b1fbadf3cf45c66873d1a012764ee
Author: Matias Mendiola
Date:   Wed Aug 21 08:30:45 2019 +0200
Branches: master
https://developer.blender.org/rB3d8f1586973b1fbadf3cf45c66873d1a012764ee

GPencil: add new filter by material to modifiers

This commit adds a new filter by material using the name and not only the index.

Reviewers: antoniov, pepeland

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

===

M   release/scripts/startup/bl_ui/properties_data_modifier.py
M   source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencil_util.h
M   source/blender/gpencil_modifiers/intern/MOD_gpencilarray.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
M   source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c
M   source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
M   source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
M   source/blender/makesdna/DNA_gpencil_modifier_types.h
M   source/blender/makesrna/intern/rna_gpencil_modifier.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py 
b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 1d1ee2e52be..47c911821fc 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1706,11 +1706,20 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, 
Panel):
 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
 row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT')
 
+col = layout.column()
+col.separator()
+
 col.label(text="Material:")
 row = col.row(align=True)
+row.prop_search(md, "material", gpd, "materials", text="", 
icon='SHADING_TEXTURE')
+row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT')
+row = layout.row(align=True)
 row.prop(md, "pass_index", text="Pass")
 row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT')
 
+col = layout.column()
+col.separator()
+
 col.label(text="Layer:")
 row = col.row(align=True)
 row.prop_search(md, "layer", gpd, "layers", text="", 
icon='GREASEPENCIL')
@@ -1738,11 +1747,20 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, 
Panel):
 row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
 row.prop(md, "invert_vertex", text="", icon='ARROW_LEFTRIGHT')
 
+col = layout.column()
+col.separator()
+
 col.label(text="Material:")
 row = col.row(align=True)
+row.prop_search(md, "material", gpd, "materials", text="", 
icon='SHADING_TEXTURE')
+row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT')
+row = layout.row(align=True)
 row.prop(md, "pass_index", text="Pass")
 row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT')
 
+col = layout.column()
+col.separator()
+
 col.label(text="Layer:")
 row = col.row(align=True)
 row.prop_search(md, "layer", gpd, "layers", text="", 
icon='GREASEPENCIL')
@@ -1762,11 +1780,19 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, 
Panel):
 
 col = layout.column()
 col.separator()
+
 col.label(text="Material:")
 row = col.row(align=True)
+
+row.prop_search(md, "material", gpd, "materials", text="", 
icon='SHADING_TEXTURE')
+row.prop(md, "invert_materials", text="", icon='ARROW_LEFTRIGHT')
+row = layout.row(align=True)
 row.prop(md, "pass_index", text="Pass")
 row.prop(md, "invert_material_pass", text="", icon='ARROW_LEFTRIGHT')
 
+col = layout.column()
+col.separator()
+
 col.label(text="Layer:")
 row = col.row(align=True)
 row.prop_search(md, "layer", gpd, "layers", text="", 
icon='GREASEPENCIL')
@@ -1797,11 +1823,18 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, 
Panel):
 
 col = layout.column()
 col.separator()
+
 col.label(text="Material:")
 row = col.row(align=True)
+row.prop_search(md, "material", gpd, "materials", text="", 
icon='SHADING_TEXTURE')
+