[Bf-blender-cvs] [38eab96] master: Fix T44683: Unable to mute movie clip when using stabilized display

2015-05-13 Thread Sergey Sharybin
Commit: 38eab96f9b725bc9d068a46fa3aa982aa0d7e726
Author: Sergey Sharybin
Date:   Wed May 13 14:28:24 2015 +0500
Branches: master
https://developer.blender.org/rB38eab96f9b725bc9d068a46fa3aa982aa0d7e726

Fix T44683: Unable to mute movie clip when using stabilized display

===

M   source/blender/editors/space_clip/clip_draw.c

===

diff --git a/source/blender/editors/space_clip/clip_draw.c 
b/source/blender/editors/space_clip/clip_draw.c
index d021002..ce248f1 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -1694,29 +1694,29 @@ void clip_draw_main(const bContext *C, SpaceClip *sc, 
ARegion *ar)
}
 
if (sc-flag  SC_SHOW_STABLE) {
+   float translation[2];
+   float aspect = clip-tracking.camera.pixel_aspect;
float smat[4][4], ismat[4][4];
 
-   ibuf = ED_space_clip_get_stable_buffer(sc, sc-loc, sc-scale, 
sc-angle);
-
-   if (ibuf) {
-   float translation[2];
-   float aspect = clip-tracking.camera.pixel_aspect;
+   if ((sc-flag  SC_MUTE_FOOTAGE) == 0) {
+   ibuf = ED_space_clip_get_stable_buffer(sc, sc-loc,
+  sc-scale, 
sc-angle);
+   }
 
-   if (width != ibuf-x)
-   mul_v2_v2fl(translation, sc-loc, (float)width 
/ ibuf-x);
-   else
-   copy_v2_v2(translation, sc-loc);
+   if (ibuf != NULL  width != ibuf-x)
+   mul_v2_v2fl(translation, sc-loc, (float)width / 
ibuf-x);
+   else
+   copy_v2_v2(translation, sc-loc);
 
-   BKE_tracking_stabilization_data_to_mat4(width, height, 
aspect,
-   translation, 
sc-scale, sc-angle, sc-stabmat);
+   BKE_tracking_stabilization_data_to_mat4(width, height, aspect, 
translation,
+   sc-scale, sc-angle, 
sc-stabmat);
 
-   unit_m4(smat);
-   smat[0][0] = 1.0f / width;
-   smat[1][1] = 1.0f / height;
-   invert_m4_m4(ismat, smat);
+   unit_m4(smat);
+   smat[0][0] = 1.0f / width;
+   smat[1][1] = 1.0f / height;
+   invert_m4_m4(ismat, smat);
 
-   mul_m4_series(sc-unistabmat, smat, sc-stabmat, ismat);
-   }
+   mul_m4_series(sc-unistabmat, smat, sc-stabmat, ismat);
}
else if ((sc-flag  SC_MUTE_FOOTAGE) == 0) {
ibuf = ED_space_clip_get_buffer(sc);

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


[Bf-blender-cvs] [ae9e38c] master: Fix T44689: New Depsgraph crash

2015-05-13 Thread Sergey Sharybin
Commit: ae9e38c5adc60347e127c9f4c5ee5436b611b48f
Author: Sergey Sharybin
Date:   Wed May 13 14:05:31 2015 +0500
Branches: master
https://developer.blender.org/rBae9e38c5adc60347e127c9f4c5ee5436b611b48f

Fix T44689: New Depsgraph crash

Simple highschool rated issue -- uninitialized variable :)

===

M   source/blender/depsgraph/intern/depsnode.cc
M   source/blender/depsgraph/intern/depsnode.h

===

diff --git a/source/blender/depsgraph/intern/depsnode.cc 
b/source/blender/depsgraph/intern/depsnode.cc
index 8d21f6e..866e911 100644
--- a/source/blender/depsgraph/intern/depsnode.cc
+++ b/source/blender/depsgraph/intern/depsnode.cc
@@ -114,6 +114,10 @@ void TimeSourceDepsNode::tag_update(Depsgraph *graph)
 
 /* Root Node == */
 
