[Bf-blender-cvs] [ccc5a8757be] custom-manipulators: Cleanup: rename file

2017-04-05 Thread Campbell Barton
Commit: ccc5a8757bedcb4bc08103908bfa80afaf6213f2
Author: Campbell Barton
Date:   Thu Apr 6 15:43:59 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBccc5a8757bedcb4bc08103908bfa80afaf6213f2

Cleanup: rename file

===

M   source/blender/windowmanager/CMakeLists.txt
R099source/blender/windowmanager/manipulators/intern/wm_manipulator.c   
source/blender/windowmanager/manipulators/intern/wm_manipulator_api.c
R099source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c  
source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
R100source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c

===

diff --git a/source/blender/windowmanager/CMakeLists.txt 
b/source/blender/windowmanager/CMakeLists.txt
index 1535d6da107..a2db253da6d 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -70,9 +70,9 @@ set(SRC
intern/wm_subwindow.c
intern/wm_window.c
intern/wm_stereo.c
-   manipulators/intern/wm_manipulator.c
-   manipulators/intern/wm_manipulatorgroup.c
-   manipulators/intern/wm_manipulatormap.c
+   manipulators/intern/wm_manipulator_api.c
+   manipulators/intern/wm_manipulator_group.c
+   manipulators/intern/wm_manipulator_map.c
manipulators/intern/manipulator_library/arrow_manipulator.c
manipulators/intern/manipulator_library/arrow2d_manipulator.c
manipulators/intern/manipulator_library/cage_manipulator.c
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c 
b/source/blender/windowmanager/manipulators/intern/wm_manipulator_api.c
similarity index 99%
rename from source/blender/windowmanager/manipulators/intern/wm_manipulator.c
rename to source/blender/windowmanager/manipulators/intern/wm_manipulator_api.c
index ef99e98cb96..29a7a2cd9a1 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_api.c
@@ -23,7 +23,7 @@
  * * END GPL LICENSE BLOCK *
  */
 
-/** \file blender/windowmanager/manipulators/intern/wm_manipulator.c
+/** \file blender/windowmanager/manipulators/intern/wm_manipulator_api.c
  *  \ingroup wm
  */
 
diff --git 
a/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c 
b/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
similarity index 99%
rename from 
source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
rename to 
source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
index 5074c6d0257..3954e832596 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
@@ -23,7 +23,7 @@
  * * END GPL LICENSE BLOCK *
  */
 
-/** \file blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
+/** \file blender/windowmanager/manipulators/intern/wm_manipulator_group.c
  *  \ingroup wm
  *
  * \name Manipulator-Group
diff --git 
a/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c 
b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
similarity index 100%
rename from source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
rename to source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c

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


[Bf-blender-cvs] [e1567156c55] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators

2017-04-05 Thread Campbell Barton
Commit: e1567156c550b40cc21a288c82847c9cb394d967
Author: Campbell Barton
Date:   Thu Apr 6 15:22:16 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBe1567156c550b40cc21a288c82847c9cb394d967

Merge branch 'blender2.8' into custom-manipulators

===



===



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


[Bf-blender-cvs] [0debbe2b7f7] blender2.8: Gawain: VertexFormat_add_attrib (function name change)

2017-04-05 Thread Mike Erwin
Commit: 0debbe2b7f7177678c9bce9046c1499b698ac969
Author: Mike Erwin
Date:   Thu Apr 6 00:59:04 2017 -0400
Branches: blender2.8
https://developer.blender.org/rB0debbe2b7f7177678c9bce9046c1499b698ac969

Gawain: VertexFormat_add_attrib (function name change)

See intern/gawain for the API change. Other files are updated to use the new 
name. Also updated every call site to the recommended style:
unsigned int foo = VertexFormat_add_attrib(format, "foo", COMP_ ... )

===

M   intern/gawain/gawain/vertex_format.h
M   intern/gawain/src/vertex_format.c
M   source/blender/blenfont/intern/blf.c
M   source/blender/blenkernel/intern/DerivedMesh.c
M   source/blender/blenkernel/intern/mesh_render.c
M   source/blender/blenkernel/intern/pbvh.c
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_manager.c
M   source/blender/draw/intern/draw_view.c
M   source/blender/editors/animation/anim_channels_defines.c
M   source/blender/editors/animation/anim_draw.c
M   source/blender/editors/animation/anim_markers.c
M   source/blender/editors/animation/keyframes_draw.c
M   source/blender/editors/armature/editarmature_sketch.c
M   source/blender/editors/curve/editcurve_paint.c
M   source/blender/editors/gpencil/drawgpencil.c
M   source/blender/editors/gpencil/gpencil_brush.c
M   source/blender/editors/gpencil/gpencil_paint.c
M   source/blender/editors/interface/interface_draw.c
M   source/blender/editors/interface/interface_icons.c
M   source/blender/editors/interface/interface_panel.c
M   source/blender/editors/interface/interface_widgets.c
M   source/blender/editors/interface/view2d.c
M   source/blender/editors/mask/mask_draw.c
M   source/blender/editors/mesh/editmesh_knife.c
M   source/blender/editors/mesh/editmesh_loopcut.c
M   source/blender/editors/physics/particle_edit.c
M   source/blender/editors/screen/area.c
M   source/blender/editors/screen/glutil.c
M   source/blender/editors/screen/screen_draw.c
M   source/blender/editors/screen/screendump.c
M   source/blender/editors/sculpt_paint/paint_cursor.c
M   source/blender/editors/sculpt_paint/paint_image.c
M   source/blender/editors/sculpt_paint/paint_stroke.c
M   source/blender/editors/sculpt_paint/sculpt_uv.c
M   source/blender/editors/space_action/action_draw.c
M   source/blender/editors/space_clip/clip_dopesheet_draw.c
M   source/blender/editors/space_clip/clip_draw.c
M   source/blender/editors/space_clip/clip_graph_draw.c
M   source/blender/editors/space_clip/clip_utils.c
M   source/blender/editors/space_console/console_draw.c
M   source/blender/editors/space_file/file_draw.c
M   source/blender/editors/space_graph/graph_draw.c
M   source/blender/editors/space_graph/space_graph.c
M   source/blender/editors/space_image/image_draw.c
M   source/blender/editors/space_info/textview.c
M   source/blender/editors/space_nla/nla_draw.c
M   source/blender/editors/space_node/drawnode.c
M   source/blender/editors/space_node/node_draw.c
M   source/blender/editors/space_outliner/outliner_draw.c
M   source/blender/editors/space_sequencer/sequencer_draw.c
M   source/blender/editors/space_text/text_draw.c
M   source/blender/editors/space_time/space_time.c
M   source/blender/editors/space_view3d/drawanimviz.c
M   source/blender/editors/space_view3d/drawarmature.c
M   source/blender/editors/space_view3d/drawobject.c
M   source/blender/editors/space_view3d/drawsimdebug.c
M   source/blender/editors/space_view3d/view3d_draw.c
M   source/blender/editors/space_view3d/view3d_fly.c
M   source/blender/editors/space_view3d/view3d_ruler.c
M   source/blender/editors/space_view3d/view3d_walk.c
M   source/blender/editors/transform/transform.c
M   source/blender/editors/transform/transform_constraints.c
M   source/blender/editors/transform/transform_generics.c
M   source/blender/editors/transform/transform_manipulator.c
M   source/blender/editors/transform/transform_snap.c
M   source/blender/editors/util/ed_util.c
M   source/blender/editors/uvedit/uvedit_draw.c
M   source/blender/editors/uvedit/uvedit_smart_stitch.c
M   source/blender/gpu/intern/gpu_batch.c
M   source/blender/gpu/intern/gpu_compositing.c
M   source/blender/gpu/intern/gpu_framebuffer.c
M   source/blender/gpu/intern/gpu_immediate_util.c
M   source/blender/gpu/intern/gpu_viewport.c
M   source/blender/windowmanager/intern/wm_draw.c
M   source/blender/windowmanager/intern/wm_gesture.c
M   source/blender/windowmanager/intern/wm_operators.c
M   source/blender/windowmanager/intern/wm_stereo.c

===

diff --git a/intern/gawain/gawain/vertex_format.h 
b/intern/gawain/gawain/vertex_format.h

[Bf-blender-cvs] [c2f5cd8f645] blender2.8: Gawain: add VertexBuffer prefix to functions

2017-04-05 Thread Mike Erwin
Commit: c2f5cd8f6454bf8256a39a5fc9cb075311e25c58
Author: Mike Erwin
Date:   Tue Apr 4 20:45:23 2017 -0400
Branches: blender2.8
https://developer.blender.org/rBc2f5cd8f6454bf8256a39a5fc9cb075311e25c58

Gawain: add VertexBuffer prefix to functions

See intern/gawain for the API change. Other files are updated to use the new 
names.

===

M   intern/gawain/gawain/vertex_buffer.h
M   intern/gawain/src/vertex_buffer.c
M   source/blender/blenkernel/intern/mesh_render.c
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_manager.c
M   source/blender/editors/interface/interface_draw.c
M   source/blender/editors/space_view3d/drawarmature.c
M   source/blender/editors/space_view3d/drawobject.c
M   source/blender/editors/uvedit/uvedit_smart_stitch.c
M   source/blender/gpu/intern/gpu_batch.c
M   source/blender/gpu/intern/gpu_compositing.c
M   source/blender/gpu/intern/gpu_framebuffer.c

===

diff --git a/intern/gawain/gawain/vertex_buffer.h 
b/intern/gawain/gawain/vertex_buffer.h
index 6a72cfe6ff3..687f15e9e98 100644
--- a/intern/gawain/gawain/vertex_buffer.h
+++ b/intern/gawain/gawain/vertex_buffer.h
@@ -46,9 +46,9 @@ void VertexBuffer_resize_data(VertexBuffer*, unsigned v_ct);
 // to the vertex attribute's type and component count. They're in control of 
both, so this
 // should not be a problem.
 
-void setAttrib(VertexBuffer*, unsigned a_idx, unsigned v_idx, const void* 
data);
-void fillAttrib(VertexBuffer*, unsigned a_idx, const void* data); // tightly 
packed, non interleaved input data
-void fillAttribStride(VertexBuffer*, unsigned a_idx, unsigned stride, const 
void* data);
+void VertexBuffer_set_attrib(VertexBuffer*, unsigned a_idx, unsigned v_idx, 
const void* data);
+void VertexBuffer_fill_attrib(VertexBuffer*, unsigned a_idx, const void* 
data); // tightly packed, non interleaved input data
+void VertexBuffer_fill_attrib_stride(VertexBuffer*, unsigned a_idx, unsigned 
stride, const void* data);
 
 // TODO: decide whether to keep the functions below
 // doesn't immediate mode satisfy these needs?
diff --git a/intern/gawain/src/vertex_buffer.c 
b/intern/gawain/src/vertex_buffer.c
index 827703403e3..ab488a07bed 100644
--- a/intern/gawain/src/vertex_buffer.c
+++ b/intern/gawain/src/vertex_buffer.c
@@ -92,7 +92,7 @@ void VertexBuffer_resize_data(VertexBuffer* verts, unsigned 
v_ct)
// extra space will be reclaimed, and never sent to VRAM (see 
VertexBuffer_prime)
}
 
-void setAttrib(VertexBuffer* verts, unsigned a_idx, unsigned v_idx, const 
void* data)
+void VertexBuffer_set_attrib(VertexBuffer* verts, unsigned a_idx, unsigned 
v_idx, const void* data)
{
const VertexFormat* format = >format;
const Attrib* a = format->attribs + a_idx;
@@ -106,7 +106,7 @@ void setAttrib(VertexBuffer* verts, unsigned a_idx, 
unsigned v_idx, const void*
memcpy((GLubyte*)verts->data + a->offset + v_idx * format->stride, 
data, a->sz);
}
 
-void fillAttrib(VertexBuffer* verts, unsigned a_idx, const void* data)
+void VertexBuffer_fill_attrib(VertexBuffer* verts, unsigned a_idx, const void* 
data)
{
const VertexFormat* format = >format;
const Attrib* a = format->attribs + a_idx;
@@ -117,10 +117,10 @@ void fillAttrib(VertexBuffer* verts, unsigned a_idx, 
const void* data)
 
const unsigned stride = a->sz; // tightly packed input data
 
-   fillAttribStride(verts, a_idx, stride, data);
+   VertexBuffer_fill_attrib_stride(verts, a_idx, stride, data);
}
 
-void fillAttribStride(VertexBuffer* verts, unsigned a_idx, unsigned stride, 
const void* data)
+void VertexBuffer_fill_attrib_stride(VertexBuffer* verts, unsigned a_idx, 
unsigned stride, const void* data)
{
const VertexFormat* format = >format;
const Attrib* a = format->attribs + a_idx;
diff --git a/source/blender/blenkernel/intern/mesh_render.c 
b/source/blender/blenkernel/intern/mesh_render.c
index dbe99acc10b..ecd2c6ea28e 100644
--- a/source/blender/blenkernel/intern/mesh_render.c
+++ b/source/blender/blenkernel/intern/mesh_render.c
@@ -676,22 +676,22 @@ static void add_overlay_tri(
unsigned char  fflag = mesh_render_data_looptri_flag(mrdata, f);
unsigned char  vflag = mesh_render_data_vertex_flag(mrdata, v1);
eflag[0] = fflag | vflag;
-   setAttrib(vbo, pos_id, base_vert_idx + 0, pos);
-   setAttrib(vbo, edgeMod_id, base_vert_idx + 0, eflag);
+   VertexBuffer_set_attrib(vbo, pos_id, base_vert_idx + 0, pos);
+   VertexBuffer_set_attrib(vbo, edgeMod_id, base_vert_idx + 0, eflag);
 
pos = mesh_render_data_vert_co(mrdata, v2);
eflag = mesh_render_data_edge_flag(mrdata, v1, v3, -1);
vflag = mesh_render_data_vertex_flag(mrdata, v2);
eflag[0] = fflag | vflag;
-   setAttrib(vbo, pos_id, 

[Bf-blender-cvs] [957b4084581] blender2.8: Fix manipulator showing in pose & editmode

2017-04-05 Thread Campbell Barton
Commit: 957b408458140d1cfc72395d62189918bac5b5c7
Author: Campbell Barton
Date:   Thu Apr 6 15:16:34 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB957b408458140d1cfc72395d62189918bac5b5c7

Fix manipulator showing in pose & editmode

===

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

===

diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index 4841b136f1d..13b97b2e1c0 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -337,8 +337,6 @@ static int calc_manipulator_stats(const bContext *C)
}
else if (obedit) {
ob = obedit;
-   if ((ob->lay & v3d->lay) == 0) return 0;
-
if (obedit->type == OB_MESH) {
BMEditMesh *em = BKE_editmesh_from_object(obedit);
BMEditSelection ese;
@@ -521,8 +519,6 @@ static int calc_manipulator_stats(const bContext *C)
int mode = TFM_ROTATION; // mislead counting bones... bah. We 
don't know the manipulator mode, could be mixed
bool ok = false;
 
-   if ((ob->lay & v3d->lay) == 0) return 0;
-
if ((v3d->around == V3D_AROUND_ACTIVE) && (pchan = 
BKE_pose_channel_active(ob))) {
/* doesn't check selection or visibility intentionally 
*/
Bone *bone = pchan->bone;

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


[Bf-blender-cvs] [0899b4bb3f9] blender2.8: Fix building without clay engine

2017-04-05 Thread Campbell Barton
Commit: 0899b4bb3f9574a593a54f4a511fba6662844c16
Author: Campbell Barton
Date:   Thu Apr 6 15:16:23 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB0899b4bb3f9574a593a54f4a511fba6662844c16

Fix building without clay engine

===

M   source/blender/draw/intern/draw_manager.c

===

diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index d2d98f15fa9..276ccd980a0 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -653,6 +653,8 @@ void DRW_shgroup_uniform_mat4(DRWShadingGroup *shgroup, 
const char *name, const
DRW_interface_uniform(shgroup, name, DRW_UNIFORM_MAT4, value, 16, 1, 0);
 }
 
+#ifdef WITH_CLAY_ENGINE
+
 /* Creates a VBO containing OGL primitives for all DRWDynamicCall */
 static void shgroup_dynamic_batch(DRWShadingGroup *shgroup)
 {
@@ -763,6 +765,7 @@ static void 
shgroup_dynamic_batch_from_calls(DRWShadingGroup *shgroup)
shgroup_dynamic_batch(shgroup);
}
 }
+#endif  /* WITH_CLAY_ENGINE */
 
 /* * PASSES 
**/
 
@@ -1170,12 +1173,14 @@ void DRW_state_reset(void)
set_state(state, true);
 }
 
-#else
-void DRW_draw_pass(DRWPass *UNUSED(pass))
-{
-}
+#else  /* !WITH_CLAY_ENGINE */
 
-#endif
+void DRW_draw_pass(DRWPass *UNUSED(pass)) {}
+void DRW_draw_callbacks_pre_scene(void) {}
+void DRW_draw_callbacks_post_scene(void) {}
+void DRW_state_reset(void) {}
+
+#endif  /* WITH_CLAY_ENGINE */
 
 /* ** Settings 
**/

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


[Bf-blender-cvs] [ff3880ff93f] blender2.8: Initialize immediate mode in Animation Player

2017-04-05 Thread Germano Cavalcante
Commit: ff3880ff93f492e68a5923db4bb32b2c0b189cae
Author: Germano Cavalcante
Date:   Thu Apr 6 01:54:10 2017 -0300
Branches: blender2.8
https://developer.blender.org/rBff3880ff93f492e68a5923db4bb32b2c0b189cae

Initialize immediate mode in Animation Player

PS. With this solution, immediate mode can be initialized and finalized 
consecutively if you drop a video

part of T49043

===

M   source/blender/windowmanager/intern/wm_playanim.c

===

diff --git a/source/blender/windowmanager/intern/wm_playanim.c 
b/source/blender/windowmanager/intern/wm_playanim.c
index afe46f6c336..f132186157b 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -64,6 +64,7 @@
 #include "BIF_gl.h"
 
 #include "GPU_matrix.h"
+#include "GPU_immediate.h"
 #include "GPU_immediate_util.h"
 
 #include "DNA_scene_types.h"
@@ -1254,6 +1255,9 @@ static char *wm_main_playanim_intern(int argc, const char 
**argv)
 
//GHOST_ActivateWindowDrawingContext(g_WS.ghost_window);
 
+   /* initialize OpenGL immediate mode */
+   immInit();
+
/* initialize the font */
BLF_init(11, 72);
ps.fontid = BLF_load_mem("monospace", (unsigned char 
*)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size);
@@ -1524,7 +1528,11 @@ static char *wm_main_playanim_intern(int argc, const 
char **argv)
 #endif
/* we still miss freeing a lot!,
 * but many areas could skip initialization too for anim play */
-   
+
+   GPU_shader_free_builtin_shaders();
+
+   immDestroy();
+
BLF_exit();
 
GHOST_DisposeWindow(g_WS.ghost_system, g_WS.ghost_window);

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


[Bf-blender-cvs] [c320172a8b2] custom-manipulators: Remove redundant includes

2017-04-05 Thread Campbell Barton
Commit: c320172a8b24ea951d50eb7528d5c4c2204cc2fc
Author: Campbell Barton
Date:   Thu Apr 6 13:12:50 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBc320172a8b24ea951d50eb7528d5c4c2204cc2fc

Remove redundant includes

===

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

===

diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index b8b4276215f..b3c793b29b9 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -52,7 +52,6 @@
 #include "RNA_access.h"
 
 #include "BKE_action.h"
-#include "BKE_armature.h"
 #include "BKE_context.h"
 #include "BKE_curve.h"
 #include "BKE_global.h"
@@ -66,7 +65,6 @@
 
 #include "WM_api.h"
 #include "WM_types.h"
-#include "wm.h" /* XXX */
 
 #include "ED_armature.h"
 #include "ED_curve.h"
@@ -77,7 +75,6 @@
 #include "ED_screen.h"
 
 #include "UI_resources.h"
-#include "UI_interface.h"
 
 /* local module include */
 #include "transform.h"

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


[Bf-blender-cvs] [c49a84e48d5] custom-manipulators: Remove manipulator_drawflags_refresh

2017-04-05 Thread Campbell Barton
Commit: c49a84e48d569c469a83bc5d93d7a57009c02cdf
Author: Campbell Barton
Date:   Thu Apr 6 13:02:07 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBc49a84e48d569c469a83bc5d93d7a57009c02cdf

Remove manipulator_drawflags_refresh

This decoupled setting draw flags from calculating the manipulator center.

I can't see any advantage to doing this with the current code
It just increases the chance the two get out of sync.

===

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

===

diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index 8273a4eae84..b8b4276215f 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1007,90 +1007,6 @@ static int calc_manipulator_stats(const bContext *C)
return totsel;
 }
 
