[Bf-blender-cvs] [4849583] master: BMesh: callback for bmbvh so caller can choose faces

2014-07-29 Thread Campbell Barton
Commit: 4849583e241baeadf965e2dcdb8b11052f3c2dac
Author: Campbell Barton
Date:   Wed Jul 30 16:48:20 2014 +1000
Branches: master
https://developer.blender.org/rB4849583e241baeadf965e2dcdb8b11052f3c2dac

BMesh: callback for bmbvh so caller can choose faces

===

M   source/blender/blenkernel/BKE_editmesh_bvh.h
M   source/blender/blenkernel/intern/editmesh_bvh.c

===

diff --git a/source/blender/blenkernel/BKE_editmesh_bvh.h 
b/source/blender/blenkernel/BKE_editmesh_bvh.h
index 355e817..168f700 100644
--- a/source/blender/blenkernel/BKE_editmesh_bvh.h
+++ b/source/blender/blenkernel/BKE_editmesh_bvh.h
@@ -43,9 +43,16 @@ struct Scene;
 
 typedef struct BMBVHTree BMBVHTree;
 
-BMBVHTree  *BKE_bmbvh_new_from_editmesh(struct BMEditMesh *em, int flag, 
const float (*cos_cage)[3], const bool cos_cage_free);
-BMBVHTree  *BKE_bmbvh_new(struct BMesh *bm, struct BMLoop *(*looptris)[3], 
int looptris_tot, int flag,
-  const float (*cos_cage)[3], const bool 
cos_cage_free);
+BMBVHTree  *BKE_bmbvh_new_from_editmesh(
+struct BMEditMesh *em, int flag,
+const float (*cos_cage)[3], const bool cos_cage_free);
+BMBVHTree  *BKE_bmbvh_new_ex(
+struct BMesh *bm, struct BMLoop *(*looptris)[3], int looptris_tot, int 
flag,
+const float (*cos_cage)[3], const bool cos_cage_free,
+bool (*test_fn)(struct BMFace *, void *user_data), void *user_data);
+BMBVHTree  *BKE_bmbvh_new(
+struct BMesh *bm, struct BMLoop *(*looptris)[3], int looptris_tot, int 
flag,
+const float (*cos_cage)[3], const bool cos_cage_free);
 voidBKE_bmbvh_free(BMBVHTree *tree);
 struct BVHTree *BKE_bmbvh_tree_get(BMBVHTree *tree);
 struct BMFace  *BKE_bmbvh_ray_cast(BMBVHTree *tree, const float co[3], const 
float dir[3], const float radius,
diff --git a/source/blender/blenkernel/intern/editmesh_bvh.c 
b/source/blender/blenkernel/intern/editmesh_bvh.c
index 76ea340..442ab26 100644
--- a/source/blender/blenkernel/intern/editmesh_bvh.c
+++ b/source/blender/blenkernel/intern/editmesh_bvh.c
@@ -53,13 +53,17 @@ struct BMBVHTree {
int flag;
 };
 
-BMBVHTree *BKE_bmbvh_new_from_editmesh(BMEditMesh *em, int flag, const float 
(*cos_cage)[3], const bool cos_cage_free)
+BMBVHTree *BKE_bmbvh_new_from_editmesh(
+BMEditMesh *em, int flag,
+const float (*cos_cage)[3], const bool cos_cage_free)
 {
return BKE_bmbvh_new(em->bm, em->looptris, em->tottri, flag, cos_cage, 
cos_cage_free);
 }
 
-BMBVHTree *BKE_bmbvh_new(BMesh *bm, BMLoop *(*looptris)[3], int looptris_tot, 
int flag, const float (*cos_cage)[3],
-const bool cos_cage_free)
+BMBVHTree *BKE_bmbvh_new_ex(
+BMesh *bm, BMLoop *(*looptris)[3], int looptris_tot, int flag,
+const float (*cos_cage)[3], const bool cos_cage_free,
+bool (*test_fn)(BMFace *, void *user_data), void *user_data)
 {
/* could become argument */
const float epsilon = FLT_EPSILON * 2.0f;
@@ -69,6 +73,10 @@ const bool cos_cage_free)
int i;
int tottri;
 
+   /* avoid testing every tri */
+   BMFace *f_test, *f_test_prev;
+   bool test_fn_ret;
+
/* BKE_editmesh_tessface_calc() must be called already */
BLI_assert(looptris_tot != 0 || bm->totface == 0);
 
@@ -83,18 +91,22 @@ const bool cos_cage_free)
bmtree->cos_cage_free = cos_cage_free;
bmtree->flag = flag;
 