+RootDepsNode::RootDepsNode() : time_source(NULL)
+{
+}
+
 RootDepsNode::~RootDepsNode()
 {
OBJECT_GUARDED_DELETE(time_source, TimeSourceDepsNode);
diff --git a/source/blender/depsgraph/intern/depsnode.h 
b/source/blender/depsgraph/intern/depsnode.h
index 993bb69..84554ae 100644
--- a/source/blender/depsgraph/intern/depsnode.h
+++ b/source/blender/depsgraph/intern/depsnode.h
@@ -127,6 +127,7 @@ struct TimeSourceDepsNode : public DepsNode {
 
 /* Root Node. */
 struct RootDepsNode : public DepsNode {
+   RootDepsNode();
~RootDepsNode();
 
TimeSourceDepsNode *add_time_source(const string name = );

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


[Bf-blender-cvs] [1a0fb7e] master: Project Paint: enable old bleed UV calculation

2015-05-13 Thread Campbell Barton
Commit: 1a0fb7e9ae8889905173a7deb0a7b1ca990fc34d
Author: Campbell Barton
Date:   Wed May 13 18:26:56 2015 +1000
Branches: master
https://developer.blender.org/rB1a0fb7e9ae8889905173a7deb0a7b1ca990fc34d

Project Paint: enable old bleed UV calculation

Was disabled because other values weren't quite right.

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c 
b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 8bf4395..2923685 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -2841,10 +2841,11 @@ static void project_paint_face_init(

{

/* Only bother calculating the weights if we intersect */

if (ps-do_mask_normal || ps-dm_mtface_clone) {
-#if 1
+   
float uv_fac;
+#if 0

/* get the UV on the line since we want to copy the pixels from 
there for bleeding */

float uv_close[2];
-   
float uv_fac = closest_to_line_v2(uv_close, uv, 
tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2]);
+   
uv_fac = closest_to_line_v2(uv_close, uv, 
tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2]);

if  (uv_fac  0.0f) copy_v2_v2(uv_close, 
tf_uv_pxoffset[fidx1]);

else if (uv_fac  1.0f) copy_v2_v2(uv_close, 
tf_uv_pxoffset[fidx2]);
 
@@ -2854,7 +2855,7 @@ static void project_paint_face_init(

else {

barycentric_weights_v2(tf_uv_pxoffset[0], 
tf_uv_pxoffset[1], tf_uv_pxoffset[2], uv_close, w);

}
-#else  
/* this is buggy with quads, don't use for now */
+#else
 

/* Cheat, we know where we are along the edge so work out the 
weights from that */

uv_fac = fac1 + (uv_fac * (fac2 - fac1));

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


[Bf-blender-cvs] [0d64e26] master: Clip editor: Deselecting with shift-LMB does not work in graph view

2015-05-13 Thread Sergey Sharybin
Commit: 0d64e26740a7f0b6052e386e9a9ad2e88d4a4058
Author: Sergey Sharybin
Date:   Wed May 13 15:55:32 2015 +0500
Branches: master
https://developer.blender.org/rB0d64e26740a7f0b6052e386e9a9ad2e88d4a4058

Clip editor: Deselecting with shift-LMB does not work in graph view

===

M   source/blender/editors/space_clip/clip_graph_ops.c

===

diff --git a/source/blender/editors/space_clip/clip_graph_ops.c 
b/source/blender/editors/space_clip/clip_graph_ops.c
index 2a2f15c..9011f08 100644
--- a/source/blender/editors/space_clip/clip_graph_ops.c
+++ b/source/blender/editors/space_clip/clip_graph_ops.c
@@ -200,10 +200,18 @@ static bool mouse_select_knot(bContext *C, float co[2], 
bool extend)

toggle_selection_cb);
}
 
-   if (userdata.coord == 0)
-   userdata.marker-flag |= 
MARKER_GRAPH_SEL_X;
-   else
-   userdata.marker-flag |= 
MARKER_GRAPH_SEL_Y;
+   if (userdata.coord == 0) {
+   if (extend  (userdata.marker-flag  
MARKER_GRAPH_SEL_X) != 0)
+   userdata.marker-flag = 
~MARKER_GRAPH_SEL_X;
+   else
+   userdata.marker-flag |= 
MARKER_GRAPH_SEL_X;
+   }
+   else {
+   if (extend  (userdata.marker-flag  
MARKER_GRAPH_SEL_Y) != 0)
+   userdata.marker-flag = 
~MARKER_GRAPH_SEL_Y;
+   else
+   userdata.marker-flag |= 
MARKER_GRAPH_SEL_Y;
+   }
 
return true;
}

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


[Bf-blender-cvs] [730e61b] master: Clip editor: Selecting curves in graph view always extends tracks selection

2015-05-13 Thread Sergey Sharybin
Commit: 730e61b446879f71eae7267de42026069a53d66f
Author: Sergey Sharybin
Date:   Wed May 13 16:11:26 2015 +0500
Branches: master
https://developer.blender.org/rB730e61b446879f71eae7267de42026069a53d66f

Clip editor: Selecting curves in graph view always extends tracks selection

Was actually an old TODO, hopefully solved now in a way so everyone is happy.

===

M   source/blender/editors/space_clip/clip_graph_ops.c

===

diff --git a/source/blender/editors/space_clip/clip_graph_ops.c 
b/source/blender/editors/space_clip/clip_graph_ops.c
index 9011f08..e781d19 100644
--- a/source/blender/editors/space_clip/clip_graph_ops.c
+++ b/source/blender/editors/space_clip/clip_graph_ops.c
@@ -246,10 +246,12 @@ static bool mouse_select_curve(bContext *C, float co[2], 
bool extend)
else if (act_track != userdata.track) {
SelectUserData selectdata = {SEL_DESELECT};
MovieTrackingObject *object = 
BKE_tracking_object_get_active(tracking);
-   ListBase *tracksbase = 
BKE_tracking_object_get_tracks(tracking, object);
 
tracking-act_track = userdata.track;
-   BKE_tracking_track_select(tracksbase, userdata.track, 
TRACK_AREA_ALL, true);
+   if ((sc-flag  SC_SHOW_GRAPH_SEL_ONLY) == 0) {
+   ListBase *tracksbase = 
BKE_tracking_object_get_tracks(tracking, object);
+   BKE_tracking_track_select(tracksbase, 
userdata.track, TRACK_AREA_ALL, false);
+   }
 
/* deselect all knots on newly selected curve */
clip_graph_tracking_iterate(sc,

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


[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61520] trunk/lib/ darwin-9.x.universal/opencollada/lib: OSX/collada: fix compiling on older osx sdk-versions

2015-05-13 Thread jens verwiebe
Revision: 61520
  https://developer.blender.org/rBL61520
Author:   jensverwiebe
Date: 2015-05-13 13:20:58 + (Wed, 13 May 2015)
Log Message:
---
OSX/collada: fix compiling on older osx sdk-versions

Modified Paths:
--
trunk/lib/darwin-9.x.universal/opencollada/lib/libGeneratedSaxParser.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libMathMLSolver.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADABaseUtils.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADAFramework.a

trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADASaxFrameworkLoader.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADAStreamWriter.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libUTF.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libbuffer.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libftoa.a
trunk/lib/darwin-9.x.universal/opencollada/lib/libpcre.a

Modified: trunk/lib/darwin-9.x.universal/opencollada/lib/libGeneratedSaxParser.a
===
(Binary files differ)

Modified: trunk/lib/darwin-9.x.universal/opencollada/lib/libMathMLSolver.a
===
(Binary files differ)

Modified: 
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADABaseUtils.a
===
(Binary files differ)

Modified: 
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADAFramework.a
===
(Binary files differ)

Modified: 
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADASaxFrameworkLoader.a
===
(Binary files differ)

Modified: 
trunk/lib/darwin-9.x.universal/opencollada/lib/libOpenCOLLADAStreamWriter.a
===
(Binary files differ)

Modified: trunk/lib/darwin-9.x.universal/opencollada/lib/libUTF.a
===
(Binary files differ)

Modified: trunk/lib/darwin-9.x.universal/opencollada/lib/libbuffer.a
===
(Binary files differ)

Modified: trunk/lib/darwin-9.x.universal/opencollada/lib/libftoa.a
===
(Binary files differ)

Modified: trunk/lib/darwin-9.x.universal/opencollada/lib/libpcre.a
===
(Binary files differ)

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


[Bf-blender-cvs] [044398c] asset-experiments: Merge branch 'master' into asset-experiments

2015-05-13 Thread Bastien Montagne
Commit: 044398c786780ac71dddb2036c4181da66b01e40
Author: Bastien Montagne
Date:   Wed May 13 13:58:39 2015 +0200
Branches: asset-experiments
https://developer.blender.org/rB044398c786780ac71dddb2036c4181da66b01e40

Merge branch 'master' into asset-experiments

===



===



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


[Bf-blender-cvs] [b0f1a9e] asset-experiments: Merge branch 'master' into asset-experiments

2015-05-13 Thread Bastien Montagne
Commit: b0f1a9e27fe719632d8b121e0192f2e07b2dfd30
Author: Bastien Montagne
Date:   Wed May 13 12:52:11 2015 +0200
Branches: asset-experiments
https://developer.blender.org/rBb0f1a9e27fe719632d8b121e0192f2e07b2dfd30

Merge branch 'master' into asset-experiments

===



===



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


[Bf-blender-cvs] [952ef0f] asset-experiments: Fix newly created dir not going into rename state anymore.

2015-05-13 Thread Bastien Montagne
Commit: 952ef0fedfda5a2f941fe4ea87b4ece25861ba75
Author: Bastien Montagne
Date:   Wed May 13 14:07:49 2015 +0200
Branches: asset-experiments
https://developer.blender.org/rB952ef0fedfda5a2f941fe4ea87b4ece25861ba75

Fix newly created dir not going into rename state anymore.

Due to async dir listing...

===

M   source/blender/editors/space_file/space_file.c

===

diff --git a/source/blender/editors/space_file/space_file.c 
b/source/blender/editors/space_file/space_file.c
index d235131..188b834 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -277,7 +277,11 @@ static void file_refresh(const bContext *C, ScrArea *sa)
}
}
BLI_strncpy(sfile-params-renameedit, 
sfile-params-renamefile, sizeof(sfile-params-renameedit));
-   params-renamefile[0] = '\0';
+   /* File listing is now async, do not clear renamefile if 
matching entry not found
+* and dirlist is not finished! */
+   if (idx = 0 || filelist_is_ready(sfile-files)) {
+   params-renamefile[0] = '\0';
+   }
}
 
if (sfile-layout) {

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


[Bf-blender-cvs] [0a6e321] master: Cleanup / Cycles: De-Duplicate Portal data fetch and side check.

2015-05-13 Thread Thomas Dinges
Commit: 0a6e32173eaeaf35d194a8787458cb05194854a2
Author: Thomas Dinges
Date:   Wed May 13 16:04:43 2015 +0200
Branches: master
https://developer.blender.org/rB0a6e32173eaeaf35d194a8787458cb05194854a2

Cleanup / Cycles: De-Duplicate Portal data fetch and side check.

===

M   intern/cycles/kernel/kernel_light.h

===

diff --git a/intern/cycles/kernel/kernel_light.h 
b/intern/cycles/kernel/kernel_light.h
index 704fb49..3983947 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -249,6 +249,25 @@ float background_map_pdf(KernelGlobals *kg, float3 
direction)
return (cdf_u.x * cdf_v.x)/(M_2PI_F * M_PI_F * sin_theta * denom);
 }
 
+ccl_device_inline bool 
background_portal_data_fetch_and_check_side(KernelGlobals *kg,
+   float3 P,
+   int index,
+   float3 
*lightpos,
+   float3 *dir)
+{
+   float4 data0 = kernel_tex_fetch(__light_data, (index + 
kernel_data.integrator.portal_offset)*LIGHT_SIZE + 0);
+   float4 data3 = kernel_tex_fetch(__light_data, (index + 
kernel_data.integrator.portal_offset)*LIGHT_SIZE + 3);
+
+   *lightpos = make_float3(data0.y, data0.z, data0.w);
+   *dir = make_float3(data3.y, data3.z, data3.w);
+
+   /* Check whether portal is on the right side. */
+   if(dot(*dir, P - *lightpos)  1e-5f)
+   return true;
+
+   return false;
+}
+
 ccl_device float background_portal_pdf(KernelGlobals *kg,
float3 P,
float3 direction,
@@ -261,19 +280,9 @@ ccl_device float background_portal_pdf(KernelGlobals *kg,
if(p == ignore_portal)
continue;
 
-   /* TODO(sergey): Consider moving portal data fetch to a
-* dedicated function.
-*/
-   float4 data0 = kernel_tex_fetch(__light_data, (p + 
kernel_data.integrator.portal_offset)*LIGHT_SIZE + 0);
-   float4 data3 = kernel_tex_fetch(__light_data, (p + 
kernel_data.integrator.portal_offset)*LIGHT_SIZE + 3);
-
-   float3 lightpos = make_float3(data0.y, data0.z, data0.w);
-   float3 dir = make_float3(data3.y, data3.z, data3.w);
-
-   if(dot(dir, P - lightpos) = 1e-5f) {
-   /* P is on the wrong side or too close. */
+   float3 lightpos, dir;
+   if(!background_portal_data_fetch_and_check_side(kg, P, p, 
lightpos, dir))
continue;
-   }
 
if(is_possible) {
/* There's a portal that could be sampled from this 
position. */
@@ -310,13 +319,8 @@ ccl_device int 
background_num_possible_portals(KernelGlobals *kg, float3 P)
 {
int num_possible_portals = 0;
for(int p = 0; p  kernel_data.integrator.num_portals; p++) {
-   float4 data0 = kernel_tex_fetch(__light_data, (p + 
kernel_data.integrator.portal_offset)*LIGHT_SIZE + 0);
-   float4 data3 = kernel_tex_fetch(__light_data, (p + 
kernel_data.integrator.portal_offset)*LIGHT_SIZE + 3);
-   float3 lightpos = make_float3(data0.y, data0.z, data0.w);
-   float3 dir = make_float3(data3.y, data3.z, data3.w);
-
-   /* Check whether portal is on the right side. */
-   if(dot(dir, P - lightpos)  1e-5f)
+   float3 lightpos, dir;
+   if(background_portal_data_fetch_and_check_side(kg, P, p, 
lightpos, dir))
num_possible_portals++;
}
return num_possible_portals;
@@ -340,13 +344,8 @@ ccl_device float3 background_portal_sample(KernelGlobals 
*kg,
 */
for(int p = 0; p  kernel_data.integrator.num_portals; p++) {
/* Search for the sampled portal. */
-   float4 data0 = kernel_tex_fetch(__light_data, (p + 
kernel_data.integrator.portal_offset)*LIGHT_SIZE + 0);
-   float4 data3 = kernel_tex_fetch(__light_data, (p + 
kernel_data.integrator.portal_offset)*LIGHT_SIZE + 3);
-   float3 lightpos = make_float3(data0.y, data0.z, data0.w);
-   float3 dir = make_float3(data3.y, data3.z, data3.w);
-
-   /* Check whether portal is on the right side. */
-   if(dot(dir, P - lightpos) = 1e-5f)
+   float3 lightpos, dir;
+   if(!background_portal_data_fetch_and_check_side(kg, P, p, 
lightpos, dir))
continue;
 
if(portal == 0) {

___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org

[Bf-blender-cvs] [93867ae] master: Cycles: Cleanup: use generic utility function to set kernel arguments

2015-05-13 Thread Sergey Sharybin
Commit: 93867ae549f54cf98451c0a72e0843fc7b1c62bc
Author: Sergey Sharybin
Date:   Wed May 13 19:29:19 2015 +0500
Branches: master
https://developer.blender.org/rB93867ae549f54cf98451c0a72e0843fc7b1c62bc

Cycles: Cleanup: use generic utility function to set kernel arguments

===

M   intern/cycles/device/device_opencl.cpp

===

diff --git a/intern/cycles/device/device_opencl.cpp 
b/intern/cycles/device/device_opencl.cpp
index 46d6706..f2ac5fc 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -39,8 +39,6 @@
 CCL_NAMESPACE_BEGIN
 
 #define CL_MEM_PTR(p) ((cl_mem)(uintptr_t)(p))
-#define KERNEL_APPEND_ARG(kernel_name, arg) \
-   opencl_assert(clSetKernelArg(kernel_name, narg++, sizeof(arg), 
(void*)arg))
 
 /* Macro declarations used with split kernel */
 
@@ -1008,29 +1006,30 @@ public:
cl_int d_offset = task.offset;
cl_int d_stride = task.stride;
 
-   /* sample arguments */
-   cl_uint narg = 0;
-
 
cl_kernel ckFilmConvertKernel = (rgba_byte)? 
ckFilmConvertByteKernel: ckFilmConvertHalfFloatKernel;
 
-   /* TODO : Make the kernel launch similar to Cuda */
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_data);
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_rgba);
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_buffer);
+   cl_uint start_arg_index =
+   kernel_set_args(ckFilmConvertKernel,
+   0,
+   d_data,
+   d_rgba,
+   d_buffer);
 
 #define KERNEL_TEX(type, ttype, name) \
-   set_kernel_arg_mem(ckFilmConvertKernel, narg, #name);
+   set_kernel_arg_mem(ckFilmConvertKernel, start_arg_index, #name);
 #include kernel_textures.h
 #undef KERNEL_TEX
 
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_sample_scale);
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_x);
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_y);
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_w);
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_h);
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_offset);
-   KERNEL_APPEND_ARG(ckFilmConvertKernel, d_stride);
+   start_arg_index += kernel_set_args(ckFilmConvertKernel,
+  start_arg_index,
+  d_sample_scale,
+  d_x,
+  d_y,
+  d_w,
+  d_h,
+  d_offset,
+  d_stride);
 
enqueue_kernel(ckFilmConvertKernel, d_w, d_h);
}
@@ -1046,9 +1045,6 @@ public:
cl_int d_shader_w = task.shader_w;
cl_int d_offset = task.offset;
 