-static void drawflags_posemode(Object *ob, View3D *v3d, RegionView3D *rv3d)
-{
-   bPoseChannel *pchan;
-
-   if ((ob->lay & v3d->lay) == 0)
-   return;
-
-   if ((v3d->around == V3D_AROUND_ACTIVE) && (pchan = 
BKE_pose_channel_active(ob))) {
-   if (pchan->bone)
-   protectflag_to_drawflags(pchan->protectflag, 
>twdrawflag);
-   }
-   else {
-   int mode = TFM_ROTATION;
-   int totsel = count_set_pose_transflags(, 0, ob);
-
-   if (totsel) {
-   /* use channels to get stats */
-   for (pchan = ob->pose->chanbase.first; pchan; pchan = 
pchan->next) {
-   Bone *bone = pchan->bone;
-   if (bone && (bone->flag & BONE_TRANSFORM)) {
-   
protectflag_to_drawflags(pchan->protectflag, >twdrawflag);
-   }
-   }
-   }
-   }
-}
-
-static void drawflags_editmode(Object *obedit, View3D *v3d, RegionView3D *rv3d)
-{
-   if ((obedit->lay & v3d->lay) == 0)
-   return;
-
-   if (obedit->type == OB_ARMATURE) {
-   const bArmature *arm = obedit->data;
-   EditBone *ebo;
-   if ((v3d->around == V3D_AROUND_ACTIVE) && (ebo = 
arm->act_edbone)) {
-   protectflag_to_drawflags_ebone(rv3d, ebo);
-   }
-   else {
-   for (ebo = arm->edbo->first; ebo; ebo = ebo->next) {
-   if (EBONE_VISIBLE(arm, ebo)) {
-   if (ebo->flag & BONE_SELECTED) {
-   
protectflag_to_drawflags_ebone(rv3d, ebo);
-   }
-   }
-   }
-   }
-   }
-}
-
-/**
- * Refresh RegionView3D.twdrawflag based on protect-flags.
- */
-static void manipulator_drawflags_refresh(const bContext *C, View3D *v3d, 
RegionView3D *rv3d)
-{
-   SceneLayer *sl = CTX_data_scene_layer(C);
-   Object *ob = OBACT_NEW, *obedit = CTX_data_edit_object(C);
-   bGPdata *gpd = CTX_data_gpencil_data(C);
-   const bool is_gp_edit = ((gpd) && (gpd->flag & 
GP_DATA_STROKE_EDITMODE));
-
-   /* all enabled */
-   rv3d->twdrawflag = 0x;
-
-   if (is_gp_edit) {
-   /* pass */
-   }
-   else if (obedit) {
-   drawflags_editmode(obedit, v3d, rv3d);
-   }
-   else if (ob && (ob->mode & OB_MODE_POSE)) {
-   drawflags_posemode(ob, v3d, rv3d);
-   }
-   else if (ob && (ob->mode & OB_MODE_ALL_PAINT)) {
-   /* pass */
-   }
-   else {
-   for (Base *base = sl->object_bases.first; base; base = 
base->next) {
-   if (TESTBASELIB_NEW(base)) {
-   
protectflag_to_drawflags(base->object->protectflag, >twdrawflag);
-   }
-   }
-   }
-}
-
 static void manipulator_get_idot(RegionView3D *rv3d, float r_idot[3])
 {
float view_vec[3], axis_vec[3];
@@ -1317,8 +1233,6 @@ static void WIDGETGROUP_manipulator_refresh(const 
bContext *C, wmManipulatorGrou
return;
 
manipulator_prepare_mat(C, v3d, rv3d);
-   manipulator_drawflags_refresh(C, v3d, rv3d);
-
 
/* *** set properties for axes *** */

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


[Bf-blender-cvs] [c301dc445a7] custom-manipulators: Use obmat for manipulator center instead of 'loc'

2017-04-05 Thread Campbell Barton
Commit: c301dc445a78e01518bc07c10e8a7c35c481023d
Author: Campbell Barton
Date:   Thu Apr 6 12:47:00 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBc301dc445a78e01518bc07c10e8a7c35c481023d

Use obmat for manipulator center instead of 'loc'

Would show wrong location with parenting.

===

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

===

diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index 6931b60cfb6..8273a4eae84 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -478,13 +478,13 @@ static void protectflag_to_drawflags(short protectflag, 
short *drawflags)
 }
 
 /* for pose mode */
-static void protectflag_to_drawflags_pchan(RegionView3D *rv3d, bPoseChannel 
*pchan)
+static void protectflag_to_drawflags_pchan(RegionView3D *rv3d, const 
bPoseChannel *pchan)
 {
protectflag_to_drawflags(pchan->protectflag, >twdrawflag);
 }
 
 /* for editmode*/
-static void protectflag_to_drawflags_ebone(RegionView3D *rv3d, EditBone *ebo)
+static void protectflag_to_drawflags_ebone(RegionView3D *rv3d, const EditBone 
*ebo)
 {
if (ebo->flag & BONE_EDITMODE_LOCKED) {
protectflag_to_drawflags(OB_LOCK_LOC | OB_LOCK_ROT | 
OB_LOCK_SCALE, >twdrawflag);
@@ -523,7 +523,7 @@ static void axis_angle_to_gimbal_axis(float gmat[3][3], 
const float axis[3], con
 }
 
 
-static int test_rotmode_euler(short rotmode)
+static bool test_rotmode_euler(short rotmode)
 {
return (ELEM(rotmode, ROT_MODE_AXISANGLE, ROT_MODE_QUAT)) ? 0 : 1;
 }
@@ -927,8 +927,7 @@ static int calc_manipulator_stats(const bContext *C)
if (TESTBASELIB_NEW(base)) {
if (ob == NULL)
ob = base->object;
-
-   calc_tw_center(scene, base->object->loc);
+   calc_tw_center(scene, base->object->obmat[3]);
totsel++;
}
}

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


[Bf-blender-cvs] [dbccccc0a57] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators

2017-04-05 Thread Campbell Barton
Commit: dbc0a575f7352876fb32f5973615e6761767
Author: Campbell Barton
Date:   Thu Apr 6 12:32:44 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBdbc0a575f7352876fb32f5973615e6761767

Merge branch 'blender2.8' into custom-manipulators

===



===

diff --cc source/blender/editors/transform/transform_manipulator.c
index 960d80762bd,4841b136f1d..4390af496c2
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@@ -478,19 -145,13 +478,19 @@@ static void protectflag_to_drawflags(sh
  }
  
  /* for pose mode */
- static void stats_pchan(Scene *scene, Object *ob, RegionView3D *rv3d, 
bPoseChannel *pchan)
 -static void protectflag_to_drawflags_pchan(RegionView3D *rv3d, const 
bPoseChannel *pchan)
++static void protectflag_to_drawflags_pchan(Scene *scene, Object *ob, 
RegionView3D *rv3d, bPoseChannel *pchan)
  {
 -  protectflag_to_drawflags(pchan->protectflag, >twdrawflag);
 +  Bone *bone = pchan->bone;
 +  if (bone) {
 +  /* update pose matrix after transform */
 +  BKE_pose_where_is(scene, ob);
 +
 +  protectflag_to_drawflags(pchan->protectflag, >twdrawflag);
 +  }
  }
  
  /* for editmode*/
- static void stats_editbone(RegionView3D *rv3d, EditBone *ebo)
 -static void protectflag_to_drawflags_ebone(RegionView3D *rv3d, const EditBone 
*ebo)
++static void protectflag_to_drawflags_ebone(RegionView3D *rv3d, EditBone *ebo)
  {
if (ebo->flag & BONE_EDITMODE_LOCKED) {
protectflag_to_drawflags(OB_LOCK_LOC | OB_LOCK_ROT | 
OB_LOCK_SCALE, >twdrawflag);
@@@ -867,7 -528,7 +867,7 @@@ static int calc_manipulator_stats(cons
Bone *bone = pchan->bone;
if (bone) {
calc_tw_center(scene, pchan->pose_head);
-   stats_pchan(scene, ob, rv3d, pchan);
 -  protectflag_to_drawflags_pchan(rv3d, pchan);
++  protectflag_to_drawflags_pchan(scene, ob, rv3d, 
pchan);
totsel = 1;
ok = true;
}
@@@ -881,7 -542,7 +881,7 @@@
Bone *bone = pchan->bone;
if (bone && (bone->flag & 
BONE_TRANSFORM)) {
calc_tw_center(scene, 
pchan->pose_head);
-   stats_pchan(scene, ob, rv3d, 
pchan);
 -  
protectflag_to_drawflags_pchan(rv3d, pchan);
++  
protectflag_to_drawflags_pchan(scene, ob, rv3d, pchan);
}
}
ok = true;
@@@ -1041,60 -699,101 +1041,60 @@@ static void drawflags_posemode(Object *
}
  }
  
 -
 -/*  DRAWING STUFFIES *** */
 -
 -static float screen_aligned(RegionView3D *rv3d, float mat[4][4])
 +static void drawflags_editmode(Object *obedit, View3D *v3d, RegionView3D 
*rv3d)
  {
 -  gpuTranslate3fv(mat[3]);
 -
 -  /* sets view screen aligned */
 -  gpuRotate3f(-360.0f * saacos(rv3d->viewquat[0]) / (float)M_PI, 
rv3d->viewquat[1], rv3d->viewquat[2], rv3d->viewquat[3]);
 -
 -  return len_v3(mat[0]); /* draw scale */
 -}
 -
 +  if ((obedit->lay & v3d->lay) == 0)
 +  return;
  
 -/* radring = radius of doughnut rings
 - * radhole = radius hole
 - * start = starting segment (based on nrings)
 - * end   = end segment
 - * nsides = amount of points in ring
 - * nrigns = amount of rings
 - */
 -static void partial_doughnut(unsigned int pos, float radring, float radhole, 
int start, int end, int nsides, int nrings)
 -{
 -  float theta, phi, theta1;
 -  float cos_theta, sin_theta;
 -  float cos_theta1, sin_theta1;
 -  float ring_delta, side_delta;
 -  int i, j, do_caps = true;
 -
 -  if (start == 0 && end == nrings) do_caps = false;
 -
 -  ring_delta = 2.0f * (float)M_PI / (float)nrings;
 -  side_delta = 2.0f * (float)M_PI / (float)nsides;
 -
 -  theta = (float)M_PI + 0.5f * ring_delta;
 -  cos_theta = cosf(theta);
 -  sin_theta = sinf(theta);
 -
 -  for (i = nrings - 1; i >= 0; i--) {
 -  theta1 = theta + ring_delta;
 -  cos_theta1 = cosf(theta1);
 -  sin_theta1 = sinf(theta1);
 -
 -  if (do_caps && i == start) {  // cap
 -  immBegin(GL_TRIANGLE_FAN, nsides+1);
 -  phi = 0.0;
 -  for (j = nsides; j >= 0; j--) {
 -  float cos_phi, sin_phi, dist;
 -
 -  phi += side_delta;
 -  

[Bf-blender-cvs] [9f72580d078] blender2.8: Merge branch 'master' into blender2.8

2017-04-05 Thread Campbell Barton
Commit: 9f72580d0784b2bf55743ab44d5f95039f282b5e
Author: Campbell Barton
Date:   Thu Apr 6 12:26:55 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB9f72580d0784b2bf55743ab44d5f95039f282b5e

Merge branch 'master' into blender2.8

===



===



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


[Bf-blender-cvs] [f74b4a010d4] master: Cleanup: function naming for manipulator

2017-04-05 Thread Campbell Barton
Commit: f74b4a010d4b0cc51eb9ecddeab0f7d91b31ec94
Author: Campbell Barton
Date:   Thu Apr 6 12:23:39 2017 +1000
Branches: master
https://developer.blender.org/rBf74b4a010d4b0cc51eb9ecddeab0f7d91b31ec94

Cleanup: function naming for manipulator

Rename 'stats_*' to 'protectflag_to_drawflags_*' (was too vague).
Also remove NULL check from gimbal_axis

===

M   source/blender/editors/transform/transform_manipulator.c
M   source/blender/editors/transform/transform_orientations.c

===

diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index b41b247683f..f23c913da1e 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -143,13 +143,13 @@ static void protectflag_to_drawflags(short protectflag, 
short *drawflags)
 }
 
 /* for pose mode */
-static void stats_pchan(RegionView3D *rv3d, bPoseChannel *pchan)
+static void protectflag_to_drawflags_pchan(RegionView3D *rv3d, const 
bPoseChannel *pchan)
 {
protectflag_to_drawflags(pchan->protectflag, >twdrawflag);
 }
 
 /* for editmode*/
-static void stats_editbone(RegionView3D *rv3d, EditBone *ebo)
+static void protectflag_to_drawflags_ebone(RegionView3D *rv3d, const EditBone 
*ebo)
 {
if (ebo->flag & BONE_EDITMODE_LOCKED) {
protectflag_to_drawflags(OB_LOCK_LOC | OB_LOCK_ROT | 
OB_LOCK_SCALE, >twdrawflag);
@@ -188,73 +188,71 @@ static void axis_angle_to_gimbal_axis(float gmat[3][3], 
const float axis[3], con
 }
 
 
-static int test_rotmode_euler(short rotmode)
+static bool test_rotmode_euler(short rotmode)
 {
return (ELEM(rotmode, ROT_MODE_AXISANGLE, ROT_MODE_QUAT)) ? 0 : 1;
 }
 
 bool gimbal_axis(Object *ob, float gmat[3][3])
 {
-   if (ob) {
-   if (ob->mode & OB_MODE_POSE) {
-   bPoseChannel *pchan = BKE_pose_channel_active(ob);
-
-   if (pchan) {
-   float mat[3][3], tmat[3][3], obmat[3][3];
-   if (test_rotmode_euler(pchan->rotmode)) {
-   eulO_to_gimbal_axis(mat, pchan->eul, 
pchan->rotmode);
-   }
-   else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
-   axis_angle_to_gimbal_axis(mat, 
pchan->rotAxis, pchan->rotAngle);
-   }
-   else { /* quat */
-   return 0;
-   }
-
+   if (ob->mode & OB_MODE_POSE) {
+   bPoseChannel *pchan = BKE_pose_channel_active(ob);
 
-   /* apply bone transformation */
-   mul_m3_m3m3(tmat, pchan->bone->bone_mat, mat);
-
-   if (pchan->parent) {
-   float parent_mat[3][3];
-
-   copy_m3_m4(parent_mat, 
pchan->parent->pose_mat);
-   mul_m3_m3m3(mat, parent_mat, tmat);
-
-   /* needed if object transformation 
isn't identity */
-   copy_m3_m4(obmat, ob->obmat);
-   mul_m3_m3m3(gmat, obmat, mat);
-   }
-   else {
-   /* needed if object transformation 
isn't identity */
-   copy_m3_m4(obmat, ob->obmat);
-   mul_m3_m3m3(gmat, obmat, tmat);
-   }
-
-   normalize_m3(gmat);
-   return 1;
+   if (pchan) {
+   float mat[3][3], tmat[3][3], obmat[3][3];
+   if (test_rotmode_euler(pchan->rotmode)) {
+   eulO_to_gimbal_axis(mat, pchan->eul, 
pchan->rotmode);
}
-   }
-   else {
-   if (test_rotmode_euler(ob->rotmode)) {
-   eulO_to_gimbal_axis(gmat, ob->rot, ob->rotmode);
-   }
-   else if (ob->rotmode == ROT_MODE_AXISANGLE) {
-   axis_angle_to_gimbal_axis(gmat, ob->rotAxis, 
ob->rotAngle);
+   else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
+   axis_angle_to_gimbal_axis(mat, pchan->rotAxis, 
pchan->rotAngle);
}
else { /* quat */
return 0;
}
 
-   if (ob->parent) {
+
+   /* apply bone 

[Bf-blender-cvs] [e34540a6748] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators

2017-04-05 Thread Campbell Barton
Commit: e34540a6748ae462c0cb31f0bd646af7015abe92
Author: Campbell Barton
Date:   Thu Apr 6 12:13:47 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBe34540a6748ae462c0cb31f0bd646af7015abe92

Merge branch 'blender2.8' into custom-manipulators

===



===

diff --cc source/blender/editors/transform/transform_manipulator.c
index c5bbf356414,eead20eac33..960d80762bd
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@@ -478,16 -145,9 +478,15 @@@ static void protectflag_to_drawflags(sh
  }
  
  /* for pose mode */
- static void stats_pose(Scene *scene, Object *ob, bPoseChannel *pchan)
 -static void stats_pchan(RegionView3D *rv3d, bPoseChannel *pchan)
++static void stats_pchan(Scene *scene, Object *ob, RegionView3D *rv3d, 
bPoseChannel *pchan)
  {
 -  protectflag_to_drawflags(pchan->protectflag, >twdrawflag);
 +  Bone *bone = pchan->bone;
- 
 +  if (bone) {
 +  /* update pose matrix after transform */
 +  BKE_pose_where_is(scene, ob);
 +
-   calc_tw_center(scene, pchan->pose_head);
++  protectflag_to_drawflags(pchan->protectflag, >twdrawflag);
 +  }
  }
  
  /* for editmode*/
@@@ -864,7 -527,8 +866,8 @@@ static int calc_manipulator_stats(cons
/* doesn't check selection or visibility intentionally 
*/
Bone *bone = pchan->bone;
if (bone) {
-   stats_pose(scene, ob, pchan);
+   calc_tw_center(scene, pchan->pose_head);
 -  stats_pchan(rv3d, pchan);
++  stats_pchan(scene, ob, rv3d, pchan);
totsel = 1;
ok = true;
}
@@@ -877,7 -541,8 +880,8 @@@
for (pchan = ob->pose->chanbase.first; pchan; 
pchan = pchan->next) {
Bone *bone = pchan->bone;
if (bone && (bone->flag & 
BONE_TRANSFORM)) {
-   stats_pose(scene, ob, pchan);
+   calc_tw_center(scene, 
pchan->pose_head);
 -  stats_pchan(rv3d, pchan);
++  stats_pchan(scene, ob, rv3d, 
pchan);
}
}
ok = true;

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


[Bf-blender-cvs] [e63ba6d0f42] blender2.8: Remove NULL check from gimbal_axis

2017-04-05 Thread Campbell Barton
Commit: e63ba6d0f422bd55a5d3cbdb0d835e8839d2d6b6
Author: Campbell Barton
Date:   Thu Apr 6 11:32:20 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBe63ba6d0f422bd55a5d3cbdb0d835e8839d2d6b6

Remove NULL check from gimbal_axis

===

M   source/blender/editors/transform/transform_manipulator.c
M   source/blender/editors/transform/transform_orientations.c

===

diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index ab5494ff39f..fc32cdef635 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -201,66 +201,64 @@ static int test_rotmode_euler(short rotmode)
 
 bool gimbal_axis(Object *ob, float gmat[3][3])
 {
-   if (ob) {
-   if (ob->mode & OB_MODE_POSE) {
-   bPoseChannel *pchan = BKE_pose_channel_active(ob);
-
-   if (pchan) {
-   float mat[3][3], tmat[3][3], obmat[3][3];
-   if (test_rotmode_euler(pchan->rotmode)) {
-   eulO_to_gimbal_axis(mat, pchan->eul, 
pchan->rotmode);
-   }
-   else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
-   axis_angle_to_gimbal_axis(mat, 
pchan->rotAxis, pchan->rotAngle);
-   }
-   else { /* quat */
-   return 0;
-   }
-
+   if (ob->mode & OB_MODE_POSE) {
+   bPoseChannel *pchan = BKE_pose_channel_active(ob);
 
-   /* apply bone transformation */
-   mul_m3_m3m3(tmat, pchan->bone->bone_mat, mat);
-
-   if (pchan->parent) {
-   float parent_mat[3][3];
-
-   copy_m3_m4(parent_mat, 
pchan->parent->pose_mat);
-   mul_m3_m3m3(mat, parent_mat, tmat);
-
-   /* needed if object transformation 
isn't identity */
-   copy_m3_m4(obmat, ob->obmat);
-   mul_m3_m3m3(gmat, obmat, mat);
-   }
-   else {
-   /* needed if object transformation 
isn't identity */
-   copy_m3_m4(obmat, ob->obmat);
-   mul_m3_m3m3(gmat, obmat, tmat);
-   }
-
-   normalize_m3(gmat);
-   return 1;
+   if (pchan) {
+   float mat[3][3], tmat[3][3], obmat[3][3];
+   if (test_rotmode_euler(pchan->rotmode)) {
+   eulO_to_gimbal_axis(mat, pchan->eul, 
pchan->rotmode);
}
-   }
-   else {
-   if (test_rotmode_euler(ob->rotmode)) {
-   eulO_to_gimbal_axis(gmat, ob->rot, ob->rotmode);
-   }
-   else if (ob->rotmode == ROT_MODE_AXISANGLE) {
-   axis_angle_to_gimbal_axis(gmat, ob->rotAxis, 
ob->rotAngle);
+   else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
+   axis_angle_to_gimbal_axis(mat, pchan->rotAxis, 
pchan->rotAngle);
}
else { /* quat */
return 0;
}
 
-   if (ob->parent) {
+
+   /* apply bone transformation */
+   mul_m3_m3m3(tmat, pchan->bone->bone_mat, mat);
+
+   if (pchan->parent) {
float parent_mat[3][3];
-   copy_m3_m4(parent_mat, ob->parent->obmat);
-   normalize_m3(parent_mat);
-   mul_m3_m3m3(gmat, parent_mat, gmat);
+
+   copy_m3_m4(parent_mat, pchan->parent->pose_mat);
+   mul_m3_m3m3(mat, parent_mat, tmat);
+
+   /* needed if object transformation isn't 
identity */
+   copy_m3_m4(obmat, ob->obmat);
+   mul_m3_m3m3(gmat, obmat, mat);
}
+   else {
+   /* needed if object transformation isn't 
identity */
+   copy_m3_m4(obmat, ob->obmat);
+   

[Bf-blender-cvs] [13f77de2146] blender2.8: Merge branch 'master' into blender2.8

2017-04-05 Thread Campbell Barton
Commit: 13f77de21463a4406edf1e387bb4a7b9735c5a72
Author: Campbell Barton
Date:   Thu Apr 6 12:04:48 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB13f77de21463a4406edf1e387bb4a7b9735c5a72

Merge branch 'master' into blender2.8

===



===



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


[Bf-blender-cvs] [5e3b6e951b0] master: Cleanup: minor changes to transform-manipulator

2017-04-05 Thread Campbell Barton
Commit: 5e3b6e951b0914010396257b723b1d5331433719
Author: Campbell Barton
Date:   Thu Apr 6 12:00:14 2017 +1000
Branches: master
https://developer.blender.org/rB5e3b6e951b0914010396257b723b1d5331433719

Cleanup: minor changes to transform-manipulator

Match stats_editbone & stats_pchan behavior to avoid confusion.

===

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

===

diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index 0a984d90ae3..b41b247683f 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -143,21 +143,17 @@ static void protectflag_to_drawflags(short protectflag, 
short *drawflags)
 }
 
 /* for pose mode */
-static void stats_pose(Scene *scene, RegionView3D *rv3d, bPoseChannel *pchan)
+static void stats_pchan(RegionView3D *rv3d, bPoseChannel *pchan)
 {
-   Bone *bone = pchan->bone;
-
-   if (bone) {
-   calc_tw_center(scene, pchan->pose_head);
-   protectflag_to_drawflags(pchan->protectflag, >twdrawflag);
-   }
+   protectflag_to_drawflags(pchan->protectflag, >twdrawflag);
 }
 
 /* for editmode*/
 static void stats_editbone(RegionView3D *rv3d, EditBone *ebo)
 {
-   if (ebo->flag & BONE_EDITMODE_LOCKED)
+   if (ebo->flag & BONE_EDITMODE_LOCKED) {
protectflag_to_drawflags(OB_LOCK_LOC | OB_LOCK_ROT | 
OB_LOCK_SCALE, >twdrawflag);
+   }
 }
 
 /* could move into BLI_math however this is only useful for display/editing 
purposes */
@@ -530,7 +526,8 @@ static int calc_manipulator_stats(const bContext *C)
/* doesn't check selection or visibility intentionally 
*/
Bone *bone = pchan->bone;
if (bone) {
-   stats_pose(scene, rv3d, pchan);
+   calc_tw_center(scene, pchan->pose_head);
+   stats_pchan(rv3d, pchan);
totsel = 1;
ok = true;
}
@@ -543,7 +540,8 @@ static int calc_manipulator_stats(const bContext *C)
for (pchan = ob->pose->chanbase.first; pchan; 
pchan = pchan->next) {
Bone *bone = pchan->bone;
if (bone && (bone->flag & 
BONE_TRANSFORM)) {
-   stats_pose(scene, rv3d, pchan);
+   calc_tw_center(scene, 
pchan->pose_head);
+   stats_pchan(rv3d, pchan);
}
}
ok = true;

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


[Bf-blender-cvs] [a29fb3945f2] custom-manipulators: Sync with 2.8

2017-04-05 Thread Campbell Barton
Commit: a29fb3945f276cf8fc9ef35d10af814a6864d9d3
Author: Campbell Barton
Date:   Thu Apr 6 11:52:18 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBa29fb3945f276cf8fc9ef35d10af814a6864d9d3

Sync with 2.8

===

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

===

diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index 83681e1e233..c5bbf356414 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -88,23 +88,22 @@
 #include "GPU_immediate.h"
 #include "GPU_matrix.h"
 
+/* return codes for select, and drawing flags */
 
-/* drawing flags */
+#define MAN_TRANS_X(1 << 0)
+#define MAN_TRANS_Y(1 << 1)
+#define MAN_TRANS_Z(1 << 2)
+#define MAN_TRANS_C(MAN_TRANS_X | MAN_TRANS_Y | MAN_TRANS_Z)
 
-#define MAN_TRANS_X  (1 << 0)
-#define MAN_TRANS_Y  (1 << 1)
-#define MAN_TRANS_Z  (1 << 2)
-#define MAN_TRANS_C  (MAN_TRANS_X | MAN_TRANS_Y | MAN_TRANS_Z)
+#define MAN_ROT_X  (1 << 3)
+#define MAN_ROT_Y  (1 << 4)
+#define MAN_ROT_Z  (1 << 5)
+#define MAN_ROT_C  (MAN_ROT_X | MAN_ROT_Y | MAN_ROT_Z)
 
-#define MAN_ROT_X(1 << 3)
-#define MAN_ROT_Y(1 << 4)
-#define MAN_ROT_Z(1 << 5)
-#define MAN_ROT_C(MAN_ROT_X | MAN_ROT_Y | MAN_ROT_Z)
-
-#define MAN_SCALE_X  (1 << 8)
-#define MAN_SCALE_Y  (1 << 9)
-#define MAN_SCALE_Z  (1 << 10)
-#define MAN_SCALE_C  (MAN_SCALE_X | MAN_SCALE_Y | MAN_SCALE_Z)
+#define MAN_SCALE_X(1 << 8)
+#define MAN_SCALE_Y(1 << 9)
+#define MAN_SCALE_Z(1 << 10)
+#define MAN_SCALE_C(MAN_SCALE_X | MAN_SCALE_Y | MAN_SCALE_Z)
 
 /* threshold for testing view aligned manipulator axis */
 #define TW_AXIS_DOT_MIN 0.02f
@@ -491,6 +490,13 @@ static void stats_pose(Scene *scene, Object *ob, 
bPoseChannel *pchan)
}
 }
 
+/* for editmode*/
+static void stats_editbone(RegionView3D *rv3d, EditBone *ebo)
+{
+   if (ebo->flag & BONE_EDITMODE_LOCKED)
+   protectflag_to_drawflags(OB_LOCK_LOC | OB_LOCK_ROT | 
OB_LOCK_SCALE, >twdrawflag);
+}
+
 /* could move into BLI_math however this is only useful for display/editing 
purposes */
 static void axis_angle_to_gimbal_axis(float gmat[3][3], const float axis[3], 
const float angle)
 {
@@ -1016,15 +1022,13 @@ static void drawflags_editmode(Object *obedit, View3D 
*v3d, RegionView3D *rv3d)
const bArmature *arm = obedit->data;
EditBone *ebo;
if ((v3d->around == V3D_AROUND_ACTIVE) && (ebo = 
arm->act_edbone)) {
-   if (ebo->flag & BONE_EDITMODE_LOCKED)
-   protectflag_to_drawflags(OB_LOCK_LOC | 
OB_LOCK_ROT | OB_LOCK_SCALE, >twdrawflag);
+   stats_editbone(rv3d, ebo);
}
else {
for (ebo = arm->edbo->first; ebo; ebo = ebo->next) {
if (EBONE_VISIBLE(arm, ebo)) {
if (ebo->flag & BONE_SELECTED) {
-   if (ebo->flag & 
BONE_EDITMODE_LOCKED)
-   
protectflag_to_drawflags(OB_LOCK_LOC | OB_LOCK_ROT | OB_LOCK_SCALE, 
>twdrawflag);
+   stats_editbone(rv3d, ebo);
}
}
}

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


[Bf-blender-cvs] [365546a6624] custom-manipulators: Add null check to gimbal_axis (sync with 2.8)

2017-04-05 Thread Campbell Barton
Commit: 365546a66243b1e86e3fe25a3d270ff47160e896
Author: Campbell Barton
Date:   Thu Apr 6 11:35:04 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB365546a66243b1e86e3fe25a3d270ff47160e896

Add null check to gimbal_axis (sync with 2.8)

===

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

===

diff --git a/source/blender/editors/transform/transform_manipulator.c 
b/source/blender/editors/transform/transform_manipulator.c
index 1563328a963..83681e1e233 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -530,64 +530,66 @@ static int test_rotmode_euler(short rotmode)
 
 bool gimbal_axis(Object *ob, float gmat[3][3])
 {
-   if (ob->mode & OB_MODE_POSE) {
-   bPoseChannel *pchan = BKE_pose_channel_active(ob);
+   if (ob) {
+   if (ob->mode & OB_MODE_POSE) {
+   bPoseChannel *pchan = BKE_pose_channel_active(ob);
+
+   if (pchan) {
+   float mat[3][3], tmat[3][3], obmat[3][3];
+   if (test_rotmode_euler(pchan->rotmode)) {
+   eulO_to_gimbal_axis(mat, pchan->eul, 
pchan->rotmode);
+   }
+   else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
+   axis_angle_to_gimbal_axis(mat, 
pchan->rotAxis, pchan->rotAngle);
+   }
+   else { /* quat */
+   return 0;
+   }
 
-   if (pchan) {
-   float mat[3][3], tmat[3][3], obmat[3][3];
-   if (test_rotmode_euler(pchan->rotmode)) {
-   eulO_to_gimbal_axis(mat, pchan->eul, 
pchan->rotmode);
-   }
-   else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
-   axis_angle_to_gimbal_axis(mat, pchan->rotAxis, 
pchan->rotAngle);
-   }
-   else { /* quat */
-   return 0;
-   }
 
+   /* apply bone transformation */
+   mul_m3_m3m3(tmat, pchan->bone->bone_mat, mat);
 
-   /* apply bone transformation */
-   mul_m3_m3m3(tmat, pchan->bone->bone_mat, mat);
+   if (pchan->parent) {
+   float parent_mat[3][3];
 
-   if (pchan->parent) {
-   float parent_mat[3][3];
+   copy_m3_m4(parent_mat, 
pchan->parent->pose_mat);
+   mul_m3_m3m3(mat, parent_mat, tmat);
 
-   copy_m3_m4(parent_mat, pchan->parent->pose_mat);
-   mul_m3_m3m3(mat, parent_mat, tmat);
+   /* needed if object transformation 
isn't identity */
+   copy_m3_m4(obmat, ob->obmat);
+   mul_m3_m3m3(gmat, obmat, mat);
+   }
+   else {
+   /* needed if object transformation 
isn't identity */
+   copy_m3_m4(obmat, ob->obmat);
+   mul_m3_m3m3(gmat, obmat, tmat);
+   }
 
-   /* needed if object transformation isn't 
identity */
-   copy_m3_m4(obmat, ob->obmat);
-   mul_m3_m3m3(gmat, obmat, mat);
+   normalize_m3(gmat);
+   return 1;
}
-   else {
-   /* needed if object transformation isn't 
identity */
-   copy_m3_m4(obmat, ob->obmat);
-   mul_m3_m3m3(gmat, obmat, tmat);
+   }
+   else {
+   if (test_rotmode_euler(ob->rotmode)) {
+   eulO_to_gimbal_axis(gmat, ob->rot, ob->rotmode);
+   }
+   else if (ob->rotmode == ROT_MODE_AXISANGLE) {
+   axis_angle_to_gimbal_axis(gmat, ob->rotAxis, 
ob->rotAngle);
+   }
+   else { /* quat */
+   return 0;
}
 
-   normalize_m3(gmat);
+   if (ob->parent) {
+   float parent_mat[3][3];

[Bf-blender-cvs] [37176c7acbd] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators

2017-04-05 Thread Campbell Barton
Commit: 37176c7acbd97ff830a5dfddaba23735e7e5396f
Author: Campbell Barton
Date:   Thu Apr 6 00:21:23 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB37176c7acbd97ff830a5dfddaba23735e7e5396f

Merge branch 'blender2.8' into custom-manipulators

===



===



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


[Bf-blender-cvs] [d4bd16b30d8] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators

2017-04-05 Thread Campbell Barton
Commit: d4bd16b30d8053b916868983b2ecdc2ffdfbf01f
Author: Campbell Barton
Date:   Thu Apr 6 11:20:51 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBd4bd16b30d8053b916868983b2ecdc2ffdfbf01f

Merge branch 'blender2.8' into custom-manipulators

===



===



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


[Bf-blender-cvs] [cf1287308fd] custom-manipulators: Disable depth test for scale widget

2017-04-05 Thread Campbell Barton
Commit: cf1287308fd2b5cc5877ad0f3a58577fa16e8517
Author: Campbell Barton
Date:   Thu Apr 6 00:44:39 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rBcf1287308fd2b5cc5877ad0f3a58577fa16e8517

Disable depth test for scale widget

===

M   source/blender/windowmanager/manipulators/intern/wm_manipulator.c

===

diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c 
b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
index 2111b8c5d37..ef99e98cb96 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
@@ -84,12 +84,12 @@ void 
wm_manipulator_geometryinfo_draw(ManipulatorGeometryInfo *info, const bool
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(unsigned short) * (3 * 
info->ntris), info->indices, GL_STATIC_DRAW);
 
glEnable(GL_CULL_FACE);
-   glEnable(GL_DEPTH_TEST);
+   // glEnable(GL_DEPTH_TEST);
 
glDrawElements(GL_TRIANGLES, info->ntris * 3, GL_UNSIGNED_SHORT, NULL);
 
glDisable(GL_DEPTH_TEST);
-   glDisable(GL_CULL_FACE);
+   // glDisable(GL_CULL_FACE);
 
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

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


[Bf-blender-cvs] [ef6045a4735] id_override_static: Add finer controll over 'strict' finding of override property operations.

2017-04-05 Thread Bastien Montagne
Commit: ef6045a473526fde2c03e1097d64bee8d9136c70
Author: Bastien Montagne
Date:   Wed Apr 5 18:12:18 2017 +0200
Branches: id_override_static
https://developer.blender.org/rBef6045a473526fde2c03e1097d64bee8d9136c70

Add finer controll over 'strict' finding of override property operations.

===

M   source/blender/blenkernel/BKE_library_override.h
M   source/blender/blenkernel/intern/library_override.c
M   source/blender/editors/interface/interface_ops.c
M   source/blender/makesrna/RNA_access.h
M   source/blender/makesrna/intern/rna_access.c

===

diff --git a/source/blender/blenkernel/BKE_library_override.h 
b/source/blender/blenkernel/BKE_library_override.h
index cc29b0cea8f..b5e56145cbc 100644
--- a/source/blender/blenkernel/BKE_library_override.h
+++ b/source/blender/blenkernel/BKE_library_override.h
@@ -49,11 +49,12 @@ void BKE_override_property_delete(struct IDOverride 
*override, struct IDOverride
 struct IDOverridePropertyOperation *BKE_override_property_operation_find(
 struct IDOverrideProperty *override_property,
 const char *subitem_refname, const char *subitem_locname,
-const int subitem_refindex, const int subitem_locindex);
+const int subitem_refindex, const int subitem_locindex, const bool 
strict, bool *r_strict);
 struct IDOverridePropertyOperation *BKE_override_property_operation_get(
 struct IDOverrideProperty *override_property, const short operation,
 const char *subitem_refname, const char *subitem_locname,
-const int subitem_refindex, const int subitem_locindex, bool 
*r_created);
+const int subitem_refindex, const int subitem_locindex,
+const bool strict, bool *r_strict, bool *r_created);
 void BKE_override_property_operation_delete(
 struct IDOverrideProperty *override_property, struct 
IDOverridePropertyOperation *override_property_operation);
 
diff --git a/source/blender/blenkernel/intern/library_override.c 
b/source/blender/blenkernel/intern/library_override.c
index 1fecb5908b2..1f43eee5c7f 100644
--- a/source/blender/blenkernel/intern/library_override.c
+++ b/source/blender/blenkernel/intern/library_override.c
@@ -149,11 +149,15 @@ void BKE_override_property_delete(IDOverride *override, 
IDOverrideProperty *over
 IDOverridePropertyOperation *BKE_override_property_operation_find(
 IDOverrideProperty *override_property,
 const char *subitem_refname, const char *subitem_locname,
-const int subitem_refindex, const int subitem_locindex)
+const int subitem_refindex, const int subitem_locindex, const bool 
strict, bool *r_strict)
 {
IDOverridePropertyOperation *opop;
const int subitem_defindex = -1;
 
+   if (r_strict) {
+   *r_strict = true;
+   }
+
if (subitem_locname &&
(opop = BLI_findstring_ptr(_property->operations, 
subitem_locname,
   offsetof(IDOverridePropertyOperation, 
subitem_local_name
@@ -181,10 +185,13 @@ IDOverridePropertyOperation 
*BKE_override_property_operation_find(
}
 
/* index == -1 means all indices, that is valid fallback in case we 
requested specific index. */
-   if ((subitem_locindex != subitem_defindex) &&
+   if (!strict && (subitem_locindex != subitem_defindex) &&
(opop = BLI_listbase_bytes_find(_property->operations, 
_defindex, sizeof(subitem_defindex),

offsetof(IDOverridePropertyOperation, subitem_local_index
{
+   if (r_strict) {
+   *r_strict = false;
+   }
return opop;
}
 
@@ -197,11 +204,13 @@ IDOverridePropertyOperation 
*BKE_override_property_operation_find(
 IDOverridePropertyOperation *BKE_override_property_operation_get(
 IDOverrideProperty *override_property, const short operation,
 const char *subitem_refname, const char *subitem_locname,
-const int subitem_refindex, const int subitem_locindex, bool 
*r_created)
+const int subitem_refindex, const int subitem_locindex,
+const bool strict, bool *r_strict, bool *r_created)
 {
IDOverridePropertyOperation *opop = 
BKE_override_property_operation_find(override_property,

 subitem_refname, subitem_locname,
-   
 subitem_refindex, subitem_locindex);
+   
 subitem_refindex, subitem_locindex,
+   
 strict, r_strict);
 
if (opop == NULL) {
opop = MEM_callocN(sizeof(IDOverridePropertyOperation), 
__func__);
diff --git 

[Bf-blender-cvs] [8aae0549dff] id_override_static: Make 'set override type' menu option of buttons functional.

2017-04-05 Thread Bastien Montagne
Commit: 8aae0549dff458b54794429118a6053f174a0c36
Author: Bastien Montagne
Date:   Wed Apr 5 21:53:41 2017 +0200
Branches: id_override_static
https://developer.blender.org/rB8aae0549dff458b54794429118a6053f174a0c36

Make 'set override type' menu option of buttons functional.

There's still lots of things to fix or tweak, but basics are now
working.

===

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

===

diff --git a/source/blender/editors/interface/interface_ops.c 
b/source/blender/editors/interface/interface_ops.c
index be7de1fb1d7..eea52076756 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -369,20 +369,52 @@ static int override_type_set_button_exec(bContext *C, 
wmOperator *op)
PointerRNA ptr;
PropertyRNA *prop;
int index;
+   bool created;
const bool all = RNA_boolean_get(op->ptr, "all");
-   const int type = RNA_enum_get(op->ptr, "type");
+   const int op_type = RNA_enum_get(op->ptr, "type");
+
+   short operation;
+
+   switch(op_type) {
+   case UIOverride_Type_NOOP:
+   operation = IDOVERRIDE_NOOP;
+   break;
+   case UIOverride_Type_Replace:
+   operation = IDOVERRIDE_REPLACE;
+   break;
+   case UIOverride_Type_Difference:
+   operation = IDOVERRIDE_ADD;  /* override code will 
automatically switch to subtract if needed. */
+   break;
+   case UIOverride_Type_Factor:
+   operation = IDOVERRIDE_MULTIPLY;
+   break;
+   default:
+   operation = IDOVERRIDE_REPLACE;
+   BLI_assert(0);
+   break;
+   }
 
/* try to reset the nominated setting to its default value */
UI_context_active_but_prop_get(C, , , );
 
-   printf("We should define, change, or remove generic-add per-index 
override operations...\n");
-// /* if there is a valid property that is editable... */
-// if (ptr.data && prop && RNA_property_editable(, prop)) {
-// if (RNA_property_reset(, prop, (all) ? -1 : index))
-// return operator_button_property_finish(C, , prop);
-// }
+   BLI_assert(ptr.id.data != NULL);
 
-   return OPERATOR_FINISHED;
+   if (all) {
+   index = -1;
+   }
+
+   IDOverridePropertyOperation *opop = 
RNA_property_override_property_operation_get(
+   , prop, operation, index, 
true, NULL, );
+   if (!created) {
+   opop->operation = operation;
+   }
+
+   return operator_button_property_finish(C, , prop);
+}
+
+static int override_type_set_button_invoke(bContext *C, wmOperator *op, const 
wmEvent *UNUSED(event))
+{
+   return WM_menu_invoke_ex(C, op, WM_OP_INVOKE_DEFAULT);
 }
 
 static void UI_OT_override_type_set_button(wmOperatorType *ot)
@@ -395,7 +427,7 @@ static void UI_OT_override_type_set_button(wmOperatorType 
*ot)
/* callbacks */
ot->poll = override_type_set_button_poll;
ot->exec = override_type_set_button_exec;
-   ot->invoke = WM_menu_invoke;
+   ot->invoke = override_type_set_button_invoke;
 
/* flags */
ot->flag = OPTYPE_UNDO;
@@ -447,8 +479,8 @@ static int override_remove_button_exec(bContext *C, 
wmOperator *op)
oprop, NULL, NULL, 
index, index, false, _strict_find);
BLI_assert(opop != NULL);
if (!is_strict_find) {
-   /* No specific override operation, we have to get 
generic one, and... */
-   /* ... create item-specific override operations for all 
but given index, before removing generic one. */
+   /* No specific override operation, we have to get 
generic one,
+* and create item-specific override operations for all 
but given index, before removing generic one. */
for (int idx = RNA_property_array_length(, prop); 
idx--; ) {
if (idx != index) {

BKE_override_property_operation_get(oprop, opop->operation, NULL, NULL, idx, 
idx, true, NULL, NULL);
@@ -466,6 +498,7 @@ static int override_remove_button_exec(bContext *C, 
wmOperator *op)
BKE_override_property_delete(id->override, oprop);
RNA_property_copy(, , prop, -1);
}
+
return operator_button_property_finish(C, , prop);
 }

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


[Bf-blender-cvs] [15937c1f8e1] id_override_static: Rename RNA_property_override_..._get() functions to ..._find()

2017-04-05 Thread Bastien Montagne
Commit: 15937c1f8e194626efdf6ac9037349df4bc12952
Author: Bastien Montagne
Date:   Wed Apr 5 17:15:28 2017 +0200
Branches: id_override_static
https://developer.blender.org/rB15937c1f8e194626efdf6ac9037349df4bc12952

Rename RNA_property_override_..._get() functions to ..._find()

Matches functions defined in BKE_library_override!

===

M   source/blender/editors/interface/interface_ops.c
M   source/blender/makesrna/RNA_access.h
M   source/blender/makesrna/intern/rna_access.c

===

diff --git a/source/blender/editors/interface/interface_ops.c 
b/source/blender/editors/interface/interface_ops.c
index a1e34e407b3..cbb7d6d0e8f 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -430,7 +430,7 @@ static int override_remove_button_exec(bContext *C, 
wmOperator *op)
UI_context_active_but_prop_get(C, , , );
 
ID *id = ptr.id.data;
-   IDOverrideProperty *oprop = RNA_property_override_property_get(, 
prop);
+   IDOverrideProperty *oprop = RNA_property_override_property_find(, 
prop);
BLI_assert(oprop != NULL);
BLI_assert(id != NULL && id->override != NULL);
 
diff --git a/source/blender/makesrna/RNA_access.h 
b/source/blender/makesrna/RNA_access.h
index 5f9267b3e2c..22a70b1929b 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -1237,8 +1237,8 @@ void RNA_struct_override_apply(
 bool RNA_struct_auto_override(
 struct PointerRNA *local, struct PointerRNA *reference, struct 
IDOverride *override, const char *root_path);
 
-struct IDOverrideProperty *RNA_property_override_property_get(PointerRNA *ptr, 
PropertyRNA *prop);
-struct IDOverridePropertyOperation 
*RNA_property_override_property_operation_get(
+struct IDOverrideProperty *RNA_property_override_property_find(PointerRNA 
*ptr, PropertyRNA *prop);
+struct IDOverridePropertyOperation 
*RNA_property_override_property_operation_find(
 PointerRNA *ptr, PropertyRNA *prop, const int index);
 
 bool RNA_property_overridable(PointerRNA *ptr, PropertyRNA *prop);
diff --git a/source/blender/makesrna/intern/rna_access.c 
b/source/blender/makesrna/intern/rna_access.c
index 8a7b10d278e..b802f76d608 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -8052,7 +8052,7 @@ bool RNA_struct_auto_override(PointerRNA *local, 
PointerRNA *reference, IDOverri
return changed;
 }
 
-IDOverrideProperty *RNA_property_override_property_get(PointerRNA *ptr, 
PropertyRNA *prop)
+IDOverrideProperty *RNA_property_override_property_find(PointerRNA *ptr, 
PropertyRNA *prop)
 {
ID *id = ptr->id.data;
 
@@ -8073,10 +8073,10 @@ IDOverrideProperty 
*RNA_property_override_property_get(PointerRNA *ptr, Property
return NULL;
 }
 
-IDOverridePropertyOperation *RNA_property_override_property_operation_get(
+IDOverridePropertyOperation *RNA_property_override_property_operation_find(
 PointerRNA *ptr, PropertyRNA *prop, const int index)
 {
-   IDOverrideProperty *op = RNA_property_override_property_get(ptr, prop);
+   IDOverrideProperty *op = RNA_property_override_property_find(ptr, prop);
 
if (!op) {
return NULL;
@@ -8116,7 +8116,7 @@ bool RNA_property_overridden(PointerRNA *ptr, PropertyRNA 
*prop, const int index
return false;
}
 
-   if (RNA_property_override_property_operation_get(ptr, prop, index)) {
+   if (RNA_property_override_property_operation_find(ptr, prop, index)) {
return true;
}

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


[Bf-blender-cvs] [8811f4cfa36] id_override_static: Merge branch 'master' into id_override_static

2017-04-05 Thread Bastien Montagne
Commit: 8811f4cfa36512258a7d6b1b1a7647371aec3e95
Author: Bastien Montagne
Date:   Wed Apr 5 15:34:26 2017 +0200
Branches: id_override_static
https://developer.blender.org/rB8811f4cfa36512258a7d6b1b1a7647371aec3e95

Merge branch 'master' into id_override_static

===



===



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


[Bf-blender-cvs] [40cb5a067bf] blender2.8: Immediate Mode: missing ALPHA_TEST in gpuRestoreState

2017-04-05 Thread Dalai Felinto
Commit: 40cb5a067bf93a993181d4c07c8fba63a9197eee
Author: Dalai Felinto
Date:   Wed Apr 5 19:16:58 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB40cb5a067bf93a993181d4c07c8fba63a9197eee

Immediate Mode: missing ALPHA_TEST in gpuRestoreState

Missed in rBcbd78c81268f06e7b658ae042f3ab6a3816149b0

===

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

===

diff --git a/source/blender/gpu/intern/gpu_draw.c 
b/source/blender/gpu/intern/gpu_draw.c
index 9c8a4254b7d..6008e32f0fd 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -2567,6 +2567,7 @@ void gpuRestoreState(GPUStateValues *values)
}
 
if ((mask & GPU_ENABLE_BIT) != 0) {
+   restore_mask(GL_ALPHA_TEST, values->is_alpha_test);
restore_mask(GL_BLEND, values->is_blend);
 
for (int i = 0; i < 6; i++) {

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


[Bf-blender-cvs] [0cc77b5492e] greasepencil-object: Free new symbol memory

2017-04-05 Thread Antonio Vazquez
Commit: 0cc77b5492e0b4cf0fd19cf7255849f4ddaddebf
Author: Antonio Vazquez
Date:   Wed Apr 5 19:12:11 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0cc77b5492e0b4cf0fd19cf7255849f4ddaddebf

Free new symbol memory

I forget include the memory free in previous commit

===

M   source/blender/draw/intern/draw_cache.c

===

diff --git a/source/blender/draw/intern/draw_cache.c 
b/source/blender/draw/intern/draw_cache.c
index 1c4217c1840..df0adeefcb4 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -127,6 +127,8 @@ void DRW_shape_cache_free(void)
Batch_discard_all(SHC.drw_camera_tria);
if (SHC.drw_camera_focus)
Batch_discard_all(SHC.drw_camera_focus);
+   if (SHC.drw_gpencil_axes)
+   Batch_discard_all(SHC.drw_gpencil_axes);
 }
 
 /* Helper functions */

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


[Bf-blender-cvs] [7ae9d092d0d] master: Fix alembic build error with MSVC

2017-04-05 Thread lazydodo
Commit: 7ae9d092d0d3e3279a0dff6940e46e314cf42ec0
Author: lazydodo
Date:   Wed Apr 5 10:59:29 2017 -0600
Branches: master
https://developer.blender.org/rB7ae9d092d0d3e3279a0dff6940e46e314cf42ec0

Fix alembic build error with MSVC

===

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

===

diff --git a/source/blender/alembic/intern/abc_util.cc 
b/source/blender/alembic/intern/abc_util.cc
index f82b07e91fb..aa95180dfe2 100644
--- a/source/blender/alembic/intern/abc_util.cc
+++ b/source/blender/alembic/intern/abc_util.cc
@@ -542,7 +542,7 @@ ScopeTimer::~ScopeTimer()
 
 bool SimpleLogger::empty()
 {
-   return m_stream.tellp() == 0ul;
+   return ((size_t)m_stream.tellp()) == 0ul;
 }
 
 std::string SimpleLogger::str() const

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


[Bf-blender-cvs] [0d668cdf792] greasepencil-object: Merge branch 'blender2.8' into greasepencil-object

2017-04-05 Thread Antonio Vazquez
Commit: 0d668cdf79225802aa3384fddb23a17921831f12
Author: Antonio Vazquez
Date:   Wed Apr 5 17:39:22 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0d668cdf79225802aa3384fddb23a17921831f12

Merge branch 'blender2.8' into greasepencil-object

===



===

diff --cc source/blender/blenkernel/BKE_context.h
index 8fd19c0601f,22368104566..dda84e9322f
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@@ -301,12 -304,8 +302,14 @@@ int CTX_data_visible_gpencil_layers(con
  int CTX_data_editable_gpencil_layers(const bContext *C, ListBase *list);
  int CTX_data_editable_gpencil_strokes(const bContext *C, ListBase *list);
  
 +struct Palette *CTX_data_active_palette(const bContext *C);
 +struct PaletteColor *CTX_data_active_palettecolor(const bContext *C);
 +int CTX_data_active_palettecolors(const bContext *C, ListBase *list);
 +int CTX_data_available_palettes(const bContext *C, ListBase *list);
 +int CTX_data_available_palettecolors(const bContext *C, ListBase *list);
 +
+ struct Depsgraph *CTX_data_depsgraph(const bContext *C);
+ 
  #ifdef __cplusplus
  }
  #endif
diff --cc source/blender/blenkernel/intern/context.c
index 0c6565e89cd,20a3d4ac7e0..a94ff47ef44
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@@ -1209,27 -1211,8 +1211,33 @@@ int CTX_data_editable_gpencil_strokes(c
return ctx_data_collection_get(C, "editable_gpencil_strokes", list);
  }
  
 +Palette *CTX_data_active_palette(const bContext *C)
 +{
 +  return ctx_data_pointer_get(C, "active_palette");
 +}
 +
 +PaletteColor *CTX_data_active_palettecolor(const bContext *C)
 +{
 +  return ctx_data_pointer_get(C, "active_palettecolor");
 +}
 +
 +int CTX_data_available_palettes(const bContext *C, ListBase *list)
 +{
 +  return ctx_data_collection_get(C, "available_palettes", list);
 +}
 +
 +int CTX_data_active_palettecolorss(const bContext *C, ListBase *list)
 +{
 +  return ctx_data_collection_get(C, "active_palettecolors", list);
 +}
 +
 +int CTX_data_available_palettecolors(const bContext *C, ListBase *list)
 +{
 +  return ctx_data_collection_get(C, "available_palettecolors", list);
 +}
++
+ Depsgraph *CTX_data_depsgraph(const bContext *C)
+ {
+   Scene *scene = CTX_data_scene(C);
+   return scene->depsgraph;
+ }

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


[Bf-blender-cvs] [277d0891ffb] greasepencil-object: Add new draw manager symbol for new ob_gpencil object type

2017-04-05 Thread Antonio Vazquez
Commit: 277d0891ffbcee7d008905373afc6643c7d40367
Author: Antonio Vazquez
Date:   Wed Apr 5 16:50:12 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB277d0891ffbcee7d008905373afc6643c7d40367

Add new draw manager symbol for new ob_gpencil object type

===

M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_cache.h
M   source/blender/draw/modes/object_mode.c

===

diff --git a/source/blender/draw/intern/draw_cache.c 
b/source/blender/draw/intern/draw_cache.c
index 0d79011d267..1c4217c1840 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -66,6 +66,7 @@ static struct DRWShapeCache {
Batch *drw_camera;
Batch *drw_camera_tria;
Batch *drw_camera_focus;
+   Batch *drw_gpencil_axes;
 } SHC = {NULL};
 
 void DRW_shape_cache_free(void)
@@ -425,6 +426,60 @@ Batch *DRW_cache_single_line_endpoints_get(void)
return SHC.drw_line_endpoints;
 }
 
+/* Grease Pencil object */
+Batch *DRW_cache_gpencil_axes_get(void)
+{
+   if (!SHC.drw_gpencil_axes) {
+   int axis;
+   float v1[3] = { 0.0f, 0.0f, 0.0f };
+   float v2[3] = { 0.0f, 0.0f, 0.0f };
+   
+   /* cube data */
+   const GLfloat verts[8][3] = {
+   { -0.25f, -0.25f, -0.25f },
+   { -0.25f, -0.25f,  0.25f },
+   { -0.25f,  0.25f, -0.25f },
+   { -0.25f,  0.25f,  0.25f },
+   { 0.25f, -0.25f, -0.25f },
+   { 0.25f, -0.25f,  0.25f },
+   { 0.25f,  0.25f, -0.25f },
+   { 0.25f,  0.25f,  0.25f }
+   };
+
+   const GLubyte indices[24] = { 0, 1, 1, 3, 3, 2, 2, 0, 0, 4, 4, 
5, 5, 7, 7, 6, 6, 4, 1, 5, 3, 7, 2, 6 };
+
+   /* Position Only 3D format */
+   static VertexFormat format = { 0 };
+   static unsigned pos_id;
+   if (format.attrib_ct == 0) {
+   pos_id = add_attrib(, "pos", GL_FLOAT, 3, 
KEEP_FLOAT);
+   }
+
+   VertexBuffer *vbo = VertexBuffer_create_with_format();
+   VertexBuffer_allocate_data(vbo, 30);
+
+   /* draw axis */
+   for (axis = 0; axis < 3; axis++) {
+   v1[axis] = 1.0f;
+   v2[axis] = -1.0f;
+
+   setAttrib(vbo, pos_id, axis * 2, v1);
+   setAttrib(vbo, pos_id, axis * 2 + 1, v2);
+
+   /* reset v1 & v2 to zero for next axis */
+   v1[axis] = v2[axis] = 0.0f;
+   }
+
+   /* draw cube */
+   for (int i = 0; i < 24; ++i) {
+   setAttrib(vbo, pos_id, i + 6, verts[indices[i]]);
+   }
+
+   SHC.drw_gpencil_axes = Batch_create(GL_LINES, vbo, NULL);
+   }
+   return SHC.drw_gpencil_axes;
+}
+
 /* Empties */
 Batch *DRW_cache_plain_axes_get(void)
 {
diff --git a/source/blender/draw/intern/draw_cache.h 
b/source/blender/draw/intern/draw_cache.h
index 0af7f3d08b1..c9c9f17586b 100644
--- a/source/blender/draw/intern/draw_cache.h
+++ b/source/blender/draw/intern/draw_cache.h
@@ -48,6 +48,9 @@ struct Batch *DRW_cache_empty_cone_get(void);
 struct Batch *DRW_cache_arrows_get(void);
 struct Batch *DRW_cache_axis_names_get(void);
 
+/* Grease Pencil */
+struct Batch *DRW_cache_gpencil_axes_get(void);
+
 /* Lamps */
 struct Batch *DRW_cache_lamp_get(void);
 struct Batch *DRW_cache_lamp_sunrays_get(void);
diff --git a/source/blender/draw/modes/object_mode.c 
b/source/blender/draw/modes/object_mode.c
index e301c3e4e8a..ff6d5799d4e 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -114,6 +114,9 @@ typedef struct g_data{
DRWShadingGroup *arrows;
DRWShadingGroup *axis_names;
 
+   /* Grease Pencil */
+   DRWShadingGroup *gpencil_axes;
+
/* Speaker */
DRWShadingGroup *speaker;
 
@@ -570,6 +573,10 @@ static void OBJECT_cache_init(void *vedata)
geom = DRW_cache_axis_names_get();
stl->g_data->axis_names = 
shgroup_instance_axis_names(psl->non_meshes, geom);
 
+   /* Grease Pencil */
+   geom = DRW_cache_gpencil_axes_get();
+   stl->g_data->gpencil_axes = shgroup_instance(psl->non_meshes, 
geom);
+
/* Speaker */
geom = DRW_cache_speaker_get();
stl->g_data->speaker = shgroup_instance(psl->non_meshes, geom);
@@ -878,6 +885,14 @@ static void DRW_shgroup_empty(OBJECT_StorageList *stl, 
Object *ob, SceneLayer *s
}
 }
 
+static void DRW_shgroup_gpencil(OBJECT_StorageList *stl, Object *ob, 
SceneLayer *sl)
+{
+

[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61850] trunk/lib/tests/cycles/ctests/reports: Cycles tests: Add all existing watertight-related bugs

2017-04-05 Thread Sergey Sharybin
Revision: 61850
  https://developer.blender.org/rBL61850
Author:   sergey
Date: 2017-04-05 16:49:27 +0200 (Wed, 05 Apr 2017)
Log Message:
---
Cycles tests: Add all existing watertight-related bugs

Added Paths:
---
trunk/lib/tests/cycles/ctests/reports/T43865.blend
trunk/lib/tests/cycles/ctests/reports/T50164.blend
trunk/lib/tests/cycles/ctests/reports/T50452.blend
trunk/lib/tests/cycles/ctests/reports/reference_renders/T43865.png
trunk/lib/tests/cycles/ctests/reports/reference_renders/T50164.png
trunk/lib/tests/cycles/ctests/reports/reference_renders/T50452.png

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

Index: trunk/lib/tests/cycles/ctests/reports/T43865.blend
===
--- trunk/lib/tests/cycles/ctests/reports/T43865.blend  2017-04-05 01:58:30 UTC 
(rev 61849)
+++ trunk/lib/tests/cycles/ctests/reports/T43865.blend  2017-04-05 14:49:27 UTC 
(rev 61850)

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

Index: trunk/lib/tests/cycles/ctests/reports/T50164.blend
===
--- trunk/lib/tests/cycles/ctests/reports/T50164.blend  2017-04-05 01:58:30 UTC 
(rev 61849)
+++ trunk/lib/tests/cycles/ctests/reports/T50164.blend  2017-04-05 14:49:27 UTC 
(rev 61850)

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

Index: trunk/lib/tests/cycles/ctests/reports/T50452.blend
===
--- trunk/lib/tests/cycles/ctests/reports/T50452.blend  2017-04-05 01:58:30 UTC 
(rev 61849)
+++ trunk/lib/tests/cycles/ctests/reports/T50452.blend  2017-04-05 14:49:27 UTC 
(rev 61850)

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

Index: trunk/lib/tests/cycles/ctests/reports/reference_renders/T43865.png
===
--- trunk/lib/tests/cycles/ctests/reports/reference_renders/T43865.png  
2017-04-05 01:58:30 UTC (rev 61849)
+++ trunk/lib/tests/cycles/ctests/reports/reference_renders/T43865.png  
2017-04-05 14:49:27 UTC (rev 61850)

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

Index: trunk/lib/tests/cycles/ctests/reports/reference_renders/T50164.png
===
--- trunk/lib/tests/cycles/ctests/reports/reference_renders/T50164.png  
2017-04-05 01:58:30 UTC (rev 61849)
+++ trunk/lib/tests/cycles/ctests/reports/reference_renders/T50164.png  
2017-04-05 14:49:27 UTC (rev 61850)

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

Index: trunk/lib/tests/cycles/ctests/reports/reference_renders/T50452.png
===
--- trunk/lib/tests/cycles/ctests/reports/reference_renders/T50452.png  
2017-04-05 01:58:30 UTC (rev 61849)
+++ trunk/lib/tests/cycles/ctests/reports/reference_renders/T50452.png  
2017-04-05 14:49:27 UTC (rev 61850)

Property changes on: 
trunk/lib/tests/cycles/ctests/reports/reference_renders/T50452.png
___
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property

[Bf-blender-cvs] [a13878b9af1] blender2.8: Cleanup: Remove legacy depsgraph private header from modifiers

2017-04-05 Thread Sergey Sharybin
Commit: a13878b9af162fa6b470aa47c7e73cf42c66c488
Author: Sergey Sharybin
Date:   Wed Apr 5 15:46:56 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBa13878b9af162fa6b470aa47c7e73cf42c66c488

Cleanup: Remove legacy depsgraph private header from modifiers

===

M   source/blender/modifiers/intern/MOD_armature.c
M   source/blender/modifiers/intern/MOD_array.c
M   source/blender/modifiers/intern/MOD_boolean.c
M   source/blender/modifiers/intern/MOD_cast.c
M   source/blender/modifiers/intern/MOD_cloth.c
M   source/blender/modifiers/intern/MOD_curve.c
M   source/blender/modifiers/intern/MOD_datatransfer.c
M   source/blender/modifiers/intern/MOD_displace.c
M   source/blender/modifiers/intern/MOD_dynamicpaint.c
M   source/blender/modifiers/intern/MOD_fluidsim.c
M   source/blender/modifiers/intern/MOD_hook.c
M   source/blender/modifiers/intern/MOD_lattice.c
M   source/blender/modifiers/intern/MOD_mask.c
M   source/blender/modifiers/intern/MOD_meshdeform.c
M   source/blender/modifiers/intern/MOD_meshsequencecache.c
M   source/blender/modifiers/intern/MOD_mirror.c
M   source/blender/modifiers/intern/MOD_normal_edit.c
M   source/blender/modifiers/intern/MOD_particleinstance.c
M   source/blender/modifiers/intern/MOD_screw.c
M   source/blender/modifiers/intern/MOD_shrinkwrap.c
M   source/blender/modifiers/intern/MOD_simpledeform.c
M   source/blender/modifiers/intern/MOD_smoke.c
M   source/blender/modifiers/intern/MOD_softbody.c
M   source/blender/modifiers/intern/MOD_surfacedeform.c
M   source/blender/modifiers/intern/MOD_uvproject.c
M   source/blender/modifiers/intern/MOD_uvwarp.c
M   source/blender/modifiers/intern/MOD_warp.c
M   source/blender/modifiers/intern/MOD_wave.c
M   source/blender/modifiers/intern/MOD_weightvgedit.c
M   source/blender/modifiers/intern/MOD_weightvgmix.c
M   source/blender/modifiers/intern/MOD_weightvgproximity.c

===

diff --git a/source/blender/modifiers/intern/MOD_armature.c 
b/source/blender/modifiers/intern/MOD_armature.c
index 8aee7b66916..8f26077ea82 100644
--- a/source/blender/modifiers/intern/MOD_armature.c
+++ b/source/blender/modifiers/intern/MOD_armature.c
@@ -50,8 +50,6 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "depsgraph_private.h"
-
 #include "MOD_util.h"
 
 
diff --git a/source/blender/modifiers/intern/MOD_array.c 
b/source/blender/modifiers/intern/MOD_array.c
index 61ac4d5692f..f4c665bf550 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -46,6 +46,7 @@
 #include "DNA_scene_types.h"
 
 #include "BKE_cdderivedmesh.h"
+#include "BKE_depsgraph.h"
 #include "BKE_displist.h"
 #include "BKE_curve.h"
 #include "BKE_library_query.h"
@@ -53,8 +54,6 @@
 
 #include "MOD_util.h"
 
-#include "depsgraph_private.h"
-
 /* Due to cyclic dependencies it's possible that curve used for
  * deformation here is not evaluated at the time of evaluating
  * this modifier.
diff --git a/source/blender/modifiers/intern/MOD_boolean.c 
b/source/blender/modifiers/intern/MOD_boolean.c
index 6aadd10480e..e649c8821fa 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -49,8 +49,6 @@
 #include "BKE_library_query.h"
 #include "BKE_modifier.h"
 
-#include "depsgraph_private.h"
-
 #include "MOD_boolean_util.h"
 #include "MOD_util.h"
 
diff --git a/source/blender/modifiers/intern/MOD_cast.c 
b/source/blender/modifiers/intern/MOD_cast.c
index 9e718eab639..2dcc01b89d9 100644
--- a/source/blender/modifiers/intern/MOD_cast.c
+++ b/source/blender/modifiers/intern/MOD_cast.c
@@ -45,9 +45,6 @@
 #include "BKE_library_query.h"
 #include "BKE_modifier.h"
 
-
-#include "depsgraph_private.h"
-
 #include "MOD_util.h"
 
 static void initData(ModifierData *md)
diff --git a/source/blender/modifiers/intern/MOD_cloth.c 
b/source/blender/modifiers/intern/MOD_cloth.c
index c5ab97b5ccd..00161366b93 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -53,8 +53,6 @@
 #include "BKE_modifier.h"
 #include "BKE_pointcache.h"
 
-#include "depsgraph_private.h"
-
 #include "MOD_util.h"
 
 static void initData(ModifierData *md) 
diff --git a/source/blender/modifiers/intern/MOD_curve.c 
b/source/blender/modifiers/intern/MOD_curve.c
index 6f3dbe841aa..fa4f1ac76fc 100644
--- a/source/blender/modifiers/intern/MOD_curve.c
+++ b/source/blender/modifiers/intern/MOD_curve.c
@@ -41,14 +41,13 @@
 
 
 #include "BKE_cdderivedmesh.h"
+#include "BKE_depsgraph.h"
 #include "BKE_lattice.h"
 #include "BKE_library_query.h"
 #include "BKE_modifier.h"
 
-#include "depsgraph_private.h"
 #include "DEG_depsgraph_build.h"
 
-
 static void initData(ModifierData *md)
 {
CurveModifierData *cmd = (CurveModifierData *) 

[Bf-blender-cvs] [1980f3d3b8f] blender2.8: Motion paths: Switch to a slower evaluation which does not need bases to be sorted

2017-04-05 Thread Sergey Sharybin
Commit: 1980f3d3b8fc5b862143c9e3fc29b28f41e15e3b
Author: Sergey Sharybin
Date:   Wed Apr 5 15:56:27 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB1980f3d3b8fc5b862143c9e3fc29b28f41e15e3b

Motion paths: Switch to a slower evaluation which does not need bases to be 
sorted

New dpesgtraph does not ensure bases are sorted by the evaluation order
any more, so motion paths update might go horrribly wrong.

===

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

===

diff --git a/source/blender/blenkernel/intern/anim.c 
b/source/blender/blenkernel/intern/anim.c
index babe5cbde05..ad3f1ac02f2 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -314,47 +314,15 @@ static void motionpaths_calc_optimise_depsgraph(Scene 
*scene, ListBase *targets)
 /* update scene for current frame */
 static void motionpaths_calc_update_scene(Scene *scene)
 {
-#if 1 // 'production' optimizations always on
-   /* rigid body simulation needs complete update to work correctly for 
now */
-   /* RB_TODO investigate if we could avoid updating everything */
-   if (BKE_scene_check_rigidbody_active(scene)) {
-   BKE_scene_update_for_newframe(G.main->eval_ctx, G.main, scene);
-   }
-   else { /* otherwise we can optimize by restricting updates */
-   BaseLegacy *base, *last = NULL;
-   
-   /* only stuff that moves or needs display still */
-   DAG_scene_update_flags(G.main, scene, scene->lay, true, false);
-   
-   /* find the last object with the tag 
-* - all those afterwards are assumed to not be relevant for 
our calculations
-*/
-   /* optimize further by moving out... */
-   for (base = scene->base.first; base; base = base->next) {
-   if (base->object->flag & BA_TEMP_TAG)
-   last = base;
-   }
-   
-   /* perform updates for tagged objects */
-   /* XXX: this will break if rigs depend on scene or other data 
that
-* is animated but not attached to/updatable from objects */
-   for (base = scene->base.first; base; base = base->next) {
-   /* update this object */
-   BKE_object_handle_update(G.main->eval_ctx, scene, 
base->object);
-   
-   /* if this is the last one we need to update, let's 
stop to save some time */
-   if (base == last)
-   break;
-   }
-   }
-#else // original, 'always correct' version
-   /* do all updates
+   /* Do all updates
 *  - if this is too slow, resort to using a more efficient way
 *that doesn't force complete update, but for now, this is the
 *most accurate way!
+*
+* TODO(segey): Bring back partial updates, which became impossible
+* with the new depsgraph due to unsorted nature of bases.
 */
-   BKE_scene_update_for_newframe(G.main->eval_ctx, G.main, scene); /* XXX 
this is the best way we can get anything moving */
-#endif
+   BKE_scene_update_for_newframe(G.main->eval_ctx, G.main, scene);
 }
 
 /*  */

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


[Bf-blender-cvs] [fa5e5f898ed] blender2.8: Cleanup: Remove depsgraph stubs

2017-04-05 Thread Sergey Sharybin
Commit: fa5e5f898edcd25897e4dc288b853db11e6539bb
Author: Sergey Sharybin
Date:   Wed Apr 5 15:57:36 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBfa5e5f898edcd25897e4dc288b853db11e6539bb

Cleanup: Remove depsgraph stubs

===

M   source/blender/blenkernel/BKE_depsgraph.h
M   source/blender/blenkernel/intern/depsgraph.c

===

diff --git a/source/blender/blenkernel/BKE_depsgraph.h 
b/source/blender/blenkernel/BKE_depsgraph.h
index 93db48ce49a..00de4ca2f82 100644
--- a/source/blender/blenkernel/BKE_depsgraph.h
+++ b/source/blender/blenkernel/BKE_depsgraph.h
@@ -117,7 +117,6 @@ void DAG_scene_free(struct Scene *sce);
  * not cause any updates but is used by external render engines to detect if 
for
  * example a datablock was removed. */
 
-void DAG_scene_update_flags(struct Main *bmain, struct Scene *sce, unsigned 
int lay, const bool do_time, const bool do_invisible_flush);
 void DAG_on_visible_update(struct Main *bmain, const bool do_time);
 
 void DAG_id_tag_update(struct ID *id, short flag);
@@ -136,15 +135,10 @@ int  DAG_id_type_tagged(struct Main *bmain, short idtype);
  * DAG_ids_check_recalc and DAG_ids_clear_recalc are used for external render
  * engines to detect changes. */
 
-void DAG_scene_flush_update(struct Main *bmain, struct Scene *sce, unsigned 
int lay, const short do_time);
 void DAG_ids_flush_tagged(struct Main *bmain);
 void DAG_ids_check_recalc(struct Main *bmain, struct Scene *scene, bool time);
 void DAG_ids_clear_recalc(struct Main *bmain);
 
-/* Armature: sorts the bones according to dependencies between them */
-
-void DAG_pose_sort(struct Object *ob);
-
 /* Editors: callbacks to notify editors of datablock changes */
 
 void DAG_editors_update_cb(void (*id_func)(struct Main *bmain, struct ID *id),
@@ -155,25 +149,13 @@ void DAG_editors_update_pre(struct Main *bmain, struct 
Scene *scene, bool time);
 
 /* ** Threaded update ** */
 
-/* Initialize the DAG for threaded update. */
-void DAG_threaded_update_begin(struct Scene *scene,
-   void (*func)(void *node, void *user_data),
-   void *user_data);
-
-void DAG_threaded_update_handle_node_updated(void *node_v,
- void (*func)(void *node, void 
*user_data),
- void *user_data);
-
 /* Debugging: print dependency graph for scene or armature object to console */
 
 void DAG_print_dependencies(struct Main *bmain, struct Scene *scene, struct 
Object *ob);
 
 /*  DAG querying * */
 
-struct Object *DAG_get_node_object(void *node_v);
-const char *DAG_get_node_name(struct Scene *scene, void *node_v);
 short DAG_get_eval_flags_for_object(struct Scene *scene, void *object);
-bool DAG_is_acyclic(struct Scene *scene);
 
 /*  DAG * */
 
diff --git a/source/blender/blenkernel/intern/depsgraph.c 
b/source/blender/blenkernel/intern/depsgraph.c
index 199519a..c83b381ead2 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -53,73 +53,6 @@
 #include "DEG_depsgraph_debug.h"
 #include "DEG_depsgraph_query.h"
 
-/* *
- * Stubs to avoid linking issues and make sure legacy crap is not used *
- * *
- */
-
-void DAG_scene_flush_update(Main *UNUSED(bmain),
-Scene *UNUSED(sce),
-unsigned int UNUSED(lay),
-const short UNUSED(time))
-{
-   BLI_assert(!"Should not be used with new dependnecy graph");
-}
-
-void DAG_scene_update_flags(Main *UNUSED(bmain),
-Scene *UNUSED(scene),
-unsigned int UNUSED(lay),
-const bool UNUSED(do_time),
-const bool UNUSED(do_invisible_flush))
-{
-   BLI_assert(!"Should not be used with new dependnecy graph");
-}
-
-/* *** DAG FOR ARMATURE POSE * */
-
-void DAG_pose_sort(Object *UNUSED(ob))
-{
-   BLI_assert(!"Should not be used with new dependnecy graph");
-}
-
-/*   DAG FOR THREADED UPDATE  * */
-
-void DAG_threaded_update_begin(Scene *UNUSED(scene),
-   void (*func)(void *node, void *user_data),
-   void *UNUSED(user_data))
-{
-   BLI_assert(!"Should not be used with new dependnecy graph");
-   (void)func;
-}
-
-void DAG_threaded_update_handle_node_updated(void *UNUSED(node_v),
- void (*func)(void *node, void 
*user_data),
- void 

[Bf-blender-cvs] [5b386270a5c] blender2.8: Cleanup: Get rid of legacy depsgraph header file

2017-04-05 Thread Sergey Sharybin
Commit: 5b386270a5cc395611f56cdf4bf544be63a96913
Author: Sergey Sharybin
Date:   Wed Apr 5 15:50:45 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB5b386270a5cc395611f56cdf4bf544be63a96913

Cleanup: Get rid of legacy depsgraph header file

===

M   source/blender/blenkernel/CMakeLists.txt
D   source/blender/blenkernel/depsgraph_private.h
M   source/blender/blenkernel/intern/depsgraph.c
M   source/blender/depsgraph/DEG_depsgraph_build.h

===

diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index b665183a37b..2d595e0e3c5 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -302,7 +302,6 @@ set(SRC
BKE_writeavi.h
BKE_writeframeserver.h
 
-   depsgraph_private.h
nla_private.h
tracking_private.h
intern/CCGSubSurf.h
diff --git a/source/blender/blenkernel/depsgraph_private.h 
b/source/blender/blenkernel/depsgraph_private.h
deleted file mode 100644
index 69ca75836d9..000
--- a/source/blender/blenkernel/depsgraph_private.h
+++ /dev/null
@@ -1,169 +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) 2004 Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): none yet.
- *
- * * END GPL LICENSE BLOCK *
- */
-
-/** \file blender/blenkernel/depsgraph_private.h
- *  \ingroup bke
- */
-
-#ifndef __DEPSGRAPH_PRIVATE_H__
-#define __DEPSGRAPH_PRIVATE_H__
-
-#include "BKE_depsgraph.h"
-#include "DNA_constraint_types.h"
-#include "BKE_constraint.h"
-
-struct Scene;
-struct Group;
-struct EffectorWeights;
-struct ModifierData;
-
-/*  DAG relation types *** */
-
-/* scene link to object */
-#define DAG_RL_SCENE(1 << 0)
-/* object link to data */
-#define DAG_RL_DATA (1 << 1)
-
-/* object changes object (parent, track, constraints) */
-#define DAG_RL_OB_OB(1 << 2)
-/* object changes obdata (hooks, constraints) */
-#define DAG_RL_OB_DATA  (1 << 3)
-/* data changes object (vertex parent) */
-#define DAG_RL_DATA_OB  (1 << 4)
-/* data changes data (deformers) */
-#define DAG_RL_DATA_DATA(1 << 5)
-
-#define DAG_NO_RELATION (1 << 6)
-
-#define DAG_RL_ALL_BUT_DATA (DAG_RL_SCENE | DAG_RL_OB_OB | DAG_RL_OB_DATA | 
DAG_RL_DATA_OB | DAG_RL_DATA_DATA)
-#define DAG_RL_ALL  (DAG_RL_ALL_BUT_DATA | DAG_RL_DATA)
-
-
-#define DAGQUEUEALLOC 50
-
-enum {
-   DAG_WHITE = 0,
-   DAG_GRAY = 1,
-   DAG_BLACK = 2
-};
-
-typedef struct DagAdjList {
-   struct DagNode *node;
-   short type;
-   int count;  /* number of identical arcs */
-   unsigned int lay;   // for flushing redraw/rebuild events
-   const char *name;
-   struct DagAdjList *next;
-} DagAdjList;
-
-
-typedef struct DagNode {
-   int color;
-   short type;
-   float x, y, k;
-   void *ob;
-   void *first_ancestor;
-   int ancestor_count;
-   unsigned int lay;   /* accumulated layers of its relations 
+ itself */
-   unsigned int scelay;/* layers due to being in scene */
-   uint64_t customdata_mask;   /* customdata mask */
-   int lasttime;   /* if lasttime != DagForest->time, this node was 
not evaluated yet for flushing */
-   int BFS_dist;   /* BFS distance */
-   int DFS_dist;   /* DFS distance */
-   int DFS_dvtm;   /* DFS discovery time */
-   int DFS_fntm;   /* DFS Finishing time */
-   struct DagAdjList *child;
-   struct DagAdjList *parent;
-   struct DagNode *next;
-
-   /* Threaded evaluation routines */
-   uint32_t num_pending_parents;  /* number of parents which are not 
updated yet
-   * this node has got.
-   * Used by threaded update for faster 
detect whether node could be
-   * updated aready.
-   */
-   bool scheduled;
-
-   /* Runtime flags mainly used to determine which extra data is to be 
evaluated
-* during 

[Bf-blender-cvs] [70aa5f97f24] blender2.8: Cleanup, remove unused function

2017-04-05 Thread Sergey Sharybin
Commit: 70aa5f97f2431523e8e80b4bb22ee256e051ed29
Author: Sergey Sharybin
Date:   Wed Apr 5 15:45:54 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB70aa5f97f2431523e8e80b4bb22ee256e051ed29

Cleanup, remove unused function

===

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

===

diff --git a/source/blender/modifiers/intern/MOD_uvwarp.c 
b/source/blender/modifiers/intern/MOD_uvwarp.c
index 00ef6dd9733..a49f11e5969 100644
--- a/source/blender/modifiers/intern/MOD_uvwarp.c
+++ b/source/blender/modifiers/intern/MOD_uvwarp.c
@@ -225,22 +225,9 @@ static void foreachObjectLink(ModifierData *md, Object 
*ob, ObjectWalkFunc walk,
walk(userData, ob, >object_src, IDWALK_CB_NOP);
 }
 
-static void UNUSED_FUNCTION(uv_warp_deps_object_bone)(DagForest *forest, 
DagNode *obNode,
-Object *obj, const char *bonename)
-{
-   if (obj) {
-   DagNode *curNode = dag_get_node(forest, obj);
-
-   if (bonename[0])
-   dag_add_relation(forest, curNode, obNode, 
DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "UVWarp Modifier");
-   else
-   dag_add_relation(forest, curNode, obNode, 
DAG_RL_OB_DATA, "UVWarp Modifier");
-   }
-}
-
-static void uv_warp_deps_object_bone_new(struct DepsNodeHandle *node,
- Object *object,
- const char *bonename)
+static void uv_warp_deps_object_bone(struct DepsNodeHandle *node,
+ Object *object,
+ const char *bonename)
 {
if (object != NULL) {
if (bonename[0])
@@ -258,8 +245,8 @@ static void updateDepsgraph(ModifierData *md,
 {
UVWarpModifierData *umd = (UVWarpModifierData *) md;
 
-   uv_warp_deps_object_bone_new(node, umd->object_src, umd->bone_src);
-   uv_warp_deps_object_bone_new(node, umd->object_dst, umd->bone_dst);
+   uv_warp_deps_object_bone(node, umd->object_src, umd->bone_src);
+   uv_warp_deps_object_bone(node, umd->object_dst, umd->bone_dst);
 }
 
 ModifierTypeInfo modifierType_UVWarp = {

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


[Bf-blender-cvs] [3bb88a7807d] blender2.8: Merge branch 'master' into blender2.8

2017-04-05 Thread Sergey Sharybin
Commit: 3bb88a7807d00560351a0ca6768b8339fa019d2b
Author: Sergey Sharybin
Date:   Wed Apr 5 15:36:55 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB3bb88a7807d00560351a0ca6768b8339fa019d2b

Merge branch 'master' into blender2.8

===



===

diff --cc source/blender/depsgraph/intern/builder/deg_builder.cc
index 137b507acfc,7f62eb122db..f8e384bf51c
--- a/source/blender/depsgraph/intern/builder/deg_builder.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder.cc
@@@ -52,17 -52,95 +52,9 @@@
  
  namespace DEG {
  
- string deg_fcurve_id_name(const FCurve *fcu)
 -static bool check_object_needs_evaluation(Object *object)
--{
-   char index_buf[32];
-   // TODO(sergey): Use int-to-string utility or so.
-   BLI_snprintf(index_buf, sizeof(index_buf), "[%d]", fcu->array_index);
-   return string(fcu->rna_path) + index_buf;
 -  if (object->recalc & OB_RECALC_ALL) {
 -  /* Object is tagged for update anyway, no need to re-tag it. */
 -  return false;
 -  }
 -  if (object->type == OB_MESH) {
 -  return object->derivedFinal == NULL;
 -  }
 -  else if (ELEM(object->type,
 -OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE))
 -  {
 -  return object->curve_cache == NULL;
 -  }
 -  return false;
 -}
 -
 -void deg_graph_build_flush_layers(Depsgraph *graph)
 -{
 -  std::stack stack;
 -  foreach (OperationDepsNode *node, graph->operations) {
 -  IDDepsNode *id_node = node->owner->owner;
 -  node->done = 0;
 -  node->num_links_pending = 0;
 -  foreach (DepsRelation *rel, node->outlinks) {
 -  if ((rel->from->type == DEPSNODE_TYPE_OPERATION) &&
 -  (rel->flag & DEPSREL_FLAG_CYCLIC) == 0)
 -  {
 -  ++node->num_links_pending;
 -  }
 -  }
 -  if (node->num_links_pending == 0) {
 -  stack.push(node);
 -  node->done = 1;
 -  }
 -  node->owner->layers = id_node->layers;
 -  id_node->id->tag |= LIB_TAG_DOIT;
 -  }
 -  while (!stack.empty()) {
 -  OperationDepsNode *node = stack.top();
 -  stack.pop();
 -  /* Flush layers to parents. */
 -  foreach (DepsRelation *rel, node->inlinks) {
 -  if (rel->from->type == DEPSNODE_TYPE_OPERATION) {
 -  OperationDepsNode *from = (OperationDepsNode 
*)rel->from;
 -  from->owner->layers |= node->owner->layers;
 -  }
 -  }
 -  /* Schedule parent nodes. */
 -  foreach (DepsRelation *rel, node->inlinks) {
 -  if (rel->from->type == DEPSNODE_TYPE_OPERATION) {
 -  OperationDepsNode *from = (OperationDepsNode 
*)rel->from;
 -  if ((rel->flag & DEPSREL_FLAG_CYCLIC) == 0) {
 -  BLI_assert(from->num_links_pending > 0);
 -  --from->num_links_pending;
 -  }
 -  if (from->num_links_pending == 0 && from->done 
== 0) {
 -  stack.push(from);
 -  from->done = 1;
 -  }
 -  }
 -  }
 -  }
--}
--
  void deg_graph_build_finalize(Depsgraph *graph)
  {
 -  /* STEP 1: Make sure new invisible dependencies are ready for use.
 -   *
 -   * TODO(sergey): This might do a bit of extra tagging, but it's kinda 
nice
 -   * to do it ahead of a time and don't spend time on flushing updates on
 -   * every frame change.
 -   */
 -  GHASH_FOREACH_BEGIN(IDDepsNode *, id_node, graph->id_hash)
 -  {
 -  if (id_node->layers == 0) {
 -  ID *id = id_node->id;
 -  if (GS(id->name) == ID_OB) {
 -  Object *object = (Object *)id;
 -  if (check_object_needs_evaluation(object)) {
 -  id_node->tag_update(graph);
 -  }
 -  }
 -  }
 -  }
 -  GHASH_FOREACH_END();
 -  /* STEP 2: Flush visibility layers from children to parent. */
 -  deg_graph_build_flush_layers(graph);
 -  /* STEP 3: Re-tag IDs for update if it was tagged before the relations
 +  /* Re-tag IDs for update if it was tagged before the relations
 * update tag.
 */
GHASH_FOREACH_BEGIN(IDDepsNode *, id_node, graph->id_hash)
diff --cc 

[Bf-blender-cvs] [f921442a441] master: Depsghraph: Remove unused function

2017-04-05 Thread Sergey Sharybin
Commit: f921442a441abbb458ed540f55c24372971acff7
Author: Sergey Sharybin
Date:   Wed Apr 5 15:36:17 2017 +0200
Branches: master
https://developer.blender.org/rBf921442a441abbb458ed540f55c24372971acff7

Depsghraph: Remove unused function

===

M   source/blender/depsgraph/intern/builder/deg_builder.cc
M   source/blender/depsgraph/intern/builder/deg_builder.h

===

diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc 
b/source/blender/depsgraph/intern/builder/deg_builder.cc
index 828da6cb056..7f62eb122db 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder.cc
@@ -52,14 +52,6 @@
 
 namespace DEG {
 
-string deg_fcurve_id_name(const FCurve *fcu)
-{
-   char index_buf[32];
-   // TODO(sergey): Use int-to-string utility or so.
-   BLI_snprintf(index_buf, sizeof(index_buf), "[%d]", fcu->array_index);
-   return string(fcu->rna_path) + index_buf;
-}
-
 static bool check_object_needs_evaluation(Object *object)
 {
if (object->recalc & OB_RECALC_ALL) {
diff --git a/source/blender/depsgraph/intern/builder/deg_builder.h 
b/source/blender/depsgraph/intern/builder/deg_builder.h
index 3cc51a2d7db..b8ea8c8e599 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder.h
@@ -38,9 +38,6 @@ namespace DEG {
 
 struct Depsgraph;
 
-/* Get unique identifier for FCurves and Drivers */
-string deg_fcurve_id_name(const FCurve *fcu);
-
 void deg_graph_build_finalize(struct Depsgraph *graph);
 void deg_graph_build_flush_layers(struct Depsgraph *graph);

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


[Bf-blender-cvs] [d6164c5396f] soc-2016-pbvh-painting: Fix building on gcc.

2017-04-05 Thread Bastien Montagne
Commit: d6164c5396fd174b3df79c9f99015fb2795d00a1
Author: Bastien Montagne
Date:   Wed Apr 5 15:33:47 2017 +0200
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rBd6164c5396fd174b3df79c9f99015fb2795d00a1

Fix building on gcc.

===

M   source/blender/editors/sculpt_paint/sculpt_intern.h

===

diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h 
b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 71716625198..87623f6cd19 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -59,6 +59,7 @@
 struct bContext;
 struct KeyBlock;
 struct Object;
+struct SculptUndoNode;
 
 int sculpt_mode_poll(struct bContext *C);
 int sculpt_mode_poll_view3d(struct bContext *C);

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


[Bf-blender-cvs] [929c45b7d40] blender2.8: Paint cursor changes, so it save/load only the required flags

2017-04-05 Thread Dalai Felinto
Commit: 929c45b7d40536ce5fe572d19ebcbb70e9416a42
Author: Dalai Felinto
Date:   Wed Apr 5 13:01:32 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB929c45b7d40536ce5fe572d19ebcbb70e9416a42

Paint cursor changes, so it save/load only the required flags

===

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

===

diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c 
b/source/blender/editors/sculpt_paint/paint_cursor.c
index de629faac32..9bc163c6a62 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -57,6 +57,7 @@
 
 #include "ED_view3d.h"
 
+#include "GPU_draw.h"
 #include "GPU_immediate.h"
 #include "GPU_immediate_util.h"
 #include "GPU_matrix.h"
@@ -697,9 +698,9 @@ static void paint_draw_tex_overlay(UnifiedPaintSettings 
*ups, Brush *brush,
immUnbindProgram();
 
glPopMatrix(); /* TEXTURE */
+   glMatrixMode(GL_MODELVIEW);
 
if (mtex->brush_map_mode == MTEX_MAP_MODE_STENCIL) {
-   glMatrixMode(GL_MODELVIEW);
gpuPopMatrix();
}
}
@@ -796,19 +797,8 @@ static void paint_draw_alpha_overlay(UnifiedPaintSettings 
*ups, Brush *brush,
/* color means that primary brush texture is colured and secondary is 
used for alpha/mask control */
bool col = ELEM(mode, ePaintTextureProjective, ePaintTexture2D, 
ePaintVertex) ? true : false;
OverlayControlFlags flags = BKE_paint_get_overlay_flags();
-   /* save lots of GL state
-* TODO: check on whether all of these are needed? */
-   glPushAttrib(GL_COLOR_BUFFER_BIT |
-GL_CURRENT_BIT |
-GL_DEPTH_BUFFER_BIT |
-GL_ENABLE_BIT |
-GL_LINE_BIT |
-GL_POLYGON_BIT |
-GL_STENCIL_BUFFER_BIT |
-GL_TRANSFORM_BIT |
-GL_VIEWPORT_BIT |
-GL_TEXTURE_BIT);
-
+   GPUStateValues attribs;
+   gpuSaveState(, GPU_DEPTH_BUFFER_BIT | GPU_BLEND_BIT);
 
/* coloured overlay should be drawn separately */
if (col) {
@@ -826,7 +816,7 @@ static void paint_draw_alpha_overlay(UnifiedPaintSettings 
*ups, Brush *brush,
paint_draw_cursor_overlay(ups, brush, vc, x, y, zoom);
}
 
-   glPopAttrib();
+   gpuRestoreState();
GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 }

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


[Bf-blender-cvs] [bbfa1a86391] blender2.8: Viewport: 3D cameras don't need glPushAttrib/glPopAttrib

2017-04-05 Thread Dalai Felinto
Commit: bbfa1a8639114d66ed0c4971a1996e08e520bd06
Author: Dalai Felinto
Date:   Wed Apr 5 12:31:55 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBbbfa1a8639114d66ed0c4971a1996e08e520bd06

Viewport: 3D cameras don't need glPushAttrib/glPopAttrib

===

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

===

diff --git a/source/blender/editors/space_view3d/drawobject.c 
b/source/blender/editors/space_view3d/drawobject.c
index fc28baf5160..eaa5ee3b9eb 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2009,7 +2009,6 @@ static void drawcamera_stereo3d(
 
if (is_stereo3d_cameras) {
/* draw connecting lines */
-   glPushAttrib(GL_ENABLE_BIT); /* TODO(merwin): new state 
tracking! */
glLineStipple(2, 0x);
glEnable(GL_LINE_STIPPLE);
 
@@ -2018,7 +2017,7 @@ static void drawcamera_stereo3d(
immVertex3fv(pos, origin[1]);
immEnd();
 
-   glPopAttrib();
+   glDisable(GL_LINE_STIPPLE);
}
 
/* draw convergence plane */

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


[Bf-blender-cvs] [cbd78c81268] blender2.8: Immediate Mode: replacing glPushAttrib/glPopAttrib

2017-04-05 Thread Dalai Felinto
Commit: cbd78c81268f06e7b658ae042f3ab6a3816149b0
Author: Dalai Felinto
Date:   Tue Apr 4 20:33:23 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBcbd78c81268f06e7b658ae042f3ab6a3816149b0

Immediate Mode: replacing glPushAttrib/glPopAttrib

Reference document: http://docs.gl/gl3/glPushAttrib

This patch only tackles the bits that are set by Blender with the
following exceptions:

1) Deprecated states (e.g., GL_STIPPLE) are not saved/restored

2) The exception being GL_ALPHA_TEST, which will be removed, but it may
affect drawing too much now. To be removed once we no longer set GL_ALPHA_TEST
elsewhere.

3) paint_cursor will be tackled separated, since it was abusing
glPush/PopAttrib in the first place.

4) Despite what the glPushAttrib page above may suggest, GL_DEPTH_WRITEMASK 
needs glGet, not glIsEnabled

5) BGE is still a problem since it relies on GL_ALL_ATTRIB_BITS which
would lead to a way more complete/lenghty solution. Since the BGE has
other (OpenGL deprecated) problems anyways, it can be handled on its own
time.

Finally, the original design for 2.8 was to implement a proper stack
system. However we need to move to core profile sooner than later. So
this is a pragmatic temporary (that may be permanent) solution.

Reviewers: merwin, campbellbarton

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

===

M   source/blender/gpu/GPU_draw.h
M   source/blender/gpu/intern/gpu_compositing.c
M   source/blender/gpu/intern/gpu_draw.c
M   source/blender/gpu/intern/gpu_framebuffer.c
M   source/blender/gpu/intern/gpu_select_pick.c
M   source/blender/gpu/intern/gpu_select_sample_query.c
M   source/blender/gpu/intern/gpu_viewport.c

===

diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index 47ddabbed19..3704f909336 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -74,7 +74,7 @@ void GPU_disable_program_point_size(void);
  *   GPU_object_material_bind returns 0 if drawing should be skipped
  * - after drawing, the material must be disabled again */
 
-void GPU_begin_object_materials(struct View3D *v3d, struct RegionView3D *rv3d, 
+void GPU_begin_object_materials(struct View3D *v3d, struct RegionView3D *rv3d,
 struct Scene *scene, struct SceneLayer *sl,
 struct Object *ob, bool glsl, bool 
*do_alpha_after);
 void GPU_end_object_materials(void);
@@ -175,6 +175,58 @@ void   GPU_select_index_get(int index, int *r_col);
 intGPU_select_to_index(unsigned int col);
 void   GPU_select_to_index_array(unsigned int *col, const unsigned int size);
 
+typedef enum eGPUStateMask {
+   GPU_DEPTH_BUFFER_BIT = (1 << 0),
+   GPU_ENABLE_BIT = (1 << 1),
+   GPU_SCISSOR_BIT = (1 << 2),
+   GPU_VIEWPORT_BIT = (1 << 3),
+   GPU_BLEND_BIT = (1 << 4),
+} eGPUStateMask;
+
+typedef struct GPUStateValues
+{
+   eGPUStateMask mask;
+
+   /* GL_ENABLE_BIT */
+   unsigned int is_alpha_test : 1;
+   unsigned int is_blend : 1;
+   bool is_clip_plane[6];
+   unsigned int is_cull_face : 1;
+   unsigned int is_depth_test : 1;
+   unsigned int is_dither : 1;
+   bool is_light[8];
+   unsigned int is_lighting : 1;
+   unsigned int is_line_smooth : 1;
+   unsigned int is_color_logic_op : 1;
+   unsigned int is_map1_vertex3 : 1;
+   unsigned int is_multisample : 1;
+   unsigned int is_normalize : 1;
+   unsigned int is_polygon_offset_line : 1;
+   unsigned int is_polygon_offset_fill : 1;
+   unsigned int is_polygon_smooth : 1;
+   unsigned int is_sample_alpha_to_coverage : 1;
+   unsigned int is_scissor_test : 1;
+   unsigned int is_stencil_test : 1;
+   unsigned int is_texture_2d : 1;
+
+   /* GL_DEPTH_BUFFER_BIT */
+   /* unsigned int is_depth_test : 1; */
+   int depth_func;
+   double depth_clear_value;
+   bool depth_write_mask;
+
+   /* GL_SCISSOR_BIT */
+   int scissor_box[4];
+   /* unsigned int is_scissor_test : 1; */
+
+   /* GL_VIEWPORT_BIT */
+   int viewport[4];
+   double near_far[2];
+} GPUStateValues;
+
+void gpuSaveState(GPUStateValues *attribs, eGPUStateMask mask);
+void gpuRestoreState(GPUStateValues *attribs);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/gpu/intern/gpu_compositing.c 
b/source/blender/gpu/intern/gpu_compositing.c
index 5214b6b1ab7..8ae100a7d95 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -42,6 +42,7 @@
 #include "DNA_gpu_types.h"
 
 #include "GPU_compositing.h"
+#include "GPU_draw.h"
 #include "GPU_extensions.h"
 #include "GPU_framebuffer.h"
 #include "GPU_glew.h"
@@ -196,6 +197,8 @@ struct GPUFX {
 
Batch *quad_batch;
Batch *point_batch;
+
+   struct 

[Bf-blender-cvs] [424901ad7b3] master: Cycles: Guard global write access in SVM compilation code

2017-04-05 Thread Sergey Sharybin
Commit: 424901ad7b32a9bc4be5b5e4f062b98e83ebfde0
Author: Sergey Sharybin
Date:   Wed Apr 5 14:21:49 2017 +0200
Branches: master
https://developer.blender.org/rB424901ad7b32a9bc4be5b5e4f062b98e83ebfde0

Cycles: Guard global write access in SVM compilation code

===

M   intern/cycles/render/svm.cpp

===

diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index 4cb4018e2b4..48287d872d4 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -67,6 +67,7 @@ void SVMShaderManager::device_update_shader(Scene *scene,
<< "Shader name: " << shader->name << "\n"
<< summary.full_report();
 
+   nodes_lock_.lock();
if(shader->use_mis && shader->has_surface_emission) {
scene->light_manager->need_update = true;
}
@@ -74,7 +75,6 @@ void SVMShaderManager::device_update_shader(Scene *scene,
/* The copy needs to be done inside the lock, if another thread resizes 
the array 
 * while memcpy is running, it'll be copying into possibly 
invalid/freed ram. 
 */
-   nodes_lock_.lock();
size_t global_nodes_size = global_svm_nodes->size();
global_svm_nodes->resize(global_nodes_size + svm_nodes.size());

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


[Bf-blender-cvs] [3ce30823ffa] master: Cycles: Add utility class to simplify scoped spin locks

2017-04-05 Thread Sergey Sharybin
Commit: 3ce30823ffadcf208ecd353a8541f7f86d85d91e
Author: Sergey Sharybin
Date:   Wed Apr 5 14:57:34 2017 +0200
Branches: master
https://developer.blender.org/rB3ce30823ffadcf208ecd353a8541f7f86d85d91e

Cycles: Add utility class to simplify scoped spin locks

===

M   intern/cycles/util/util_thread.h

===

diff --git a/intern/cycles/util/util_thread.h b/intern/cycles/util/util_thread.h
index 1b4e87ebf03..1e91fb8a706 100644
--- a/intern/cycles/util/util_thread.h
+++ b/intern/cycles/util/util_thread.h
@@ -106,6 +106,23 @@ protected:
 #endif
 };
 
+class thread_scoped_spin_lock {
+public:
+   explicit thread_scoped_spin_lock(thread_spin_lock& lock)
+   : lock_(lock) {
+   lock_.lock();
+   }
+
+   ~thread_scoped_spin_lock() {
+   lock_.unlock();
+   }
+
+   /* TODO(sergey): Implement manual control over lock/unlock. */
+
+protected:
+   thread_spin_lock& lock_;
+};
+
 CCL_NAMESPACE_END
 
 #endif /* __UTIL_THREAD_H__ */

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


[Bf-blender-cvs] [52029e689ce] master: Cycles: Fix race condition in attributes creation during SVM compilation

2017-04-05 Thread Sergey Sharybin
Commit: 52029e689ceb9fec0a873d6ed3d0c036d58be8cd
Author: Sergey Sharybin
Date:   Wed Apr 5 14:57:54 2017 +0200
Branches: master
https://developer.blender.org/rB52029e689ceb9fec0a873d6ed3d0c036d58be8cd

Cycles: Fix race condition in attributes creation during SVM compilation

===

M   intern/cycles/render/svm.cpp
M   intern/cycles/render/svm.h

===

diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index 48287d872d4..9cf3f4cb0b2 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -393,11 +393,13 @@ void SVMCompiler::add_node(const float4& f)
 
 uint SVMCompiler::attribute(ustring name)
 {
+   thread_scoped_spin_lock lock(attribute_lock_);
return shader_manager->get_attribute_id(name);
 }
 
 uint SVMCompiler::attribute(AttributeStandard std)
 {
+   thread_scoped_spin_lock lock(attribute_lock_);
return shader_manager->get_attribute_id(std);
 }
 
diff --git a/intern/cycles/render/svm.h b/intern/cycles/render/svm.h
index abbd9e50610..eef344a506e 100644
--- a/intern/cycles/render/svm.h
+++ b/intern/cycles/render/svm.h
@@ -218,6 +218,8 @@ protected:
int max_stack_use;
uint mix_weight_offset;
bool compile_failed;
+
+   thread_spin_lock attribute_lock_;
 };
 
 CCL_NAMESPACE_END

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


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

2017-04-05 Thread Nathan Vollmer
Commit: 60889291006e9fb24b25bea2a649158fad0450c2
Author: Nathan Vollmer
Date:   Wed Apr 5 04:15:54 2017 -0600
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB60889291006e9fb24b25bea2a649158fad0450c2

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

===



===



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


[Bf-blender-cvs] [38b50452056] soc-2016-pbvh-painting: fixed masking bug, & pbvh freeing bug. Still trying to figure out grids...

2017-04-05 Thread Nathan Vollmer
Commit: 38b5045205656dffa01b01f225434814bcb06f51
Author: Nathan Vollmer
Date:   Tue Apr 4 23:00:02 2017 -0600
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB38b5045205656dffa01b01f225434814bcb06f51

fixed masking bug, & pbvh freeing bug. Still trying to figure out grids...

===

M   source/blender/blenkernel/BKE_paint.h
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/paint.c
M   source/blender/blenkernel/intern/subsurf_ccg.c
M   source/blender/editors/sculpt_paint/paint_vertex.c
M   source/blender/editors/sculpt_paint/sculpt.c
M   source/blender/editors/sculpt_paint/sculpt_intern.h

===

diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index 3a46e8281a1..d8ef476988c 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -214,6 +214,7 @@ typedef struct SculptSession {
unsigned int *tot_loops_hit;
float *max_weight;
unsigned int *previous_color;
+   bool building_vp_handle;
 } SculptSession;
 
 void BKE_sculptsession_free(struct Object *ob);
diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index ebe809143c2..1554ff3d75f 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2740,7 +2740,7 @@ void BKE_object_sculpt_modifiers_changed(Object *ob)
 {
SculptSession *ss = ob->sculpt;
 
-   if (ss) {
+   if (ss && ss->building_vp_handle == false) {
if (!ss->cache) {
/* we free pbvh on changes, except during sculpt since 
it can't deal with
 * changing PVBH node organization, we hope topology 
does not change in
diff --git a/source/blender/blenkernel/intern/paint.c 
b/source/blender/blenkernel/intern/paint.c
index b1006f3807c..07fe63929cd 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -875,6 +875,9 @@ void BKE_sculpt_update_mesh_elements(Scene *scene, Sculpt 
*sd, Object *ob,
ss->modifiers_active = sculpt_modifiers_active(scene, sd, ob);
ss->show_diffuse_color = (sd->flags & SCULPT_SHOW_DIFFUSE) != 0;
 
+   /* This flag prevents PBVH from being freed when creating the vp_handle 
for texture paint */
+   ss->building_vp_handle = false;
+
if (need_mask) {
if (mmd == NULL) {
if (!CustomData_has_layer(>vdata, CD_PAINT_MASK)) {
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c 
b/source/blender/blenkernel/intern/subsurf_ccg.c
index 53dae7a141b..6927bdaa438 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -4419,7 +4419,8 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh 
*dm)
if (!ob->sculpt)
return NULL;
 
-   grid_pbvh = ccgDM_use_grid_pbvh(ccgdm);
+   /* In vwpaint, we always use a grid_pbvh for multires/subsurf */
+   grid_pbvh = (!(ob->mode & OB_MODE_SCULPT)) || 
ccgDM_use_grid_pbvh(ccgdm);
 
if (ob->sculpt->pbvh) {
if (grid_pbvh) {
@@ -4441,8 +4442,8 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh 
*dm)
/* no pbvh exists yet, we need to create one. only in case of multires
 * we build a pbvh over the modified mesh, in other cases the base mesh
 * is being sculpted, so we build a pbvh from that. */
-   /* Note: VWPaint do not support PBVH_GRIDS at the moment. */
-   if (grid_pbvh && ob->mode & OB_MODE_SCULPT) {
+   /* Note: vwpaint always builds a pbvh over the modified mesh. */
+   if (grid_pbvh) {
ccgdm_create_grids(dm);
 
numGrids = ccgDM_getNumGrids(dm);
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c 
b/source/blender/editors/sculpt_paint/paint_vertex.c
index f0e275a00d1..5ee2ae12b18 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -81,6 +81,8 @@
 
 #include "bmesh.h"
 #include "bmesh_tools.h"
+#include "BKE_subsurf.h"
+#include "BKE_ccg.h"
 
 /* small structure to defer applying weight-paint results */
 struct WPaintDefer {
@@ -1656,9 +1658,10 @@ static void do_weight_paint_vertex(
 /   copied from sculpt.c  /
 static void vertex_paint_init_session(Scene *scene, Object *ob)
 {
-   if (!ob->sculpt)
- ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
-   BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 
0, false);
+   if (!ob->sculpt) {
+   ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt 
session");
+   BKE_sculpt_update_mesh_elements(scene, 

[Bf-blender-cvs] [e7efe5c4b0f] soc-2016-pbvh-painting: added union in sculpt session for modes. Sculpt fields could use some tidying, but that might be outside the scope of this branch. Swapped out so

2017-04-05 Thread Nathan Vollmer
Commit: e7efe5c4b0f32e661add59b40bb678df92d096ec
Author: Nathan Vollmer
Date:   Wed Apr 5 04:11:26 2017 -0600
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rBe7efe5c4b0f32e661add59b40bb678df92d096ec

added union in sculpt session for modes. Sculpt fields could use some tidying, 
but that might be outside the scope of this branch. Swapped out some free 
patterns with MEM_SAFE_FREE. Swapped a long out for an int, since there's no 
size difference.

===

M   source/blender/blenkernel/BKE_paint.h
M   source/blender/blenkernel/intern/object.c
M   source/blender/blenkernel/intern/paint.c
M   source/blender/editors/sculpt_paint/paint_vertex.c

===

diff --git a/source/blender/blenkernel/BKE_paint.h 
b/source/blender/blenkernel/BKE_paint.h
index d8ef476988c..cac56ae66af 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -204,17 +204,24 @@ typedef struct SculptSession {
struct SculptStroke *stroke;
struct StrokeCache *cache;
 
-   int *vert_map_mem;
-   MeshElemMap *vert_to_loop;
-   int *poly_map_mem;
-   MeshElemMap *vert_to_poly;
-
-   unsigned int *total_color;
-   double *total_weight;
-   unsigned int *tot_loops_hit;
-   float *max_weight;
-   unsigned int *previous_color;
-   bool building_vp_handle;
+   union {
+   struct {
+   int *vert_map_mem;
+   MeshElemMap *vert_to_loop;
+   int *poly_map_mem;
+   MeshElemMap *vert_to_poly;
+
+   unsigned int *total_color;
+   double *total_weight;
+   unsigned int *tot_loops_hit;
+   float *max_weight;
+   unsigned int *previous_color;
+   bool building_vp_handle;
+   } vwpaint;
+   //struct {
+   //ToDo: identify sculpt-only fields
+   //} sculpt;
+   } modes;
 } SculptSession;
 
 void BKE_sculptsession_free(struct Object *ob);
diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index 1554ff3d75f..9e7427394be 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2740,7 +2740,7 @@ void BKE_object_sculpt_modifiers_changed(Object *ob)
 {
SculptSession *ss = ob->sculpt;
 
-   if (ss && ss->building_vp_handle == false) {
+   if (ss && ss->modes.vwpaint.building_vp_handle == false) {
if (!ss->cache) {
/* we free pbvh on changes, except during sculpt since 
it can't deal with
 * changing PVBH node organization, we hope topology 
does not change in
diff --git a/source/blender/blenkernel/intern/paint.c 
b/source/blender/blenkernel/intern/paint.c
index 07fe63929cd..d10a1830ea9 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -658,44 +658,17 @@ void BKE_sculptsession_free_deformMats(SculptSession *ss)
 
 void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss) {
/* Free maps */
-   if (ss->vert_to_loop) {
-   MEM_freeN(ss->vert_to_loop);
-   ss->vert_to_loop = NULL;
-   }
-   if (ss->vert_map_mem) {
-   MEM_freeN(ss->vert_map_mem);
-   ss->vert_map_mem = NULL;
-   }
-   if (ss->vert_to_poly) {
-   MEM_freeN(ss->vert_to_poly);
-   ss->vert_to_poly = NULL;
-   }
-   if (ss->poly_map_mem) {
-   MEM_freeN(ss->poly_map_mem);
-   ss->poly_map_mem = NULL;
-   }
+   MEM_SAFE_FREE(ss->modes.vwpaint.vert_to_loop);
+   MEM_SAFE_FREE(ss->modes.vwpaint.vert_map_mem);
+   MEM_SAFE_FREE(ss->modes.vwpaint.vert_to_poly);
+   MEM_SAFE_FREE(ss->modes.vwpaint.poly_map_mem);
 
/* Free average, blur, and spray brush arrays */
-   if (ss->tot_loops_hit) {
-   MEM_freeN(ss->tot_loops_hit);
-   ss->tot_loops_hit = NULL;
-   }
-   if (ss->total_color) {
-   MEM_freeN(ss->total_color);
-   ss->total_color = NULL;
-   }
-   if (ss->total_weight) {
-   MEM_freeN(ss->total_weight);
-   ss->total_weight = NULL;
-   }
-   if (ss->max_weight) {
-   MEM_freeN(ss->max_weight);
-   ss->max_weight = NULL;
-   }
-   if (ss->previous_color) {
-   MEM_freeN(ss->previous_color);
-   ss->previous_color = NULL;
-   }
+   MEM_SAFE_FREE(ss->modes.vwpaint.tot_loops_hit);
+   MEM_SAFE_FREE(ss->modes.vwpaint.total_color);
+   MEM_SAFE_FREE(ss->modes.vwpaint.total_weight);
+   MEM_SAFE_FREE(ss->modes.vwpaint.max_weight);
+   

[Bf-blender-cvs] [ba5b792dd99] blender2.8: Depsgraph: Remove all layer bit flags related checks

2017-04-05 Thread Sergey Sharybin
Commit: ba5b792dd997d634c0901bddbca4ebb82d6ebbbe
Author: Sergey Sharybin
Date:   Wed Apr 5 11:11:44 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBba5b792dd997d634c0901bddbca4ebb82d6ebbbe

Depsgraph: Remove all layer bit flags related checks

These bits became obsolete with the new layer system, so we can
simplify some code around them or avoid existing workarounds which
were trying to keep things working for them.

There are still work needed to be done for on_visible_change to
avoid unnecessary updates, but that can also happen later.

===

M   source/blender/alembic/intern/abc_exporter.cc
M   source/blender/alembic/intern/alembic_capi.cc
M   source/blender/blenkernel/BKE_collision.h
M   source/blender/blenkernel/BKE_scene.h
M   source/blender/blenkernel/intern/anim.c
M   source/blender/blenkernel/intern/collision.c
M   source/blender/blenkernel/intern/pointcache.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenkernel/intern/sequencer.c
M   source/blender/collada/AnimationExporter.cpp
M   source/blender/depsgraph/DEG_depsgraph.h
M   source/blender/depsgraph/DEG_depsgraph_build.h
M   source/blender/depsgraph/intern/builder/deg_builder.cc
M   source/blender/depsgraph/intern/builder/deg_builder.h
M   source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M   source/blender/depsgraph/intern/builder/deg_builder_relations.h
M   source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc
M   source/blender/depsgraph/intern/depsgraph.cc
M   source/blender/depsgraph/intern/depsgraph.h
M   source/blender/depsgraph/intern/depsgraph_build.cc
M   source/blender/depsgraph/intern/depsgraph_eval.cc
M   source/blender/depsgraph/intern/depsgraph_tag.cc
M   source/blender/depsgraph/intern/eval/deg_eval.cc
M   source/blender/depsgraph/intern/eval/deg_eval.h
M   source/blender/depsgraph/intern/nodes/deg_node.cc
M   source/blender/depsgraph/intern/nodes/deg_node.h
M   source/blender/depsgraph/intern/nodes/deg_node_component.cc
M   source/blender/depsgraph/intern/nodes/deg_node_component.h
M   source/blender/editors/render/render_opengl.c
M   source/blender/editors/screen/screen_edit.c
M   source/blender/editors/sound/sound_ops.c
M   source/blender/editors/space_view3d/view3d_view.c
M   source/blender/makesrna/intern/rna_scene_api.c
M   source/blender/modifiers/intern/MOD_cloth.c
M   source/blender/modifiers/intern/MOD_dynamicpaint.c
M   source/blender/modifiers/intern/MOD_smoke.c
M   source/blender/modifiers/intern/MOD_softbody.c
M   source/blender/render/intern/source/convertblender.c
M   source/blender/render/intern/source/external_engine.c
M   source/blender/render/intern/source/pipeline.c
M   source/blender/windowmanager/intern/wm_operators.c

===

diff --git a/source/blender/alembic/intern/abc_exporter.cc 
b/source/blender/alembic/intern/abc_exporter.cc
index ffe92c65587..31d946ddc1c 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -588,5 +588,5 @@ void AbcExporter::setCurrentFrame(Main *bmain, double t)
 {
m_scene->r.cfra = static_cast(t);
m_scene->r.subframe = static_cast(t) - m_scene->r.cfra;
-   BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, m_scene, 
m_scene->lay);
+   BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, m_scene);
 }
diff --git a/source/blender/alembic/intern/alembic_capi.cc 
b/source/blender/alembic/intern/alembic_capi.cc
index 20bdeeb96a7..91687db4334 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -296,8 +296,7 @@ static void export_startjob(void *customdata, short *stop, 
short *do_update, flo
if (CFRA != orig_frame) {
CFRA = orig_frame;
 
-   BKE_scene_update_for_newframe(data->bmain->eval_ctx, 
data->bmain,
- scene, scene->lay);
+   BKE_scene_update_for_newframe(data->bmain->eval_ctx, 
data->bmain, scene);
}
}
catch (const std::exception ) {
diff --git a/source/blender/blenkernel/BKE_collision.h 
b/source/blender/blenkernel/BKE_collision.h
index 8fedcd4ab06..0bf7f657f70 100644
--- a/source/blender/blenkernel/BKE_collision.h
+++ b/source/blender/blenkernel/BKE_collision.h
@@ -148,7 +148,7 @@ void collision_get_collider_velocity(float vel_old[3], 
float vel_new[3], struct
 /
 
 /* explicit control over layer mask and dupli recursion */
-struct Object **get_collisionobjects_ext(struct Scene *scene, struct Object 
*self, struct 

[Bf-blender-cvs] [0b6876d1e9c] custom-manipulators: Remove USE_IMM ifdefs

2017-04-05 Thread Campbell Barton
Commit: 0b6876d1e9cb42d96030cb50051d0cb58bcabe9c
Author: Campbell Barton
Date:   Wed Apr 5 19:41:16 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB0b6876d1e9cb42d96030cb50051d0cb58bcabe9c

Remove USE_IMM ifdefs

===

M   
source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
M   
source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c

===

diff --git 
a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
 
b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
index 3011c4cabac..0fc788256c4 100644
--- 
a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
+++ 
b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
@@ -65,12 +65,6 @@
 #include "manipulator_geometry.h"
 #include "manipulator_library_intern.h"
 
-#define USE_IMM
-
-#ifndef USE_IMM
-#  include 
-#endif
-
 /* to use custom arrows exported to geom_arrow_manipulator.c */
 //#define MANIPULATOR_USE_CUSTOM_ARROWS
 
@@ -163,26 +157,16 @@ static void arrow_draw_geom(const ArrowManipulator 
*arrow, const bool select, co
 
/* *** draw arrow head *** */
 
-#ifdef USE_IMM
gpuPushMatrix();
-#else
-   glPushMatrix();
-#endif
 
if (arrow->style & MANIPULATOR_ARROW_STYLE_BOX) {
const float size = 0.05f;
 
-#ifdef USE_IMM
/* translate to line end with some extra offset so box 
starts exactly where line ends */
gpuTranslate3f(0.0f, 0.0f, arrow->len + size);
/* scale down to box size */
gpuScale3f(size, size, size);
-#else
-   /* translate to line end with some extra offset so box 
starts exactly where line ends */
-   glTranslatef(0.0f, 0.0f, arrow->len + size);
-   /* scale down to box size */
-   glScalef(size, size, size);
-#endif
+
/* draw cube */
wm_manipulator_geometryinfo_draw(_draw_info, 
select);
}
@@ -192,47 +176,27 @@ static void arrow_draw_geom(const ArrowManipulator 
*arrow, const bool select, co
const bool use_lighting = select == false && 
((U.manipulator_flag & V3D_SHADED_MANIPULATORS) != 0);
 
/* translate to line end */
-#ifdef USE_IMM
-   UNUSED_VARS(use_lighting);
unsigned int pos = add_attrib(immVertexFormat(), "pos", 
GL_FLOAT, 3, KEEP_FLOAT);
gpuTranslate3f(0.0f, 0.0f, arrow->len);
 
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
immUniformColor4fv(color);
-#else
-   glTranslatef(0.0f, 0.0f, arrow->len);
+
if (use_lighting) {
glShadeModel(GL_SMOOTH);
}
-#endif
 
-#ifdef USE_IMM
imm_draw_circle_fill_3d(pos, 0.0, 0.0, width, 8);
imm_draw_cylinder_fill_3d(pos, width, 0.0, len, 8, 1);
-#else
-   GLUquadricObj *qobj = gluNewQuadric();
-   gluQuadricDrawStyle(qobj, GLU_FILL);
-   gluQuadricOrientation(qobj, GLU_INSIDE);
-   gluDisk(qobj, 0.0, width, 8, 1);
-   gluQuadricOrientation(qobj, GLU_OUTSIDE);
-   gluCylinder(qobj, width, 0.0, len, 8, 1);
-   gluDeleteQuadric(qobj);
-#endif
 
-#ifdef USE_IMM
immUnbindProgram();
-#else
+
if (use_lighting) {
glShadeModel(GL_FLAT);
}
-#endif
}
 
-#ifdef USE_IMM
gpuPopMatrix();
-#else
-   glPopMatrix();
-#endif
 
 #endif  /* MANIPULATOR_USE_CUSTOM_ARROWS */
}
@@ -261,29 +225,16 @@ static void arrow_draw_intern(ArrowManipulator *arrow, 
const bool select, const
copy_v3_v3(mat[3], final_pos);
mul_mat3_m4_fl(mat, arrow->manipulator.scale);
 
-#ifdef USE_IMM
gpuPushMatrix();
gpuMultMatrix3D(mat);
-#else
-   glPushMatrix();
-   glMultMatrixf(mat);
-#endif
 
-#ifdef USE_IMM
gpuTranslate3fv(arrow->manipulator.offset);
-#else
-   glTranslatef(UNPACK3(arrow->manipulator.offset));
-#endif
 
glEnable(GL_BLEND);
arrow_draw_geom(arrow, select, col);
glDisable(GL_BLEND);
 
-#ifdef USE_IMM
gpuPopMatrix();
-#else
-   glPopMatrix();
-#endif
 
if (arrow->manipulator.interaction_data) {
ManipulatorInteraction *inter = 

[Bf-blender-cvs] [9f643efc66b] custom-manipulators: Finish of removal of GLU deps

2017-04-05 Thread Campbell Barton
Commit: 9f643efc66b73e93e99510bfc35e228ee7bc2762
Author: Campbell Barton
Date:   Wed Apr 5 19:31:05 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB9f643efc66b73e93e99510bfc35e228ee7bc2762

Finish of removal of GLU deps

Will commit full removal next

===

M   CMakeLists.txt
M   
source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47fb65daafb..4fe6df2c67b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1052,11 +1052,6 @@ endif()
 find_package(OpenGL)
 blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
 
-# IMM-FIXME
-if(TRUE)
-   list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_glu_LIBRARY}")
-endif()
-
 if(WITH_SYSTEM_GLES)
find_package_wrapper(OpenGLES)
 endif()
diff --git 
a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
 
b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
index f20c3cc2317..3011c4cabac 100644
--- 
a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
+++ 
b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
@@ -46,8 +46,11 @@
 #include "ED_view3d.h"
 #include "ED_screen.h"
 
-#include "GPU_select.h"
+#include "GPU_draw.h"
+#include "GPU_immediate.h"
+#include "GPU_immediate_util.h"
 #include "GPU_matrix.h"
+#include "GPU_select.h"
 
 #include "MEM_guardedalloc.h"
 
@@ -62,7 +65,7 @@
 #include "manipulator_geometry.h"
 #include "manipulator_library_intern.h"
 
-// #define USE_IMM
+#define USE_IMM
 
 #ifndef USE_IMM
 #  include 
@@ -109,11 +112,8 @@ static void manipulator_arrow_get_final_pos(wmManipulator 
*manipulator, float r_
 
 static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select, 
const float color[4])
 {
-
-#ifdef USE_IMM
-#else
+   /* USE_IMM for other arrow types */
glColor4fv(color);
-#endif
 
if (arrow->style & MANIPULATOR_ARROW_STYLE_CROSS) {
glPushAttrib(GL_ENABLE_BIT);
@@ -193,16 +193,22 @@ static void arrow_draw_geom(const ArrowManipulator 
*arrow, const bool select, co
 
/* translate to line end */
 #ifdef USE_IMM
+   UNUSED_VARS(use_lighting);
+   unsigned int pos = add_attrib(immVertexFormat(), "pos", 
GL_FLOAT, 3, KEEP_FLOAT);
gpuTranslate3f(0.0f, 0.0f, arrow->len);
+
+   immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
+   immUniformColor4fv(color);
 #else
glTranslatef(0.0f, 0.0f, arrow->len);
-#endif
if (use_lighting) {
glShadeModel(GL_SMOOTH);
}
+#endif
 
 #ifdef USE_IMM
-   // IMM-FIXME
+   imm_draw_circle_fill_3d(pos, 0.0, 0.0, width, 8);
+   imm_draw_cylinder_fill_3d(pos, width, 0.0, len, 8, 1);
 #else
GLUquadricObj *qobj = gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_FILL);
@@ -213,9 +219,13 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, 
const bool select, co
gluDeleteQuadric(qobj);
 #endif
 
+#ifdef USE_IMM
+   immUnbindProgram();
+#else
if (use_lighting) {
glShadeModel(GL_FLAT);
}
+#endif
}
 
 #ifdef USE_IMM

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


[Bf-blender-cvs] [e4c5441286f] master: Locales: Some optimization work

2017-04-05 Thread Sergey Sharybin
Commit: e4c5441286f3562127c85dd20eea0a89679db900
Author: Sergey Sharybin
Date:   Wed Apr 5 11:25:58 2017 +0200
Branches: master
https://developer.blender.org/rBe4c5441286f3562127c85dd20eea0a89679db900

Locales: Some optimization work

Mainly visible for MSVC debug builds and gives about 2x speedup.

===

M   intern/locale/msgfmt.cc

===

diff --git a/intern/locale/msgfmt.cc b/intern/locale/msgfmt.cc
index 4779450bd1b..6ee1ee14781 100644
--- a/intern/locale/msgfmt.cc
+++ b/intern/locale/msgfmt.cc
@@ -27,42 +27,48 @@ namespace {
 
 std::map MESSAGES;
 
-bool starts_with(const std::string ,
+bool starts_with(const std::string ,
  const std::string ) {
-  return prefix.size() <= string.size() &&
- string.compare(0, prefix.size(), prefix) == 0;
+  const size_t prefix_length = prefix.length();
+  if (prefix_length == 0) {
+return true;
+  }
+  // TODO(sergey): Could be optimized if we calculate str.length()
+  // to maximum of prefix_length characters.
+  if (prefix_length > str.length()) {
+return false;
+  } else {
+return str.compare(0, prefix_length, prefix) == 0;
+  }
 }
 
-std::string ltrim(const std::string ) {
-  std::string result = s;
-  result.erase(result.begin(),
-   std::find_if(result.begin(),
-result.end(),
-std::not1(std::ptr_fun(std::isspace;
+std::string ltrim(const std::string ) {
+  std::string result = str;
+  result.erase(0, result.find_first_not_of(" \t\r\n"));
   return result;
 }
 
-std::string rtrim(const std::string ) {
-  std::string result = s;
-  result.erase(
-std::find_if(result.rbegin(),
- result.rend(),
- std::not1(std::ptr_fun(std::isspace))).base(),
-result.end());
+std::string rtrim(const std::string ) {
+  std::string result = str;
+  result.erase(result.find_last_not_of(" \t\r\n") + 1);
   return result;
 }
 
-std::string trim(const std::string ) {
-  return ltrim(rtrim(s));
+std::string trim(const std::string ) {
+  std::string result = str;
+  result.erase(0, result.find_first_not_of(" \t\r\n"));
+  result.erase(result.find_last_not_of(" \t\r\n") + 1);
+  return result;
 }
 
-std::string unescape(const std::string ) {
+std::string unescape(const std::string ) {
   std::string result;
-  std::string::const_iterator it = s.begin();
-  while (it != s.end()) {
-char current_char = *it++;
-if (current_char == '\\' && it != s.end()) {
-  char next_char = *it++;
+  const size_t str_length = str.length();
+  size_t i = 0;
+  while (i < str_length) {
+char current_char = str[i++];
+if (current_char == '\\' && i < str_length - 1) {
+  char next_char = str[i++];
   if (next_char == '\\') {
 current_char = '\\';
   } else if (next_char == 'n') {
@@ -76,8 +82,9 @@ std::string unescape(const std::string ) {
 result += current_char;
   }
 
-  if (result[0] == '"' && result[result.size() - 1] == '"') {
-result = result.substr(1, result.size() - 2);
+  const size_t result_length = result.length();
+  if (result[0] == '"' && result[result_length - 1] == '"') {
+result = result.substr(1, result_length - 2);
   }
 
   return result;
@@ -100,6 +107,7 @@ void add(const std::string ,
 template
 void get_keys(std::map map,
   std::vector *keys) {
+  keys->reserve(map.size());
   for (typename std::map::iterator it = map.begin();
   it != map.end();
   it++) {
@@ -136,6 +144,7 @@ std::string generate(void) {
   std::sort(keys.begin(), keys.end());
 
   std::vector offsets;
+  offsets.reserve(keys.size());
   std::string ids = "", strs = "";
   for (std::vector::iterator it = keys.begin();
it != keys.end();
@@ -160,6 +169,8 @@ std::string generate(void) {
   int valuestart = keystart + ids.size();
   std::vector koffsets;
   std::vector voffsets;
+  koffsets.reserve(offsets.size() * 2);
+  voffsets.reserve(offsets.size() * 2);
   // The string table first has the list of keys, then the list of values.
   // Each entry has first the size of the string, then the file offset.
   for (std::vector::iterator it = offsets.begin();

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


[Bf-blender-cvs] [124b21f200a] custom-manipulators: Merge branch 'blender2.8' into custom-manipulators

2017-04-05 Thread Campbell Barton
Commit: 124b21f200aa3cfe388f088dcc38646e234e24a8
Author: Campbell Barton
Date:   Wed Apr 5 19:01:48 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB124b21f200aa3cfe388f088dcc38646e234e24a8

Merge branch 'blender2.8' into custom-manipulators

===



===

diff --cc 
source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
index 7f061ee7501,000..61412ef602d
mode 100644,00..100644
--- 
a/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
+++ 
b/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
@@@ -1,465 -1,0 +1,466 @@@
 +/*
 + * * 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 Blender Foundation.
 + * All rights reserved.
 + *
 + * Contributor(s): Blender Foundation
 + *
 + * * END GPL LICENSE BLOCK *
 + */
 +
 +/** \file 
blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
 + *  \ingroup wm
 + *
 + * \name Dial Manipulator
 + *
 + * 3D Manipulator
 + *
 + * \brief Circle shaped manipulator for circular interaction.
 + * Currently no own handling, use with operator only.
 + */
 +
 +#include "BIF_gl.h"
 +#include "BIF_glutil.h"
 +
 +#include "BKE_context.h"
 +
 +#include "BLI_math.h"
 +
 +#include "DNA_manipulator_types.h"
 +
 +#include "ED_screen.h"
 +#include "ED_view3d.h"
 +
 +#include "GPU_select.h"
 +
 +#include "GPU_matrix.h"
 +
 +#include "GPU_immediate.h"
++#include "GPU_immediate_util.h"
 +
 +#include "MEM_guardedalloc.h"
 +
 +#include "WM_api.h"
 +#include "WM_types.h"
 +
 +/* own includes */
 +#include "WM_manipulator_types.h"
 +#include "WM_manipulator_library.h"
 +#include "wm_manipulator_wmapi.h"
 +#include "wm_manipulator_intern.h"
 +#include "manipulator_geometry.h"
 +#include "manipulator_library_intern.h"
 +
 +#define USE_IMM
 +
 +#ifndef USE_IMM
 +#include 
 +#endif
 +
 +/* to use custom dials exported to geom_dial_manipulator.c */
 +//#define MANIPULATOR_USE_CUSTOM_DIAS
 +
 +#ifdef MANIPULATOR_USE_CUSTOM_DIAS
 +ManipulatorGeometryInfo dial_draw_info = {0};
 +#endif
 +
 +typedef struct DialManipulator {
 +  wmManipulator manipulator;
 +  int style;
 +  float direction[3];
 +} DialManipulator;
 +
 +typedef struct DialInteraction {
 +  float init_mval[2];
 +
 +  /* cache the last angle to detect rotations bigger than -/+ PI */
 +  float last_angle;
 +  /* number of full rotations */
 +  int rotations;
 +} DialInteraction;
 +
 +#define DIAL_WIDTH   1.0f
 +#define DIAL_RESOLUTION 32
 +
 +/*  */
 +
 +static void dial_geom_draw(
 +const DialManipulator *dial, const float col[4], const bool select,
 +float axis_modal_mat[4][4], float clip_plane[4])
 +{
 +#ifdef MANIPULATOR_USE_CUSTOM_DIAS
 +  wm_manipulator_geometryinfo_draw(_draw_info, select);
 +#else
 +  const bool filled = (dial->style == MANIPULATOR_DIAL_STYLE_RING_FILLED);
 +
 +  glLineWidth(dial->manipulator.line_width);
 +
 +#ifdef USE_IMM
 +  {
 +  VertexFormat *format = immVertexFormat();
 +  unsigned int pos = add_attrib(format, "pos", GL_FLOAT, 2, 
KEEP_FLOAT);
 +
 +  if (clip_plane) {
 +  
immBindBuiltinProgram(GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR);
 +  float clip_plane_f[4] = {clip_plane[0], clip_plane[1], 
clip_plane[2], clip_plane[3]};
 +  immUniform4fv("ClipPlane", clip_plane_f);
 +  immUniformMatrix4fv("ModelMatrix", axis_modal_mat);
 +  glEnable(GL_CLIP_DISTANCE0);
 +  }
 +  else {
 +  immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
 +  }
 +
 +  immUniformColor4fv(col);
 +
 +  if (filled) {
-   imm_draw_filled_circle(pos, 0, 0, 1.0, DIAL_RESOLUTION);
++  imm_draw_circle_fill(pos, 0, 0, 1.0, DIAL_RESOLUTION);
 +  }
 +  else {
-

[Bf-blender-cvs] [1f6037c8878] blender2.8: Fix T50976: Blender UI problems with certain theme files.

2017-04-05 Thread Bastien Montagne
Commit: 1f6037c887863e67a5a8b211738e04fd6dce16ad
Author: Bastien Montagne
Date:   Wed Apr 5 10:59:46 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB1f6037c887863e67a5a8b211738e04fd6dce16ad

Fix T50976: Blender UI problems with certain theme files.

Core of the issue was that some of our Theme colors are RGB-only, but
were loaded as RGBA.

Note that tracking all possible cases is pretty impossible, so we'll
have to tackle those as they get reported am afraid.

===

M   source/blender/editors/interface/interface_panel.c
M   source/blender/gpu/GPU_immediate.h
M   source/blender/gpu/intern/gpu_immediate.c
M   source/blenderplayer/bad_level_call_stubs/stubs.c

===

diff --git a/source/blender/editors/interface/interface_panel.c 
b/source/blender/editors/interface/interface_panel.c
index 6f1d8c36d1f..5030b1d1e73 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -414,7 +414,8 @@ void UI_draw_icon_tri(float x, float y, char dir, const 
float color[4])
 static void ui_draw_tria_rect(const rctf *rect, char dir)
 {
float color[4];
-   UI_GetThemeColor4fv(TH_TITLE, color);
+   UI_GetThemeColor3fv(TH_TITLE, color);
+   color[3] = 1.0f;
 
if (dir == 'h') {
float half = 0.5f * BLI_rctf_size_y(rect);
@@ -553,7 +554,8 @@ static void ui_draw_aligned_panel_header(uiStyle *style, 
uiBlock *block, const r
pnl_icons = (panel->labelofs + PNL_ICON + 5) / block->aspect + 
0.001f;
 
/* draw text label */
-   UI_GetThemeColor4ubv(TH_TITLE, col_title);
+   UI_GetThemeColor3ubv(TH_TITLE, col_title);
+   col_title[3] = 255;
 
hrect = *rect;
if (dir == 'h') {
@@ -718,7 +720,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, 
const rcti *rect, con
if (panel->control & UI_PNL_CLOSE) {
const int ofsx = 6;
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
-   immUniformThemeColor(TH_TITLE);
+   immUniformThemeColor3(TH_TITLE);
ui_draw_x_icon(pos, rect->xmin + 2 + ofsx, rect->ymax + 2);
immUnbindProgram();
}
diff --git a/source/blender/gpu/GPU_immediate.h 
b/source/blender/gpu/GPU_immediate.h
index 35964a81030..28522da5f28 100644
--- a/source/blender/gpu/GPU_immediate.h
+++ b/source/blender/gpu/GPU_immediate.h
@@ -47,6 +47,7 @@ void immBindBuiltinProgram(GPUBuiltinShader shader_id);
  * Extend immUniformColor to take Blender's themes
  */
 void immUniformThemeColor(int color_id);
+void immUniformThemeColor3(int color_id);
 void immUniformThemeColorShade(int color_id, int offset);
 void immUniformThemeColorShadeAlpha(int color_id, int color_offset, int 
alpha_offset);
 void immUniformThemeColorBlendShade(int color_id1, int color_id2, float fac, 
int offset);
diff --git a/source/blender/gpu/intern/gpu_immediate.c 
b/source/blender/gpu/intern/gpu_immediate.c
index 5188ca4c0e2..34d32be15ed 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -45,6 +45,13 @@ void immUniformThemeColor(int color_id)
immUniformColor4fv(color);
 }
 
+void immUniformThemeColor3(int color_id)
+{
+   float color[3];
+   UI_GetThemeColor3fv(color_id, color);
+   immUniformColor3fv(color);
+}
+
 void immUniformThemeColorShade(int color_id, int offset)
 {
float color[4];
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c 
b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 66b7f23c2f9..aa3b89c6fdf 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -600,6 +600,7 @@ const char *uiLayoutIntrospect(uiLayout *layout) RET_NULL
 void UI_reinit_font(void) RET_NONE
 int UI_rnaptr_icon_get(struct bContext *C, struct PointerRNA *ptr, int 
rnaicon, const bool big) RET_ZERO
 struct bTheme *UI_GetTheme(void) RET_NULL
+void UI_GetThemeColor3fv(int colorid, float col[4]) RET_NONE
 void UI_GetThemeColor4fv(int colorid, float col[4]) RET_NONE
 void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4]) RET_NONE
 void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int 
alphaoffset, float col[4]) RET_NONE

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


[Bf-blender-cvs] [2f700b82804] blender2.8: GPU_immediate_util: missed last commit

2017-04-05 Thread Campbell Barton
Commit: 2f700b828049fe5b2d1d0f3d4bc24f37de59e1a2
Author: Campbell Barton
Date:   Wed Apr 5 18:53:34 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB2f700b828049fe5b2d1d0f3d4bc24f37de59e1a2

GPU_immediate_util: missed last commit

===

M   source/blender/editors/gpencil/gpencil_brush.c
M   source/blender/editors/gpencil/gpencil_paint.c
M   source/blender/editors/interface/interface_draw.c
M   source/blender/editors/interface/interface_widgets.c
M   source/blender/editors/physics/particle_edit.c
M   source/blender/editors/screen/screendump.c
M   source/blender/editors/sculpt_paint/paint_cursor.c
M   source/blender/editors/sculpt_paint/sculpt_uv.c
M   source/blender/editors/space_clip/clip_graph_draw.c
M   source/blender/editors/space_view3d/view3d_ruler.c
M   source/blender/gpu/GPU_immediate_util.h
M   source/blender/gpu/intern/gpu_immediate_util.c
M   source/blender/windowmanager/intern/wm_operators.c

===

diff --git a/source/blender/editors/gpencil/gpencil_brush.c 
b/source/blender/editors/gpencil/gpencil_brush.c
index bfa5d089fb0..5e72ec5f39f 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -970,11 +970,11 @@ static void gp_brush_drawcursor(bContext *C, int x, int 
y, void *UNUSED(customda
/* Inner Ring: Light color for action of the brush */
/* TODO: toggle between add and remove? */
immUniformColor4ub(255, 255, 255, 200);
-   imm_draw_lined_circle(pos, x, y, brush->size, 40);
+   imm_draw_circle_wire(pos, x, y, brush->size, 40);
 
/* Outer Ring: Dark color for contrast on light backgrounds 
(e.g. gray on white) */
immUniformColor3ub(30, 30, 30);
-   imm_draw_lined_circle(pos, x, y, brush->size + 1, 40);
+   imm_draw_circle_wire(pos, x, y, brush->size + 1, 40);
 
immUnbindProgram();
 
diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 3e5d82f002c..db1a51ea4e6 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1858,7 +1858,7 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int 
x, int y, void *p_ptr)
setlinestyle(6); /* TODO: handle line stipple in shader */
 
immUniformColor4ub(255, 100, 100, 200);
-   imm_draw_lined_circle(pos, x, y, p->radius, 40);
+   imm_draw_circle_wire(pos, x, y, p->radius, 40);
 
immUnbindProgram();
 
diff --git a/source/blender/editors/interface/interface_draw.c 
b/source/blender/editors/interface/interface_draw.c
index 99db2747033..643470dd3cf 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1478,7 +1478,7 @@ void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors 
*wcol, const rcti *rect)
 
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
-   imm_draw_lined_circle(pos, 0.0f, 0.0f, 1.0f, 32);
+   imm_draw_circle_wire(pos, 0.0f, 0.0f, 1.0f, 32);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
 
diff --git a/source/blender/editors/interface/interface_widgets.c 
b/source/blender/editors/interface/interface_widgets.c
index 114200676ed..c595bc607a3 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2274,7 +2274,7 @@ static void ui_hsv_cursor(float x, float y)
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
immUniformColor3f(0.0f, 0.0f, 0.0f);
-   imm_draw_lined_circle(pos, x, y, 3.0f * U.pixelsize, 12);
+   imm_draw_circle_wire(pos, x, y, 3.0f * U.pixelsize, 12);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
 
@@ -2394,7 +2394,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, 
uiWidgetColors *wcol, const rcti *
glEnable(GL_LINE_SMOOTH);
 
immUniformColor3ubv((unsigned char *)wcol->outline);
-   imm_draw_lined_circle(pos, centx, centy, radius, tot);
+   imm_draw_circle_wire(pos, centx, centy, radius, tot);
 
immUnbindProgram();
 
@@ -4165,8 +4165,8 @@ void ui_draw_pie_center(uiBlock *block)
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4ubv((unsigned char *)btheme->tui.wcol_pie_menu.outline);
 
-   imm_draw_lined_circle(pos, 0.0f, 0.0f, pie_radius_internal, subd);
-   imm_draw_lined_circle(pos, 0.0f, 0.0f, pie_radius_external, subd);
+   imm_draw_circle_wire(pos, 0.0f, 0.0f, pie_radius_internal, subd);
+   imm_draw_circle_wire(pos, 0.0f, 0.0f, pie_radius_external, subd);
 
immUnbindProgram();
 
diff --git a/source/blender/editors/physics/particle_edit.c 

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

2017-04-05 Thread Bastien Montagne
Commit: e9bb018a4aea1b4aeb692cdadce158496a270e32
Author: Bastien Montagne
Date:   Wed Apr 5 10:02:25 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBe9bb018a4aea1b4aeb692cdadce158496a270e32

Merge branch 'master' into blender2.8

Conflicts:
source/blender/alembic/intern/abc_exporter.h

===



===

diff --cc source/blender/alembic/intern/abc_exporter.h
index 80fee067c04,f9fde99acd4..cf2a3432da9
--- a/source/blender/alembic/intern/abc_exporter.h
+++ b/source/blender/alembic/intern/abc_exporter.h
@@@ -43,7 -43,7 +45,8 @@@ struct ExportSettings 
ExportSettings();
  
Scene *scene;
 +  SceneLayer *sl;  // Scene layer to export; all its objects will be 
exported, unless selected_only=true
+   SimpleLogger logger;
  
bool selected_only;
bool visible_layers_only;
diff --cc source/blender/alembic/intern/alembic_capi.cc
index ee8ec0fa68c,6c6f64e1669..20bdeeb96a7
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@@ -331,14 -336,23 +336,30 @@@ void ABC_export
job->bmain = CTX_data_main(C);
BLI_strncpy(job->filename, filepath, 1024);
  
+   /* Alright, alright, alright
+*
+* ExportJobData contains an ExportSettings containing a SimpleLogger.
+*
+* Since ExportJobData is a C-style struct dynamically allocated with
+* MEM_mallocN (see above), its construtor is never called, therefore 
the
+* ExportSettings constructor is not called which implies that the
+* SimpleLogger one is not called either. SimpleLogger in turn does not 
call
+* the constructor of its data members which ultimately means that its
+* std::ostringstream member has a NULL pointer. To be able to properly 
use
+* the stream's operator<<, the pointer needs to be set, therefore we 
have
+* to properly construct everything. And this is done using the 
placement
+* new operator as here below. It seems hackish, but I'm too lazy to
+* do bigger refactor and maybe there is a better way which does not 
involve
+* hardcore refactoring. */
+   new (>settings) ExportSettings();
job->settings.scene = job->scene;
 +
 +  /* Sybren: for now we only export the active scene layer.
 +   * Later in the 2.8 development process this may be replaced by using
 +   * a specific collection for Alembic I/O, which can then be toggled
 +   * between "real" objects and cached Alembic files. */
 +  job->settings.sl = CTX_data_scene_layer(C);
 +
job->settings.frame_start = params->frame_start;
job->settings.frame_end = params->frame_end;
job->settings.frame_step_xform = params->frame_step_xform;

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


[Bf-blender-cvs] [4dadb6d4453] blender2.8: Naming constancy for 'imm' utility functions

2017-04-05 Thread Campbell Barton
Commit: 4dadb6d4453d84d537e25e753f7904ce5c8539fb
Author: Campbell Barton
Date:   Wed Apr 5 17:43:28 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB4dadb6d4453d84d537e25e753f7904ce5c8539fb

Naming constancy for 'imm' utility functions

- use 'imm_draw_' prefix for functions that draw.
- use '_3d' suffix for 3d functions, no suffix for 2d functions.
- use terms fill/wire (shorter than filled / lined).

Also add `imm_draw_circle_fill_3d` (only had wire version)

===

M   source/blender/editors/armature/editarmature_sketch.c
M   source/blender/editors/gpencil/gpencil_paint.c
M   source/blender/editors/include/BIF_glutil.h
M   source/blender/editors/interface/interface_widgets.c
M   source/blender/editors/screen/glutil.c
M   source/blender/editors/screen/screendump.c
M   source/blender/editors/space_view3d/drawarmature.c
M   source/blender/editors/space_view3d/drawobject.c
M   source/blender/windowmanager/intern/wm_gesture.c
M   source/blender/windowmanager/intern/wm_operators.c

===

diff --git a/source/blender/editors/armature/editarmature_sketch.c 
b/source/blender/editors/armature/editarmature_sketch.c
index f42ce147431..c5243b29255 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -478,7 +478,7 @@ static void sk_drawEdge(SK_Point *pt0, SK_Point *pt1, float 
size, float color[4]
 
angle = angle_normalized_v3v3(vec2, vec1);
gpuRotate3fv(angle * (float)(180.0 / M_PI) + 180.0f, axis);
-   imm_cylinder(pos, sk_clampPointSize(pt1, size), sk_clampPointSize(pt0, 
size), length, 8, 8);
+   imm_draw_cylinder_fill_3d(pos, sk_clampPointSize(pt1, size), 
sk_clampPointSize(pt0, size), length, 8, 8);
 
immUnbindProgram();
 }
@@ -506,7 +506,7 @@ static void sk_drawNormal(SK_Point *pt, float size, float 
height)
angle = angle_normalized_v3v3(vec2, pt->no);
gpuRotate3fv(angle * (float)(180.0 / M_PI), axis);
 
-   imm_cylinder(pos, sk_clampPointSize(pt, size), 0, sk_clampPointSize(pt, 
height), 10, 2);
+   imm_draw_cylinder_fill_3d(pos, sk_clampPointSize(pt, size), 0, 
sk_clampPointSize(pt, height), 10, 2);
 
immUnbindProgram();
 
diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 73f393537ba..ed1ffc13602 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1852,7 +1852,7 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int 
x, int y, void *p_ptr)
glEnable(GL_BLEND);
 
immUniformColor4ub(255, 100, 100, 20);
-   imm_draw_filled_circle(pos, x, y, p->radius, 40);
+   imm_draw_circle_fill(pos, x, y, p->radius, 40);
 
setlinestyle(6); /* TODO: handle line stipple in shader */
 
diff --git a/source/blender/editors/include/BIF_glutil.h 
b/source/blender/editors/include/BIF_glutil.h
index ebc6cd86479..7db32eb39a0 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -60,7 +60,8 @@ struct ColorManagedDisplaySettings;
 void imm_draw_lined_circle(unsigned pos, float x, float y, float radius, int 
nsegments);
 
 /* use this version when VertexFormat has a vec3 position */
-void imm_draw_lined_circle_3D(unsigned pos, float x, float y, float radius, 
int nsegments);
+void imm_draw_circle_wire_3d(unsigned pos, float x, float y, float radius, int 
nsegments);
+void imm_draw_circle_fill_3d(unsigned pos, float x, float y, float radius, int 
nsegments);
 
 /**
  * Draw a filled circle with the given \a radius.
@@ -72,7 +73,7 @@ void imm_draw_lined_circle_3D(unsigned pos, float x, float y, 
float radius, int
  * \param radius The circle's radius.
  * \param nsegments The number of segments to use in drawing (more = smoother).
  */
-void imm_draw_filled_circle(unsigned pos, float x, float y, float radius, int 
nsegments);
+void imm_draw_circle_fill(unsigned pos, float x, float y, float radius, int 
nsegments);
 
 /**
  * Draw a filled arc with the given inner and outer radius.
@@ -89,7 +90,7 @@ void imm_draw_filled_circle(unsigned pos, float x, float y, 
float radius, int ns
  * \param start: Specifies the starting angle, in degrees, of the disk portion.
  * \param sweep: Specifies the sweep angle, in degrees, of the disk portion.
  */
-void imm_draw_filled_disk_partial(
+void imm_draw_disk_partial_fill(
 unsigned pos, float x, float y,
 float radius_inner, float radius_outer, int nsegments, float start, 
float sweep);
 
@@ -105,7 +106,7 @@ void imm_draw_filled_disk_partial(
 void imm_draw_line_box(unsigned pos, float x1, float y1, float x2, float y2);
 
 /* use this version when VertexFormat has a vec3 position */
-void 

[Bf-blender-cvs] [8647d5af901] master: InstallDeps: Raise minimal & official version of OIIO to 1.7.13.

2017-04-05 Thread Bastien Montagne
Commit: 8647d5af9015097698984e9864802848914e803c
Author: Bastien Montagne
Date:   Wed Apr 5 09:26:41 2017 +0200
Branches: master
https://developer.blender.org/rB8647d5af9015097698984e9864802848914e803c

InstallDeps: Raise minimal & official version of OIIO to 1.7.13.

As requested by @sergey.

===

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 c65305703bf..7aaa37285c1 100755
--- a/build_files/build_environment/install_deps.sh
+++ b/build_files/build_environment/install_deps.sh
@@ -322,8 +322,8 @@ OPENEXR_FORCE_REBUILD=false
 OPENEXR_SKIP=false
 _with_built_openexr=false
 
-OIIO_VERSION="1.7.8"
-OIIO_VERSION_MIN="1.6.0"
+OIIO_VERSION="1.7.13"
+OIIO_VERSION_MIN="1.7.13"
 OIIO_VERSION_MAX="1.9.0"  # UNKNOWN currently # Not supported by current OSL...
 OIIO_FORCE_BUILD=false
 OIIO_FORCE_REBUILD=false

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


[Bf-blender-cvs] [9586e36fdc3] workspaces: Fix workspace mode syncing

2017-04-05 Thread Campbell Barton
Commit: 9586e36fdc38f24d6f2f8109620824f3cb9ecc45
Author: Campbell Barton
Date:   Wed Apr 5 16:39:01 2017 +1000
Branches: workspaces
https://developer.blender.org/rB9586e36fdc38f24d6f2f8109620824f3cb9ecc45

Fix workspace mode syncing

Toggling off a mode didn't correctly update the workspace.

===

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

===

diff --git a/source/blender/editors/object/object_edit.c 
b/source/blender/editors/object/object_edit.c
index 26f7170f7a4..fe232e37886 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1626,10 +1626,15 @@ void ED_object_toggle_modes(bContext *C, int mode)
if (opstring) {
 #ifdef USE_WORKSPACE_MODE
WorkSpace *workspace = CTX_wm_workspace(C);
-
-   BKE_workspace_object_mode_set(workspace, mode);
 #endif
WM_operator_name_call(C, opstring, 
WM_OP_EXEC_REGION_WIN, NULL);
+
+#ifdef USE_WORKSPACE_MODE
+   Object *ob = CTX_data_active_object(C);
+   if (ob) {
+   BKE_workspace_object_mode_set(workspace, 
ob->mode);
+   }
+#endif
}
}
 }

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


[Bf-blender-cvs] [6fa06bdb793] workspaces: Minor changes

2017-04-05 Thread Campbell Barton
Commit: 6fa06bdb7935692170f277f80cf8b6c9dfcacf21
Author: Campbell Barton
Date:   Tue Apr 4 23:49:21 2017 +1000
Branches: workspaces
https://developer.blender.org/rB6fa06bdb7935692170f277f80cf8b6c9dfcacf21

Minor changes

- Remove utildefines from BKE_workspace header
- doxy example are typically for code examples, just use heading
- wrap args, avoid right shift

===

M   source/blender/blenkernel/BKE_workspace.h
M   source/blender/blenkernel/intern/workspace.c
A   source/blender/makesdna/DNA_workspace_types.h
M   source/blender/makesdna/dna_workspace_types.h
M   source/blender/makesrna/intern/rna_workspace.c

===

diff --git a/source/blender/blenkernel/BKE_workspace.h 
b/source/blender/blenkernel/BKE_workspace.h
index 19166a6a5bd..c66952096d2 100644
--- a/source/blender/blenkernel/BKE_workspace.h
+++ b/source/blender/blenkernel/BKE_workspace.h
@@ -26,7 +26,6 @@
 #define __BKE_WORKSPACE_H__
 
 #include "BLI_compiler_attrs.h"
-#include "BLI_utildefines.h"
 
 struct bScreen;
 struct ListBase;
@@ -59,8 +58,10 @@ void BKE_workspace_remove(WorkSpace *workspace, struct Main 
*bmain);
 WorkSpaceInstanceHook *BKE_workspace_instance_hook_create(const struct Main 
*bmain);
 void BKE_workspace_instance_hook_free(WorkSpaceInstanceHook *hook, const 
struct Main *bmain);
 
-struct WorkSpaceLayout *BKE_workspace_layout_add(WorkSpace *workspace, struct 
bScreen *screen, const char *name) ATTR_NONNULL();
-void BKE_workspace_layout_remove(WorkSpace *workspace, WorkSpaceLayout 
*layout, struct Main *bmain) ATTR_NONNULL();
+struct WorkSpaceLayout *BKE_workspace_layout_add(
+WorkSpace *workspace, struct bScreen *screen, const char *name) 
ATTR_NONNULL();
+void BKE_workspace_layout_remove(
+WorkSpace *workspace, WorkSpaceLayout *layout, struct Main *bmain) 
ATTR_NONNULL();
 
 
 /*  */
@@ -71,11 +72,14 @@ void BKE_workspace_layout_remove(WorkSpace *workspace, 
WorkSpaceLayout *layout,
_workspace##_next = BKE_workspace_next_get(_workspace); /* 
support removing workspace from list */
 #define BKE_workspace_iter_end } (void)0
 
-void BKE_workspaces_transform_orientation_remove(const struct ListBase 
*workspaces,
- const struct 
TransformOrientation *orientation) ATTR_NONNULL();
+void BKE_workspaces_transform_orientation_remove(
+const struct ListBase *workspaces,
+const struct TransformOrientation *orientation) ATTR_NONNULL();
 
-WorkSpaceLayout *BKE_workspace_layout_find(const WorkSpace *ws, const struct 
bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-WorkSpaceLayout *BKE_workspace_layout_find_exec(const WorkSpace *ws, const 
struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+WorkSpaceLayout *BKE_workspace_layout_find(
+const WorkSpace *ws, const struct bScreen *screen) ATTR_NONNULL() 
ATTR_WARN_UNUSED_RESULT;
+WorkSpaceLayout *BKE_workspace_layout_find_exec(
+const WorkSpace *ws, const struct bScreen *screen) ATTR_NONNULL() 
ATTR_WARN_UNUSED_RESULT;
 
 #define BKE_workspace_layout_iter_begin(_layout, _start_layout) \
for (WorkSpaceLayout *_layout = _start_layout, *_layout##_next; 
_layout; _layout = _layout##_next) { \
@@ -85,9 +89,10 @@ WorkSpaceLayout *BKE_workspace_layout_find_exec(const 
WorkSpace *ws, const struc
_layout##_prev = BKE_workspace_layout_prev_get(_layout); /* 
support removing layout from list */
 #define BKE_workspace_layout_iter_end } (void)0
 
-WorkSpaceLayout *BKE_workspace_layout_iter_circular(const WorkSpace 
*workspace, WorkSpaceLayout *start,
-bool (*callback)(const 
WorkSpaceLayout *layout, void *arg),
-void *arg, const bool 
iter_backward);
+WorkSpaceLayout *BKE_workspace_layout_iter_circular(
+const WorkSpace *workspace, WorkSpaceLayout *start,
+bool (*callback)(const WorkSpaceLayout *layout, void *arg),
+void *arg, const bool iter_backward);
 
 
 /*  */
diff --git a/source/blender/blenkernel/intern/workspace.c 
b/source/blender/blenkernel/intern/workspace.c
index 1efac3c0235..e95e22fd136 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -255,9 +255,10 @@ WorkSpaceLayout *BKE_workspace_layout_find(const WorkSpace 
*ws, const bScreen *s
return NULL;
 }
 
-WorkSpaceLayout *BKE_workspace_layout_iter_circular(const WorkSpace 
*workspace, WorkSpaceLayout *start,
-bool (*callback)(const 
WorkSpaceLayout *layout, void *arg),
-void *arg, const bool 
iter_backward)