-   if (flag & (BMBVH_RESPECT_SELECT)) {
+   if (test_fn) {
+   /* callback must do... */
+   BLI_assert(!(flag & (BMBVH_RESPECT_SELECT | 
BMBVH_RESPECT_HIDDEN)));
+
+   f_test_prev = NULL;
+   test_fn_ret = false;
+
tottri = 0;
for (i = 0; i < looptris_tot; i++) {
-   if (BM_elem_flag_test(looptris[i][0]->f, 
BM_ELEM_SELECT)) {
-   tottri++;
+   f_test = looptris[i][0]->f;
+   if (f_test != f_test_prev) {
+   test_fn_ret = test_fn(f_test, user_data);
+   f_test_prev = f_test;
}
-   }
-   }
-   else if (flag & (BMBVH_RESPECT_HIDDEN)) {
-   tottri = 0;
-   for (i = 0; i < looptris_tot; i++) {
-   if (!BM_elem_flag_test(looptris[i][0]->f, 
BM_ELEM_HIDDEN)) {
+
+   if (test_fn_ret) {
tottri++;
}
}
@@ -105,17 +117,19 @@ const bool cos_cage_free)
 
bmtree->tree = BLI_bvhtree_new(tottri, epsilon, 8, 8);
 
-   for (i = 0; i < looptris_tot; i++) {
+   f_test_prev = NULL;
+   test_fn_ret = false;
 
-   if (flag & BMBVH_RESPECT_SELECT) {
+   for (i = 0; i < looptris_tot; i++) {
+   if (tes

[Bf-blender-cvs] [3a4e8f8] master: Bugfix T41240: Home key doesn't show everything on F-Curves

2014-07-29 Thread Joshua Leung
Commit: 3a4e8f8184cfde3062bfad1a7745aba02984535d
Author: Joshua Leung
Date:   Wed Jul 30 18:15:49 2014 +1200
Branches: master
https://developer.blender.org/rB3a4e8f8184cfde3062bfad1a7745aba02984535d

Bugfix T41240: Home key doesn't show everything on F-Curves

Own copy and paste typo in 73d157e meant that this was not in some cases,
the bounds calculated may be incorrect.

===

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

===

diff --git a/source/blender/blenkernel/intern/fcurve.c 
b/source/blender/blenkernel/intern/fcurve.c
index 5ad8a1c..09c1dcf 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -542,7 +542,7 @@ bool calc_fcurve_bounds(FCurve *fcu, float *xmin, float 
*xmax, float *ymin, floa
/* right handle - only 
if applicable */
if (bezt->ipo == 
BEZT_IPO_BEZ) {
yminv = 
min_ff(yminv, bezt->vec[2][1]);
-   ymaxv = 
min_ff(ymaxv, bezt->vec[2][1]);
+   ymaxv = 
max_ff(ymaxv, bezt->vec[2][1]);
}
}

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


[Bf-blender-cvs] [f06be2b] master: missed last commit

2014-07-29 Thread Campbell Barton
Commit: f06be2b4f4f1f9f9108f6a20c0d2f0994134a8a8
Author: Campbell Barton
Date:   Wed Jul 30 15:02:42 2014 +1000
Branches: master
https://developer.blender.org/rBf06be2b4f4f1f9f9108f6a20c0d2f0994134a8a8

missed last commit

===

M   source/blender/blenlib/BLI_listbase.h

===

diff --git a/source/blender/blenlib/BLI_listbase.h 
b/source/blender/blenlib/BLI_listbase.h
index 656423b..697ba86 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -111,11 +111,11 @@ if ((lb)->first && (lb_init || (lb_init = (lb)->first))) 
{ \
 (lb_iter != lb_init)); \
 }
 
-#define LISTBASE_CIRCULAR_BACKWARD_BEGIN(lb, lb_iter, lb_init) \
+#define BLI_LISTBASE_CIRCULAR_BACKWARD_BEGIN(lb, lb_iter, lb_init) \
 if ((lb)->last && (lb_init || (lb_init = (lb)->last))) { \
lb_iter = lb_init; \
do {
-#define LISTBASE_CIRCULAR_BACKWARD_END(lb, lb_iter, lb_init) \
+#define BLI_LISTBASE_CIRCULAR_BACKWARD_END(lb, lb_iter, lb_init) \
} while ((lb_iter  = (lb_iter)->prev ? (lb_iter)->prev : (lb)->last), \
 (lb_iter != lb_init)); \
 }

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


[Bf-blender-cvs] [b64e36d] master: BLI_listbase: consistent name prefix

2014-07-29 Thread Campbell Barton
Commit: b64e36d26dac8463c0f4a1dc1dbd9cf1ef27e0d9
Author: Campbell Barton
Date:   Wed Jul 30 15:01:16 2014 +1000
Branches: master
https://developer.blender.org/rBb64e36d26dac8463c0f4a1dc1dbd9cf1ef27e0d9

BLI_listbase: consistent name prefix

===

M   source/blender/blenlib/BLI_listbase.h
M   source/blender/blenlib/intern/listbase.c
M   source/blender/bmesh/intern/bmesh_edgeloop.c
M   source/blender/bmesh/operators/bmo_bridge.c
M   source/blender/bmesh/operators/bmo_subdivide_edgering.c
M   source/blender/editors/animation/anim_markers.c
M   source/blender/editors/mesh/editmesh_tools.c
M   source/blender/editors/object/object_transform.c

===

diff --git a/source/blender/blenlib/BLI_listbase.h 
b/source/blender/blenlib/BLI_listbase.h
index b900b5f..656423b 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -76,8 +76,8 @@ void BLI_freelinkN(struct ListBase *listbase, void *vlink) 
ATTR_NONNULL(1);
 void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) 
ATTR_NONNULL(1, 2);
 void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) 
ATTR_NONNULL(1, 2);
 void BLI_listbase_reverse(struct ListBase *lb) ATTR_NONNULL(1);
-void BLI_rotatelist_first(struct ListBase *lb, void *vlink) ATTR_NONNULL(1, 2);
-void BLI_rotatelist_last(struct ListBase *lb, void *vlink) ATTR_NONNULL(1, 2);
+void BLI_listbase_rotate_first(struct ListBase *lb, void *vlink) 
ATTR_NONNULL(1, 2);
+void BLI_listbase_rotate_last(struct ListBase *lb, void *vlink) 
ATTR_NONNULL(1, 2);
 
 /**
  * Utility functions to avoid first/last references inline all over.
@@ -95,18 +95,18 @@ struct LinkData *BLI_genericNodeN(void *data);
  *
  * \code{.c}
  *
- * LISTBASE_CIRCULAR_FORWARD_BEGIN (listbase, item, item_init) {
+ * BLI_LISTBASE_CIRCULAR_FORWARD_BEGIN (listbase, item, item_init) {
  * ...operate on marker...
  * }
- * LISTBASE_CIRCULAR_FORWARD_END (listbase, item, item_init);
+ * BLI_LISTBASE_CIRCULAR_FORWARD_END (listbase, item, item_init);
  *
  * \endcode
  */
-#define LISTBASE_CIRCULAR_FORWARD_BEGIN(lb, lb_iter, lb_init) \
+#define BLI_LISTBASE_CIRCULAR_FORWARD_BEGIN(lb, lb_iter, lb_init) \
 if ((lb)->first && (lb_init || (lb_init = (lb)->first))) { \
lb_iter = lb_init; \
do {
-#define LISTBASE_CIRCULAR_FORWARD_END(lb, lb_iter, lb_init) \
+#define BLI_LISTBASE_CIRCULAR_FORWARD_END(lb, lb_iter, lb_init) \
} while ((lb_iter  = (lb_iter)->next ? (lb_iter)->next : (lb)->first), \
 (lb_iter != lb_init)); \
 }
diff --git a/source/blender/blenlib/intern/listbase.c 
b/source/blender/blenlib/intern/listbase.c
index b0c2489..9c5f2ad 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -599,7 +599,7 @@ void BLI_listbase_reverse(ListBase *lb)
 /**
  * \param vlink Link to make first.
  */
-void BLI_rotatelist_first(ListBase *lb, void *vlink)
+void BLI_listbase_rotate_first(ListBase *lb, void *vlink)
 {
/* make circular */
((Link *)lb->first)->prev = lb->last;
@@ -615,7 +615,7 @@ void BLI_rotatelist_first(ListBase *lb, void *vlink)
 /**
  * \param vlink Link to make last.
  */
-void BLI_rotatelist_last(ListBase *lb, void *vlink)
+void BLI_listbase_rotate_last(ListBase *lb, void *vlink)
 {
/* make circular */
((Link *)lb->first)->prev = lb->last;
diff --git a/source/blender/bmesh/intern/bmesh_edgeloop.c 
b/source/blender/bmesh/intern/bmesh_edgeloop.c
index f01e119..e83a1d5 100644
--- a/source/blender/bmesh/intern/bmesh_edgeloop.c
+++ b/source/blender/bmesh/intern/bmesh_edgeloop.c
@@ -682,12 +682,12 @@ void BM_edgeloop_expand(BMesh *UNUSED(bm), 
BMEdgeLoopStore *el_store, int el_sto
LinkData *node_curr_init = node_curr;
LinkData *node_curr_copy;
int i = 0;
-   LISTBASE_CIRCULAR_FORWARD_BEGIN (&el_store->verts, 
node_curr, node_curr_init) {
+   BLI_LISTBASE_CIRCULAR_FORWARD_BEGIN (&el_store->verts, 
node_curr, node_curr_init) {
if (i++ < step) {
break;
}
}
-   LISTBASE_CIRCULAR_FORWARD_END (&el_store->verts, 
node_curr, node_curr_init);
+   BLI_LISTBASE_CIRCULAR_FORWARD_END (&el_store->verts, 
node_curr, node_curr_init);
 
node_curr_copy = MEM_dupallocN(node_curr);
BLI_insertlinkafter(&el_store->verts, node_curr, 
node_curr_copy);
diff --git a/source/blender/bmesh/operators/bmo_bridge.c 
b/source/blender/bmesh/operators/bmo_bridge.c
index 9e9cd0d..e441747 100644
--- a/source/blender/bmesh/operators/bmo_bridge.c
+++ b/source/blender/bmesh/operators/bmo_bridge.c
@@ -119,7 +119,7 @@ static

[Bf-blender-cvs] [ce0ff26] master: GHash: generic comparison for int[4]

2014-07-29 Thread Campbell Barton
Commit: ce0ff266e988bf605e27ae8c393a7f74b2763d53
Author: Campbell Barton
Date:   Wed Jul 30 07:30:18 2014 +1000
Branches: master
https://developer.blender.org/rBce0ff266e988bf605e27ae8c393a7f74b2763d53

GHash: generic comparison for int[4]

===

M   source/blender/blenlib/BLI_ghash.h
M   source/blender/blenlib/intern/BLI_ghash.c
M   source/blender/bmesh/tools/bmesh_beautify.c

===

diff --git a/source/blender/blenlib/BLI_ghash.h 
b/source/blender/blenlib/BLI_ghash.h
index dc29a12..313c419 100644
--- a/source/blender/blenlib/BLI_ghash.h
+++ b/source/blender/blenlib/BLI_ghash.h
@@ -139,6 +139,9 @@ unsigned intBLI_ghashutil_uinthash(unsigned int key);
 unsigned intBLI_ghashutil_uinthash_v4(const unsigned int key[4]);
 #define BLI_ghashutil_inthash_v4_p \
((GSetHashFP)BLI_ghashutil_uinthash_v4)
+int BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b);
+#define BLI_ghashutil_inthash_v4_cmp \
+BLI_ghashutil_uinthash_v4_cmp
 unsigned intBLI_ghashutil_inthash_p(const void *ptr);
 int BLI_ghashutil_intcmp(const void *a, const void *b);
 
diff --git a/source/blender/blenlib/intern/BLI_ghash.c 
b/source/blender/blenlib/intern/BLI_ghash.c
index d24c180..6b818ed 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -704,6 +704,11 @@ unsigned int BLI_ghashutil_uinthash_v4(const unsigned int 
key[4])
return hash;
 }
 
+int BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b)
+{
+   return memcmp(a, b, sizeof(unsigned int[4]));
+}
+
 unsigned int BLI_ghashutil_uinthash(unsigned int key)
 {
key += ~(key << 16);
diff --git a/source/blender/bmesh/tools/bmesh_beautify.c 
b/source/blender/bmesh/tools/bmesh_beautify.c
index b9bd7a3..6639e76 100644
--- a/source/blender/bmesh/tools/bmesh_beautify.c
+++ b/source/blender/bmesh/tools/bmesh_beautify.c
@@ -67,6 +67,7 @@ static unsigned int erot_gsetutil_hash(const void *ptr)
return BLI_ghashutil_inthash_v4(&e_state->v1);
 }
 #endif
+#if 0
 static int erot_gsetutil_cmp(const void *a, const void *b)
 {
const EdRotState *e_state_a = (const EdRotState *)a;
@@ -81,10 +82,10 @@ static int erot_gsetutil_cmp(const void *a, const void *b)
else if (e_state_a->f2 > e_state_b->f2) return  1;
elsereturn  0;
 }
-
+#endif
 static GSet *erot_gset_new(void)
 {
-   return BLI_gset_new(BLI_ghashutil_inthash_v4_p, erot_gsetutil_cmp, 
__func__);
+   return BLI_gset_new(BLI_ghashutil_inthash_v4_p, 
BLI_ghashutil_inthash_v4_cmp, __func__);
 }
 
 /* ensure v0 is smaller */

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


[Bf-blender-cvs] [f4b3c92] blender-tiles: Merge branch 'master' into blender-tiles

2014-07-29 Thread Monique Dewanchand
Commit: f4b3c92716a8ad4aaaccd3a363619644ee064754
Author: Monique Dewanchand
Date:   Tue Jul 29 22:29:23 2014 +0200
Branches: blender-tiles
https://developer.blender.org/rBf4b3c92716a8ad4aaaccd3a363619644ee064754

Merge branch 'master' into blender-tiles

===



===



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


[Bf-blender-cvs] [f6fc2f5] pie-menus: small cleanup against mater to avoid conflict when merge-testing with multiview

2014-07-29 Thread Dalai Felinto
Commit: f6fc2f5991206d0bbf4d2087a1668be45f18119e
Author: Dalai Felinto
Date:   Tue Jul 29 17:48:21 2014 -0300
Branches: pie-menus
https://developer.blender.org/rBf6fc2f5991206d0bbf4d2087a1668be45f18119e

small cleanup against mater to avoid conflict when merge-testing with multiview

===

M   source/blender/makesdna/DNA_userdef_types.h

===

diff --git a/source/blender/makesdna/DNA_userdef_types.h 
b/source/blender/makesdna/DNA_userdef_types.h
index 7ea2770..1dcdbb3 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -853,7 +853,6 @@ typedef enum eImageDrawMethod {
IMAGE_DRAW_METHOD_DRAWPIXELS = 3,
 } eImageDrawMethod;
 
-
 #ifdef __cplusplus
 }
 #endif

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


[Bf-blender-cvs] [c4dd294] master: OSX/buildbot: after recent scons fix, UTF lib linkage is handled dependent on config, so remove now obsolete lines

2014-07-29 Thread Jens Verwiebe
Commit: c4dd294f407fcfb12e7c1451a3aaae41b0a0114a
Author: Jens Verwiebe
Date:   Tue Jul 29 20:08:41 2014 +0200
Branches: master
https://developer.blender.org/rBc4dd294f407fcfb12e7c1451a3aaae41b0a0114a

OSX/buildbot: after recent scons fix,  UTF lib linkage is handled dependent on 
config, so remove now obsolete lines

===

M   build_files/buildbot/config/user-config-mac-i386.py

===

diff --git a/build_files/buildbot/config/user-config-mac-i386.py 
b/build_files/buildbot/config/user-config-mac-i386.py
index dc74125..2ab1e76 100644
--- a/build_files/buildbot/config/user-config-mac-i386.py
+++ b/build_files/buildbot/config/user-config-mac-i386.py
@@ -4,7 +4,5 @@ MACOSX_ARCHITECTURE = 'i386' # valid archs: ppc, i386, ppc64, 
x86_64
 WITH_BF_CYCLES_CUDA_BINARIES = True
 
 WITH_BF_CYCLES_OSL = False # OSL never worked on OSX 32bit !
-WITH_BF_LLVM = False # no OSL -> no LLVM -> OpenCollada must have libUTF.a 
then !
 
-BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework 
OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser 
xml2 buffer ftoa UTF'

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


[Bf-blender-cvs] [f557b47] master: OSX/cmake: fix linking utf-functions if llvm is disabled

2014-07-29 Thread Jens Verwiebe
Commit: f557b477ad3a884a467bc7baecc22512bfaa4bc4
Author: Jens Verwiebe
Date:   Tue Jul 29 19:46:05 2014 +0200
Branches: master
https://developer.blender.org/rBf557b477ad3a884a467bc7baecc22512bfaa4bc4

OSX/cmake: fix linking utf-functions if llvm is disabled

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8be3a9b..ca83e9d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1772,6 +1772,10 @@ elseif(APPLE)
 
set(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
set(OPENCOLLADA_LIBRARIES "OpenCOLLADASaxFrameworkLoader 
-lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter 
-lMathMLSolver -lGeneratedSaxParser -lxml2 -lbuffer -lftoa")
+   # Use UTF functions from collada if LLVM is not enabled
+   if(NOT WITH_LLVM)
+   set(OPENCOLLADA_LIBRARIES "${OPENCOLLADA_LIBRARIES} 
-lUTF")
+   endif()
# pcre is bundled with openCollada
#set(PCRE ${LIBDIR}/pcre)
#set(PCRE_LIBPATH ${PCRE}/lib)

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


[Bf-blender-cvs] [3f4be7b] hair_system: Merge branch 'master' into hair_system

2014-07-29 Thread Lukas Tönne
Commit: 3f4be7b9c34f0622d375b2b7e6e29c2c85bfb737
Author: Lukas Tönne
Date:   Tue Jul 29 18:42:17 2014 +0200
Branches: hair_system
https://developer.blender.org/rB3f4be7b9c34f0622d375b2b7e6e29c2c85bfb737

Merge branch 'master' into hair_system

===



===



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


[Bf-blender-cvs] [776ce62] soc-2014-cycles: Cycles: Further optimizations for Volume Light Sampling.

2014-07-29 Thread Thomas Dinges
Commit: 776ce62bee4df7ad59b7c2172e9eec9435607d60
Author: Thomas Dinges
Date:   Tue Jul 29 17:58:14 2014 +0200
Branches: soc-2014-cycles
https://developer.blender.org/rB776ce62bee4df7ad59b7c2172e9eec9435607d60

Cycles: Further optimizations for Volume Light Sampling.

* Now we calculate ls->P only, which is needed for equi-angular sampling. If 
the scattering is successful, we call the regular light_sample() functions.

===

M   intern/cycles/kernel/kernel_light.h
M   intern/cycles/kernel/kernel_path_volume.h

===

diff --git a/intern/cycles/kernel/kernel_light.h 
b/intern/cycles/kernel/kernel_light.h
index 37230d4..199a2c2 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -208,46 +208,39 @@ ccl_device float lamp_light_pdf(KernelGlobals *kg, const 
float3 Ng, const float3
return t*t/cos_pi;
 }
 
-ccl_device void lamp_light_sample_new_position(KernelGlobals *kg, int lamp,
+ccl_device void lamp_light_sample_position(KernelGlobals *kg, int lamp,
  float randu, 
float randv, float3 P, LightSample *ls)
 {
-   if(ls->type == LIGHT_POINT || ls->type == LIGHT_SPOT) {
-   float4 data0 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 
0);
-   float4 data1 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 
1);
+   float4 data0 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 0);
+   float4 data1 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 1);
 
+   LightType type = (LightType)__float_as_int(data0.x);
+
+   if(type == LIGHT_DISTANT || type == LIGHT_BACKGROUND) {
+   /* Distant lights, no equi-angular sampling */
+   ls->t = FLT_MAX;
+   }
+   else {
+   /* calculate ls->P for equi-angular sampling */
ls->P = make_float3(data0.y, data0.z, data0.w);
 
-   float radius = data1.y;
+   if(type == LIGHT_POINT || type == LIGHT_SPOT) {
+   float radius = data1.y;
 
-   if(radius > 0.0f)
+   if(radius > 0.0f)
/* sphere light */
-   ls->P += sphere_light_sample(P, ls->P, radius, randu, 
randv);
-
-   ls->D = normalize_len(ls->P - P, &ls->t);
-   ls->Ng = -ls->D;
-
-   float invarea = data1.z;
-   ls->pdf = invarea;
-
-   if(ls->type == LIGHT_SPOT) {
-   /* spot light attenuation */
-   float4 data2 = kernel_tex_fetch(__light_data, 
lamp*LIGHT_SIZE + 2);
-   ls->eval_fac = 
(0.25f*M_1_PI_F)*invarea*kernel_data.integrator.inv_pdf_lights;
-   ls->eval_fac *= spot_light_attenuation(data1, data2, 
ls);
+   ls->P += sphere_light_sample(P, ls->P, radius, 
randu, randv);
}
-   }
-   else if(ls->type == LIGHT_AREA) {
+   else {
+   /* area light */
float4 data2 = kernel_tex_fetch(__light_data, 
lamp*LIGHT_SIZE + 2);
-   ls->pdf = data2.x;
 
-   ls->D = normalize_len(ls->P - P, &ls->t);
-   }
-   else {
-   /* Distant Lights */
-   return;
-   }
+   float3 axisu = make_float3(data1.y, data1.z, data1.w);
+   float3 axisv = make_float3(data2.y, data2.z, data2.w);
 
-   ls->pdf *= lamp_light_pdf(kg, ls->Ng, -ls->D, ls->t);
+   ls->P += area_light_sample(axisu, axisv, randu, randv);
+   }
+   }
 }
 
 ccl_device void lamp_light_sample(KernelGlobals *kg, int lamp,
@@ -554,8 +547,7 @@ ccl_device int light_distribution_sample(KernelGlobals *kg, 
float randt)
return clamp(first-1, 0, kernel_data.integrator.num_distribution-1);
 }
 
-/* ToDo: Better function name */
-ccl_device void light_sample_new_position(KernelGlobals *kg, float randt, 
float randu, float randv, float time, float3 P, LightSample *ls)
+ccl_device void light_sample_position(KernelGlobals *kg, float randt, float 
randu, float randv, float time, float3 P, LightSample *ls)
 {
/* sample index */
int index = light_distribution_sample(kg, randt);
@@ -565,13 +557,12 @@ ccl_device void light_sample_new_position(KernelGlobals 
*kg, float randt, float
int prim = __float_as_int(l.y);
 
if(prim >= 0) {
-   /* compute incoming direction, distance and pdf */
-   ls->D = normalize_len(ls->P - P, &ls->t);
-   ls->pdf = triangle_light_pdf(kg, ls->Ng, -ls->D, ls->t);
+   /* compute distance, although this probably never becomes 
FLT_MAX */
+   ls->t = len(ls->P - P);
}
else {
int lamp = -prim-

[Bf-blender-cvs] [0b064ce] pie-menus: Only modify outline of selected pie items.

2014-07-29 Thread Antony Riakiotakis
Commit: 0b064ce2d48c2c829cb8050ff7017f08a7987034
Author: Antony Riakiotakis
Date:   Tue Jul 29 17:50:21 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB0b064ce2d48c2c829cb8050ff7017f08a7987034

Only modify outline of selected pie items.

===

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

===

diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index 71bc9e2..eb081ab 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -1926,7 +1926,7 @@ static void widget_state_pie_menu_item(uiWidgetType *wt, 
int state)
}
/* regular active */
else if (state & UI_SELECT) {
-   copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
+   copy_v4_v4_char(wt->wcol.outline, wt->wcol.inner_sel);
copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
}
else if (state & UI_ACTIVE) {

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


[Bf-blender-cvs] [da844af] pie-menus: Proper fix for previous fix (tm)

2014-07-29 Thread Antony Riakiotakis
Commit: da844af3a0219ba21fc8be019f074268883a96cf
Author: Antony Riakiotakis
Date:   Tue Jul 29 17:42:07 2014 +0200
Branches: pie-menus
https://developer.blender.org/rBda844af3a0219ba21fc8be019f074268883a96cf

Proper fix for previous fix (tm)

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/interface/interface_handlers.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 71bc776..92f3be6 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1447,7 +1447,7 @@ class VIEW3D_PIE_manipulator(Menu):
 
 pie = layout.menu_pie()
 pie.prop(context.space_data, "transform_manipulators", expand=True)
-pie.operator("wm.context_toggle", icon='MANIPUL', 
text="Toggle").data_path = "space_data.show_manipulator"
+pie.prop(context.space_data, "show_manipulator")
 
 
 
diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 2f2a9cc..7d493cb 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8548,7 +8548,7 @@ static int ui_pie_menu_apply(bContext *C, 
uiPopupBlockHandle *menu, uiBut *but,
}
else {
ui_apply_button(C, but->block, but, but->active, false);
-   button_activate_exit((bContext *)C, but, but->active, 
false, false);
+   button_activate_exit((bContext *)C, but, but->active, 
false, true);
 
if (!(click_style || force_close)) {
but->block->pie_data.flags |= UI_PIE_FINISHED;

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


[Bf-blender-cvs] [4a17f1b] pie-menus: Manipulator property toggle did not work. Add toggle operator instead

2014-07-29 Thread Antony Riakiotakis
Commit: 4a17f1bd6290c9d1a1ce7f9fe96a2c2d9a611bf6
Author: Antony Riakiotakis
Date:   Tue Jul 29 16:19:49 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB4a17f1bd6290c9d1a1ce7f9fe96a2c2d9a611bf6

Manipulator property toggle did not work. Add toggle operator instead

===

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

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 87d5fd0..71bc776 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1447,7 +1447,8 @@ class VIEW3D_PIE_manipulator(Menu):
 
 pie = layout.menu_pie()
 pie.prop(context.space_data, "transform_manipulators", expand=True)
-pie.prop(context.space_data, "show_manipulator")
+pie.operator("wm.context_toggle", icon='MANIPUL', 
text="Toggle").data_path = "space_data.show_manipulator"
+
 
 
 class VIEW3D_PIE_pivot(Menu):

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


[Bf-blender-cvs] [77129b3] hair_system: Bending forces and damping for hair.

2014-07-29 Thread Lukas Tönne
Commit: 77129b399d21fdd0376efbb0daaf22dbc2abfd90
Author: Lukas Tönne
Date:   Tue Jul 29 15:44:29 2014 +0200
Branches: hair_system
https://developer.blender.org/rB77129b399d21fdd0376efbb0daaf22dbc2abfd90

Bending forces and damping for hair.

This adds some stiffness to hairs along bends, such that the hair does
no longer behave like a chain of freely rotating segments.

Note that there is no bending force on the root segment yet, which means
the hair swivels around the root point without resistance.

===

M   release/scripts/startup/bl_ui/properties_data_modifier.py
M   source/blender/hair/intern/HAIR_solver.cpp
M   source/blender/hair/intern/HAIR_solver.h
M   source/blender/makesdna/DNA_hair_types.h
M   source/blender/makesrna/intern/rna_hair.c

===

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py 
b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 9d6ebae..2f1fca4 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1235,8 +1235,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 row = col.row()
 col2 = row.column()
 col2.prop(params, "stretch_stiffness")
+col2.prop(params, "bend_stiffness")
 col2 = row.column()
 col2.prop(params, "stretch_damping")
+col2.prop(params, "bend_damping")
 
 col.separator()
 
diff --git a/source/blender/hair/intern/HAIR_solver.cpp 
b/source/blender/hair/intern/HAIR_solver.cpp
index be2c38c..433fecd 100644
--- a/source/blender/hair/intern/HAIR_solver.cpp
+++ b/source/blender/hair/intern/HAIR_solver.cpp
@@ -64,9 +64,8 @@ SolverData::~SolverData()
 
 static float3 calc_bend(const Frame &frame, const float3 &co0, const float3 
&co1)
 {
-   float3 dir;
-   normalize_v3_v3(dir, co1 - co0);
-   return float3(dot_v3_v3(dir, frame.normal), dot_v3_v3(dir, 
frame.tangent), dot_v3_v3(dir, frame.cotangent));
+   float3 edge = co1 - co0;
+   return float3(dot_v3_v3(edge, frame.normal), dot_v3_v3(edge, 
frame.tangent), dot_v3_v3(edge, frame.cotangent));
 }
 
 void SolverData::precompute_rest_bend()
@@ -150,7 +149,7 @@ float3 Solver::calc_velocity(Curve *curve, Point *point, 
float time, Point::Stat
return state.vel;
 }
 
-float3 Solver::calc_stretch(Curve *curve, Point *point0, Point *point1, float 
time) const
+float3 Solver::calc_stretch_force(Curve *curve, Point *point0, Point *point1, 
float time) const
 {
/* XXX this could be cached in SolverData */
float3 dir;
@@ -164,14 +163,34 @@ float3 Solver::calc_stretch(Curve *curve, Point *point0, 
Point *point1, float ti
return stretch_force + stretch_damp;
 }
 
-float3 Solver::calc_acceleration(Curve *curve, Point *point, float time, 
float3 prev_stretch, float3 stretch, Point::State &state) const
+#if 0
+float3 Solver::calc_bend_force(Curve *curve, const Frame &frame, Point 
*point0, Point *point1, float time) const
+{
+   float3 bend = calc_bend(frame, point0->cur.co, point1->cur.co);
+   
+   
+}
+#endif
+
+float3 Solver::calc_bend_force(Curve *curve, Point *point0, Point *point1, 
float time) const
+{
+   float3 dir;
+   float3 edge = point1->cur.co - point0->cur.co;
+   normalize_v3_v3(dir, edge);
+   float3 dvel = point1->cur.vel - point0->cur.vel;
+   
+   float3 bend_force = m_params.bend_stiffness * (edge - 
point0->rest_bend);
+   float3 bend_damp = m_params.bend_damping * (dvel - dot_v3_v3(dvel, dir) 
* dir);
+   
+   return bend_force + bend_damp;
+}
+
+float3 Solver::calc_acceleration(Curve *curve, Point *point, float time, 
Point::State &state) const
 {
float3 acc = float3(0.0f, 0.0f, 0.0f);

acc = acc + m_forces.gravity;

-   acc = acc - prev_stretch + stretch;
-   
return acc;
 }
 
@@ -187,7 +206,7 @@ void Solver::step(float timestep)

for (i = 0, curve = m_data->curves; i < totcurve; ++i, ++curve) {
int numpoints = curve->totpoints;
-   float3 prev_stretch;
+   float3 stretch, prev_stretch, bend, prev_bend;

/* Root point animation */
k = 0;
@@ -197,20 +216,37 @@ void Solver::step(float timestep)
point->next.co = point->cur.co;
point->next.vel = float3(0.0f, 0.0f, 0.0f);

-   float3 stretch = k < numpoints-1 ? calc_stretch(curve, point, 
point+1, time) : float3(0.0f, 0.0f, 0.0f);
+   if (k < numpoints-1) {
+   stretch = calc_stretch_force(curve, point, point+1, 
time);
+   bend = calc_bend_force(curve, point, point+1, time);
+   }
+   else {
+   stretch = float3(0.0f, 0.0

[Bf-blender-cvs] [c0dd8ae] hair_system: Removed the unused is_dynamic property from solver points.

2014-07-29 Thread Lukas Tönne
Commit: c0dd8aecb686d0311808192e74d9b467f3c53c7b
Author: Lukas Tönne
Date:   Tue Jul 29 13:47:14 2014 +0200
Branches: hair_system
https://developer.blender.org/rBc0dd8aecb686d0311808192e74d9b467f3c53c7b

Removed the unused is_dynamic property from solver points.

For the solver data it is quite important to keep the data structs
small, much more than in the DNA data.

===

M   source/blender/hair/HAIR_capi.cpp
M   source/blender/hair/intern/HAIR_curve.cpp
M   source/blender/hair/intern/HAIR_curve.h

===

diff --git a/source/blender/hair/HAIR_capi.cpp 
b/source/blender/hair/HAIR_capi.cpp
index 3c88835..438eb02 100644
--- a/source/blender/hair/HAIR_capi.cpp
+++ b/source/blender/hair/HAIR_capi.cpp
@@ -84,9 +84,8 @@ void HAIR_solver_init(struct HAIR_Solver *csolver, Scene 
*scene, Object *ob, Hai

for (int k = 0; k < hair->totpoints; ++k, ++point) {
HairPoint *hair_pt = hair->points + k;
-   bool is_root = (k == 0);

-   *point = Point(transform_point(mat, hair_pt->rest_co), 
!is_root);
+   *point = Point(transform_point(mat, hair_pt->rest_co));
point->cur.co = transform_point(mat, hair_pt->co);
point->cur.vel = transform_direction(mat, hair_pt->vel);
}
diff --git a/source/blender/hair/intern/HAIR_curve.cpp 
b/source/blender/hair/intern/HAIR_curve.cpp
index 3d26ee5..3be4db3 100644
--- a/source/blender/hair/intern/HAIR_curve.cpp
+++ b/source/blender/hair/intern/HAIR_curve.cpp
@@ -32,9 +32,8 @@ Point::Point()
 {
 }
 
-Point::Point(const float3 &rest_co, bool is_dynamic) :
-rest_co(rest_co),
-is_dynamic(is_dynamic)
+Point::Point(const float3 &rest_co) :
+rest_co(rest_co)
 {
cur.co = rest_co;
cur.vel = float3(0.0f, 0.0f, 0.0f);
diff --git a/source/blender/hair/intern/HAIR_curve.h 
b/source/blender/hair/intern/HAIR_curve.h
index b2c1617..f5d4850 100644
--- a/source/blender/hair/intern/HAIR_curve.h
+++ b/source/blender/hair/intern/HAIR_curve.h
@@ -40,13 +40,12 @@ struct Point {
};

Point();
-   Point(const float3 &rest_co, bool is_dynamic=true);
+   Point(const float3 &rest_co);

State cur;
State next;

float3 rest_co;
-   bool is_dynamic;

HAIR_CXX_CLASS_ALLOC(Point)
 };

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


[Bf-blender-cvs] [1d6ba6f] hair_system: Precomputation of rest "bend" vectors in the solver data.

2014-07-29 Thread Lukas Tönne
Commit: 1d6ba6fa4b0f55e99cd2bdd383fd44212f81bf47
Author: Lukas Tönne
Date:   Tue Jul 29 14:27:59 2014 +0200
Branches: hair_system
https://developer.blender.org/rB1d6ba6fa4b0f55e99cd2bdd383fd44212f81bf47

Precomputation of rest "bend" vectors in the solver data.

These vectors determine the bending amount of the hair, by giving a
fixed reference from the rest position. The same calculation is done
for the state vectors in every step, but the precomputation saves
roughly half of the cost by avoiding a useless loop over the rest data.

===

M   source/blender/hair/HAIR_capi.cpp
M   source/blender/hair/intern/HAIR_curve.h
M   source/blender/hair/intern/HAIR_solver.cpp
M   source/blender/hair/intern/HAIR_solver.h

===

diff --git a/source/blender/hair/HAIR_capi.cpp 
b/source/blender/hair/HAIR_capi.cpp
index 438eb02..a30ee0e 100644
--- a/source/blender/hair/HAIR_capi.cpp
+++ b/source/blender/hair/HAIR_capi.cpp
@@ -90,6 +90,9 @@ void HAIR_solver_init(struct HAIR_Solver *csolver, Scene 
*scene, Object *ob, Hai
point->cur.vel = transform_direction(mat, hair_pt->vel);
}
}
+   
+   /* finalize */
+   solver->prepare_data();
 }
 
 void HAIR_solver_step(struct HAIR_Solver *csolver, float timestep)
diff --git a/source/blender/hair/intern/HAIR_curve.h 
b/source/blender/hair/intern/HAIR_curve.h
index f5d4850..c267759 100644
--- a/source/blender/hair/intern/HAIR_curve.h
+++ b/source/blender/hair/intern/HAIR_curve.h
@@ -46,6 +46,7 @@ struct Point {
State next;

float3 rest_co;
+   float3 rest_bend;

HAIR_CXX_CLASS_ALLOC(Point)
 };
diff --git a/source/blender/hair/intern/HAIR_solver.cpp 
b/source/blender/hair/intern/HAIR_solver.cpp
index 539204c..be2c38c 100644
--- a/source/blender/hair/intern/HAIR_solver.cpp
+++ b/source/blender/hair/intern/HAIR_solver.cpp
@@ -25,6 +25,7 @@
  */
 
 #include "HAIR_math.h"
+#include "HAIR_smoothing.h"
 #include "HAIR_solver.h"
 
 HAIR_NAMESPACE_BEGIN
@@ -61,6 +62,47 @@ SolverData::~SolverData()
delete[] points;
 }
 
+static float3 calc_bend(const Frame &frame, const float3 &co0, const float3 
&co1)
+{
+   float3 dir;
+   normalize_v3_v3(dir, co1 - co0);
+   return float3(dot_v3_v3(dir, frame.normal), dot_v3_v3(dir, 
frame.tangent), dot_v3_v3(dir, frame.cotangent));
+}
+
+void SolverData::precompute_rest_bend()
+{
+   Curve *curve;
+   int i;
+   
+   for (curve = curves, i = 0; i < totcurves; ++curve, ++i) {
+   Point *pt0, *pt1;
+   
+   if (curve->totpoints >= 2) {
+   pt0 = &curve->points[0];
+   pt1 = &curve->points[1];
+   }
+   else if (curve->totpoints >= 1) {
+   pt0 = pt1 = &curve->points[0];
+   }
+   else
+   continue;
+   
+   FrameIterator iter(1.0f / curve->totpoints, 0.1f, 
curve->totpoints, pt0->rest_co, pt1->rest_co);
+   
+   pt0->rest_bend = calc_bend(iter.frame(), pt0->rest_co, 
pt1->rest_co);
+   
+   Point *pt = pt1;
+   while (iter.valid()) {
+   Point *next_pt = &curve->points[iter.cur()];
+   
+   pt->rest_bend = calc_bend(iter.frame(), pt->rest_co, 
next_pt->rest_co);
+   
+   iter.next(next_pt->rest_co);
+   pt = next_pt;
+   }
+   }
+}
+
 
 SolverForces::SolverForces()
 {
@@ -87,6 +129,14 @@ void Solver::init_data(int totcurves, int totpoints)
}
 }
 
+void Solver::prepare_data()
+{
+   if (!m_data)
+   return;
+   
+   m_data->precompute_rest_bend();
+}
+
 void Solver::free_data()
 {
if (m_data) {
diff --git a/source/blender/hair/intern/HAIR_solver.h 
b/source/blender/hair/intern/HAIR_solver.h
index 09798e2..940d661 100644
--- a/source/blender/hair/intern/HAIR_solver.h
+++ b/source/blender/hair/intern/HAIR_solver.h
@@ -47,6 +47,8 @@ struct SolverData {
int totcurves;
int totpoints;

+   void precompute_rest_bend();
+   
HAIR_CXX_CLASS_ALLOC(SolverData)
 };
 
@@ -67,6 +69,7 @@ public:
SolverForces &forces() { return m_forces; }

void init_data(int totcurves, int totpoints);
+   void prepare_data();
void free_data();
SolverData *data() const { return m_data; }

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


[Bf-blender-cvs] [c556ce9] hair_system: Transform3 type for pure rotational matrices.

2014-07-29 Thread Lukas Tönne
Commit: c556ce9a5d7590fdd469d84d69d8bfaeb18bfcca
Author: Lukas Tönne
Date:   Tue Jul 29 13:45:32 2014 +0200
Branches: hair_system
https://developer.blender.org/rBc556ce9a5d7590fdd469d84d69d8bfaeb18bfcca

Transform3 type for pure rotational matrices.

===

M   source/blender/hair/intern/HAIR_types.cpp
M   source/blender/hair/intern/HAIR_types.h

===

diff --git a/source/blender/hair/intern/HAIR_types.cpp 
b/source/blender/hair/intern/HAIR_types.cpp
index 4ade06c..4066dc4 100644
--- a/source/blender/hair/intern/HAIR_types.cpp
+++ b/source/blender/hair/intern/HAIR_types.cpp
@@ -33,4 +33,8 @@ const Transform Transform::Identity = Transform(float4(1.0f, 
0.0f, 0.0f, 0.0f),
 float4(0.0f, 0.0f, 1.0f, 0.0f),
 float4(0.0f, 0.0f, 0.0f, 
1.0f));
 
+const Transform3 Transform3::Identity = Transform3(float3(1.0f, 0.0f, 0.0f),
+   float3(0.0f, 1.0f, 0.0f),
+   float3(0.0f, 0.0f, 1.0f));
+
 HAIR_NAMESPACE_END
diff --git a/source/blender/hair/intern/HAIR_types.h 
b/source/blender/hair/intern/HAIR_types.h
index ad24476..7699cce 100644
--- a/source/blender/hair/intern/HAIR_types.h
+++ b/source/blender/hair/intern/HAIR_types.h
@@ -102,7 +102,7 @@ struct float4 {
 };
 
 
-typedef struct Transform {
+struct Transform {
float4 x, y, z, w; /* rows */

static const Transform Identity;
@@ -149,7 +149,27 @@ typedef struct Transform {
 
float4_col col(int i) { return float4_col(*this, i); }
float4_col_const col(int i) const { return float4_col_const(*this, i); }
-} Transform;
+};
+
+struct Transform3 {
+   float3 x, y, z; /* rows */
+   
+   static const Transform3 Identity;
+   
+   __forceinline Transform3() {}
+   __forceinline Transform3(const float3 &x, const float3 &y, const float3 
&z) : x(x), y(y), z(z) {}
+   __forceinline Transform3(float data[3][3]) :
+   x(data[0][0], data[1][0], data[2][0]),
+   y(data[0][1], data[1][1], data[2][1]),
+   z(data[0][2], data[1][2], data[2][2])
+   {}
+   
+   __forceinline float3 operator[](int i) const { return *(&x + i); }
+   __forceinline float3& operator[](int i) { return *(&x + i); }
+   
+   float3 row(int i) const { return *(&x + i); }
+   float3 &row(int i) { return *(&x + i); }
+};
 
 /* -- */

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


[Bf-blender-cvs] [65df278] pie-menus: Proper fix of tooltips not exiting

2014-07-29 Thread Antony Riakiotakis
Commit: 65df2781fd2621979199f1e0c42d9b8955522e50
Author: Antony Riakiotakis
Date:   Tue Jul 29 15:46:41 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB65df2781fd2621979199f1e0c42d9b8955522e50

Proper fix of tooltips not exiting

===

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

===

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 400c81d..2f2a9cc 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -6659,7 +6659,7 @@ static uiBut *ui_but_find_mouse_over_ex(ARegion *ar, 
const int x, const int y, c
 
for (but = block->buttons.last; but; but = but->prev) {
if (ui_is_but_interactive(but, labeledit)) {
-   if (but->dt == UI_EMBOSSR) {
+   if (but->pie_dir != UI_RADIAL_NONE) {
if (ui_but_isect_pie_seg(block, but)) {
butover = but;
break;
@@ -8548,7 +8548,7 @@ static int ui_pie_menu_apply(bContext *C, 
uiPopupBlockHandle *menu, uiBut *but,
}
else {
ui_apply_button(C, but->block, but, but->active, false);
-   button_activate_exit((bContext *)C, but, but->active, 
false, true);
+   button_activate_exit((bContext *)C, but, but->active, 
false, false);
 
if (!(click_style || force_close)) {
but->block->pie_data.flags |= UI_PIE_FINISHED;
@@ -8731,6 +8731,12 @@ static int ui_handler_pie(bContext *C, const wmEvent 
*event, uiPopupBlockHandle
{
for (but = block->buttons.first; but; 
but = but->next) {
if (but->menu_key == 
event->type) {
+   uiBut *active_but = 
ui_but_find_activated(menu->region);
+
+   if (active_but)
+   
button_activate_exit(C, active_but, active_but->active, false, false);
+
+   
button_activate_init((bContext *)C, ar, but, BUTTON_ACTIVATE_OVER);
retval = 
ui_pie_menu_apply(C, menu, but, event, false, is_click_style);
break;
}

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


[Bf-blender-cvs] [42ba931] master: Fix T41223: F-Curve sliders won't update values during playback when mouse cursor is outside the left panel.

2014-07-29 Thread Bastien Montagne
Commit: 42ba931fedf7e994781d80ad919e0b02aec9019f
Author: Bastien Montagne
Date:   Tue Jul 29 15:31:53 2014 +0200
Branches: master
https://developer.blender.org/rB42ba931fedf7e994781d80ad919e0b02aec9019f

Fix T41223: F-Curve sliders won't update values during playback when mouse 
cursor is outside the left panel.

===

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

===

diff --git a/source/blender/editors/screen/screen_ops.c 
b/source/blender/editors/screen/screen_ops.c
index 7d22990..7c7574b 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3220,6 +3220,16 @@ static int match_region_with_redraws(int spacetype, int 
regiontype, int redraws)

}
}
+   else if (regiontype == RGN_TYPE_CHANNELS) {
+   switch (spacetype) {
+   case SPACE_IPO:
+   case SPACE_ACTION:
+   case SPACE_NLA:
+   if (redraws & TIME_ALL_ANIM_WIN)
+   return 1;
+   break;
+   }
+   }
else if (regiontype == RGN_TYPE_UI) {
if (spacetype == SPACE_CLIP) {
/* Track Preview button is on Properties Editor in 
SpaceClip,

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


[Bf-blender-cvs] [ea3a11f] pie-menus: Fix tooltip sticking to button

2014-07-29 Thread Antony Riakiotakis
Commit: ea3a11fa694739cdfdb2f792554ab9a396c236d1
Author: Antony Riakiotakis
Date:   Tue Jul 29 15:13:02 2014 +0200
Branches: pie-menus
https://developer.blender.org/rBea3a11fa694739cdfdb2f792554ab9a396c236d1

Fix tooltip sticking to button

===

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

===

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 4b517df..400c81d 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8731,7 +8731,6 @@ static int ui_handler_pie(bContext *C, const wmEvent 
*event, uiPopupBlockHandle
{
for (but = block->buttons.first; but; 
but = but->next) {
if (but->menu_key == 
event->type) {
-   
button_activate_init((bContext *)C, ar, but, BUTTON_STATE_HIGHLIGHT);
retval = 
ui_pie_menu_apply(C, menu, but, event, false, is_click_style);
break;
}

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


[Bf-blender-cvs] [ab409e6] pie-menus: Pies:

2014-07-29 Thread Antony Riakiotakis
Commit: ab409e645d1d1bb79572fb071575ee8369831969
Author: Antony Riakiotakis
Date:   Tue Jul 29 15:08:17 2014 +0200
Branches: pie-menus
https://developer.blender.org/rBab409e645d1d1bb79572fb071575ee8369831969

Pies:

* Fix issue with repositioned pie menus
* Reduce default animation time

===

M   source/blender/editors/interface/interface_handlers.c
M   source/blender/editors/interface/interface_intern.h
M   source/blender/editors/interface/resources.c

===

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index b505701..4b517df 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8663,7 +8663,11 @@ static int ui_handler_pie(bContext *C, const wmEvent 
*event, uiPopupBlockHandle
ED_region_tag_redraw(ar);
}
else {
-   if (block->pie_data.flags & UI_PIE_INVALID_DIR) {
+   /* calculate distance from initial poit */
+   float seg[2] = {(float)mx, (float)my};
+   sub_v2_v2(seg, block->pie_data.pie_center_init);
+
+   if (len_squared_v2(seg) < PIE_CLICK_THRESHOLD) {
block->pie_data.flags |= UI_PIE_CLICK_STYLE;
}
else if (!is_click_style) {
diff --git a/source/blender/editors/interface/interface_intern.h 
b/source/blender/editors/interface/interface_intern.h
index f0e3b4c..f6c2e60 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -167,6 +167,8 @@ typedef enum RadialDirection {
 #define UI_PIE_CLICK_STYLE (1 << 5) /* pie menu changed to click 
style, click to confirm  */
 #define UI_PIE_ANIMATION_FINISHED  (1 << 6) /* pie animation finished, do not 
calculate any more motio  */
 
+#define PIE_CLICK_THRESHOLD 50.0
+
 typedef struct uiLinkLine {  /* only for draw/edit */
struct uiLinkLine *next, *prev;
struct uiBut *from, *to;
diff --git a/source/blender/editors/interface/resources.c 
b/source/blender/editors/interface/resources.c
index 3b4782e..c24ecdb 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -2480,7 +2480,7 @@ void init_userdef_do_versions(void)
U.pie_operator_timeout = 20;
 
if (U.pie_animation_timeout == 0)
-   U.pie_animation_timeout = 12;
+   U.pie_animation_timeout = 6;
 
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
btheme->tui.wcol_pie_menu = wcol_pie_menu;

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


[Bf-blender-cvs] [9765265] master: Fix T41228: Selection of bones bug.

2014-07-29 Thread Bastien Montagne
Commit: 976526559d2690dfeda19acc6b82c6767f21d2eb
Author: Bastien Montagne
Date:   Tue Jul 29 15:02:28 2014 +0200
Branches: master
https://developer.blender.org/rB976526559d2690dfeda19acc6b82c6767f21d2eb

Fix T41228: Selection of bones bug.

Turns out to be mostly some cleanup in Pose select code, got rid of magic 
numbers
(now understand usual SEL_xxx enums) in ED_pose_deselectall(), which was renamed
to ED_pose_de_selectall, and have a new bool parameter to ignore visibility 
status
in its process (was the root of the reported issue).

Also factorized slightly "(de)select all" code. Yet this area could use much 
more
cleanup probably...

===

M   source/blender/editors/animation/anim_channels_edit.c
M   source/blender/editors/armature/pose_select.c
M   source/blender/editors/include/ED_armature.h

===

diff --git a/source/blender/editors/animation/anim_channels_edit.c 
b/source/blender/editors/animation/anim_channels_edit.c
index f578a57..9707804 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -2802,7 +2802,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext 
*ac, int channel_index,

/* deselect all other channels */
ANIM_deselect_anim_channels(ac, ac->data, 
ac->datatype, false, ACHANNEL_SETFLAG_CLEAR);
-   if (pchan) ED_pose_deselectall(ob, 0);
+   if (pchan) ED_pose_de_selectall(ob, 
SEL_DESELECT, false);

/* only select channels in group and group 
itself */
for (fcu = agrp->channels.first; fcu && 
fcu->grp == agrp; fcu = fcu->next)
@@ -2812,7 +2812,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext 
*ac, int channel_index,
else {
/* select group by itself */
ANIM_deselect_anim_channels(ac, ac->data, 
ac->datatype, false, ACHANNEL_SETFLAG_CLEAR);
-   if (pchan) ED_pose_deselectall(ob, 0);
+   if (pchan) ED_pose_de_selectall(ob, 
SEL_DESELECT, false);

agrp->flag |= AGRP_SELECTED;
}
diff --git a/source/blender/editors/armature/pose_select.c 
b/source/blender/editors/armature/pose_select.c
index 5822974..6138661 100644
--- a/source/blender/editors/armature/pose_select.c
+++ b/source/blender/editors/armature/pose_select.c
@@ -69,6 +69,28 @@
 
 /* * Pose Select Utilities * */
 
+/* Note: SEL_TOGGLE is assumed to have already been handled! */
+static void pose_do_bone_select(bPoseChannel *pchan, const int select_mode) {
+   /* select pchan only if selectable, but deselect works always */
+   switch (select_mode) {
+   case SEL_SELECT:
+   if (!(pchan->bone->flag & BONE_UNSELECTABLE))
+   pchan->bone->flag |= BONE_SELECTED;
+   break;
+   case SEL_DESELECT:
+   pchan->bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | 
BONE_ROOTSEL);
+   break;
+   case SEL_INVERT:
+   if (pchan->bone->flag & BONE_SELECTED) {
+   pchan->bone->flag &= ~(BONE_SELECTED | 
BONE_TIPSEL | BONE_ROOTSEL);
+   }
+   else if (!(pchan->bone->flag & BONE_UNSELECTABLE)) {
+   pchan->bone->flag |= BONE_SELECTED;
+   }
+   break;
+   }
+}
+
 /* Utility method for changing the selection status of a bone */
 void ED_pose_bone_select(Object *ob, bPoseChannel *pchan, bool select)
 {
@@ -139,7 +161,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, 
unsigned int *buffer, shor
}
 
if (!extend && !deselect && !toggle) {
-   ED_pose_deselectall(ob, 0);
+   ED_pose_de_selectall(ob, SEL_DESELECT, true);
nearBone->flag |= (BONE_SELECTED | BONE_TIPSEL | 
BONE_ROOTSEL);
arm->act_bone = nearBone;
}
@@ -191,16 +213,12 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, 
unsigned int *buffer, shor
return nearBone != NULL;
 }
 
-/* test==0: deselect all
- * test==1: swap select (apply to all the opposite of current situation) 
- * test==2: only clear active tag
- * test==3: swap select (no test / inverse selection status of all 
independently)
- */
-void ED_pose_deselectall(Object *ob, int test)
+/* 'select_mode' is usual SEL_SELECT/SEL_DESELECT/SEL_TOGGLE

[Bf-blender-cvs] [bc11096] pie-menus: Change to pie iinteraction:

2014-07-29 Thread Antony Riakiotakis
Commit: bc11096db4a9da1c7e24a7cd7c1bb6c6cc768e6a
Author: Antony Riakiotakis
Date:   Tue Jul 29 14:35:34 2014 +0200
Branches: pie-menus
https://developer.blender.org/rBbc11096db4a9da1c7e24a7cd7c1bb6c6cc768e6a

Change to pie iinteraction:

After discussion with Campbell use combination of drag/click style
interaction and ommit option:

If initial button is released while the menu is still within the
threshold then switch to click style. If not then do regular selection.

===

M   release/scripts/startup/bl_ui/space_userpref.py
M   source/blender/editors/interface/interface_handlers.c
M   source/blender/makesdna/DNA_userdef_types.h
M   source/blender/makesrna/intern/rna_userdef.c

===

diff --git a/release/scripts/startup/bl_ui/space_userpref.py 
b/release/scripts/startup/bl_ui/space_userpref.py
index 979e5d02..98f391c 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -219,7 +219,6 @@ class USERPREF_PT_interface(Panel):
 col.separator()
 col.label(text="Pie Menus:")
 sub = col.column(align=True)
-sub.prop(view, "pie_interaction_type", text="")
 sub.prop(view, "pie_operator_timeout")
 sub.prop(view, "pie_animation_timeout")
 sub.prop(view, "pie_initial_timeout")
diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index b998fdb..b505701 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8509,7 +8509,7 @@ static int ui_handle_menu_return_submenu(bContext *C, 
const wmEvent *event, uiPo
if (menu->menuretval) {
/* pie menus should not close but wait for release instead */
if ((block->flag & UI_BLOCK_RADIAL) &&
-   !((block->pie_data.flags & UI_PIE_CLICK_STYLE) || 
U.pie_interaction_type == USER_UI_PIE_CLICK))
+   !(block->pie_data.flags & UI_PIE_CLICK_STYLE))
{
menu->menuretval = 0;
block->pie_data.flags |= UI_PIE_FINISHED;
@@ -8587,7 +8587,7 @@ static int ui_handler_pie(bContext *C, const wmEvent 
*event, uiPopupBlockHandle
ar = menu->region;
block = ar->uiblocks.first;
 
-   is_click_style = (U.pie_interaction_type == USER_UI_PIE_CLICK) || 
(block->pie_data.flags & UI_PIE_CLICK_STYLE);
+   is_click_style = (block->pie_data.flags & UI_PIE_CLICK_STYLE);
 
if (menu->scrolltimer == NULL) {
menu->scrolltimer =
@@ -8663,7 +8663,10 @@ static int ui_handler_pie(bContext *C, const wmEvent 
*event, uiPopupBlockHandle
ED_region_tag_redraw(ar);
}
else {
-   if (!is_click_style) {
+   if (block->pie_data.flags & UI_PIE_INVALID_DIR) {
+   block->pie_data.flags |= UI_PIE_CLICK_STYLE;
+   }
+   else if (!is_click_style) {
uiBut *but = 
ui_but_find_activated(menu->region);
 
retval = ui_pie_menu_apply(C, menu, but, event, 
true, is_click_style);
diff --git a/source/blender/makesdna/DNA_userdef_types.h 
b/source/blender/makesdna/DNA_userdef_types.h
index bfa154d..7ea2770 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -853,10 +853,6 @@ typedef enum eImageDrawMethod {
IMAGE_DRAW_METHOD_DRAWPIXELS = 3,
 } eImageDrawMethod;
 
-typedef enum eUIInteraction {
-   USER_UI_PIE_DRAG = 0,
-   USER_UI_PIE_CLICK = 1
-} eUIInteraction;
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/makesrna/intern/rna_userdef.c 
b/source/blender/makesrna/intern/rna_userdef.c
index 2168a50..f5d459a 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3158,12 +3158,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
 
-   static EnumPropertyItem pie_styles[] = {
-   {USER_UI_PIE_CLICK, "CLICK", 0, "Click", "Press to spawn pie 
menu, click to confirm"},
-   {USER_UI_PIE_DRAG, "DRAG", 0, "Drag", "Press and hold to spawn pie 
menu, release to confirm"},
-   {0, NULL, 0, NULL, NULL}
-   };
-
PropertyRNA *prop;
StructRNA *srna;

@@ -3233,10 +3227,6 @@ static void rna_def_userdef_view(BlenderRNA *brna)
 "Time delay in 1/10 seconds before 
automatically opening sub level menus");
 
/* pie menus */
-   prop = RNA_def_property(srna, "pie_interaction_type", PROP_ENUM, 
PROP_NONE);
-   RNA_def_property_ui_text(prop, "Interaction Type", "Pie menus use

[Bf-blender-cvs] [e0fd1bf] master: Fix T41227: Do not select unselectable items when unhiding them!

2014-07-29 Thread Bastien Montagne
Commit: e0fd1bf4329f41e24ada5b880dd3e98a1dffb17d
Author: Bastien Montagne
Date:   Tue Jul 29 12:58:12 2014 +0200
Branches: master
https://developer.blender.org/rBe0fd1bf4329f41e24ada5b880dd3e98a1dffb17d

Fix T41227: Do not select unselectable items when unhiding them!

===

M   source/blender/editors/armature/armature_edit.c
M   source/blender/editors/armature/pose_edit.c
M   source/blender/editors/object/object_edit.c

===

diff --git a/source/blender/editors/armature/armature_edit.c 
b/source/blender/editors/armature/armature_edit.c
index f71cfd5..1e4d9ba 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -1343,7 +1343,9 @@ static int armature_reveal_exec(bContext *C, wmOperator 
*UNUSED(op))
for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
if (arm->layer & ebone->layer) {
if (ebone->flag & BONE_HIDDEN_A) {
-   ebone->flag |= (BONE_TIPSEL | BONE_SELECTED | 
BONE_ROOTSEL);
+   if (!(ebone->flag & BONE_UNSELECTABLE)) {
+   ebone->flag |= (BONE_TIPSEL | 
BONE_SELECTED | BONE_ROOTSEL);
+   }
ebone->flag &= ~BONE_HIDDEN_A;
}
}
diff --git a/source/blender/editors/armature/pose_edit.c 
b/source/blender/editors/armature/pose_edit.c
index 890bf66..da68108 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -1074,7 +1074,9 @@ static int show_pose_bone_cb(Object *ob, Bone *bone, void 
*UNUSED(ptr))
if (arm->layer & bone->layer) {
if (bone->flag & BONE_HIDDEN_P) {
bone->flag &= ~BONE_HIDDEN_P;
-   bone->flag |= BONE_SELECTED;
+   if (!(bone->flag & BONE_UNSELECTABLE)) {
+   bone->flag |= BONE_SELECTED;
+   }
}
}

diff --git a/source/blender/editors/object/object_edit.c 
b/source/blender/editors/object/object_edit.c
index d416bff..20e31e3 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -139,7 +139,9 @@ static int object_hide_view_clear_exec(bContext *C, 
wmOperator *UNUSED(op))
/* XXX need a context loop to handle such cases */
for (base = FIRSTBASE; base; base = base->next) {
if ((base->lay & v3d->lay) && base->object->restrictflag & 
OB_RESTRICT_VIEW) {
-   base->flag |= SELECT;
+   if (!(base->object->restrictflag & OB_RESTRICT_SELECT)) 
{
+   base->flag |= SELECT;
+   }
base->object->flag = base->flag;
base->object->restrictflag &= ~OB_RESTRICT_VIEW; 
changed = true;

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


[Bf-blender-cvs] [336ca4e] pie-menus: Use UI_DPI_WINDOW_FAC define

2014-07-29 Thread Campbell Barton
Commit: 336ca4e398de3deb3e5dbce97bc0c23bc7e08ad1
Author: Campbell Barton
Date:   Tue Jul 29 21:31:10 2014 +1000
Branches: pie-menus
https://developer.blender.org/rB336ca4e398de3deb3e5dbce97bc0c23bc7e08ad1

Use UI_DPI_WINDOW_FAC define

===

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

===

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 6821f65..b998fdb 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8609,7 +8609,7 @@ static int ui_handler_pie(bContext *C, const wmEvent 
*event, uiPopupBlockHandle
uiBut *but;
double final_time = 0.01 * 
U.pie_animation_timeout;
float fac = duration / final_time;
-   float pie_radius = U.pie_menu_radius * (U.dpi / 
72.0f);
+   float pie_radius = U.pie_menu_radius * 
UI_DPI_WINDOW_FAC;
 
if (fac > 1.0f) {
fac = 1.0f;
diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index ba08839..7f8e001 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -2270,7 +2270,7 @@ static void ui_litem_layout_radial(uiLayout *litem)
 * also the old code at http://developer.blender.org/T5103
 */
 
-   int pie_radius = U.pie_menu_radius * (U.dpi / 72.0f);
+   int pie_radius = U.pie_menu_radius * UI_DPI_WINDOW_FAC;
 
x = litem->x;
y = litem->y;

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


[Bf-blender-cvs] [0ed8058] pie-menus: Pie radius scales correctly with DPI

2014-07-29 Thread Antony Riakiotakis
Commit: 0ed80583472d7d3dbb366e267fafab52f4f6ee11
Author: Antony Riakiotakis
Date:   Tue Jul 29 12:53:22 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB0ed80583472d7d3dbb366e267fafab52f4f6ee11

Pie radius scales correctly with DPI

===

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

===

diff --git a/source/blender/editors/interface/interface_handlers.c 
b/source/blender/editors/interface/interface_handlers.c
index 37cbac5..6821f65 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8609,19 +8609,22 @@ static int ui_handler_pie(bContext *C, const wmEvent 
*event, uiPopupBlockHandle
uiBut *but;
double final_time = 0.01 * 
U.pie_animation_timeout;
float fac = duration / final_time;
+   float pie_radius = U.pie_menu_radius * (U.dpi / 
72.0f);
 
if (fac > 1.0f) {
fac = 1.0f;
block->pie_data.flags |= 
UI_PIE_ANIMATION_FINISHED;
}
 
+   pie_radius *= fac;
+
for (but = block->buttons.first; but; but = 
but->next) {
if (but->pie_dir) {
float dir[2];
 

ui_but_pie_visual_dir(but->pie_dir, dir);
 
-   mul_v2_fl(dir, fac * 
U.pie_menu_radius);
+   mul_v2_fl(dir, pie_radius );
add_v2_v2(dir, 
block->pie_data.pie_center_spawned);
BLI_rctf_recenter(&but->rect, 
dir[0], dir[1]);
}
diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index e42b535..ba08839 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -2270,7 +2270,7 @@ static void ui_litem_layout_radial(uiLayout *litem)
 * also the old code at http://developer.blender.org/T5103
 */
 
-   int pie_radius = U.pie_menu_radius;
+   int pie_radius = U.pie_menu_radius * (U.dpi / 72.0f);
 
x = litem->x;
y = litem->y;

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


[Bf-blender-cvs] [06278f0] pie-menus: Bring back good ole regular menu here so people can use number accelerators as they are used to.

2014-07-29 Thread Antony Riakiotakis
Commit: 06278f03dd3186066572ba77e2f08fb8aeed36a4
Author: Antony Riakiotakis
Date:   Tue Jul 29 12:48:24 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB06278f03dd3186066572ba77e2f08fb8aeed36a4

Bring back good ole regular menu here so people can use number
accelerators as they are used to.

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/mesh/mesh_ops.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 2b337d5..87d5fd0 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2166,10 +2166,9 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu):
 layout = self.layout
 
 layout.operator_context = 'INVOKE_REGION_WIN'
-pie = layout.menu_pie()
-pie.operator("mesh.select_mode", text="Vertex", icon='VERTEXSEL').type 
= 'VERT'
-pie.operator("mesh.select_mode", text="Edge", icon='EDGESEL').type = 
'EDGE'
-pie.operator("mesh.select_mode", text="Face", icon='FACESEL').type = 
'FACE'
+layout.operator("mesh.select_mode", text="Vertex", 
icon='VERTEXSEL').type = 'VERT'
+layout.operator("mesh.select_mode", text="Edge", icon='EDGESEL').type 
= 'EDGE'
+layout.operator("mesh.select_mode", text="Face", icon='FACESEL').type 
= 'FACE'
 
 
 class VIEW3D_MT_edit_mesh_extrude(Menu):
diff --git a/source/blender/editors/mesh/mesh_ops.c 
b/source/blender/editors/mesh/mesh_ops.c
index abf4d88..fbd8522 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -349,7 +349,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, 
KM_SHIFT, 0);

/* selection mode */
-   WM_keymap_add_pie_menu(keymap, "VIEW3D_MT_edit_mesh_select_mode", 
TABKEY, KM_PRESS, KM_CTRL, 0, true);
+   WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_select_mode", TABKEY, 
KM_PRESS, KM_CTRL, 0);

/* hide */
kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0);

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


[Bf-blender-cvs] [737140f] hair_system: Implemented hair frame calculation using parallel transport along curve segments.

2014-07-29 Thread Lukas Tönne
Commit: 737140f4802f13227d04c79cf82859fea755f4c6
Author: Lukas Tönne
Date:   Tue Jul 29 12:37:56 2014 +0200
Branches: hair_system
https://developer.blender.org/rB737140f4802f13227d04c79cf82859fea755f4c6

Implemented hair frame calculation using parallel transport along
curve segments.

This can be done on-the-fly but rotating the root hair frame
incrementally according to each hair segment angle. Note: a similar
approach can be found in the Blender curve code for calculating twist
vectors.

A novel feature of the hair frame calculation is the use of smoothed
hair curves. This prevents artifacts in case of sharp segment angles by
removing small-scale noise from the curve.

===

M   source/blender/editors/space_view3d/drawhair.c
M   source/blender/hair/HAIR_capi.cpp
M   source/blender/hair/HAIR_capi.h
M   source/blender/hair/intern/HAIR_curve.h
M   source/blender/hair/intern/HAIR_math.h
M   source/blender/hair/intern/HAIR_smoothing.h
M   source/blender/hair/intern/HAIR_types.h

===

diff --git a/source/blender/editors/space_view3d/drawhair.c 
b/source/blender/editors/space_view3d/drawhair.c
index b8d0153..a96ede3 100644
--- a/source/blender/editors/space_view3d/drawhair.c
+++ b/source/blender/editors/space_view3d/drawhair.c
@@ -69,6 +69,60 @@ static void draw_hair_curve(HairSystem *hsys, HairCurve 
*hair)
}
glEnd();

+   /* frames */
+   {
+   struct HAIR_FrameIterator *iter;
+   float co[3], nor[3], tan[3], cotan[3];
+   int k = 0;
+   const float scale = 0.1f;
+   
+   glBegin(GL_LINES);
+   iter = HAIR_frame_iter_new(hair, 1.0f / hair->totpoints, 
hsys->smooth, nor, tan, cotan);
+   copy_v3_v3(co, hair->points[0].co);
+   mul_v3_fl(nor, scale);
+   mul_v3_fl(tan, scale);
+   mul_v3_fl(cotan, scale);
+   add_v3_v3(nor, co);
+   add_v3_v3(tan, co);
+   add_v3_v3(cotan, co);
+   ++k;
+   
+   glColor3f(1.0f, 0.0f, 0.0f);
+   glVertex3fv(co);
+   glVertex3fv(nor);
+   glColor3f(0.0f, 1.0f, 0.0f);
+   glVertex3fv(co);
+   glVertex3fv(tan);
+   glColor3f(0.0f, 0.0f, 1.0f);
+   glVertex3fv(co);
+   glVertex3fv(cotan);
+   
+   while (HAIR_frame_iter_valid(hair, iter)) {
+   HAIR_frame_iter_next(hair, iter, nor, tan, cotan);
+   copy_v3_v3(co, hair->points[k].co);
+   mul_v3_fl(nor, scale);
+   mul_v3_fl(tan, scale);
+   mul_v3_fl(cotan, scale);
+   add_v3_v3(nor, co);
+   add_v3_v3(tan, co);
+   add_v3_v3(cotan, co);
+   ++k;
+   
+   glColor3f(1.0f, 0.0f, 0.0f);
+   glVertex3fv(co);
+   glVertex3fv(nor);
+   glColor3f(0.0f, 1.0f, 0.0f);
+   glVertex3fv(co);
+   glVertex3fv(tan);
+   glColor3f(0.0f, 0.0f, 1.0f);
+   glVertex3fv(co);
+   glVertex3fv(cotan);
+   }
+   HAIR_frame_iter_free(iter);
+   glEnd();
+   }
+   
+#if 0
/* smoothed curve */
if (hair->totpoints >= 2) {
struct HAIR_SmoothingIteratorFloat3 *iter;
@@ -102,6 +156,7 @@ static void draw_hair_curve(HairSystem *hsys, HairCurve 
*hair)
glEnd();
glPointSize(1.0f);
}
+#endif
 }
 
 /* called from drawobject.c, return true if nothing was drawn */
diff --git a/source/blender/hair/HAIR_capi.cpp 
b/source/blender/hair/HAIR_capi.cpp
index 5dd8cc2..3c88835 100644
--- a/source/blender/hair/HAIR_capi.cpp
+++ b/source/blender/hair/HAIR_capi.cpp
@@ -179,3 +179,54 @@ void HAIR_smoothing_iter_end(HairCurve *curve, struct 
HAIR_SmoothingIteratorFloa
float3 val = iter->next(co);
copy_v3_v3(cval, val.data());
 }
+
+
+struct HAIR_FrameIterator *HAIR_frame_iter_new(HairCurve *curve, float 
rest_length, float amount, float cnor[3], float ctan[3], float ccotan[3])
+{
+   FrameIterator *iter;
+   float3 co0, co1;
+   
+   if (curve->totpoints >= 2) {
+   co0 = curve->points[0].co;
+   co1 = curve->points[1].co;
+   }
+   else if (curve->totpoints >= 1) {
+   co0 = co1 = curve->points[0].co;
+   }
+   else {
+   static const float3 v(0.0f, 0.0f, 0.0f);
+   co0 = co1 = v;
+   }
+   
+   iter = new FrameIterator(rest_length, amount, curve->totpoints, co0, 
co1);
+   

[Bf-blender-cvs] [931f9fb] opensubdiv-modifier: Merge branch 'master' into opensubdiv-modifier

2014-07-29 Thread Sergey Sharybin
Commit: 931f9fbf0415969a056d9d9ae0bf4c4acea7d141
Author: Sergey Sharybin
Date:   Tue Jul 29 16:41:02 2014 +0600
Branches: opensubdiv-modifier
https://developer.blender.org/rB931f9fbf0415969a056d9d9ae0bf4c4acea7d141

Merge branch 'master' into opensubdiv-modifier

===



===



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


[Bf-blender-cvs] [5fd10b1] pie-menus: Revert "Pie Menus:"

2014-07-29 Thread Antony Riakiotakis
Commit: 5fd10b15a6847b07376f620d11d829c92ab1970a
Author: Antony Riakiotakis
Date:   Tue Jul 29 12:11:23 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB5fd10b15a6847b07376f620d11d829c92ab1970a

Revert "Pie Menus:"

This reverts commit 0d92435a71b8dfe7896a5f28b0ac778fdf383e15.

The reason is that the operator needs greater changes for this to work
correctly, may even better to have a new operator for this operation

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/mesh/editmesh_select.c
M   source/blender/editors/mesh/mesh_ops.c
M   source/blender/editors/space_view3d/view3d_ops.c
M   source/blender/windowmanager/WM_keymap.h
M   source/blender/windowmanager/intern/wm_keymap.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index ca5dc2a..2b337d5 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2167,7 +2167,10 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu):
 
 layout.operator_context = 'INVOKE_REGION_WIN'
 pie = layout.menu_pie()
-pie.operator_enum("mesh.select_mode", "type")
+pie.operator("mesh.select_mode", text="Vertex", icon='VERTEXSEL').type 
= 'VERT'
+pie.operator("mesh.select_mode", text="Edge", icon='EDGESEL').type = 
'EDGE'
+pie.operator("mesh.select_mode", text="Face", icon='FACESEL').type = 
'FACE'
+
 
 class VIEW3D_MT_edit_mesh_extrude(Menu):
 bl_label = "Extrude"
diff --git a/source/blender/editors/mesh/editmesh_select.c 
b/source/blender/editors/mesh/editmesh_select.c
index 8c648b1..9cdfb43 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -44,7 +44,6 @@
 #include "BKE_report.h"
 #include "BKE_paint.h"
 #include "BKE_editmesh.h"
-#include "BKE_mesh.h"
 
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
@@ -939,27 +938,6 @@ static int edbm_select_mode_exec(bContext *C, wmOperator 
*op)
const bool use_extend = RNA_boolean_get(op->ptr, "use_extend");
const bool use_expand = RNA_boolean_get(op->ptr, "use_expand");
 
-   if (!is_power_of_2_i(type)) {
-   Scene *scene = CTX_data_scene(C);
-   ToolSettings *ts = scene->toolsettings;
-
-   ts->selectmode = type;
-
-   if (scene->basact) {
-   Object *obact = scene->basact->object;
-   Mesh *me = BKE_mesh_from_object(obact);
-   if (me && me->edit_btmesh && 
me->edit_btmesh->selectmode != type) {
-   me->edit_btmesh->selectmode = type;
-   EDBM_selectmode_set(me->edit_btmesh);
-   WM_event_add_notifier(C, NC_GEOM | ND_SELECT, 
obact->data);
-   WM_main_add_notifier(NC_SCENE | 
ND_TOOLSETTINGS, NULL);
-   return OPERATOR_FINISHED;
-   }
-   }
-
-   return OPERATOR_CANCELLED;
-   }
-
if (EDBM_selectmode_toggle(C, type, action, use_extend, use_expand)) {
return OPERATOR_FINISHED;
}
@@ -985,14 +963,10 @@ void MESH_OT_select_mode(wmOperatorType *ot)
PropertyRNA *prop;
 
static EnumPropertyItem elem_items[] = {
-   {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex 
selection mode"},
-   {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection 
mode"},
-   {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection 
mode"},
-   {SCE_SELECT_VERTEX | SCE_SELECT_FACE, "VERTEX_FACE", ICON_FACESEL, 
"Vertex/Face", "Vertex and Face selection mode"},
-   {SCE_SELECT_VERTEX | SCE_SELECT_EDGE, "VERTEX_EDGE", 
ICON_VERTEXSEL, "Vertex/Edge", "Vertex and Edge selection mode"},
-   {SCE_SELECT_FACE | SCE_SELECT_EDGE, "FACE_EDGE", ICON_EDGESEL, 
"Face/Edge", "Face and Edge selection mode"},
-   {SCE_SELECT_VERTEX | SCE_SELECT_EDGE | SCE_SELECT_FACE, "ALL", 
ICON_FACESEL, "All", "All selection modes"},
-   {0, NULL, 0, NULL, NULL}
+   {SCE_SELECT_VERTEX, "VERT", ICON_VERTEXSEL, "Vertices", ""},
+   {SCE_SELECT_EDGE,   "EDGE", ICON_EDGESEL, "Edges", ""},
+   {SCE_SELECT_FACE,   "FACE", ICON_FACESEL, "Faces", ""},
+   {0, NULL, 0, NULL, NULL},
};
 
static EnumPropertyItem actions_items[] = {
diff --git a/source/blender/editors/mesh/mesh_ops.c 
b/source/blender/editors/mesh/mesh_ops.c
index 657d99c..abf4d88 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -349,7 +349,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "MESH_OT_selec

[Bf-blender-cvs] [946f291] master: Fix T41174: Tangent space required UV map in Cycles

2014-07-29 Thread Sergey Sharybin
Commit: 946f291c46b5f7f481b42de1ecf1186608809fd8
Author: Sergey Sharybin
Date:   Tue Jul 29 16:07:05 2014 +0600
Branches: master
https://developer.blender.org/rB946f291c46b5f7f481b42de1ecf1186608809fd8

Fix T41174: Tangent space required UV map in Cycles

Now Cycles behaves in the same way as BI in terms of using
sphere projection of orco coordinates if there's no UV map
when calculating tangent space.

===

M   intern/cycles/blender/blender_mesh.cpp
M   intern/cycles/util/util_math.h

===

diff --git a/intern/cycles/blender/blender_mesh.cpp 
b/intern/cycles/blender/blender_mesh.cpp
index e7c18c9..c532f07 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -35,14 +35,14 @@ CCL_NAMESPACE_BEGIN
 /* Tangent Space */
 
 struct MikkUserData {
-   MikkUserData(const BL::Mesh mesh_, const BL::MeshTextureFaceLayer 
layer_, int num_faces_)
+   MikkUserData(const BL::Mesh mesh_, BL::MeshTextureFaceLayer *layer_, 
int num_faces_)
: mesh(mesh_), layer(layer_), num_faces(num_faces_)
{
tangent.resize(num_faces*4);
}
 
BL::Mesh mesh;
-   BL::MeshTextureFaceLayer layer;
+   BL::MeshTextureFaceLayer *layer;
int num_faces;
vector tangent;
 };
@@ -78,26 +78,34 @@ static void mikk_get_position(const SMikkTSpaceContext 
*context, float P[3], con
 static void mikk_get_texture_coordinate(const SMikkTSpaceContext *context, 
float uv[2], const int face_num, const int vert_num)
 {
MikkUserData *userdata = (MikkUserData*)context->m_pUserData;
-   BL::MeshTextureFace tf = userdata->layer.data[face_num];
-   float3 tfuv;
-   
-   switch (vert_num) {
-   case 0:
-   tfuv = get_float3(tf.uv1());
-   break;
-   case 1:
-   tfuv = get_float3(tf.uv2());
-   break;
-   case 2:
-   tfuv = get_float3(tf.uv3());
-   break;
-   default:
-   tfuv = get_float3(tf.uv4());
-   break;
+   if(userdata->layer != NULL) {
+   BL::MeshTextureFace tf = userdata->layer->data[face_num];
+   float3 tfuv;
+
+   switch (vert_num) {
+   case 0:
+   tfuv = get_float3(tf.uv1());
+   break;
+   case 1:
+   tfuv = get_float3(tf.uv2());
+   break;
+   case 2:
+   tfuv = get_float3(tf.uv3());
+   break;
+   default:
+   tfuv = get_float3(tf.uv4());
+   break;
+   }
+
+   uv[0] = tfuv.x;
+   uv[1] = tfuv.y;
+   }
+   else {
+   int vert_idx = 
userdata->mesh.tessfaces[face_num].vertices()[vert_num];
+   float3 orco =
+   
get_float3(userdata->mesh.vertices[vert_idx].undeformed_co());
+   map_to_sphere(&uv[0], &uv[1], orco[0], orco[1], orco[2]);
}
-   
-   uv[0] = tfuv.x;
-   uv[1] = tfuv.y;
 }
 
 static void mikk_get_normal(const SMikkTSpaceContext *context, float N[3], 
const int face_num, const int vert_num)
@@ -127,7 +135,7 @@ static void mikk_set_tangent_space(const SMikkTSpaceContext 
*context, const floa
userdata->tangent[face*4 + vert] = make_float4(T[0], T[1], T[2], sign);
 }
 
-static void mikk_compute_tangents(BL::Mesh b_mesh, BL::MeshTextureFaceLayer 
b_layer, Mesh *mesh, vector& nverts, bool need_sign, bool active_render)
+static void mikk_compute_tangents(BL::Mesh b_mesh, BL::MeshTextureFaceLayer 
*b_layer, Mesh *mesh, vector& nverts, bool need_sign, bool active_render)
 {
/* setup userdata */
MikkUserData userdata(b_mesh, b_layer, nverts.size());
@@ -153,7 +161,11 @@ static void mikk_compute_tangents(BL::Mesh b_mesh, 
BL::MeshTextureFaceLayer b_la
 
/* create tangent attributes */
Attribute *attr;
-   ustring name = ustring((string(b_layer.name().c_str()) + 
".tangent").c_str());
+   ustring name;
+   if(b_layer != NULL)
+   name = ustring((string(b_layer->name().c_str()) + 
".tangent").c_str());
+   else
+   name = ustring("orco.tangent");
 
if(active_render)
attr = mesh->attributes.add(ATTR_STD_UV_TANGENT, name);
@@ -167,7 +179,11 @@ static void mikk_compute_tangents(BL::Mesh b_mesh, 
BL::MeshTextureFaceLayer b_la
 
if(need_sign) {
Attribute *attr_sign;
-   ustring name_sign = ustring((string(b_layer.name().c_str()) + 
".tangent_sign").c_str());
+   ustring name

[Bf-blender-cvs] [ada6ead] soc-2014-fluid: manta readfile to separate function

2014-07-29 Thread Roman Pogribnyi
Commit: ada6ead6cc63649995c4c1d476e6928424afbea5
Author: Roman Pogribnyi
Date:   Mon Jul 28 12:09:00 2014 +0200
Branches: soc-2014-fluid
https://developer.blender.org/rBada6ead6cc63649995c4c1d476e6928424afbea5

manta readfile to separate function

===

M   intern/smoke/intern/MANTA.cpp
M   intern/smoke/intern/MANTA.h

===

diff --git a/intern/smoke/intern/MANTA.cpp b/intern/smoke/intern/MANTA.cpp
index d4ffade..5aef064 100644
--- a/intern/smoke/intern/MANTA.cpp
+++ b/intern/smoke/intern/MANTA.cpp
@@ -174,23 +174,33 @@ void create_manta_folder()

 }
 
-void *run_manta_scene(void *threadid)
+void *run_manta_scene_thread(void *arguments)
 {
+   struct manta_arg_struct *args = (struct manta_arg_struct *)arguments;
//create_manta_folder();
//PyInterpreterState *st = PyThreadState_GET()->interp;
//PyThreadState *ts = Py_NewInterpreter();

-   vector args;
-   args.push_back("manta_scene.py");
+   vector a;
+   a.push_back(args->filepath);
+   //a.push_back("manta_scene.py");
//args.push_back("test_1.py");

-   runMantaScript(args);
+   runMantaScript(a);

//system("./manta manta_scene.py");
-   //  pthread_exit(NULL);
+   pthread_exit(NULL);
+   return NULL;
 }
 
-
+void run_manta_scene(char *filepath)
+{
+   pthread_t manta_thread;
+   struct manta_arg_struct args;
+   args.filepath = filepath;
+   int rc = pthread_create(&manta_thread, NULL, run_manta_scene_thread, 
(void *)&args);
+   pthread_detach(manta_thread);
+}
 
 void generate_manta_sim_file(Scene *scene, SmokeModifierData *smd)
 {
@@ -390,9 +400,6 @@ void generate_manta_sim_file(Scene *scene, 
SmokeModifierData *smd)
}
manta_setup_file << ss.rdbuf();
manta_setup_file.close();
-   //  create_manta_folder();
-   pthread_t manta_thread;
-   int rc = pthread_create(&manta_thread, NULL, run_manta_scene, NULL);
-   pthread_detach(manta_thread);
+   run_manta_scene("manta_scene.py");
 }
 
diff --git a/intern/smoke/intern/MANTA.h b/intern/smoke/intern/MANTA.h
index 42bc09a..8801f42 100644
--- a/intern/smoke/intern/MANTA.h
+++ b/intern/smoke/intern/MANTA.h
@@ -15,6 +15,10 @@
 //#include "../../../source/blender/blenlib/BLI_fileops.h"
 //#include "../../../source/blender/python/manta_pp/pwrapper/pymain.cpp"
 
+struct manta_arg_struct {
+   std::string filepath;
+};
+
 void runMantaScript(vector& args);//defined in 
manta_pp/pwrapper/pymain.cpp
 
 extern "C" bool manta_check_grid_size(struct FLUID_3D *fluid, int dimX, int 
dimY, int dimZ);
@@ -42,7 +46,9 @@ void manta_cache_path(char *filepath);
 //void BLI_dir_create_recursive(const char *filepath);
 void create_manta_folder();
 
-void *run_manta_scene(void *threadid);
+void *run_manta_scene_thread(void *threadid);
+
+void run_manta_scene(char * filepath);
 
 void generate_manta_sim_file(Scene *scene, SmokeModifierData *smd);

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


[Bf-blender-cvs] [5f19242] soc-2014-fluid: new flags for manta module

2014-07-29 Thread Roman Pogribnyi
Commit: 5f19242c589381a4652500b5af0edbb45a914510
Author: Roman Pogribnyi
Date:   Mon Jul 28 21:16:58 2014 +0200
Branches: soc-2014-fluid
https://developer.blender.org/rB5f19242c589381a4652500b5af0edbb45a914510

new flags for manta module

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 9d513d8..b089c9d 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -1147,7 +1147,8 @@ endif()
target_link_libraries(blender ${BLENDER_SORTED_LIBS})
 
#linking manta library
-   SET(MANTA_LINK_LIBRARIES -rdynamic -Wl,-force_load bf_python_manta ) 
+   #PR removed -Wl, -force_load 
+   SET(MANTA_LINK_LIBRARIES -force_load bf_python_manta ) 
#-Wl,--whole-archive bf_python_manta -Wl,--no-whole-archive)
TARGET_LINK_LIBRARIES(blender ${MANTA_LINK_LIBRARIES})

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


[Bf-blender-cvs] [0d92435] pie-menus: Pie Menus:

2014-07-29 Thread Antony Riakiotakis
Commit: 0d92435a71b8dfe7896a5f28b0ac778fdf383e15
Author: Antony Riakiotakis
Date:   Tue Jul 29 11:44:27 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB0d92435a71b8dfe7896a5f28b0ac778fdf383e15

Pie Menus:

* Editmesh selection pie can spawn combinations.

* Remove extraneous flag from operators.

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/mesh/editmesh_select.c
M   source/blender/editors/mesh/mesh_ops.c
M   source/blender/editors/space_view3d/view3d_ops.c
M   source/blender/windowmanager/WM_keymap.h
M   source/blender/windowmanager/intern/wm_keymap.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 2b337d5..ca5dc2a 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2167,10 +2167,7 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu):
 
 layout.operator_context = 'INVOKE_REGION_WIN'
 pie = layout.menu_pie()
-pie.operator("mesh.select_mode", text="Vertex", icon='VERTEXSEL').type 
= 'VERT'
-pie.operator("mesh.select_mode", text="Edge", icon='EDGESEL').type = 
'EDGE'
-pie.operator("mesh.select_mode", text="Face", icon='FACESEL').type = 
'FACE'
-
+pie.operator_enum("mesh.select_mode", "type")
 
 class VIEW3D_MT_edit_mesh_extrude(Menu):
 bl_label = "Extrude"
diff --git a/source/blender/editors/mesh/editmesh_select.c 
b/source/blender/editors/mesh/editmesh_select.c
index 9cdfb43..8c648b1 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -44,6 +44,7 @@
 #include "BKE_report.h"
 #include "BKE_paint.h"
 #include "BKE_editmesh.h"
+#include "BKE_mesh.h"
 
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
@@ -938,6 +939,27 @@ static int edbm_select_mode_exec(bContext *C, wmOperator 
*op)
const bool use_extend = RNA_boolean_get(op->ptr, "use_extend");
const bool use_expand = RNA_boolean_get(op->ptr, "use_expand");
 
+   if (!is_power_of_2_i(type)) {
+   Scene *scene = CTX_data_scene(C);
+   ToolSettings *ts = scene->toolsettings;
+
+   ts->selectmode = type;
+
+   if (scene->basact) {
+   Object *obact = scene->basact->object;
+   Mesh *me = BKE_mesh_from_object(obact);
+   if (me && me->edit_btmesh && 
me->edit_btmesh->selectmode != type) {
+   me->edit_btmesh->selectmode = type;
+   EDBM_selectmode_set(me->edit_btmesh);
+   WM_event_add_notifier(C, NC_GEOM | ND_SELECT, 
obact->data);
+   WM_main_add_notifier(NC_SCENE | 
ND_TOOLSETTINGS, NULL);
+   return OPERATOR_FINISHED;
+   }
+   }
+
+   return OPERATOR_CANCELLED;
+   }
+
if (EDBM_selectmode_toggle(C, type, action, use_extend, use_expand)) {
return OPERATOR_FINISHED;
}
@@ -963,10 +985,14 @@ void MESH_OT_select_mode(wmOperatorType *ot)
PropertyRNA *prop;
 
static EnumPropertyItem elem_items[] = {
-   {SCE_SELECT_VERTEX, "VERT", ICON_VERTEXSEL, "Vertices", ""},
-   {SCE_SELECT_EDGE,   "EDGE", ICON_EDGESEL, "Edges", ""},
-   {SCE_SELECT_FACE,   "FACE", ICON_FACESEL, "Faces", ""},
-   {0, NULL, 0, NULL, NULL},
+   {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex 
selection mode"},
+   {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection 
mode"},
+   {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection 
mode"},
+   {SCE_SELECT_VERTEX | SCE_SELECT_FACE, "VERTEX_FACE", ICON_FACESEL, 
"Vertex/Face", "Vertex and Face selection mode"},
+   {SCE_SELECT_VERTEX | SCE_SELECT_EDGE, "VERTEX_EDGE", 
ICON_VERTEXSEL, "Vertex/Edge", "Vertex and Edge selection mode"},
+   {SCE_SELECT_FACE | SCE_SELECT_EDGE, "FACE_EDGE", ICON_EDGESEL, 
"Face/Edge", "Face and Edge selection mode"},
+   {SCE_SELECT_VERTEX | SCE_SELECT_EDGE | SCE_SELECT_FACE, "ALL", 
ICON_FACESEL, "All", "All selection modes"},
+   {0, NULL, 0, NULL, NULL}
};
 
static EnumPropertyItem actions_items[] = {
diff --git a/source/blender/editors/mesh/mesh_ops.c 
b/source/blender/editors/mesh/mesh_ops.c
index abf4d88..657d99c 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -349,7 +349,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, 
KM_SHIFT, 0);

/* selection mode */
-   WM_keymap_add_pie_menu(keymap, "

[Bf-blender-cvs] [a9c8a11] master: OSX/scons: Fix linking if llvm is not used ( new osl/llvm/oiio related )

2014-07-29 Thread Jens Verwiebe
Commit: a9c8a117a267e1feec7471309107c8ef67dc5dc3
Author: Jens Verwiebe
Date:   Tue Jul 29 10:59:57 2014 +0200
Branches: master
https://developer.blender.org/rBa9c8a117a267e1feec7471309107c8ef67dc5dc3

OSX/scons: Fix linking if llvm is not used ( new osl/llvm/oiio related )

===

M   SConstruct

===

diff --git a/SConstruct b/SConstruct
index 331158e..91ade7e 100644
--- a/SConstruct
+++ b/SConstruct
@@ -438,6 +438,10 @@ if env['OURPLATFORM']=='darwin':
 
env.Append(LINKFLAGS=['-L'+OSX_OSL_LIBPATH,'-loslcomp','-force_load '+ 
OSX_OSL_LIBPATH +'/liboslexec.a','-loslquery'])
 
env.Append(BF_PROGRAM_LINKFLAGS=['-Xlinker','-force_load','-Xlinker',OSX_OSL_LIBPATH
 +'/liboslexec.a'])
 
+if env['WITH_BF_LLVM'] == 0:
+# Due duplicated generic UTF functions, we pull them either from 
LLVMSupport or COLLADA
+env.Append(BF_OPENCOLLADA_LIB=' UTF')
+
 # Trying to get rid of eventually clashes, we export some symbols 
explicite as local
 
env.Append(LINKFLAGS=['-Xlinker','-unexported_symbols_list','-Xlinker','./source/creator/osx_locals.map'])

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


[Bf-blender-cvs] [564c48a] master: Cycles: Make Glass Shader Color default to 1.0.

2014-07-29 Thread Thomas Dinges
Commit: 564c48a06868e56c2ca06a6cc7ba193baadea218
Author: Thomas Dinges
Date:   Tue Jul 29 10:11:30 2014 +0200
Branches: master
https://developer.blender.org/rB564c48a06868e56c2ca06a6cc7ba193baadea218

Cycles: Make Glass Shader Color default to 1.0.

This came up a few times already, most of the time you want a clear white 
glass, and not a greyish like one. :)

===

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

===

diff --git a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c 
b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
index 55dafae..75ca4b8 100644
--- a/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
+++ b/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c
@@ -30,7 +30,7 @@
 /*  OUTPUT  */
 
 static bNodeSocketTemplate sh_node_bsdf_glass_in[] = {
-   {   SOCK_RGBA, 1, N_("Color"),  0.8f, 0.8f, 0.8f, 1.0f, 
0.0f, 1.0f},
+   {   SOCK_RGBA, 1, N_("Color"),  1.0f, 1.0f, 1.0f, 1.0f, 
0.0f, 1.0f},
{   SOCK_FLOAT, 1, N_("Roughness"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 
1.0f, PROP_FACTOR},
{   SOCK_FLOAT, 1, N_("IOR"),   1.45f, 0.0f, 0.0f, 
0.0f, 0.0f, 1000.0f},
{   SOCK_VECTOR, 1, N_("Normal"),   0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 
1.0f, PROP_NONE, SOCK_HIDE_VALUE},

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