-   /* sample arguments */
-   cl_uint narg = 0;
-
cl_kernel kernel;
 
if(task.shader_eval_type = SHADER_EVAL_BAKE)
@@ -1063,21 +1059,25 @@ public:
 
cl_int d_sample = sample;
 
-   /* TODO : Make the kernel launch similar to Cuda */
-   KERNEL_APPEND_ARG(kernel, d_data);
-   KERNEL_APPEND_ARG(kernel, d_input);
-   KERNEL_APPEND_ARG(kernel, d_output);
+   cl_uint start_arg_index =
+   kernel_set_args(kernel,
+   0,
+   d_data,
+   d_input,
+   d_output);
 
 #define KERNEL_TEX(type, ttype, name) \
-   set_kernel_arg_mem(kernel, narg, #name);
+   set_kernel_arg_mem(kernel, start_arg_index, #name);
 #include kernel_textures.h
 #undef KERNEL_TEX
 
-   KERNEL_APPEND_ARG(kernel, d_shader_eval_type);
-   KERNEL_APPEND_ARG(kernel, d_shader_x);
-   KERNEL_APPEND_ARG(kernel, d_shader_w);
-   KERNEL_APPEND_ARG(kernel, d_offset);
-   KERNEL_APPEND_ARG(kernel, d_sample);
+   start_arg_index += kernel_set_args(kernel,
+  start_arg_index,
+  d_shader_eval_type,
+  d_shader_x,
+ 

[Bf-blender-cvs] [bab4d49] gooseberry: Merge branch 'alembic' into gooseberry

2015-05-13 Thread Lukas Tönne
Commit: bab4d495ddb110c2a0b653c474954efc01f40a00
Author: Lukas Tönne
Date:   Wed May 13 16:50:06 2015 +0200
Branches: gooseberry
https://developer.blender.org/rBbab4d495ddb110c2a0b653c474954efc01f40a00

Merge branch 'alembic' into gooseberry

Conflicts:
source/blender/physics/intern/BPH_mass_spring.cpp

===



===

diff --cc source/blender/physics/intern/BPH_mass_spring.cpp
index 997938c,f8d4fa6..702ac8d
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@@ -1,1698 -1,1751 +1,1720 @@@
 -/*
 - * * BEGIN GPL LICENSE BLOCK *
 - *
 - * This program is free software; you can redistribute it and/or
 - * modify it under the terms of the GNU General Public License
 - * as published by the Free Software Foundation; either version 2
 - * of the License, or (at your option) any later version.
 - *
 - * This program is distributed in the hope that it will be useful,
 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 - * GNU General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software Foundation,
 - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 - *
 - * The Original Code is Copyright (C) Blender Foundation
 - * All rights reserved.
 - *
 - * The Original Code is: all of this file.
 - *
 - * Contributor(s): Lukas Toenne
 - *
 - * * END GPL LICENSE BLOCK *
 - */
 -
 -/** \file blender/physics/intern/BPH_mass_spring.cpp
 - *  \ingroup bph
 - */
 -
 -extern C {
 -#include MEM_guardedalloc.h
 -
 -#include DNA_cache_library_types.h
 -#include DNA_cloth_types.h
 -#include DNA_scene_types.h
 -#include DNA_object_force.h
 -#include DNA_object_types.h
 -#include DNA_meshdata_types.h
 -#include DNA_modifier_types.h
 -
 -#include BLI_math.h
 -#include BLI_linklist.h
 -#include BLI_utildefines.h
 -
 -#include BKE_cache_library.h
 -#include BKE_cloth.h
 -#include BKE_collision.h
 -#include BKE_colortools.h
 -#include BKE_effect.h
 -#include BKE_strands.h
 -}
 -
 -#include BPH_mass_spring.h
 -#include implicit.h
 -
 -static float I3[3][3] = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}};
 -
 -/* Number of off-diagonal non-zero matrix blocks.
 - * Basically there is one of these for each vertex-vertex interaction.
 - */
 -static int cloth_count_nondiag_blocks(Cloth *cloth)
 -{
 -  LinkNode *link;
 -  int nondiag = 0;
 -  
 -  for (link = cloth-springs; link; link = link-next) {
 -  ClothSpring *spring = (ClothSpring *)link-link;
 -  switch (spring-type) {
 -  case CLOTH_SPRING_TYPE_BENDING_ANG:
 -  /* angular bending combines 3 vertices */
 -  nondiag += 3;
 -  break;
 -  
 -  default:
 -  /* all other springs depend on 2 vertices only 
*/
 -  nondiag += 1;
 -  break;
 -  }
 -  }
 -  
 -  return nondiag;
 -}
 -
 -int BPH_cloth_solver_init(Object *UNUSED(ob), ClothModifierData *clmd)
 -{
 -  Cloth *cloth = clmd-clothObject;
 -  ClothVertex *verts = cloth-verts;
 -  const float ZERO[3] = {0.0f, 0.0f, 0.0f};
 -  Implicit_Data *id;
 -  unsigned int i, nondiag;
 -  
 -  nondiag = cloth_count_nondiag_blocks(cloth);
 -  cloth-implicit = id = BPH_mass_spring_solver_create(cloth-numverts, 
nondiag);
 -  
 -  for (i = 0; i  cloth-numverts; i++) {
 -  BPH_mass_spring_set_vertex_mass(id, i, verts[i].mass);
 -  }
 -  
 -  for (i = 0; i  cloth-numverts; i++) {
 -  BPH_mass_spring_set_motion_state(id, i, verts[i].x, ZERO);
 -  }
 -  
 -  return 1;
 -}
 -
 -void BPH_cloth_solver_free(ClothModifierData *clmd)
 -{
 -  Cloth *cloth = clmd-clothObject;
 -  
 -  if (cloth-implicit) {
 -  BPH_mass_spring_solver_free(cloth-implicit);
 -  cloth-implicit = NULL;
 -  }
 -}
 -
 -void BKE_cloth_solver_set_positions(ClothModifierData *clmd)
 -{
 -  Cloth *cloth = clmd-clothObject;
 -  ClothVertex *verts = cloth-verts;
 -  unsigned int numverts = cloth-numverts, i;
 -  ClothHairData *cloth_hairdata = clmd-hairdata;
 -  Implicit_Data *id = cloth-implicit;
 -  
 -  for (i = 0; i  numverts; i++) {
 -  if (cloth_hairdata) {
 -  ClothHairData *root = cloth_hairdata[i];
 -  BPH_mass_spring_set_rest_transform(id, i, root-rot);
 -  }
 -  else
 -  BPH_mass_spring_set_rest_transform(id, i, 

[Bf-blender-cvs] [85499bb] asset-experiments: Fix crash in append/link on windows (sigh).

2015-05-13 Thread Bastien Montagne
Commit: 85499bb5e817e583f7574d6a6e0759c37ddcab62
Author: Bastien Montagne
Date:   Wed May 13 17:06:44 2015 +0200
Branches: asset-experiments
https://developer.blender.org/rB85499bb5e817e583f7574d6a6e0759c37ddcab62

Fix crash in append/link on windows (sigh).

===

M   source/blender/editors/space_file/filelist.c

===

diff --git a/source/blender/editors/space_file/filelist.c 
b/source/blender/editors/space_file/filelist.c
index 45ef4e1..94e3264 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1316,7 +1316,7 @@ int filelist_numfiles(struct FileList *filelist)
 
 static const char *fileentry_uiname(const char *root, const char *relpath, 
const int typeflag, char *buff)
 {
-   char *name;
+   char *name = NULL;
 
if (typeflag  FILE_TYPE_BLENDERLIB) {
char abspath[FILE_MAX_LIBEXTRA];
@@ -1328,11 +1328,14 @@ static const char *fileentry_uiname(const char *root, 
const char *relpath, const
name = group;
}
}
-   else if (typeflag  FILE_TYPE_DIR) {
-   name = (char *)relpath;
-   }
-   else {
-   name = (char *)BLI_path_basename(relpath);
+   /* Depending on platforms, 'my_file.blend/..' might be viewed as dir or 
not... */
+   if (!name) {
+   if (typeflag  FILE_TYPE_DIR) {
+   name = (char *)relpath;
+   }
+   else {
+   name = (char *)BLI_path_basename(relpath);
+   }
}
BLI_assert(name);
 
@@ -1351,7 +1354,7 @@ void filelist_setdir(struct FileList *filelist, char 
*r_dir)
 {
 #ifndef NDEBUG
size_t len = strlen(r_dir);
-   BLI_assert((len  FILE_MAX_LIBEXTRA)  r_dir[len - 1] == '/');
+   BLI_assert((len  FILE_MAX_LIBEXTRA)  ELEM(r_dir[len - 1], SEP, 
ALTSEP));
 #endif
 
BLI_cleanup_dir(G.main-name, r_dir);

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


[Bf-blender-cvs] [b5c72b1] asset-experiments: Merge branch 'master' into asset-experiments

2015-05-13 Thread Bastien Montagne
Commit: b5c72b15edfad7f2f96c8c135e17d08574687815
Author: Bastien Montagne
Date:   Wed May 13 17:14:46 2015 +0200
Branches: asset-experiments
https://developer.blender.org/rBb5c72b15edfad7f2f96c8c135e17d08574687815

Merge branch 'master' into asset-experiments

===



===



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


[Bf-blender-cvs] [d99620f] alembic: Optional feature Goal Deflect to disable goal forces when hitting a deflector object.

2015-05-13 Thread Lukas Tönne
Commit: d99620f296a4612cf187031e4fc934ae84a41387
Author: Lukas Tönne
Date:   Wed May 13 16:49:12 2015 +0200
Branches: alembic
https://developer.blender.org/rBd99620f296a4612cf187031e4fc934ae84a41387

Optional feature Goal Deflect to disable goal forces when hitting a
deflector object.

===

M   release/scripts/startup/bl_ui/properties_object.py
M   source/blender/blenkernel/BKE_cache_library.h
M   source/blender/blenkernel/intern/cache_library.c
M   source/blender/makesdna/DNA_cache_library_types.h
M   source/blender/makesrna/intern/rna_cache_library.c
M   source/blender/physics/intern/BPH_mass_spring.cpp

===

diff --git a/release/scripts/startup/bl_ui/properties_object.py 
b/release/scripts/startup/bl_ui/properties_object.py
index fbcde95..f3f960d 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -531,7 +531,9 @@ class OBJECT_PT_cache_library(ObjectButtonsPanel, Panel):
 row = col.row(align=True)
 row.prop(params, goal_stiffness)
 row.prop(params, goal_damping)
+row = col.row(align=True)
 row.prop(params, use_goal_stiffness_curve)
+row.prop(params, use_goal_deflect)
 if params.use_goal_stiffness_curve:
 sub = col.column()
 sub.template_curve_mapping(params, goal_stiffness_curve)
diff --git a/source/blender/blenkernel/BKE_cache_library.h 
b/source/blender/blenkernel/BKE_cache_library.h
index c7634fb..900d541 100644
--- a/source/blender/blenkernel/BKE_cache_library.h
+++ b/source/blender/blenkernel/BKE_cache_library.h
@@ -228,6 +228,8 @@ int BKE_cache_effectors_get(struct CacheEffector 
*effectors, int max, struct Cac
 void BKE_cache_effectors_free(struct CacheEffector *effectors, int tot);
 void BKE_cache_effector_velocity_update(struct CacheLibrary *cachelib, struct 
DupliCache *dupcache, float obmat[4][4], float frame);
 int BKE_cache_effectors_eval(struct CacheEffector *effectors, int tot, struct 
CacheEffectorPoint *point, struct CacheEffectorResult *result);
+int BKE_cache_effectors_eval_ex(struct CacheEffector *effectors, int tot, 
struct CacheEffectorPoint *point, struct CacheEffectorResult *result,
+bool (*filter)(void *, struct CacheEffector 
*), void *filter_data);
 
 /* = */
 
diff --git a/source/blender/blenkernel/intern/cache_library.c 
b/source/blender/blenkernel/intern/cache_library.c
index e1e8426..5ef771e 100644
--- a/source/blender/blenkernel/intern/cache_library.c
+++ b/source/blender/blenkernel/intern/cache_library.c
@@ -805,21 +805,25 @@ void BKE_cache_effector_velocity_update(CacheLibrary 
*cachelib, DupliCache *dupc
}
 }
 
-static float cache_effector_falloff(const CacheEffector *eff, float distance)
+static bool cache_effector_falloff(const CacheEffector *eff, float distance, 
float *r_factor)
 {
float mindist = eff-mindist;
float maxdist = eff-maxdist;
float falloff = eff-falloff;
float range = maxdist - mindist;

+   if (r_factor) *r_factor = 0.0f;
+   
if (range = 0.0f)
-   return 0.0f;
+   return false;

+   if (distance  eff-maxdist)
+   return false;
CLAMP_MIN(distance, eff-mindist);
-   CLAMP_MAX(distance, eff-maxdist);
CLAMP_MIN(falloff, 0.0f);

-   return powf(1.0f - (distance - mindist) / range, falloff);
+   if (r_factor) *r_factor = powf(1.0f - (distance - mindist) / range, 
falloff);
+   return true;
 }
 
 typedef struct CacheEffectorTessfaceData {
@@ -926,8 +930,9 @@ static bool cache_effector_deflect(CacheEffector *eff, 
CacheEffectorInstance *in

if (!cache_effector_find_nearest(eff, inst, point, vec, NULL, dist, 
inside, NULL))
return false;
+   if (!cache_effector_falloff(eff, dist, falloff))
+   return false;

-   falloff = cache_effector_falloff(eff, dist);
mul_v3_v3fl(result-f, vec, eff-strength * falloff);
if (inside)
negate_v3(result-f);
@@ -942,8 +947,9 @@ static bool cache_effector_drag(CacheEffector *eff, 
CacheEffectorInstance *inst,

if (!cache_effector_find_nearest(eff, inst, point, vec, NULL, dist, 
NULL, facedata))
return false;
+   if (!cache_effector_falloff(eff, dist, falloff))
+   return false;

-   falloff = cache_effector_falloff(eff, dist);
cache_effector_velocity(eff, inst, facedata, vel);

/* relative velocity */
@@ -964,7 +970,8 @@ static void cache_effector_result_add(CacheEffectorResult 
*result, const CacheEf
add_v3_v3(result-f, other-f);
 }
 
-int BKE_cache_effectors_eval(CacheEffector *effectors, int 

[Bf-blender-cvs] [51a6bc8] master: Cycles: Inline sizeof of elements needed for the split kernel

2015-05-13 Thread Sergey Sharybin
Commit: 51a6bc8faa2994f6fea6cfa3f6fe7ac6662efee6
Author: Sergey Sharybin
Date:   Wed May 13 19:09:07 2015 +0500
Branches: master
https://developer.blender.org/rB51a6bc8faa2994f6fea6cfa3f6fe7ac6662efee6

Cycles: Inline sizeof of elements needed for the split kernel

No need to store them in the class, they're unlikely to be changed
and if they do change we're in big trouble anyway.

More appropriate approach would be then to typedef this things in
kernel_types.h, but still use inlined sizeof(),

===

M   intern/cycles/device/device_opencl.cpp

===

diff --git a/intern/cycles/device/device_opencl.cpp 
b/intern/cycles/device/device_opencl.cpp
index 5657e3a..46d6706 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -1620,18 +1620,6 @@ public:
/* Flag to make sceneintersect and lampemission kernel use queues. */
cl_mem use_queues_flag;
 
-   /* Required-memory size. */
-   size_t throughput_size;
-   size_t L_transparent_size;
-   size_t rayState_size;
-   size_t hostRayState_size;
-   size_t work_element_size;
-   size_t ISLamp_size;
-
-   /* Sizes of memory required for shadow blocked function. */
-   size_t AOAlpha_size;
-   size_t AOBSDF_size;
-
/* Amount of memory in output buffer associated with one pixel/thread. 
*/
size_t per_thread_output_buffer_size;
 
@@ -1786,18 +1774,6 @@ public:
 
per_sample_output_buffers = NULL;
 
-   /* Initialize required memory size. */
-   throughput_size = sizeof(float3);
-   L_transparent_size = sizeof(float);
-   rayState_size = sizeof(char);
-   hostRayState_size = sizeof(char);
-   work_element_size = sizeof(unsigned int);
-   ISLamp_size = sizeof(int);
-
-   /* Initialize sizes of memory required for shadow blocked 
function. */
-   AOAlpha_size = sizeof(float3);
-   AOBSDF_size = sizeof(float3);
-
per_thread_output_buffer_size = 0;
hostRayStateArray = NULL;
PathIteration_times = PATH_ITER_INC_FACTOR;
@@ -2203,10 +2179,6 @@ public:
assert(max_render_feasible_tile_size.x % 
SPLIT_KERNEL_LOCAL_SIZE_X == 0);
assert(max_render_feasible_tile_size.y % 
SPLIT_KERNEL_LOCAL_SIZE_Y == 0);
 
-   /* ray_state and hostRayStateArray should be of same size. */
-   assert(hostRayState_size == rayState_size);
-   assert(rayState_size == 1);
-
size_t global_size[2];
size_t local_size[2] = {SPLIT_KERNEL_LOCAL_SIZE_X,
SPLIT_KERNEL_LOCAL_SIZE_Y};
@@ -2340,17 +2312,17 @@ public:
 * the kernels.
 */
rng_coop = mem_alloc(num_global_elements * sizeof(RNG));
-   throughput_coop = mem_alloc(num_global_elements * 
throughput_size);
-   L_transparent_coop = mem_alloc(num_global_elements * 
L_transparent_size);
+   throughput_coop = mem_alloc(num_global_elements * 
sizeof(float3));
+   L_transparent_coop = mem_alloc(num_global_elements * 
sizeof(float));
PathRadiance_coop = mem_alloc(num_global_elements * 
sizeof(PathRadiance));
Ray_coop = mem_alloc(num_global_elements * sizeof(Ray));
PathState_coop = mem_alloc(num_global_elements * 
sizeof(PathState));
Intersection_coop = mem_alloc(num_global_elements * 
sizeof(Intersection));
-   AOAlpha_coop = mem_alloc(num_global_elements * 
AOAlpha_size);
-   AOBSDF_coop = mem_alloc(num_global_elements * 
AOBSDF_size);
+   AOAlpha_coop = mem_alloc(num_global_elements * 
sizeof(float3));
+   AOBSDF_coop = mem_alloc(num_global_elements * 
sizeof(float3));
AOLightRay_coop = mem_alloc(num_global_elements * 
sizeof(Ray));
BSDFEval_coop = mem_alloc(num_global_elements * 
sizeof(BsdfEval));
-   ISLamp_coop = mem_alloc(num_global_elements * 
ISLamp_size);
+   ISLamp_coop = mem_alloc(num_global_elements * 
sizeof(int));
LightRay_coop = mem_alloc(num_global_elements * 
sizeof(Ray));
Intersection_coop_AO = mem_alloc(num_global_elements * 
sizeof(Intersection));
Intersection_coop_DL = mem_alloc(num_global_elements * 
sizeof(Intersection));
@@ -2359,13 +2331,13 @@ public:
debugdata_coop = mem_alloc(num_global_elements * 
sizeof(DebugData));
 #endif
 
-   ray_state = 

[Bf-blender-cvs] [da1038c] master: UI: Copy to selected nodes now filtered by type

2015-05-13 Thread Campbell Barton
Commit: da1038c768557c88d29ce74a98026ca4915ab2c3
Author: Campbell Barton
Date:   Thu May 14 06:23:41 2015 +1000
Branches: master
https://developer.blender.org/rBda1038c768557c88d29ce74a98026ca4915ab2c3

UI: Copy to selected nodes now filtered by type

Was needed because sockets are very generic type which would match on unrelated 
values.

===

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

===

diff --git a/source/blender/editors/interface/interface_ops.c 
b/source/blender/editors/interface/interface_ops.c
index d13078f..643397b 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -44,6 +44,7 @@
 #include BKE_context.h
 #include BKE_screen.h
 #include BKE_global.h
+#include BKE_node.h
 #include BKE_text.h /* for UI_OT_reports_to_text */
 #include BKE_report.h
 
@@ -278,13 +279,48 @@ bool UI_context_copy_to_selected_list(
else if (RNA_struct_is_a(ptr-type, RNA_Sequence)) {
*r_lb = CTX_data_collection_get(C, 
selected_editable_sequences);
}
-   else if (RNA_struct_is_a(ptr-type, RNA_Node)) {
-   *r_lb = CTX_data_collection_get(C, selected_nodes);
-   }
-   else if (RNA_struct_is_a(ptr-type, RNA_NodeSocket)) {
-   if ((*r_path = RNA_path_resolve_from_type_to_property(ptr, 
prop, RNA_Node)) != NULL) {
-   *r_lb = CTX_data_collection_get(C, selected_nodes);
+   else if (RNA_struct_is_a(ptr-type, RNA_Node) ||
+RNA_struct_is_a(ptr-type, RNA_NodeSocket))
+   {
+   ListBase lb = {NULL, NULL};
+   char *path = NULL;
+   bNode *node = NULL;
+
+   /* Get the node we're editing */
+   if (RNA_struct_is_a(ptr-type, RNA_NodeSocket)) {
+   bNodeTree *ntree = ptr-id.data;
+   bNodeSocket *sock = ptr-data;
+   if (nodeFindNode(ntree, sock, node, NULL)) {
+   if ((path = 
RNA_path_resolve_from_type_to_property(ptr, prop, RNA_Node)) != NULL) {
+   /* we're good! */
+   }
+   else {
+   node = NULL;
+   }
+   }
+   }
+   else {
+   node = ptr-data;
+   }
+
+   /* Now filter by type */
+   if (node) {
+   CollectionPointerLink *link, *link_next;
+   lb = CTX_data_collection_get(C, selected_nodes);
+
+   for (link = lb.first; link; link = link_next) {
+   bNode *node_data = link-ptr.data;
+   link_next = link-next;
+
+   if (node_data-type != node-type) {
+   BLI_remlink(lb, link);
+   MEM_freeN(link);
+   }
+   }
}
+
+   *r_lb = lb;
+   *r_path = path;
}
else if (ptr-id.data) {
ID *id = ptr-id.data;

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


[Bf-blender-cvs] [e9263a8] gooseberry: Zoom to frame options, requested by the Hwoozeberry (dutch translation) team.

2015-05-13 Thread Antony Riakiotakis
Commit: e9263a8ee329afc894f226d770b12df37ff1ddd4
Author: Antony Riakiotakis
Date:   Wed May 13 20:30:53 2015 +0200
Branches: gooseberry
https://developer.blender.org/rBe9263a8ee329afc894f226d770b12df37ff1ddd4

Zoom to frame options, requested by the Hwoozeberry (dutch translation)
team.

There are 3 options here:

1) Keep range (previous behaviour)
2) Seconds - allows a specified offset in seconds around current frame
3) keyframes - zoom to include a number of keyframes around the cursor

Options 2 and 3 have their own properties to tweak the behaviour and all
options can be found in User Preferences-Interface under the 2D
viewports section.

Number 3 will probably need some refinement so commiting here for the
hwoozeberry team to test first.

===

M   release/scripts/startup/bl_ui/space_userpref.py
M   source/blender/editors/animation/anim_draw.c
M   source/blender/editors/include/ED_anim_api.h
M   source/blender/editors/include/UI_view2d.h
M   source/blender/editors/interface/view2d_ops.c
M   source/blender/editors/space_action/action_edit.c
M   source/blender/editors/space_graph/graph_edit.c
M   source/blender/makesdna/DNA_userdef_types.h
M   source/blender/makesrna/intern/rna_userdef.c

===

diff --git a/release/scripts/startup/bl_ui/space_userpref.py 
b/release/scripts/startup/bl_ui/space_userpref.py
index 91f7780..8e3727c 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -200,6 +200,11 @@ class USERPREF_PT_interface(Panel):
 col.label(text=2D Viewports:)
 col.prop(view, view2d_grid_spacing_min, text=Minimum Grid Spacing)
 col.prop(view, timecode_style)
+col.prop(view, view_frame_type)
+if (view.view_frame_type == 'SECONDS'):
+col.prop(view, view_frame_seconds)
+elif (view.view_frame_type == 'KEYFRAMES'):
+col.prop(view, view_frame_keyframes)
 
 row.separator()
 row.separator()
diff --git a/source/blender/editors/animation/anim_draw.c 
b/source/blender/editors/animation/anim_draw.c
index 54d371d..7d669e8 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -34,17 +34,25 @@
 #include DNA_scene_types.h
 #include DNA_space_types.h
 #include DNA_userdef_types.h
+#include DNA_screen_types.h
+#include DNA_object_types.h
+#include DNA_gpencil_types.h
+#include DNA_mask_types.h
 
 #include BLI_math.h
 #include BLI_timecode.h
 #include BLI_utildefines.h
+#include BLI_rect.h
+#include BLI_dlrbTree.h
 
 #include BKE_context.h
 #include BKE_global.h
 #include BKE_nla.h
+#include BKE_mask.h
 
 #include ED_anim_api.h
 #include ED_keyframes_edit.h
+#include ED_keyframes_draw.h
 
 #include RNA_access.h
 
@@ -381,4 +389,136 @@ float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, 
FCurve *fcu, short flag
return 1.0f;
 }
 
+static bool find_prev_next_keyframes(struct bContext *C, int *nextfra, int 
*prevfra) {
+   Scene *scene = CTX_data_scene(C);
+   Object *ob = CTX_data_active_object(C);
+   bGPdata *gpd = CTX_data_gpencil_data(C);
+   Mask *mask = CTX_data_edit_mask(C);
+   bDopeSheet ads = {NULL};
+   DLRBT_Tree keys;
+   ActKeyColumn *aknext, *akprev;
+   float cfranext, cfraprev;
+   bool donenext = false, doneprev = false;
+   int nextcount = 0, prevcount = 0;
+
+   cfranext = cfraprev = (float)(CFRA);
+
+   /* init binarytree-list for getting keyframes */
+   BLI_dlrbTree_init(keys);
+
+   /* seed up dummy dopesheet context with flags to perform necessary 
filtering */
+   if ((scene-flag  SCE_KEYS_NO_SELONLY) == 0) {
+   /* only selected channels are included */
+   ads.filterflag |= ADS_FILTER_ONLYSEL;
+   }
+
+   /* populate tree with keyframe nodes */
+   scene_to_keylist(ads, scene, keys, NULL);
+
+   if (ob)
+   ob_to_keylist(ads, ob, keys, NULL);
+
+   gpencil_to_keylist(ads, gpd, keys);
+
+   if (mask) {
+   MaskLayer *masklay = BKE_mask_layer_active(mask);
+   mask_to_keylist(ads, masklay, keys);
+   }
+
+   /* build linked-list for searching */
+   BLI_dlrbTree_linkedlist_sync(keys);
+
+   /* find matching keyframe in the right direction */
+   do {
+   aknext = (ActKeyColumn *)BLI_dlrbTree_search_next(keys, 
compare_ak_cfraPtr, cfranext);
+
+   if (aknext) {
+   if (CFRA == (int)aknext-cfra) {
+   /* make this the new starting point for the 
search and ignore */
+   cfranext = aknext-cfra;
+   }
+   else {
+   /* this changes the frame, so set the frame and 
we're done */
+  

[Bf-blender-cvs] [25e492e] GPU_data_request: new function: bind all attrib locations

2015-05-13 Thread Mike Erwin
Commit: 25e492edaa2cb57999ed229534a36fbeb841cf14
Author: Mike Erwin
Date:   Wed May 13 23:57:03 2015 -0400
Branches: GPU_data_request
https://developer.blender.org/rB25e492edaa2cb57999ed229534a36fbeb841cf14

new function: bind all attrib locations

Was binding these by hand in wireframe shader tests, but retyping the
name strings is a potential source of errors. Call this function instead
after creating VertexBuffer but before linking the GLSL program.

===

M   source/blender/gpu/GPUx_vbo.h
M   source/blender/gpu/intern/gpux_vbo.c

===

diff --git a/source/blender/gpu/GPUx_vbo.h b/source/blender/gpu/GPUx_vbo.h
index eec2841..2155e00 100644
--- a/source/blender/gpu/GPUx_vbo.h
+++ b/source/blender/gpu/GPUx_vbo.h
@@ -40,6 +40,12 @@ void GPUx_specify_attrib(VertexBuffer*, unsigned attrib_num,
 #endif
 GLenum comp_type, unsigned comp_ct, VertexFetchMode);
 
+#ifdef GENERIC_ATTRIB
+/* binds all our named attributes to internally-used GL indices
+ * call this before linking the program */
+void GPUx_bind_attrib_locations(const VertexBuffer*, GLuint program);
+#endif
+
 /* set value of single attribute of single vertex
  * incoming data must be of same type  size for this attribute */
 void GPUx_set_attrib(VertexBuffer*, unsigned attrib_num, unsigned vertex_num, 
const void *data);
diff --git a/source/blender/gpu/intern/gpux_vbo.c 
b/source/blender/gpu/intern/gpux_vbo.c
index 84d2697..eab3fec 100644
--- a/source/blender/gpu/intern/gpux_vbo.c
+++ b/source/blender/gpu/intern/gpux_vbo.c
@@ -285,6 +285,20 @@ void GPUx_specify_attrib(VertexBuffer *buff, unsigned 
attrib_num,
 #endif /* PRINT */
 }
 
+#ifdef GENERIC_ATTRIB
+void GPUx_bind_attrib_locations(const VertexBuffer *buff, GLuint program)
+{
+   unsigned a_idx;
+  #ifdef TRUST_NO_ONE
+   BLI_assert(glIsProgram(program));
+  #endif
+   for (a_idx = 0; a_idx  buff-attrib_ct; ++a_idx) {
+   const Attrib *a = buff-attribs + a_idx;
+   glBindAttribLocation(program, a_idx, a-name);
+   }
+}
+#endif /* GENERIC_ATTRIB */
+
 void GPUx_set_attrib(VertexBuffer *buff, unsigned attrib_num, unsigned 
vertex_num, const void *data)
 {
Attrib *attrib = buff-attribs + attrib_num;

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


[Bf-blender-cvs] [67eb2c7] master: Cycles: Remove Emission shaders from the graph if color or strength is 0.

2015-05-13 Thread Thomas Dinges
Commit: 67eb2c7897188c2e5134ea7df7bdc26e08fa5a7a
Author: Thomas Dinges
Date:   Thu May 14 01:08:45 2015 +0200
Branches: master
https://developer.blender.org/rB67eb2c7897188c2e5134ea7df7bdc26e08fa5a7a

Cycles: Remove Emission shaders from the graph if color or strength is 0.

===

M   intern/cycles/render/graph.cpp
M   intern/cycles/render/graph.h
M   intern/cycles/render/nodes.cpp

===

diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index ab89ee3..9adf6b4 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -404,6 +404,21 @@ void ShaderGraph::remove_unneeded_nodes()
}
}
}
+   else if(node-special_type == SHADER_SPECIAL_TYPE_EMISSION) {
+   EmissionNode *em = static_castEmissionNode*(node);
+
+   if(em-outputs[0]-links.size()) {
+   /* Black color or zero strength, remove node */
+   if((!em-inputs[0]-link  
em-inputs[0]-value == make_float3(0.0f, 0.0f, 0.0f)) ||
+  (!em-inputs[1]-link  
em-inputs[1]-value.x == 0.0f)) {
+   vectorShaderInput* inputs = 
em-outputs[0]-links;
+
+   relink(em-inputs, inputs, NULL);
+   removed[em-id] = true;
+   any_node_removed = true;
+   }
+   }
+   }
else if(node-special_type == SHADER_SPECIAL_TYPE_MIX_CLOSURE) {
MixClosureNode *mix = 
static_castMixClosureNode*(node);
 
diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h
index e627100..1a17909 100644
--- a/intern/cycles/render/graph.h
+++ b/intern/cycles/render/graph.h
@@ -83,6 +83,7 @@ enum ShaderNodeSpecialType {
SHADER_SPECIAL_TYPE_BACKGROUND,
SHADER_SPECIAL_TYPE_IMAGE_SLOT,
SHADER_SPECIAL_TYPE_CLOSURE,
+   SHADER_SPECIAL_TYPE_EMISSION,
 };
 
 /* Enum
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 7eaecc2..430c059 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1923,6 +1923,8 @@ bool SubsurfaceScatteringNode::has_bssrdf_bump()
 EmissionNode::EmissionNode()
 : ShaderNode(emission)
 {
+   special_type = SHADER_SPECIAL_TYPE_EMISSION;
+
add_input(Color, SHADER_SOCKET_COLOR, make_float3(0.8f, 0.8f, 0.8f));
add_input(Strength, SHADER_SOCKET_FLOAT, 10.0f);
add_input(SurfaceMixWeight, SHADER_SOCKET_FLOAT, 0.0f, 
ShaderInput::USE_SVM);

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


[Bf-blender-cvs] [0e80eb8] master: Cycles: Resize light_data after possible light removal.

2015-05-13 Thread Thomas Dinges
Commit: 0e80eb82e0667aa9b64d5a5e3e34c84d1d9957a3
Author: Thomas Dinges
Date:   Thu May 14 01:11:43 2015 +0200
Branches: master
https://developer.blender.org/rB0e80eb82e0667aa9b64d5a5e3e34c84d1d9957a3

Cycles: Resize light_data after possible light removal.

===

M   intern/cycles/render/light.cpp

===

diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index 817e1f5..1b7aa0e 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -545,8 +545,6 @@ void LightManager::device_update_points(Device *device, 
DeviceScene *dscene, Sce
if(scene-lights.size() == 0)
return;
 
-   float4 *light_data = 
dscene-light_data.resize(scene-lights.size()*LIGHT_SIZE);
-
/* remove background light? */
if(!(device-info.advanced_shading)) {
foreach(Light *light, scene-lights) {
@@ -557,6 +555,7 @@ void LightManager::device_update_points(Device *device, 
DeviceScene *dscene, Sce
}
}
 
+   float4 *light_data = 
dscene-light_data.resize(scene-lights.size()*LIGHT_SIZE);
int light_index = 0;
 
foreach(Light *light, scene-lights) {

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


[Bf-blender-cvs] [5b9a2f0] experimental-build: Revert Squashed commit of asset-experiments branch.

2015-05-13 Thread Bastien Montagne
Commit: 5b9a2f031cdebc6a2c05dbd6a4338d85213eb74c
Author: Bastien Montagne
Date:   Wed May 13 17:19:26 2015 +0200
Branches: experimental-build
https://developer.blender.org/rB5b9a2f031cdebc6a2c05dbd6a4338d85213eb74c

Revert Squashed commit of asset-experiments branch.

This reverts commit 41e471dca4a195e703cf1d21bf4c1e7a92ef46a4.

===

D   release/scripts/modules/bl_previews_utils/bl_previews_render.py
M   release/scripts/startup/bl_operators/wm.py
M   release/scripts/startup/bl_ui/space_filebrowser.py
M   release/scripts/startup/bl_ui/space_info.py
M   source/blender/blenkernel/BKE_idcode.h
M   source/blender/blenkernel/intern/group.c
M   source/blender/blenkernel/intern/icons.c
M   source/blender/blenkernel/intern/idcode.c
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenlib/BLI_fileops.h
M   source/blender/blenlib/BLI_fileops_types.h
M   source/blender/blenlib/intern/BLI_filelist.c
M   source/blender/blenloader/BLO_readfile.h
M   source/blender/blenloader/intern/readblenentry.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/editors/include/ED_fileselect.h
M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/include/UI_interface_icons.h
M   source/blender/editors/interface/interface.c
M   source/blender/editors/interface/interface_icons.c
M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/interface_templates.c
M   source/blender/editors/space_file/file_draw.c
M   source/blender/editors/space_file/file_intern.h
M   source/blender/editors/space_file/file_ops.c
M   source/blender/editors/space_file/filelist.c
M   source/blender/editors/space_file/filelist.h
M   source/blender/editors/space_file/filesel.c
M   source/blender/editors/space_file/space_file.c
M   source/blender/imbuf/IMB_thumbs.h
M   source/blender/imbuf/intern/thumbs.c
M   source/blender/imbuf/intern/thumbs_blend.c
M   source/blender/makesdna/DNA_ID.h
M   source/blender/makesdna/DNA_group_types.h
M   source/blender/makesdna/DNA_object_types.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesdna/DNA_space_types.h
M   source/blender/makesrna/intern/rna_ID.c
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/python/intern/bpy_app.c
M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/WM_types.h
M   source/blender/windowmanager/intern/wm_operators.c
M   source/blender/windowmanager/intern/wm_window.c
M   source/blender/windowmanager/wm_event_types.h

===

diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py 
b/release/scripts/modules/bl_previews_utils/bl_previews_render.py
deleted file mode 100644
index 3da7355..000
--- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py
+++ /dev/null
@@ -1,459 +0,0 @@
-# * BEGIN GPL LICENSE BLOCK *
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# * END GPL LICENSE BLOCK *
-
-# pep8 compliant
-
-# Populate a template file (POT format currently) from Blender RNA/py/C data.
-# Note: This script is meant to be used from inside Blender!
-
-import collections
-import os
-import sys
-
-import bpy
-from mathutils import Vector, Euler
-
-
-INTERN_PREVIEW_TYPES = {'MATERIAL', 'LAMP', 'WORLD', 'TEXTURE', 'IMAGE'}
-OBJECT_TYPES_RENDER = {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}
-
-
-def rna_backup_gen(data, include_props=None, exclude_props=None, root=()):
-# only writable properties...
-for p in data.bl_rna.properties:
-pid = p.identifier
-if pid in {'rna_type',}:
-continue
-path = root + (pid,)
-if include_props is not None and path not in include_props:
-continue
-if exclude_props is not None and path in exclude_props:
-continue
-val = getattr(data, pid)
-if val is not None and p.type == 'POINTER':
-# recurse!
-

[Bf-blender-cvs] [604a38f] experimental-build: Merge branch 'master' into experimental-build

2015-05-13 Thread Bastien Montagne
Commit: 604a38f2a43265fb11b0d8c7fb3c548f7af12ad6
Author: Bastien Montagne
Date:   Wed May 13 17:18:13 2015 +0200
Branches: experimental-build
https://developer.blender.org/rB604a38f2a43265fb11b0d8c7fb3c548f7af12ad6

Merge branch 'master' into experimental-build

===



===



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


[Bf-blender-cvs] [9207c8d] master: Fix project paint worldspace coord calc from seam

2015-05-13 Thread Campbell Barton
Commit: 9207c8d669319d6c09e8498703cd8192e90496c6
Author: Campbell Barton
Date:   Thu May 14 13:03:24 2015 +1000
Branches: master
https://developer.blender.org/rB9207c8d669319d6c09e8498703cd8192e90496c6

Fix project paint worldspace coord calc from seam

Surprising this worked at all, would show errors with non-flat-quads.

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c 
b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 2923685..330b93b 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -2534,8 +2534,6 @@ static void project_paint_face_init(
 
int has_x_isect = 0, has_isect = 0; /* for early loop exit */
 
-   int i1, i2, i3;
-
float uv_clip[8][2];
int uv_clip_tot;
const bool is_ortho = ps-is_ortho;
@@ -2584,6 +2582,8 @@ static void project_paint_face_init(
}
 
do {
+   int i1, i2, i3;
+
if (side == 1) {
i1 = 0; i2 = 2; i3 = 3;
}
@@ -2778,7 +2778,7 @@ static void project_paint_face_init(
{
if (len_squared_v2v2(vCoSS[fidx1], 
vCoSS[fidx2])  FLT_EPSILON) { /* avoid div by zero */
if (mf-v4) {
-   if (fidx1 == 2 || fidx2 
== 2) side = 1;
+   if (fidx1 == 3 || fidx2 
== 3) side = 1;
else side = 0;
}
 
@@ -2841,14 +2841,11 @@ static void project_paint_face_init(

{

/* Only bother calculating the weights if we intersect */

if (ps-do_mask_normal || ps-dm_mtface_clone) {
-   
float uv_fac;
+   
const float uv_fac = fac1 + (fac * (fac2 - fac1));
 #if 0

/* get the UV on the line since we want to copy the pixels from 
there for bleeding */

float uv_close[2];
-   
uv_fac = closest_to_line_v2(uv_close, uv, 
tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2]);
-   
if  (uv_fac  0.0f) copy_v2_v2(uv_close, 
tf_uv_pxoffset[fidx1]);
-   
else if (uv_fac  1.0f) copy_v2_v2(uv_close, 
tf_uv_pxoffset[fidx2]);
-
+   
interp_v2_v2v2(uv_close, tf_uv_pxoffset[fidx1], 
tf_uv_pxoffset[fidx2], uv_fac);

if (side) {

barycentric_weights_v2(tf_uv_pxoffset[0], 
tf_uv_pxoffset[2], tf_uv_pxoffset[3], uv_close, w);

}
@@ -2858,8 +2855,6 @@ static void project_paint_face_init(
 #else
 

/* Cheat, we know where we are along the edge so work out the 
weights from that */
-   
uv_fac = fac1 + (uv_fac * (fac2 - fac1));
-

w[0] = w[1] = w[2] = 0.0;

if (side) {

w[fidx1 ? fidx1 - 1 : 0] = 1.0f - uv_fac;
@@ -2874,8 +2869,8 @@ static void project_paint_face_init(
 

/* a pity we need to get the worldspace pixel location here */
  

[Bf-blender-cvs] [434086d] master: install_deps.sh: correct typo

2015-05-13 Thread Campbell Barton
Commit: 434086dc53aa03205714bb0415550bb158edcf43
Author: Campbell Barton
Date:   Thu May 14 13:13:13 2015 +1000
Branches: master
https://developer.blender.org/rB434086dc53aa03205714bb0415550bb158edcf43

install_deps.sh: correct typo

===

M   build_files/build_environment/install_deps.sh

===

diff --git a/build_files/build_environment/install_deps.sh 
b/build_files/build_environment/install_deps.sh
index ea60eb3..0873263 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -1374,7 +1374,7 @@ EOF
 cmake_d=$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst
 cmake_d=$cmake_d -D LLVM_ENABLE_FFI=ON
 cmake_d=$cmake_d -D LLVM_TARGETS_TO_BUILD=X86
-cmake_d=$cmake_d -D -DLLVM_ENABLE_TERMINFO=OFF
+cmake_d=$cmake_d -D LLVM_ENABLE_TERMINFO=OFF
 
 if [ -d $_FFI_INCLUDE_DIR ]; then
   cmake_d=$cmake_d -D FFI_INCLUDE_DIR=$_FFI_INCLUDE_DIR

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


[Bf-blender-cvs] [41e471d] experimental-build: Squashed commit of asset-experiments branch.

2015-05-13 Thread Bastien Montagne
Commit: 41e471dca4a195e703cf1d21bf4c1e7a92ef46a4
Author: Bastien Montagne
Date:   Wed May 13 17:18:50 2015 +0200
Branches: experimental-build
https://developer.blender.org/rB41e471dca4a195e703cf1d21bf4c1e7a92ef46a4

Squashed commit of asset-experiments branch.

===

A   release/scripts/modules/bl_previews_utils/bl_previews_render.py
M   release/scripts/startup/bl_operators/wm.py
M   release/scripts/startup/bl_ui/space_filebrowser.py
M   release/scripts/startup/bl_ui/space_info.py
M   source/blender/blenkernel/BKE_idcode.h
M   source/blender/blenkernel/intern/group.c
M   source/blender/blenkernel/intern/icons.c
M   source/blender/blenkernel/intern/idcode.c
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenlib/BLI_fileops.h
M   source/blender/blenlib/BLI_fileops_types.h
M   source/blender/blenlib/intern/BLI_filelist.c
M   source/blender/blenloader/BLO_readfile.h
M   source/blender/blenloader/intern/readblenentry.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/editors/include/ED_fileselect.h
M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/include/UI_interface_icons.h
M   source/blender/editors/interface/interface.c
M   source/blender/editors/interface/interface_icons.c
M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/interface_templates.c
M   source/blender/editors/space_file/file_draw.c
M   source/blender/editors/space_file/file_intern.h
M   source/blender/editors/space_file/file_ops.c
M   source/blender/editors/space_file/filelist.c
M   source/blender/editors/space_file/filelist.h
M   source/blender/editors/space_file/filesel.c
M   source/blender/editors/space_file/space_file.c
M   source/blender/imbuf/IMB_thumbs.h
M   source/blender/imbuf/intern/thumbs.c
M   source/blender/imbuf/intern/thumbs_blend.c
M   source/blender/makesdna/DNA_ID.h
M   source/blender/makesdna/DNA_group_types.h
M   source/blender/makesdna/DNA_object_types.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesdna/DNA_space_types.h
M   source/blender/makesrna/intern/rna_ID.c
M   source/blender/makesrna/intern/rna_space.c
M   source/blender/python/intern/bpy_app.c
M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/WM_types.h
M   source/blender/windowmanager/intern/wm_operators.c
M   source/blender/windowmanager/intern/wm_window.c
M   source/blender/windowmanager/wm_event_types.h

===

diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py 
b/release/scripts/modules/bl_previews_utils/bl_previews_render.py
new file mode 100644
index 000..3da7355
--- /dev/null
+++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py
@@ -0,0 +1,459 @@
+# * BEGIN GPL LICENSE BLOCK *
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# * END GPL LICENSE BLOCK *
+
+# pep8 compliant
+
+# Populate a template file (POT format currently) from Blender RNA/py/C data.
+# Note: This script is meant to be used from inside Blender!
+
+import collections
+import os
+import sys
+
+import bpy
+from mathutils import Vector, Euler
+
+
+INTERN_PREVIEW_TYPES = {'MATERIAL', 'LAMP', 'WORLD', 'TEXTURE', 'IMAGE'}
+OBJECT_TYPES_RENDER = {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}
+
+
+def rna_backup_gen(data, include_props=None, exclude_props=None, root=()):
+# only writable properties...
+for p in data.bl_rna.properties:
+pid = p.identifier
+if pid in {'rna_type',}:
+continue
+path = root + (pid,)
+if include_props is not None and path not in include_props:
+continue
+if exclude_props is not None and path in exclude_props:
+continue
+val = getattr(data, pid)
+if val is not None and p.type == 'POINTER':
+# recurse!
+yield from rna_backup_gen(val, include_props, exclude_props, 
root=path)
+   

[Bf-blender-cvs] [d58765c] GPU_data_request: fix mismatched memory free

2015-05-13 Thread Mike Erwin
Commit: d58765ccb312690429ce5449a5fc264583838313
Author: Mike Erwin
Date:   Thu May 14 00:38:10 2015 -0400
Branches: GPU_data_request
https://developer.blender.org/rBd58765ccb312690429ce5449a5fc264583838313

fix mismatched memory free

This string is copied with strdup during GPUx_specify_attrib, needs a
plain free.

===

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

===

diff --git a/source/blender/gpu/intern/gpux_vbo.c 
b/source/blender/gpu/intern/gpux_vbo.c
index eab3fec..1888617 100644
--- a/source/blender/gpu/intern/gpux_vbo.c
+++ b/source/blender/gpu/intern/gpux_vbo.c
@@ -4,6 +4,7 @@
 #include GPU_extensions.h
 #include BLI_utildefines.h
 #include MEM_guardedalloc.h
+#include stdlib.h
 #include string.h
 
 #ifdef PRINT
@@ -169,7 +170,7 @@ void GPUx_vertex_buffer_discard(VertexBuffer *buff)
buffer_id_free(a-vbo_id);
 #endif /* USE_VBO */
 #ifdef GENERIC_ATTRIB
-   MEM_freeN(a-name);
+   free(a-name);
 #endif /* GENERIC_ATTRIB */
if (a-data)
MEM_freeN(a-data);

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


[Bf-blender-cvs] [7969b23] master: Fix T39775: Skin modifier crash

2015-05-13 Thread Campbell Barton
Commit: 7969b238dbfd697a2590d654090080c862346d76
Author: Campbell Barton
Date:   Wed May 13 16:01:43 2015 +1000
Branches: master
https://developer.blender.org/rB7969b238dbfd697a2590d654090080c862346d76

Fix T39775: Skin modifier crash

===

M   source/blender/modifiers/intern/MOD_skin.c

===

diff --git a/source/blender/modifiers/intern/MOD_skin.c 
b/source/blender/modifiers/intern/MOD_skin.c
index 6c09622..1b8b296 100644
--- a/source/blender/modifiers/intern/MOD_skin.c
+++ b/source/blender/modifiers/intern/MOD_skin.c
@@ -104,6 +104,9 @@ typedef struct Frame {
/* Merge to target frame/corner (no merge if frame is null) */
struct Frame *frame;
int corner;
+   /* checked to avoid chaining.
+* (merging when we're already been referenced), see T39775 */
+   unsigned int is_target : 1;
} merge[4];
 
/* For hull frames, whether each vertex is detached or not */
@@ -363,7 +366,7 @@ static void merge_frame_corners(Frame **frames, int 
totframe)
 
/* Compare with each corner of all other 
frames... */
for (l = 0; l  4; l++) {
-   if (frames[k]-merge[l].frame)
+   if (frames[k]-merge[l].frame || 
frames[k]-merge[l].is_target)
continue;
 
/* Some additional concerns that could 
be checked
@@ -393,6 +396,7 @@ static void merge_frame_corners(Frame **frames, int 
totframe)
 
frames[k]-merge[l].frame = 
frames[i];
frames[k]-merge[l].corner = j;
+   frames[i]-merge[j].is_target = 
true;
 
/* Can't merge another corner 
into the same
 * frame corner, so move on to 
frame k+1 */

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


[Bf-blender-cvs] [7742a8f] master: Cleanup: reduce scope for win32, Linux vars

2015-05-13 Thread Campbell Barton
Commit: 7742a8f09c1a631adbbd87a407d55420f775fa4e
Author: Campbell Barton
Date:   Wed May 13 12:49:33 2015 +1000
Branches: master
https://developer.blender.org/rB7742a8f09c1a631adbbd87a407d55420f775fa4e

Cleanup: reduce scope for win32, Linux vars

===

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

===

diff --git a/source/blender/blenkernel/intern/appdir.c 
b/source/blender/blenkernel/intern/appdir.c
index 4c7cda9..e4ed8c3 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -514,31 +514,34 @@ const char *BKE_appdir_folder_id_version(const int 
folder_id, const int ver, con
  */
 static void bli_where_am_i(char *fullname, const size_t maxlen, const char 
*name)
 {
-   const char *path = NULL;
-
 #ifdef WITH_BINRELOC
/* linux uses binreloc since argv[0] is not reliable, call br_init( 
NULL ) first */
-   path = br_find_exe(NULL);
-   if (path) {
-   BLI_strncpy(fullname, path, maxlen);
-   free((void *)path);
-   return;
+   {
+   const char *path = NULL;
+   path = br_find_exe(NULL);
+   if (path) {
+   BLI_strncpy(fullname, path, maxlen);
+   free((void *)path);
+   return;
+   }
}
 #endif
 
 #ifdef _WIN32
-   wchar_t *fullname_16 = MEM_mallocN(maxlen * sizeof(wchar_t), 
ProgramPath);
-   if (GetModuleFileNameW(0, fullname_16, maxlen)) {
-   conv_utf_16_to_8(fullname_16, fullname, maxlen);
-   if (!BLI_exists(fullname)) {
-   printf(path can't be found: \%.*s\\n, (int)maxlen, 
fullname);
-   MessageBox(NULL, path contains invalid characters or 
is too long (see console), Error, MB_OK);
+   {
+   wchar_t *fullname_16 = MEM_mallocN(maxlen * sizeof(wchar_t), 
ProgramPath);
+   if (GetModuleFileNameW(0, fullname_16, maxlen)) {
+   conv_utf_16_to_8(fullname_16, fullname, maxlen);
+   if (!BLI_exists(fullname)) {
+   printf(path can't be found: \%.*s\\n, 
(int)maxlen, fullname);
+   MessageBox(NULL, path contains invalid 
characters or is too long (see console), Error, MB_OK);
+   }
+   MEM_freeN(fullname_16);
+   return;
}
+
MEM_freeN(fullname_16);
-   return;
}
-
-   MEM_freeN(fullname_16);
 #endif
 
/* unix and non linux */

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


[Bf-blender-cvs] [3e78275] master: Project Paint: simplify uv bleed factor calc

2015-05-13 Thread Campbell Barton
Commit: 3e782756e386d036edce24d11ee092695b283cda
Author: Campbell Barton
Date:   Wed May 13 17:48:54 2015 +1000
Branches: master
https://developer.blender.org/rB3e782756e386d036edce24d11ee092695b283cda

Project Paint: simplify uv bleed factor calc

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c 
b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 00fac6b..400202a 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -2742,7 +2742,7 @@ static void project_paint_face_init(
int fidx1, fidx2; /* face edge pairs - loop throuh 
these ((0,1), (1,2), (2,3), (3,0)) or ((0,1), (1,2), (2,0)) for a tri */
 
float seam_subsection[4][2];
-   float fac1, fac2, ftot;
+   float fac1, fac2;
 
if (outset_uv[0][0] == FLT_MAX) /* first time 
initialize */
uv_image_outset(tf_uv_pxoffset, outset_uv, 
ps-seam_bleed_px, ibuf-x, ibuf-y, mf-v4 != 0, 
(ps-faceWindingFlags[face_index]  PROJ_FACE_WINDING_CW) == 0);
@@ -2776,17 +2776,14 @@ static void project_paint_face_init(
if ((face_seam_flag  (1  fidx1))  /* 
1fidx1 - PROJ_FACE_SEAM# */
line_clip_rect2f(bucket_bounds, 
vCoSS[fidx1], vCoSS[fidx2], bucket_clip_edges[0], bucket_clip_edges[1]))
{
-
-   ftot = len_v2v2(vCoSS[fidx1], 
vCoSS[fidx2]); /* screenspace edge length */
-
-   if (ftot  0.0f) { /* avoid div by zero 
*/
+   if (len_squared_v2v2(vCoSS[fidx1], 
vCoSS[fidx2])  FLT_EPSILON) { /* avoid div by zero */
if (mf-v4) {
if (fidx1 == 2 || fidx2 
== 2) side = 1;
else side = 0;
}
 
-   fac1 = len_v2v2(vCoSS[fidx1], 
bucket_clip_edges[0]) / ftot;
-   fac2 = len_v2v2(vCoSS[fidx1], 
bucket_clip_edges[1]) / ftot;
+   fac1 = 
line_point_factor_v2(bucket_clip_edges[0], vCoSS[fidx1], vCoSS[fidx2]);
+   fac2 = 
line_point_factor_v2(bucket_clip_edges[1], vCoSS[fidx1], vCoSS[fidx2]);
 

interp_v2_v2v2(seam_subsection[0], tf_uv_pxoffset[fidx1], 
tf_uv_pxoffset[fidx2], fac1);

interp_v2_v2v2(seam_subsection[1], tf_uv_pxoffset[fidx1], 
tf_uv_pxoffset[fidx2], fac2);

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


[Bf-blender-cvs] [a050d60] master: Project Paint: resolve ugly bleed artifacts

2015-05-13 Thread Campbell Barton
Commit: a050d6063c78004de8b4b5945cb03bb43d84c8de
Author: Campbell Barton
Date:   Wed May 13 18:04:46 2015 +1000
Branches: master
https://developer.blender.org/rBa050d6063c78004de8b4b5945cb03bb43d84c8de

Project Paint: resolve ugly bleed artifacts

Use the bilinear reverse to find the pixel to bleed from.
Was using pixel space which didn't work well.

===

M   source/blender/blenlib/BLI_math_geom.h
M   source/blender/blenlib/intern/math_geom.c
M   source/blender/editors/sculpt_paint/paint_image_proj.c

===

diff --git a/source/blender/blenlib/BLI_math_geom.h 
b/source/blender/blenlib/BLI_math_geom.h
index 4f7a331..4a75e83 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -259,6 +259,7 @@ void resolve_tri_uv_v3(float r_uv[2], const float st[3], 
const float st0[3], con
 void resolve_quad_uv_v2(float r_uv[2], const float st[2], const float st0[2], 
const float st1[2], const float st2[2], const float st3[2]);
 void resolve_quad_uv_v2_deriv(float r_uv[2], float r_deriv[2][2],
   const float st[2], const float st0[2], const 
float st1[2], const float st2[2], const float st3[2]);
+float resolve_quad_u_v2(const float st[2], const float st0[2], const float 
st1[2], const float st2[2], const float st3[2]);
 
 /* use to find the point of a UV on a face */
 void interp_bilinear_quad_v3(float data[4][3], float u, float v, float res[3]);
diff --git a/source/blender/blenlib/intern/math_geom.c 
b/source/blender/blenlib/intern/math_geom.c
index ba1f448..82062e8 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -3101,6 +3101,43 @@ void resolve_quad_uv_v2_deriv(float r_uv[2], float 
r_deriv[2][2],
}
 }
 
+/* a version of resolve_quad_uv_v2 that only calculates the 'u' */
+float resolve_quad_u_v2(
+const float st[2],
+const float st0[2], const float st1[2], const float st2[2], const 
float st3[2])
+{
+   const double signed_area = (st0[0] * st1[1] - st0[1] * st1[0]) + 
(st1[0] * st2[1] - st1[1] * st2[0]) +
+  (st2[0] * st3[1] - st2[1] * st3[0]) + 
(st3[0] * st0[1] - st3[1] * st0[0]);
+
+   /* X is 2D cross product (determinant)
+* A = (p0 - p) X (p0 - p3)*/
+   const double a = (st0[0] - st[0]) * (st0[1] - st3[1]) - (st0[1] - 
st[1]) * (st0[0] - st3[0]);
+
+   /* B = ( (p0 - p) X (p1 - p2) + (p1 - p) X (p0 - p3) ) / 2 */
+   const double b = 0.5 * (double)(((st0[0] - st[0]) * (st1[1] - st2[1]) - 
(st0[1] - st[1]) * (st1[0] - st2[0])) +
+   ((st1[0] - st[0]) * (st0[1] - st3[1]) - 
(st1[1] - st[1]) * (st0[0] - st3[0])));
+
+   /* C = (p1-p) X (p1-p2) */
+   const double fC = (st1[0] - st[0]) * (st1[1] - st2[1]) - (st1[1] - 
st[1]) * (st1[0] - st2[0]);
+   double denom = a - 2 * b + fC;
+
+   if (IS_ZERO(denom) != 0) {
+   const double fDen = a - fC;
+   if (IS_ZERO(fDen) == 0)
+   return (float)(a / fDen);
+   else
+   return 0.0f;
+   }
+   else {
+   const double desc_sq = b * b - a * fC;
+   const double desc = sqrt(desc_sq  0.0 ? 0.0 : desc_sq);
+   const double s = signed_area  0 ? (-1.0) : 1.0;
+
+   return (float)(((a - b) + s * desc) / denom);
+   }
+}
+
+
 #undef IS_ZERO
 
 /* reverse of the functions above */
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c 
b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 400202a..8bf4395 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -2825,11 +2825,8 @@ static void project_paint_face_init(
 

/* Since this is a seam we need to work out where on the line this pixel is */

//fac = line_point_factor_v2(uv, uv_seam_quad[0], uv_seam_quad[1]);
-
-   
fac = line_point_factor_v2(uv, seam_subsection[0], seam_subsection[1]);
-   
if  (fac  0.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[0]); }
-   
else if (fac  1.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[1]); }
-   
else { interp_v3_v3v3(pixelScreenCo, edge_verts_inset_clip[0], 
edge_verts_inset_clip[1], fac); }
+   
fac