[Bf-blender-cvs] [16597b6] master: Fix camera view-border line width

2016-04-05 Thread Campbell Barton
Commit: 16597b691ac911ec54da3c0aeff36278a8107b22
Author: Campbell Barton
Date:   Wed Apr 6 14:27:37 2016 +1000
Branches: master
https://developer.blender.org/rB16597b691ac911ec54da3c0aeff36278a8107b22

Fix camera view-border line width

===

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

===

diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index 8c2d787..7f1a7a0 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1110,6 +1110,8 @@ static void drawviewborder(Scene *scene, ARegion *ar, 
View3D *v3d)
x2 = viewborder.xmax;
y2 = viewborder.ymax;

+   glLineWidth(1.0f);
+
/* apply offsets so the real 3D camera shows through */
 
/* note: quite un-scientific but without this bit extra
@@ -1135,7 +1137,6 @@ static void drawviewborder(Scene *scene, ARegion *ar, 
View3D *v3d)
glEnable(GL_BLEND);
glColor4f(0, 0, 0, ca->passepartalpha);
}
-   glLineWidth(1.0f);
 
if (x1i > 0.0f)
glRectf(0.0, winy, x1i, 0.0);

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


[Bf-blender-cvs] [78d39ca] master: Tweak fill-region method to produce fewer 'gaps'

2016-04-05 Thread Campbell Barton
Commit: 78d39cad8bc9c494efb384e833e75d4a3086a025
Author: Campbell Barton
Date:   Wed Apr 6 15:07:37 2016 +1000
Branches: master
https://developer.blender.org/rB78d39cad8bc9c494efb384e833e75d4a3086a025

Tweak fill-region method to produce fewer 'gaps'

===

M   source/blender/bmesh/tools/bmesh_path_region.c

===

diff --git a/source/blender/bmesh/tools/bmesh_path_region.c 
b/source/blender/bmesh/tools/bmesh_path_region.c
index e68dc86..389bcc7 100644
--- a/source/blender/bmesh/tools/bmesh_path_region.c
+++ b/source/blender/bmesh/tools/bmesh_path_region.c
@@ -315,12 +315,27 @@ static LinkNode *mesh_calc_path_region_elem(
BMLoop *l_first, *l_iter;
l_iter = l_first = BM_FACE_FIRST_LOOP(f);
bool ok = true;
+#if 0
do {
if 
(!bm_vert_region_test_chain(l_iter->v, depths, pass)) {
ok = false;
break;
}
} while ((l_iter = l_iter->next) != l_first);
+#else
+   /* Allowing a single failure on a face gives 
fewer 'gaps'.
+* While correct, in practice they're often 
part of what a user would consider the 'region'. */
+   int ok_tests = f->len > 3 ? 1 : 0;  /* how many 
times we may fail */
+   do {
+   if 
(!bm_vert_region_test_chain(l_iter->v, depths, pass)) {
+   if (ok_tests == 0) {
+   ok = false;
+   break;
+   }
+   ok_tests--;
+   }
+   } while ((l_iter = l_iter->next) != l_first);
+#endif
 
