[Bf-blender-cvs] [3948f65] master: Cleanup: style, spelling

2016-07-18 Thread Campbell Barton
Commit: 3948f65686ae78de2b0cd668390826f49598f99b
Author: Campbell Barton
Date:   Tue Jul 19 10:23:26 2016 +1000
Branches: master
https://developer.blender.org/rB3948f65686ae78de2b0cd668390826f49598f99b

Cleanup: style, spelling

===

M   source/blender/blenkernel/intern/library_query.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/bmesh/operators/bmo_connect_pair.c
M   source/blender/bmesh/tools/bmesh_bevel.c
M   source/blender/makesdna/DNA_view3d_types.h

===

diff --git a/source/blender/blenkernel/intern/library_query.c 
b/source/blender/blenkernel/intern/library_query.c
index f86f5fa..0413211 100644
--- a/source/blender/blenkernel/intern/library_query.c
+++ b/source/blender/blenkernel/intern/library_query.c
@@ -856,9 +856,10 @@ void BKE_library_update_ID_link_user(ID *id_dst, ID 
*id_src, const int cd_flag)
 
 /**
  * Say whether given \a id_type_owner can use (in any way) a datablock of \a 
id_type_used.
+ *
+ * This is a 'simplified' abstract version of #BKE_library_foreach_ID_link() 
above, quite useful to reduce
+ * useless iterations in some cases.
  */
-/* This is a 'simplified' abstract version of BKE_library_foreach_ID_link() 
above, quite useful to reduce
- * useless ietrations in some cases. */
 bool BKE_library_idtype_can_use_idtype(const short id_type_owner, const short 
id_type_used)
 {
if (id_type_used == ID_AC) {
diff --git a/source/blender/blenloader/intern/writefile.c 
b/source/blender/blenloader/intern/writefile.c
index 88f1c4d..ba783e0 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2268,7 +2268,7 @@ static void write_meshes(WriteData *wd, ListBase *idbase)
mesh->edit_btmesh = NULL;
 
/* now fill in polys to mfaces */
-   /* XXX This breaks writing desing, by using 
temp allocated memory, which will likely generate
+   /* XXX This breaks writing design, by using 
temp allocated memory, which will likely generate
 * duplicates in stored 'old' addresses.
 * This is very bad, but do not see easy 
way to avoid this, aside from generating those data
 * outside of save process itself.
diff --git a/source/blender/bmesh/operators/bmo_connect_pair.c 
b/source/blender/bmesh/operators/bmo_connect_pair.c
index 241086f..05322a5 100644
--- a/source/blender/bmesh/operators/bmo_connect_pair.c
+++ b/source/blender/bmesh/operators/bmo_connect_pair.c
@@ -124,7 +124,7 @@ typedef struct PathLinkState {
 } PathLinkState;
 
 /**
-  \name Min Dist Dir Util
+ * \name Min Dist Dir Util
  *
  * Simply getting the closest intersecting vert/edge is _not_ good enough. see 
T43792
  * we need to get the closest in both directions since the absolute closest 
may be a dead-end.
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c 
b/source/blender/bmesh/tools/bmesh_bevel.c
index 4dc1c8a..b647f5a 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -1648,9 +1648,11 @@ static void build_boundary_vertex_only(BevelParams *bp, 
BevVert *bv, bool constr
}
 }
 
-/* Special case of build_boundary when a single edge is beveled.
-  * The 'width adjust' part of build_boundary has been done already, and
- * efirst is the first beveled edge at vertex bv. */
+/**
+ * Special case of build_boundary when a single edge is beveled.
+ * The 'width adjust' part of build_boundary has been done already,
+ * and \a efirst is the first beveled edge at vertex \a bv.
+*/
 static void build_boundary_terminal_edge(BevelParams *bp, BevVert *bv, 
EdgeHalf *efirst, bool construct)
 {
MemArena *mem_arena = bp->mem_arena;
diff --git a/source/blender/makesdna/DNA_view3d_types.h 
b/source/blender/makesdna/DNA_view3d_types.h
index 5b533d1..4c24350 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -239,7 +239,7 @@ typedef struct View3D {
float stereo3d_convergence_alpha;
 
/* Previous viewport draw type.
-* Runtime-only, set in the rendered viewport otggle operator.
+* Runtime-only, set in the rendered viewport toggle operator.
 */
short prev_drawtype;
short pad1;

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


[Bf-blender-cvs] [bd59206] master: Cleanup: style, spelling

2016-07-18 Thread Campbell Barton
Commit: bd59206b5c28674a757746a64aaf31abc107cedb
Author: Campbell Barton
Date:   Tue Jul 19 08:39:38 2016 +1000
Branches: master
https://developer.blender.org/rBbd59206b5c28674a757746a64aaf31abc107cedb

Cleanup: style, spelling

===

M   source/blender/blenkernel/intern/CCGSubSurf_intern.h
M   source/blender/blenkernel/intern/colortools.c
M   source/blender/blenkernel/intern/image.c
M   source/blender/blenlib/intern/BLI_kdopbvh.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/bmesh/intern/bmesh_polygon.c
M   source/blender/render/extern/include/RE_pipeline.h
M   source/blender/render/intern/source/pipeline.c
M   source/blender/render/intern/source/zbuf.c

===

diff --git a/source/blender/blenkernel/intern/CCGSubSurf_intern.h 
b/source/blender/blenkernel/intern/CCGSubSurf_intern.h
index 7ec9f32..0cdf3ac 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_intern.h
+++ b/source/blender/blenkernel/intern/CCGSubSurf_intern.h
@@ -86,7 +86,7 @@ void ccg_ehashIterator_next(EHashIterator *ehi);
 int ccg_ehashIterator_isStopped(EHashIterator *ehi);
 
 /**
- * Standard allocator implementarion.
+ * Standard allocator implementation.
  */
 
 CCGAllocatorIFC *ccg_getStandardAllocatorIFC(void);
diff --git a/source/blender/blenkernel/intern/colortools.c 
b/source/blender/blenkernel/intern/colortools.c
index 4089475..53a7402 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -1266,7 +1266,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const 
ColorManagedViewSettings *
 
switch (scopes->wavefrm_mode) {
case SCOPES_WAVEFRM_RGB:
-   //break;
+   /* fall-through */
case SCOPES_WAVEFRM_RGB_PARADE:
ycc_mode = -1;
break;
diff --git a/source/blender/blenkernel/intern/image.c 
b/source/blender/blenkernel/intern/image.c
index ae3163d..7cf2b95 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1083,39 +1083,48 @@ int BKE_image_imtype_to_ftype(const char imtype, 
ImbFormatOptions *r_options)
 {
memset(r_options, 0, sizeof(*r_options));
 
-   if (imtype == R_IMF_IMTYPE_TARGA)
+   if (imtype == R_IMF_IMTYPE_TARGA) {
return IMB_FTYPE_TGA;
+   }
else if (imtype == R_IMF_IMTYPE_RAWTGA) {
r_options->flag = RAWTGA;
return IMB_FTYPE_TGA;
}
-   else if (imtype == R_IMF_IMTYPE_IRIS)
+   else if (imtype == R_IMF_IMTYPE_IRIS) {
return IMB_FTYPE_IMAGIC;
+   }
 #ifdef WITH_HDR
-   else if (imtype == R_IMF_IMTYPE_RADHDR)
+   else if (imtype == R_IMF_IMTYPE_RADHDR) {
return IMB_FTYPE_RADHDR;
+   }
 #endif
else if (imtype == R_IMF_IMTYPE_PNG) {
r_options->quality = 15;
return IMB_FTYPE_PNG;
}
 #ifdef WITH_DDS
-   else if (imtype == R_IMF_IMTYPE_DDS)
+   else if (imtype == R_IMF_IMTYPE_DDS) {
return IMB_FTYPE_DDS;
+   }
 #endif
-   else if (imtype == R_IMF_IMTYPE_BMP)
+   else if (imtype == R_IMF_IMTYPE_BMP) {
return IMB_FTYPE_BMP;
+   }
 #ifdef WITH_TIFF
-   else if (imtype == R_IMF_IMTYPE_TIFF)
+   else if (imtype == R_IMF_IMTYPE_TIFF) {
return IMB_FTYPE_TIF;
+   }
 #endif
-   else if (imtype == R_IMF_IMTYPE_OPENEXR || imtype == 
R_IMF_IMTYPE_MULTILAYER)
+   else if (imtype == R_IMF_IMTYPE_OPENEXR || imtype == 
R_IMF_IMTYPE_MULTILAYER) {
return IMB_FTYPE_OPENEXR;
+   }
 #ifdef WITH_CINEON
-   else if (imtype == R_IMF_IMTYPE_CINEON)
+   else if (imtype == R_IMF_IMTYPE_CINEON) {
return IMB_FTYPE_CINEON;
-   else if (imtype == R_IMF_IMTYPE_DPX)
+   }
+   else if (imtype == R_IMF_IMTYPE_DPX) {
return IMB_FTYPE_DPX;
+   }
 #endif
 #ifdef WITH_OPENJPEG
else if (imtype == R_IMF_IMTYPE_JP2) {
@@ -1132,46 +1141,60 @@ int BKE_image_imtype_to_ftype(const char imtype, 
ImbFormatOptions *r_options)
 
 char BKE_image_ftype_to_imtype(const int ftype, const ImbFormatOptions 
*options)
 {
-   if (ftype == 0)
+   if (ftype == 0) {
return R_IMF_IMTYPE_TARGA;
-   else if (ftype == IMB_FTYPE_IMAGIC)
+   }
+   else if (ftype == IMB_FTYPE_IMAGIC) {
return R_IMF_IMTYPE_IRIS;
+   }
 #ifdef WITH_HDR
-   else if (ftype == IMB_FTYPE_RADHDR)
+   else if (ftype == IMB_FTYPE_RADHDR) {
return R_IMF_IMTYPE_RADHDR;
+   }
 #endif
-   else if (ftype == IMB_FTYPE_PNG)
+   else if (ftype == IMB_FTYPE_PNG) {
return R_IMF_IMTYPE_PNG;
+   }
 #ifdef WITH_DDS
-   else if (ftype == 

[Bf-blender-cvs] [5234e9d] master: Cycles: add ConstantFolder class for constant folding boilerplate.

2016-07-18 Thread Alexander Gavrilov
Commit: 5234e9ddd3ecefcf3a48d1f41e4dc18b89627f72
Author: Alexander Gavrilov
Date:   Sat Jul 16 13:16:54 2016 +0200
Branches: master
https://developer.blender.org/rB5234e9ddd3ecefcf3a48d1f41e4dc18b89627f72

Cycles: add ConstantFolder class for constant folding boilerplate.

Reviewed By: brecht, sergey

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

===

M   intern/cycles/render/CMakeLists.txt
A   intern/cycles/render/constant_fold.cpp
A   intern/cycles/render/constant_fold.h
M   intern/cycles/render/graph.cpp
M   intern/cycles/render/graph.h
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h

===

diff --git a/intern/cycles/render/CMakeLists.txt 
b/intern/cycles/render/CMakeLists.txt
index b14da3e..a632ddc 100644
--- a/intern/cycles/render/CMakeLists.txt
+++ b/intern/cycles/render/CMakeLists.txt
@@ -22,6 +22,7 @@ set(SRC
bake.cpp
buffers.cpp
camera.cpp
+   constant_fold.cpp
film.cpp
graph.cpp
image.cpp
@@ -49,6 +50,7 @@ set(SRC_HEADERS
background.h
buffers.h
camera.h
+   constant_fold.h
film.h
graph.h
image.h
diff --git a/intern/cycles/render/constant_fold.cpp 
b/intern/cycles/render/constant_fold.cpp
new file mode 100644
index 000..1fee6b2
--- /dev/null
+++ b/intern/cycles/render/constant_fold.cpp
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2011-2013 Blender Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "constant_fold.h"
+#include "graph.h"
+
+#include "util_foreach.h"
+
+CCL_NAMESPACE_BEGIN
+
+ConstantFolder::ConstantFolder(ShaderGraph *graph, ShaderNode *node, 
ShaderOutput *output)
+: graph(graph), node(node), output(output)
+{
+}
+
+bool ConstantFolder::all_inputs_constant() const
+{
+   foreach(ShaderInput *input, node->inputs) {
+   if(input->link) {
+   return false;
+   }
+   }
+
+   return true;
+}
+
+void ConstantFolder::make_constant(float value) const
+{
+   foreach(ShaderInput *sock, output->links) {
+   sock->set(value);
+   }
+
+   graph->disconnect(output);
+}
+
+void ConstantFolder::make_constant(float3 value) const
+{
+   foreach(ShaderInput *sock, output->links) {
+   sock->set(value);
+   }
+
+   graph->disconnect(output);
+}
+
+void ConstantFolder::make_constant_clamp(float value, bool clamp) const
+{
+   make_constant(clamp ? saturate(value) : value);
+}
+
+void ConstantFolder::make_constant_clamp(float3 value, bool clamp) const
+{
+   if (clamp) {
+   value.x = saturate(value.x);
+   value.y = saturate(value.y);
+   value.z = saturate(value.z);
+   }
+
+   make_constant(value);
+}
+
+void ConstantFolder::bypass(ShaderOutput *new_output) const
+{
+   assert(new_output);
+
+   /* Remove all outgoing links from socket and connect them to new_output 
instead.
+* The graph->relink method affects node inputs, so it's not safe to 
use in constant
+* folding if the node has multiple outputs and will thus be folded 
multiple times. */
+   vector outputs = output->links;
+
+   graph->disconnect(output);
+
+   foreach(ShaderInput *sock, outputs) {
+   graph->connect(new_output, sock);
+   }
+}
+
+void ConstantFolder::discard() const
+{
+   assert(output->type() == SocketType::CLOSURE);
+   graph->disconnect(output);
+}
+
+void ConstantFolder::bypass_or_discard(ShaderInput *input) const
+{
+   assert(input->type() == SocketType::CLOSURE);
+
+   if (input->link) {
+   bypass(input->link);
+   }
+   else {
+   discard();
+   }
+}
+
+bool ConstantFolder::try_bypass_or_make_constant(ShaderInput *input, float3 
input_value, bool clamp) const
+{
+   if(!input->link) {
+   make_constant_clamp(input_value, clamp);
+   return true;
+   }
+   else if(!clamp) {
+   bypass(input->link);
+   return true;
+   }
+
+   return false;
+}
+
+CCL_NAMESPACE_END
diff --git a/intern/cycles/render/constant_fold.h 
b/intern/cycles/render/constant_fold.h
new file mode 100644
index 000..978c8e5
--- /dev/null
+++ b/intern/cycles/render/constant_fold.h
@@ -0,0 +1,59 

[Bf-blender-cvs] [20ec6bc] master: Fix Cycles kernel build without render passes support.

2016-07-18 Thread Brecht Van Lommel
Commit: 20ec6bc166e31449cce48a5a658f26caf96f71fa
Author: Brecht Van Lommel
Date:   Sun Jul 17 18:09:58 2016 +0200
Branches: master
https://developer.blender.org/rB20ec6bc166e31449cce48a5a658f26caf96f71fa

Fix Cycles kernel build without render passes support.

===

M   intern/cycles/kernel/kernel_accumulate.h
M   intern/cycles/kernel/kernel_types.h
M   intern/cycles/kernel/kernels/cpu/kernel_cpu_impl.h

===

diff --git a/intern/cycles/kernel/kernel_accumulate.h 
b/intern/cycles/kernel/kernel_accumulate.h
index 5f5a360..0e13b22 100644
--- a/intern/cycles/kernel/kernel_accumulate.h
+++ b/intern/cycles/kernel/kernel_accumulate.h
@@ -50,7 +50,7 @@ ccl_device_inline void bsdf_eval_init(BsdfEval *eval, 
ClosureType type, float3 v
else
eval->diffuse = value;
 #else
-   *eval = value;
+   eval->diffuse = value;
 #endif
 }
 
@@ -80,7 +80,7 @@ void bsdf_eval_accum(BsdfEval *eval, ClosureType type, float3 
value)
else
eval->diffuse += value;
 #else
-   *eval += value;
+   eval->diffuse += value;
 #endif
 }
 
@@ -98,7 +98,7 @@ ccl_device_inline bool bsdf_eval_is_zero(BsdfEval *eval)
else
return is_zero(eval->diffuse);
 #else
-   return is_zero(*eval);
+   return is_zero(eval->diffuse);
 #endif
 }
 
@@ -117,7 +117,7 @@ ccl_device_inline void bsdf_eval_mul(BsdfEval *eval, float3 
value)
else
eval->diffuse *= value;
 #else
-   *eval *= value;
+   eval->diffuse *= value;
 #endif
 }
 
@@ -172,7 +172,7 @@ ccl_device_inline void path_radiance_init(PathRadiance *L, 
int use_light_pass)
else
L->emission = make_float3(0.0f, 0.0f, 0.0f);
 #else
-   *L = make_float3(0.0f, 0.0f, 0.0f);
+   L->emission = make_float3(0.0f, 0.0f, 0.0f);
 #endif
 }
 
@@ -207,7 +207,7 @@ ccl_device_inline void 
path_radiance_bsdf_bounce(PathRadiance *L, ccl_addr_space
else
*throughput *= bsdf_eval->diffuse*inverse_pdf;
 #else
-   *throughput *= *bsdf_eval*inverse_pdf;
+   *throughput *= bsdf_eval->diffuse*inverse_pdf;
 #endif
 }
 
@@ -225,7 +225,7 @@ ccl_device_inline void 
path_radiance_accum_emission(PathRadiance *L, float3 thro
else
L->emission += throughput*value;
 #else
-   *L += throughput*value;
+   L->emission += throughput*value;
 #endif
 }
 
@@ -246,7 +246,7 @@ ccl_device_inline void path_radiance_accum_ao(PathRadiance 
*L, float3 throughput
else
L->emission += throughput*bsdf*ao;
 #else
-   *L += throughput*bsdf*ao;
+   L->emission += throughput*bsdf*ao;
 #endif
 }
 
@@ -277,7 +277,7 @@ ccl_device_inline void 
path_radiance_accum_light(PathRadiance *L, float3 through
else
L->emission += throughput*bsdf_eval->diffuse*shadow;
 #else
-   *L += throughput*(*bsdf_eval)*shadow;
+   L->emission += throughput*bsdf_eval->diffuse*shadow;
 #endif
 }
 
@@ -295,7 +295,7 @@ ccl_device_inline void 
path_radiance_accum_background(PathRadiance *L, float3 th
else
L->emission += throughput*value;
 #else
-   *L += throughput*value;
+   L->emission += throughput*value;
 #endif
 }
 
@@ -441,7 +441,7 @@ ccl_device_inline float3 
path_radiance_clamp_and_sum(KernelGlobals *kg, PathRadi
else
L_sum = L->emission;
 #else
-   L_sum = *L;
+   L_sum = L->emission;
 #endif
 
/* Reject invalid value */
@@ -477,7 +477,7 @@ ccl_device_inline void 
path_radiance_accum_sample(PathRadiance *L, PathRadiance
L->shadow += L_sample->shadow*fac;
L->mist += L_sample->mist*fac;
 #else
-   *L += *L_sample * fac;
+   L->emission += L_sample->emission * fac;
 #endif
 }
 
diff --git a/intern/cycles/kernel/kernel_types.h 
b/intern/cycles/kernel/kernel_types.h
index 5de58ba..a9be2ae 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -387,12 +387,13 @@ typedef enum BakePassFilterCombos {
BAKE_FILTER_SUBSURFACE_INDIRECT = (BAKE_FILTER_INDIRECT | 
BAKE_FILTER_SUBSURFACE),
 } BakePassFilterCombos;
 
-#ifdef __PASSES__
-
 typedef ccl_addr_space struct PathRadiance {
+#ifdef __PASSES__
int use_light_pass;
+#endif
 
float3 emission;
+#ifdef __PASSES__
float3 background;
float3 ao;
 
@@ -426,25 +427,23 @@ typedef ccl_addr_space struct PathRadiance {
 
float4 shadow;
float mist;
+#endif
 } PathRadiance;
 
 typedef struct BsdfEval {
+#ifdef __PASSES__
int use_light_pass;
+#endif
 
float3 diffuse;
+#ifdef __PASSES__
float3 glossy;
float3 transmission;
float3 transparent;
float3 subsurface;
float3 scatter;
-} BsdfEval;
-
-#else
-
-typedef ccl_addr_space float3 PathRadiance;
-typedef float3 BsdfEval;
-
 #endif
+} BsdfEval;
 
 /* Shader 

[Bf-blender-cvs] [10b0e33] master: Cycles: add support for motion blurring of fluid meshes.

2016-07-18 Thread Kévin Dietrich
Commit: 10b0e33de1b9b57693ebcec7d503d3b204043f56
Author: Kévin Dietrich
Date:   Sat Jul 16 18:56:59 2016 +0200
Branches: master
https://developer.blender.org/rB10b0e33de1b9b57693ebcec7d503d3b204043f56

Cycles: add support for motion blurring of fluid meshes.

Reviewed By: brecht

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

===

M   intern/cycles/blender/blender_mesh.cpp
M   intern/cycles/blender/blender_object.cpp
M   intern/cycles/blender/blender_sync.h
M   intern/cycles/blender/blender_util.h
M   intern/cycles/render/scene.cpp
M   intern/cycles/render/scene.h
M   source/blender/makesrna/intern/rna_fluidsim.c

===

diff --git a/intern/cycles/blender/blender_mesh.cpp 
b/intern/cycles/blender/blender_mesh.cpp
index 4bd385c..ec11a89 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -680,6 +680,43 @@ static void create_subd_mesh(Scene *scene,
 
 /* Sync */
 
+static void sync_mesh_fluid_motion(BL::Object& b_ob, Scene *scene, Mesh *mesh)
+{
+   if(scene->need_motion() == Scene::MOTION_NONE)
+   return;
+
+   BL::DomainFluidSettings b_fluid_domain = object_fluid_domain_find(b_ob);
+
+   if(!b_fluid_domain)
+   return;
+
+   /* If the mesh has modifiers following the fluid domain we can't export 
motion. */
+   if(b_fluid_domain.fluid_mesh_vertices.length() != mesh->verts.size())
+   return;
+
+   /* Find or add attribute */
+   float3 *P = >verts[0];
+   Attribute *attr_mP = 
mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
+
+   if(!attr_mP) {
+   attr_mP = mesh->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
+   }
+
+   /* Only export previous and next frame, we don't have any in between 
data. */
+   float motion_times[2] = {-1.0f, 1.0f};
+   for (int step = 0; step < 2; step++) {
+   float relative_time = motion_times[step] * 
scene->motion_shutter_time() * 0.5f;
+   float3 *mP = attr_mP->data_float3() + step*mesh->verts.size();
+
+   BL::DomainFluidSettings::fluid_mesh_vertices_iterator fvi;
+   int i = 0;
+
+   for(b_fluid_domain.fluid_mesh_vertices.begin(fvi); fvi != 
b_fluid_domain.fluid_mesh_vertices.end(); ++fvi, ++i) {
+   mP[i] = P[i] + get_float3(fvi->velocity()) * 
relative_time;
+   }
+   }
+}
+
 Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
  bool object_updated,
  bool hide_tris)
@@ -821,6 +858,9 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
mesh->displacement_method = Mesh::DISPLACE_BOTH;
}
 
+   /* fluid motion */
+   sync_mesh_fluid_motion(b_ob, scene, mesh);
+
/* tag update */
bool rebuild = false;
 
@@ -910,6 +950,11 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob,
 * would need a more extensive check to see which objects are animated 
*/
BL::Mesh b_mesh(PointerRNA_NULL);
 
+   /* fluid motion is exported immediate with mesh, skip here */
+   BL::DomainFluidSettings b_fluid_domain = object_fluid_domain_find(b_ob);
+   if (b_fluid_domain)
+   return;
+
if(ccl::BKE_object_is_deform_modified(b_ob, b_scene, preview)) {
/* get derived mesh */
b_mesh = object_to_mesh(b_data, b_ob, b_scene, true, !preview, 
false);
diff --git a/intern/cycles/blender/blender_object.cpp 
b/intern/cycles/blender/blender_object.cpp
index ede8c47..22a0b39 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -719,12 +719,7 @@ void BlenderSync::sync_motion(BL::RenderSettings& b_render,
<< relative_time << ".";
 
/* fixed shutter time to get previous and next frame for motion 
pass */
-   float shuttertime;
-
-   if(scene->need_motion() == Scene::MOTION_PASS)
-   shuttertime = 2.0f;
-   else
-   shuttertime = scene->camera->shuttertime;
+   float shuttertime = scene->motion_shutter_time();
 
/* compute frame and subframe time */
float time = frame_center + frame_center_delta + relative_time 
* shuttertime * 0.5f;
diff --git a/intern/cycles/blender/blender_sync.h 
b/intern/cycles/blender/blender_sync.h
index d690adb..b8b9597 100644
--- a/intern/cycles/blender/blender_sync.h
+++ b/intern/cycles/blender/blender_sync.h
@@ -131,7 +131,9 @@ private:
Transform& tfm,
bool *use_portal);
void sync_background_light(bool use_portal);
-   void sync_mesh_motion(BL::Object& b_ob, Object *object, float 
motion_time);
+   void 

[Bf-blender-cvs] [399c978] master: fix breakage caused by D2094 / rB404f41d22de46119ee8afb409011eb1ba1840092

2016-07-18 Thread lazydodo
Commit: 399c978a551dfd13504852aaa7d3a2ab874272fe
Author: lazydodo
Date:   Mon Jul 18 13:08:03 2016 -0600
Branches: master
https://developer.blender.org/rB399c978a551dfd13504852aaa7d3a2ab874272fe

fix breakage caused by D2094 / rB404f41d22de46119ee8afb409011eb1ba1840092

===

M   source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

===

diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp 
b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 9c3f94f..d033afa 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -709,7 +709,7 @@ int main(
{
i++;
if ( (i + 1) <= validArguments )
-   parentWindow = atoi(argv[i++]);
+   parentWindow = 
(GHOST_TEmbedderWindowID)atoll(argv[i++]);
else {
error = true;
printf("error: too few options for 
parent window argument.\n");

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


[Bf-blender-cvs] [8592e10] soc-2016-pbvh-painting: Disregard last commit.

2016-07-18 Thread Nathan Vollmer
Commit: 8592e10a43c3786aaa4c661828649be1a4925ef1
Author: Nathan Vollmer
Date:   Tue Jul 19 03:09:02 2016 -0600
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB8592e10a43c3786aaa4c661828649be1a4925ef1

Disregard last commit.

===

M   release/scripts/addons
M   release/scripts/addons_contrib
M   release/scripts/startup/bl_ui/space_view3d_toolbar.py

===

diff --git a/release/scripts/addons b/release/scripts/addons
index 04138bd..9dd1799 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 04138bdf09c5835273ab10177e99f2ffd3f1bc44
+Subproject commit 9dd17998ca72cdc1abce8e9e9cff8b82798244e2
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 21462b9..6176bf6 16
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 21462b91fffb2a4693ef08cfee16a6fab32c4acb
+Subproject commit 6176bf658d03be565f7c82e2d2527c9c2aa1cf3b
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index c7fcc95..f9f6b43 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1694,6 +1694,7 @@ class VIEW3D_PT_tools_brush_appearance(Panel, 
View3DPaintPanel):
 class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
 bl_category = "Tools"
 bl_context = "weightpaint"
+bl_options = {'DEFAULT_CLOSED'}
 bl_label = "Weight Tools"
 
 def draw(self, context):
@@ -1706,6 +1707,23 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
 props.use_reverse_transfer = True
 props.data_type = 'VGROUP_WEIGHTS'
 
+class VIEW3D_PT_weightpaint_symmetry(Panel, View3DPaintPanel):
+bl_category = "Tools"
+bl_context = "weightpaint"
+bl_options = {'DEFAULT_CLOSED'}
+bl_label = "Symmetry / Lock"
+
+def draw(self, context):
+layout = self.layout
+toolsettings = context.tool_settings
+wpaint = toolsettings.weight_paint
+col = layout.column(align=True)
+col.label(text="Mirror:")
+row = col.row(align=True)
+row.prop(wpaint, "use_symmetry_x", text="X", toggle=True)
+row.prop(wpaint, "use_symmetry_y", text="Y", toggle=True)
+row.prop(wpaint, "use_symmetry_z", text="Z", toggle=True)
+layout.column().prop(wpaint, "radial_symmetry", text="Radial")
 
 class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
 bl_category = "Options"

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


[Bf-blender-cvs] [ffe106a] master: Docs: improve bpy.props.EnumProperty reference

2016-07-18 Thread Campbell Barton
Commit: ffe106a56a8907ae73a4d2299af6a78fc0b450da
Author: Campbell Barton
Date:   Tue Jul 19 05:03:50 2016 +1000
Branches: master
https://developer.blender.org/rBffe106a56a8907ae73a4d2299af6a78fc0b450da

Docs: improve bpy.props.EnumProperty reference

===

M   source/blender/python/intern/bpy_props.c

===

diff --git a/source/blender/python/intern/bpy_props.c 
b/source/blender/python/intern/bpy_props.c
index bce1d92..3baeae0 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -2627,17 +2627,29 @@ PyDoc_STRVAR(BPy_EnumProperty_doc,
 "   Returns a new enumerator property definition.\n"
 "\n"
 "   :arg items: sequence of enum items formatted:\n"
-"  [(identifier, name, description, icon, number), ...] where the 
identifier is used\n"
-"  for python access and other values are used for the interface.\n"
-"  The three first elements of the tuples are mandatory.\n"
-"  The fourth one is either the (unique!) number id of the item or, if 
followed by a fith element\n"
-"  (which must be the numid), an icon string identifier or integer icon 
value (e.g. returned by icon()...).\n"
-"  Note the item is optional.\n"
+"  ``[(identifier, name, description, icon, number), ...]``.\n"
+"\n"
+"  The first three elements of the tuples are mandatory.\n"
+"\n"
+"  :identifier: The identifier is used for Python access.\n"
+"  :name: Name for the interace.\n"
+"  :description: Used for documentation and tooltips.\n"
+"  :icon: An icon string identifier or integer icon value\n"
+" (e.g. returned by :class:`bpy.types.UILayout.icon`)\n"
+"  :number: Unique value used as the identifier for this item (stored in 
file data).\n"
+" Use when the identifier may need to change.\n"
+"\n"
+"  When an item only contains 4 items they define ``(identifier, name, 
description, number)``.\n"
+"\n"
 "  For dynamic values a callback can be passed which returns a list in\n"
 "  the same format as the static list.\n"
-"  This function must take 2 arguments (self, context), **context may be 
None**.\n"
-"  WARNING: There is a known bug with using a callback,\n"
-"  Python must keep a reference to the strings returned or Blender will 
crash.\n"
+"  This function must take 2 arguments ``(self, context)``, **context may 
be None**.\n"
+"\n"
+"  .. warning::\n"
+"\n"
+" There is a known bug with using a callback,\n"
+" Python must keep a reference to the strings returned or Blender will 
crash.\n"
+"\n"
 "   :type items: sequence of string tuples or a function\n"
 BPY_PROPDEF_NAME_DOC
 BPY_PROPDEF_DESC_DOC
@@ -2986,7 +2998,7 @@ static struct PyModuleDef props_module = {
"This module defines properties to extend Blender's internal data. The 
result of these functions"
" is used to assign properties to classes registered with Blender and 
can't be used directly.\n"
"\n"
-   ".. warning:: All parameters to these functions must be passed as 
keywords.\n",
+   ".. note:: All parameters to these functions must be passed as 
keywords.\n",
-1, /* multiple "initialization" just copies the module dict. */
props_methods,
NULL, NULL, NULL, NULL

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


[Bf-blender-cvs] [8a438de] soc-2016-pbvh-painting: Forgot to commit modified toolbar.

2016-07-18 Thread Nathan Vollmer
Commit: 8a438de61063c8512659fa4151756cae927efc00
Author: Nathan Vollmer
Date:   Mon Jul 18 12:50:35 2016 -0600
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB8a438de61063c8512659fa4151756cae927efc00

Forgot to commit modified toolbar.

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 42081ff..c7fcc95 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1607,7 +1607,7 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
 
 class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
 bl_category = "Tools"
-bl_label = "Symmetry/Lock"
+bl_label = "Symmetry / Lock"
 bl_options = {'DEFAULT_CLOSED'}
 
 @classmethod
@@ -1694,7 +1694,6 @@ class VIEW3D_PT_tools_brush_appearance(Panel, 
View3DPaintPanel):
 class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
 bl_category = "Tools"
 bl_context = "weightpaint"
-bl_options = {'DEFAULT_CLOSED'}
 bl_label = "Weight Tools"
 
 def draw(self, context):
@@ -1707,26 +1706,6 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
 props.use_reverse_transfer = True
 props.data_type = 'VGROUP_WEIGHTS'
 
-class VIEW3D_PT_weightpaint_symmetry(Panel, View3DPaintPanel):
-bl_category = "Tools"
-bl_context = "weightpaint"
-bl_options = {'DEFAULT_CLOSED'}
-bl_label = "Symmetry / Lock"
-
-def draw(self, context):
-layout = self.layout
-toolsettings = context.tool_settings
-wpaint = toolsettings.weight_paint
-
-col = layout.column(align=True)
-col.label(text="Mirror:")
-row = col.row(align=True)
-
-row.prop(wpaint, "use_symmetry_x", text="X", toggle=True)
-row.prop(wpaint, "use_symmetry_y", text="Y", toggle=True)
-row.prop(wpaint, "use_symmetry_z", text="Z", toggle=True)
-
-layout.column().prop(wpaint, "radial_symmetry", text="Radial")
 
 class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
 bl_category = "Options"

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


[Bf-blender-cvs] [0ad6424] soc-2016-pbvh-painting: Merge branch 'soc-2016-pbvh-painting' of git.blender.org:blender into soc-2016-pbvh-painting

2016-07-18 Thread Nathan Vollmer
Commit: 0ad6424548ab14ff661ecf29430c4cb64f40f009
Author: Nathan Vollmer
Date:   Mon Jul 18 12:51:00 2016 -0600
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB0ad6424548ab14ff661ecf29430c4cb64f40f009

Merge branch 'soc-2016-pbvh-painting' of git.blender.org:blender into 
soc-2016-pbvh-painting

===



===



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


[Bf-blender-cvs] [9e5635b] soc-2016-uv_tools: Compilefix for conflicting types

2016-07-18 Thread Jens Verwiebe
Commit: 9e5635b8a20564614019e2b021687581ba16a08e
Author: Jens Verwiebe
Date:   Mon Jul 18 19:46:59 2016 +0200
Branches: soc-2016-uv_tools
https://developer.blender.org/rB9e5635b8a20564614019e2b021687581ba16a08e

Compilefix for conflicting types

===

M   source/blender/editors/uvedit/uvedit_parametrizer.h

===

diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.h 
b/source/blender/editors/uvedit/uvedit_parametrizer.h
index 3698c52..710d4fd 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.h
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.h
@@ -1,3 +1,4 @@
+
 /*
  * * BEGIN GPL LICENSE BLOCK *
  *
@@ -105,7 +106,7 @@ void param_pack(ParamHandle *handle, float margin, bool 
do_rotate);
 /* Packing 2.0 */
 
 void param_irregular_pack_begin(ParamHandle *handle);
-void param_irregular_pack_iter(ParamHandle *handle, float *w_area, int seed);
+void param_irregular_pack_iter(ParamHandle *handle, float *w_area, unsigned 
int seed);
 void param_irregular_pack_end(ParamHandle *handle);
 
 /* Average area for all charts */

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


[Bf-blender-cvs] [de0f371] master: Fix missing release w/ mouse wheel over layer menu

2016-07-18 Thread Campbell Barton
Commit: de0f371528af8eef2d243091459ce617582a3416
Author: Campbell Barton
Date:   Tue Jul 19 02:41:50 2016 +1000
Branches: master
https://developer.blender.org/rBde0f371528af8eef2d243091459ce617582a3416

Fix missing release w/ mouse wheel over layer menu

===

M   source/blender/editors/space_image/image_buttons.c

===

diff --git a/source/blender/editors/space_image/image_buttons.c 
b/source/blender/editors/space_image/image_buttons.c
index a2db682..8347bd6 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -575,6 +575,8 @@ static bool ui_imageuser_layer_menu_step(bContext *C, int 
direction, void *rnd_p
BLI_assert(0);
}
 
+   BKE_image_release_renderresult(scene, image);
+
if (changed) {
BKE_image_multilayer_index(rr, iuser);
WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);

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


[Bf-blender-cvs] [a99dbb9] master: Fix T48885: Wheel in image space changes wrong window

2016-07-18 Thread Campbell Barton
Commit: a99dbb9aa027c3b8ef60bd4e15fcc6104e2fed70
Author: Campbell Barton
Date:   Tue Jul 19 02:44:14 2016 +1000
Branches: master
https://developer.blender.org/rBa99dbb9aa027c3b8ef60bd4e15fcc6104e2fed70

Fix T48885: Wheel in image space changes wrong window

===

M   source/blender/editors/space_image/image_buttons.c

===

diff --git a/source/blender/editors/space_image/image_buttons.c 
b/source/blender/editors/space_image/image_buttons.c
index 8347bd6..38a54ad 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -345,6 +345,13 @@ struct ImageUI_Data {
int rpass_index;
 };
 
+static struct ImageUI_Data *ui_imageuser_data_copy(const struct ImageUI_Data 
*rnd_pt_src)
+{
+   struct ImageUI_Data *rnd_pt_dst = MEM_mallocN(sizeof(*rnd_pt_src), 
__func__);
+   memcpy(rnd_pt_dst, rnd_pt_src, sizeof(*rnd_pt_src));
+   return rnd_pt_dst;
+}
+
 static void ui_imageuser_layer_menu(bContext *UNUSED(C), uiLayout *layout, 
void *rnd_pt)
 {
struct ImageUI_Data *rnd_data = rnd_pt;
@@ -532,9 +539,10 @@ static void ui_imageuser_view_menu_multiview(bContext 
*UNUSED(C), uiLayout *layo
 }
 
 /* 5 layer button callbacks... */
-static void image_multi_cb(bContext *C, void *rr_v, void *iuser_v) 
+static void image_multi_cb(bContext *C, void *rnd_pt, void *rr_v)
 {
-   ImageUser *iuser = iuser_v;
+   struct ImageUI_Data *rnd_data = rnd_pt;
+   ImageUser *iuser = rnd_data->iuser;
 
BKE_image_multilayer_index(rr_v, iuser);
WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
@@ -664,10 +672,11 @@ static bool ui_imageuser_pass_menu_step(bContext *C, int 
direction, void *rnd_pt
 }
 
 /* 5 view button callbacks... */
-static void image_multiview_cb(bContext *C, void *ima_v, void *iuser_v)
+static void image_multiview_cb(bContext *C, void *rnd_pt, void *UNUSED(arg_v))
 {
-   Image *ima = ima_v;
-   ImageUser *iuser = iuser_v;
+   struct ImageUI_Data *rnd_data = rnd_pt;
+   Image *ima = rnd_data->image;
+   ImageUser *iuser = rnd_data->iuser;
 
BKE_image_multiview_index(ima, iuser);
WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
@@ -694,7 +703,7 @@ static void uiblock_layer_pass_buttons(
 uiLayout *layout, Image *image, RenderResult *rr, ImageUser *iuser, 
int w,
 short *render_slot)
 {
-   static struct ImageUI_Data rnd_pt;  /* XXX, workaround */
+   struct ImageUI_Data rnd_pt_local, *rnd_pt = NULL;
uiBlock *block = uiLayoutGetBlock(layout);
uiBut *but;
RenderLayer *rl = NULL;
@@ -710,10 +719,10 @@ static void uiblock_layer_pass_buttons(
wmenu2 = (3 * w) / 5;
wmenu3 = (3 * w) / 6;
wmenu4 = (3 * w) / 6;
-   
-   rnd_pt.image = image;
-   rnd_pt.iuser = iuser;
-   rnd_pt.rpass_index = 0;
+
+   rnd_pt_local.image = image;
+   rnd_pt_local.iuser = iuser;
+   rnd_pt_local.rpass_index = 0;
 
/* menu buts */
if (render_slot) {
@@ -725,10 +734,12 @@ static void uiblock_layer_pass_buttons(
BLI_snprintf(str, sizeof(str), IFACE_("Slot %d"), 
*render_slot + 1);
}
 
+   rnd_pt = ui_imageuser_data_copy(_pt_local);
but = uiDefMenuBut(block, ui_imageuser_slot_menu, image, str, 
0, 0, wmenu1, UI_UNIT_Y, TIP_("Select Slot"));
UI_but_func_menu_step_set(but, ui_imageuser_slot_menu_step);
-   UI_but_func_set(but, image_multi_cb, rr, iuser);
+   UI_but_funcN_set(but, image_multi_cb, rnd_pt, rr);
UI_but_type_set_menu_from_pulldown(but);
+   rnd_pt = NULL;
}
 
if (rr) {
@@ -740,15 +751,18 @@ static void uiblock_layer_pass_buttons(
fake_name = ui_imageuser_layer_fake_name(rr);
rpass_index = iuser->layer  - (fake_name ? 1 : 0);
rl = BLI_findlink(>layers, rpass_index);
-   rnd_pt.rpass_index = rpass_index;
+   rnd_pt_local.rpass_index = rpass_index;
 
if (RE_layers_have_name(rr)) {
display_name = rl ? rl->name : (fake_name ? fake_name : 
"");
-   but = uiDefMenuBut(block, ui_imageuser_layer_menu, 
_pt, display_name,
-  0, 0, wmenu2, UI_UNIT_Y, 
TIP_("Select Layer"));
+   rnd_pt = ui_imageuser_data_copy(_pt_local);
+   but = uiDefMenuBut(
+   block, ui_imageuser_layer_menu, rnd_pt, 
display_name,
+   0, 0, wmenu2, UI_UNIT_Y, TIP_("Select Layer"));
UI_but_func_menu_step_set(but, 
ui_imageuser_layer_menu_step);
-   UI_but_func_set(but, image_multi_cb, rr, iuser);
+   

[Bf-blender-cvs] [a9758d7] soc-2016-multiview: move correspondence link code to correspondence mode

2016-07-18 Thread Tianwei Shen
Commit: a9758d75f2dc946702846957a9cb35f9241928f4
Author: Tianwei Shen
Date:   Mon Jul 18 23:58:49 2016 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rBa9758d75f2dc946702846957a9cb35f9241928f4

move correspondence link code to correspondence mode

===

M   release/scripts/startup/bl_ui/space_clip.py
M   source/blender/editors/space_clip/tracking_ops_correspondence.c

===

diff --git a/release/scripts/startup/bl_ui/space_clip.py 
b/release/scripts/startup/bl_ui/space_clip.py
index 6a081bf..662821c 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -279,6 +279,16 @@ class CLIP_PT_tracking_panel:
 return clip and sc.mode == 'TRACKING' and sc.view == 'CLIP'
 
 
+class CLIP_PT_correspondence_panel:
+
+@classmethod
+def poll(cls, context):
+sc = context.space_data
+clip = sc.clip
+
+return clip and sc.mode == 'CORRESPONDENCE' and sc.view == 'CLIP'
+
+
 class CLIP_PT_reconstruction_panel:
 
 @classmethod
@@ -454,7 +464,7 @@ class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel):
 row.operator("clip.join_tracks", text="Join Tracks")
 
 
-class CLIP_PT_tools_correspondence(CLIP_PT_tracking_panel, Panel):
+class CLIP_PT_tools_correspondence(CLIP_PT_correspondence_panel, Panel):
 bl_space_type = 'CLIP_EDITOR'
 bl_region_type = 'TOOLS'
 bl_label = "Correspondence"
diff --git a/source/blender/editors/space_clip/tracking_ops_correspondence.c 
b/source/blender/editors/space_clip/tracking_ops_correspondence.c
index 608d637..d130ac4 100644
--- a/source/blender/editors/space_clip/tracking_ops_correspondence.c
+++ b/source/blender/editors/space_clip/tracking_ops_correspondence.c
@@ -134,7 +134,7 @@ void CLIP_OT_add_correspondence(wmOperatorType *ot)
 
/* api callbacks */
ot->exec = add_correspondence_exec;
-   ot->poll = ED_space_clip_tracking_poll;
+   ot->poll = ED_space_clip_correspondence_poll;
 
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -183,7 +183,7 @@ void CLIP_OT_delete_correspondence(wmOperatorType *ot)
/* api callbacks */
ot->invoke = WM_operator_confirm;
ot->exec = delete_correspondence_exec;
-   ot->poll = ED_space_clip_tracking_poll;
+   ot->poll = ED_space_clip_correspondence_poll;
 
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -466,7 +466,7 @@ void CLIP_OT_solve_multiview(wmOperatorType *ot)
ot->exec = solve_multiview_exec;
ot->invoke = solve_multiview_invoke;
ot->modal = solve_multiview_modal;
-   ot->poll = ED_space_clip_tracking_poll;
+   ot->poll = ED_space_clip_correspondence_poll;
 
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;

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


[Bf-blender-cvs] [a0ed1f2] soc-2016-multiview: Merge branch 'master' into soc-2016-multiview

2016-07-18 Thread Tianwei Shen
Commit: a0ed1f29def84839c0f2acfa10dee10d8650cad0
Author: Tianwei Shen
Date:   Mon Jul 18 20:28:47 2016 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rBa0ed1f29def84839c0f2acfa10dee10d8650cad0

Merge branch 'master' into soc-2016-multiview

===



===



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


[Bf-blender-cvs] [95e2685] soc-2016-uv_tools: Merge remote-tracking branch 'origin/master' into soc-2016-uv_tools

2016-07-18 Thread Phil Gosch
Commit: 95e2685020bfa9357ec3521ce1fa2ac91bca159f
Author: Phil Gosch
Date:   Mon Jul 18 17:29:19 2016 +0200
Branches: soc-2016-uv_tools
https://developer.blender.org/rB95e2685020bfa9357ec3521ce1fa2ac91bca159f

Merge remote-tracking branch 'origin/master' into soc-2016-uv_tools

===



===



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


[Bf-blender-cvs] [97c2b66] soc-2016-uv_tools: WIP: Simulated Annealing

2016-07-18 Thread Phil Gosch
Commit: 97c2b665ad13efdc31cd24c5639f76385316d1a8
Author: Phil Gosch
Date:   Mon Jul 18 17:28:13 2016 +0200
Branches: soc-2016-uv_tools
https://developer.blender.org/rB97c2b665ad13efdc31cd24c5639f76385316d1a8

WIP: Simulated Annealing

Basics of the simulated annealing approach to iteratively find the optimal 
packing solution

===

M   source/blender/editors/uvedit/uvedit_parametrizer.c
M   source/blender/editors/uvedit/uvedit_parametrizer.h
M   source/blender/editors/uvedit/uvedit_unwrap_ops.c

===

diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c 
b/source/blender/editors/uvedit/uvedit_parametrizer.c
index c03580d..e64c292 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -5304,7 +5304,8 @@ bool p_chart_pack_individual(PHandle *phandle,  PChart 
*item)
}
MEM_freeN(nfps);
printf("-freeing stuff done!\n");
-   /* p_flush_uvs(phandle, item); */ /* ToDo SaphireS: Needs update to 
work ... */
+   p_flush_uvs(phandle, item);  /* ToDo SaphireS: Needs update to work ... 
*/
+
 
return found;
 }
@@ -5386,6 +5387,12 @@ bool p_compute_packing_solution(PHandle *phandle /* ToDo 
SaphireS: Simulated Ann
}
}
 
+   /* Un-set placed property of charts so next iteration works as expected 
*/
+   for (i = 0; i < phandle->ncharts; i++) {
+   chart = phandle->charts[i];
+   chart->u.ipack.convex_hull->placed = false;
+   }
+
return true;
 }
 
@@ -5414,6 +5421,9 @@ void param_irregular_pack_begin(ParamHandle *handle)
p_face_backup_uvs(f);
}
 
+   /* Set initial scale of charts */
+   /* ToDo SaphireS: Idea: set initial scale so that combined 
chart area is about 1.0 of UV area */
+
/* Compute convex hull for each chart -> CW */
chart->u.ipack.convex_hull = p_convex_hull_new(chart);
 
@@ -5439,24 +5449,22 @@ void param_irregular_pack_begin(ParamHandle *handle)
 
 }
 
-void param_irregular_pack_iter(ParamHandle *handle, float *w_area)
+void param_irregular_pack_iter(ParamHandle *handle, float *w_area, unsigned 
int seed)
 {
PHandle *phandle = (PHandle *)handle;
 
-   param_assert(phandle->state == PHANDLE_STATE_PACK);
-
-   /* ToDo (SaphireS): packing solution computation */
+   BLI_rng_seed(phandle->rng, seed);
 
-   /* Compute inner fit polygon */
+   param_assert(phandle->state == PHANDLE_STATE_PACK);
 
-   /* For every chart: */
+   /* Set initial scale of charts so finding a better solution is possible 
*/
 
-   /*Compute no-fit polygon for current chart against all placed 
charts so far */
-   /*This includes a decomposition of non-convex shapes into convex 
ones */
 
-   /*Compute collision-free area for current chart */
+   /* ToDo (SaphireS): packing solution computation */
 
-   /*Place chart according to parameters from simulated annealing 
algorithm */
+   if (p_compute_packing_solution(phandle)) {
+   printf("packing solution 
found-\n");
+   }
 
float used_area = p_face_uv_area_combined(handle);
 
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.h 
b/source/blender/editors/uvedit/uvedit_parametrizer.h
index 1460b22..3698c52 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.h
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.h
@@ -105,7 +105,7 @@ void param_pack(ParamHandle *handle, float margin, bool 
do_rotate);
 /* Packing 2.0 */
 
 void param_irregular_pack_begin(ParamHandle *handle);
-void param_irregular_pack_iter(ParamHandle *handle, float *w_area);
+void param_irregular_pack_iter(ParamHandle *handle, float *w_area, int seed);
 void param_irregular_pack_end(ParamHandle *handle);
 
 /* Average area for all charts */
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c 
b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 9f9cf7a..deeaca1 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -46,6 +46,7 @@
 #include "BLI_utildefines.h"
 #include "BLI_alloca.h"
 #include "BLI_math.h"
+#include "BLI_rand.h"
 #include "BLI_uvproject.h"
 #include "BLI_string.h"
 
@@ -828,6 +829,15 @@ void UV_OT_pack_islands(wmOperatorType *ot)
 
 /*  Pack Islands operator 2.0  */
 
+typedef struct SimulatedAnnealing {
+   RNG *rng;
+   int seed;
+   float theta;
+   float f;
+   float r;
+   float temperature;
+} SimulatedAnnealing;
+
 typedef struct PackIslands {
Scene *scene;
Object *obedit;
@@ -837,6 +847,7 @@ typedef struct PackIslands {
int i, iterations;
 

[Bf-blender-cvs] [44efcdd] strand_gpu: Fix incorrect tangent calculations for the "curl" effect.

2016-07-18 Thread Lukas Tönne
Commit: 44efcddec5da4754a7d06086ad5a6d976f580cd1
Author: Lukas Tönne
Date:   Mon Jul 18 17:16:19 2016 +0200
Branches: strand_gpu
https://developer.blender.org/rB44efcddec5da4754a7d06086ad5a6d976f580cd1

Fix incorrect tangent calculations for the "curl" effect.

The result for tangents under a mix transformation is essentially a mix
of the original and target tangents, plus a shape correction term.

===

M   source/blender/gpu/shaders/gpu_shader_strand_debug_geom.glsl
M   source/blender/gpu/shaders/gpu_shader_strand_debug_vert.glsl
M   source/blender/gpu/shaders/gpu_shader_strand_effects.glsl

===

diff --git a/source/blender/gpu/shaders/gpu_shader_strand_debug_geom.glsl 
b/source/blender/gpu/shaders/gpu_shader_strand_debug_geom.glsl
index 5a44cd7..0829a42 100644
--- a/source/blender/gpu/shaders/gpu_shader_strand_debug_geom.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_strand_debug_geom.glsl
@@ -1,12 +1,13 @@
-#define MAX_CURVE_VERTS 8
-
 layout(points) in;
-layout(line_strip, max_vertices = MAX_CURVE_VERTS) out;
+layout(line_strip, max_vertices = 16) out;
 
 uniform float debug_scale;
 
+in float vCurveParam[];
 in vec3 vPosition[];
+in vec3 vOldPosition[];
 in vec3 vTangent[];
+in vec3 vOldTangent[];
 in vec3 vTargetPosition[];
 in mat3 vTargetFrame[];
 in vec3 vColor[];
@@ -24,24 +25,62 @@ void main()
 {
fColor = vColor[0];
 
-   vec3 co = vPosition[0].xyz;
-
-   emit_vertex(co, vec3(1.0, 0.0, 1.0));
-   emit_vertex(co + vTangent[0] * debug_scale, vec3(1.0, 0.0, 1.0));
-   EndPrimitive();
-
+   vec3 loc = vPosition[0];
+   vec3 oldloc = vOldPosition[0];
+   vec3 nor = vTangent[0];
+   vec3 oldnor = vOldTangent[0];
vec3 target_loc = vTargetPosition[0];
mat3 target_frame = vTargetFrame[0];
vec3 red = vec3(1, 0, 0);
vec3 green = vec3(0, 1, 0);
vec3 blue = vec3(0, 0, 1);
-   emit_vertex(target_loc, red);
-   emit_vertex(target_loc + target_frame[0] * debug_scale, red);
+   vec3 magenta = vec3(1, 0, 1);
+   vec3 yellow = vec3(1, 1, 0);
+   vec3 cyan = vec3(0, 1, 1);
+
+#if 1
+   emit_vertex(loc, magenta);
+   emit_vertex(loc + vTangent[0] * debug_scale, magenta);
+   EndPrimitive();
+#endif
+
+#if 1
+   emit_vertex(loc, red);
+   emit_vertex(loc + target_frame[0] * debug_scale, red);
EndPrimitive();
-   emit_vertex(target_loc, green);
-   emit_vertex(target_loc + target_frame[1] * debug_scale, green);
+   emit_vertex(loc, green);
+   emit_vertex(loc + target_frame[1] * debug_scale, green);
EndPrimitive();
-   emit_vertex(target_loc, blue);
-   emit_vertex(target_loc + target_frame[2] * debug_scale, blue);
+   emit_vertex(loc, blue);
+   emit_vertex(loc + target_frame[2] * debug_scale, blue);
+   EndPrimitive();
+#endif
+
+   CurlParams params = curl_params(vCurveParam[0], 1.0, target_loc, 
target_frame);
+   
+#if 0
+   vec3 dcurl = (params.dcurlvec - nor) * params.factor;
+   vec3 dshape = (target_loc + params.curlvec - loc) * params.dfactor;
+   emit_vertex(loc, cyan);
+   emit_vertex(loc + dcurl * debug_scale, cyan);
+   EndPrimitive();
+   emit_vertex(loc, yellow);
+   emit_vertex(loc + dshape * debug_scale, yellow);
+   EndPrimitive();
+
+   emit_vertex(loc, magenta);
+   emit_vertex(loc + (oldnor + dcurl + dshape) * debug_scale, magenta);
+   EndPrimitive();
+#endif
+
+#if 0
+   vec3 dloc = (target_loc + params.curlvec - loc) * params.factor;
+   vec3 nloc = loc + dloc;
+   vec3 dshape = dloc / (vCurveParam[0] * curl_shape);
+   vec3 dtarget = target_frame[2] + params.turns * params.dcurlvec;
+   vec3 nnor = normalize(dshape + mix(oldnor, dtarget, params.factor));
+   emit_vertex(loc, cyan);
+   emit_vertex(loc + nnor * debug_scale, cyan);
EndPrimitive();
+#endif
 }
diff --git a/source/blender/gpu/shaders/gpu_shader_strand_debug_vert.glsl 
b/source/blender/gpu/shaders/gpu_shader_strand_debug_vert.glsl
index 6640f71..5991b20 100644
--- a/source/blender/gpu/shaders/gpu_shader_strand_debug_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_strand_debug_vert.glsl
@@ -1,8 +1,11 @@
 in uint fiber_index;
 in float curve_param;
 
+out float vCurveParam;
 out vec3 vPosition;
+out vec3 vOldPosition;
 out vec3 vTangent;
+out vec3 vOldTangent;
 out vec3 vTargetPosition;
 out mat3 vTargetFrame;
 out vec3 vColor;
@@ -16,10 +19,15 @@ void main()
interpolate_vertex(int(fiber_index), curve_param, loc, nor, target_loc, 
target_frame);
 
// TODO define proper curve scale, independent of subdivision!
+   vec3 oldloc = loc;
+   vec3 oldnor = nor;
displace_vertex(loc, nor, curve_param, 1.0, target_loc, target_frame);
 
+   vCurveParam = curve_param;
vPosition = loc;
+   

[Bf-blender-cvs] [404f41d] master: [bf_intern_ghost/Windows] Cleanup

2016-07-18 Thread Ray Molenkamp
Commit: 404f41d22de46119ee8afb409011eb1ba1840092
Author: Ray Molenkamp
Date:   Mon Jul 18 15:48:16 2016 +0200
Branches: master
https://developer.blender.org/rB404f41d22de46119ee8afb409011eb1ba1840092

[bf_intern_ghost/Windows] Cleanup

This patch addresses the following issues in bf_intern_ghost

```
Warning C4312   'type cast': conversion from 'GHOST_TEmbedderWindowID' to 
'HWND' of greater sizebf_intern_ghost 
K:\BlenderGit\blender\intern\ghost\intern\GHOST_WindowWin32.cpp 179
Warning C4312   'type cast': conversion from 'GHOST_TEmbedderWindowID' to 
'HWND' of greater sizebf_intern_ghost 
K:\BlenderGit\blender\intern\ghost\intern\GHOST_WindowWin32.cpp 198
```

GHOST_TEmbedderWindowID is defined as long, handles are however of pointer size,
so this should have been an issue when we moved to 64 bits, guess we got lucky.
fixed by turning GHOST_TEmbedderWindowID from long into void*

```
Warning C4302   'reinterpret_cast': truncation from 'HKL' to 'LANGID'   
bf_intern_ghost K:\BlenderGit\blender\intern\ghost\intern\GHOST_ImeWin32.cpp
67
```

reinterpret_cast emits warnings on truncation, LOWORD does the job just
as well with no warnings.

```
Warning C4838   conversion from 'int' to 'DWORD' requires a narrowing 
conversionbf_intern_ghost 
K:\BlenderGit\blender\intern\ghost\intern\GHOST_ContextWGL.cpp  734
Warning C4838   conversion from 'int' to 'BYTE' requires a narrowing conversion 
bf_intern_ghost K:\BlenderGit\blender\intern\ghost\intern\GHOST_ContextWGL.cpp  
734
```

Weird warning, it does a really bad job at telling you what parameter is
causing the warning , tuns out there's a bunch of parameters that cause it
but it still only yields a single warning, the problem is that every
(somevar ? a : b) construct results in an integer type. which needs to be
properly cast to get rid of the warning.

```
Warning C4996   'GetVersionExA': was declared deprecatedbf_intern_ghost 
K:\BlenderGit\blender\intern\ghost\intern\GHOST_WindowWin32.cpp 105
Warning C4996   'GetVersionExA': was declared deprecatedbf_intern_ghost 
K:\BlenderGit\blender\intern\ghost\intern\GHOST_WindowWin32.cpp 107
```

The warning was clear, the code not as much. The version check in place
here is quite convoluted and could be replaced by including VersionHelpers.h
and calling IsWindows7OrGreater, However, CreateInstance will just return NULL
in m_Bar if the interface is not supported, so the whole check is useless.
This however did require that the CreateInstance call actually asked for
ITaskbarList3 and not ITaskBarlist . (You're not really allowed to assign
different interface types to each-other, a roundtrip through QueryInterface
is required there, we were violating spec here by asking for ITaskBarlist and
storing it in ITaskbarList3*  )

Reviewers: sergey

Reviewed By: sergey

Subscribers: sergey

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

===

M   intern/ghost/GHOST_Types.h
M   intern/ghost/intern/GHOST_ContextWGL.cpp
M   intern/ghost/intern/GHOST_ImeWin32.cpp
M   intern/ghost/intern/GHOST_WindowWin32.cpp

===

diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 7e77ba3..0dd5d15 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -530,7 +530,7 @@ typedef struct {
 
 
 #ifdef _WIN32
-typedef long GHOST_TEmbedderWindowID;
+typedef void* GHOST_TEmbedderWindowID;
 #endif // _WIN32
 
 #ifndef _WIN32
diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp 
b/intern/ghost/intern/GHOST_ContextWGL.cpp
index eeb6a24..abce3ea 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -707,6 +707,7 @@ int GHOST_ContextWGL::choose_pixel_format(
PIXELFORMATDESCRIPTOR preferredPFD = {
sizeof(PIXELFORMATDESCRIPTOR),   /* size */
1,   /* version */
+   (DWORD) (
PFD_SUPPORT_OPENGL |
PFD_DRAW_TO_WINDOW |
PFD_SWAP_COPY  | /* support swap copy */
@@ -717,16 +718,16 @@ int GHOST_ContextWGL::choose_pixel_format(
needAlpha ? PFD_SUPPORT_COMPOSITION :/* support composition 
for transparent background */
 #endif
0
-   ),
+   )),
PFD_TYPE_RGBA,   /* color type */
-   (needAlpha ? 32 : 24),   /* preferred color depth */
+   (BYTE) (needAlpha ? 32 : 24),   /* preferred color 
depth */
0, 0, 0, 0, 0, 0,/* color bits (ignored) */
-   needAlpha ? 8 : 0,   /* alpha buffer */
+   (BYTE) (needAlpha ? 8 : 0),   /* alpha buffer */
0,   /* alpha shift (ignored) */
0,   

[Bf-blender-cvs] [a76e69f] master: Additional Waveform Drawing Mode

2016-07-18 Thread Sergey Sharybin
Commit: a76e69f5f75c06dda6d35113d80b6b65dcc94ea0
Author: Sergey Sharybin
Date:   Mon Jul 18 15:28:56 2016 +0200
Branches: master
https://developer.blender.org/rBa76e69f5f75c06dda6d35113d80b6b65dcc94ea0

Additional Waveform Drawing Mode

This diff adds a 6th drawing mode to the Waveform Scope.

The new mode shows the RGB colour channels overlaid as a "Full colour" waveform.

The old "Red Green Blue" mode is renamed "Parade" which is the standard industry
term for RGB channels shown side-by-side.

This full colour style of waveform is very much more useful for colour grading 
than the
Parade mode and is the default waveform for many artists.

Files from older Blender versions which show scopes open as expected.

Patch by John Cox (johnedwardcox), thanks!

Reviewers: sergey

Reviewed By: sergey

Subscribers: campbellbarton, tmw, Blendify

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

===

M   source/blender/blenkernel/intern/colortools.c
M   source/blender/editors/interface/interface_draw.c
M   source/blender/makesdna/DNA_color_types.h
M   source/blender/makesrna/intern/rna_color.c

===

diff --git a/source/blender/blenkernel/intern/colortools.c 
b/source/blender/blenkernel/intern/colortools.c
index 2932939..4089475 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -982,6 +982,7 @@ static void save_sample_line(Scopes *scopes, const int idx, 
const float fx, cons
/* waveform */
switch (scopes->wavefrm_mode) {
case SCOPES_WAVEFRM_RGB:
+   case SCOPES_WAVEFRM_RGB_PARADE:
scopes->waveform_1[idx + 0] = fx;
scopes->waveform_1[idx + 1] = rgb[0];
scopes->waveform_2[idx + 0] = fx;
@@ -1265,6 +1266,8 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const 
ColorManagedViewSettings *
 
switch (scopes->wavefrm_mode) {
case SCOPES_WAVEFRM_RGB:
+   //break;
+   case SCOPES_WAVEFRM_RGB_PARADE:
ycc_mode = -1;
break;
case SCOPES_WAVEFRM_LUMA:
diff --git a/source/blender/editors/interface/interface_draw.c 
b/source/blender/editors/interface/interface_draw.c
index 72a6a04..9ce863d 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -734,24 +734,50 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, 
uiWidgetColors *UNUSED(wcol),
CLAMP(max, rect.ymin, rect.ymax);
fdrawline(rect.xmax - 3, min, rect.xmax - 3, max);
}
+   /* RGB (3 channel) */
+   else if (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB) {
+   glBlendFunc(GL_ONE, GL_ONE);
+
+   glEnableClientState(GL_VERTEX_ARRAY);
+
+   glPushMatrix();
+
+   glTranslatef(rect.xmin, yofs, 0.f);
+   glScalef(w, h, 0.f);
+
+   glColor3fv( colors_alpha[0] );
+   glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_1);
+   glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
+
+   glColor3fv( colors_alpha[1] );
+   glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_2);
+   glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
 
-   /* RGB / YCC (3 channels) */
+   glColor3fv( colors_alpha[2] );
+   glVertexPointer(2, GL_FLOAT, 0, scopes->waveform_3);
+   glDrawArrays(GL_POINTS, 0, scopes->waveform_tot);
+
+   glDisableClientState(GL_VERTEX_ARRAY);
+   glPopMatrix();
+   }
+   /* PARADE / YCC (3 channels) */
else if (ELEM(scopes->wavefrm_mode,
- SCOPES_WAVEFRM_RGB,
+ SCOPES_WAVEFRM_RGB_PARADE,
  SCOPES_WAVEFRM_YCC_601,
  SCOPES_WAVEFRM_YCC_709,
- SCOPES_WAVEFRM_YCC_JPEG))
+ SCOPES_WAVEFRM_YCC_JPEG
+ ))
{
-   int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB);
-   
+   int rgb = (scopes->wavefrm_mode == 
SCOPES_WAVEFRM_RGB_PARADE);
+
glBlendFunc(GL_ONE, GL_ONE);
-   
+
glPushMatrix();
glEnableClientState(GL_VERTEX_ARRAY);
-   
+
glTranslatef(rect.xmin, yofs, 0.f);
glScalef(w3, h, 0.f);
-   

[Bf-blender-cvs] [3e882c9] master: [MSVC2015/Cycles] MSVC2015 before update 3 produce invalid builds

2016-07-18 Thread Ray Molenkamp
Commit: 3e882c91e0fad343d6b8590ae1c391488cd5160d
Author: Ray Molenkamp
Date:   Mon Jul 18 15:24:46 2016 +0200
Branches: master
https://developer.blender.org/rB3e882c91e0fad343d6b8590ae1c391488cd5160d

[MSVC2015/Cycles] MSVC2015 before update 3 produce invalid builds

I'm not quite sure where the codegen bug gets triggered but it's easily
noticeable in the barcelona scene. (extra saturated leafs and illumination
on the right ledge of the pool)

2013 buildbot reference image:
{F320792}

2015 With no updates (compiler version 19.00.23026)
{F320793}

2015 With Update 2 (Compiler version 19.00.23918)
{F320794}

2015 With Update 3 (Compiler version 19.00.24210)
{F320795}

This patch blocks all compiler builds before update 3 in a similar way we
did for msvc 2013 update 4

Reviewers: campbellbarton, brecht, juicyfruit

Reviewed By: juicyfruit

Tags: #bf_blender

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

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59ddd97..1dfa838 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1283,11 +1283,21 @@ elseif(WIN32)
 
if(MSVC)
# Minimum MSVC Version
-   set(_min_ver "18.0.31101")
-   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver})
-   message(FATAL_ERROR
-   "Visual Studio 2013 (Update 4, ${_min_ver}) 
required, "
-   "found (${CMAKE_CXX_COMPILER_VERSION})")
+   if(MSVC_VERSION EQUAL 1800)
+   set(_min_ver "18.0.31101")
+   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver})
+   message(FATAL_ERROR
+   "Visual Studio 2013 (Update 4, 
${_min_ver}) required, "
+   "found (${CMAKE_CXX_COMPILER_VERSION})")
+   endif()
+   endif()
+   if(MSVC_VERSION EQUAL 1900)
+   set(_min_ver "19.0.24210")
+   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver})
+   message(FATAL_ERROR
+   "Visual Studio 2015 (Update 3, 
${_min_ver}) required, "
+   "found (${CMAKE_CXX_COMPILER_VERSION})")
+   endif()
endif()
unset(_min_ver)

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


[Bf-blender-cvs] [6239afd] master: [MSVC/LNK4199/Cleanup] Delay loading is causing linker warnings.

2016-07-18 Thread Ray Molenkamp
Commit: 6239afd36f9216f7944d1320fa8f19cc802b3a19
Author: Ray Molenkamp
Date:   Mon Jul 18 15:16:45 2016 +0200
Branches: master
https://developer.blender.org/rB6239afd36f9216f7944d1320fa8f19cc802b3a19

[MSVC/LNK4199/Cleanup] Delay loading is causing linker warnings.

We recently added delay-loading of the openmp dll's so we no longer had to use
the stub loader, we however put these linker flags on the global linker flags
causing any sub projects not using openmp to spit linker warning 4199 while 
building,

```
Warning LNK4199 /DELAYLOAD:vcomp140.dll ignored; no imports found from 
vcomp140.dll datatoc 
k:\BlenderGit\build_windows_2015a\source\blender\datatoc\LINK   1
```

This patch makes the delay-load only apply to the blender project.

Reviewers: sergey

Subscribers: sergey

Tags: #bf_blender

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

===

M   CMakeLists.txt
M   build_files/cmake/macros.cmake

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c933d3..59ddd97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1353,17 +1353,6 @@ elseif(WIN32)
 
set(PLATFORM_LINKFLAGS_DEBUG "/IGNORE:4099 
/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libc.lib")
 
-   # Use dynamic loading for OpenMP
-   if(WITH_OPENMP)
-   if(MSVC_VERSION EQUAL 1800)
-   set(OPENMP_DLL_NAME "vcomp120")
-   else()
-   set(OPENMP_DLL_NAME "vcomp140")
-   endif()
-   set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} 
/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
-   set(PLATFORM_LINKFLAGS_DEBUG 
"${PLATFORM_LINKFLAGS_DEBUG} /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib")
-   endif()
-
if(NOT DEFINED LIBDIR)
 
# Setup 64bit and 64bit windows systems
@@ -3162,6 +3151,14 @@ add_subdirectory(tests)
 # CPack for generating packages
 include(build_files/cmake/packaging.cmake)
 
+#-
+# Use dynamic loading for OpenMP
+if(WITH_BLENDER)
+   openmp_delayload(blender)
+endif(WITH_BLENDER)
+if(WITH_PLAYER)
+   openmp_delayload(blenderplayer)
+endif(WITH_PLAYER)
 
 #-
 # Print Final Configuration
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 5ffd6c4..f57a695 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -1547,3 +1547,21 @@ function(print_all_vars)
message("${_var}=${${_var}}")
endforeach()
 endfunction()
+
+macro(openmp_delayload
+   projectname
+   )
+   if(MSVC)
+   if(WITH_OPENMP)
+   if(MSVC_VERSION EQUAL 1800)
+   set(OPENMP_DLL_NAME "vcomp120")
+   else()
+   set(OPENMP_DLL_NAME "vcomp140")
+   endif()
+   SET_TARGET_PROPERTIES(${projectname} PROPERTIES 
LINK_FLAGS_RELEASE "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
+   SET_TARGET_PROPERTIES(${projectname} PROPERTIES 
LINK_FLAGS_DEBUG "/DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib")
+   SET_TARGET_PROPERTIES(${projectname} PROPERTIES 
LINK_FLAGS_RELWITHDEBINFO "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
+   SET_TARGET_PROPERTIES(${projectname} PROPERTIES 
LINK_FLAGS_MINSIZEREL "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib")
+   endif(WITH_OPENMP)
+   endif(MSVC)
+endmacro()

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


[Bf-blender-cvs] [8eab7ac] soc-2016-pbvh-painting: Merge branch 'master' into soc-2016-pbvh-painting

2016-07-18 Thread Bastien Montagne
Commit: 8eab7ace33924eabda5d671344341e1dcc82d4de
Author: Bastien Montagne
Date:   Mon Jul 18 14:55:20 2016 +0200
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB8eab7ace33924eabda5d671344341e1dcc82d4de

Merge branch 'master' into soc-2016-pbvh-painting

===



===



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


[Bf-blender-cvs] [65e7caf] master: Fix (unreported) ED_region_tag_redraw_partial() could override a previously defined partial redraw, instead of extending it.

2016-07-18 Thread Bastien Montagne
Commit: 65e7caf950d94496caf3a538ddfc3cc0683fd86d
Author: Bastien Montagne
Date:   Mon Jul 18 14:37:04 2016 +0200
Branches: master
https://developer.blender.org/rB65e7caf950d94496caf3a538ddfc3cc0683fd86d

Fix (unreported) ED_region_tag_redraw_partial() could override a previously 
defined partial redraw, instead of extending it.

Probably not an issue currently, since partial redraw is not much used
(only from sculpt code and box-rendering it seems?), but logic was broken here.

===

M   source/blender/editors/screen/area.c

===

diff --git a/source/blender/editors/screen/area.c 
b/source/blender/editors/screen/area.c
index ab8b7d4..8d058ed 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -580,15 +580,20 @@ void ED_region_tag_refresh_ui(ARegion *ar)
 void ED_region_tag_redraw_partial(ARegion *ar, const rcti *rct)
 {
if (ar && !(ar->do_draw & RGN_DRAWING)) {
-   if (!(ar->do_draw & RGN_DRAW)) {
+   if (!(ar->do_draw & (RGN_DRAW | RGN_DRAW_PARTIAL))) {
/* no redraw set yet, set partial region */
ar->do_draw |= RGN_DRAW_PARTIAL;
ar->drawrct = *rct;
}
else if (ar->drawrct.xmin != ar->drawrct.xmax) {
+   BLI_assert((ar->do_draw & RGN_DRAW_PARTIAL) != 0);
/* partial redraw already set, expand region */
BLI_rcti_union(>drawrct, rct);
}
+   else {
+   BLI_assert((ar->do_draw & RGN_DRAW) != 0);
+   /* Else, full redraw is already requested, nothing to 
do here. */
+   }
}
 }

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


[Bf-blender-cvs] [bbc1507] master: Fix T48848: Cycles - Camera Culling - Camera Culling removes objects which are still in frame

2016-07-18 Thread Sergey Sharybin
Commit: bbc15078710a15642982bd4e72e973b1d496598c
Author: Sergey Sharybin
Date:   Mon Jul 18 14:29:37 2016 +0200
Branches: master
https://developer.blender.org/rBbbc15078710a15642982bd4e72e973b1d496598c

Fix T48848: Cycles - Camera Culling - Camera Culling removes objects which are 
still in frame

===

M   intern/cycles/blender/blender_object.cpp

===

diff --git a/intern/cycles/blender/blender_object.cpp 
b/intern/cycles/blender/blender_object.cpp
index 80768c0..ede8c47 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -253,11 +253,10 @@ static bool object_boundbox_clip(Scene *scene,
   boundbox[3 * i + 1],
   boundbox[3 * i + 2]);
p = transform_point(, p);
-   p = transform_point(, p);
+   p = transform_perspective(, p);
if(p.z >= -margin) {
all_behind = false;
}
-   p /= p.z;
bb_min = min(bb_min, p);
bb_max = max(bb_max, p);
}

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


[Bf-blender-cvs] [6533d72] master: Fix T48877: Lightmap Pack fails w/ 1-3 faces

2016-07-18 Thread Campbell Barton
Commit: 6533d72056d1a0df85e05650f74885ae7e7d35a5
Author: Campbell Barton
Date:   Mon Jul 18 19:44:51 2016 +1000
Branches: master
https://developer.blender.org/rB6533d72056d1a0df85e05650f74885ae7e7d35a5

Fix T48877: Lightmap Pack fails w/ 1-3 faces

Unnecessary limit was applied.

===

M   release/scripts/startup/bl_operators/uvcalc_lightmap.py

===

diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py 
b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
index a120e2b..3b095c8 100644
--- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py
+++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
@@ -285,8 +285,7 @@ def lightmap_uvpack(meshes,
 for face_sel in face_groups:
 print("\nStarting unwrap")
 
-if len(face_sel) < 4:
-print("\tWarning, less then 4 faces, skipping")
+if not face_sel:
 continue
 
 pretty_faces = [prettyface(f) for f in face_sel if f.loop_total >= 4]

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


[Bf-blender-cvs] [d42cb44] master: CMake: correct py-module on OSX

2016-07-18 Thread Campbell Barton
Commit: d42cb44ea25edf5f47cfd2465a03d491d420f679
Author: Campbell Barton
Date:   Mon Jul 18 19:28:45 2016 +1000
Branches: master
https://developer.blender.org/rBd42cb44ea25edf5f47cfd2465a03d491d420f679

CMake: correct py-module on OSX

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index d843528..7acea43 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -246,7 +246,7 @@ if(WITH_PYTHON_MODULE)
set_target_properties(
blender
PROPERTIES
-   MACOSX_BUNDLE
+   MACOSX_BUNDLE TRUE
LINK_FLAGS_RELEASE "${PLATFORM_LINKFLAGS}"
LINK_FLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG}"
)

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


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

2016-07-18 Thread Campbell Barton
Commit: 9186b9ae4806f4bbc1a14417c408e844f8e8cc1a
Author: Campbell Barton
Date:   Mon Jul 18 19:25:44 2016 +1000
Branches: blender2.8
https://developer.blender.org/rB9186b9ae4806f4bbc1a14417c408e844f8e8cc1a

Merge branch 'master' into blender2.8

===



===

diff --cc source/blender/blenkernel/intern/library.c
index 978f1ac,2e06652..9b9b80a
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@@ -332,17 -332,20 +331,17 @@@ bool id_make_local(Main *bmain, ID *id
case ID_GR:
return false; /* not implemented */
case ID_AR:
-   if (!test) BKE_armature_make_local(bmain, (bArmature 
*)id);
+   if (!test) BKE_armature_make_local(bmain, (bArmature 
*)id, force_local);
return true;
case ID_AC:
-   if (!test) BKE_action_make_local(bmain, (bAction *)id);
+   if (!test) BKE_action_make_local(bmain, (bAction *)id, 
force_local);
return true;
case ID_NT:
-   if (!test) ntreeMakeLocal(bmain, (bNodeTree *)id, true);
+   if (!test) ntreeMakeLocal(bmain, (bNodeTree *)id, true, 
force_local);
return true;
case ID_BR:
-   if (!test) BKE_brush_make_local(bmain, (Brush *)id);
+   if (!test) BKE_brush_make_local(bmain, (Brush *)id, 
force_local);
return true;
 -  case ID_PA:
 -  if (!test) BKE_particlesettings_make_local(bmain, 
(ParticleSettings *)id, force_local);
 -  return true;
case ID_WM:
return false; /* can't be linked */
case ID_GD:
diff --cc source/blender/editors/space_view3d/view3d_edit.c
index 2b0bd76,b117a5e..83fde34
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@@ -3075,7 -3076,12 +3075,9 @@@ static int viewselected_exec(bContext *
else if (BKE_paint_select_face_test(ob)) {
ok = paintface_minmax(ob, min, max);
}
-   else if (ob && (ob->mode & (OB_MODE_SCULPT | OB_MODE_TEXTURE_PAINT))) {
 -  else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT)) {
 -  ok = PE_minmax(scene, min, max);
 -  }
+   else if (ob &&
+(ob->mode & (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | 
OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)))
+   {
BKE_paint_stroke_get_average(scene, ob, min);
copy_v3_v3(max, min);
ok = true;
diff --cc source/blender/editors/transform/transform_snap_object.c
index ed6d49d,c3adebe..724eba1
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@@ -1451,17 -1862,25 +1862,9 @@@ static bool snapObjectsRay
  {
bool retval = false;
  
-   float dvec[3];
-   sub_v3_v3v3(dvec, ray_start, ray_origin);
- 
-   const float ray_depth_range[2] = {
-   dot_v3v3(dvec, ray_normal),
-   *ray_depth,
-   };
- 
unsigned int ob_index = 0;
Object *obedit = use_object_edit_cage ? sctx->scene->obedit : NULL;
 -
 -  /* Need an exception for particle edit because the base is flagged with 
BA_HAS_RECALC_DATA
 -   * which makes the loop skip it, even the derived mesh will never change
 -   *
 -   * To solve that problem, we do it first as an exception.
 -   * */
Base *base_act = sctx->scene->basact;
 -  if (base_act && base_act->object && base_act->object->mode & 
OB_MODE_PARTICLE_EDIT) {
 -  Object *ob = base_act->object;
 -
 -  retval |= snapObject(
 -  sctx, ob, ob->obmat, ob_index++,
 -  false, snap_to, mval,
 -  ray_origin, ray_start, ray_normal, depth_range,
 -  ray_depth, dist_px,
 -  r_loc, r_no, r_index, r_ob, r_obmat, r_hit_list);
 -  }
  
bool ignore_object_selected = false, ignore_object_active = false;
switch (snap_select) {

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


[Bf-blender-cvs] [9946cca] master: Fix T48860: Cycles SSS artifacts with spatially split BVH

2016-07-18 Thread Sergey Sharybin
Commit: 9946cca14676bf07b3c7c103e99033fe1e4e423e
Author: Sergey Sharybin
Date:   Fri Jul 15 14:55:37 2016 +0200
Branches: master
https://developer.blender.org/rB9946cca14676bf07b3c7c103e99033fe1e4e423e

Fix T48860: Cycles SSS artifacts with spatially split BVH

The issue was caused by SSS intersection code gathering all
intersections without check for duplicated ones. This caused
situations when same intersection will be recorded twice in
the case if triangle is shared by several BVH nodes.

Usually this is handled by checking intersection distance
after sorting intersections (in shadow_blocked for example)
but for SSS we don't do such sorting and using number of
intersections to calculate various things.

Didn't find anything smarter than to check intersection
distance in triangle_intersect_subsurface().

This solves render artifacts in the cost of 1.5% slowdown
of extreme case rendering (SSS object filling in whole
FullHD screen).

Reviewers: brecht

Reviewed By: brecht

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

===

M   intern/cycles/kernel/geom/geom_triangle_intersect.h

===

diff --git a/intern/cycles/kernel/geom/geom_triangle_intersect.h 
b/intern/cycles/kernel/geom/geom_triangle_intersect.h
index fc081bd..720ee6a 100644
--- a/intern/cycles/kernel/geom/geom_triangle_intersect.h
+++ b/intern/cycles/kernel/geom/geom_triangle_intersect.h
@@ -255,6 +255,13 @@ ccl_device_inline void triangle_intersect_subsurface(
/* Normalize U, V, W, and T. */
const float inv_det = 1.0f / det;
 
+   const float t = T * inv_det;
+   for(int i = min(max_hits, ss_isect->num_hits); i >= 0; --i) {
+   if(ss_isect->hits[i].t == t) {
+   return;
+   }
+   }
+
ss_isect->num_hits++;
int hit;
 
@@ -277,7 +284,7 @@ ccl_device_inline void triangle_intersect_subsurface(
isect->type = PRIMITIVE_TRIANGLE;
isect->u = U * inv_det;
isect->v = V * inv_det;
-   isect->t = T * inv_det;
+   isect->t = t;
 
/* Record geometric normal. */
/* TODO(sergey): Use float4_to_float3() on just an edges. */

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


[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61692] trunk/lib/tests/cycles/ctests/reports: Cycles tests: Add test for SSS and spatial split BVH

2016-07-18 Thread Sergey Sharybin
Revision: 61692
  https://developer.blender.org/rBL61692
Author:   sergey
Date: 2016-07-18 10:46:37 +0200 (Mon, 18 Jul 2016)
Log Message:
---
Cycles tests: Add test for SSS and spatial split BVH

Added Paths:
---
trunk/lib/tests/cycles/ctests/reports/T48860.blend
trunk/lib/tests/cycles/ctests/reports/reference_renders/T48860.png

Added: trunk/lib/tests/cycles/ctests/reports/T48860.blend
===
(Binary files differ)

Index: trunk/lib/tests/cycles/ctests/reports/T48860.blend
===
--- trunk/lib/tests/cycles/ctests/reports/T48860.blend  2016-07-12 11:41:07 UTC 
(rev 61691)
+++ trunk/lib/tests/cycles/ctests/reports/T48860.blend  2016-07-18 08:46:37 UTC 
(rev 61692)

Property changes on: trunk/lib/tests/cycles/ctests/reports/T48860.blend
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/lib/tests/cycles/ctests/reports/reference_renders/T48860.png
===
(Binary files differ)

Index: trunk/lib/tests/cycles/ctests/reports/reference_renders/T48860.png
===
--- trunk/lib/tests/cycles/ctests/reports/reference_renders/T48860.png  
2016-07-12 11:41:07 UTC (rev 61691)
+++ trunk/lib/tests/cycles/ctests/reports/reference_renders/T48860.png  
2016-07-18 08:46:37 UTC (rev 61692)

Property changes on: 
trunk/lib/tests/cycles/ctests/reports/reference_renders/T48860.png
___
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] [bbcd607] alembic_basic_io: Fix crash loading a file with an invalid archive.

2016-07-18 Thread Kévin Dietrich
Commit: bbcd60701e6c46eeb48ec58111eaaf47794dc1e1
Author: Kévin Dietrich
Date:   Mon Jul 18 08:44:29 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rBbbcd60701e6c46eeb48ec58111eaaf47794dc1e1

Fix crash loading a file with an invalid archive.

===

M   source/blender/alembic/intern/alembic_capi.cc

===

diff --git a/source/blender/alembic/intern/alembic_capi.cc 
b/source/blender/alembic/intern/alembic_capi.cc
index 691aa06..a258f07 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -245,6 +245,10 @@ AbcArchiveHandle *ABC_create_handle(const char *filename, 
ListBase *object_paths
 {
IArchive *archive = open_archive(filename);
 
+   if (!archive) {
+   return NULL;
+   }
+
if (object_paths) {
gather_objects_paths(archive->getTop(), object_paths);
}

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


[Bf-blender-cvs] [d1557c0] alembic_basic_io: Cleanup: indent.

2016-07-18 Thread Kévin Dietrich
Commit: d1557c01435bc4ed84a875e7bf30f893309b940b
Author: Kévin Dietrich
Date:   Mon Jul 18 08:50:42 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rBd1557c01435bc4ed84a875e7bf30f893309b940b

Cleanup: indent.

===

M   intern/cycles/blender/blender_mesh.cpp

===

diff --git a/intern/cycles/blender/blender_mesh.cpp 
b/intern/cycles/blender/blender_mesh.cpp
index d5fd139..17a9b60 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -727,7 +727,7 @@ static void sync_mesh_cached_velocities(BL::Object& b_ob, 
Scene *scene, Mesh *me
 
/* Only export previous and next frame, we don't have any in between 
data. */
float motion_times[2] = {-1.0f, 1.0f};
-for (int step = 0; step < 2; step++) {
+   for (int step = 0; step < 2; step++) {
const float relative_time = motion_times[step] * 
scene->motion_shutter_time() * 0.5f;
float3 *mP = attr_mP->data_float3() + step*numverts;
 
@@ -974,8 +974,8 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob,
 
/* cached motion is exported immediate with mesh, skip here */
BL::MeshSequenceCacheModifier mesh_cache = object_mesh_cache_find(b_ob);
-if (mesh_cache)
-return;
+   if (mesh_cache)
+   return;
 
if(ccl::BKE_object_is_deform_modified(b_ob, b_scene, preview)) {
/* get derived mesh */
@@ -1062,7 +1062,7 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob,
else if(time_index > 0) {
VLOG(1) << "Filling deformation motion for 
object " << b_ob.name();
/* motion, fill up previous steps that we might 
have skipped because
-* they had no motion, but we need them 
anyway now */
+* they had no motion, but we need them anyway 
now */
float3 *P = >verts[0];
float3 *N = (attr_N)? attr_N->data_float3(): 
NULL;

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


[Bf-blender-cvs] [30adc1a] alembic_basic_io: Cycles: sync motion vectors when syncing the mesh, not as an extra step.

2016-07-18 Thread Kévin Dietrich
Commit: 30adc1a615cda6e0463569f929e49251b4c1219b
Author: Kévin Dietrich
Date:   Mon Jul 18 08:46:03 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB30adc1a615cda6e0463569f929e49251b4c1219b

Cycles: sync motion vectors when syncing the mesh, not as an extra step.

===

M   intern/cycles/blender/blender_mesh.cpp
M   intern/cycles/blender/blender_object.cpp
M   intern/cycles/blender/blender_sync.h
M   intern/cycles/render/scene.cpp
M   intern/cycles/render/scene.h

===

diff --git a/intern/cycles/blender/blender_mesh.cpp 
b/intern/cycles/blender/blender_mesh.cpp
index 0511244..d5fd139 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -680,6 +680,65 @@ static void create_subd_mesh(Scene *scene,
 
 /* Sync */
 
+static inline BL::MeshSequenceCacheModifier object_mesh_cache_find(BL::Object 
_ob)
+{
+   BL::Object::modifiers_iterator b_mod;
+
+   for(b_ob.modifiers.begin(b_mod); b_mod != b_ob.modifiers.end(); 
++b_mod) {
+   if (!b_mod->is_a(_MeshSequenceCacheModifier)) {
+   continue;
+   }
+
+   BL::MeshSequenceCacheModifier mesh_cache = 
BL::MeshSequenceCacheModifier(*b_mod);
+
+   if 
(MeshSequenceCacheModifier_has_velocity_get(_cache.ptr)) {
+   return mesh_cache;
+   }
+   }
+
+   return BL::MeshSequenceCacheModifier(PointerRNA_NULL);
+}
+
+static void sync_mesh_cached_velocities(BL::Object& b_ob, Scene *scene, Mesh 
*mesh)
+{
+   if(scene->need_motion() == Scene::MOTION_NONE)
+   return;
+
+   BL::MeshSequenceCacheModifier mesh_cache = object_mesh_cache_find(b_ob);
+
+   if(!mesh_cache)
+   return;
+
+   /* TODO: check that the number of vertices still matches. */
+
+   /* Find or add attribute */
+   float3 *P = >verts[0];
+   Attribute *attr_mP = 
mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION);
+
+   if(!attr_mP) {
+   attr_mP = mesh->attributes.add(ATTR_STD_MOTION_VERTEX_POSITION);
+   }
+
+   const size_t numverts = mesh->verts.size();
+
+   float3 *buffer = new float3[numverts];
+
+   MeshSequenceCacheModifier_velocity_cache_get(_cache.ptr, 
[0].x);
+
+   /* Only export previous and next frame, we don't have any in between 
data. */
+   float motion_times[2] = {-1.0f, 1.0f};
+for (int step = 0; step < 2; step++) {
+   const float relative_time = motion_times[step] * 
scene->motion_shutter_time() * 0.5f;
+   float3 *mP = attr_mP->data_float3() + step*numverts;
+
+   for (int i = 0; i < numverts; ++i) {
+   mP[i] = P[i] + buffer[i]*relative_time;
+   }
+   }
+
+   delete [] buffer;
+}
+
 Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
  bool object_updated,
  bool hide_tris)
@@ -821,6 +880,9 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
mesh->displacement_method = Mesh::DISPLACE_BOTH;
}
 
+   /* cached velocities (e.g. from alembic archive) */
+   sync_mesh_cached_velocities(b_ob, scene, mesh);
+
/* tag update */
bool rebuild = false;
 
@@ -850,29 +912,9 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
return mesh;
 }
 
-static inline BL::MeshSequenceCacheModifier object_mesh_cache_find(BL::Object 
_ob)
-{
-   BL::Object::modifiers_iterator b_mod;
-
-   for(b_ob.modifiers.begin(b_mod); b_mod != b_ob.modifiers.end(); 
++b_mod) {
-   if (!b_mod->is_a(_MeshSequenceCacheModifier)) {
-   continue;
-   }
-
-   BL::MeshSequenceCacheModifier mesh_cache = 
BL::MeshSequenceCacheModifier(*b_mod);
-
-   if 
(MeshSequenceCacheModifier_has_velocity_get(_cache.ptr)) {
-   return mesh_cache;
-   }
-   }
-
-   return BL::MeshSequenceCacheModifier(PointerRNA_NULL);
-}
-
 void BlenderSync::sync_mesh_motion(BL::Object& b_ob,
Object *object,
-   float motion_time,
-   float shuttertime)
+   float motion_time)
 {
/* ensure we only sync instanced meshes once */
Mesh *mesh = object->mesh;
@@ -930,10 +972,12 @@ void BlenderSync::sync_mesh_motion(BL::Object& b_ob,
 * would need a more extensive check to see which objects are animated 
*/
BL::Mesh b_mesh(PointerRNA_NULL);
 
-   /* First try to determine if this is a fluid domain. */
+   /* cached motion is exported immediate with mesh, skip here */
BL::MeshSequenceCacheModifier mesh_cache = object_mesh_cache_find(b_ob);
+if (mesh_cache)
+return;
 
- 

[Bf-blender-cvs] [3117919] alembic_basic_io: Merge branch 'master' into alembic_basic_io

2016-07-18 Thread Kévin Dietrich
Commit: 3117919b2f32ff9b23c195241adb0caec8e978c4
Author: Kévin Dietrich
Date:   Mon Jul 18 07:48:30 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB3117919b2f32ff9b23c195241adb0caec8e978c4

Merge branch 'master' into alembic_basic_io

===



===



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