if (ok) {
BLI_linklist_prepend(, f);

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


[Bf-blender-cvs] [28dad2e] master: Correct error checking for wrong frame range

2016-04-05 Thread Campbell Barton
Commit: 28dad2ec129bd69a17f8f74c2f822bdd2cd90917
Author: Campbell Barton
Date:   Wed Apr 6 09:41:30 2016 +1000
Branches: master
https://developer.blender.org/rB28dad2ec129bd69a17f8f74c2f822bdd2cd90917

Correct error checking for wrong frame range

===

M   source/creator/creator_args.c

===

diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index dc590db..3d12935 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -1335,7 +1335,7 @@ static int arg_handle_render_frame(int argc, const char 
**argv, void *data)
for (int i = 0; i < frames_range_len; i++) {
/* We could pass in frame ranges,
 * but prefer having exact behavior as passing 
in multiple frames */
-   if ((frame_range_arr[i][0] < 
frame_range_arr[i][1]) == 0) {
+   if ((frame_range_arr[i][0] <= 
frame_range_arr[i][1]) == 0) {
printf("\nWarning: negative range 
ignored '%s %s'.\n", arg_id, argv[1]);
}

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


[Bf-blender-cvs] [f5fb436] master: Cleanup: indentation

2016-04-05 Thread Campbell Barton
Commit: f5fb4361d20f5e7b34866262541eaa1e5319e57f
Author: Campbell Barton
Date:   Wed Apr 6 09:30:20 2016 +1000
Branches: master
https://developer.blender.org/rBf5fb4361d20f5e7b34866262541eaa1e5319e57f

Cleanup: indentation

===

M   intern/ghost/intern/GHOST_SystemX11.cpp

===

diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp 
b/intern/ghost/intern/GHOST_SystemX11.cpp
index beb8ab5..3e1dbd1 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -787,40 +787,40 @@ GHOST_SystemX11::processEvent(XEvent *xe)
GHOST_TKey gkey;
 
 #ifdef USE_NON_LATIN_KB_WORKAROUND
-/* XXX Code below is kinda awfully convoluted... Issues are:
- *
- * - In keyboards like latin ones, numbers need a 'Shift' to 
be accessed but key_sym
- *   is unmodified (or anyone swapping the keys with xmodmap).
- *
- * - XLookupKeysym seems to always use first defined keymap 
(see T47228), which generates
- *   keycodes unusable by convertXKey for non-latin-compatible 
keymaps.
- *
- * To address this, we:
- *
- * - Try to get a 'number' key_sym using XLookupKeysym (with 
or without shift modifier).
- * - Fallback to XLookupString to get a key_sym from active 
user-defined keymap.
- *
- * Note that this enforces users to use an ascii-compatible keymap 
with Blender - but at least it gives
- * predictable and consistent results.
- *
- * Also, note that nothing in XLib sources [1] makes it obvious 
why those two functions give different
- * key_sym results...
- *
- * [1] 
http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/KeyBind.c
- */
-if ((xke->keycode >= 10 && xke->keycode < 20)) {
-key_sym = XLookupKeysym(xke, ShiftMask);
-if (!((key_sym >= XK_0) && (key_sym <= XK_9))) {
+   /* XXX Code below is kinda awfully convoluted... Issues 
are:
+*
+* - In keyboards like latin ones, numbers need a 
'Shift' to be accessed but key_sym
+*   is unmodified (or anyone swapping the keys 
with xmodmap).
+*
+* - XLookupKeysym seems to always use first 
defined keymap (see T47228), which generates
+*   keycodes unusable by convertXKey for 
non-latin-compatible keymaps.
+*
+* To address this, we:
+*
+* - Try to get a 'number' key_sym using 
XLookupKeysym (with or without shift modifier).
+* - Fallback to XLookupString to get a key_sym 
from active user-defined keymap.
+*
+* Note that this enforces users to use an 
ascii-compatible keymap with Blender - but at least it gives
+* predictable and consistent results.
+*
+* Also, note that nothing in XLib sources [1] makes it 
obvious why those two functions give different
+* key_sym results...
+*
+* [1] 
http://cgit.freedesktop.org/xorg/lib/libX11/tree/src/KeyBind.c
+*/
+   if ((xke->keycode >= 10 && xke->keycode < 20)) {
+   key_sym = XLookupKeysym(xke, ShiftMask);
+   if (!((key_sym >= XK_0) && (key_sym <= XK_9))) {
key_sym = XLookupKeysym(xke, 0);
-}
-}
+   }
+   }
else {
key_sym = XLookupKeysym(xke, 0);
}
 
-if (!XLookupString(xke, , 1, _sym_str, NULL)) {
-ascii = '\0';
-}
+   if (!XLookupString(xke, , 1, _sym_str, NULL)) 
{
+   ascii = '\0';
+   }
 
if ((gkey = convertXKey(key_sym)) == GHOST_kKeyUnknown) 
{
gkey = convertXKey(key_sym_str);
@@ -1385,8 +1385,8 @@ GHOST_TSuccess
 GHOST_SystemX11::
 setCursorPosition(
GHOST_TInt32 x,
-   GHOST_TInt32 y
-) {
+   GHOST_TInt32 y)
+{
 
/* This is a brute force move in screen coordinates
 * XWarpPointer does relative moves so first determine the

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

[Bf-blender-cvs] [16f919e] master: Render frame arg parsing, list and range support

2016-04-05 Thread Campbell Barton
Commit: 16f919ea582be01faf7cced7aafa5bad5842260d
Author: Campbell Barton
Date:   Wed Apr 6 07:34:20 2016 +1000
Branches: master
https://developer.blender.org/rB16f919ea582be01faf7cced7aafa5bad5842260d

Render frame arg parsing, list and range support

Support a comma separated list of frames, as well as frame ranges using the 
'..' separator.

eg: `blender my.blend --render-frame 1,2,10..40,100..200`

===

M   source/creator/creator_args.c

===

diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index b44c6d0..c490a9c 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -99,7 +99,7 @@
  * \{ */
 
 static bool parse_int_relative(
-const char *str, int pos, int neg,
+const char *str, const char *str_end_test, int pos, int neg,
 int *r_value, const char **r_err_msg)
 {
char *str_end = NULL;
@@ -120,7 +120,7 @@ static bool parse_int_relative(
}
 
 
-   if (*str_end != '\0') {
+   if (*str_end != '\0' && (str_end != str_end_test)) {
static const char *msg = "not a number";
*r_err_msg = msg;
return false;
@@ -136,11 +136,48 @@ static bool parse_int_relative(
}
 }
 
+static const char *parse_int_range_sep_search(const char *str, const char 
*str_end_test)
+{
+   const char *str_end_range = NULL;
+   if (str_end_test) {
+   str_end_range = memchr(str, '.', (str_end_test - str) - 1);
+   if (str_end_range && (str_end_range[1] != '.')) {
+   str_end_range = NULL;
+   }
+   }
+   else {
+   str_end_range = strstr(str, "..");
+   if (str_end_range && (str_end_range[2] == '\0')) {
+   str_end_range = NULL;
+   }
+   }
+   return str_end_range;
+}
+
+/**
+ * Parse a number as a range, eg: `1..4`.
+ *
+ * The \a str_end_range argument is a result of #parse_int_range_sep_search.
+ */
+static bool parse_int_range_relative(
+const char *str, const char *str_end_range, const char *str_end_test, 
int pos, int neg,
+int r_value_range[2], const char **r_err_msg)
+{
+   if (parse_int_relative(str,   str_end_range, pos, neg, 
_value_range[0], r_err_msg) &&
+   parse_int_relative(str_end_range + 2, str_end_test,  pos, neg, 
_value_range[1], r_err_msg))
+   {
+   return true;
+   }
+   else {
+   return false;
+   }
+}
+
 static bool parse_int_relative_clamp(
-const char *str, int pos, int neg, int min, int max,
+const char *str, const char *str_end_test, int pos, int neg, int min, 
int max,
 int *r_value, const char **r_err_msg)
 {
-   if (parse_int_relative(str, pos, neg, r_value, r_err_msg)) {
+   if (parse_int_relative(str, str_end_test, pos, neg, r_value, 
r_err_msg)) {
CLAMP(*r_value, min, max);
return true;
}
@@ -149,11 +186,25 @@ static bool parse_int_relative_clamp(
}
 }
 
+static bool parse_int_range_relative_clamp(
+const char *str, const char *str_end_range, const char *str_end_test, 
int pos, int neg, int min, int max,
+int r_value_range[2], const char **r_err_msg)
+{
+   if (parse_int_range_relative(str, str_end_range, str_end_test, pos, 
neg, r_value_range, r_err_msg)) {
+   CLAMP(r_value_range[0], min, max);
+   CLAMP(r_value_range[1], min, max);
+   return true;
+   }
+   else {
+   return false;
+   }
+}
+
 /**
  * No clamping, fails with any number outside the range.
  */
 static bool parse_int_strict_range(
-const char *str, const int min, const int max,
+const char *str, const char *str_end_test, const int min, const int 
max,
 int *r_value, const char **r_err_msg)
 {
char *str_end = NULL;
@@ -162,7 +213,7 @@ static bool parse_int_strict_range(
errno = 0;
value = strtol(str, _end, 10);
 
-   if (*str_end != '\0') {
+   if (*str_end != '\0' && (str_end != str_end_test)) {
static const char *msg = "not a number";
*r_err_msg = msg;
return false;
@@ -179,17 +230,17 @@ static bool parse_int_strict_range(
 }
 
 static bool parse_int(
-const char *str,
+const char *str, const char *str_end_test,
 int *r_value, const char **r_err_msg)
 {
-   return parse_int_strict_range(str, INT_MIN, INT_MAX, r_value, 
r_err_msg);
+   return parse_int_strict_range(str, str_end_test, INT_MIN, INT_MAX, 
r_value, r_err_msg);
 }
 
 static bool parse_int_clamp(
-const char *str, int min, int max,
+const char *str, const char *str_end_test, int min, int max,
 int *r_value, const char **r_err_msg)
 {
-   if (parse_int(str, 

[Bf-blender-cvs] [cc970dc] master: Cleanup: arg docstrings

2016-04-05 Thread Campbell Barton
Commit: cc970dc08a7a03594728fb0ecfbdb72689a452f3
Author: Campbell Barton
Date:   Wed Apr 6 09:28:22 2016 +1000
Branches: master
https://developer.blender.org/rBcc970dc08a7a03594728fb0ecfbdb72689a452f3

Cleanup: arg docstrings

===

M   source/creator/creator_args.c

===

diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index c490a9c..dc590db 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -586,10 +586,6 @@ static int arg_handle_print_help(int UNUSED(argc), const 
char **UNUSED(argv), vo
printf("Other Options:\n");
BLI_argsPrintOtherDoc(ba);
 
-   printf("\n");
-   printf("Experimental Features:\n");
-   BLI_argsPrintArgDoc(ba, "--enable-new-depsgraph");
-
printf("Argument Parsing:\n");
printf("\tArguments must be separated by white space, eg:\n");
printf("\t# blender -ba test.blend\n");
@@ -623,6 +619,11 @@ static int arg_handle_print_help(int UNUSED(argc), const 
char **UNUSED(argv), vo
 #endif
printf("  $PYTHONHOME   Path to the python directory, eg. 
/usr/lib/python.\n\n");
 
+   /* keep last */
+   printf("\n");
+   printf("Experimental Features:\n");
+   BLI_argsPrintArgDoc(ba, "--enable-new-depsgraph");
+
exit(0);
 
return 0;
@@ -694,10 +695,12 @@ static int arg_handle_background_mode_set(int 
UNUSED(argc), const char **UNUSED(
 }
 
 static const char arg_handle_debug_mode_set_doc[] =
-"\n\tTurn debugging on\n"
-"\n\t* Enables memory error detection"
-"\n\t* Disables mouse grab (to interact with a debugger in some cases)"
-"\n\t* Keeps Python's 'sys.stdin' rather than setting it to None"
+"\n"
+"\tTurn debugging on\n"
+"\n"
+"\t* Enables memory error detection\n"
+"\t* Disables mouse grab (to interact with a debugger in some cases)\n"
+"\t* Keeps Python's 'sys.stdin' rather than setting it to None"
 ;
 static int arg_handle_debug_mode_set(int UNUSED(argc), const char 
**UNUSED(argv), void *data)
 {
@@ -784,7 +787,8 @@ static int arg_handle_debug_mode_memory_set(int 
UNUSED(argc), const char **UNUSE
 }
 
 static const char arg_handle_debug_value_set_doc[] =
-"\n\tSet debug value of  on startup\n"
+"\n"
+"\tSet debug value of  on startup\n"
 ;
 static int arg_handle_debug_value_set(int argc, const char **argv, void 
*UNUSED(data))
 {
@@ -1022,6 +1026,7 @@ static const char arg_handle_output_set_doc[] =
 "\tUse '//' at the start of the path to render relative to the blend-file.\n"
 "\n"
 "\tThe '#' characters are replaced by the frame number, and used to define 
zero padding.\n"
+"\n"
 "\t* 'ani_##_test.png' becomes 'ani_01_test.png'\n"
 "\t* 'test-##.png' becomes 'test-01.png'\n"
 "\n"
@@ -1166,7 +1171,8 @@ static int arg_handle_depsgraph_use_new(int UNUSED(argc), 
const char **UNUSED(ar
 }
 
 static const char arg_handle_verbosity_set_doc[] =
-"\n\tSet logging verbosity level."
+"\n"
+"\tSet logging verbosity level."
 ;
 static int arg_handle_verbosity_set(int argc, const char **argv, void 
*UNUSED(data))
 {
@@ -1398,7 +1404,8 @@ static int arg_handle_scene_set(int argc, const char 
**argv, void *data)
 }
 
 static const char arg_handle_frame_start_set_doc[] =
-"\n\tSet start to frame , supports +/- for relative frames too."
+"\n"
+"\tSet start to frame , supports +/- for relative frames too."
 ;
 static int arg_handle_frame_start_set(int argc, const char **argv, void *data)
 {
@@ -1459,7 +1466,8 @@ static int arg_handle_frame_end_set(int argc, const char 
**argv, void *data)
 }
 
 static const char arg_handle_frame_skip_set_doc[] =
-"\n\tSet number of frames to step forward after each rendered frame"
+"\n"
+"\tSet number of frames to step forward after each rendered frame"
 ;
 static int arg_handle_frame_skip_set(int argc, const char **argv, void *data)
 {
@@ -1610,7 +1618,8 @@ static int arg_handle_python_console_run(int 
UNUSED(argc), const char **argv, vo
 }
 
 static const char arg_handle_python_exit_code_set_doc[] =
-"\n\tSet the exit-code in [0..255] to exit if a Python exception is raised\n"
+"\n"
+"\tSet the exit-code in [0..255] to exit if a Python exception is raised\n"
 "\t(only for scripts executed from the command line), zero disables."
 ;
 static int arg_handle_python_exit_code_set(int argc, const char **argv, void 
*UNUSED(data))

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


[Bf-blender-cvs] [c084520] master: Expose new Recast partitioning methods for navmesh generation

2016-04-05 Thread Reinier de Blois
Commit: c084520b0376c4ab92cb0193577a79cf23e5bb80
Author: Reinier de Blois
Date:   Tue Apr 5 20:38:42 2016 +0200
Branches: master
https://developer.blender.org/rBc084520b0376c4ab92cb0193577a79cf23e5bb80

Expose new Recast partitioning methods for navmesh generation

This patch depends on D1747, which upgrades the Recast version.  It exposes the 
new Recast partitioning methods in the navmesh generation.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Projects: #bf_blender

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

===

M   release/scripts/startup/bl_ui/properties_game.py
M   source/blender/editors/mesh/mesh_navmesh.c
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/release/scripts/startup/bl_ui/properties_game.py 
b/release/scripts/startup/bl_ui/properties_game.py
index ed1253e..8baad4e 100644
--- a/release/scripts/startup/bl_ui/properties_game.py
+++ b/release/scripts/startup/bl_ui/properties_game.py
@@ -510,7 +510,11 @@ class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
 col.label(text="Region:")
 row = col.row()
 row.prop(rd, "region_min_size")
-row.prop(rd, "region_merge_size")
+if rd.partitioning != 'LAYERS':
+row.prop(rd, "region_merge_size")
+
+col = layout.column()
+col.prop(rd, "partitioning")
 
 col = layout.column()
 col.label(text="Polygonization:")
diff --git a/source/blender/editors/mesh/mesh_navmesh.c 
b/source/blender/editors/mesh/mesh_navmesh.c
index 4d07d50..b959219 100644
--- a/source/blender/editors/mesh/mesh_navmesh.c
+++ b/source/blender/editors/mesh/mesh_navmesh.c
@@ -245,20 +245,41 @@ static bool buildNavMesh(const RecastData *recastParams, 
int nverts, float *vert
return false;
}
 
-   /* Prepare for region partitioning, by calculating distance field along 
the walkable surface */
-   if (!recast_buildDistanceField(chf)) {
-   recast_destroyCompactHeightfield(chf);
+   if (recastParams->partitioning == RC_PARTITION_WATERSHED) {
+   /* Prepare for region partitioning, by calculating distance 
field along the walkable surface */
+   if (!recast_buildDistanceField(chf)) {
+   recast_destroyCompactHeightfield(chf);
 
-   BKE_report(reports, RPT_ERROR, "Failed to build distance 
field");
-   return false;
-   }
+   BKE_report(reports, RPT_ERROR, "Failed to build 
distance field");
+   return false;
+   }
 
-   /* Partition the walkable surface into simple regions without holes */
-   if (!recast_buildRegions(chf, 0, minRegionArea, mergeRegionArea)) {
-   recast_destroyCompactHeightfield(chf);
+   /* Partition the walkable surface into simple regions without 
holes */
+   if (!recast_buildRegions(chf, 0, minRegionArea, 
mergeRegionArea)) {
+   recast_destroyCompactHeightfield(chf);
 
-   BKE_report(reports, RPT_ERROR, "Failed to build regions");
-   return false;
+   BKE_report(reports, RPT_ERROR, "Failed to build 
watershed regions");
+   return false;
+   }
+   }
+   else if (recastParams->partitioning == RC_PARTITION_MONOTONE) {
+   /* Partition the walkable surface into simple regions without 
holes */
+   /* Monotone partitioning does not need distancefield. */
+   if (!recast_buildRegionsMonotone(chf, 0, minRegionArea, 
mergeRegionArea)) {
+   recast_destroyCompactHeightfield(chf);
+
+   BKE_report(reports, RPT_ERROR, "Failed to build 
monotone regions");
+   return false;
+   }
+   }
+   else { /* RC_PARTITION_LAYERS */
+   /* Partition the walkable surface into simple regions without 
holes */
+   if (!recast_buildLayerRegions(chf, 0, minRegionArea)) {
+   recast_destroyCompactHeightfield(chf);
+
+   BKE_report(reports, RPT_ERROR, "Failed to build layer 
regions");
+   return false;
+   }
}
 
/* ** Step 5: Trace and simplify region contours ** */
diff --git a/source/blender/makesdna/DNA_scene_types.h 
b/source/blender/makesdna/DNA_scene_types.h
index fd37bde..a8f78f6 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -795,9 +795,15 @@ typedef struct RecastData {
int vertsperpoly;
float detailsampledist;
float detailsamplemaxerror;
-   short pad1, pad2;
+   char partitioning;
+   char pad1;
+   short pad2;
 } RecastData;
 
+#define 

[Bf-blender-cvs] [176538f] master: Update Recast version to 1.5.0

2016-04-05 Thread Reinier de Blois
Commit: 176538f61360fb54f0e4ce209fc7d7632bce1401
Author: Reinier de Blois
Date:   Tue Apr 5 20:34:00 2016 +0200
Branches: master
https://developer.blender.org/rB176538f61360fb54f0e4ce209fc7d7632bce1401

Update Recast version to 1.5.0

The version of Recast that Blender ships with is from 2009.  This patch updates 
the Recast version to the latest version, 1.5.0.  The Detour version remains 
untouched.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Projects: #bf_blender

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

===

M   extern/recastnavigation/Recast/Include/Recast.h
M   extern/recastnavigation/Recast/Include/RecastAlloc.h
M   extern/recastnavigation/Recast/Include/RecastAssert.h
D   extern/recastnavigation/Recast/Include/RecastLog.h
D   extern/recastnavigation/Recast/Include/RecastTimer.h
M   extern/recastnavigation/Recast/Source/Recast.cpp
M   extern/recastnavigation/Recast/Source/RecastAlloc.cpp
M   extern/recastnavigation/Recast/Source/RecastArea.cpp
M   extern/recastnavigation/Recast/Source/RecastContour.cpp
M   extern/recastnavigation/Recast/Source/RecastFilter.cpp
M   extern/recastnavigation/Recast/Source/RecastLayers.cpp
D   extern/recastnavigation/Recast/Source/RecastLog.cpp
M   extern/recastnavigation/Recast/Source/RecastMesh.cpp
M   extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
M   extern/recastnavigation/Recast/Source/RecastRasterization.cpp
M   extern/recastnavigation/Recast/Source/RecastRegion.cpp
D   extern/recastnavigation/Recast/Source/RecastTimer.cpp
A   extern/recastnavigation/readme-blender.txt
M   extern/recastnavigation/recast-capi.cpp
M   extern/recastnavigation/recast-capi.h
M   source/blender/editors/mesh/mesh_navmesh.c

===

diff --git a/extern/recastnavigation/Recast/Include/Recast.h 
b/extern/recastnavigation/Recast/Include/Recast.h
index 4e20b0f..6f18247 100644
--- a/extern/recastnavigation/Recast/Include/Recast.h
+++ b/extern/recastnavigation/Recast/Include/Recast.h
@@ -15,7 +15,7 @@
 //misrepresented as being the original software.
 // 3. This notice may not be removed or altered from any source distribution.
 //
- 
+
 #ifndef RECAST_H
 #define RECAST_H
 
@@ -27,8 +27,8 @@ static const float RC_PI = 3.14159265f;
 enum rcLogCategory
 {
RC_LOG_PROGRESS = 1,///< A progress log entry.
-   RC_LOG_WARNING, ///< A warning log entry.
-   RC_LOG_ERROR,   ///< An error log entry.
+   RC_LOG_WARNING, ///< A warning log entry.
+   RC_LOG_ERROR,   ///< An error log entry.
 };
 
 /// Recast performance timer categories.
@@ -86,7 +86,7 @@ enum rcTimerLabel
/// The time to filter out small regions. (See: #rcBuildRegions, 
#rcBuildRegionsMonotone)
RC_TIMER_BUILD_REGIONS_FILTER,
/// The time to build heightfield layers. (See: 
#rcBuildHeightfieldLayers)
-   RC_TIMER_BUILD_LAYERS, 
+   RC_TIMER_BUILD_LAYERS,
/// The time to build the polygon mesh detail. (See: 
#rcBuildPolyMeshDetail)
RC_TIMER_BUILD_POLYMESHDETAIL,
/// The time to merge polygon mesh details. (See: 
#rcMergePolyMeshDetails)
@@ -95,7 +95,7 @@ enum rcTimerLabel
RC_MAX_TIMERS
 };
 
-/// Provides an interface for optional logging and performance tracking of the 
Recast 
+/// Provides an interface for optional logging and performance tracking of the 
Recast
 /// build process.
 /// @ingroup recast
 class rcContext
@@ -103,39 +103,39 @@ class rcContext
 public:
 
/// Contructor.
-   ///  @param[in] state  TRUE if the logging and performance timers 
should be enabled.  [Default: true]
+   ///  @param[in] state   TRUE if the logging and performance 
timers should be enabled.  [Default: true]
inline rcContext(bool state = true) : m_logEnabled(state), 
m_timerEnabled(state) {}
virtual ~rcContext() {}
 
/// Enables or disables logging.
-   ///  @param[in] state TRUE if logging should be enabled.
+   ///  @param[in] state   TRUE if logging should be enabled.
inline void enableLog(bool state) { m_logEnabled = state; }
 
/// Clears all log entries.
inline void resetLog() { if (m_logEnabled) doResetLog(); }
 
/// Logs a message.
-   ///  @param[in] category The category of the message.
-   ///  @param[in] format The message.
+   ///  @param[in] categoryThe category of the message.
+   ///  @param[in] format  The message.
void log(const rcLogCategory category, const char* format, ...);
 
/// Enables or disables the performance timers.
-   ///  @param[in] state  TRUE if timers should be enabled.
+   ///  @param[in] state   TRUE if timers should be enabled.
inline 

[Bf-blender-cvs] [abf6f08] blender-v2.77-release: Blender 2.77a: Use proper char for the release

2016-04-05 Thread Sergey Sharybin
Commit: abf6f081c4cd5248e174caa8c1c765aa69b8cd96
Author: Sergey Sharybin
Date:   Tue Apr 5 20:12:32 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBabf6f081c4cd5248e174caa8c1c765aa69b8cd96

Blender 2.77a: Use proper char for the release

===

M   source/blender/blenkernel/BKE_blender.h

===

diff --git a/source/blender/blenkernel/BKE_blender.h 
b/source/blender/blenkernel/BKE_blender.h
index 23b6e2b..79be01e 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -49,7 +49,7 @@ extern "C" {
 
 /* used by packaging tools */
 /* can be left blank, otherwise a,b,c... etc with no quotes */
-#define BLENDER_VERSION_CHAR   
+#define BLENDER_VERSION_CHAR   a
 /* alpha/beta/rc/release, docs use this */
 #define BLENDER_VERSION_CYCLE   release

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


[Bf-blender-cvs] [1e321b9] fracture_modifier: Merge remote-tracking branch 'refs/remotes/origin/blender-v2.77-release' into fracture_modifier

2016-04-05 Thread Martin Felke
Commit: 1e321b998c525d93972e9d9909067d3eae37698e
Author: Martin Felke
Date:   Tue Apr 5 19:58:20 2016 +0200
Branches: fracture_modifier
https://developer.blender.org/rB1e321b998c525d93972e9d9909067d3eae37698e

Merge remote-tracking branch 'refs/remotes/origin/blender-v2.77-release' into 
fracture_modifier

===



===



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


[Bf-blender-cvs] [470d0cd] fracture_modifier: set version char to "a" and cycle to "release"

2016-04-05 Thread Martin Felke
Commit: 470d0cd6e80e58c9427602565adc5089e7f515c7
Author: Martin Felke
Date:   Tue Apr 5 20:00:49 2016 +0200
Branches: fracture_modifier
https://developer.blender.org/rB470d0cd6e80e58c9427602565adc5089e7f515c7

set version char to "a" and cycle to "release"

===

M   source/blender/blenkernel/BKE_blender.h

===

diff --git a/source/blender/blenkernel/BKE_blender.h 
b/source/blender/blenkernel/BKE_blender.h
index 4f8184b..79be01e 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -49,9 +49,9 @@ extern "C" {
 
 /* used by packaging tools */
 /* can be left blank, otherwise a,b,c... etc with no quotes */
-#define BLENDER_VERSION_CHAR   
+#define BLENDER_VERSION_CHAR   a
 /* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE   alpha
+#define BLENDER_VERSION_CYCLE   release
 
 extern char versionstr[]; /* from blender.c */

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


[Bf-blender-cvs] [3346568] object_nodes: Initial code for mapping node sockets to llvm values.

2016-04-05 Thread Lukas Tönne
Commit: 3346568b015cfd41303e8f27322a4020e9cc1c87
Author: Lukas Tönne
Date:   Tue Apr 5 16:58:21 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB3346568b015cfd41303e8f27322a4020e9cc1c87

Initial code for mapping node sockets to llvm values.

===

M   source/blender/blenvm/llvm/llvm_codegen.cc
M   source/blender/blenvm/llvm/llvm_codegen.h

===

diff --git a/source/blender/blenvm/llvm/llvm_codegen.cc 
b/source/blender/blenvm/llvm/llvm_codegen.cc
index 0f762b1..2de7fdf 100644
--- a/source/blender/blenvm/llvm/llvm_codegen.cc
+++ b/source/blender/blenvm/llvm/llvm_codegen.cc
@@ -195,37 +195,35 @@ llvm::FunctionType 
*LLVMCompiler::codegen_node_function_type(const NodeGraph 
return FunctionType::get(TypeBuilder::get(context()), 
input_types, false);
 }
 
-llvm::Function *LLVMCompiler::codegen_node_function(const string , const 
NodeGraph , llvm::Module *module)
+/* Compile nodes as a simple expression.
+ * Every node can be treated as a single statement. Each node is translated
+ * into a function call, with regular value arguments. The resulting value is
+ * assigned to a variable and can be used for subsequent node function calls.
+ */
+llvm::BasicBlock *LLVMCompiler::codegen_function_body_expression(const 
NodeGraph , llvm::Function *func)
 {
using namespace llvm;

IRBuilder<> builder(context());

-   FunctionType *functype = codegen_node_function_type(graph);
-   Function *func = llvm::cast(module->getOrInsertFunction(name, 
functype));
-   Argument *retarg = func->getArgumentList().begin();
-   retarg->addAttr(AttributeSet::get(context(), AttributeSet::ReturnIndex, 
Attribute::StructRet));
+   BasicBlock *entry = BasicBlock::Create(context(), "entry", func);
+   builder.SetInsertPoint(entry);

int num_inputs = graph.inputs.size();
int num_outputs = graph.outputs.size();

-   if (func->getArgumentList().size() != num_inputs + 1) {
-   printf("Error: Function has wrong number of arguments for node 
tree\n");
-   return func;
-   }
+   OutputValueMap output_values;

-   Function::ArgumentListType::iterator it = 
func->getArgumentList().begin();
+   Argument *retarg = func->getArgumentList().begin();
+   Function::ArgumentListType::iterator it = retarg;
++it; /* skip return arg */
for (int i = 0; i < num_inputs; ++i) {
-// Argument *arg = &(*it++);
-// const NodeGraph::Input  = graph.inputs[i];
+   const NodeGraph::Input  = graph.inputs[i];

-// graph.set_input_argument(input.name, arg);
+   Argument *arg = &(*it++);
+   output_values[input.key] = arg;
}

-   BasicBlock *entry = BasicBlock::Create(context(), "entry", func);
-   builder.SetInsertPoint(entry);
-   
 #if 0 // TODO
NodeRefList sorted_nodes = toposort_nodes(graph);
for (NodeRefList::iterator it = sorted_nodes.begin(); it != 
sorted_nodes.end(); ++it) {
@@ -238,26 +236,36 @@ llvm::Function *LLVMCompiler::codegen_node_function(const 
string , const No
 #endif

for (int i = 0; i < num_outputs; ++i) {
-// Value *retptr = builder.CreateStructGEP(retarg, i);
-   
-#if 0 // TODO
const NodeGraph::Output  = graph.outputs[i];
-   Value *value = NULL;
-   if (output->link_node && output->link_socket) {
-   value = 
output->link_node->find_output_value(output->link_socket->name);
-   }
-   else {
-   value = output->default_value;
-   }
-   BLI_assert(value);

-   Value *retval = builder.CreateLoad(value);
-   builder.CreateStore(retval, retptr);
-#endif
+   Value *retptr = builder.CreateStructGEP(retarg, i);
+   
+// Value *value = output_values.at(output.key);
+// Value *retval = builder.CreateLoad(value);
+// builder.CreateStore(retval, retptr);
}

builder.CreateRetVoid();

+   return entry;
+}
+
+llvm::Function *LLVMCompiler::codegen_node_function(const string , const 
NodeGraph , llvm::Module *module)
+{
+   using namespace llvm;
+   
+   FunctionType *functype = codegen_node_function_type(graph);
+   Function *func = llvm::cast(module->getOrInsertFunction(name, 
functype));
+   Argument *retarg = func->getArgumentList().begin();
+   retarg->addAttr(AttributeSet::get(context(), AttributeSet::ReturnIndex, 
Attribute::StructRet));
+   
+   if (func->getArgumentList().size() != graph.inputs.size() + 1) {
+   printf("Error: Function has wrong number of arguments 

[Bf-blender-cvs] [37477ff] object_nodes: Ported over code from previous llvm branch for loading IR modules and linking runtime code.

2016-04-05 Thread Lukas Tönne
Commit: 37477ffa1ce112353887a030753f4788f8f576c5
Author: Lukas Tönne
Date:   Tue Apr 5 17:57:29 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB37477ffa1ce112353887a030753f4788f8f576c5

Ported over code from previous llvm branch for loading IR modules and linking 
runtime code.

===

M   source/blender/blenvm/llvm/llvm_codegen.cc
M   source/blender/blenvm/llvm/llvm_engine.cc
M   source/blender/blenvm/llvm/llvm_engine.h
M   source/blender/blenvm/llvm/llvm_headers.h

===

diff --git a/source/blender/blenvm/llvm/llvm_codegen.cc 
b/source/blender/blenvm/llvm/llvm_codegen.cc
index 2de7fdf..d751464 100644
--- a/source/blender/blenvm/llvm/llvm_codegen.cc
+++ b/source/blender/blenvm/llvm/llvm_codegen.cc
@@ -291,6 +291,8 @@ FunctionLLVM *LLVMCompiler::compile_function(const string 
, const NodeGraph

fpm.run(*func);

+   llvm_link_module_full(module);
+   
llvm_execution_engine()->finalizeObject();

uint64_t address = llvm_execution_engine()->getFunctionAddress(name);
diff --git a/source/blender/blenvm/llvm/llvm_engine.cc 
b/source/blender/blenvm/llvm/llvm_engine.cc
index 4d4fd74..c607a5e 100644
--- a/source/blender/blenvm/llvm/llvm_engine.cc
+++ b/source/blender/blenvm/llvm/llvm_engine.cc
@@ -29,8 +29,15 @@
  *  \ingroup llvm
  */
 
+#include 
+
 extern "C" {
+#include "BLI_fileops.h"
+#include "BLI_fileops_types.h"
+#include "BLI_path_util.h"
 #include "BLI_utildefines.h"
+
+#include "BKE_appdir.h"
 }
 
 #include "llvm_engine.h"
@@ -38,8 +45,11 @@ extern "C" {
 
 namespace blenvm {
 
+typedef std::map ModuleMap;
+
 static llvm::ExecutionEngine *theEngine = NULL;
 static llvm::Module *theModule = NULL;
+static ModuleMap theModules;
 
 //static ModuleMap theModules;
 
@@ -77,14 +87,12 @@ void llvm_init()
theEngine = create_execution_engine();

/* load modules */
-// BJIT_load_all_modules(NULL, false);
-// bjit::build_effector_module();
+   llvm_load_all_modules("", false);
 }
 
 void llvm_free()
 {
-// bjit::free_effector_module();
-// BJIT_unload_all_modules();
+   llvm_unload_all_modules();

if (theEngine) {
delete theEngine;
@@ -97,4 +105,156 @@ llvm::ExecutionEngine *llvm_execution_engine()
return theEngine;
 }
 
+bool llvm_function_is_external(const llvm::Function *func)
+{
+   return func->hasFnAttribute("name");
+}
+
+llvm::Function *llvm_find_external_function(llvm::Module *mod, const string 
)
+{
+   using namespace llvm;
+   
+   for (Module::FunctionListType::iterator it = 
mod->getFunctionList().begin(); it != mod->getFunctionList().end(); ++it) {
+   Function *func = &(*it);
+   if (func->hasFnAttribute("name")) {
+   std::string value = 
func->getFnAttribute("name").getValueAsString();
+   if (value == name)
+   return func;
+   }
+   }
+   return NULL;
+}
+
+string llvm_get_external_function_name(llvm::Function *func)
+{
+   if (func->hasFnAttribute("name"))
+   return func->getFnAttribute("name").getValueAsString().str();
+   else
+   return func->getName().str();
+}
+
+#if 0
+/* Based on
+ * http://homes.cs.washington.edu/~bholt/posts/llvm-quick-tricks.html
+ */
+static void llvm_parse_function_annotations(llvm::Module *mod)
+{
+   using namespace llvm;
+   
+   GlobalVariable *global_annos = 
mod->getNamedGlobal("llvm.global.annotations");
+   if (global_annos) {
+   ConstantArray *a = 
static_cast(global_annos->getOperand(0));
+   for (int i = 0; i < a->getNumOperands(); i++) {
+   ConstantStruct *e = 
static_cast(a->getOperand(i));
+   StringRef anno = 
static_cast(static_cast(e->getOperand(1)->getOperand(0))->getOperand(0))->getAsCString();
+   
+   Function *fn = 
dynamic_cast(e->getOperand(0)->getOperand(0));
+   if (fn) {
+   fn->addFnAttr("name", anno); /* add function 
annotation */
+   }
+   }
+   }
+}
+#endif
+
+void llvm_load_module(const string , const string )
+{
+   using namespace llvm;
+   
+   printf("Loading module '%s'\n", modfile.c_str());
+   LLVMContext  = getGlobalContext();
+   SMDiagnostic err;
+   
+   Module *mod = getLazyIRFileModule(modfile, err, llvmctx);
+// Module *mod = ParseIRFile(modfile, err, llvmctx);
+   if (!mod) {
+   err.print(modfile.c_str(), errs());
+   return;
+   }
+   
+   printf("Module Functions for '%s'\n", 

[Bf-blender-cvs] [1fc5680] object_nodes: Cleanup: Renamed Value class to NodeValue, to distinguish from llvm::Value easier.

2016-04-05 Thread Lukas Tönne
Commit: 1fc5680442fd3514d046ff9a6ef9cace6c549ad7
Author: Lukas Tönne
Date:   Tue Apr 5 16:26:38 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB1fc5680442fd3514d046ff9a6ef9cace6c549ad7

Cleanup: Renamed Value class to NodeValue, to distinguish from llvm::Value 
easier.

===

M   source/blender/blenvm/compile/CMakeLists.txt
M   source/blender/blenvm/compile/bvm_codegen.cc
M   source/blender/blenvm/compile/bvm_codegen.h
M   source/blender/blenvm/compile/bvm_codegen_debug.cc
A   source/blender/blenvm/compile/node_graph.cc
A   source/blender/blenvm/compile/node_graph.h
A   source/blender/blenvm/compile/node_value.cc
A   source/blender/blenvm/compile/node_value.h
D   source/blender/blenvm/compile/nodegraph.cc
D   source/blender/blenvm/compile/nodegraph.h
M   source/blender/blenvm/compile/typedesc.cc
M   source/blender/blenvm/compile/typedesc.h
D   source/blender/blenvm/compile/value.cc
D   source/blender/blenvm/compile/value.h
M   source/blender/blenvm/intern/bvm_api.cc
M   source/blender/blenvm/llvm/llvm_codegen.cc
M   source/blender/blenvm/llvm/llvm_codegen.h
M   source/blender/blenvm/util/util_debug.h

===

diff --git a/source/blender/blenvm/compile/CMakeLists.txt 
b/source/blender/blenvm/compile/CMakeLists.txt
index 5e10574..d7e120c 100644
--- a/source/blender/blenvm/compile/CMakeLists.txt
+++ b/source/blender/blenvm/compile/CMakeLists.txt
@@ -40,12 +40,12 @@ set(INC_SYS
 )
 
 set(SRC
-   nodegraph.cc
-   nodegraph.h
+   node_graph.cc
+   node_graph.h
+   node_value.cc
+   node_value.h
typedesc.cc
typedesc.h
-   value.cc
-   value.h
 
bvm_codegen.cc
bvm_codegen_debug.cc
diff --git a/source/blender/blenvm/compile/bvm_codegen.cc 
b/source/blender/blenvm/compile/bvm_codegen.cc
index 230ef56..59c67d2 100644
--- a/source/blender/blenvm/compile/bvm_codegen.cc
+++ b/source/blender/blenvm/compile/bvm_codegen.cc
@@ -32,7 +32,7 @@
 #include 
 #include 
 
-#include "nodegraph.h"
+#include "node_graph.h"
 
 #include "bvm_codegen.h"
 #include "bvm_eval.h"
@@ -232,7 +232,7 @@ void Compiler::resolve_symbols(const NodeGraph )
 }
 
 
-void Compiler::push_constant(const Value *value) const
+void Compiler::push_constant(const NodeValue *value) const
 {
BLI_assert(value != NULL);
switch (value->typedesc().base_type()) {
@@ -294,7 +294,7 @@ void Compiler::push_constant(const Value *value) const
}
 }
 
-void Compiler::codegen_value(const Value *value, StackIndex offset) const
+void Compiler::codegen_value(const NodeValue *value, StackIndex offset) const
 {
switch (value->typedesc().base_type()) {
case BVM_FLOAT: {
diff --git a/source/blender/blenvm/compile/bvm_codegen.h 
b/source/blender/blenvm/compile/bvm_codegen.h
index 8438a61..9261c68 100644
--- a/source/blender/blenvm/compile/bvm_codegen.h
+++ b/source/blender/blenvm/compile/bvm_codegen.h
@@ -37,7 +37,7 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "nodegraph.h"
+#include "node_graph.h"
 
 #include "bvm_instruction_list.h"
 
@@ -92,9 +92,9 @@ protected:

virtual int current_address() const = 0;

-   void push_constant(const Value *value) const;
+   void push_constant(const NodeValue *value) const;

-   void codegen_value(const Value *value, StackIndex offset) const;
+   void codegen_value(const NodeValue *value, StackIndex offset) const;
int codegen_node_block(const NodeBlock );
int codegen_graph(const NodeGraph );

diff --git a/source/blender/blenvm/compile/bvm_codegen_debug.cc 
b/source/blender/blenvm/compile/bvm_codegen_debug.cc
index 3ad7a80..f8990b3 100644
--- a/source/blender/blenvm/compile/bvm_codegen_debug.cc
+++ b/source/blender/blenvm/compile/bvm_codegen_debug.cc
@@ -32,7 +32,7 @@
 #include 
 #include 
 
-#include "nodegraph.h"
+#include "node_graph.h"
 
 #include "bvm_codegen.h"
 
diff --git a/source/blender/blenvm/compile/nodegraph.cc 
b/source/blender/blenvm/compile/node_graph.cc
similarity index 98%
rename from source/blender/blenvm/compile/nodegraph.cc
rename to source/blender/blenvm/compile/node_graph.cc
index ab1a5bc..444590c 100644
--- a/source/blender/blenvm/compile/nodegraph.cc
+++ b/source/blender/blenvm/compile/node_graph.cc
@@ -37,7 +37,7 @@
 #include 
 #include 
 
-#include "nodegraph.h"
+#include "node_graph.h"
 
 #include "util_opcode.h"
 #include "util_math.h"
@@ -46,7 +46,7 @@ namespace blenvm {
 
 NodeInput::NodeInput(const string ,
  const TypeDesc ,
- Value *default_value,
+ NodeValue *default_value,
  BVMInputValueType value_type) :
 name(name),
 typedesc(typedesc),
@@ -212,7 +212,7 @@ bool NodeType::verify_arguments(Module *module, LLVMContext 
, raw_ostrea
 

[Bf-blender-cvs] [1ddfdfa] object_nodes: With the proper formal function parameters for node functions they can now actually be called.

2016-04-05 Thread Lukas Tönne
Commit: 1ddfdfa31d07278a2ca903a959a6cea287ba3936
Author: Lukas Tönne
Date:   Tue Apr 5 11:37:43 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB1ddfdfa31d07278a2ca903a959a6cea287ba3936

With the proper formal function parameters for node functions they can now 
actually be called.

===

M   source/blender/blenvm/intern/bvm_api.cc

===

diff --git a/source/blender/blenvm/intern/bvm_api.cc 
b/source/blender/blenvm/intern/bvm_api.cc
index b89cbc9..3fb93b3 100644
--- a/source/blender/blenvm/intern/bvm_api.cc
+++ b/source/blender/blenvm/intern/bvm_api.cc
@@ -955,13 +955,11 @@ static void parse_tex_nodes(bNodeTree *btree, 
blenvm::NodeGraph *graph)
 
 namespace blenvm {
 
-// TODO
 struct TexNodesResult {
float4 color;
float3 normal;
 };
-//typedef TexNodesResult (*TexNodesFunc)(float3 co, float3 dxt, float3 dyt, 
int cfra, int osatex);
-typedef void (*TexNodesFunc)(void);
+typedef TexNodesResult (*TexNodesFunc)(float3 co, float3 dxt, float3 dyt, int 
cfra, int osatex);
 
 static void set_texresult(TexResult *result, const float4 , const float3 
)
 {
@@ -1094,7 +1092,7 @@ void BVM_debug_texture_nodes(bNodeTree *btree, FILE 
*debug_file, const char *lab
 void BVM_eval_texture_bvm(struct BVMEvalContext *ctx, struct BVMFunction *fn,
   struct TexResult *target,
   float coord[3], float dxt[3], float dyt[3], int 
osatex,
-  short which_output, int cfra, int UNUSED(preview))
+  short UNUSED(which_output), int cfra, int 
UNUSED(preview))
 {
using namespace blenvm;

@@ -1110,7 +1108,7 @@ void BVM_eval_texture_bvm(struct BVMEvalContext *ctx, 
struct BVMFunction *fn,
set_texresult(target, color, normal);
 }
 
-void BVM_eval_texture_llvm(struct BVMEvalContext *ctx, struct BVMFunction *fn,
+void BVM_eval_texture_llvm(struct BVMEvalContext *UNUSED(ctx), struct 
BVMFunction *fn,
struct TexResult *target,
float coord[3], float dxt[3], float dyt[3], int 
osatex,
short UNUSED(which_output), int cfra, int 
UNUSED(preview))
@@ -1124,8 +1122,17 @@ void BVM_eval_texture_llvm(struct BVMEvalContext *ctx, 
struct BVMFunction *fn,
 #ifdef WITH_LLVM
TexNodesFunc fp = (TexNodesFunc)_FUNC_LLVM(fn)->ptr();

-   // TODO
-// result = fp(coord, dxt, dyt, cfra, osatex);
+   float3 coord_v, dxt_v, dyt_v;
+   copy_v3_v3(coord_v.data(), coord);
+   if (dxt)
+   copy_v3_v3(dxt_v.data(), dxt);
+   else
+   zero_v3(dxt_v.data());
+   if (dyt)
+   copy_v3_v3(dyt_v.data(), dyt);
+   else
+   zero_v3(dyt_v.data());
+   result = fp(coord_v, dxt_v, dyt_v, cfra, osatex);
 #else
UNUSED_VARS(ctx, fn, coord, dxt, dyt, cfra, osatex);
result.color = float4(0.0f, 0.0f, 0.0f, 0.0f);

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


[Bf-blender-cvs] [6392e88] object_nodes: Use getFunctionAddress instead of deprecated getFunctionPointer.

2016-04-05 Thread Lukas Tönne
Commit: 6392e8885a0f288c317f04c677495dc0557844e4
Author: Lukas Tönne
Date:   Tue Apr 5 11:30:30 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB6392e8885a0f288c317f04c677495dc0557844e4

Use getFunctionAddress instead of deprecated getFunctionPointer.

===

M   source/blender/blenvm/llvm/llvm_codegen.cc

===

diff --git a/source/blender/blenvm/llvm/llvm_codegen.cc 
b/source/blender/blenvm/llvm/llvm_codegen.cc
index dde5e11..30c67e4 100644
--- a/source/blender/blenvm/llvm/llvm_codegen.cc
+++ b/source/blender/blenvm/llvm/llvm_codegen.cc
@@ -285,15 +285,8 @@ FunctionLLVM *LLVMCompiler::compile_function(const string 
, const NodeGraph

llvm_execution_engine()->finalizeObject();

-   /* XXX according to docs, getFunctionAddress should be used
-* for MCJIT, but always returns 0
-*/
-// uint64_t address = llvm_execution_engine()->getFunctionAddress(name);
-// uint64_t address = 
(uint64_t)llvm_execution_engine()->getPointerToFunction(func);
-   void (*fp)(void) = (void 
(*)(void))llvm_execution_engine()->getPointerToFunction(func);
-   printf("GOT FUNCTION %s: %p\n", name.c_str(), fp);
-   BLI_assert(fp != 0);
-   uint64_t address = (uint64_t)fp;
+   uint64_t address = llvm_execution_engine()->getFunctionAddress(name);
+   BLI_assert(address != 0);

llvm_execution_engine()->removeModule(module);
delete module;

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


[Bf-blender-cvs] [fa1f852] object_nodes: Cleanup: Fixed deprecated docstrings for file location.

2016-04-05 Thread Lukas Tönne
Commit: fa1f852381e2e7f4e1b144cef1ec260e18c21e78
Author: Lukas Tönne
Date:   Tue Apr 5 16:32:16 2016 +0200
Branches: object_nodes
https://developer.blender.org/rBfa1f852381e2e7f4e1b144cef1ec260e18c21e78

Cleanup: Fixed deprecated docstrings for file location.

===

M   source/blender/blenvm/BVM_api.h
M   source/blender/blenvm/BVM_types.h
M   source/blender/blenvm/compile/node_graph.cc
M   source/blender/blenvm/compile/node_graph.h
M   source/blender/blenvm/compile/typedesc.cc
M   source/blender/blenvm/compile/typedesc.h
M   source/blender/blenvm/intern/function.h
M   source/blender/blenvm/intern/function_cache.h
M   source/blender/blenvm/llvm/llvm_codegen.cc
M   source/blender/blenvm/llvm/llvm_codegen.h
M   source/blender/blenvm/llvm/llvm_engine.cc
M   source/blender/blenvm/llvm/llvm_engine.h
M   source/blender/blenvm/llvm/llvm_function.cc
M   source/blender/blenvm/llvm/llvm_function.h
M   source/blender/blenvm/llvm/llvm_headers.h
M   source/blender/blenvm/util/util_data_ptr.h
M   source/blender/blenvm/util/util_debug.h
M   source/blender/blenvm/util/util_hash.h
M   source/blender/blenvm/util/util_map.h
M   source/blender/blenvm/util/util_math.h
M   source/blender/blenvm/util/util_opcode.h
M   source/blender/blenvm/util/util_string.h
M   source/blender/blenvm/util/util_structs.h
M   source/blender/blenvm/util/util_thread.h

===

diff --git a/source/blender/blenvm/BVM_api.h b/source/blender/blenvm/BVM_api.h
index c0e7064..df8550d 100644
--- a/source/blender/blenvm/BVM_api.h
+++ b/source/blender/blenvm/BVM_api.h
@@ -28,7 +28,7 @@
 #ifndef __BVM_API_H__
 #define __BVM_API_H__
 
-/** \file BVM_api.h
+/** \file blender/blenvm/BVM_api.h
  *  \ingroup bvm
  */
 
diff --git a/source/blender/blenvm/BVM_types.h 
b/source/blender/blenvm/BVM_types.h
index 1d16e73..36f3274 100644
--- a/source/blender/blenvm/BVM_types.h
+++ b/source/blender/blenvm/BVM_types.h
@@ -28,7 +28,7 @@
 #ifndef __BVM_TYPES_H__
 #define __BVM_TYPES_H__
 
-/** \file BVM_types.h
+/** \file blender/blenvm/BVM_types.h
  *  \ingroup bvm
  */
 
diff --git a/source/blender/blenvm/compile/node_graph.cc 
b/source/blender/blenvm/compile/node_graph.cc
index 444590c..1077ee8 100644
--- a/source/blender/blenvm/compile/node_graph.cc
+++ b/source/blender/blenvm/compile/node_graph.cc
@@ -25,7 +25,7 @@
  * * END GPL LICENSE BLOCK *
  */
 
-/** \file blender/blenvm/intern/bvm_nodegraph.cc
+/** \file blender/blenvm/intern/node_graph.cc
  *  \ingroup bvm
  */
 
diff --git a/source/blender/blenvm/compile/node_graph.h 
b/source/blender/blenvm/compile/node_graph.h
index 3daf8af..210daa5 100644
--- a/source/blender/blenvm/compile/node_graph.h
+++ b/source/blender/blenvm/compile/node_graph.h
@@ -25,7 +25,7 @@
  * * END GPL LICENSE BLOCK *
  */
 
-/** \file blender/blenvm/intern/bvm_nodegraph.h
+/** \file blender/blenvm/intern/node_graph.h
  *  \ingroup bvm
  */
 
diff --git a/source/blender/blenvm/compile/typedesc.cc 
b/source/blender/blenvm/compile/typedesc.cc
index 7dfa0d9..6b37055 100644
--- a/source/blender/blenvm/compile/typedesc.cc
+++ b/source/blender/blenvm/compile/typedesc.cc
@@ -25,7 +25,7 @@
  * * END GPL LICENSE BLOCK *
  */
 
-/** \file blender/blenvm/intern/bvm_typedesc.cc
+/** \file blender/blenvm/intern/typedesc.cc
  *  \ingroup bvm
  */
 
diff --git a/source/blender/blenvm/compile/typedesc.h 
b/source/blender/blenvm/compile/typedesc.h
index ba2eb32..c407d0c 100644
--- a/source/blender/blenvm/compile/typedesc.h
+++ b/source/blender/blenvm/compile/typedesc.h
@@ -25,7 +25,7 @@
  * * END GPL LICENSE BLOCK *
  */
 
-/** \file blender/blenvm/intern/bvm_typedesc.h
+/** \file blender/blenvm/intern/typedesc.h
  *  \ingroup bvm
  */
 
diff --git a/source/blender/blenvm/intern/function.h 
b/source/blender/blenvm/intern/function.h
index a9b6fa3..70076fb 100644
--- a/source/blender/blenvm/intern/function.h
+++ b/source/blender/blenvm/intern/function.h
@@ -28,7 +28,7 @@
 #ifndef __FUNCTION_H__
 #define __FUNCTION_H__
 
-/** \file function.h
+/** \file blender/blenvm/intern/function.h
  *  \ingroup blenvm
  */
 
diff --git a/source/blender/blenvm/intern/function_cache.h 
b/source/blender/blenvm/intern/function_cache.h
index 295838e..2be84d3 100644
--- a/source/blender/blenvm/intern/function_cache.h
+++ b/source/blender/blenvm/intern/function_cache.h
@@ -28,7 +28,7 @@
 #ifndef __FUNCTION_CACHE_H__
 #define __FUNCTION_CACHE_H__
 
-/** \file function_cache.h
+/** \file blender/blenvm/intern/function_cache.h
  *  \ingroup blenvm
  */
 
diff --git a/source/blender/blenvm/llvm/llvm_codegen.cc 
b/source/blender/blenvm/llvm/llvm_codegen.cc
index 51a74cb..0f762b1 100644
--- a/source/blender/blenvm/llvm/llvm_codegen.cc
+++ b/source/blender/blenvm/llvm/llvm_codegen.cc
@@ -25,7 +25,7 @@
  * * END GPL LICENSE BLOCK *
  */

[Bf-blender-cvs] [214e384] master: Fix UV-Editor crashes w/ over SHRT_MAX UV's

2016-04-05 Thread Campbell Barton
Commit: 214e384fc4ac0924fcad26f5eb64fc9e4c24b8a8
Author: Campbell Barton
Date:   Tue Apr 5 20:42:21 2016 +1000
Branches: master
https://developer.blender.org/rB214e384fc4ac0924fcad26f5eb64fc9e4c24b8a8

Fix UV-Editor crashes w/ over SHRT_MAX UV's

===

M   source/blender/blenkernel/BKE_mesh_mapping.h

===

diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h 
b/source/blender/blenkernel/BKE_mesh_mapping.h
index e4b2b8a..d7dd9ed 100644
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@ -69,7 +69,7 @@ typedef struct UvElement {
/* general use flag */
unsigned char flag;
/* If generating element map with island sorting, this stores the 
island index */
-   unsigned short island;
+   unsigned int island;
 } UvElement;
 
 
@@ -90,9 +90,7 @@ typedef struct UvElementMap {
int *islandIndices;
 } UvElementMap;
 
-/* invalid island index is max short. If any one has the patience
- * to make that many islands, he can bite me :p */
-#define INVALID_ISLAND 0x
+#define INVALID_ISLAND ((unsigned int)-1)
 
 /* Connectivity data */
 typedef struct MeshElemMap {

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


[Bf-blender-cvs] [89f6987] blender-v2.77-release: Fix UV-Editor crashes w/ over SHRT_MAX UV's

2016-04-05 Thread Campbell Barton
Commit: 89f6987953ebad852942e719a41ace3b217ec59a
Author: Campbell Barton
Date:   Tue Apr 5 20:42:21 2016 +1000
Branches: blender-v2.77-release
https://developer.blender.org/rB89f6987953ebad852942e719a41ace3b217ec59a

Fix UV-Editor crashes w/ over SHRT_MAX UV's

===

M   source/blender/blenkernel/BKE_mesh_mapping.h

===

diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h 
b/source/blender/blenkernel/BKE_mesh_mapping.h
index c8a1700..936858f 100644
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@ -69,7 +69,7 @@ typedef struct UvElement {
/* general use flag */
unsigned char flag;
/* If generating element map with island sorting, this stores the 
island index */
-   unsigned short island;
+   unsigned int island;
 } UvElement;
 
 
@@ -90,9 +90,7 @@ typedef struct UvElementMap {
int *islandIndices;
 } UvElementMap;
 
-/* invalid island index is max short. If any one has the patience
- * to make that many islands, he can bite me :p */
-#define INVALID_ISLAND 0x
+#define INVALID_ISLAND ((unsigned int)-1)
 
 /* Connectivity data */
 typedef struct MeshElemMap {

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


[Bf-blender-cvs] [b8ca481] master: Revert "Cycles: Remove the Preetham Sky model."

2016-04-05 Thread Thomas Dinges
Commit: b8ca4819b2e9288cb86988c01b0b6a2a5b39fe8a
Author: Thomas Dinges
Date:   Tue Apr 5 12:25:54 2016 +0200
Branches: master
https://developer.blender.org/rBb8ca4819b2e9288cb86988c01b0b6a2a5b39fe8a

Revert "Cycles: Remove the Preetham Sky model."

This reverts commit d91316dc672dc1ee69fbd24d2f00124a24b75c6b.

===

M   intern/cycles/app/cycles_xml.cpp
M   intern/cycles/blender/blender_shader.cpp
M   intern/cycles/kernel/shaders/node_sky_texture.osl
M   intern/cycles/kernel/svm/svm_sky.h
M   intern/cycles/kernel/svm/svm_types.h
M   intern/cycles/render/nodes.cpp
M   intern/cycles/render/nodes.h
M   source/blender/editors/space_node/drawnode.c
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/makesrna/intern/rna_nodetree.c
M   source/blender/nodes/shader/nodes/node_shader_tex_sky.c

===

diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index e33fce4..c845f28 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -470,7 +470,8 @@ static void xml_read_shader_graph(const XMLReadState& 
state, Shader *shader, pug
}
else if(string_iequals(node.name(), "sky_texture")) {
SkyTextureNode *sky = new SkyTextureNode();
-
+   
+   xml_read_enum(>type, SkyTextureNode::type_enum, 
node, "type");
xml_read_float3(>sun_direction, node, 
"sun_direction");
xml_read_float(>turbidity, node, "turbidity");
xml_read_float(>ground_albedo, node, 
"ground_albedo");
diff --git a/intern/cycles/blender/blender_shader.cpp 
b/intern/cycles/blender/blender_shader.cpp
index e186a59..4f7ca30 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -833,6 +833,7 @@ static ShaderNode *add_node(Scene *scene,
else if(b_node.is_a(_ShaderNodeTexSky)) {
BL::ShaderNodeTexSky b_sky_node(b_node);
SkyTextureNode *sky = new SkyTextureNode();
+   sky->type = 
SkyTextureNode::type_enum[(int)b_sky_node.sky_type()];
sky->sun_direction = 
normalize(get_float3(b_sky_node.sun_direction()));
sky->turbidity = b_sky_node.turbidity();
sky->ground_albedo = b_sky_node.ground_albedo();
diff --git a/intern/cycles/kernel/shaders/node_sky_texture.osl 
b/intern/cycles/kernel/shaders/node_sky_texture.osl
index 9ce9008..05eed23 100644
--- a/intern/cycles/kernel/shaders/node_sky_texture.osl
+++ b/intern/cycles/kernel/shaders/node_sky_texture.osl
@@ -34,6 +34,40 @@ vector sky_spherical_coordinates(vector dir)
return vector(acos(dir[2]), atan2(dir[0], dir[1]), 0);
 }
 
+/* Preetham */
+float sky_perez_function(float lam[9], float theta, float gamma)
+{
+   float ctheta = cos(theta);
+   float cgamma = cos(gamma);
+
+   return (1.0 + lam[0] * exp(lam[1] / ctheta)) * (1.0 + lam[2] * 
exp(lam[3] * gamma) + lam[4] * cgamma * cgamma);
+}
+
+color sky_radiance_old(normal dir,
+   float sunphi, float suntheta, color radiance,
+   float config_x[9], float config_y[9], float config_z[9])
+{
+   /* convert vector to spherical coordinates */
+   vector spherical = sky_spherical_coordinates(dir);
+   float theta = spherical[0];
+   float phi = spherical[1];
+
+   /* angle between sun direction and dir */
+   float gamma = sky_angle_between(theta, phi, suntheta, sunphi);
+
+   /* clamp theta to horizon */
+   theta = min(theta, M_PI_2 - 0.001);
+
+   /* compute xyY color space values */
+   float x = radiance[1] * sky_perez_function(config_y, theta, gamma);
+   float y = radiance[2] * sky_perez_function(config_z, theta, gamma);
+   float Y = radiance[0] * sky_perez_function(config_x, theta, gamma);
+
+   /* convert to RGB */
+   color xyz = xyY_to_xyz(x, y, Y);
+   return xyz_to_rgb(xyz[0], xyz[1], xyz[2]);
+}
+
 /* Hosek / Wilkie */
 float sky_radiance_internal(float config[9], float theta, float gamma)
 {
@@ -49,9 +83,9 @@ float sky_radiance_internal(float config[9], float theta, 
float gamma)
(config[2] + config[3] * expM + config[5] * rayM + config[6] * 
mieM + config[7] * zenith);
 }
 
-color sky_radiance(normal dir,
-   float sunphi, float suntheta, color radiance,
-   float config_x[9], float config_y[9], float config_z[9])
+color sky_radiance_new(normal dir,
+   float sunphi, float suntheta, color radiance,
+   float config_x[9], float config_y[9], float config_z[9])
 {
/* convert vector to spherical coordinates */
vector spherical = sky_spherical_coordinates(dir);
@@ -77,6 +111,7 @@ shader 

[Bf-blender-cvs] [46aaa53] master: Fix T48054: Blender 2.77 doesn't import blenders fbx, due to recent changes in anim RNA API.

2016-04-05 Thread Bastien Montagne
Commit: 46aaa539984231021a2e895afa8c04734de96c86
Author: Bastien Montagne
Date:   Tue Apr 5 11:51:54 2016 +0200
Branches: master
https://developer.blender.org/rB46aaa539984231021a2e895afa8c04734de96c86

Fix T48054: Blender 2.77 doesn't import blenders fbx, due to recent changes in 
anim RNA API.

Please do not break API when not absolutely needed, here it was a mere 
parameter order issue...

===

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

===

diff --git a/source/blender/makesrna/intern/rna_fcurve.c 
b/source/blender/makesrna/intern/rna_fcurve.c
index c34d812..b765ca1 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -1793,10 +1793,9 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA 
*brna, PropertyRNA *cprop)
parm = RNA_def_float(func, "value", 0.0f, -FLT_MAX, FLT_MAX, "",
 "Y Value of this keyframe point", -FLT_MAX, 
FLT_MAX);
RNA_def_property_flag(parm, PROP_REQUIRED);
-   
-   RNA_def_enum(func, "keyframe_type", 
rna_enum_beztriple_keyframe_type_items, 0, "", 
-"Type of keyframe to insert");
RNA_def_enum_flag(func, "options", keyframe_flag_items, 0, "", 
"Keyframe options");
+   RNA_def_enum(func, "keyframe_type", 
rna_enum_beztriple_keyframe_type_items, BEZT_KEYTYPE_KEYFRAME, "",
+"Type of keyframe to insert");
 
parm = RNA_def_pointer(func, "keyframe", "Keyframe", "", "Newly created 
keyframe");
RNA_def_function_return(func, parm);

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


[Bf-blender-cvs] [63e0d3a] blender-v2.77-release: Fix T47705: Freestyle line glitch.

2016-04-05 Thread Tamito Kajiyama
Commit: 63e0d3a47fdae8a42cd584f13d0530ea57ca0e6f
Author: Tamito Kajiyama
Date:   Tue Apr 5 16:08:45 2016 +0900
Branches: blender-v2.77-release
https://developer.blender.org/rB63e0d3a47fdae8a42cd584f13d0530ea57ca0e6f

Fix T47705: Freestyle line glitch.

The addressed issue is a regression from Blender 2.75, after the internal
switch from double to single precision floating-point numbers in the
Freestyle code base.  Face normal calculations require the higher
precision during the computations, even though the results can be stored
as single precision numbers.

===

M   source/blender/freestyle/intern/winged_edge/WEdge.cpp

===

diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.cpp 
b/source/blender/freestyle/intern/winged_edge/WEdge.cpp
index 87ca3a4..99aa2d2 100644
--- a/source/blender/freestyle/intern/winged_edge/WEdge.cpp
+++ b/source/blender/freestyle/intern/winged_edge/WEdge.cpp
@@ -640,18 +640,19 @@ WFace *WShape::MakeFace(vector& iVertexList, 
vector& iFaceEdgeM
vector::iterator it;
 
// compute the face normal (v1v2 ^ v1v3)
-   WVertex *v1, *v2, *v3;
+   // Double precision numbers are used here to avoid truncation errors 
[T47705]
+   Vec3r v1, v2, v3;
it = iVertexList.begin();
-   v1 = *it;
+   v1 = (*it)->GetVertex();
it++;
-   v2 = *it;
+   v2 = (*it)->GetVertex();
it++;
-   v3 = *it;
+   v3 = (*it)->GetVertex();
 
-   Vec3f vector1(v2->GetVertex() - v1->GetVertex());
-   Vec3f vector2(v3->GetVertex() - v1->GetVertex());
+   Vec3r vector1(v2 - v1);
+   Vec3r vector2(v3 - v1);
 
-   Vec3f normal(vector1 ^ vector2);
+   Vec3r normal(vector1 ^ vector2);
normal.normalize();
face->setNormal(normal);

___
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 [61649] tags/blender-2.77-release/lib/: Tagging Blender 2.77 release

2016-04-05 Thread Sergey Sharybin
Revision: 61649
  https://developer.blender.org/rBL61649
Author:   sergey
Date: 2016-04-05 09:28:29 + (Tue, 05 Apr 2016)
Log Message:
---
Tagging Blender 2.77 release

Added Paths:
---
tags/blender-2.77-release/lib/

___
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 [61648] tags/blender-2.77-release/: Preparing Blender 2.77 release tag

2016-04-05 Thread Sergey Sharybin
Revision: 61648
  https://developer.blender.org/rBL61648
Author:   sergey
Date: 2016-04-05 09:27:11 + (Tue, 05 Apr 2016)
Log Message:
---
Preparing Blender 2.77 release tag

Added Paths:
---
tags/blender-2.77-release/

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


[Bf-blender-cvs] [ff6673d] object_nodes: Type generation for LLVM based on node socket types.

2016-04-05 Thread Lukas Tönne
Commit: ff6673d8b80d969cbdd98402a347fe7e2175fb97
Author: Lukas Tönne
Date:   Tue Apr 5 10:16:57 2016 +0200
Branches: object_nodes
https://developer.blender.org/rBff6673d8b80d969cbdd98402a347fe7e2175fb97

Type generation for LLVM based on node socket types.

Currently every socket stores a complete and unique type definition.
This should be changed to module-level type declarations and referencing by 
name.

===

M   source/blender/blenvm/llvm/llvm_codegen.cc
M   source/blender/blenvm/llvm/llvm_codegen.h

===

diff --git a/source/blender/blenvm/llvm/llvm_codegen.cc 
b/source/blender/blenvm/llvm/llvm_codegen.cc
index 560c19b..dde5e11 100644
--- a/source/blender/blenvm/llvm/llvm_codegen.cc
+++ b/source/blender/blenvm/llvm/llvm_codegen.cc
@@ -30,6 +30,7 @@
  */
 
 #include 
+#include 
 
 #include "nodegraph.h"
 
@@ -38,8 +39,86 @@
 #include "llvm_function.h"
 #include "llvm_headers.h"
 
+/* TypeBuilder specializations for own structs */
+
+namespace llvm {
+
+template 
+class TypeBuilder {
+public:
+   static StructType *get(LLVMContext ) {
+   return StructType::get(
+   TypeBuilder::get(context),
+   TypeBuilder::get(context),
+   TypeBuilder::get(context),
+   NULL);
+   }
+   
+   enum Fields {
+   FIELD_X = 0,
+   FIELD_Y = 1,
+   FIELD_Z = 2,
+   };
+};
+
+template 
+class TypeBuilder {
+public:
+   static StructType *get(LLVMContext ) {
+   return StructType::get(
+   TypeBuilder::get(context),
+   TypeBuilder::get(context),
+   TypeBuilder::get(context),
+   TypeBuilder::get(context),
+   NULL);
+   }
+   
+   enum Fields {
+   FIELD_X = 0,
+   FIELD_Y = 1,
+   FIELD_Z = 2,
+   FIELD_W = 3,
+   };
+};
+
+template 
+class TypeBuilder {
+public:
+   static StructType *get(LLVMContext ) {
+   return StructType::get(
+   ArrayType::get(
+   ArrayType::get(
+   TypeBuilder::get(context),
+   4),
+   4),
+   NULL);
+   }
+};
+
+} /* namespace llvm */
+
+
 namespace blenvm {
 
+/* XXX Should eventually declare and reference types by name,
+ * rather than storing full TypeDesc in each socket!
+ * These functions just provides per-socket type names in the meantime.
+ */
+static string dummy_type_name(const InputKey )
+{
+   size_t hash = std::hash()(input.node) ^ 
std::hash()(input.socket);
+   std::stringstream ss;
+   ss << "InputType" << (unsigned short)hash;
+   return ss.str();
+}
+static string dummy_type_name(const OutputKey )
+{
+   size_t hash = std::hash()(output.node) ^ 
std::hash()(output.socket);
+   std::stringstream ss;
+   ss << "OutputType" << (unsigned short)hash;
+   return ss.str();
+}
+
 LLVMCompiler::LLVMCompiler()
 {
 }
@@ -48,11 +127,47 @@ LLVMCompiler::~LLVMCompiler()
 {
 }
 
-llvm::Type *LLVMCompiler::codegen_typedesc(TypeDesc *td)
+llvm::LLVMContext ::context() const
+{
+   return llvm::getGlobalContext();
+}
+
+llvm::Type *LLVMCompiler::codegen_typedesc(const string , const TypeDesc 
*td)
 {
using namespace llvm;

-   // TODO
+   if (td->is_structure()) {
+   const StructSpec *s = td->structure();
+   std::vector elemtypes;
+   for (int i = 0; i < s->num_fields(); ++s) {
+   Type *ftype = codegen_typedesc(s->field(i).name, 
>field(i).typedesc);
+   elemtypes.push_back(ftype);
+   }
+   
+   StructType *stype = StructType::create(context(), 
ArrayRef(elemtypes), name);
+   return stype;
+   }
+   else {
+   switch (td->base_type()) {
+   case BVM_FLOAT:
+   return TypeBuilder::get(context());
+   case BVM_FLOAT3:
+   return TypeBuilder::get(context());
+   case BVM_FLOAT4:
+   return TypeBuilder::get(context());
+   case BVM_INT:
+   

[Bf-blender-cvs] [1761091] object_nodes: Only insert functions into the function cache when use_cache argument is true.

2016-04-05 Thread Lukas Tönne
Commit: 1761091ce68559d725e8a482a1ea79518e9a9edc
Author: Lukas Tönne
Date:   Tue Apr 5 10:26:59 2016 +0200
Branches: object_nodes
https://developer.blender.org/rB1761091ce68559d725e8a482a1ea79518e9a9edc

Only insert functions into the function cache when use_cache argument is true.

===

M   source/blender/blenvm/intern/bvm_api.cc

===

diff --git a/source/blender/blenvm/intern/bvm_api.cc 
b/source/blender/blenvm/intern/bvm_api.cc
index f64bc4d..36b7367 100644
--- a/source/blender/blenvm/intern/bvm_api.cc
+++ b/source/blender/blenvm/intern/bvm_api.cc
@@ -430,7 +430,9 @@ struct BVMFunction 
*BVM_gen_forcefield_function_bvm(bNodeTree *btree, bool use_c
BVMCompiler compiler;
fn = compiler.compile_function(graph);

-   function_bvm_cache_set(btree, fn);
+   if (use_cache) {
+   function_bvm_cache_set(btree, fn);
+   }
}

bvm_lock.unlock();
@@ -1012,7 +1014,9 @@ struct BVMFunction 
*BVM_gen_texture_function_bvm(bNodeTree *btree, bool use_cach
BVMCompiler compiler;
fn = compiler.compile_function(graph);

-   function_bvm_cache_set(btree, fn);
+   if (use_cache) {
+   function_bvm_cache_set(btree, fn);
+   }
}

bvm_lock.unlock();
@@ -1041,7 +1045,9 @@ struct BVMFunction 
*BVM_gen_texture_function_llvm(bNodeTree *btree, bool use_cac
LLVMCompiler compiler;
fn = 
compiler.compile_function(get_ntree_unique_function_name(btree), graph);

-   function_llvm_cache_set(btree, fn);
+   if (use_cache) {
+   function_llvm_cache_set(btree, fn);
+   }
}

llvm_lock.unlock();
@@ -1152,7 +1158,9 @@ struct BVMFunction *BVM_gen_modifier_function_bvm(struct 
bNodeTree *btree, bool
BVMCompiler compiler;
fn = compiler.compile_function(graph);

-   function_bvm_cache_set(btree, fn);
+   if (use_cache) {
+   function_bvm_cache_set(btree, fn);
+   }
}

bvm_lock.unlock();
@@ -1238,7 +1246,9 @@ struct BVMFunction *BVM_gen_dupli_function_bvm(struct 
bNodeTree *btree, bool use
BVMCompiler compiler;
fn = compiler.compile_function(graph);

-   function_bvm_cache_set(btree, fn);
+   if (use_cache) {
+   function_bvm_cache_set(btree, fn);
+   }
}

bvm_lock.unlock();

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


[Bf-blender-cvs] [baf585c] object_nodes: Retain functions both for storage in the cache as well as keeping the pointer during eval.

2016-04-05 Thread Lukas Tönne
Commit: baf585cdc529366fc2542a3b163c1d5a09c640c7
Author: Lukas Tönne
Date:   Tue Apr 5 11:04:44 2016 +0200
Branches: object_nodes
https://developer.blender.org/rBbaf585cdc529366fc2542a3b163c1d5a09c640c7

Retain functions both for storage in the cache as well as keeping the pointer 
during eval.

Otherwise the function is freed immediately after each use, making the cache 
pointless.

===

M   source/blender/blenvm/intern/bvm_api.cc
M   source/blender/blenvm/intern/function_cache.cc

===

diff --git a/source/blender/blenvm/intern/bvm_api.cc 
b/source/blender/blenvm/intern/bvm_api.cc
index 36b7367..b89cbc9 100644
--- a/source/blender/blenvm/intern/bvm_api.cc
+++ b/source/blender/blenvm/intern/bvm_api.cc
@@ -98,7 +98,9 @@ void BVM_free(void)
using namespace blenvm;

blenvm::function_bvm_cache_clear();
+#ifdef WITH_LLVM
blenvm::function_llvm_cache_clear();
+#endif

nodes_free();

@@ -435,6 +437,8 @@ struct BVMFunction 
*BVM_gen_forcefield_function_bvm(bNodeTree *btree, bool use_c
}
}

+   fn->retain(fn);
+   
bvm_lock.unlock();

return (BVMFunction *)fn;
@@ -1019,6 +1023,8 @@ struct BVMFunction 
*BVM_gen_texture_function_bvm(bNodeTree *btree, bool use_cach
}
}

+   fn->retain(fn);
+   
bvm_lock.unlock();

return (BVMFunction *)fn;
@@ -1050,6 +1056,8 @@ struct BVMFunction 
*BVM_gen_texture_function_llvm(bNodeTree *btree, bool use_cac
}
}

+   fn->retain(fn);
+   
llvm_lock.unlock();

return (BVMFunction *)fn;
@@ -1163,6 +1171,8 @@ struct BVMFunction *BVM_gen_modifier_function_bvm(struct 
bNodeTree *btree, bool
}
}

+   fn->retain(fn);
+   
bvm_lock.unlock();

return (BVMFunction *)fn;
@@ -1251,6 +1261,8 @@ struct BVMFunction *BVM_gen_dupli_function_bvm(struct 
bNodeTree *btree, bool use
}
}

+   fn->retain(fn);
+   
bvm_lock.unlock();

return (BVMFunction *)fn;
diff --git a/source/blender/blenvm/intern/function_cache.cc 
b/source/blender/blenvm/intern/function_cache.cc
index 840d9c7..82760e0 100644
--- a/source/blender/blenvm/intern/function_cache.cc
+++ b/source/blender/blenvm/intern/function_cache.cc
@@ -53,7 +53,6 @@ struct FunctionCache {
function_type *fn = NULL;
if (it != m_functions.end()) {
fn = it->second;
-   function_type::retain(fn);
}
return fn;
}

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


[Bf-blender-cvs] [2490779] blender-v2.77-release: Correct merge error

2016-04-05 Thread Campbell Barton
Commit: 249077901320a006398a8ad55a73cb6717d5df39
Author: Campbell Barton
Date:   Tue Apr 5 19:02:39 2016 +1000
Branches: blender-v2.77-release
https://developer.blender.org/rB249077901320a006398a8ad55a73cb6717d5df39

Correct merge error

===

M   source/blender/blenkernel/intern/icons.c
M   source/blender/blenlib/BLI_ghash.h

===

diff --git a/source/blender/blenkernel/intern/icons.c 
b/source/blender/blenkernel/intern/icons.c
index 45ebada..f3e86b4 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -273,9 +273,10 @@ PreviewImage *BKE_previewimg_cached_get(const char *name)
 PreviewImage *BKE_previewimg_cached_ensure(const char *name)
 {
PreviewImage *prv = NULL;
-   void **prv_p;
+   void **key_p, **prv_p;
 
-   if (!BLI_ghash_ensure_p_ex(gCachedPreviews, name, _p, 
(GHashKeyCopyFP)BLI_strdup)) {
+   if (!BLI_ghash_ensure_p_ex(gCachedPreviews, name, _p, _p)) {
+   *key_p = BLI_strdup(name);
*prv_p = BKE_previewimg_create();
}
prv = *prv_p;
diff --git a/source/blender/blenlib/BLI_ghash.h 
b/source/blender/blenlib/BLI_ghash.h
index f13e8cb..873ee4f 100644
--- a/source/blender/blenlib/BLI_ghash.h
+++ b/source/blender/blenlib/BLI_ghash.h
@@ -94,7 +94,7 @@ void  *BLI_ghash_lookup(GHash *gh, const void *key) 
ATTR_WARN_UNUSED_RESULT;
 void  *BLI_ghash_lookup_default(GHash *gh, const void *key, void *val_default) 
ATTR_WARN_UNUSED_RESULT;
 void **BLI_ghash_lookup_p(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT;
 bool   BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) 
ATTR_WARN_UNUSED_RESULT;
-bool   BLI_ghash_ensure_p_ex(GHash *gh, const void *key, void ***r_val, 
GHashKeyCopyFP keycopyfp) ATTR_WARN_UNUSED_RESULT;
+bool   BLI_ghash_ensure_p_ex(GHash *gh, const void *key, void ***r_key, void 
***r_val) ATTR_WARN_UNUSED_RESULT;
 bool   BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, 
GHashValFreeFP valfreefp);
 void   BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP 
valfreefp);
 void   BLI_ghash_clear_ex(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP 
valfreefp,

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


[Bf-blender-cvs] [8b55e0e] blender-v2.77-release: Remove newly added function (harmless but unused)

2016-04-05 Thread Campbell Barton
Commit: 8b55e0e8778da53c88bfc6f58973c010f141b024
Author: Campbell Barton
Date:   Tue Apr 5 18:58:42 2016 +1000
Branches: blender-v2.77-release
https://developer.blender.org/rB8b55e0e8778da53c88bfc6f58973c010f141b024

Remove newly added function (harmless but unused)

===

M   source/blender/blenlib/intern/BLI_ghash.c

===

diff --git a/source/blender/blenlib/intern/BLI_ghash.c 
b/source/blender/blenlib/intern/BLI_ghash.c
index 06946e5..e2f1f83 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -1395,30 +1395,6 @@ bool BLI_gset_add(GSet *gs, void *key)
 }
 
 /**
- * Set counterpart to #BLI_ghash_ensure_p_ex.
- * similar to BLI_gset_add, except it returns the key pointer.
- *
- * \warning Caller _must_ write to \a r_key when returning false.
- */
-bool BLI_gset_ensure_p_ex(GSet *gs, const void *key, void ***r_key)
-{
-   const unsigned int hash = ghash_keyhash((GHash *)gs, key);
-   const unsigned int bucket_index = ghash_bucket_index((GHash *)gs, hash);
-   GSetEntry *e = (GSetEntry *)ghash_lookup_entry_ex((GHash *)gs, key, 
bucket_index);
-   const bool haskey = (e != NULL);
-
-   if (!haskey) {
-   /* pass 'key' incase we resize */
-   e = BLI_mempool_alloc(((GHash *)gs)->entrypool);
-   ghash_insert_ex_keyonly_entry((GHash *)gs, (void *)key, 
bucket_index, (Entry *)e);
-   e->key = NULL;  /* caller must re-assign */
-   }
-
-   *r_key = >key;
-   return haskey;
-}
-
-/**
  * Adds the key to the set (duplicates are managed).
  * Matching #BLI_ghash_reinsert
  *

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


[Bf-blender-cvs] [d979ba0] blender-v2.77-release: Blender 2.77a: Point addons to a new submodule hash

2016-04-05 Thread Sergey Sharybin
Commit: d979ba0f73c0f8471817a67ab3fb42fbf6b79191
Author: Sergey Sharybin
Date:   Tue Apr 5 10:55:38 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBd979ba0f73c0f8471817a67ab3fb42fbf6b79191

Blender 2.77a: Point addons to a new submodule hash

===

M   release/scripts/addons

===

diff --git a/release/scripts/addons b/release/scripts/addons
index de35192..9fccb98 16
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit de351922ee98e690c1f3aa942b300367abe878e2
+Subproject commit 9fccb9806a8fc2cf6b13668ca604ce778a7f6e4c

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


[Bf-blender-cvs] [19f3230] blender-v2.77-release: Particles: Fix broken grid distribution in some case from own recent rB201d3938622.

2016-04-05 Thread Bastien Montagne
Commit: 19f323012ae925a245c2b9e8bd64737bab7f6ec8
Author: Bastien Montagne
Date:   Wed Mar 30 16:54:13 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB19f323012ae925a245c2b9e8bd64737bab7f6ec8

Particles: Fix broken grid distribution in some case from own recent 
rB201d3938622.

===

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

===

diff --git a/source/blender/blenkernel/intern/particle_distribute.c 
b/source/blender/blenkernel/intern/particle_distribute.c
index 0e45f6b..ccbc239 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -822,6 +822,7 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
else {
dm = CDDM_from_mesh((Mesh*)ob->data);
}
+   DM_ensure_tessface(dm);
 
distribute_grid(dm,psys);

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


[Bf-blender-cvs] [ebceb93] blender-v2.77-release: Fix T47902: Particle grid not using modifier stack.

2016-04-05 Thread Bastien Montagne
Commit: ebceb93bb497a8ddacfee410dc85a19161f9d183
Author: Bastien Montagne
Date:   Fri Mar 25 22:46:19 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rBebceb93bb497a8ddacfee410dc85a19161f9d183

Fix T47902: Particle grid not using modifier stack.

Disclaimer: this is tentative fix, seems to be working but you never know with 
particles.
If issue arise, we'll just revert this commit and hide 'use modifier stack' 
option
for grid distribution instead.

This commit also try to make choice of which dm to use during distribution more 
generic
(deduplication of code), again hopping not to break anything. :P

===

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

===

diff --git a/source/blender/blenkernel/intern/particle_distribute.c 
b/source/blender/blenkernel/intern/particle_distribute.c
index 1c4099f..6d712ca 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -796,13 +796,23 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
}

psys_thread_context_init(ctx, sim);
-   
+
+   if (psys->part->use_modifier_stack)
+   dm = finaldm;
+   else
+   dm= CDDM_from_mesh((Mesh*)ob->data);
+
+   /* BMESH ONLY, for verts we don't care about tessfaces */
+   if (from != PART_FROM_VERT) {
+   DM_ensure_tessface(dm);
+   }
+
/* First handle special cases */
if (from == PART_FROM_CHILD) {
/* Simple children */
if (part->childtype != PART_CHILD_FACES) {
BLI_srandom(31415926 + psys->seed + psys->child_seed);
-   distribute_simple_children(scene, ob, finaldm, 
sim->psmd->dm_deformed, psys);
+   distribute_simple_children(scene, ob, dm, 
sim->psmd->dm_deformed, psys);
return 0;
}
}
@@ -810,10 +820,11 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
/* Grid distribution */
if (part->distr==PART_DISTR_GRID && from != PART_FROM_VERT) {
BLI_srandom(31415926 + psys->seed);
-   dm= CDDM_from_mesh((Mesh*)ob->data);
-   DM_ensure_tessface(dm);
-   distribute_grid(dm,psys);
-   dm->release(dm);
+
+   distribute_grid(dm, psys);
+
+   if (dm != finaldm) dm->release(dm);
+
return 0;
}
}
@@ -822,10 +833,6 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
if (from == PART_FROM_CHILD) {
distr=PART_DISTR_RAND;
BLI_srandom(31415926 + psys->seed + psys->child_seed);
-   dm= finaldm;
-
-   /* BMESH ONLY */
-   DM_ensure_tessface(dm);
 
children=1;
 
@@ -846,16 +853,6 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
distr = part->distr;
BLI_srandom(31415926 + psys->seed);

-   if (psys->part->use_modifier_stack)
-   dm = finaldm;
-   else
-   dm= CDDM_from_mesh((Mesh*)ob->data);
-
-   /* BMESH ONLY, for verts we don't care about tessfaces */
-   if (from != PART_FROM_VERT) {
-   DM_ensure_tessface(dm);
-   }
-
/* we need orco for consistent distributions */
if (!CustomData_has_layer(>vertData, CD_ORCO))
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, 
BKE_mesh_orco_verts_get(ob));

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


[Bf-blender-cvs] [2d887ae] blender-v2.77-release: Revert "Fix T47902: Particle grid not using modifier stack."

2016-04-05 Thread Bastien Montagne
Commit: 2d887ae200885c74bd9799ef3eaa450b622a10c4
Author: Bastien Montagne
Date:   Tue Mar 29 17:33:08 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB2d887ae200885c74bd9799ef3eaa450b622a10c4

Revert "Fix T47902: Particle grid not using modifier stack."

This reverts commit 2bd3acf7cd27c0c3ee77b10d56b91c3b03226d39.

Commit is valid in theory - but in practice, it means nearly all edited hair 
systems
would need to be re-created from scratch... Not nice, so better revert and note 
in code
that particle distribution is ugly and does not respect 'use modifier stack' 
option in most cases.

===

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

===

diff --git a/source/blender/blenkernel/intern/particle_distribute.c 
b/source/blender/blenkernel/intern/particle_distribute.c
index 6d712ca..1c4099f 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -796,23 +796,13 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
}

psys_thread_context_init(ctx, sim);
-
-   if (psys->part->use_modifier_stack)
-   dm = finaldm;
-   else
-   dm= CDDM_from_mesh((Mesh*)ob->data);
-
-   /* BMESH ONLY, for verts we don't care about tessfaces */
-   if (from != PART_FROM_VERT) {
-   DM_ensure_tessface(dm);
-   }
-
+   
/* First handle special cases */
if (from == PART_FROM_CHILD) {
/* Simple children */
if (part->childtype != PART_CHILD_FACES) {
BLI_srandom(31415926 + psys->seed + psys->child_seed);
-   distribute_simple_children(scene, ob, dm, 
sim->psmd->dm_deformed, psys);
+   distribute_simple_children(scene, ob, finaldm, 
sim->psmd->dm_deformed, psys);
return 0;
}
}
@@ -820,11 +810,10 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
/* Grid distribution */
if (part->distr==PART_DISTR_GRID && from != PART_FROM_VERT) {
BLI_srandom(31415926 + psys->seed);
-
-   distribute_grid(dm, psys);
-
-   if (dm != finaldm) dm->release(dm);
-
+   dm= CDDM_from_mesh((Mesh*)ob->data);
+   DM_ensure_tessface(dm);
+   distribute_grid(dm,psys);
+   dm->release(dm);
return 0;
}
}
@@ -833,6 +822,10 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
if (from == PART_FROM_CHILD) {
distr=PART_DISTR_RAND;
BLI_srandom(31415926 + psys->seed + psys->child_seed);
+   dm= finaldm;
+
+   /* BMESH ONLY */
+   DM_ensure_tessface(dm);
 
children=1;
 
@@ -853,6 +846,16 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
distr = part->distr;
BLI_srandom(31415926 + psys->seed);

+   if (psys->part->use_modifier_stack)
+   dm = finaldm;
+   else
+   dm= CDDM_from_mesh((Mesh*)ob->data);
+
+   /* BMESH ONLY, for verts we don't care about tessfaces */
+   if (from != PART_FROM_VERT) {
+   DM_ensure_tessface(dm);
+   }
+
/* we need orco for consistent distributions */
if (!CustomData_has_layer(>vertData, CD_ORCO))
DM_add_vert_layer(dm, CD_ORCO, CD_ASSIGN, 
BKE_mesh_orco_verts_get(ob));

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


[Bf-blender-cvs] [e97db72] blender-v2.77-release: Fix T47902: Particle grid not using modifier stack, Take II.

2016-04-05 Thread Bastien Montagne
Commit: e97db72ae40652501fb2486913a23f0b9625f75e
Author: Bastien Montagne
Date:   Tue Mar 29 17:45:56 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBe97db72ae40652501fb2486913a23f0b9625f75e

Fix T47902: Particle grid not using modifier stack, Take II.

Now only fix correct handling of use_modifier_stack for grid distribution,
fixing it globally breaks all existing edited hair systems. :/

===

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

===

diff --git a/source/blender/blenkernel/intern/particle_distribute.c 
b/source/blender/blenkernel/intern/particle_distribute.c
index 1c4099f..0e45f6b 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -795,6 +795,11 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
return 0;
}

+   /* XXX This distribution code is totally broken in case from == 
PART_FROM_CHILD, it's always using finaldm
+* even if use_modifier_stack is unset... But making things 
consistent here break all existing edited
+* hair systems, so better wait for complete rewrite.
+*/
+
psys_thread_context_init(ctx, sim);

/* First handle special cases */
@@ -810,10 +815,20 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
/* Grid distribution */
if (part->distr==PART_DISTR_GRID && from != PART_FROM_VERT) {
BLI_srandom(31415926 + psys->seed);
-   dm= CDDM_from_mesh((Mesh*)ob->data);
-   DM_ensure_tessface(dm);
+
+   if (psys->part->use_modifier_stack) {
+   dm = finaldm;
+   }
+   else {
+   dm = CDDM_from_mesh((Mesh*)ob->data);
+   }
+
distribute_grid(dm,psys);
-   dm->release(dm);
+
+   if (dm != finaldm) {
+   dm->release(dm);
+   }
+
return 0;
}
}

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


[Bf-blender-cvs] [f590b2f] blender-v2.77-release: Fix When using keying sets, the toggling "all items" in the array target only goes from the index value down, instead of keying all

2016-04-05 Thread Joshua Leung
Commit: f590b2f89f53f458c166f2de31f5881efacc4fe7
Author: Joshua Leung
Date:   Fri Apr 1 12:44:53 2016 +1300
Branches: blender-v2.77-release
https://developer.blender.org/rBf590b2f89f53f458c166f2de31f5881efacc4fe7

Fix When using keying sets, the toggling "all items" in the array target only 
goes from the index value down, instead of keying all

===

M   source/blender/editors/animation/keyingsets.c

===

diff --git a/source/blender/editors/animation/keyingsets.c 
b/source/blender/editors/animation/keyingsets.c
index 4b9a629..6a301d5 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -1014,8 +1014,10 @@ int ANIM_apply_keyingset(bContext *C, ListBase 
*dsources, bAction *act, KeyingSe
PropertyRNA *prop;

RNA_id_pointer_create(ksp->id, _ptr);
-   if (RNA_path_resolve_property(_ptr, ksp->rna_path, 
, ))
+   if (RNA_path_resolve_property(_ptr, ksp->rna_path, 
, )) {
arraylen = RNA_property_array_length(, 
prop);
+   i = 0;  /* start from start of array, instead 
of the previously specified index - T48020 */
+   }
}

/* we should do at least one step */

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


[Bf-blender-cvs] [a5cfe0f] blender-v2.77-release: Fix curve adding 3D nurbs when 2D is set

2016-04-05 Thread Campbell Barton
Commit: a5cfe0f9dcb213d2f81eaebaff37aec6b8fb0c42
Author: Campbell Barton
Date:   Mon Apr 4 17:47:55 2016 +1000
Branches: blender-v2.77-release
https://developer.blender.org/rBa5cfe0f9dcb213d2f81eaebaff37aec6b8fb0c42

Fix curve adding 3D nurbs when 2D is set

Ctrl-LMB ignored 2D constraint

===

M   source/blender/editors/curve/editcurve.c

===

diff --git a/source/blender/editors/curve/editcurve.c 
b/source/blender/editors/curve/editcurve.c
index 55e571e..268804e 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4767,7 +4767,7 @@ static bool ed_editcurve_extrude(Curve *cu, EditNurb 
*editnurb)
 
 /* add vertex operator **/
 
-static int ed_editcurve_addvert(Curve *cu, EditNurb *editnurb, const float 
location[3])
+static int ed_editcurve_addvert(Curve *cu, EditNurb *editnurb, const float 
location_init[3])
 {
Nurb *nu;
 
@@ -4808,7 +4808,7 @@ static int ed_editcurve_addvert(Curve *cu, EditNurb 
*editnurb, const float locat
int i;
 
mid_v3_v3v3(center, minmax[0], minmax[1]);
-   sub_v3_v3v3(ofs, location, center);
+   sub_v3_v3v3(ofs, location_init, center);
 
if ((cu->flag & CU_3D) == 0) {
ofs[2] = 0.0f;
@@ -4846,6 +4846,14 @@ static int ed_editcurve_addvert(Curve *cu, EditNurb 
*editnurb, const float locat
changed = true;
}
else {
+   float location[3];
+
+   copy_v3_v3(location, location_init);
+
+   if ((cu->flag & CU_3D) == 0) {
+   location[2] = 0.0f;
+   }
+
/* nothing selected: create a new curve */
nu = BKE_curve_nurb_active_get(cu);
 
@@ -4863,6 +4871,10 @@ static int ed_editcurve_addvert(Curve *cu, EditNurb 
*editnurb, const float locat
nurb_new->orderu = 4;
nurb_new->flag |= CU_SMOOTH;
BKE_nurb_bezierPoints_add(nurb_new, 1);
+
+   if ((cu->flag & CU_3D) == 0) {
+   nurb_new->flag |= CU_2D;
+   }
}
BLI_addtail(>nurbs, nurb_new);
 
@@ -4894,6 +4906,10 @@ static int ed_editcurve_addvert(Curve *cu, EditNurb 
*editnurb, const float locat
nurb_new->flag |= CU_SMOOTH;
nurb_new->orderu = 4;
BKE_nurb_points_add(nurb_new, 1);
+
+   if ((cu->flag & CU_3D) == 0) {
+   nurb_new->flag |= CU_2D;
+   }
}
BLI_addtail(>nurbs, nurb_new);

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


[Bf-blender-cvs] [37ab16d] blender-v2.77-release: Cycles: Fix regression caused by recent camera-in-volume commit

2016-04-05 Thread Sergey Sharybin
Commit: 37ab16d0759f4d10375a09a7d6bde55a43693ef7
Author: Sergey Sharybin
Date:   Mon Apr 4 18:24:40 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB37ab16d0759f4d10375a09a7d6bde55a43693ef7

Cycles: Fix regression caused by recent camera-in-volume commit

Stupid me forgot that we don't have stop-element in the stack yet.

===

M   intern/cycles/kernel/kernel_volume.h

===

diff --git a/intern/cycles/kernel/kernel_volume.h 
b/intern/cycles/kernel/kernel_volume.h
index 984eb7e..ef0d4f6 100644
--- a/intern/cycles/kernel/kernel_volume.h
+++ b/intern/cycles/kernel/kernel_volume.h
@@ -1011,7 +1011,7 @@ ccl_device void kernel_volume_stack_init(KernelGlobals 
*kg,
shader_setup_from_ray(kg, , isect, _ray);
if(sd.flag & SD_BACKFACING) {
bool need_add = true;
-   for(int i = 0; stack[i].shader != SHADER_NONE; 
++i) {
+   for(int i = 0; i < stack_index; ++i) {
/* If ray exited the volume and never 
entered to that volume
 * it means that camera is inside such 
a volume.
 */

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


[Bf-blender-cvs] [da0ce86] blender-v2.77-release: Cycles: Make curves modified by a taper object with modifier considered a deform modified

2016-04-05 Thread Sergey Sharybin
Commit: da0ce86a3cd048de66531a1f3c4f1bcb49f2310e
Author: Sergey Sharybin
Date:   Mon Apr 4 11:39:04 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBda0ce86a3cd048de66531a1f3c4f1bcb49f2310e

Cycles: Make curves modified by a taper object with modifier considered a 
deform modified

That might consider a bit more objects to be considered deform modified,
but it covers common case of using taper object without require of doing
recursive checks.

In worst case it'll be just some extra synchronization time, no render
time difference will happen for false-positive because of extra checks
happening in Cycles.

===

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

===

diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index d78b49b..1ba4852 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -3658,6 +3658,9 @@ static bool object_deforms_in_time(Object *object)
if (BKE_key_from_object(object) != NULL) {
return true;
}
+   if (!BLI_listbase_is_empty(>modifiers)) {
+   return true;
+   }
return object_moves_in_time(object);
 }

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


[Bf-blender-cvs] [b3f08cd] blender-v2.77-release: Fix NULL check before free

2016-04-05 Thread Campbell Barton
Commit: b3f08cddf3ec69275d4ac9d843a1d96d8713f93d
Author: Campbell Barton
Date:   Fri Apr 1 05:42:15 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBb3f08cddf3ec69275d4ac9d843a1d96d8713f93d

Fix NULL check before free

===

M   source/blender/editors/mesh/editmesh_knife.c

===

diff --git a/source/blender/editors/mesh/editmesh_knife.c 
b/source/blender/editors/mesh/editmesh_knife.c
index 59967ff..9480755 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -2276,12 +2276,8 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, 
BMFace *f, ListBase *kfe
KnifeEdge *kfe;
Ref *ref;
int edge_array_len = BLI_listbase_count(kfedges);
-   bool ok;
int i;
 
-   BMFace **face_arr;
-   int face_arr_len;
-
BMEdge **edge_array = BLI_array_alloca(edge_array, edge_array_len);
 
 /* point to knife edges we've created edges in, edge_array aligned */
@@ -2357,12 +2353,17 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, 
BMFace *f, ListBase *kfe
}
 #endif
 
-   ok = BM_face_split_edgenet(
-bm, f, edge_array, edge_array_len,
-_arr, _arr_len);
+   {
+   BMFace **face_arr = NULL;
+   int face_arr_len;
+
+   BM_face_split_edgenet(
+   bm, f, edge_array, edge_array_len,
+   _arr, _arr_len);
 
-   if (ok) {
-   MEM_freeN(face_arr);
+   if (face_arr) {
+   MEM_freeN(face_arr);
+   }
}
 
/* remove dangling edges, not essential - but nice for users */

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


[Bf-blender-cvs] [315703d] blender-v2.77-release: Cycles: Aligned vector was not covered by guarded stat

2016-04-05 Thread Sergey Sharybin
Commit: 315703d72570ef975663e89566f213457da0e972
Author: Sergey Sharybin
Date:   Wed Mar 30 10:46:56 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB315703d72570ef975663e89566f213457da0e972

Cycles: Aligned vector was not covered by guarded stat

This was making stats printed by the logging being wrong: they did not
include such memory as BVH storage.

===

M   intern/cycles/util/util_vector.h

===

diff --git a/intern/cycles/util/util_vector.h b/intern/cycles/util/util_vector.h
index 9f9e69c..d573939 100644
--- a/intern/cycles/util/util_vector.h
+++ b/intern/cycles/util/util_vector.h
@@ -107,7 +107,7 @@ public:
capacity = 0;
}
else {
-   data = (T*)util_aligned_malloc(sizeof(T)*newsize, 
alignment);
+   data = mem_allocate(newsize);
datasize = newsize;
capacity = datasize;
}
@@ -126,7 +126,7 @@ public:
capacity = 0;
}
else {
-   data = (T*)util_aligned_malloc(sizeof(T)*from.datasize, 
alignment);
+   data = mem_allocate(from.datasize);
memcpy(data, from.data, from.datasize*sizeof(T));
datasize = from.datasize;
capacity = datasize;
@@ -142,7 +142,7 @@ public:
data = NULL;
 
if(datasize > 0) {
-   data = (T*)util_aligned_malloc(sizeof(T)*datasize, 
alignment);
+   data = mem_allocate(datasize);
memcpy(data, [0], datasize*sizeof(T));
}
 
@@ -151,7 +151,7 @@ public:
 
~array()
{
-   util_aligned_free(data);
+   mem_free(data, capacity);
}
 
T* resize(size_t newsize)
@@ -161,15 +161,15 @@ public:
}
else if(newsize != datasize) {
if(newsize > capacity) {
-   T *newdata = 
(T*)util_aligned_malloc(sizeof(T)*newsize, alignment);
+   T *newdata = mem_allocate(newsize);
if(newdata == NULL) {
/* Allocation failed, likely out of 
memory. */
clear();
return NULL;
}
-   else if(data) {
+   else if(data != NULL) {
memcpy(newdata, data, ((datasize < 
newsize)? datasize: newsize)*sizeof(T));
-   util_aligned_free(data);
+   mem_free(data, capacity);
}
data = newdata;
capacity = newsize;
@@ -182,7 +182,7 @@ public:
void clear()
{
if(data != NULL) {
-   util_aligned_free(data);
+   mem_free(data, capacity);
data = NULL;
}
datasize = 0;
@@ -202,10 +202,10 @@ public:
 
void reserve(size_t newcapacity) {
if(newcapacity > capacity) {
-   T *newdata = 
(T*)util_aligned_malloc(sizeof(T)*newcapacity, alignment);
+   T *newdata = mem_allocate(newcapacity);
if(data) {
memcpy(newdata, data, ((datasize < 
newcapacity)? datasize: newcapacity)*sizeof(T));
-   util_aligned_free(data);
+   mem_free(data, capacity);
}
data = newdata;
capacity = newcapacity;
@@ -213,6 +213,23 @@ public:
}
 
 protected:
+   inline T* mem_allocate(size_t N)
+   {
+   T *mem = (T*)util_aligned_malloc(sizeof(T)*N, alignment);
+   if(mem != NULL) {
+   util_guarded_mem_alloc(sizeof(T)*N);
+   }
+   return mem;
+   }
+
+   inline void mem_free(T *mem, size_t N)
+   {
+   if(mem != NULL) {
+   util_guarded_mem_free(sizeof(T)*N);
+   util_aligned_free(mem);
+   }
+   }
+
T *data;
size_t datasize;
size_t capacity;

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


[Bf-blender-cvs] [4960006] blender-v2.77-release: Fix T47985: VSE GL-render scene strip hangs

2016-04-05 Thread Campbell Barton
Commit: 4960006b2716d0361ebabf31d9c5820cd9a75eb5
Author: Campbell Barton
Date:   Thu Mar 31 15:35:47 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB4960006b2716d0361ebabf31d9c5820cd9a75eb5

Fix T47985: VSE GL-render scene strip hangs

Regression in d5f1b9c22,
threading deadlock rendering a scene from the OpenGL preview.

===

M   source/blender/editors/render/render_opengl.c

===

diff --git a/source/blender/editors/render/render_opengl.c 
b/source/blender/editors/render/render_opengl.c
index 12fed3f..992b827 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -88,8 +88,13 @@ typedef struct OGLRender {
ScrArea *prevsa;
ARegion *prevar;
 
+   int views_len;  /* multi-view views */
+
bool is_sequencer;
SpaceSeq *sseq;
+   struct {
+   ImBuf **ibufs_arr;
+   } seq_data;
 
 
Image *ima;
@@ -253,7 +258,6 @@ static void screen_opengl_render_doit(OGLRender *oglrender, 
RenderResult *rr)
View3D *v3d = oglrender->v3d;
RegionView3D *rv3d = oglrender->rv3d;
Object *camera = NULL;
-   ImBuf *ibuf;
int sizex = oglrender->sizex;
int sizey = oglrender->sizey;
const short view_context = (v3d != NULL);
@@ -263,22 +267,11 @@ static void screen_opengl_render_doit(OGLRender 
*oglrender, RenderResult *rr)
const char *viewname = RE_GetActiveRenderView(oglrender->re);
 
if (oglrender->is_sequencer) {
-   SeqRenderData context;
SpaceSeq *sseq = oglrender->sseq;
-   int chanshown = sseq ? sseq->chanshown : 0;
struct bGPdata *gpd = (sseq && (sseq->flag & SEQ_SHOW_GPENCIL)) 
? sseq->gpd : NULL;
 
-   BKE_sequencer_new_render_data(
-   oglrender->bmain->eval_ctx, oglrender->bmain, scene,
-   oglrender->sizex, oglrender->sizey, 100.0f,
-   );
-
-   context.view_id = BKE_scene_multiview_view_id_get(>r, 
viewname);
-   context.gpu_offscreen = oglrender->ofs;
-   context.gpu_fx = oglrender->fx;
-   context.gpu_full_samples = oglrender->ofs_full_samples;
-
-   ibuf = BKE_sequencer_give_ibuf(, CFRA, chanshown);
+   /* use pre-calculated ImBuf (avoids deadlock), see: */
+   ImBuf *ibuf = oglrender->seq_data.ibufs_arr[oglrender->view_id];
 
if (ibuf) {
ImBuf *out = IMB_dupImBuf(ibuf);
@@ -429,8 +422,31 @@ static void screen_opengl_render_apply(OGLRender 
*oglrender)
ImBuf *ibuf;
void *lock;
 
+   if (oglrender->is_sequencer) {
+   Scene *scene = oglrender->scene;
+
+   SeqRenderData context;
+   SpaceSeq *sseq = oglrender->sseq;
+   int chanshown = sseq ? sseq->chanshown : 0;
+
+   BKE_sequencer_new_render_data(
+   oglrender->bmain->eval_ctx, oglrender->bmain, scene,
+   oglrender->sizex, oglrender->sizey, 100.0f,
+   );
+
+   for (view_id = 0; view_id < oglrender->views_len; view_id++) {
+   context.view_id = view_id;
+   context.gpu_offscreen = oglrender->ofs;
+   context.gpu_fx = oglrender->fx;
+   context.gpu_full_samples = oglrender->ofs_full_samples;
+
+   oglrender->seq_data.ibufs_arr[view_id] = 
BKE_sequencer_give_ibuf(, CFRA, chanshown);
+   }
+   }
+
rr = RE_AcquireResultRead(oglrender->re);
for (rv = rr->views.first, view_id = 0; rv; rv = rv->next, view_id++) {
+   BLI_assert(view_id < oglrender->views_len);
RE_SetActiveRenderView(oglrender->re, rv->name);
oglrender->view_id = view_id;
screen_opengl_render_doit(oglrender, rr);
@@ -529,9 +545,13 @@ static bool screen_opengl_render_init(bContext *C, 
wmOperator *op)
 
oglrender->write_still = is_write_still && !is_animation;
 
+   oglrender->views_len = BKE_scene_multiview_num_views_get(>r);
+
oglrender->is_sequencer = is_sequencer;
if (is_sequencer) {
oglrender->sseq = CTX_wm_space_seq(C);
+   ImBuf **ibufs_arr = MEM_callocN(sizeof(*ibufs_arr) * 
oglrender->views_len, __func__);
+   oglrender->seq_data.ibufs_arr = ibufs_arr;
}
 
oglrender->prevsa = prevsa;
@@ -616,6 +636,10 @@ static void screen_opengl_render_end(bContext *C, 
OGLRender *oglrender)
 
GPU_offscreen_free(oglrender->ofs);
 
+   if (oglrender->is_sequencer) {
+   MEM_freeN(oglrender->seq_data.ibufs_arr);
+   }
+
oglrender->scene->customdata_mask_modal = 0;
 

[Bf-blender-cvs] [0fcb17f] blender-v2.77-release: Remove the obsolete windows launcher

2016-04-05 Thread Martijn Berger
Commit: 0fcb17fc4f218f52b44a1e8bb912d637ec327dec
Author: Martijn Berger
Date:   Thu Mar 31 14:07:57 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB0fcb17fc4f218f52b44a1e8bb912d637ec327dec

Remove the obsolete windows launcher

===

D   source/creator/creator_launch_win.c

===

diff --git a/source/creator/creator_launch_win.c 
b/source/creator/creator_launch_win.c
deleted file mode 100644
index 03f28cd..000
--- a/source/creator/creator_launch_win.c
+++ /dev/null
@@ -1,90 +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.
- *
- * The Original Code is Copyright (C) 2014 by Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): Sergey Sharybin.
- *
- * * END GPL LICENSE BLOCK *
- */
-
-/* Binary name to launch. */
-#define BLENDER_BINARY L"blender-app.exe"
-
-#define WIN32_LEAN_AND_MEAN
-#include 
-#include 
-
-#include 
-#include 
-
-#include "utfconv.h"
-
-#include "BLI_utildefines.h"
-#include "BLI_winstuff.h"
-
-static void local_hacks_do(void)
-{
-   _putenv_s("OMP_WAIT_POLICY", "PASSIVE");
-}
-
-int main(int argc, const char **UNUSED(argv_c))
-{
-   PROCESS_INFORMATION processInformation = {0};
-   STARTUPINFOW startupInfo = {0};
-   BOOL result;
-   wchar_t command[65536];
-   int i, len = sizeof(command) / sizeof(wchar_t);
-   wchar_t **argv_16 = CommandLineToArgvW(GetCommandLineW(), );
-   int argci = 0;
-
-   local_hacks_do();
-
-   wcsncpy(command, BLENDER_BINARY, len - 1);
-   len -= wcslen(BLENDER_BINARY);
-   for (i = 1; i < argc; ++i) {
-   size_t argument_len = wcslen(argv_16[i]);
-   wcsncat(command, L" \"", len - 2);
-   wcsncat(command, argv_16[i], len - 3);
-   len -= argument_len + 1;
-   if (argv_16[i][argument_len - 1] == '\\') {
-   wcsncat(command, L"\\", len - 1);
-   len--;
-   }
-   wcsncat(command, L"\"", len - 1);
-   }
-
-   LocalFree(argv_16);
-
-   startupInfo.cb = sizeof(startupInfo);
-   result = CreateProcessW(NULL, command, NULL, NULL, TRUE,
-   0, NULL, NULL,
-   , );
-
-   if (!result) {
-   fprintf(stderr, "%S\n", L"Error launching " BLENDER_BINARY);
-   return EXIT_FAILURE;
-   }
-
-   WaitForSingleObject(processInformation.hProcess, INFINITE);
-
-   CloseHandle(processInformation.hProcess);
-   CloseHandle(processInformation.hThread);
-
-   return EXIT_SUCCESS;
-}

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


[Bf-blender-cvs] [18875f6] blender-v2.77-release: Fix T48013: UV Sculpt Brush Does not appear in UV window - but does show up in uv panels (t, n)

2016-04-05 Thread Philipp Oeser
Commit: 18875f6aa3a2cab1c82e23b799bb0a831e18b4df
Author: Philipp Oeser
Date:   Fri Apr 1 14:20:22 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB18875f6aa3a2cab1c82e23b799bb0a831e18b4df

Fix T48013: UV Sculpt Brush Does not appear in UV window - but does show up in 
uv panels (t, n)

Epic fail in recent rB2c3985 :/

To be backported to 2.77a!

===

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

===

diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c 
b/source/blender/editors/sculpt_paint/sculpt_uv.c
index 8ed654c..fd2a0b1 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -177,7 +177,7 @@ static int uv_sculpt_brush_poll_do(bContext *C, const bool 
check_region)
 
if (ret) {
ARegion *ar = CTX_wm_region(C);
-   if ((!toolsettings->use_uv_sculpt) || (check_region && ar && 
(ar->regiontype == RGN_TYPE_WINDOW))) {
+   if ((!toolsettings->use_uv_sculpt) || (check_region && ar && 
(ar->regiontype != RGN_TYPE_WINDOW))) {
ret = 0;
}
}

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


[Bf-blender-cvs] [828c795] blender-v2.77-release: Fix error in ghash/gset_ensure_p_ex

2016-04-05 Thread Campbell Barton
Commit: 828c7956c874e6f2e5d0d597b25ee36094c90621
Author: Campbell Barton
Date:   Wed Mar 30 03:00:26 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB828c7956c874e6f2e5d0d597b25ee36094c90621

Fix error in ghash/gset_ensure_p_ex

The key is needed in the case the ghash resizes.
Caused regression T47984.

===

M   source/blender/blenlib/intern/BLI_ghash.c

===

diff --git a/source/blender/blenlib/intern/BLI_ghash.c 
b/source/blender/blenlib/intern/BLI_ghash.c
index 21b0a58..06946e5 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -607,7 +607,7 @@ static Entry *ghash_pop(GHash *gh, GHashIterState *state)
}
 
/* Note: using first_bucket_index here allows us to avoid potential 
huge number of loops over buckets,
-*   in case we are poping from a large ghash with few items in 
it... */
+*   in case we are popping from a large ghash with few items in 
it... */
curr_bucket = ghash_find_next_bucket_index(gh, curr_bucket);
 
Entry *e = gh->buckets[curr_bucket];
@@ -836,11 +836,13 @@ bool BLI_ghash_ensure_p(GHash *gh, void *key, void 
***r_val)
 }
 
 /**
- * A version of #BLI_ghash_ensure_p copies the key on insertion.
+ * A version of #BLI_ghash_ensure_p that allows caller to re-assign the key.
+ * Typically used when the key is to be duplicated.
+ *
+ * \warning Caller _must_ write to \a r_key when returning false.
  */
 bool BLI_ghash_ensure_p_ex(
-GHash *gh, const void *key, void ***r_val,
-GHashKeyCopyFP keycopyfp)
+GHash *gh, const void *key, void ***r_key, void ***r_val)
 {
const unsigned int hash = ghash_keyhash(gh, key);
const unsigned int bucket_index = ghash_bucket_index(gh, hash);
@@ -848,11 +850,13 @@ bool BLI_ghash_ensure_p_ex(
const bool haskey = (e != NULL);
 
if (!haskey) {
-   /* keycopyfp(key) is the only difference to BLI_ghash_ensure_p 
*/
+   /* pass 'key' incase we resize */
e = BLI_mempool_alloc(gh->entrypool);
-   ghash_insert_ex_keyonly_entry(gh, keycopyfp(key), bucket_index, 
(Entry *)e);
+   ghash_insert_ex_keyonly_entry(gh, (void *)key, bucket_index, 
(Entry *)e);
+   e->e.key = NULL;  /* caller must re-assign */
}
 
+   *r_key = >e.key;
*r_val = >val;
return haskey;
 }
@@ -913,12 +917,12 @@ bool BLI_ghash_haskey(GHash *gh, const void *key)
 }
 
 /**
- * Remove a random entry from \a ghp, returning true if a key/value pair could 
be removed, false otherwise.
+ * Remove a random entry from \a gh, returning true if a key/value pair could 
be removed, false otherwise.
  *
  * \param r_key: The removed key.
  * \param r_val: The removed value.
  * \param state: Used for efficient removal.
- * \return true if there was somethjing to pop, false if ghash was already 
empty.
+ * \return true if there was something to pop, false if ghash was already 
empty.
  */
 bool BLI_ghash_pop(
 GHash *gh, GHashIterState *state,
@@ -1391,6 +1395,30 @@ bool BLI_gset_add(GSet *gs, void *key)
 }
 
 /**
+ * Set counterpart to #BLI_ghash_ensure_p_ex.
+ * similar to BLI_gset_add, except it returns the key pointer.
+ *
+ * \warning Caller _must_ write to \a r_key when returning false.
+ */
+bool BLI_gset_ensure_p_ex(GSet *gs, const void *key, void ***r_key)
+{
+   const unsigned int hash = ghash_keyhash((GHash *)gs, key);
+   const unsigned int bucket_index = ghash_bucket_index((GHash *)gs, hash);
+   GSetEntry *e = (GSetEntry *)ghash_lookup_entry_ex((GHash *)gs, key, 
bucket_index);
+   const bool haskey = (e != NULL);
+
+   if (!haskey) {
+   /* pass 'key' incase we resize */
+   e = BLI_mempool_alloc(((GHash *)gs)->entrypool);
+   ghash_insert_ex_keyonly_entry((GHash *)gs, (void *)key, 
bucket_index, (Entry *)e);
+   e->key = NULL;  /* caller must re-assign */
+   }
+
+   *r_key = >key;
+   return haskey;
+}
+
+/**
  * Adds the key to the set (duplicates are managed).
  * Matching #BLI_ghash_reinsert
  *
@@ -1413,11 +1441,11 @@ bool BLI_gset_haskey(GSet *gs, const void *key)
 }
 
 /**
- * Remove a random entry from \a gsp, returning true if a key could be 
removed, false otherwise.
+ * Remove a random entry from \a gs, returning true if a key could be removed, 
false otherwise.
  *
  * \param r_key: The removed key.
  * \param state: Used for efficient removal.
- * \return true if there was somethjing to pop, false if gset was already 
empty.
+ * \return true if there was something to pop, false if gset was already empty.
  */
 bool BLI_gset_pop(
 GSet *gs, GSetIterState *state,

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

[Bf-blender-cvs] [275ca01] blender-v2.77-release: Fix T47939, take II: Check clang package version, not llvm-devel one.

2016-04-05 Thread Bastien Montagne
Commit: 275ca01eac78b87d4759b671aecfd1c9ab577a91
Author: Bastien Montagne
Date:   Sat Mar 26 21:07:04 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB275ca01eac78b87d4759b671aecfd1c9ab577a91

Fix T47939, take II: Check clang package version, not llvm-devel one.

Looks like some distro still provide llvm-3.4-devel, while no more clang-3.4.
Since clang depends on llvm of same version, check clang only should ensure
us we also have matvhing llvm... *sigh*

===

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 9024ff0..9dde348 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -2642,7 +2642,7 @@ install_DEB() {
 INFO "Forced LLVM building, as requested..."
 _do_compile_llvm=true
   else
-check_package_DEB llvm-$LLVM_VERSION-dev
+check_package_DEB clang-$LLVM_VERSION
 if [ $? -eq 0 ]; then
   install_packages_DEB llvm-$LLVM_VERSION-dev clang-$LLVM_VERSION
   have_llvm=true
@@ -3161,21 +3161,28 @@ install_RPM() {
 _do_compile_llvm=true
   else
 # Problem compiling with LLVM 3.2 so match version 3.1 ...
-check_package_version_match_RPM llvm $LLVM_VERSION
-if [ $? -eq 0 ]; then
-  if [ "$RPM" = "SUSE" ]; then
+if [ "$RPM" = "SUSE" ]; then
+  check_package_version_match_RPM llvm-clang-devel $LLVM_VERSION
+  if [ $? -eq 0 ]; then
 install_packages_RPM llvm-devel llvm-clang-devel
+have_llvm=true
+LLVM_VERSION_FOUND=$LLVM_VERSION
+clean_LLVM
   else
-install_packages_RPM llvm-devel clang-devel
+# Better to compile it than use minimum version from repo...
+_do_compile_llvm=true
   fi
-  have_llvm=true
-  LLVM_VERSION_FOUND=$LLVM_VERSION
-  clean_LLVM
 else
-  #
-  # Better to compile it than use minimum version from repo...
-  #
-  _do_compile_llvm=true
+  check_package_version_match_RPM clang-devel $LLVM_VERSION
+  if [ $? -eq 0 ]; then
+install_packages_RPM llvm-devel clang-devel
+have_llvm=true
+LLVM_VERSION_FOUND=$LLVM_VERSION
+clean_LLVM
+  else
+# Better to compile it than use minimum version from repo...
+_do_compile_llvm=true
+  fi
 fi
   fi
 
@@ -3563,11 +3570,11 @@ install_ARCH() {
 INFO "Forced LLVM building, as requested..."
 _do_compile_llvm=true
   else
-check_package_version_match_ARCH llvm $LLVM_VERSION
+check_package_version_match_ARCH clang $LLVM_VERSION
 if [ $? -eq 0 ]; then
   install_packages_ARCH llvm clang
   have_llvm=true
-  LLVM_VERSION=`check_package_version_ge_ARCH llvm $LLVM_VERSION_MIN`
+  LLVM_VERSION=`check_package_version_ge_ARCH clang $LLVM_VERSION_MIN`
   LLVM_VERSION_FOUND=$LLVM_VERSION
   clean_LLVM
 else

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


[Bf-blender-cvs] [95de7b9] blender-v2.77-release: Fix T47939: Install Deps OSL 1.7.1 and clang-3.5

2016-04-05 Thread Bastien Montagne
Commit: 95de7b9a5fb378e77303fe401569e323cdd7896e
Author: Bastien Montagne
Date:   Sat Mar 26 00:31:41 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB95de7b9a5fb378e77303fe401569e323cdd7896e

Fix T47939: Install Deps OSL 1.7.1 and clang-3.5

Until we officially support llvm3.5 or more, only allow for 3.4 llvm packages,
and build own stuff otherwise...

===

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 9b080f7..9024ff0 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -2649,15 +2649,15 @@ install_DEB() {
   LLVM_VERSION_FOUND=$LLVM_VERSION
   clean_LLVM
 else
-  check_package_version_ge_DEB llvm-dev $LLVM_VERSION_MIN
-  if [ $? -eq 0 ]; then
-install_packages_DEB llvm-dev clang
-have_llvm=true
-LLVM_VERSION_FOUND=""  # Using default one, no need to specify it!
-clean_LLVM
-  else
-_do_compile_llvm=true
-  fi
+  #~ check_package_version_ge_DEB llvm-dev $LLVM_VERSION_MIN
+  #~ if [ $? -eq 0 ]; then
+#~ install_packages_DEB llvm-dev clang
+#~ have_llvm=true
+#~ LLVM_VERSION_FOUND=""  # Using default one, no need to specify it!
+#~ clean_LLVM
+  #~ else
+  _do_compile_llvm=true
+  #~ fi
 fi
   fi
 
@@ -3563,7 +3563,7 @@ install_ARCH() {
 INFO "Forced LLVM building, as requested..."
 _do_compile_llvm=true
   else
-check_package_version_ge_ARCH llvm $LLVM_VERSION_MIN
+check_package_version_match_ARCH llvm $LLVM_VERSION
 if [ $? -eq 0 ]; then
   install_packages_ARCH llvm clang
   have_llvm=true

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


[Bf-blender-cvs] [f36de27] blender-v2.77-release: Fix T47848: Fix regression in sequencer GL render

2016-04-05 Thread Campbell Barton
Commit: f36de2733965c96117aa9b68053c0fffa805779a
Author: Campbell Barton
Date:   Mon Mar 21 16:36:20 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBf36de2733965c96117aa9b68053c0fffa805779a

Fix T47848: Fix regression in sequencer GL render

Own changes in 2.77 broke off-screen render with scene render size doesn't 
match output.

===

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

===

diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index d81ef17..8c2d787 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3308,14 +3308,20 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
 {
RegionView3D *rv3d = ar->regiondata;
ImBuf *ibuf;
-   const bool draw_sky = (alpha_mode == R_ADDSKY) && v3d && (v3d->flag3 & 
V3D_SHOW_WORLD);
-   const bool own_ofs = (ofs == NULL);
+   const bool draw_sky = (alpha_mode == R_ADDSKY);
 
/* view state */
GPUFXSettings fx_settings = v3d->fx_settings;
bool is_ortho = false;
float winmat[4][4];
 
+   if (ofs && ((GPU_offscreen_width(ofs) != sizex) || 
(GPU_offscreen_height(ofs) != sizey))) {
+   /* sizes differ, can't reuse */
+   ofs = NULL;
+   }
+
+   const bool own_ofs = (ofs == NULL);
+
if (own_ofs) {
/* bind */
ofs = GPU_offscreen_create(sizex, sizey, full_samples ? 0 : 
samples, err_out);

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


[Bf-blender-cvs] [fc78a58] blender-v2.77-release: Cycles: Fix wrong camera in volume check when domain is only visible to camera rays

2016-04-05 Thread Sergey Sharybin
Commit: fc78a58337ab1021cd816737f3bbb496b9b4fe23
Author: Sergey Sharybin
Date:   Mon Apr 4 19:30:38 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBfc78a58337ab1021cd816737f3bbb496b9b4fe23

Cycles: Fix wrong camera in volume check when domain is only visible to camera 
rays

===

M   intern/cycles/kernel/geom/geom_bvh.h
M   intern/cycles/kernel/geom/geom_bvh_volume.h
M   intern/cycles/kernel/geom/geom_bvh_volume_all.h
M   intern/cycles/kernel/geom/geom_qbvh_volume.h
M   intern/cycles/kernel/geom/geom_qbvh_volume_all.h
M   intern/cycles/kernel/kernel_volume.h

===

diff --git a/intern/cycles/kernel/geom/geom_bvh.h 
b/intern/cycles/kernel/geom/geom_bvh.h
index d9f4076..d8e6224 100644
--- a/intern/cycles/kernel/geom/geom_bvh.h
+++ b/intern/cycles/kernel/geom/geom_bvh.h
@@ -371,39 +371,40 @@ ccl_device_intersect bool 
scene_intersect_shadow_all(KernelGlobals *kg, const Ra
 
 #ifdef __VOLUME__
 ccl_device_intersect bool scene_intersect_volume(KernelGlobals *kg,
-const Ray *ray,
-Intersection *isect)
+ const Ray *ray,
+ Intersection *isect,
+ const uint visibility)
 {
 #ifdef __OBJECT_MOTION__
if(kernel_data.bvh.have_motion) {
 #ifdef __HAIR__
if(kernel_data.bvh.have_curves)
-   return bvh_intersect_volume_hair_motion(kg, ray, isect);
+   return bvh_intersect_volume_hair_motion(kg, ray, isect, 
visibility);
 #endif /* __HAIR__ */
 
-   return bvh_intersect_volume_motion(kg, ray, isect);
+   return bvh_intersect_volume_motion(kg, ray, isect, visibility);
}
 #endif /* __OBJECT_MOTION__ */
 
 #ifdef __HAIR__
if(kernel_data.bvh.have_curves)
-   return bvh_intersect_volume_hair(kg, ray, isect);
+   return bvh_intersect_volume_hair(kg, ray, isect, visibility);
 #endif /* __HAIR__ */
 
 #ifdef __KERNEL_CPU__
 
 #ifdef __INSTANCING__
if(kernel_data.bvh.have_instancing)
-   return bvh_intersect_volume_instancing(kg, ray, isect);
+   return bvh_intersect_volume_instancing(kg, ray, isect, 
visibility);
 #endif /* __INSTANCING__ */
 
-   return bvh_intersect_volume(kg, ray, isect);
+   return bvh_intersect_volume(kg, ray, isect, visibility);
 #else /* __KERNEL_CPU__ */
 
 #ifdef __INSTANCING__
-   return bvh_intersect_volume_instancing(kg, ray, isect);
+   return bvh_intersect_volume_instancing(kg, ray, isect, visibility);
 #else
-   return bvh_intersect_volume(kg, ray, isect);
+   return bvh_intersect_volume(kg, ray, isect, visibility);
 #endif /* __INSTANCING__ */
 
 #endif /* __KERNEL_CPU__ */
@@ -414,30 +415,31 @@ ccl_device_intersect bool 
scene_intersect_volume(KernelGlobals *kg,
 ccl_device_intersect uint scene_intersect_volume_all(KernelGlobals *kg,
  const Ray *ray,
  Intersection *isect,
- const uint max_hits)
+ const uint max_hits,
+ const uint visibility)
 {
 #ifdef __OBJECT_MOTION__
if(kernel_data.bvh.have_motion) {
 #ifdef __HAIR__
if(kernel_data.bvh.have_curves)
-   return bvh_intersect_volume_all_hair_motion(kg, ray, 
isect, max_hits);
+   return bvh_intersect_volume_all_hair_motion(kg, ray, 
isect, max_hits, visibility);
 #endif /* __HAIR__ */
 
-   return bvh_intersect_volume_all_motion(kg, ray, isect, 
max_hits);
+   return bvh_intersect_volume_all_motion(kg, ray, isect, 
max_hits, visibility);
}
 #endif /* __OBJECT_MOTION__ */
 
 #ifdef __HAIR__
if(kernel_data.bvh.have_curves)
-   return bvh_intersect_volume_all_hair(kg, ray, isect, max_hits);
+   return bvh_intersect_volume_all_hair(kg, ray, isect, max_hits, 
visibility);
 #endif /* __HAIR__ */
 
 #ifdef __INSTANCING__
if(kernel_data.bvh.have_instancing)
-   return bvh_intersect_volume_all_instancing(kg, ray, isect, 
max_hits);
+   return bvh_intersect_volume_all_instancing(kg, ray, isect, 
max_hits, visibility);
 #endif /* __INSTANCING__ */
 
-   return bvh_intersect_volume_all(kg, ray, isect, max_hits);
+   return bvh_intersect_volume_all(kg, ray, isect, max_hits, visibility);
 }
 #endif
 
diff --git a/intern/cycles/kernel/geom/geom_bvh_volume.h 
b/intern/cycles/kernel/geom/geom_bvh_volume.h
index 656cd6e..b1b2e2d 100644
--- a/intern/cycles/kernel/geom/geom_bvh_volume.h
+++ 

[Bf-blender-cvs] [e63a8e7] blender-v2.77-release: Fix curve hide keeping spline active

2016-04-05 Thread Campbell Barton
Commit: e63a8e7ded3953038654387b9a88a1552d6217f6
Author: Campbell Barton
Date:   Mon Apr 4 17:55:28 2016 +1000
Branches: blender-v2.77-release
https://developer.blender.org/rBe63a8e7ded3953038654387b9a88a1552d6217f6

Fix curve hide keeping spline active

===

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

===

diff --git a/source/blender/blenkernel/intern/curve.c 
b/source/blender/blenkernel/intern/curve.c
index 3329d3a..4c09998 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -4256,6 +4256,7 @@ void BKE_curve_nurb_active_set(Curve *cu, const Nurb *nu)
cu->actnu = CU_ACT_NONE;
}
else {
+   BLI_assert(!nu->hide);
ListBase *nurbs = BKE_curve_editNurbs_get(cu);
cu->actnu = BLI_findindex(nurbs, nu);
}
@@ -4359,6 +4360,10 @@ void BKE_curve_nurb_vert_active_validate(Curve *cu)
cu->actvert = CU_ACT_NONE;
}
}
+
+   if (nu->hide) {
+   cu->actnu = CU_ACT_NONE;
+   }
}
 }

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


[Bf-blender-cvs] [3ed49f8] blender-v2.77-release: Fix T47505: Cycles OpenCL rendering crash on Windows.

2016-04-05 Thread Brecht Van Lommel
Commit: 3ed49f8bc92f5038b2068fc2165d98f55ac86dc0
Author: Brecht Van Lommel
Date:   Fri Apr 1 20:37:24 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB3ed49f8bc92f5038b2068fc2165d98f55ac86dc0

Fix T47505: Cycles OpenCL rendering crash on Windows.

Restore the boost bug workaround, but without changing the locale.

===

M   intern/cycles/util/util_path.cpp

===

diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp
index b7aa24a..adefcdb 100644
--- a/intern/cycles/util/util_path.cpp
+++ b/intern/cycles/util/util_path.cpp
@@ -19,6 +19,7 @@
 #include "util_path.h"
 #include "util_string.h"
 
+#include 
 #include 
 #include 
 
@@ -335,6 +336,13 @@ void path_init(const string& path, const string& user_path)
 {
cached_path = path;
cached_user_path = user_path;
+
+#ifdef _MSC_VER
+   // workaround for https://svn.boost.org/trac/boost/ticket/6320
+   // indirectly init boost codec here since it's not thread safe, and can
+   // cause crashes when it happens in multithreaded image load
+   OIIO::Filesystem::exists(path);
+#endif
 }
 
 string path_get(const string& sub)

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


[Bf-blender-cvs] [754566c] blender-v2.77-release: Fix T48030: Can't zoom VSE properties panel

2016-04-05 Thread Campbell Barton
Commit: 754566cf5bfb795a9b38312a8e6edce4e0045827
Author: Campbell Barton
Date:   Sat Apr 2 18:52:52 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB754566cf5bfb795a9b38312a8e6edce4e0045827

Fix T48030: Can't zoom VSE properties panel

===

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

===

diff --git a/source/blender/editors/interface/view2d_ops.c 
b/source/blender/editors/interface/view2d_ops.c
index ca1efb8..f60fed3 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -572,7 +572,7 @@ static void view_zoom_axis_lock_defaults(bContext *C, bool 
r_do_zoom_xy[2])
if (sa && sa->spacetype == SPACE_SEQ) {
ARegion *ar = CTX_wm_region(C);
 
-   if (ar && ar->regiontype != RGN_TYPE_PREVIEW)
+   if (ar && ar->regiontype == RGN_TYPE_WINDOW)
r_do_zoom_xy[1] = false;
}
 }

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


[Bf-blender-cvs] [f2ae9c6] blender-v2.77-release: Fix curve, missing update on Ctrl-LMB

2016-04-05 Thread Campbell Barton
Commit: f2ae9c6f8535a0f5f6519d28636d32d816b96bb5
Author: Campbell Barton
Date:   Mon Apr 4 18:18:21 2016 +1000
Branches: blender-v2.77-release
https://developer.blender.org/rBf2ae9c6f8535a0f5f6519d28636d32d816b96bb5

Fix curve, missing update on Ctrl-LMB

===

M   source/blender/editors/curve/editcurve.c

===

diff --git a/source/blender/editors/curve/editcurve.c 
b/source/blender/editors/curve/editcurve.c
index 22cb479..55e571e 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4830,6 +4830,8 @@ static int ed_editcurve_addvert(Curve *cu, EditNurb 
*editnurb, const float locat
}
}
}
+
+   BKE_nurb_handles_calc(nu);
}
else {
BPoint *bp;

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


[Bf-blender-cvs] [8e1e3e0] blender-v2.77-release: Fix T48001: Highlighting selected item in filtered lists.

2016-04-05 Thread Bastien Montagne
Commit: 8e1e3e0228a6917fb368bbc7675a484941cff0ef
Author: Bastien Montagne
Date:   Fri Apr 1 16:54:01 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB8e1e3e0228a6917fb368bbc7675a484941cff0ef

Fix T48001: Highlighting selected item in filtered lists.

active index was not reset to 'nothing' in case actual active item was filtered 
out.

===

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

===

diff --git a/source/blender/editors/interface/interface_templates.c 
b/source/blender/editors/interface/interface_templates.c
index 1bff2dd..144fc5b 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -3017,7 +3017,7 @@ void uiTemplateList(
/* So that we do not map again 
activei! */
activei_mapping_pending = false;
}
-# if 0 /* For now, do not alter active element, even if it will be hidden... */
+#if 0 /* For now, do not alter active element, even if it will be hidden... */
else if (activei < i) {
/* We do not want an active but 
invisible item!
 * Only exception is when all 
items are filtered out...
@@ -3038,6 +3038,11 @@ void uiTemplateList(
i++;
}
RNA_PROP_END;
+
+   if (activei_mapping_pending) {
+   /* No active item found, set to 'invalid' -1 
value... */
+   activei = -1;
+   }
}
if (dyn_data->items_shown >= 0) {
len = dyn_data->items_shown;

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


[Bf-blender-cvs] [f615b57] blender-v2.77-release: Fix curve editmode adding 3D primitives w/ 2D curves

2016-04-05 Thread Campbell Barton
Commit: f615b5737935d8b1f504dd9989047ecc1a715e32
Author: Campbell Barton
Date:   Mon Apr 4 18:34:04 2016 +1000
Branches: blender-v2.77-release
https://developer.blender.org/rBf615b5737935d8b1f504dd9989047ecc1a715e32

Fix curve editmode adding 3D primitives w/ 2D curves

===

M   source/blender/editors/curve/editcurve_add.c

===

diff --git a/source/blender/editors/curve/editcurve_add.c 
b/source/blender/editors/curve/editcurve_add.c
index 246f089..cc8e272 100644
--- a/source/blender/editors/curve/editcurve_add.c
+++ b/source/blender/editors/curve/editcurve_add.c
@@ -121,7 +121,6 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object 
*obedit, float mat[4][4],
const float grid = 1.0f;
const int cutype = (type & CU_TYPE); // poly, bezier, nurbs, etc
const int stype = (type & CU_PRIMITIVE);
-   const bool force_3d = (((Curve *)obedit->data)->flag & CU_3D) != 0; /* 
could be adding to an existing 3D curve */
 
unit_m4(umat);
unit_m4(viewmat);
@@ -145,7 +144,6 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object 
*obedit, float mat[4][4],
case CU_PRIM_CURVE: /* curve */
nu->resolu = cu->resolu;
if (cutype == CU_BEZIER) {
-   if (!force_3d) nu->flag |= CU_2D;
nu->pntsu = 2;
nu->bezt = (BezTriple *)MEM_callocN(2 * 
sizeof(BezTriple), "addNurbprim1");
bezt = nu->bezt;
@@ -247,7 +245,6 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object 
*obedit, float mat[4][4],
nu->resolu = cu->resolu;
 
if (cutype == CU_BEZIER) {
-   if (!force_3d) nu->flag |= CU_2D;
nu->pntsu = 4;
nu->bezt = (BezTriple 
*)MEM_callocN(sizeof(BezTriple) * 4, "addNurbprim1");
nu->flagu = CU_NURB_CYCLIC;
@@ -459,6 +456,10 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object 
*obedit, float mat[4][4],
BLI_assert(nu != NULL);
 
if (nu) { /* should always be set */
+   if ((obedit->type != OB_SURF) && ((cu->flag & CU_3D) == 0)) {
+   nu->flag |= CU_2D;
+   }
+
nu->flag |= CU_SMOOTH;
cu->actnu = BLI_listbase_count(editnurb);
cu->actvert = CU_ACT_NONE;

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


[Bf-blender-cvs] [45e68e1] blender-v2.77-release: Fix T47971: rigid body baking crash due to thread race condition.

2016-04-05 Thread Brecht Van Lommel
Commit: 45e68e190dca949d4d2018d587b8f3cbb1000700
Author: Brecht Van Lommel
Date:   Sat Apr 2 04:24:24 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB45e68e190dca949d4d2018d587b8f3cbb1000700

Fix T47971: rigid body baking crash due to thread race condition.

===

M   source/blender/blenkernel/BKE_pointcache.h
M   source/blender/blenkernel/intern/pointcache.c
M   source/blender/editors/physics/physics_pointcache.c
M   source/blender/render/intern/source/pipeline.c

===

diff --git a/source/blender/blenkernel/BKE_pointcache.h 
b/source/blender/blenkernel/BKE_pointcache.h
index 40dbffe..8238ea6 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -190,7 +190,7 @@ typedef struct PTCacheBaker {
int render;
int anim_init;
int quick_step;
-   struct PTCacheID *pid;
+   struct PTCacheID pid;
 
void (*update_progress)(void *data, float progress, int *cancel);
void *bake_job;
diff --git a/source/blender/blenkernel/intern/pointcache.c 
b/source/blender/blenkernel/intern/pointcache.c
index c8a42d8..448 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -3508,15 +3508,13 @@ void BKE_ptcache_quick_cache_all(Main *bmain, Scene 
*scene)
 {
PTCacheBaker baker;
 
-   baker.bake=0;
-   baker.pid=NULL;
-   baker.render=0;
+   memset(, 0, sizeof(baker));
+   baker.main = bmain;
+   baker.scene = scene;
+   baker.bake = 0;
+   baker.render = 0;
baker.anim_init = 0;
-   baker.main=bmain;
-   baker.scene=scene;
-   baker.quick_step=scene->physics_settings.quick_cache_step;
-   baker.update_progress = NULL;
-   baker.bake_job = NULL;
+   baker.quick_step = scene->physics_settings.quick_cache_step;
 
BKE_ptcache_bake();
 }
@@ -3541,7 +3539,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
Scene *sce_iter; /* SETLOOPER macro only */
Base *base;
ListBase pidlist;
-   PTCacheID *pid = baker->pid;
+   PTCacheID *pid = >pid;
PointCache *cache = NULL;
float frameleno = scene->r.framelen;
int cfrao = CFRA;
@@ -3552,7 +3550,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
G.is_break = false;
 
/* set caches to baking mode and figure out start frame */
-   if (pid) {
+   if (pid->ob) {
/* cache/bake a single object */
cache = pid->cache;
if ((cache->flag & PTCACHE_BAKED)==0) {
diff --git a/source/blender/editors/physics/physics_pointcache.c 
b/source/blender/editors/physics/physics_pointcache.c
index 406b589..e81aa58 100644
--- a/source/blender/editors/physics/physics_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -30,6 +30,7 @@
  */
 
 #include 
+#include 
 
 #include "MEM_guardedalloc.h"
 
@@ -57,12 +58,7 @@
 
 static int ptcache_bake_all_poll(bContext *C)
 {
-   Scene *scene= CTX_data_scene(C);
-
-   if (!scene)
-   return 0;
-   
-   return 1;
+   return CTX_data_scene(C) != NULL;
 }
 
 static int ptcache_poll(bContext *C)
@@ -77,14 +73,11 @@ typedef struct PointCacheJob {
float *progress;
 
PTCacheBaker *baker;
-   Object *ob;
-   ListBase pidlist;
 } PointCacheJob;
 
 static void ptcache_job_free(void *customdata)
 {
PointCacheJob *job = customdata;
-   BLI_freelistN(>pidlist);
MEM_freeN(job->baker);
MEM_freeN(job);
 }
@@ -149,7 +142,7 @@ static void ptcache_job_endjob(void *customdata)
WM_set_locked_interface(G.main->wm.first, false);
 
WM_main_add_notifier(NC_SCENE | ND_FRAME, scene);
-   WM_main_add_notifier(NC_OBJECT | ND_POINTCACHE, job->ob);
+   WM_main_add_notifier(NC_OBJECT | ND_POINTCACHE, job->baker->pid.ob);
 }
 
 static void ptcache_free_bake(PointCache *cache)
@@ -166,32 +159,60 @@ static void ptcache_free_bake(PointCache *cache)
}
 }
 
-static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
+static PTCacheBaker *ptcache_baker_create(bContext *C, wmOperator *op, bool 
all)
 {
-   Main *bmain = CTX_data_main(C);
-   Scene *scene = CTX_data_scene(C);
+   PTCacheBaker *baker = MEM_callocN(sizeof(PTCacheBaker), "PTCacheBaker");
 
-   PTCacheBaker *baker = MEM_mallocN(sizeof(PTCacheBaker), "PTCacheBaker");
-
-   baker->main = bmain;
-   baker->scene = scene;
-   baker->pid = NULL;
+   baker->main = CTX_data_main(C);
+   baker->scene = CTX_data_scene(C);
baker->bake = RNA_boolean_get(op->ptr, "bake");
baker->render = 0;
baker->anim_init = 0;
baker->quick_step = 1;
-   baker->update_progress = ptcache_job_update;
 
-   PointCacheJob *job = 

[Bf-blender-cvs] [0f3d558] blender-v2.77-release: Cycles: Fix wrong camera-in-volume stack when camera ray hits volume domain twice

2016-04-05 Thread Sergey Sharybin
Commit: 0f3d5589825819e98e2bf7350ca776673a3e598e
Author: Sergey Sharybin
Date:   Fri Apr 1 18:03:58 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB0f3d5589825819e98e2bf7350ca776673a3e598e

Cycles: Fix wrong camera-in-volume stack when camera ray hits volume domain 
twice

===

M   intern/cycles/kernel/kernel_volume.h

===

diff --git a/intern/cycles/kernel/kernel_volume.h 
b/intern/cycles/kernel/kernel_volume.h
index ccb7436..984eb7e 100644
--- a/intern/cycles/kernel/kernel_volume.h
+++ b/intern/cycles/kernel/kernel_volume.h
@@ -1010,17 +1010,22 @@ ccl_device void kernel_volume_stack_init(KernelGlobals 
*kg,
ShaderData sd;
shader_setup_from_ray(kg, , isect, _ray);
if(sd.flag & SD_BACKFACING) {
-   /* If ray exited the volume and never entered 
to that volume
-* it means that camera is inside such a volume.
-*/
-   bool is_enclosed = false;
-   for(int i = 0; i < enclosed_index; ++i) {
-   if(enclosed_volumes[i] == sd.object) {
-   is_enclosed = true;
+   bool need_add = true;
+   for(int i = 0; stack[i].shader != SHADER_NONE; 
++i) {
+   /* If ray exited the volume and never 
entered to that volume
+* it means that camera is inside such 
a volume.
+*/
+   if(i < enclosed_index && 
enclosed_volumes[i] == sd.object) {
+   need_add = false;
+   break;
+   }
+   /* Don't add intersections twice. */
+   if(stack[i].object == sd.object) {
+   need_add = false;
break;
}
}
-   if(is_enclosed == false) {
+   if(need_add) {
stack[stack_index].object = sd.object;
stack[stack_index].shader = sd.shader;
++stack_index;

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


[Bf-blender-cvs] [f4eb7e1] blender-v2.77-release: Knife Project: revert fix for T43896

2016-04-05 Thread Campbell Barton
Commit: f4eb7e149a0bc42b198b67e18c38d619b8e3277b
Author: Campbell Barton
Date:   Sat Apr 2 01:30:57 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBf4eb7e149a0bc42b198b67e18c38d619b8e3277b

Knife Project: revert fix for T43896

For now leave precision at half a pixel until we have real fix.
Resolves T48023.

===

M   source/blender/editors/mesh/editmesh_knife.c

===

diff --git a/source/blender/editors/mesh/editmesh_knife.c 
b/source/blender/editors/mesh/editmesh_knife.c
index 9480755..0fd56fb 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1625,8 +1625,11 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
face_tol = KNIFE_FLT_EPS_PX_FACE;
}
else {
-   /* use 1/100th of a pixel, see T43896 (too big), T47910 (too 
small). */
-   vert_tol = line_tol = face_tol = 0.01f;
+   /* Use 1/100th of a pixel, see T43896 (too big), T47910 (too 
small).
+*
+* Update, leave this as is until we investigate not using 
pixel coords for geometry calculations: T48023
+*/
+   vert_tol = line_tol = face_tol = 0.5f;
}
 
vert_tol_sq = vert_tol * vert_tol;

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


[Bf-blender-cvs] [713669f] blender-v2.77-release: Cycles: Support deformation motion blur for curves deformed by taper

2016-04-05 Thread Sergey Sharybin
Commit: 713669f7e67e1e5fc01caaa9c9a2da932d71759a
Author: Sergey Sharybin
Date:   Fri Apr 1 15:53:40 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB713669f7e67e1e5fc01caaa9c9a2da932d71759a

Cycles: Support deformation motion blur for curves deformed by taper

===

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

===

diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index f81f13e..d78b49b 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -3653,6 +3653,14 @@ static bool object_moves_in_time(Object *object)
return false;
 }
 
+static bool object_deforms_in_time(Object *object)
+{
+   if (BKE_key_from_object(object) != NULL) {
+   return true;
+   }
+   return object_moves_in_time(object);
+}
+
 static bool constructive_modifier_is_deform_modified(ModifierData *md)
 {
/* TODO(sergey): Consider generalizing this a bit so all modifier logic
@@ -3712,8 +3720,16 @@ int BKE_object_is_deform_modified(Scene *scene, Object 
*ob)
int flag = 0;
const bool is_modifier_animated = modifiers_has_animation_check(ob);
 
-   if (BKE_key_from_object(ob))
+   if (BKE_key_from_object(ob)) {
flag |= eModifierMode_Realtime | eModifierMode_Render;
+   }
+
+   if (ob->type == OB_CURVE) {
+   Curve *cu = (Curve *)ob->data;
+   if (cu->taperobj != NULL && 
object_deforms_in_time(cu->taperobj)) {
+   flag |= eModifierMode_Realtime | eModifierMode_Render;
+   }
+   }
 
/* cloth */
for (md = modifiers_getVirtualModifierList(ob, );

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


[Bf-blender-cvs] [e69c02a] blender-v2.77-release: cmake fix full debug builds on msvc

2016-04-05 Thread Martijn Berger
Commit: e69c02a392baf3b17759dceedf2a89eec6da3b26
Author: Martijn Berger
Date:   Thu Mar 31 08:12:41 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBe69c02a392baf3b17759dceedf2a89eec6da3b26

cmake fix full debug builds on msvc

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1572e2b..9028f94 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1427,18 +1427,11 @@ elseif(WIN32)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} 
${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
set(OPENEXR_LIBRARIES
-   optimized
-   ${OPENEXR_LIBPATH}/Iex-2_2.lib
-   ${OPENEXR_LIBPATH}/Half.lib
-   ${OPENEXR_LIBPATH}/IlmImf-2_2.lib
-   ${OPENEXR_LIBPATH}/Imath-2_2.lib
-   ${OPENEXR_LIBPATH}/IlmThread-2_2.lib
-   debug
-   ${OPENEXR_LIBPATH}/Iex-2_2_d.lib
-   ${OPENEXR_LIBPATH}/Half_d.lib
-   ${OPENEXR_LIBPATH}/IlmImf-2_2_d.lib
-   ${OPENEXR_LIBPATH}/Imath-2_2_d.lib
-   ${OPENEXR_LIBPATH}/IlmThread-2_2_d.lib
+   optimized 
${OPENEXR_LIBPATH}/Iex-2_2.lib debug ${OPENEXR_LIBPATH}/Iex-2_2_d.lib
+   optimized ${OPENEXR_LIBPATH}/Half.lib 
debug ${OPENEXR_LIBPATH}/Half_d.lib
+   optimized 
${OPENEXR_LIBPATH}/IlmImf-2_2.lib debug ${OPENEXR_LIBPATH}/IlmImf-2_2_d.lib
+   optimized 
${OPENEXR_LIBPATH}/Imath-2_2.lib debug ${OPENEXR_LIBPATH}/Imath-2_2_d.lib
+   optimized 
${OPENEXR_LIBPATH}/IlmThread-2_2.lib debug 
${OPENEXR_LIBPATH}/IlmThread-2_2_d.lib
)
endif()
endif()
@@ -1577,12 +1570,12 @@ elseif(WIN32)
endif()
 
if(WITH_OPENVDB)
-   set(BLOSC_LIBRARIES ${LIBDIR}/blosc/lib/libblosc.lib)
-   set(TBB_LIBRARIES ${LIBDIR}/tbb/lib/tbb.lib)
+   set(BLOSC_LIBRARIES optimized 
${LIBDIR}/blosc/lib/libblosc.lib debug ${LIBDIR}/blosc/lib/libblosc_d.lib)
+   set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib 
debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
set(OPENVDB ${LIBDIR}/openvdb)
set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include 
${TBB_INCLUDE_DIR})
-   set(OPENVDB_LIBRARIES openvdb ${TBB_LIBRARIES} 
${BLOSC_LIBRARIES})
+   set(OPENVDB_LIBRARIES optimized openvdb debug openvdb_d 
${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
endif()

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


[Bf-blender-cvs] [357787b] blender-v2.77-release: Fix T46623: OSX bpy.app.binary_path_python incorrect

2016-04-05 Thread Campbell Barton
Commit: 357787b06bf376d54db216d15a59a5bc6387139e
Author: Campbell Barton
Date:   Wed Mar 30 22:44:44 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB357787b06bf376d54db216d15a59a5bc6387139e

Fix T46623: OSX bpy.app.binary_path_python incorrect

CMake's PYTHON_EXECUTABLE wasn't set.

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2eabd4b..7232e5e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1988,14 +1988,14 @@ elseif(APPLE)
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
# normally cached but not since we include them with 
blender
set(PYTHON_INCLUDE_DIR 
"${LIBDIR}/python/include/python${PYTHON_VERSION}m")
-   # set(PYTHON_EXECUTABLE 
"${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
+   set(PYTHON_EXECUTABLE 
"${LIBDIR}/python/bin/python${PYTHON_VERSION}m")
set(PYTHON_LIBRARY python${PYTHON_VERSION}m)
set(PYTHON_LIBPATH 
"${LIBDIR}/python/lib/python${PYTHON_VERSION}")
# set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  
build with this enabled
else()
# module must be compiled against Python framework
set(PYTHON_INCLUDE_DIR 
"/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
-   set(PYTHON_EXECUTABLE 
"/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
+   set(PYTHON_EXECUTABLE 
"/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}m")
#set(PYTHON_LIBRARY python${PYTHON_VERSION})
set(PYTHON_LIBPATH 
"/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}m")
#set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework 
Python")  # won't  build with this enabled
@@ -2004,6 +2004,10 @@ elseif(APPLE)
# uncached vars
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
+
+   if(NOT EXISTS "${PYTHON_EXECUTABLE}")
+   message(FATAL_ERROR "Python executable missing: 
${PYTHON_EXECUTABLE}")
+   endif()
endif()
 
if(WITH_FFTW3)

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


[Bf-blender-cvs] [a5bc674] blender-v2.77-release: Include requests' cacert.pem file

2016-04-05 Thread Sybren A. Stüvel
Commit: a5bc674e8856ed0a21650b489051fcc9ad2b5e85
Author: Sybren A. Stüvel
Date:   Thu Mar 10 16:58:09 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rBa5bc674e8856ed0a21650b489051fcc9ad2b5e85

Include requests' cacert.pem file

This allows us to verify certificates of HTTPS connections, which is
mandatory for logins like on Blender ID.

Reviewers: campbellbarton

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

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 74b26d1..e825f53 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -584,7 +584,6 @@ if(UNIX AND NOT APPLE)
PATTERN "__pycache__" EXCLUDE   
# * any cache *
PATTERN "*.pyc" EXCLUDE 
# * any cache *
PATTERN "*.pyo" EXCLUDE 
# * any cache *
-   PATTERN "cacert.pem" EXCLUDE
# for now we don't deal with security
)
# On some platforms requests does have extra 
dependencies.
set(_requests_deps "chardet" "urllib3")

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


[Bf-blender-cvs] [d21ed9a] blender-v2.77-release: Fix T47893: BGE crashes w/ generated mesh data

2016-04-05 Thread Campbell Barton
Commit: d21ed9af211c0e0f691761174b11653cb8c5e0ec
Author: Campbell Barton
Date:   Wed Mar 23 23:37:08 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBd21ed9af211c0e0f691761174b11653cb8c5e0ec

Fix T47893: BGE crashes w/ generated mesh data

===

M   source/gameengine/Physics/Bullet/CcdPhysicsController.cpp

===

diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
index 89806d8..c79e1c2 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
@@ -1895,10 +1895,10 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject 
*meshobj, DerivedMesh *dm,
for (int p2 = 0; p2 < numpolys; p2++) {
MFace *mf = [p2];
const int origi = index_mf_to_mpoly ? 
DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, p2) : p2;
-   RAS_Polygon *poly = meshobj->GetPolygon(origi);
+   RAS_Polygon *poly = (origi != ORIGINDEX_NONE) ? 
meshobj->GetPolygon(origi) : NULL;
 
// only add polygons that have the collision flag set
-   if (poly->IsCollider()) {
+   if (poly && poly->IsCollider()) {
if (!vert_tag_array[mf->v1]) {
vert_tag_array[mf->v1] = true;
tot_bt_verts++;
@@ -1930,7 +1930,7 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject 
*meshobj, DerivedMesh *dm,
for (int p2 = 0; p2 < numpolys; p2++) {
MFace *mf = [p2];
const int origi = index_mf_to_mpoly ? 
DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, p2) : p2;
-   RAS_Polygon *poly = meshobj->GetPolygon(origi);
+   RAS_Polygon *poly = (origi != ORIGINDEX_NONE) ? 
meshobj->GetPolygon(origi) : NULL;
 
// only add polygons that have the collisionflag set
if (poly->IsCollider()) {
@@ -1973,10 +1973,10 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject 
*meshobj, DerivedMesh *dm,
for (int p2 = 0; p2 < numpolys; p2++) {
MFace *mf = [p2];
const int origi = index_mf_to_mpoly ? 
DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, p2) : p2;
-   RAS_Polygon *poly = meshobj->GetPolygon(origi);
+   RAS_Polygon *poly = (origi != ORIGINDEX_NONE) ? 
meshobj->GetPolygon(origi) : NULL;
 
// only add polygons that have the collision flag set
-   if (poly->IsCollider()) {
+   if (poly && poly->IsCollider()) {
if (!vert_tag_array[mf->v1]) {
vert_tag_array[mf->v1] = true;
vert_remap_array[mf->v1] = tot_bt_verts;
@@ -2025,10 +2025,10 @@ bool CcdShapeConstructionInfo::SetMesh(RAS_MeshObject 
*meshobj, DerivedMesh *dm,
MFace *mf = [p2];
MTFace *tf = (tface) ? [p2] : NULL;
const int origi = index_mf_to_mpoly ? 
DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, p2) : p2;
-   RAS_Polygon *poly = meshobj->GetPolygon(origi);
+   RAS_Polygon *poly = (origi != ORIGINDEX_NONE) ? 
meshobj->GetPolygon(origi) : NULL;
 
// only add polygons that have the collisionflag set
-   if (poly->IsCollider()) {
+   if (poly && poly->IsCollider()) {
MVert *v1 = [mf->v1];
MVert *v2 = [mf->v2];
MVert *v3 = [mf->v3];

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


[Bf-blender-cvs] [81e8bd1] blender-v2.77-release: Hide layers from UI in template

2016-04-05 Thread Campbell Barton
Commit: 81e8bd107f4d5416ec4749731623da532fd47c84
Author: Campbell Barton
Date:   Fri Apr 1 10:23:39 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB81e8bd107f4d5416ec4749731623da532fd47c84

Hide layers from UI in template

===

M   release/scripts/templates_py/operator_mesh_add.py

===

diff --git a/release/scripts/templates_py/operator_mesh_add.py 
b/release/scripts/templates_py/operator_mesh_add.py
index efe936c..2590d53 100644
--- a/release/scripts/templates_py/operator_mesh_add.py
+++ b/release/scripts/templates_py/operator_mesh_add.py
@@ -69,6 +69,7 @@ class AddBox(bpy.types.Operator):
 name="Layers",
 description="Object Layers",
 size=20,
+options={'HIDDEN', 'SKIP_SAVE'},
 )
 
 # generic transform props

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


[Bf-blender-cvs] [a66116f] blender-v2.77-release: Fix T48012: Knife Project crash

2016-04-05 Thread Campbell Barton
Commit: a66116f5439fa5ebf33a27867e846006ac20f78d
Author: Campbell Barton
Date:   Fri Apr 1 06:22:30 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBa66116f5439fa5ebf33a27867e846006ac20f78d

Fix T48012: Knife Project crash

===

M   source/blender/bmesh/intern/bmesh_polygon_edgenet.c

===

diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c 
b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
index 1ee96d4..e9d43eb 100644
--- a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
+++ b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
@@ -1485,12 +1485,26 @@ finally:
 #ifdef USE_PARTIAL_CONNECT
/* don't free 'vert_temp_pair_list', its part of the arena */
if (use_partial_connect) {
+
+   /* Sanity check: ensure we don't have connecting edges before 
splicing begins. */
+#ifdef DEBUG
+   {
+   struct TempVertPair *tvp = temp_vert_pairs.list;
+   do {
+   /* we must _never_ create connections here
+* (inface the islands can't have a connection 
at all) */
+   BLI_assert(BM_edge_exists(tvp->v_orig, 
tvp->v_temp) == NULL);
+   } while ((tvp = tvp->next));
+   }
+#endif
+
struct TempVertPair *tvp = temp_vert_pairs.list;
do {
-   /* we must _never_ create connections here
-* (inface the islands can't have a connection at all) 
*/
-   BLI_assert(BM_edge_exists(tvp->v_orig, tvp->v_temp) == 
NULL);
-   BM_vert_splice(bm, tvp->v_orig, tvp->v_temp);
+   /* its _very_ unlikely the edge exists,
+* however splicing may case this. see: T48012 */
+   if (!BM_edge_exists(tvp->v_orig, tvp->v_temp)) {
+   BM_vert_splice(bm, tvp->v_orig, tvp->v_temp);
+   }
} while ((tvp = tvp->next));
 
/* Remove edges which have become doubles since splicing 
vertices together,

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


[Bf-blender-cvs] [f601a4b] blender-v2.77-release: Fix T47830: Multi-edit w/ ui-list wont highlight

2016-04-05 Thread Campbell Barton
Commit: f601a4b4f7b03db090d4009b0484a6675ac5b81b
Author: Campbell Barton
Date:   Wed Mar 23 03:37:23 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBf601a4b4f7b03db090d4009b0484a6675ac5b81b

Fix T47830: Multi-edit w/ ui-list wont highlight

Regression from 4d6b892.

===

M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/interface_widgets.c

===

diff --git a/source/blender/editors/interface/interface_intern.h 
b/source/blender/editors/interface/interface_intern.h
index 66510fb..d828c4e 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -92,6 +92,7 @@ typedef enum {
 
/* specials */
UI_WTYPE_ICON,
+   UI_WTYPE_ICON_LABEL,
UI_WTYPE_SWATCH,
UI_WTYPE_RGB_PICKER,
UI_WTYPE_UNITVEC,
diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index 5898f3b..21ff857 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -3499,6 +3499,10 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)

/* specials */
case UI_WTYPE_ICON:
+   wt.custom = widget_icon_has_anim;
+   break;
+
+   case UI_WTYPE_ICON_LABEL:
/* behave like regular labels (this is simply a label 
with an icon) */
wt.state = widget_state_label;
wt.custom = widget_icon_has_anim;
@@ -3628,7 +3632,14 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle 
*style, uiBut *but, rct
}
else if (but->dt == UI_EMBOSS_NONE) {
/* "nothing" */
-   wt = widget_type(UI_WTYPE_ICON);
+   switch (but->type) {
+   case UI_BTYPE_LABEL:
+   wt = widget_type(UI_WTYPE_ICON_LABEL);
+   break;
+   default:
+   wt = widget_type(UI_WTYPE_ICON);
+   break;
+   }
}
else if (but->dt == UI_EMBOSS_RADIAL) {
wt = widget_type(UI_WTYPE_MENU_ITEM_RADIAL);

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


[Bf-blender-cvs] [611e544] blender-v2.77-release: Fix T47972: Blender crash showing particle system.

2016-04-05 Thread Bastien Montagne
Commit: 611e544191fa7fa89ed299c5aa3ab9ea5a82bdfe
Author: Bastien Montagne
Date:   Mon Mar 28 15:37:08 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB611e544191fa7fa89ed299c5aa3ab9ea5a82bdfe

Fix T47972: Blender crash showing particle system.

Do same as with faces - if no orcodata is available, fill orco with current 
location...

===

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

===

diff --git a/source/blender/blenkernel/intern/particle.c 
b/source/blender/blenkernel/intern/particle.c
index 364bdbb..221bb6d 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -1609,8 +1609,14 @@ void psys_particle_on_dm(DerivedMesh *dm_final, int 
from, int index, int index_d
normalize_v3(nor);
}
 
-   if (orco)
-   copy_v3_v3(orco, orcodata[mapindex]);
+   if (orco) {
+   if (orcodata) {
+   copy_v3_v3(orco, orcodata[mapindex]);
+   }
+   else {
+   copy_v3_v3(orco, vec);
+   }
+   }
 
if (ornor) {
dm_final->getVertNo(dm_final, mapindex, ornor);

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


[Bf-blender-cvs] [96b9f45] blender-v2.77-release: Partly fix (unreported) particles not updating correctly when changing settings.

2016-04-05 Thread Bastien Montagne
Commit: 96b9f45d7a104cce093da174a4b9d076250f326d
Author: Bastien Montagne
Date:   Wed Mar 30 17:10:54 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB96b9f45d7a104cce093da174a4b9d076250f326d

Partly fix (unreported) particles not updating correctly when changing settings.

Point-cached particles (those using simulations) would not update at all 
outside of
first frame, due to PSYS_RECALC_RESET flag being ingnored in `system_step()`...

For some mysterious reasons, udate is still non-fully functional outside of 
startframe
(e.g. changing face distribution between random and jittered), but at least 
when choosing
'Vertices' you get particles from verts and not faces!

===

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

===

diff --git a/source/blender/blenkernel/intern/particle_system.c 
b/source/blender/blenkernel/intern/particle_system.c
index e9ce532..87f39f2 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3878,8 +3878,8 @@ static void system_step(ParticleSimulationData *sim, 
float cfra)

BKE_ptcache_id_time(pid, sim->scene, 0.0f, , 
, NULL);
 
-   /* clear everythin on start frame */
-   if (cfra == startframe) {
+   /* clear everything on start frame, or when psys needs full 
reset! */
+   if ((cfra == startframe) || (psys->recalc & PSYS_RECALC_RESET)) 
{
BKE_ptcache_id_reset(sim->scene, pid, 
PTCACHE_RESET_OUTDATED);
BKE_ptcache_validate(cache, startframe);
cache->flag &= ~PTCACHE_REDO_NEEDED;

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


[Bf-blender-cvs] [edb1cc6] blender-v2.77-release: Fix T47697: Smoke simulation doesn't work in viewport

2016-04-05 Thread Sergey Sharybin
Commit: edb1cc6fa8915403a73bae7519fc16aa21f1666c
Author: Sergey Sharybin
Date:   Sun Mar 27 13:19:09 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBedb1cc6fa8915403a73bae7519fc16aa21f1666c

Fix T47697: Smoke simulation doesn't work in viewport

Seems to be a division by zero error.

Should be safe for an upcoming 'a' release.

===

M   source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl

===

diff --git a/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl 
b/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl
index 7bee7ef..4d1feb5 100644
--- a/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_smoke_frag.glsl
@@ -17,7 +17,13 @@ void main()
 {
/* compute color and density from volume texture */
vec4 soot = texture3D(soot_texture, coords);
-   vec3 soot_color = active_color * soot.rgb / soot.a;
+   vec3 soot_color;
+   if (soot.a != 0) {
+   soot_color = active_color * soot.rgb / soot.a;
+   }
+   else {
+   soot_color = vec3(0, 0, 0);
+   }
float soot_density = density_scale * soot.a;
 
/* compute transmittance and alpha */

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


[Bf-blender-cvs] [7a7b242] blender-v2.77-release: Fix T47862: VSE hard cut fails

2016-04-05 Thread Campbell Barton
Commit: 7a7b242007ce64de3b4751ac05ab49e4220f3984
Author: Campbell Barton
Date:   Mon Mar 21 19:22:39 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB7a7b242007ce64de3b4751ac05ab49e4220f3984

Fix T47862: VSE hard cut fails

Regression caused by changing how video length is calculated,
however similar problems could be caused by strip length changing on-disk.

===

M   source/blender/editors/space_sequencer/sequencer_edit.c

===

diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c 
b/source/blender/editors/space_sequencer/sequencer_edit.c
index c0a95225f..df3e508 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -685,6 +685,14 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, 
int cutframe)
/* First Strip! */
/* strips with extended stillfames before */

+   /* Precaution, needed because the length saved on-disk may not match 
the length saved in the blend file,
+* or our code may have minor differences reading file length between 
versions.
+* This causes hard-cut to fail, see: T47862 */
+   if (seq->type != SEQ_TYPE_META) {
+   BKE_sequence_reload_new_file(scene, seq, true);
+   BKE_sequence_calc(scene, seq);
+   }
+
if ((seq->startstill) && (cutframe < seq->start)) {
/* don't do funny things with METAs ... */
if (seq->type == SEQ_TYPE_META) {

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


[Bf-blender-cvs] [261c12a] blender-v2.77-release: Fix T47958: Crash in Walk or Fly Navigation in Camera mode when invoking from non-3DView region

2016-04-05 Thread Bastien Montagne
Commit: 261c12aab489d12db79d5c0f2e6e6a1cf19b8039
Author: Bastien Montagne
Date:   Mon Mar 28 18:17:45 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB261c12aab489d12db79d5c0f2e6e6a1cf19b8039

Fix T47958: Crash in Walk or Fly Navigation in Camera mode when invoking from 
non-3DView region

===

M   source/blender/editors/space_view3d/view3d_fly.c
M   source/blender/editors/space_view3d/view3d_walk.c

===

diff --git a/source/blender/editors/space_view3d/view3d_fly.c 
b/source/blender/editors/space_view3d/view3d_fly.c
index f3ee99f..8418cf0 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -1065,7 +1065,7 @@ void VIEW3D_OT_fly(wmOperatorType *ot)
ot->invoke = fly_invoke;
ot->cancel = fly_cancel;
ot->modal = fly_modal;
-   ot->poll = ED_operator_view3d_active;
+   ot->poll = ED_operator_region_view3d_active;
 
/* flags */
ot->flag = OPTYPE_BLOCKING;
diff --git a/source/blender/editors/space_view3d/view3d_walk.c 
b/source/blender/editors/space_view3d/view3d_walk.c
index 022b305..7e1202a 100644
--- a/source/blender/editors/space_view3d/view3d_walk.c
+++ b/source/blender/editors/space_view3d/view3d_walk.c
@@ -1421,7 +1421,7 @@ void VIEW3D_OT_walk(wmOperatorType *ot)
ot->invoke = walk_invoke;
ot->cancel = walk_cancel;
ot->modal = walk_modal;
-   ot->poll = ED_operator_view3d_active;
+   ot->poll = ED_operator_region_view3d_active;
 
/* flags */
ot->flag = OPTYPE_BLOCKING;

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


[Bf-blender-cvs] [5bfa814] blender-v2.77-release: Fix T47900: VSE adjustment crashes on blank frame

2016-04-05 Thread Campbell Barton
Commit: 5bfa814dcba5b8f88086d8c1b6dbac7a459501fa
Author: Campbell Barton
Date:   Thu Mar 24 05:17:38 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB5bfa814dcba5b8f88086d8c1b6dbac7a459501fa

Fix T47900: VSE adjustment crashes on blank frame

===

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

===

diff --git a/source/blender/blenkernel/intern/sequencer.c 
b/source/blender/blenkernel/intern/sequencer.c
index 970825e..f479a03 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -3694,8 +3694,9 @@ static ImBuf *seq_render_strip_stack(const SeqRenderData 
*context, ListBase *seq
ImBuf *ibuf2 = out;
 
out = 
seq_render_strip_stack_apply_effect(context, seq, cfra, ibuf1, ibuf2);
-
-   IMB_metadata_copy(out, ibuf2);
+   if (out) {
+   IMB_metadata_copy(out, ibuf2);
+   }
 
IMB_freeImBuf(ibuf1);
IMB_freeImBuf(ibuf2);

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


[Bf-blender-cvs] [3108861] blender-v2.77-release: Cycles: Fix wrong initialization order of mesh flags and object transform

2016-04-05 Thread Sergey Sharybin
Commit: 3108861981dbeedc679b2b9015f18d46f6d718e3
Author: Sergey Sharybin
Date:   Thu Mar 31 17:54:03 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB3108861981dbeedc679b2b9015f18d46f6d718e3

Cycles: Fix wrong initialization order of mesh flags and object transform

===

M   intern/cycles/render/scene.cpp

===

diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp
index 62951af..9842cd1 100644
--- a/intern/cycles/render/scene.cpp
+++ b/intern/cycles/render/scene.cpp
@@ -167,13 +167,13 @@ void Scene::device_update(Device *device_, Progress& 
progress)
 
if(progress.get_cancel() || device->have_error()) return;
 
-   progress.set_status("Updating Objects");
-   object_manager->device_update(device, , this, progress);
+   progress.set_status("Updating Meshes Flags");
+   mesh_manager->device_update_flags(device, , this, progress);
 
if(progress.get_cancel() || device->have_error()) return;
 
-   progress.set_status("Updating Meshes Flags");
-   mesh_manager->device_update_flags(device, , this, progress);
+   progress.set_status("Updating Objects");
+   object_manager->device_update(device, , this, progress);
 
if(progress.get_cancel() || device->have_error()) return;

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


[Bf-blender-cvs] [8aed449] blender-v2.77-release: Fix T47973: Render stamp ignores font alpha

2016-04-05 Thread Campbell Barton
Commit: 8aed4495280b5caf6faca2609c0eb044f572646c
Author: Campbell Barton
Date:   Tue Mar 29 00:25:07 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB8aed4495280b5caf6faca2609c0eb044f572646c

Fix T47973: Render stamp ignores font alpha

===

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

===

diff --git a/source/blender/blenkernel/intern/image.c 
b/source/blender/blenkernel/intern/image.c
index 05ec54e..02567fa 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1992,7 +1992,7 @@ void BKE_image_stamp_buf(
BLF_wordwrap(mono, width - (BUFF_MARGIN_X * 2));
 
BLF_buffer(mono, rectf, rect, width, height, channels, display);
-   BLF_buffer_col(mono, scene->r.fg_stamp[0], scene->r.fg_stamp[1], 
scene->r.fg_stamp[2], 1.0);
+   BLF_buffer_col(mono, UNPACK4(scene->r.fg_stamp));
pad = BLF_width_max(mono);
 
/* use 'h_fixed' rather than 'h', aligns better */

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


[Bf-blender-cvs] [2ad02b6] blender-v2.77-release: Fix T47967: Select next active fails in some cases

2016-04-05 Thread Campbell Barton
Commit: 2ad02b63e58a9ee85e6d2da4b7e49df353a172a5
Author: Campbell Barton
Date:   Wed Mar 30 04:56:18 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB2ad02b63e58a9ee85e6d2da4b7e49df353a172a5

Fix T47967: Select next active fails in some cases

For cases when there are multiple matches,
find the closest match (with increasingly fuzzy tests) instead of failing.

===

M   release/scripts/startup/bl_operators/bmesh/find_adjacent.py

===

diff --git a/release/scripts/startup/bl_operators/bmesh/find_adjacent.py 
b/release/scripts/startup/bl_operators/bmesh/find_adjacent.py
index 46edcd2..77e590f 100644
--- a/release/scripts/startup/bl_operators/bmesh/find_adjacent.py
+++ b/release/scripts/startup/bl_operators/bmesh/find_adjacent.py
@@ -23,6 +23,11 @@
 
 import bmesh
 
+__all__ = (
+"select_prev",
+"select_next",
+)
+
 
 def other_edges_over_face(e):
 # Can yield same edge multiple times, its fine.
@@ -261,6 +266,52 @@ def select_next(bm, report):
 return False
 
 ele_pair_next = find_next(*ele_pair)
+
+if len(ele_pair_next) > 1:
+# We have multiple options,
+# check topology around the element and find the closest match
+# (allow for sloppy comparison if exact checks fail).
+
+def ele_uuid(ele):
+ele_type = type(ele)
+if ele_type is bmesh.types.BMFace:
+ret = [len(f.verts) for l in ele.loops for f in 
l.edge.link_faces if f is not ele]
+elif ele_type is bmesh.types.BMEdge:
+ret = [len(l.face.verts) for l in ele.link_loops]
+elif ele_type is bmesh.types.BMVert:
+ret = [len(l.face.verts) for l in ele.link_loops]
+else:
+raise TypeError("wrong type")
+return tuple(sorted(ret))
+
+def ele_uuid_filter():
+
+def pass_fn(seq):
+return seq
+
+def sum_set(seq):
+return sum(set(seq))
+
+uuid_cmp = ele_uuid(ele_pair[0])
+ele_pair_next_uuid = [(ele, ele_uuid(ele)) for ele in 
ele_pair_next]
+
+# Attempt to find the closest match,
+# start specific, use increasingly more approximate comparisons.
+for fn in (pass_fn, set, sum_set, len):
+uuid_cmp_test = fn(uuid_cmp)
+ele_pair_next_uuid_test = [
+(ele, uuid) for (ele, uuid) in ele_pair_next_uuid
+if uuid_cmp_test == fn(uuid)]
+if len(ele_pair_next_uuid_test) > 1:
+ele_pair_next_uuid = ele_pair_next_uuid_test
+elif len(ele_pair_next_uuid_test) == 1:
+return [ele for (ele, uuid) in ele_pair_next_uuid_test]
+return []
+
+ele_pair_next[:] = ele_uuid_filter()
+
+del ele_uuid, ele_uuid_filter
+
 if len(ele_pair_next) != 1:
 report({'INFO'}, "No single next item found")
 return False

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


[Bf-blender-cvs] [d17f3c6] blender-v2.77-release: Fix T47987: Blender Cycles standalone does not properly read UV coordinates from XML

2016-04-05 Thread Sergey Sharybin
Commit: d17f3c6d5632f3381998dc360a69c3ff50e58fcd
Author: Sergey Sharybin
Date:   Tue Mar 29 10:02:17 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBd17f3c6d5632f3381998dc360a69c3ff50e58fcd

Fix T47987: Blender Cycles standalone does not properly read UV coordinates 
from XML

===

M   intern/cycles/app/cycles_xml.cpp

===

diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index dd1dae1..fbe585f 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -1004,6 +1004,8 @@ static void xml_read_mesh(const XMLReadState& state, 
pugi::xml_node node)
fdata[2] = make_float3(UV[v2*2], 
UV[v2*2+1], 0.0);
fdata += 3;
}
+
+   index_offset += nverts[i];
}
}
}

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


[Bf-blender-cvs] [49573b8] blender-v2.77-release: Fix T47931: Missed world shader update when having object dependency

2016-04-05 Thread Sergey Sharybin
Commit: 49573b8e39bae2b70e3b391b8cd492a496f54110
Author: Sergey Sharybin
Date:   Mon Mar 28 10:45:29 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB49573b8e39bae2b70e3b391b8cd492a496f54110

Fix T47931: Missed world shader update when having object dependency

===

M   intern/cycles/blender/blender_sync.cpp

===

diff --git a/intern/cycles/blender/blender_sync.cpp 
b/intern/cycles/blender/blender_sync.cpp
index 3098522..749b8c0 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -133,10 +133,18 @@ bool BlenderSync::sync_recalc()
BL::BlendData::worlds_iterator b_world;
 
for(b_data.worlds.begin(b_world); b_world != b_data.worlds.end(); 
++b_world) {
-   if(world_map == b_world->ptr.data &&
-  (b_world->is_updated() || (b_world->node_tree() && 
b_world->node_tree().is_updated(
-   {
-   world_recalc = true;
+   if(world_map == b_world->ptr.data) {
+   if(b_world->is_updated() ||
+  (b_world->node_tree() && 
b_world->node_tree().is_updated()))
+   {
+   world_recalc = true;
+   }
+   else if(b_world->node_tree() && b_world->use_nodes()) {
+   Shader *shader = 
scene->shaders[scene->default_background];
+   if(has_updated_objects && shader != NULL && 
shader->has_object_dependency) {
+   world_recalc = true;
+   }
+   }
}
}

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


[Bf-blender-cvs] [f3259ae] blender-v2.77-release: BLF: alpha support for drawing to buffer

2016-04-05 Thread Campbell Barton
Commit: f3259ae602c3307959401fb21b49087a34a5e607
Author: Campbell Barton
Date:   Tue Mar 29 00:23:37 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBf3259ae602c3307959401fb21b49087a34a5e607

BLF: alpha support for drawing to buffer

===

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

===

diff --git a/source/blender/blenfont/intern/blf_font.c 
b/source/blender/blenfont/intern/blf_font.c
index bf3db19..08e41dc 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -306,7 +306,6 @@ static void blf_font_draw_buffer_ex(
const unsigned char *b_col_char = buf_info->col_char;
int chx, chy;
int y, x;
-   float a;
 
BLF_KERNING_VARS(font, has_kerning, kern_mode);
 
@@ -356,26 +355,27 @@ static void blf_font_draw_buffer_ex(
int yb = yb_start;
for (y = ((chy >= 0) ? 0 : -chy); y < 
height_clip; y++) {
for (x = ((chx >= 0) ? 0 : -chx); x < 
width_clip; x++) {
-   a = *(g->bitmap + x + (yb * 
g->pitch)) / 255.0f;
-
-   if (a > 0.0f) {
+   const char a_byte = *(g->bitmap 
+ x + (yb * g->pitch));
+   if (a_byte) {
+   const float a = (a_byte 
/ 255.0f) * b_col_float[3];
const size_t buf_ofs = (
((size_t)(chx + 
x) + ((size_t)(pen_y + y) * (size_t)buf_info->w)) *

(size_t)buf_info->ch);
float *fbuf = 
buf_info->fbuf + buf_ofs;
-   float alphatest;
 
if (a >= 1.0f) {
fbuf[0] = 
b_col_float[0];
fbuf[1] = 
b_col_float[1];
fbuf[2] = 
b_col_float[2];
-   fbuf[3] = 
(alphatest = (fbuf[3] + (b_col_float[3]))) < 1.0f ? alphatest : 1.0f;
+   fbuf[3] = 1.0f;
}
else {
+   float alphatest;
fbuf[0] = 
(b_col_float[0] * a) + (fbuf[0] * (1.0f - a));
fbuf[1] = 
(b_col_float[1] * a) + (fbuf[1] * (1.0f - a));
fbuf[2] = 
(b_col_float[2] * a) + (fbuf[2] * (1.0f - a));
-   fbuf[3] = 
(alphatest = (fbuf[3] + (b_col_float[3] * a))) < 1.0f ? alphatest : 1.0f;
+   fbuf[3] = 
(alphatest = (fbuf[3] + a)) < 1.0f ?
+ 
alphatest : 1.0f;
}
}
}
@@ -391,40 +391,28 @@ static void blf_font_draw_buffer_ex(
int yb = yb_start;
for (y = ((chy >= 0) ? 0 : -chy); y < 
height_clip; y++) {
for (x = ((chx >= 0) ? 0 : -chx); x < 
width_clip; x++) {
-   a = *(g->bitmap + x + (yb * 
g->pitch)) / 255.0f;
+   const char a_byte = *(g->bitmap 
+ x + (yb * g->pitch));
 
-   if (a > 0.0f) {
+   if (a_byte) {
+   const float a = (a_byte 
/ 255.0f) * b_col_float[3];
const size_t buf_ofs = (
((size_t)(chx + 
x) + ((size_t)(pen_y + y) * (size_t)buf_info->w)) *

(size_t)buf_info->ch);
unsigned char *cbuf = 
buf_info->cbuf + buf_ofs;
-   int alphatest;
 
 

[Bf-blender-cvs] [7e29ce8] blender-v2.77-release: Fix for non spot lamps calculating spot values

2016-04-05 Thread Campbell Barton
Commit: 7e29ce8e96c75edb72d117d8be8605685c3ba36f
Author: Campbell Barton
Date:   Mon Mar 21 16:01:26 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB7e29ce8e96c75edb72d117d8be8605685c3ba36f

Fix for non spot lamps calculating spot values

Logical error in D1378, also incorrectly used lamp type as a flag.

===

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

===

diff --git a/source/blender/gpu/intern/gpu_material.c 
b/source/blender/gpu/intern/gpu_material.c
index cc401dc..fcace47 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -2157,22 +2157,17 @@ static void gpu_lamp_calc_winmat(GPULamp *lamp)
wsize = lamp->la->shadow_frustum_size;
orthographic_m4(lamp->winmat, -wsize, wsize, -wsize, wsize, 
lamp->d, lamp->clipend);
}
-   else {
+   else if (lamp->type == LA_SPOT) {
angle = saacos(lamp->spotsi);
temp = 0.5f * lamp->size * cosf(angle) / sinf(angle);
pixsize = lamp->d / temp;
wsize = pixsize * 0.5f * lamp->size;
-   if (lamp->type & LA_SPOT) {
-   /* compute shadows according to X and Y scaling factors 
*/
-   perspective_m4(
-   lamp->winmat,
-   -wsize * lamp->spotvec[0], wsize * 
lamp->spotvec[0],
-   -wsize * lamp->spotvec[1], wsize * 
lamp->spotvec[1],
-   lamp->d, lamp->clipend);
-   }
-   else {
-   perspective_m4(lamp->winmat, -wsize, wsize, -wsize, 
wsize, lamp->d, lamp->clipend);
-   }
+   /* compute shadows according to X and Y scaling factors */
+   perspective_m4(
+   lamp->winmat,
+   -wsize * lamp->spotvec[0], wsize * lamp->spotvec[0],
+   -wsize * lamp->spotvec[1], wsize * lamp->spotvec[1],
+   lamp->d, lamp->clipend);
}
 }

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


[Bf-blender-cvs] [0f5ca75] blender-v2.77-release: Fix T47969: Select Random always uses same seed

2016-04-05 Thread Campbell Barton
Commit: 0f5ca755fc0056341cbbe74f87cc2dce9fb4f299
Author: Campbell Barton
Date:   Tue Mar 29 01:20:45 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB0f5ca755fc0056341cbbe74f87cc2dce9fb4f299

Fix T47969: Select Random always uses same seed

Increment the seed on each use,
otherwise calling again selects the same order, unless you manually adjust the 
seed.

===

M   source/blender/editors/curve/editcurve_select.c
M   source/blender/editors/mesh/editmesh_select.c
M   source/blender/editors/metaball/mball_edit.c
M   source/blender/editors/object/object_lattice.c
M   source/blender/editors/object/object_select.c
M   source/blender/editors/physics/particle_edit.c
M   source/blender/windowmanager/WM_api.h
M   source/blender/windowmanager/intern/wm_operator_props.c

===

diff --git a/source/blender/editors/curve/editcurve_select.c 
b/source/blender/editors/curve/editcurve_select.c
index 4855f9d..a292662 100644
--- a/source/blender/editors/curve/editcurve_select.c
+++ b/source/blender/editors/curve/editcurve_select.c
@@ -1045,7 +1045,7 @@ static int curve_select_random_exec(bContext *C, 
wmOperator *op)
ListBase *editnurb = object_editcurve_get(obedit);
const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT);
const float randfac = RNA_float_get(op->ptr, "percent") / 100.0f;
-   const int seed = RNA_int_get(op->ptr, "seed");
+   const int seed = 
WM_operator_properties_select_random_seed_increment_get(op);
 
curve_select_random(editnurb, randfac, seed, select);
BKE_curve_nurb_vert_active_validate(obedit->data);
diff --git a/source/blender/editors/mesh/editmesh_select.c 
b/source/blender/editors/mesh/editmesh_select.c
index 83a1cdb..17250fb 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -3588,7 +3588,7 @@ static int edbm_select_random_exec(bContext *C, 
wmOperator *op)
BMEditMesh *em = BKE_editmesh_from_object(obedit);
const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT);
const float randfac =  RNA_float_get(op->ptr, "percent") / 100.0f;
-   const int seed = RNA_int_get(op->ptr, "seed");
+   const int seed = 
WM_operator_properties_select_random_seed_increment_get(op);
 
BMIter iter;
 
diff --git a/source/blender/editors/metaball/mball_edit.c 
b/source/blender/editors/metaball/mball_edit.c
index f05414f..ed5bf4a 100644
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@ -373,7 +373,7 @@ static int select_random_metaelems_exec(bContext *C, 
wmOperator *op)
MetaElem *ml;
const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT);
const float randfac = RNA_float_get(op->ptr, "percent") / 100.0f;
-   const int seed = RNA_int_get(op->ptr, "seed");
+   const int seed = 
WM_operator_properties_select_random_seed_increment_get(op);

RNG *rng = BLI_rng_new_srandom(seed);
 
diff --git a/source/blender/editors/object/object_lattice.c 
b/source/blender/editors/object/object_lattice.c
index 5724e54..73ce1fa 100644
--- a/source/blender/editors/object/object_lattice.c
+++ b/source/blender/editors/object/object_lattice.c
@@ -194,7 +194,7 @@ static int lattice_select_random_exec(bContext *C, 
wmOperator *op)
Lattice *lt = ((Lattice *)obedit->data)->editlatt->latt;
 
const float randfac = RNA_float_get(op->ptr, "percent") / 100.0f;
-   const int seed = RNA_int_get(op->ptr, "seed");
+   const int seed = 
WM_operator_properties_select_random_seed_increment_get(op);
const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT);
 
RNG *rng = BLI_rng_new_srandom(seed);
diff --git a/source/blender/editors/object/object_select.c 
b/source/blender/editors/object/object_select.c
index 6b2c2bc..0cbbe46 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -1297,7 +1297,7 @@ void OBJECT_OT_select_less(wmOperatorType *ot)
 static int object_select_random_exec(bContext *C, wmOperator *op)
 {  
const float randfac = RNA_float_get(op->ptr, "percent") / 100.0f;
-   const int seed = RNA_int_get(op->ptr, "seed");
+   const int seed = 
WM_operator_properties_select_random_seed_increment_get(op);
const bool select = (RNA_enum_get(op->ptr, "action") == SEL_SELECT);
 
RNG *rng = BLI_rng_new_srandom(seed);
diff --git a/source/blender/editors/physics/particle_edit.c 
b/source/blender/editors/physics/particle_edit.c
index 277189b..29824a3 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -1635,7 +1635,7 @@ static int select_random_exec(bContext *C, wmOperator *op)
int k;
 
   

[Bf-blender-cvs] [fa429b3] blender-v2.77-release: Fix T47668: Cycles OpenCL glass not rendering correctly on AMD.

2016-04-05 Thread Brecht Van Lommel
Commit: fa429b3f0cda7b78e044071c3981f2284873731f
Author: Brecht Van Lommel
Date:   Sat Mar 26 23:44:30 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rBfa429b3f0cda7b78e044071c3981f2284873731f

Fix T47668: Cycles OpenCL glass not rendering correctly on AMD.

Work around what appears to be a compiler bug.

===

M   intern/cycles/kernel/svm/svm_closure.h

===

diff --git a/intern/cycles/kernel/svm/svm_closure.h 
b/intern/cycles/kernel/svm/svm_closure.h
index b24873d..af16b81 100644
--- a/intern/cycles/kernel/svm/svm_closure.h
+++ b/intern/cycles/kernel/svm/svm_closure.h
@@ -259,6 +259,8 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, 
ShaderData *sd, float *
break;
}
 #endif
+   int num_closure = ccl_fetch(sd, num_closure);
+
/* index of refraction */
float eta = fmaxf(param2, 1e-5f);
eta = (ccl_fetch(sd, flag) & SD_BACKFACING)? 1.0f/eta: 
eta;
@@ -269,7 +271,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, 
ShaderData *sd, float *
float roughness = param1;
 
/* reflection */
-   ShaderClosure *sc = ccl_fetch_array(sd, closure, 
ccl_fetch(sd, num_closure));
+   ShaderClosure *sc = ccl_fetch_array(sd, closure, 
num_closure);
float3 weight = sc->weight;
float sample_weight = sc->sample_weight;
 
@@ -290,8 +292,8 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, 
ShaderData *sd, float *
 #endif
 
/* refraction */
-   if(ccl_fetch(sd, num_closure) < MAX_CLOSURE) {
-   sc = ccl_fetch_array(sd, closure, ccl_fetch(sd, 
num_closure));
+   if(num_closure + 1 < MAX_CLOSURE) {
+   sc = ccl_fetch_array(sd, closure, num_closure + 
1);
sc->weight = weight;
sc->sample_weight = sample_weight;

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


[Bf-blender-cvs] [8aefea0] blender-v2.77-release: Fix Cycles debug panel, being shown in BI as well.

2016-04-05 Thread Thomas Dinges
Commit: 8aefea0c3a8ae556a889895d3837f694f173a25a
Author: Thomas Dinges
Date:   Fri Mar 25 19:59:18 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB8aefea0c3a8ae556a889895d3837f694f173a25a

Fix Cycles debug panel, being shown in BI as well.

===

M   intern/cycles/blender/addon/ui.py

===

diff --git a/intern/cycles/blender/addon/ui.py 
b/intern/cycles/blender/addon/ui.py
index 9234df5..b9e51df 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -1505,7 +1505,7 @@ class CyclesRender_PT_debug(CyclesButtonsPanel, Panel):
 
 @classmethod
 def poll(cls, context):
-return bpy.app.debug_value == 256
+return CyclesButtonsPanel.poll(context) and bpy.app.debug_value == 256
 
 def draw(self, context):
 layout = self.layout

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


[Bf-blender-cvs] [8efe90f] blender-v2.77-release: CMAKE / msvc openmp, delay loading of openmp dll so we can set environment variable before it is loaded

2016-04-05 Thread Martijn Berger
Commit: 8efe90f0a01fa3fcae68c02952aefb9c15c7c0d0
Author: Martijn Berger
Date:   Thu Mar 31 13:45:33 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB8efe90f0a01fa3fcae68c02952aefb9c15c7c0d0

CMAKE / msvc openmp, delay loading of openmp dll so we can set environment
variable before it is loaded

===

M   CMakeLists.txt
M   source/creator/creator.c

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9028f94..198995a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1292,6 +1292,17 @@ 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
diff --git a/source/creator/creator.c b/source/creator/creator.c
index b2bfe7f..bf8347d 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1816,6 +1816,11 @@ int main(
 
 
 #ifdef WIN32
+   /* We delay loading of openmp so we can set the policy here. */
+# if defined(_MSC_VER)
+   _putenv_s("OMP_WAIT_POLICY", "PASSIVE");
+# endif
+
/* FMA3 support in the 2013 CRT is broken on Vista and Windows 7 RTM 
(fixed in SP1). Just disable it. */
 #  if defined(_MSC_VER) && defined(_M_X64)
_set_FMA3_enable(0);

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


[Bf-blender-cvs] [a3ef7c9] blender-v2.77-release: Fix add mesh template

2016-04-05 Thread Bassam Kurdali
Commit: a3ef7c986cb1671813a6816715839a49af9fea83
Author: Bassam Kurdali
Date:   Tue Mar 22 03:51:48 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBa3ef7c986cb1671813a6816715839a49af9fea83

Fix add mesh template

===

M   release/scripts/templates_py/operator_mesh_add.py

===

diff --git a/release/scripts/templates_py/operator_mesh_add.py 
b/release/scripts/templates_py/operator_mesh_add.py
index 5fabaaf..efe936c 100644
--- a/release/scripts/templates_py/operator_mesh_add.py
+++ b/release/scripts/templates_py/operator_mesh_add.py
@@ -33,7 +33,12 @@ def add_box(width, height, depth):
 return verts, faces
 
 
-from bpy.props import FloatProperty, BoolProperty, FloatVectorProperty
+from bpy.props import (
+BoolProperty,
+BoolVectorProperty,
+FloatProperty,
+FloatVectorProperty,
+)
 
 
 class AddBox(bpy.types.Operator):
@@ -60,6 +65,11 @@ class AddBox(bpy.types.Operator):
 min=0.01, max=100.0,
 default=1.0,
 )
+layers = BoolVectorProperty(
+name="Layers",
+description="Object Layers",
+size=20,
+)
 
 # generic transform props
 view_align = BoolProperty(

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


[Bf-blender-cvs] [f036e18] blender-v2.77-release: GPU: avoid redundant logic for non-spot lamps

2016-04-05 Thread Campbell Barton
Commit: f036e1875f3dc4caa550078acdffb077f7f082f6
Author: Campbell Barton
Date:   Mon Mar 21 16:06:04 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBf036e1875f3dc4caa550078acdffb077f7f082f6

GPU: avoid redundant logic for non-spot lamps

===

M   source/blender/editors/space_view3d/view3d_draw.c
M   source/blender/gpu/intern/gpu_material.c

===

diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index 087c533..d81ef17 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2508,7 +2508,11 @@ static void gpu_render_lamp_update(Scene *scene, View3D 
*v3d,
if (srl)
layers &= srl->lay;
 
-   if (layers && GPU_lamp_override_visible(lamp, srl, NULL) && 
GPU_lamp_has_shadow_buffer(lamp)) {
+   if (layers &&
+   GPU_lamp_has_shadow_buffer(lamp) &&
+   /* keep last, may do string lookup */
+   GPU_lamp_override_visible(lamp, srl, NULL))
+   {
shadow = MEM_callocN(sizeof(View3DShadow), 
"View3DShadow");
shadow->lamp = lamp;
BLI_addtail(shadows, shadow);
diff --git a/source/blender/gpu/intern/gpu_material.c 
b/source/blender/gpu/intern/gpu_material.c
index fcace47..7437e2d 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -2186,12 +2186,16 @@ void GPU_lamp_update(GPULamp *lamp, int lay, int hide, 
float obmat[4][4])
copy_m4_m4(lamp->obmat, mat);
invert_m4_m4(lamp->imat, mat);
 
-   /* update spotlamp scale on X and Y axis */
-   lamp->spotvec[0] = obmat_scale[0] / obmat_scale[2];
-   lamp->spotvec[1] = obmat_scale[1] / obmat_scale[2];
+   if (lamp->type == LA_SPOT) {
+   /* update spotlamp scale on X and Y axis */
+   lamp->spotvec[0] = obmat_scale[0] / obmat_scale[2];
+   lamp->spotvec[1] = obmat_scale[1] / obmat_scale[2];
+   }
 
-   /* makeshadowbuf */
-   gpu_lamp_calc_winmat(lamp);
+   if (GPU_lamp_has_shadow_buffer(lamp)) {
+   /* makeshadowbuf */
+   gpu_lamp_calc_winmat(lamp);
+   }
 }
 
 void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float 
energy)

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


[Bf-blender-cvs] [2265628] blender-v2.77-release: Fix T47986: OBJ Import fails w/ imagepath encoding

2016-04-05 Thread Campbell Barton
Commit: 22656289644a72add3e414063252251949afc24e
Author: Campbell Barton
Date:   Tue Mar 29 18:22:35 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB22656289644a72add3e414063252251949afc24e

Fix T47986: OBJ Import fails w/ imagepath encoding

===

M   release/scripts/modules/bpy/path.py
M   release/scripts/modules/bpy_extras/image_utils.py

===

diff --git a/release/scripts/modules/bpy/path.py 
b/release/scripts/modules/bpy/path.py
index 99c46e4..30f6c8e 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -35,6 +35,7 @@ __all__ = (
 "extensions_audio",
 "is_subdir",
 "module_names",
+"native_pathsep",
 "reduce_dirs",
 "relpath",
 "resolve_ncase",
@@ -349,6 +350,28 @@ def basename(path):
 return _os.path.basename(path[2:] if path[:2] in {"//", b"//"} else path)
 
 
+def native_pathsep(path):
+"""
+Replace the path separator with the systems native ``os.sep``.
+"""
+if type(path) is str:
+if _os.sep == "/":
+return path.replace("\\", "/")
+else:
+if path.startswith("//"):
+return "//" + path[2:].replace("/", "\\")
+else:
+return path.replace("/", "\\")
+else:  # bytes
+if _os.sep == "/":
+return path.replace(b"\\", b"/")
+else:
+if path.startswith(b"//"):
+return b"//" + path[2:].replace(b"/", b"\\")
+else:
+return path.replace(b"/", b"\\")
+
+
 def reduce_dirs(dirs):
 """
 Given a sequence of directories, remove duplicates and
diff --git a/release/scripts/modules/bpy_extras/image_utils.py 
b/release/scripts/modules/bpy_extras/image_utils.py
index d078d63..f772aab 100644
--- a/release/scripts/modules/bpy_extras/image_utils.py
+++ b/release/scripts/modules/bpy_extras/image_utils.py
@@ -80,9 +80,12 @@ def load_image(imagepath,
 # Utility Functions
 
 def _image_load_placeholder(path):
-name = bpy.path.basename(path)
-if type(name) == bytes:
-name = name.decode("utf-8", "replace")
+name = path
+if type(path) is str:
+name = name.encode("utf-8", "replace")
+name = name.decode("utf-8", "replace")
+name = os.path.basename(name)
+
 image = bpy.data.images.new(name, 128, 128)
 # allow the path to be resolved later
 image.filepath = path
@@ -147,6 +150,8 @@ def load_image(imagepath,
 
 # -
 
+imagepath = bpy.path.native_pathsep(imagepath)
+
 if verbose:
 print("load_image('%s', '%s', ...)" % (imagepath, dirname))

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


[Bf-blender-cvs] [97836b7] blender-v2.77-release: Fix T47814: VSE Scene 'Use Sequence' fails

2016-04-05 Thread Campbell Barton
Commit: 97836b72500eec76efb65892f21909a9a8ad3b85
Author: Campbell Barton
Date:   Wed Mar 30 06:59:36 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB97836b72500eec76efb65892f21909a9a8ad3b85

Fix T47814: VSE Scene 'Use Sequence' fails

Conflict with flags between depsgraph and sequencer caused error.
Now pass state of sequencer parents to avoid recursion.

===

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

===

diff --git a/source/blender/blenkernel/intern/sequencer.c 
b/source/blender/blenkernel/intern/sequencer.c
index f479a03..c82f3a3 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -47,6 +47,7 @@
 #include "BLI_math.h"
 #include "BLI_fileops.h"
 #include "BLI_listbase.h"
+#include "BLI_linklist.h"
 #include "BLI_path_util.h"
 #include "BLI_string.h"
 #include "BLI_string_utf8.h"
@@ -91,10 +92,17 @@
 #  include AUD_SPECIAL_H
 #endif
 
-#define USE_SCENE_RECURSIVE_HACK
-
-static ImBuf *seq_render_strip_stack(const SeqRenderData *context, ListBase 
*seqbasep, float cfra, int chanshown);
-static ImBuf *seq_render_strip(const SeqRenderData *context, Sequence *seq, 
float cfra);
+/* mutable state for sequencer */
+typedef struct SeqRenderState {
+   LinkNode *scene_parents;
+} SeqRenderState;
+
+static ImBuf *seq_render_strip_stack(
+const SeqRenderData *context, SeqRenderState *state, ListBase 
*seqbasep,
+float cfra, int chanshown);
+static ImBuf *seq_render_strip(
+const SeqRenderData *context, SeqRenderState *state,
+Sequence *seq, float cfra);
 static void seq_free_animdata(Scene *scene, Sequence *seq);
 static ImBuf *seq_render_mask(const SeqRenderData *context, Mask *mask, float 
nr, bool make_float);
 static int seq_num_files(Scene *scene, char views_format, const bool 
is_multiview);
@@ -119,6 +127,11 @@ static void printf_strip(Sequence *seq)
 }
 #endif
 
+static void sequencer_state_init(SeqRenderState *state)
+{
+   state->scene_parents = NULL;
+}
+
 int BKE_sequencer_base_recursive_apply(ListBase *seqbase, int 
(*apply_func)(Sequence *seq, void *), void *arg)
 {
Sequence *iseq;
@@ -1758,8 +1771,10 @@ static ImBuf *seq_proxy_fetch(const SeqRenderData 
*context, Sequence *seq, int c
}
 }
 
-static void seq_proxy_build_frame(const SeqRenderData *context, Sequence *seq, 
int cfra,
-  int proxy_render_size, const bool overwrite)
+static void seq_proxy_build_frame(
+const SeqRenderData *context, SeqRenderState *state,
+Sequence *seq, int cfra,
+int proxy_render_size, const bool overwrite)
 {
char name[PROXY_MAXFILE];
int quality;
@@ -1776,7 +1791,7 @@ static void seq_proxy_build_frame(const SeqRenderData 
*context, Sequence *seq, i
return;
}
 
-   ibuf_tmp = seq_render_strip(context, seq, cfra);
+   ibuf_tmp = seq_render_strip(context, state, seq, cfra);
 
rectx = (proxy_render_size * ibuf_tmp->x) / 100;
recty = (proxy_render_size * ibuf_tmp->y) / 100;
@@ -1978,18 +1993,21 @@ void BKE_sequencer_proxy_rebuild(SeqIndexBuildContext 
*context, short *stop, sho
render_context.is_proxy_render = true;
render_context.view_id = context->view_id;
 
+   SeqRenderState state;
+   sequencer_state_init();
+
for (cfra = seq->startdisp + seq->startstill;  cfra < seq->enddisp - 
seq->endstill; cfra++) {
if (context->size_flags & IMB_PROXY_25) {
-   seq_proxy_build_frame(_context, seq, cfra, 25, 
overwrite);
+   seq_proxy_build_frame(_context, , seq, 
cfra, 25, overwrite);
}
if (context->size_flags & IMB_PROXY_50) {
-   seq_proxy_build_frame(_context, seq, cfra, 50, 
overwrite);
+   seq_proxy_build_frame(_context, , seq, 
cfra, 50, overwrite);
}
if (context->size_flags & IMB_PROXY_75) {
-   seq_proxy_build_frame(_context, seq, cfra, 75, 
overwrite);
+   seq_proxy_build_frame(_context, , seq, 
cfra, 75, overwrite);
}
if (context->size_flags & IMB_PROXY_100) {
-   seq_proxy_build_frame(_context, seq, cfra, 100, 
overwrite);
+   seq_proxy_build_frame(_context, , seq, 
cfra, 100, overwrite);
}
 
*progress = (float) (cfra - seq->startdisp - seq->startstill) / 
(seq->enddisp - seq->endstill - seq->startdisp - seq->startstill);
@@ -2298,7 +2316,10 @@ ImBuf *BKE_sequencer_render_mask_input(
 
if (mask_input_type == SEQUENCE_MASK_INPUT_STRIP) {
if (mask_sequence) {
-   mask_input = seq_render_strip(context, mask_sequence, 
cfra);
+   

[Bf-blender-cvs] [721f008] blender-v2.77-release: Fix T47928: Crashing save corruption with dynamic paint drip effector groups.

2016-04-05 Thread Bastien Montagne
Commit: 721f0089aa6799573611c4da78f7c57a3abf7090
Author: Bastien Montagne
Date:   Fri Mar 25 13:15:50 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB721f0089aa6799573611c4da78f7c57a3abf7090

Fix T47928: Crashing save corruption with dynamic paint drip effector groups.

Dynapaint's `foreachIDLink` was mnot handling effector_weights->group pointer...

===

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

===

diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c 
b/source/blender/modifiers/intern/MOD_dynamicpaint.c
index 91af965..edf959f 100644
--- a/source/blender/modifiers/intern/MOD_dynamicpaint.c
+++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c
@@ -29,6 +29,7 @@
 
 #include "DNA_dynamicpaint_types.h"
 #include "DNA_object_types.h"
+#include "DNA_object_force.h"
 #include "DNA_scene_types.h"
 
 #include "BLI_utildefines.h"
@@ -173,6 +174,9 @@ static void foreachIDLink(ModifierData *md, Object *ob,
for (; surface; surface = surface->next) {
walk(userData, ob, (ID **)>brush_group, 
IDWALK_NOP);
walk(userData, ob, (ID **)>init_texture, 
IDWALK_USER);
+   if (surface->effector_weights) {
+   walk(userData, ob, (ID 
**)>effector_weights->group, IDWALK_NOP);
+   }
}
}
if (pmd->brush) {

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


[Bf-blender-cvs] [02081f8] blender-v2.77-release: CMAKE disable building the windows launcher, fix type in delayloading of debug dll

2016-04-05 Thread Martijn Berger
Commit: 02081f86d1eefaec54a4758939b004d921175715
Author: Martijn Berger
Date:   Thu Mar 31 14:05:38 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB02081f86d1eefaec54a4758939b004d921175715

CMAKE disable building the windows launcher, fix type in delayloading of debug 
dll

===

M   CMakeLists.txt
M   source/creator/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 198995a..1efaa14 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1300,7 +1300,7 @@ elseif(WIN32)
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")
+   set(PLATFORM_LINKFLAGS_DEBUG 
"${PLATFORM_LINKFLAGS_DEBUG} /DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib")
endif()
 
if(NOT DEFINED LIBDIR)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index e825f53..ff6544c 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1090,17 +1090,7 @@ setup_liblinks(blender)
 # Setup launcher
 
 if(WIN32 AND NOT WITH_PYTHON_MODULE)
-   set(LAUNCHER_SRC
-   creator_launch_win.c
-   ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.rc
-   )
-   add_executable(blender-launcher ${LAUNCHER_SRC})
-   target_link_libraries(blender-launcher bf_intern_utfconv 
${PLATFORM_LINKLIBS})
-
-   set_target_properties(blender PROPERTIES OUTPUT_NAME blender-app)
-   set_target_properties(blender-launcher PROPERTIES OUTPUT_NAME blender)
-
-   install(TARGETS blender blender-launcher
+   install(TARGETS blender
COMPONENT Blender
DESTINATION ".")

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


[Bf-blender-cvs] [e4b1b00] blender-v2.77-release: Fix T47983: Particles - Emit from Verts emits double on one vert.

2016-04-05 Thread Bastien Montagne
Commit: e4b1b0088413cb912f7d8072935305e9100f426f
Author: Bastien Montagne
Date:   Wed Mar 30 20:59:07 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBe4b1b0088413cb912f7d8072935305e9100f426f

Fix T47983: Particles - Emit from Verts emits double on one vert.

When non-random, particle distribution used a small start offset (to avoid
zero-weight faces), which is fine with "continuous" entities like faces, but not
for discrete ones like vertices - in that case it was generating some undesired
"jump" over a few verts in case step was small enough
(i.e. total number of verts/particles was big enough).

===

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

===

diff --git a/source/blender/blenkernel/intern/particle_distribute.c 
b/source/blender/blenkernel/intern/particle_distribute.c
index 2527ff5..1c4099f 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -1014,7 +1014,7 @@ static int 
psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
double step, pos;

step= (totpart < 2) ? 0.5 : 1.0/(double)totpart;
-   pos= 1e-6; /* tiny offset to avoid zero weight face */
+   pos = (from == PART_FROM_VERT) ? 0.0 : 1e-6; /* tiny offset to 
avoid zero weight face */
i= 0;
 
for (p=0; p

[Bf-blender-cvs] [18029ed] blender-v2.77-release: Fix T47758: rigidbody bug with constraint breaking and disable collisions.

2016-04-05 Thread Brecht Van Lommel
Commit: 18029edf1ff5a99a3f856422d7bf4d32605beaa8
Author: Brecht Van Lommel
Date:   Sun Mar 27 01:25:25 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB18029edf1ff5a99a3f856422d7bf4d32605beaa8

Fix T47758: rigidbody bug with constraint breaking and disable collisions.

This is a regression in Bullet, reverted the problematic change for now with
a custom patch.

===

M   extern/bullet2/patches/blender.patch
M   extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp
M   extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h

===

diff --git a/extern/bullet2/patches/blender.patch 
b/extern/bullet2/patches/blender.patch
index f67d691..96357dd 100644
--- a/extern/bullet2/patches/blender.patch
+++ b/extern/bullet2/patches/blender.patch
@@ -233,3 +233,92 @@ index e05bdcc..dbcf2b6 100644
  
  
  #include "btVector3.h"
+diff --git a/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp 
b/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp
+index e0e8bc7..a788268 100644
+--- a/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp
 b/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp
+@@ -425,50 +425,38 @@ void btRigidBody::setCenterOfMassTransform(const 
btTransform& xform)
+ }
+ 
+ 
++bool btRigidBody::checkCollideWithOverride(const  btCollisionObject* co) const
++{
++  const btRigidBody* otherRb = btRigidBody::upcast(co);
++  if (!otherRb)
++  return true;
++
++  for (int i = 0; i < m_constraintRefs.size(); ++i)
++  {
++  const btTypedConstraint* c = m_constraintRefs[i];
++  if (c->isEnabled())
++  if (>getRigidBodyA() == otherRb || 
>getRigidBodyB() == otherRb)
++  return false;
++  }
++
++  return true;
++}
+ 
+ 
+ 
+ void btRigidBody::addConstraintRef(btTypedConstraint* c)
+ {
+-  ///disable collision with the 'other' body
+-
+   int index = m_constraintRefs.findLinearSearch(c);
+-  //don't add constraints that are already referenced
+-  //btAssert(index == m_constraintRefs.size());
+   if (index == m_constraintRefs.size())
+-  {
+-  m_constraintRefs.push_back(c);
+-  btCollisionObject* colObjA = >getRigidBodyA();
+-  btCollisionObject* colObjB = >getRigidBodyB();
+-  if (colObjA == this)
+-  {
+-  colObjA->setIgnoreCollisionCheck(colObjB, true);
+-  }
+-  else
+-  {
+-  colObjB->setIgnoreCollisionCheck(colObjA, true);
+-  }
+-  } 
++  m_constraintRefs.push_back(c); 
++
++  m_checkCollideWith = true;
+ }
+ 
+ void btRigidBody::removeConstraintRef(btTypedConstraint* c)
+ {
+-  int index = m_constraintRefs.findLinearSearch(c);
+-  //don't remove constraints that are not referenced
+-  if(index < m_constraintRefs.size())
+-{
+-m_constraintRefs.remove(c);
+-btCollisionObject* colObjA = >getRigidBodyA();
+-btCollisionObject* colObjB = >getRigidBodyB();
+-if (colObjA == this)
+-{
+-colObjA->setIgnoreCollisionCheck(colObjB, false);
+-}
+-else
+-{
+-colObjB->setIgnoreCollisionCheck(colObjA, false);
+-}
+-}
++  m_constraintRefs.remove(c);
++  m_checkCollideWith = m_constraintRefs.size() > 0;
+ }
+ 
+ int   btRigidBody::calculateSerializeBufferSize() const
+diff --git a/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h 
b/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h
+index 1d177db..c2f8c5d 100644
+--- a/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h
 b/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h
+@@ -509,6 +509,8 @@ public:
+   return (getBroadphaseProxy() != 0);
+   }
+ 
++  virtual bool checkCollideWithOverride(const  btCollisionObject* co) 
const;
++
+   void addConstraintRef(btTypedConstraint* c);
+   void removeConstraintRef(btTypedConstraint* c);
+ 
diff --git a/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp 
b/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp
index e0e8bc7..a788268 100644
--- a/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp
+++ b/extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp
@@ -425,50 +425,38 @@ void btRigidBody::setCenterOfMassTransform(const 
btTransform& xform)
 }
 
 
+bool btRigidBody::checkCollideWithOverride(const  btCollisionObject* co) const
+{
+   const btRigidBody* otherRb = btRigidBody::upcast(co);
+   if (!otherRb)
+   return true;
+
+   for (int i = 0; i < m_constraintRefs.size(); ++i)
+   {
+   const btTypedConstraint* c = m_constraintRefs[i];
+   if (c->isEnabled())
+   if 

[Bf-blender-cvs] [61aea37] blender-v2.77-release: Fix T47951: UserId problem on reload.

2016-04-05 Thread Bastien Montagne
Commit: 61aea37d3597e3755e7df1f5f38e368c42803fe4
Author: Bastien Montagne
Date:   Sat Mar 26 16:22:17 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB61aea37d3597e3755e7df1f5f38e368c42803fe4

Fix T47951: UserId problem on reload.

readfile.c would increment object usercount in three places, where it should 
not.
Remember kids: Objects are **only** refcounted by Scene's bases, and 
Object->proxy!

===

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

===

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 393d582..82efc74 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3309,7 +3309,7 @@ static void lib_link_camera(FileData *fd, Main *main)

ca->ipo = newlibadr_us(fd, ca->id.lib, ca->ipo); // XXX 
deprecated - old animation system

-   ca->dof_ob = newlibadr_us(fd, ca->id.lib, ca->dof_ob);
+   ca->dof_ob = newlibadr(fd, ca->id.lib, ca->dof_ob);

ca->id.tag &= ~LIB_TAG_NEED_LINK;
}
@@ -4012,7 +4012,7 @@ static void lib_link_partdeflect(FileData *fd, ID *id, 
PartDeflect *pd)
if (pd && pd->tex)
pd->tex = newlibadr_us(fd, id->lib, pd->tex);
if (pd && pd->f_source)
-   pd->f_source = newlibadr_us(fd, id->lib, pd->f_source);
+   pd->f_source = newlibadr(fd, id->lib, pd->f_source);
 }
 
 static void lib_link_particlesettings(FileData *fd, Main *main)
@@ -5578,7 +5578,7 @@ static void lib_link_scene(FileData *fd, Main *main)
 
if (sce->toolsettings->sculpt)
sce->toolsettings->sculpt->gravity_object =
-   newlibadr_us(fd, sce->id.lib, 
sce->toolsettings->sculpt->gravity_object);
+   newlibadr(fd, sce->id.lib, 
sce->toolsettings->sculpt->gravity_object);
 
if (sce->toolsettings->imapaint.stencil)
sce->toolsettings->imapaint.stencil =

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


[Bf-blender-cvs] [7ea29d6] blender-v2.77-release: Fix T47935: Hair particles; The display percentage parameter breaks after a render is done.

2016-04-05 Thread Bastien Montagne
Commit: 7ea29d69dfa79258c9f4c4e92b5c469606ff90dd
Author: Bastien Montagne
Date:   Sat Mar 26 17:41:56 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB7ea29d69dfa79258c9f4c4e92b5c469606ff90dd

Fix T47935: Hair particles; The display percentage parameter breaks after a 
render is done.

Follow same logic in `psys_render_restore` as in `psys_render_set` - if hair and
display percentage is not 100%, we have to recompute particles...

With regular 'emitter' particles just hiding some is fine (though using random 
here
will not give a precise proportion...).

===

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

===

diff --git a/source/blender/blenkernel/intern/particle.c 
b/source/blender/blenkernel/intern/particle.c
index d02308b..364bdbb 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -720,13 +720,19 @@ void psys_render_restore(Object *ob, ParticleSystem *psys)
disp = psys_get_current_display_percentage(psys);
 
if (disp != render_disp) {
-   PARTICLE_P;
+   /* Hair can and has to be recalculated if everything isn't 
displayed. */
+   if (psys->part->type == PART_HAIR) {
+   psys->recalc |= PSYS_RECALC_RESET;
+   }
+   else {
+   PARTICLE_P;
 
-   LOOP_PARTICLES {
-   if (psys_frand(psys, p) > disp)
-   pa->flag |= PARS_NO_DISP;
-   else
-   pa->flag &= ~PARS_NO_DISP;
+   LOOP_PARTICLES {
+   if (psys_frand(psys, p) > disp)
+   pa->flag |= PARS_NO_DISP;
+   else
+   pa->flag &= ~PARS_NO_DISP;
+   }
}
}
 }

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


[Bf-blender-cvs] [ee128c3] blender-v2.77-release: Fix T47962: It's possible to set a Sound strip as a modifier Mask.

2016-04-05 Thread Bastien Montagne
Commit: ee128c348fa12fa0be53a6f8ae3f7bda08c5d664
Author: Bastien Montagne
Date:   Sun Mar 27 13:01:58 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rBee128c348fa12fa0be53a6f8ae3f7bda08c5d664

Fix T47962: It's possible to set a Sound strip as a modifier Mask.

===

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

===

diff --git a/source/blender/makesrna/intern/rna_sequencer.c 
b/source/blender/makesrna/intern/rna_sequencer.c
index fae0d1c..856dc8b 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -1027,8 +1027,9 @@ static int 
rna_SequenceModifier_otherSequence_poll(PointerRNA *ptr, PointerRNA v
Sequence *seq = sequence_get_by_modifier(ed, ptr->data);
Sequence *cur = (Sequence *) value.data;
 
-   if (seq == cur)
+   if ((seq == cur) || (cur->type == SEQ_TYPE_SOUND_RAM)) {
return false;
+   }
 
return true;
 }

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


[Bf-blender-cvs] [4fc9178] blender-v2.77-release: CMake cleanup target_link_libraries_decoupled

2016-04-05 Thread Martijn Berger
Commit: 4fc9178af994765470836a3ee359250a33e63482
Author: Martijn Berger
Date:   Wed Mar 30 15:15:07 2016 +0200
Branches: blender-v2.77-release
https://developer.blender.org/rB4fc9178af994765470836a3ee359250a33e63482

CMake cleanup target_link_libraries_decoupled

===

M   CMakeLists.txt
M   build_files/cmake/macros.cmake
M   intern/cycles/app/CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7232e5e..1572e2b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1427,11 +1427,18 @@ elseif(WIN32)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} 
${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
set(OPENEXR_LIBRARIES
+   optimized
${OPENEXR_LIBPATH}/Iex-2_2.lib
${OPENEXR_LIBPATH}/Half.lib
${OPENEXR_LIBPATH}/IlmImf-2_2.lib
${OPENEXR_LIBPATH}/Imath-2_2.lib
${OPENEXR_LIBPATH}/IlmThread-2_2.lib
+   debug
+   ${OPENEXR_LIBPATH}/Iex-2_2_d.lib
+   ${OPENEXR_LIBPATH}/Half_d.lib
+   ${OPENEXR_LIBPATH}/IlmImf-2_2_d.lib
+   ${OPENEXR_LIBPATH}/Imath-2_2_d.lib
+   ${OPENEXR_LIBPATH}/IlmThread-2_2_d.lib
)
endif()
endif()
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index df0c365..7bdf790 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -141,22 +141,6 @@ function(target_link_libraries_debug
endforeach()
 endfunction()
 
-function(target_link_libraries_decoupled
-   target
-   libraries_var
-   )
-
-   if(NOT MSVC)
-   target_link_libraries(${target} ${${libraries_var}})
-   else()
-   # For MSVC we link to different libraries depending whether
-   # release or debug target is being built.
-   file_list_suffix(_libraries_debug "${${libraries_var}}" "_d")
-   target_link_libraries_debug(${target} "${_libraries_debug}")
-   target_link_libraries_optimized(${target} "${${libraries_var}}")
-   endif()
-endfunction()
-
 # Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
 # use it instead of include_directories()
 function(blender_include_dirs
@@ -417,14 +401,7 @@ function(setup_liblinks
endif()
target_link_libraries(${target} ${JPEG_LIBRARIES})
if(WITH_IMAGE_OPENEXR)
-   if(WIN32 AND NOT UNIX AND NOT CMAKE_COMPILER_IS_GNUCC)
-   file_list_suffix(OPENEXR_LIBRARIES_DEBUG 
"${OPENEXR_LIBRARIES}" "_d")
-   target_link_libraries_debug(${target} 
"${OPENEXR_LIBRARIES_DEBUG}")
-   target_link_libraries_optimized(${target} 
"${OPENEXR_LIBRARIES}")
-   unset(OPENEXR_LIBRARIES_DEBUG)
-   else()
-   target_link_libraries(${target} ${OPENEXR_LIBRARIES})
-   endif()
+   target_link_libraries(${target} ${OPENEXR_LIBRARIES})
endif()
if(WITH_IMAGE_OPENJPEG AND WITH_SYSTEM_OPENJPEG)
target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
index af20356..d40a1a1 100644
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@ -84,18 +84,12 @@ include_directories(SYSTEM ${INC_SYS})
 macro(cycles_target_link_libraries target)
target_link_libraries(${target} ${LIBRARIES})
if(WITH_CYCLES_OSL)
-   target_link_libraries_decoupled(${target} OSL_LIBRARIES)
-   if(MSVC)
-   target_link_libraries_debug(${target} 
"${LLVM_LIBRARIES_DEBUG}")
-   target_link_libraries_optimized(${target} 
"${LLVM_LIBRARIES}")
-   else()
-   target_link_libraries(${target} ${LLVM_LIBRARIES})
-   endif()
+   target_link_libraries(${target} ${OSL_LIBRARIES} 
${LLVM_LIBRARIES})
endif()
-   target_link_libraries_decoupled(${target} OPENIMAGEIO_LIBRARIES)
-   target_link_libraries_decoupled(${target} OPENEXR_LIBRARIES)
target_link_libraries(
${target}
+   ${OPENIMAGEIO_LIBRARIES}
+   ${OPENEXR_LIBRARIES}
${PUGIXML_LIBRARIES}
${BOOST_LIBRARIES}
${CMAKE_DL_LIBS}


[Bf-blender-cvs] [1af7bf3] blender-v2.77-release: Fix T47910: Knife project fails

2016-04-05 Thread Campbell Barton
Commit: 1af7bf3a208e86427c923674117e26fc59e25b63
Author: Campbell Barton
Date:   Thu Mar 24 18:27:39 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB1af7bf3a208e86427c923674117e26fc59e25b63

Fix T47910: Knife project fails

Regression in fix for T43896, using screen-space precision here is very 
problematic,
using lower precision here works for both reports.

===

M   source/blender/editors/mesh/editmesh_knife.c

===

diff --git a/source/blender/editors/mesh/editmesh_knife.c 
b/source/blender/editors/mesh/editmesh_knife.c
index b606eb0..59967ff 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1625,7 +1625,8 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
face_tol = KNIFE_FLT_EPS_PX_FACE;
}
else {
-   vert_tol = line_tol = face_tol = 0.001f;
+   /* use 1/100th of a pixel, see T43896 (too big), T47910 (too 
small). */
+   vert_tol = line_tol = face_tol = 0.01f;
}
 
vert_tol_sq = vert_tol * vert_tol;

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


[Bf-blender-cvs] [a80f3d7] blender-v2.77-release: Fix T48000: Eyedropper sample-merged ignored at first

2016-04-05 Thread Campbell Barton
Commit: a80f3d7ddb647b19e97817d408494c0b8ec0ee27
Author: Campbell Barton
Date:   Wed Mar 30 17:28:01 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBa80f3d7ddb647b19e97817d408494c0b8ec0ee27

Fix T48000: Eyedropper sample-merged ignored at first

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_image.c 
b/source/blender/editors/sculpt_paint/paint_image.c
index 4d82553..a9cd601 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -1219,7 +1219,6 @@ static int sample_color_invoke(bContext *C, wmOperator 
*op, const wmEvent *event
 {
Scene *scene = CTX_data_scene(C);
Paint *paint = BKE_paint_get_active_from_context(C);
-   PaintMode mode = BKE_paintmode_get_active_from_context(C);
Brush *brush = BKE_paint_brush(paint);
SampleColorData *data = MEM_mallocN(sizeof(SampleColorData), "sample 
color custom data");
ARegion *ar = CTX_wm_region(C);
@@ -1242,7 +1241,10 @@ static int sample_color_invoke(bContext *C, wmOperator 
*op, const wmEvent *event
 
RNA_int_set_array(op->ptr, "location", event->mval);
 
-   paint_sample_color(C, ar, event->mval[0], event->mval[1], mode == 
ePaintTextureProjective, false);
+   PaintMode mode = BKE_paintmode_get_active_from_context(C);
+   const bool use_sample_texture = (mode == ePaintTextureProjective) && 
!RNA_boolean_get(op->ptr, "merged");
+
+   paint_sample_color(C, ar, event->mval[0], event->mval[1], 
use_sample_texture, false);
WM_cursor_modal_set(win, BC_EYEDROPPER_CURSOR);
 
WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush);

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


[Bf-blender-cvs] [9a7d576] blender-v2.77-release: Fix T47838: Walk gravity fails w/ intersecting objects

2016-04-05 Thread Campbell Barton
Commit: 9a7d57633213dd430f01faaa30ab009907a5770c
Author: Campbell Barton
Date:   Thu Mar 24 17:50:20 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB9a7d57633213dd430f01faaa30ab009907a5770c

Fix T47838: Walk gravity fails w/ intersecting objects

Regression in 3ad0344, fix from @mano-wii.

More comprehensive fix can be done after 2.77a.

===

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

===

diff --git a/source/blender/editors/transform/transform_snap.c 
b/source/blender/editors/transform/transform_snap.c
index 3622012..bb9120c 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -1574,7 +1574,9 @@ static bool snapDerivedMesh(
bb = _temp;
}
 
-   len_diff = local_depth;
+   /* was local_depth, see: T47838 */
+   len_diff = BVH_RAYCAST_DIST_MAX;
+
if (!BKE_boundbox_ray_hit_check(bb, 
ray_start_local, ray_normal_local, _diff)) {
return retval;
}

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


[Bf-blender-cvs] [744ef82] blender-v2.77-release: Fix incorrect strncat use

2016-04-05 Thread Campbell Barton
Commit: 744ef820d136fc3da14003319dd6f49e8633faf5
Author: Campbell Barton
Date:   Wed Mar 23 03:54:04 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rB744ef820d136fc3da14003319dd6f49e8633faf5

Fix incorrect strncat use

===

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

===

diff --git a/source/blender/editors/space_file/file_ops.c 
b/source/blender/editors/space_file/file_ops.c
index ddb8b1c..d83a7d5 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -1374,8 +1374,8 @@ int file_exec(bContext *C, wmOperator *exec_op)
BLI_parent_dir(sfile->params->dir);
}
else {
-   BLI_cleanup_dir(G.main->name, sfile->params->dir);
-   strncat(sfile->params->dir, file->relpath, 
sizeof(sfile->params->dir));
+   BLI_cleanup_path(G.main->name, sfile->params->dir);
+   BLI_path_append(sfile->params->dir, 
sizeof(sfile->params->dir) - 1, file->relpath);
BLI_add_slash(sfile->params->dir);
}

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


[Bf-blender-cvs] [0889f8c] blender-v2.77-release: Fix for crash of point density textures due to undefined `point_data` on loading.

2016-04-05 Thread Lukas Tönne
Commit: 0889f8c127622ecc9383e73e20a274063f0bcc03
Author: Lukas Tönne
Date:   Tue Mar 22 15:07:56 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB0889f8c127622ecc9383e73e20a274063f0bcc03

Fix for crash of point density textures due to undefined `point_data` on 
loading.

===

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

===

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 3758374..393d582 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3838,6 +3838,7 @@ static void direct_link_texture(FileData *fd, Tex *tex)
if (tex->pd->falloff_curve) {
direct_link_curvemapping(fd, tex->pd->falloff_curve);
}
+   tex->pd->point_data = NULL; /* runtime data */
}

tex->vd = newdataadr(fd, tex->vd);

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


[Bf-blender-cvs] [5ac7186] blender-v2.77-release: Fix T47842: UV sculpt brush widgets are available when not in uv sculpt mode.

2016-04-05 Thread Philipp Oeser
Commit: 5ac7186633fd16e1d86a7214c726e4c82453bf32
Author: Philipp Oeser
Date:   Mon Mar 21 15:45:16 2016 +0100
Branches: blender-v2.77-release
https://developer.blender.org/rB5ac7186633fd16e1d86a7214c726e4c82453bf32

Fix T47842: UV sculpt brush widgets are available when not in uv sculpt mode.

rB5b3af3dd made the poll function here slightly too laxist.

To be backported to 2.77 should we make an 'a' release.

Reviewed By: mont29

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

===

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

===

diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c 
b/source/blender/editors/sculpt_paint/sculpt_uv.c
index b8fec17..8ed654c 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -175,9 +175,9 @@ static int uv_sculpt_brush_poll_do(bContext *C, const bool 
check_region)
em = BKE_editmesh_from_object(obedit);
ret = EDBM_mtexpoly_check(em);
 
-   if (ret && check_region) {
+   if (ret) {
ARegion *ar = CTX_wm_region(C);
-   if (!((toolsettings->use_uv_sculpt) && (ar->regiontype == 
RGN_TYPE_WINDOW))) {
+   if ((!toolsettings->use_uv_sculpt) || (check_region && ar && 
(ar->regiontype == RGN_TYPE_WINDOW))) {
ret = 0;
}
}

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


  1   2   >