[Bf-blender-cvs] [115aea5f2f] cloth-improvements: Optimization: Use static BVH for collision intersection

2017-01-29 Thread Luca Rood
Commit: 115aea5f2f334ce656004ae73507089e0c7d03d4
Author: Luca Rood
Date:   Sun Jan 29 20:38:34 2017 -0200
Branches: cloth-improvements
https://developer.blender.org/rB115aea5f2f334ce656004ae73507089e0c7d03d4

Optimization: Use static BVH for collision intersection

No need to use moving BVH for intersection checking, as in the end
collisions are only evaluated at the next state anyway, so can use
static BVH to reduce the amount of intersections to check.

Moving BVH will only make sense if ccd is implemented.

===

M   source/blender/blenkernel/intern/cloth.c
M   source/blender/blenkernel/intern/collision.c

===

diff --git a/source/blender/blenkernel/intern/cloth.c 
b/source/blender/blenkernel/intern/cloth.c
index 8e377a69d7..b98700f7ea 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -220,12 +220,12 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, 
bool moving, bool self)
float co[3][3], co_moving[3][3];
bool ret;
 
-   copy_v3_v3(co[0], verts[vt->tri[0]].txold);
-   copy_v3_v3(co[1], verts[vt->tri[1]].txold);
-   copy_v3_v3(co[2], verts[vt->tri[2]].txold);
-
/* copy new locations into array */
if (moving) {
+   copy_v3_v3(co[0], verts[vt->tri[0]].txold);
+   copy_v3_v3(co[1], verts[vt->tri[1]].txold);
+   copy_v3_v3(co[2], verts[vt->tri[2]].txold);
+
/* update moving positions */
copy_v3_v3(co_moving[0], verts[vt->tri[0]].tx);
copy_v3_v3(co_moving[1], verts[vt->tri[1]].tx);
@@ -234,6 +234,10 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, 
bool moving, bool self)
ret = BLI_bvhtree_update_node(bvhtree, i, 
co[0], co_moving[0], 3);
}
else {
+   copy_v3_v3(co[0], verts[vt->tri[0]].tx);
+   copy_v3_v3(co[1], verts[vt->tri[1]].tx);
+   copy_v3_v3(co[2], verts[vt->tri[2]].tx);
+
ret = BLI_bvhtree_update_node(bvhtree, i, 
co[0], NULL, 3);
}

diff --git a/source/blender/blenkernel/intern/collision.c 
b/source/blender/blenkernel/intern/collision.c
index 2283083185..26bf0930c4 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -1064,7 +1064,7 @@ int cloth_bvh_objcollision(Object *ob, ClothModifierData 
*clmd, float step, floa

 
if (clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED) {
-   bvhtree_update_from_cloth(clmd, 1, false); // 0 means STATIC, 1 
means MOVING (see later in this function)
+   bvhtree_update_from_cloth(clmd, false, false);
collobjs = get_collisionobjects(clmd->scene, ob, 
clmd->coll_parms->group, , eModifierType_Collision);

if (!collobjs)
@@ -1084,7 +1084,7 @@ int cloth_bvh_objcollision(Object *ob, ClothModifierData 
*clmd, float step, floa
}
 
if (clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF) {
-   bvhtree_update_from_cloth(clmd, 1, true); // 0 means STATIC, 1 
means MOVING (see later in this function)
+   bvhtree_update_from_cloth(clmd, false, true);
}
 
do {

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


[Bf-blender-cvs] [e735eda393] cloth-improvements: Bring back impulse scaled repulses

2017-01-29 Thread Luca Rood
Commit: e735eda393e79370fc897aad8cdc82c83a472ca9
Author: Luca Rood
Date:   Sat Jan 28 02:40:14 2017 -0200
Branches: cloth-improvements
https://developer.blender.org/rBe735eda393e79370fc897aad8cdc82c83a472ca9

Bring back impulse scaled repulses

It seems I was a bit too optimistic in thinking that just distance based
repulses could handle contacts nicely. Turns out impulse scaled repulses
really have enough of an influence in making the collision response more
effective, that it is worth keeping it for now, even if at the cost of a
very slight stability reduction and and a bit of an increase in
collision elasticity.

I hope to come up with a better solution, and elliminate this, after
cluster based impulse pruning is implemented.

===

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

===

diff --git a/source/blender/blenkernel/intern/collision.c 
b/source/blender/blenkernel/intern/collision.c
index c9259451e8..6f64d59ada 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -382,6 +382,7 @@ static int cloth_collision_response_static 
(ClothModifierData *clmd, CollisionMo
/* stay on the safe side and clamp repulse */
if ( impulse > ALMOST_ZERO )
repulse = min_ff( repulse, 5.0*impulse 
);
+   repulse = max_ff(impulse, repulse);
 
/*impulse = repulse / ( 1.0f + w1*w1 + w2*w2 + 
w3*w3 ); original 2.0 / 0.25 */

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


[Bf-blender-cvs] [5de2fc2679] cloth-improvements: Use pre-solved locations for col response evaluation

2017-01-29 Thread Luca Rood
Commit: 5de2fc2679482b37d9e286dd99780d6cc3b37ed1
Author: Luca Rood
Date:   Sun Jan 29 20:35:46 2017 -0200
Branches: cloth-improvements
https://developer.blender.org/rB5de2fc2679482b37d9e286dd99780d6cc3b37ed1

Use pre-solved locations for col response evaluation

===

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

===

diff --git a/source/blender/blenkernel/intern/collision.c 
b/source/blender/blenkernel/intern/collision.c
index 6f64d59ada..2283083185 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -252,9 +252,9 @@ static int cloth_collision_response_static 
(ClothModifierData *clmd, CollisionMo
 
/* compute barycentric coordinates for both collision points */
collision_compute_barycentric ( collpair->pa,
-   cloth1->verts[collpair->ap1].txold,
-   cloth1->verts[collpair->ap2].txold,
-   cloth1->verts[collpair->ap3].txold,
+   cloth1->verts[collpair->ap1].tx,
+   cloth1->verts[collpair->ap2].tx,
+   cloth1->verts[collpair->ap3].tx,
, ,  );
 
/* was: txold */

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


[Bf-blender-cvs] [ade28fe8a2] cloth-improvements: Optimization: Use inertial solve for pre-collision

2017-01-29 Thread Luca Rood
Commit: ade28fe8a2abce1a3237c385ba7bdeb4338e0bdb
Author: Luca Rood
Date:   Mon Jan 30 03:47:11 2017 -0200
Branches: cloth-improvements
https://developer.blender.org/rBade28fe8a2abce1a3237c385ba7bdeb4338e0bdb

Optimization: Use inertial solve for pre-collision

Instead of doing a full implicit pre-collision solve, do a simple
inertial solve (avance using velocities from previous step), this saves
time by doing one less solve per step, and also improves resting
stability by eliminating the influence of external forces disturbing the
mesh in contacting areas.

This improves general cloth performance by about 30-40% in relation to
the new cloth code, and improves performance by about 3 times in
relation to the original cloth code. This also makes collisions more
reliable by removing the need for positional interpolation, and thus
decreases the number of subframes required for a successful solve.

===

M   source/blender/physics/intern/BPH_mass_spring.cpp
M   source/blender/physics/intern/implicit.h
M   source/blender/physics/intern/implicit_blender.c

===

diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp 
b/source/blender/physics/intern/BPH_mass_spring.cpp
index eb0b1a4bed..1c5dbbe426 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -927,25 +927,25 @@ static void cloth_calc_volume_force(ClothModifierData 
*clmd)
 }
 #endif
 
-/* old collision stuff for cloth, use for continuity
- * until a good replacement is ready
- */
-static void cloth_collision_solve_extra(Object *ob, ClothModifierData *clmd, 
ListBase *effectors, float frame, float step, float dt)
+static void cloth_solve_collisions(Object *ob, ClothModifierData *clmd, float 
step, float dt)
 {
Cloth *cloth = clmd->clothObject;
Implicit_Data *id = cloth->implicit;
ClothVertex *verts = cloth->verts;
int mvert_num = cloth->mvert_num;
const float spf = (float)clmd->sim_parms->stepsPerFrame / 
clmd->sim_parms->timescale;
-   
-   bool do_extra_solve;
int i;

if (!(clmd->coll_parms->flags & (CLOTH_COLLSETTINGS_FLAG_ENABLED | 
CLOTH_COLLSETTINGS_FLAG_SELF)))
return;
if (!clmd->clothObject->bvhtree)
return;
-   
+
+   /* do inertial solve */
+   BPH_mass_spring_solve_velocities_inertial(id);
+
+   BPH_mass_spring_solve_positions(id, dt);
+
// update verts to current positions
for (i = 0; i < mvert_num; i++) {
BPH_mass_spring_get_new_position(id, i, verts[i].tx);
@@ -955,20 +955,10 @@ static void cloth_collision_solve_extra(Object *ob, 
ClothModifierData *clmd, Lis
zero_v3(verts[i].dcvel);
}

-#if 0 /* unused */
-   for (i=0, cv=cloth->verts; imvert_num; i++, cv++) {
-   copy_v3_v3(initial_cos[i], cv->tx);
-   }
-#endif
-   
// call collision function
// TODO: check if "step" or "step+dt" is correct - dg
-   do_extra_solve = cloth_bvh_objcollision(ob, clmd, step / 
clmd->sim_parms->timescale, dt / clmd->sim_parms->timescale);

-   if (do_extra_solve) {
-   ImplicitSolverResult result;
-// cloth_calc_helper_forces(ob, clmd, initial_cos, 
step/clmd->sim_parms->timescale, dt/clmd->sim_parms->timescale);
-   
+   if (cloth_bvh_objcollision(ob, clmd, step / clmd->sim_parms->timescale, 
dt / clmd->sim_parms->timescale)) {
for (i = 0; i < mvert_num; i++) {
if ((clmd->sim_parms->vgroup_mass>0) && (verts 
[i].flags & CLOTH_VERT_FLAG_PINNED))
continue;
@@ -982,35 +972,6 @@ static void cloth_collision_solve_extra(Object *ob, 
ClothModifierData *clmd, Lis
madd_v3_v3fl(verts[i].tv, verts[i].dcvel, spf);
BPH_mass_spring_set_velocity(id, i, verts[i].tv);
}
-
-   /* initialize forces to zero */
-   BPH_mass_spring_clear_forces(id);
-   
-   /* calculate forces */
-   cloth_calc_force(clmd, frame, effectors, step, true);
-   
-   /* solve new velocities */
-   BPH_mass_spring_solve_velocities(id, dt, );
-// cloth_record_result(clmd, , 
clmd->sim_parms->stepsPerFrame);
-
-   for (i = 0; i < mvert_num; i++) {
-   float prex[3];
-
-   /* Get position calculated in pre-collision solve */
-   BPH_mass_spring_get_new_position(id, i, prex);
-
-   /* Solve new possition from old position and velocity 
solved after collision responce */
-   BPH_mass_spring_get_position(id, i, verts[i].tx);
-   

[Bf-blender-cvs] [505ff16dbf] master: Snap System: BVH: ignore AABBs behind ray

2017-01-29 Thread Germano Cavalcante
Commit: 505ff16dbff03a90ddc9e2d53cd1694e38beb49c
Author: Germano Cavalcante
Date:   Mon Jan 30 02:49:41 2017 -0300
Branches: master
https://developer.blender.org/rB505ff16dbff03a90ddc9e2d53cd1694e38beb49c

Snap System: BVH: ignore AABBs behind ray

This provides a slight improvement in performance in specific cases, such as 
when the observer is inside a high poly object and executes snap to edge or 
vertex

===

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

===

diff --git a/source/blender/editors/transform/transform_snap_object.c 
b/source/blender/editors/transform/transform_snap_object.c
index 43eb02889b..0624288f94 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -542,12 +542,16 @@ static bool cb_walk_parent_snap_project(const 
BVHTreeAxisRange *bounds, void *us
 
/* if rtmin < rtmax, ray intersect `AABB` */
if (rtmin <= rtmax) {
+#define IGNORE_BEHIND_RAY
 #ifdef IGNORE_BEHIND_RAY
/* `if rtmax < depth_min`, the hit is behind us */
if (rtmax < data->depth_range[0]) {
-   /* TODO: TODO: Check if the entire AABB is behind ray
-* this will prevent unnecessary leaf testing */
-   return false;
+   /* Test if the entire AABB is behind us */
+   float dvec[3];
+   sub_v3_v3v3(dvec, local_bvmax, data->ray_origin_local);
+   if (dot_v3v3(dvec, data->ray_direction_local) < 
(data->depth_range[0])) {
+   return false;
+   }
}
 #endif
const float proj = rtmin * data->ray_direction_local[main_axis];
@@ -557,10 +561,15 @@ static bool cb_walk_parent_snap_project(const 
BVHTreeAxisRange *bounds, void *us
 #ifdef IGNORE_BEHIND_RAY
/* `if rtmin < depth_min`, the hit is behing us */
else if (rtmin < data->depth_range[0]) {
-   /* TODO: Test if the AABB is totally behind ray */
-   return false;
+   /* Test if the entire AABB is behind us */
+   float dvec[3];
+   sub_v3_v3v3(dvec, local_bvmax, data->ray_origin_local);
+   if (dot_v3v3(dvec, data->ray_direction_local) < 
(data->depth_range[0])) {
+   return false;
+   }
}
 #endif
+#undef IGNORE_BEHIND_RAY
if (data->sign[main_axis]) {
va[main_axis] = local_bvmax[main_axis];
vb[main_axis] = local_bvmin[main_axis];

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


[Bf-blender-cvs] [318ee2e8c1] master: Fix unreported bug: parameter ray_start repeated

2017-01-29 Thread Germano Cavalcante
Commit: 318ee2e8c108c7a6e03a78dd4877e2ce67f8f5e0
Author: Germano Cavalcante
Date:   Mon Jan 30 02:26:00 2017 -0300
Branches: master
https://developer.blender.org/rB318ee2e8c108c7a6e03a78dd4877e2ce67f8f5e0

Fix unreported bug: parameter ray_start repeated

The bug would only be seen in terms of performance

===

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

===

diff --git a/source/blender/editors/transform/transform_snap_object.c 
b/source/blender/editors/transform/transform_snap_object.c
index 87c28c30a4..43eb02889b 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -2099,7 +2099,7 @@ bool ED_transform_snap_object_project_view3d_ex(
SnapData snapdata;
const enum eViewProj view_proj = ((RegionView3D 
*)ar->regiondata)->is_persp ? VIEW_PROJ_PERSP : VIEW_PROJ_ORTHO;
snap_data_set(, ar, snap_to, view_proj, mval,
-   ray_start, ray_start, ray_normal, depth_range);
+   ray_origin, ray_start, ray_normal, depth_range);
 
return snapObjectsRay(
sctx, ,

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


[Bf-blender-cvs] [167ab03f36] master: Solve compilation error: Field has incomplete type 'enum eViewProj'

2017-01-29 Thread Germano Cavalcante
Commit: 167ab03f36a912c1e23f75d30102e545e336bf26
Author: Germano Cavalcante
Date:   Mon Jan 30 02:19:18 2017 -0300
Branches: master
https://developer.blender.org/rB167ab03f36a912c1e23f75d30102e545e336bf26

Solve compilation error: Field has incomplete type 'enum eViewProj'

Error reported by @tomjpsun
Patch D2491

===

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

===

diff --git a/source/blender/editors/transform/transform_snap_object.c 
b/source/blender/editors/transform/transform_snap_object.c
index 47bb86561a..87c28c30a4 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -59,6 +59,12 @@
 
 #include "transform.h"
 
+enum eViewProj {
+   VIEW_PROJ_NONE = -1,
+   VIEW_PROJ_ORTHO = 0,
+   VIEW_PROJ_PERSP = -1,
+};
+
 typedef struct SnapData {
short snap_to;
float mval[2];
@@ -122,12 +128,6 @@ struct SnapObjectContext {
 
 };
 
-enum eViewProj {
-   VIEW_PROJ_NONE = -1,
-   VIEW_PROJ_ORTHO=  0,
-   VIEW_PROJ_PERSP= -1,
-};
-
 static int dm_looptri_to_poly_index(DerivedMesh *dm, const MLoopTri *lt);

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


[Bf-blender-cvs] [cdff659036] master: Freestyle: Fix (unreported) wrong distance calculation in the Fill Range by Selection operator.

2017-01-29 Thread Tamito Kajiyama
Commit: cdff659036d72e09eba0db688807a567090d722b
Author: Tamito Kajiyama
Date:   Mon Jan 30 12:18:39 2017 +0900
Branches: master
https://developer.blender.org/rBcdff659036d72e09eba0db688807a567090d722b

Freestyle: Fix (unreported) wrong distance calculation in the Fill Range by 
Selection operator.

Distance calculation performed by the "Fill Range by Selection" button of the
"Distance from Camera" color, alpha and thickness modifiers was incorrect,
limiting the usefulness of the functionality.

The problem was that the distance between the camera and individual vertex
locations was calculated in the world space, which was inconsistent with the
distance calculation done by the modifiers in the camera space.

===

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

===

diff --git a/release/scripts/startup/bl_operators/freestyle.py 
b/release/scripts/startup/bl_operators/freestyle.py
index edda92284d..e190572d44 100644
--- a/release/scripts/startup/bl_operators/freestyle.py
+++ b/release/scripts/startup/bl_operators/freestyle.py
@@ -62,28 +62,40 @@ class 
SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
 m = linestyle.alpha_modifiers[self.name]
 else:
 m = linestyle.thickness_modifiers[self.name]
-# Find the source object
+# Find the reference object
 if m.type == 'DISTANCE_FROM_CAMERA':
-source = scene.camera
+ref = scene.camera
+matrix_to_camera = ref.matrix_world.inverted()
 elif m.type == 'DISTANCE_FROM_OBJECT':
 if m.target is None:
 self.report({'ERROR'}, "Target object not specified")
 return {'CANCELLED'}
-source = m.target
+ref = m.target
+target_location = ref.location
 else:
 self.report({'ERROR'}, "Unexpected modifier type: " + m.type)
 return {'CANCELLED'}
 # Find selected mesh objects
-selection = [ob for ob in scene.objects if ob.select and ob.type == 
'MESH' and ob.name != source.name]
+selection = [ob for ob in scene.objects if ob.select and ob.type == 
'MESH' and ob.name != ref.name]
 if selection:
-# Compute the min/max distance between selected mesh objects and 
the source
+# Compute the min/max distance from the reference to mesh vertices
 min_dist = sys.float_info.max
 max_dist = -min_dist
-for ob in selection:
-for vert in ob.data.vertices:
-dist = (ob.matrix_world * vert.co - source.location).length
-min_dist = min(dist, min_dist)
-max_dist = max(dist, max_dist)
+if m.type == 'DISTANCE_FROM_CAMERA':
+for ob in selection:
+ob_to_cam = matrix_to_camera * ob.matrix_world
+for vert in ob.data.vertices:
+# dist in the camera space
+dist = (ob_to_cam * vert.co).length
+min_dist = min(dist, min_dist)
+max_dist = max(dist, max_dist)
+elif m.type == 'DISTANCE_FROM_OBJECT':
+for ob in selection:
+for vert in ob.data.vertices:
+# dist in the world space
+dist = (ob.matrix_world * vert.co - 
target_location).length
+min_dist = min(dist, min_dist)
+max_dist = max(dist, max_dist)
 # Fill the Range Min/Max entries with the computed distances
 m.range_min = min_dist
 m.range_max = max_dist

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


[Bf-blender-cvs] [e15c16f11c] clay-engine: Changes to DNA/RNA. Follow same layout as sensors.

2017-01-29 Thread Clément Foucault
Commit: e15c16f11c08a13ef8288ee500d2d317634c
Author: Clément Foucault
Date:   Mon Jan 30 02:24:18 2017 +0100
Branches: clay-engine
https://developer.blender.org/rBe15c16f11c08a13ef8288ee500d2d317634c

Changes to DNA/RNA. Follow same layout as sensors.

===

M   release/scripts/startup/bl_ui/properties_render.py
M   source/blender/draw/DRW_engine.h
M   source/blender/draw/engines/clay/clay.c
M   source/blender/draw/intern/DRW_render.h
M   source/blender/draw/intern/draw_manager.c
M   source/blender/makesdna/DNA_material_types.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/RNA_access.h
M   source/blender/makesrna/intern/rna_material.c
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/release/scripts/startup/bl_ui/properties_render.py 
b/release/scripts/startup/bl_ui/properties_render.py
index 593072992f..b1c68559d8 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -590,17 +590,17 @@ class RENDER_PT_clay(RenderButtonsPanel, Panel):
 
 def draw(self, context):
 layout = self.layout;
-settings = context.scene.render_engine
-layout.template_icon_view(settings, "matcap_icon")
-layout.prop(settings, "matcap_rotation")
-layout.prop(settings, "matcap_hue")
-layout.prop(settings, "matcap_saturation")
-layout.prop(settings, "matcap_value")
-layout.prop(settings, "ssao_factor_cavity")
-layout.prop(settings, "ssao_factor_edge")
-layout.prop(settings, "ssao_distance")
-layout.prop(settings, "ssao_attenuation")
-layout.prop(settings, "ssao_samples")
+# settings = context.scene.engine_settings
+# layout.template_icon_view(settings, "matcap_icon")
+# layout.prop(settings, "matcap_rotation")
+# layout.prop(settings, "matcap_hue")
+# layout.prop(settings, "matcap_saturation")
+# layout.prop(settings, "matcap_value")
+# layout.prop(settings, "ssao_factor_cavity")
+# layout.prop(settings, "ssao_factor_edge")
+# layout.prop(settings, "ssao_distance")
+# layout.prop(settings, "ssao_attenuation")
+# layout.prop(settings, "ssao_samples")
 
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h
index 4f86e3fcd9..93b5e69d4d 100644
--- a/source/blender/draw/DRW_engine.h
+++ b/source/blender/draw/DRW_engine.h
@@ -39,7 +39,7 @@ void DRW_engines_free(void);
 void DRW_pass_free(struct DRWPass *pass);
 
 /* Settings */
-void *DRW_material_settings_get(struct Material *ma, const char *engine_name);
-void *DRW_render_settings_get(struct Scene *scene, const char *engine_name);
+void *DRW_material_settings_get(struct Material *ma, const char *engine_name, 
void **runtime);
+void *DRW_render_settings_get(struct Scene *scene, const char *engine_name, 
void **runtime);
 
 #endif /* __DRW_ENGINE_H__ */
\ No newline at end of file
diff --git a/source/blender/draw/engines/clay/clay.c 
b/source/blender/draw/engines/clay/clay.c
index 6e155776bb..d084a3383b 100644
--- a/source/blender/draw/engines/clay/clay.c
+++ b/source/blender/draw/engines/clay/clay.c
@@ -237,7 +237,7 @@ static struct GPUTexture *create_jitter_texture(void)
 
 static void clay_material_settings_init(MaterialEngineSettingsClay *ma)
 {
-   ma->matcap_icon = 0;
+   ma->matcap_icon = ICON_MATCAP_01;
ma->matcap_rot = 0.0f;
ma->matcap_hue = 0.5f;
ma->matcap_sat = 0.5f;
@@ -252,8 +252,6 @@ RenderEngineSettings *CLAY_render_settings_create(void)
 {
RenderEngineSettingsClay *settings = 
MEM_callocN(sizeof(RenderEngineSettingsClay), "RenderEngineSettingsClay");
 
-   BLI_strncpy(settings->res.name, RE_engine_id_BLENDER_CLAY, 64);
-
clay_material_settings_init((MaterialEngineSettingsClay *)settings);
 
settings->ssao_samples = 32;
@@ -265,8 +263,6 @@ MaterialEngineSettings *CLAY_material_settings_create(void)
 {
MaterialEngineSettingsClay *settings = 
MEM_callocN(sizeof(MaterialEngineSettingsClay), "MaterialEngineSettingsClay");
 
-   BLI_strncpy(settings->mes.name, RE_engine_id_BLENDER_CLAY, 64);
-
clay_material_settings_init(settings);
 
return (MaterialEngineSettings *)settings;
@@ -366,7 +362,7 @@ static void CLAY_ssao_setup(void)
};
int i;
float *size = DRW_viewport_size_get();
-   RenderEngineSettingsClay *settings = DRW_render_settings_get(NULL, 
RE_engine_id_BLENDER_CLAY);
+   RenderEngineSettingsClay *settings = DRW_render_settings_get(NULL, 
RE_engine_id_BLENDER_CLAY, NULL);
 
DRW_get_dfdy_factors(dfdyfacs);
 
@@ -429,33 +425,33 @@ static DRWShadingGroup *CLAY_shgroup_create(DRWPass 
*pass, int 

[Bf-blender-cvs] [f754ce1c5e] transform-manipulators: Merge branch 'blender2.8' into transform-manipulators

2017-01-29 Thread Julian Eisel
Commit: f754ce1c5e050d1637fe97d78f782d6a68da6c15
Author: Julian Eisel
Date:   Mon Jan 30 00:21:36 2017 +0100
Branches: transform-manipulators
https://developer.blender.org/rBf754ce1c5e050d1637fe97d78f782d6a68da6c15

Merge branch 'blender2.8' into transform-manipulators

===



===

diff --cc source/blender/blenloader/intern/versioning_270.c
index 66a2698eb8,477382d8c5..21880fdb2d
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -1515,21 -1595,21 +1595,38 @@@ void blo_do_versions_270(FileData *fd, 
}
}
}
 +
 +  {
 +  /* New transform manipulators */
 +  if (!DNA_struct_elem_find(fd->filesdna, "View3D", "char", 
"transform_manipulators_type")) {
 +  for (bScreen *screen = main->screen.first; screen; 
screen = screen->id.next) {
 +  for (ScrArea *sa = screen->areabase.first; sa; 
sa = sa->next) {
 +  /* handle pushed-back space data first 
*/
 +  for (SpaceLink *sl = 
sa->spacedata.first; sl; sl = sl->next) {
 +  if (sl->spacetype == 
SPACE_VIEW3D) {
 +  View3D *v3d = (View3D 
*)sl;
 +  v3d->flag3 |= 
V3D_USE_TRANSFORM_MANIPULATORS;
 +  }
 +  }
 +  }
 +  }
 +  }
 +  }
  }
+ 
+ void do_versions_after_linking_270(Main *main)
+ {
+   /* To be added to next subversion bump! */
+   {
+   FOREACH_NODETREE(main, ntree, id) {
+   if (ntree->type == NTREE_COMPOSIT) {
+   ntreeSetTypes(NULL, ntree);
+   for (bNode *node = ntree->nodes.first; node; 
node = node->next) {
+   if (node->type == CMP_NODE_HUE_SAT) {
+   do_version_hue_sat_node(ntree, 
node);
+   }
+   }
+   }
+   } FOREACH_NODETREE_END
+   }
+ }

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


[Bf-blender-cvs] [bfe151e5f7] custom-manipulators: Fix compile error

2017-01-29 Thread Julian Eisel
Commit: bfe151e5f72e0726d2b7a38c59180cfc74b404ec
Author: Julian Eisel
Date:   Mon Jan 30 00:15:27 2017 +0100
Branches: custom-manipulators
https://developer.blender.org/rBbfe151e5f72e0726d2b7a38c59180cfc74b404ec

Fix compile error

===

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

===

diff --git a/source/blender/blenkernel/intern/facemap.c 
b/source/blender/blenkernel/intern/facemap.c
index 28732c41d0..f586fdc16b 100644
--- a/source/blender/blenkernel/intern/facemap.c
+++ b/source/blender/blenkernel/intern/facemap.c
@@ -41,6 +41,7 @@
 #include "BLI_utildefines.h"
 #include "BLI_path_util.h"
 #include "BLI_string.h"
+#include "BLI_string_utils.h"
 #include "BLI_listbase.h"
 
 #include "BLT_translation.h"

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


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

2017-01-29 Thread Julian Eisel
Commit: 04e4cb9714d72a32a85d82a01f341a90d17a7a1e
Author: Julian Eisel
Date:   Mon Jan 30 00:16:43 2017 +0100
Branches: custom-manipulators
https://developer.blender.org/rB04e4cb9714d72a32a85d82a01f341a90d17a7a1e

Merge branch 'blender2.8' into custom-manipulators

===



===

diff --cc source/blender/blenloader/intern/versioning_270.c
index 2dbf92c544,477382d8c5..2db2fa440a
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -1515,43 -1595,21 +1595,60 @@@ void blo_do_versions_270(FileData *fd, 
}
}
}
 +
 +  {
 +  if (!DNA_struct_elem_find(fd->filesdna, "SpaceNode", "float", 
"backdrop_zoom")) {
 +  bScreen *sc;
 +  for (sc = main->screen.first; sc; sc = sc->id.next) {
 +  ScrArea *sa;
 +  for (sa = sc->areabase.first; sa; sa = 
sa->next) {
 +  SpaceLink *sl;
 +  for (sl = sa->spacedata.first; sl; sl = 
sl->next) {
 +  if (sl->spacetype == 
SPACE_NODE) {
 +  SpaceNode *snode = 
(SpaceNode *)sl;
 +  snode->backdrop_zoom = 
1.0;
 +  }
 +  if (sl->spacetype == SPACE_SEQ) 
{
 +  SpaceSeq *sseq = 
(SpaceSeq *)sl;
 +  sseq->overdrop_zoom = 
1.0;
 +  }
 +  }
 +  }
 +  }
 +  }
 +
 +  if (!DNA_struct_elem_find(fd->filesdna, "SpaceIpo", "float", 
"backdrop_zoom")) {
 +  bScreen *sc;
 +  for (sc = main->screen.first; sc; sc = sc->id.next) {
 +  ScrArea *sa;
 +  for (sa = sc->areabase.first; sa; sa = 
sa->next) {
 +  SpaceLink *sl;
 +  for (sl = sa->spacedata.first; sl; sl = 
sl->next) {
 +  if (sl->spacetype == SPACE_IPO) 
{
 +  SpaceIpo *sipo = 
(SpaceIpo *)sl;
 +  sipo->backdrop_zoom = 
1.0f;
 +  sipo->backdrop_opacity 
= 0.7f;
 +  }
 +  }
 +  }
 +  }
 +  }
 +  }
  }
+ 
+ void do_versions_after_linking_270(Main *main)
+ {
+   /* To be added to next subversion bump! */
+   {
+   FOREACH_NODETREE(main, ntree, id) {
+   if (ntree->type == NTREE_COMPOSIT) {
+   ntreeSetTypes(NULL, ntree);
+   for (bNode *node = ntree->nodes.first; node; 
node = node->next) {
+   if (node->type == CMP_NODE_HUE_SAT) {
+   do_version_hue_sat_node(ntree, 
node);
+   }
+   }
+   }
+   } FOREACH_NODETREE_END
+   }
+ }

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


[Bf-blender-cvs] [744f26b612] clay-engine: Change in DNA/RNA. Still missing freeing and read/write.

2017-01-29 Thread Clément Foucault
Commit: 744f26b6129fc3723f9934d358060a3cb931474c
Author: Clément Foucault
Date:   Sun Jan 29 00:55:46 2017 +0100
Branches: clay-engine
https://developer.blender.org/rB744f26b6129fc3723f9934d358060a3cb931474c

Change in DNA/RNA. Still missing freeing and read/write.

===

M   release/scripts/startup/bl_ui/properties_material.py
M   release/scripts/startup/bl_ui/properties_render.py
M   source/blender/blenkernel/intern/material.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/versioning_280.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/draw/DRW_engine.h
M   source/blender/draw/engines/clay/clay.c
M   source/blender/draw/engines/clay/clay.h
M   source/blender/draw/intern/DRW_render.h
M   source/blender/draw/intern/draw_cache.c
M   source/blender/draw/intern/draw_cache.h
M   source/blender/draw/intern/draw_manager.c
M   source/blender/makesdna/DNA_material_types.h
M   source/blender/makesdna/DNA_scene_types.h
M   source/blender/makesrna/RNA_access.h
M   source/blender/makesrna/intern/CMakeLists.txt
M   source/blender/makesrna/intern/rna_material.c
M   source/blender/makesrna/intern/rna_scene.c

===

diff --git a/release/scripts/startup/bl_ui/properties_material.py 
b/release/scripts/startup/bl_ui/properties_material.py
index 04662095a0..e8ba7cc803 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -1060,16 +1060,16 @@ class MATERIAL_PT_clay_settings(MaterialButtonsPanel, 
Panel):
 def draw(self, context):
 layout = self.layout;
 settings = context.material.clay_settings
-layout.template_icon_view(settings, "matcap_icon")
-layout.prop(settings, "type")
-layout.prop(settings, "matcap_rotation")
-layout.prop(settings, "matcap_hue")
-layout.prop(settings, "matcap_saturation")
-layout.prop(settings, "matcap_value")
-layout.prop(settings, "ssao_factor_cavity")
-layout.prop(settings, "ssao_factor_edge")
-layout.prop(settings, "ssao_distance")
-layout.prop(settings, "ssao_attenuation")
+# layout.template_icon_view(settings, "matcap_icon")
+# layout.prop(settings, "type")
+# layout.prop(settings, "matcap_rotation")
+# layout.prop(settings, "matcap_hue")
+# layout.prop(settings, "matcap_saturation")
+# layout.prop(settings, "matcap_value")
+# layout.prop(settings, "ssao_factor_cavity")
+# layout.prop(settings, "ssao_factor_edge")
+# layout.prop(settings, "ssao_distance")
+# layout.prop(settings, "ssao_attenuation")
 
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/release/scripts/startup/bl_ui/properties_render.py 
b/release/scripts/startup/bl_ui/properties_render.py
index 0d473d79ed..593072992f 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -590,17 +590,16 @@ class RENDER_PT_clay(RenderButtonsPanel, Panel):
 
 def draw(self, context):
 layout = self.layout;
-settings = context.scene.clay_settings
-matsettings = context.scene.clay_settings.mat_settings
-layout.template_icon_view(matsettings, "matcap_icon")
-layout.prop(matsettings, "matcap_rotation")
-layout.prop(matsettings, "matcap_hue")
-layout.prop(matsettings, "matcap_saturation")
-layout.prop(matsettings, "matcap_value")
-layout.prop(matsettings, "ssao_factor_cavity")
-layout.prop(matsettings, "ssao_factor_edge")
-layout.prop(matsettings, "ssao_distance")
-layout.prop(matsettings, "ssao_attenuation")
+settings = context.scene.render_engine
+layout.template_icon_view(settings, "matcap_icon")
+layout.prop(settings, "matcap_rotation")
+layout.prop(settings, "matcap_hue")
+layout.prop(settings, "matcap_saturation")
+layout.prop(settings, "matcap_value")
+layout.prop(settings, "ssao_factor_cavity")
+layout.prop(settings, "ssao_factor_edge")
+layout.prop(settings, "ssao_distance")
+layout.prop(settings, "ssao_attenuation")
 layout.prop(settings, "ssao_samples")
 
 
diff --git a/source/blender/blenkernel/intern/material.c 
b/source/blender/blenkernel/intern/material.c
index ad53d03f43..3fb7ee89ae 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -112,10 +112,7 @@ void BKE_material_free(Material *ma)
BKE_icon_id_delete((ID *)ma);
BKE_previewimg_free(>preview);
 
-   if (ma->clay.runtime) {
-   MEM_freeN(ma->clay.runtime);
-   

[Bf-blender-cvs] [5bf60530e5] clay-engine: Added switch to test viewport cache

2017-01-29 Thread Clément Foucault
Commit: 5bf60530e5f1843b613439ea05790412d7f74d41
Author: Clément Foucault
Date:   Fri Jan 27 12:44:41 2017 +0100
Branches: clay-engine
https://developer.blender.org/rB5bf60530e5f1843b613439ea05790412d7f74d41

Added switch to test viewport cache

===

M   source/blender/draw/DRW_engine.h
M   source/blender/draw/engines/clay/clay.c
M   source/blender/draw/intern/DRW_render.h
M   source/blender/draw/intern/draw_manager.c
M   source/blender/editors/space_view3d/view3d_draw.c
M   source/blender/gpu/intern/gpu_viewport.c

===

diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h
index ad05cf625f..d58e2406fa 100644
--- a/source/blender/draw/DRW_engine.h
+++ b/source/blender/draw/DRW_engine.h
@@ -26,6 +26,8 @@
 #ifndef __DRW_ENGINE_H__
 #define __DRW_ENGINE_H__
 
+//#define WITH_VIEWPORT_CACHE_TEST
+
 struct DRWPass;
 
 void DRW_engines_init(void);
diff --git a/source/blender/draw/engines/clay/clay.c 
b/source/blender/draw/engines/clay/clay.c
index f741cb54b9..cf5720b911 100644
--- a/source/blender/draw/engines/clay/clay.c
+++ b/source/blender/draw/engines/clay/clay.c
@@ -577,11 +577,18 @@ static void CLAY_view_draw(RenderEngine *UNUSED(engine), 
const struct bContext *
/* TODO : tag to refresh by the deps graph */
/* ideally only refresh when objects are added/removed */
/* or render properties / materials change */
-   //static bool once = false;
+#ifdef WITH_VIEWPORT_CACHE_TEST
+   static bool once = false;
+   printf("AA\n");
+#endif
if (DRW_viewport_cache_is_dirty()
-   //&& !once
+#ifdef WITH_VIEWPORT_CACHE_TEST
+   && !once
+#endif
) {
-   //once = true;
+#ifdef WITH_VIEWPORT_CACHE_TEST
+   once = true;
+#endif
CLAY_create_cache(passes, context);
}
 
diff --git a/source/blender/draw/intern/DRW_render.h 
b/source/blender/draw/intern/DRW_render.h
index 8daf97875b..75f5a124a1 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -50,6 +50,8 @@
 
 #include "RE_engine.h"
 
+//#define WITH_VIEWPORT_CACHE_TEST
+
 struct GPUFrameBuffer;
 struct GPUShader;
 struct GPUTexture;
diff --git a/source/blender/draw/intern/draw_manager.c 
b/source/blender/draw/intern/draw_manager.c
index a2ddf07079..0bb651897b 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -446,6 +446,10 @@ static void 
shgroup_dynamic_batch_from_calls(DRWShadingGroup *shgroup)
int nbr = BLI_listbase_count(>calls);
GLenum type;
 
+#ifdef WITH_VIEWPORT_CACHE_TEST
+   if (shgroup->dyngeom) return;
+#endif
+
if (nbr == 0) {
if (shgroup->dyngeom) {
Batch_discard(shgroup->dyngeom);
@@ -457,7 +461,6 @@ static void 
shgroup_dynamic_batch_from_calls(DRWShadingGroup *shgroup)
/* Gather Data */
float *data = MEM_mallocN(sizeof(float) * 3 * nbr , "Object Center 
Batch data");
 
-   /* TODO do something more generic usable for other things than obj 
center */
for (DRWCall *call = shgroup->calls.first; call; call = call->next, 
i++) {
copy_v3_v3([i*3], call->obmat[3]);
}
@@ -506,6 +509,7 @@ void DRW_pass_free(DRWPass *pass)
BLI_freelistN(>shgroups);
 }
 
+/* TODO this is slow we should not have to use this (better store shgroup 
pointer somewhere) */
 DRWShadingGroup *DRW_pass_nth_shgroup_get(DRWPass *pass, int n)
 {
int i = 0;
diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index c8f0a4e325..f428b2cec4 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2109,7 +2109,7 @@ static void view3d_render_pass(const bContext *C, ARegion 
*ar)
}
 }
 
-static void view3d_draw_view_new(const bContext *C, ARegion *ar, DrawData 
*draw_data)
+static void view3d_draw_view_new(const bContext *C, ARegion *ar, DrawData 
*UNUSED(draw_data))
 {
 
view3d_draw_setup_view(C, ar);
diff --git a/source/blender/gpu/intern/gpu_viewport.c 
b/source/blender/gpu/intern/gpu_viewport.c
index 015d71ac56..b1964857ab 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -87,8 +87,10 @@ void GPU_viewport_bind(GPUViewport *viewport, const rcti 
*rect)
/* add one pixel because of scissor test */
int rect_w = BLI_rcti_size_x(rect) + 1, rect_h = BLI_rcti_size_y(rect) 
+ 1;
 
+#ifndef WITH_VIEWPORT_CACHE_TEST
/* TODO for testing only, we need proper cache invalidation */
GPU_viewport_passes_free(viewport);
+#endif
 
if (viewport->fbl->default_fb) {
if (rect_w != viewport->size[0] || rect_h != 

[Bf-blender-cvs] [9529a96fd0] fracture_modifier: fix attempt for disappearing fm debris particles after baking

2017-01-29 Thread Martin Felke
Commit: 9529a96fd0eda76c2463d9b240d21bb2ce5e1d8e
Author: Martin Felke
Date:   Sun Jan 29 19:08:38 2017 +0100
Branches: fracture_modifier
https://developer.blender.org/rB9529a96fd0eda76c2463d9b240d21bb2ce5e1d8e

fix attempt for disappearing fm debris particles after baking

===

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

===

diff --git a/source/blender/blenkernel/intern/particle_system.c 
b/source/blender/blenkernel/intern/particle_system.c
index e882391569..8e9bd1d701 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3882,7 +3882,7 @@ static void system_step(ParticleSimulationData *sim, 
float cfra, const bool use_
PTCacheID ptcacheid, *pid = NULL;
PARTICLE_P;
float disp, cache_cfra = cfra; /*, *vg_vel= 0, *vg_tan= 0, *vg_rot= 0, 
*vg_size= 0; */
-   int startframe = 0, endframe = 100, oldtotpart = 0, emitcount = 0;
+   int startframe = 0, endframe = 100, oldtotpart = 0, emitcount = 0, 
cache_check = 0;
 
/* cache shouldn't be used for hair or "continue physics" */
if (part->type != PART_HAIR) {
@@ -3910,7 +3910,12 @@ static void system_step(ParticleSimulationData *sim, 
float cfra, const bool use_
 /* 1. emit particles and redo particles if needed */
oldtotpart = psys->totpart;
emitcount = emit_particles(sim, pid, cfra, part);
-   if (emitcount || psys->recalc & PSYS_RECALC_RESET) {
+   if (pid) {
+   cache_check = BKE_ptcache_read(pid, cache_cfra, true);
+   }
+   if ((emitcount && !ELEM(cache_check, PTCACHE_READ_EXACT, 
PTCACHE_READ_INTERPOLATED)) ||
+   psys->recalc & PSYS_RECALC_RESET)
+   {
if (distribute_particles(sim, part->from) || part->distr == 
PART_DISTR_GRID) {
initialize_all_particles(sim);
/* reset only just created particles (on startframe all 
particles are recreated) */

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


[Bf-blender-cvs] [3c518ab4a4] fracture_modifier: crash fix, do not update tessface data while loading, only ensure it (saved fracture might have been invalid mesh)

2017-01-29 Thread Martin Felke
Commit: 3c518ab4a431e9c26e96cae5fd5b4182657f3b4d
Author: Martin Felke
Date:   Sun Jan 29 19:07:33 2017 +0100
Branches: fracture_modifier
https://developer.blender.org/rB3c518ab4a431e9c26e96cae5fd5b4182657f3b4d

crash fix,  do not update tessface data while loading, only ensure it (saved 
fracture might have been invalid mesh)

===

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

===

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 654b00e2f3..e5b0cc81a6 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5349,7 +5349,8 @@ static void load_fracture_modifier(FileData* fd, 
FractureModifierData *fmd)
 
DM_ensure_tessface(fmd->visible_mesh_cached);
DM_ensure_normals(fmd->visible_mesh_cached);
-   DM_update_tessface_data(fmd->visible_mesh_cached);
+   //DM_update_tessface_data(fmd->visible_mesh_cached);
+
 
/* re-init cached verts here... */
mverts = CDDM_get_verts(fmd->visible_mesh_cached);

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


[Bf-blender-cvs] [6c23a1b8b9] master: Remove `BKE_boundbox_ray_hit_check`

2017-01-29 Thread Germano Cavalcante
Commit: 6c23a1b8b951ba76965ae2b33188dfaa4b4f2a29
Author: Germano Cavalcante
Date:   Sun Jan 29 14:19:58 2017 -0300
Branches: master
https://developer.blender.org/rB6c23a1b8b951ba76965ae2b33188dfaa4b4f2a29

Remove `BKE_boundbox_ray_hit_check`

Remove `BKE_boundbox_ray_hit_check` since it is no longer being used and can be 
easily replaced by `isect_ray_aabb_v3_simple`

===

M   source/blender/blenkernel/BKE_object.h
M   source/blender/blenkernel/intern/object.c
M   source/blender/editors/transform/transform_snap_object.c

===

diff --git a/source/blender/blenkernel/BKE_object.h 
b/source/blender/blenkernel/BKE_object.h
index cf07a178fe..4349e68f7c 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -136,10 +136,6 @@ void BKE_object_where_is_calc_mat4(struct Scene *scene, 
struct Object *ob, float
 /* possibly belong in own moduke? */
 struct BoundBox *BKE_boundbox_alloc_unit(void);
 void BKE_boundbox_init_from_minmax(struct BoundBox *bb, const float min[3], 
const float max[3]);
-bool BKE_boundbox_ray_hit_check(
-const struct BoundBox *bb,
-const float ray_start[3], const float ray_normal[3],
-float *r_lambda);
 void BKE_boundbox_calc_center_aabb(const struct BoundBox *bb, float r_cent[3]);
 void BKE_boundbox_calc_size_aabb(const struct BoundBox *bb, float r_size[3]);
 void BKE_boundbox_minmax(const struct BoundBox *bb, float obmat[4][4], float 
r_min[3], float r_max[3]);
diff --git a/source/blender/blenkernel/intern/object.c 
b/source/blender/blenkernel/intern/object.c
index e93bfcdda8..41f725ba2c 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2816,45 +2816,6 @@ int BKE_object_obdata_texspace_get(Object *ob, short 
**r_texflag, float **r_loc,
return 1;
 }
 
-/*
- * Test a bounding box for ray intersection
- * assumes the ray is already local to the boundbox space
- */
-bool BKE_boundbox_ray_hit_check(
-const struct BoundBox *bb,
-const float ray_start[3], const float ray_normal[3],
-float *r_lambda)
-{
-   const int triangle_indexes[12][3] = {
-   {0, 1, 2}, {0, 2, 3},
-   {3, 2, 6}, {3, 6, 7},
-   {1, 2, 6}, {1, 6, 5},
-   {5, 6, 7}, {4, 5, 7},
-   {0, 3, 7}, {0, 4, 7},
-   {0, 1, 5}, {0, 4, 5}};
-
-   bool result = false;
-   int i;
-
-   for (i = 0; i < 12 && (!result || r_lambda); i++) {
-   float lambda;
-   int v1, v2, v3;
-   v1 = triangle_indexes[i][0];
-   v2 = triangle_indexes[i][1];
-   v3 = triangle_indexes[i][2];
-   if (isect_ray_tri_v3(ray_start, ray_normal, bb->vec[v1], 
bb->vec[v2], bb->vec[v3], , NULL) &&
-   (!r_lambda || *r_lambda > lambda))
-   {
-   result = true;
-   if (r_lambda) {
-   *r_lambda = lambda;
-   }
-   }
-   }
-
-   return result;
-}
-
 static int pc_cmp(const void *a, const void *b)
 {
const LinkData *ad = a, *bd = b;
diff --git a/source/blender/editors/transform/transform_snap_object.c 
b/source/blender/editors/transform/transform_snap_object.c
index a562a66597..47bb86561a 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -1089,7 +1089,7 @@ static bool snapDerivedMesh(
 
float tmin, tmax;
 
-   /* was BKE_boundbox_ray_hit_check, see: T50486 
*/
+   /* was BKE_boundbox_ray_hit_check, see: 
cf6ca226fa58 */
if (!isect_ray_aabb_v3_simple(
ray_start_local, ray_normal_local, 
bb->vec[0], bb->vec[6], , ))
{

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


[Bf-blender-cvs] [b99491caf7] master: [msvc] Set proper OpenSubdiv flags when not using find_package to find opensubdiv. Fixes T50548

2017-01-29 Thread lazydodo
Commit: b99491caf78f2e74bc5f87e5d36f5363910acc3d
Author: lazydodo
Date:   Sun Jan 29 10:00:11 2017 -0700
Branches: master
https://developer.blender.org/rBb99491caf78f2e74bc5f87e5d36f5363910acc3d

[msvc] Set proper OpenSubdiv flags when not using find_package to find 
opensubdiv. Fixes T50548

===

M   build_files/cmake/platform/platform_win32_msvc.cmake

===

diff --git a/build_files/cmake/platform/platform_win32_msvc.cmake 
b/build_files/cmake/platform/platform_win32_msvc.cmake
index 1a266df779..45a44596e6 100644
--- a/build_files/cmake/platform/platform_win32_msvc.cmake
+++ b/build_files/cmake/platform/platform_win32_msvc.cmake
@@ -453,6 +453,12 @@ if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
 debug ${OPENSUBDIV_LIBPATH}/osdCPU_d.lib 
 debug ${OPENSUBDIV_LIBPATH}/osdGPU_d.lib
 )
+set(OPENSUBDIV_HAS_OPENMP TRUE)
+   set(OPENSUBDIV_HAS_TBB FALSE)
+   set(OPENSUBDIV_HAS_OPENCL TRUE)
+   set(OPENSUBDIV_HAS_CUDA FALSE)
+   set(OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK TRUE)
+   set(OPENSUBDIV_HAS_GLSL_COMPUTE TRUE)
 windows_find_package(OpenSubdiv)
 endif()

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


[Bf-blender-cvs] [cf6ca226fa] master: New math_geom function `isect_ray_aabb_v3_simple`

2017-01-29 Thread Germano Cavalcante
Commit: cf6ca226fa58d7a03be6cebb73a88eeb57497cf4
Author: Germano Cavalcante
Date:   Sun Jan 29 13:56:58 2017 -0300
Branches: master
https://developer.blender.org/rBcf6ca226fa58d7a03be6cebb73a88eeb57497cf4

New math_geom function `isect_ray_aabb_v3_simple`

The new `isect_ray_aabb_v3_simple` function replaces the 
`BKE_boundbox_ray_hit_check` and can be used in BVHTree Root (first AABB). So 
it is much more efficient.

===

M   source/blender/blenlib/BLI_math_geom.h
M   source/blender/blenlib/intern/math_geom.c
M   source/blender/editors/transform/transform_snap_object.c

===

diff --git a/source/blender/blenlib/BLI_math_geom.h 
b/source/blender/blenlib/BLI_math_geom.h
index e3635be671..4a85e859c1 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -293,6 +293,10 @@ void isect_ray_aabb_v3_precalc(
 bool isect_ray_aabb_v3(
 const struct IsectRayAABB_Precalc *data,
 const float bb_min[3], const float bb_max[3], float *tmin);
+bool isect_ray_aabb_v3_simple(
+const float orig[3], const float dir[3],
+const float bb_min[3], const float bb_max[3],
+float *tmin, float *tmax);
 
 struct NearestRayToAABB_Precalc {
float ray_origin[3];
diff --git a/source/blender/blenlib/intern/math_geom.c 
b/source/blender/blenlib/intern/math_geom.c
index 8f5d84dfa0..aeb6a550cd 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -2309,6 +2309,34 @@ bool isect_ray_aabb_v3(
return true;
 }
 
+/*
+ * Test a bounding box (AABB) for ray intersection
+ * assumes the ray is already local to the boundbox space
+ */
+bool isect_ray_aabb_v3_simple(
+const float orig[3], const float dir[3],
+const float bb_min[3], const float bb_max[3],
+float *tmin, float *tmax)
+{
+   double t[7];
+   float hit_dist[2];
+   t[1] = (double)(bb_min[0] - orig[0]) / dir[0];
+   t[2] = (double)(bb_max[0] - orig[0]) / dir[0];
+   t[3] = (double)(bb_min[1] - orig[1]) / dir[1];
+   t[4] = (double)(bb_max[1] - orig[1]) / dir[1];
+   t[5] = (double)(bb_min[2] - orig[2]) / dir[2];
+   t[6] = (double)(bb_max[2] - orig[2]) / dir[2];
+   hit_dist[0] = (float)fmax(fmax(fmin(t[1], t[2]), fmin(t[3], t[4])), 
fmin(t[5], t[6]));
+   hit_dist[1] = (float)fmin(fmin(fmax(t[1], t[2]), fmax(t[3], t[4])), 
fmax(t[5], t[6]));
+   if ((hit_dist[1] < 0 || hit_dist[0] > hit_dist[1]))
+   return false;
+   else {
+   if (tmin) *tmin = hit_dist[0];
+   if (tmax) *tmax = hit_dist[1];
+   return true;
+   }
+}
+
 void dist_squared_ray_to_aabb_v3_precalc(
 struct NearestRayToAABB_Precalc *data,
 const float ray_origin[3], const float ray_direction[3])
diff --git a/source/blender/editors/transform/transform_snap_object.c 
b/source/blender/editors/transform/transform_snap_object.c
index 0f7b62d7ba..a562a66597 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -1087,13 +1087,16 @@ static bool snapDerivedMesh(
bb = _temp;
}
 
-   /* was local_depth, see: T47838 */
-   len_diff = BVH_RAYCAST_DIST_MAX;
+   float tmin, tmax;
 
-   if (!BKE_boundbox_ray_hit_check(bb, 
ray_start_local, ray_normal_local, _diff)) {
+   /* was BKE_boundbox_ray_hit_check, see: T50486 
*/
+   if (!isect_ray_aabb_v3_simple(
+   ray_start_local, ray_normal_local, 
bb->vec[0], bb->vec[6], , ))
+   {
return retval;
}
-   need_ray_start_correction_init = false;
+   /* was local_depth, see: T47838 */
+   len_diff = tmin > 0 ? tmin : tmax;
}
}

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


[Bf-blender-cvs] [dead79a16a] master: Rename func `set_SnapData` to `snap_data_set`

2017-01-29 Thread Germano Cavalcante
Commit: dead79a16a8e307d6dc2de21380347460c6b
Author: Germano Cavalcante
Date:   Sun Jan 29 13:13:14 2017 -0300
Branches: master
https://developer.blender.org/rBdead79a16a8e307d6dc2de21380347460c6b

Rename func `set_SnapData` to `snap_data_set`

Don't use CamelCase in functions and try to keep area affected first, and 
action last, in names

===

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

===

diff --git a/source/blender/editors/transform/transform_snap_object.c 
b/source/blender/editors/transform/transform_snap_object.c
index bd8596ca1b..0f7b62d7ba 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -258,7 +258,7 @@ typedef struct BVHTreeFromMeshType {
  * \param ray_direction: Unit length direction of the ray.
  * \param depth_range: distances of clipe plane min and clip plane max;
  */
-static void set_SnapData(
+static void snap_data_set(
 SnapData *snapdata,
 const ARegion *ar, const unsigned short snap_to, const enum eViewProj 
view_proj,
 const float mval[2], const float ray_origin[3], const float 
ray_start[3],
@@ -1894,7 +1894,7 @@ bool ED_transform_snap_object_project_ray_ex(
const float depth_range[2] = {0.0f, FLT_MAX};
 
SnapData snapdata;
-   set_SnapData(, sctx->v3d_data.ar, snap_to, VIEW_PROJ_NONE, 
NULL, r_loc, r_loc, r_no, depth_range);
+   snap_data_set(, sctx->v3d_data.ar, snap_to, VIEW_PROJ_NONE, 
NULL, r_loc, r_loc, r_no, depth_range);
 
return snapObjectsRay(
sctx, ,
@@ -1928,7 +1928,7 @@ bool ED_transform_snap_object_project_ray_all(
 #endif
 
SnapData snapdata;
-   set_SnapData(, sctx->v3d_data.ar, snap_to, VIEW_PROJ_NONE, 
NULL,
+   snap_data_set(, sctx->v3d_data.ar, snap_to, VIEW_PROJ_NONE, 
NULL,
ray_start, ray_start, ray_normal, depth_range);
 
bool retval = snapObjectsRay(
@@ -2095,7 +2095,7 @@ bool ED_transform_snap_object_project_view3d_ex(
 
SnapData snapdata;
const enum eViewProj view_proj = ((RegionView3D 
*)ar->regiondata)->is_persp ? VIEW_PROJ_PERSP : VIEW_PROJ_ORTHO;
-   set_SnapData(, ar, snap_to, view_proj, mval,
+   snap_data_set(, ar, snap_to, view_proj, mval,
ray_start, ray_start, ray_normal, depth_range);
 
return snapObjectsRay(

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


[Bf-blender-cvs] [88b0b22914] master: fix T50486: Don't always do the `ray_start_correction` in the ortho view

2017-01-29 Thread Germano Cavalcante
Commit: 88b0b22914cc2333b022080d2e2f1f235f924db7
Author: Germano Cavalcante
Date:   Sun Jan 29 12:26:15 2017 -0300
Branches: master
https://developer.blender.org/rB88b0b22914cc2333b022080d2e2f1f235f924db7

fix T50486: Don't always do the `ray_start_correction` in the ortho view

You need to make sure that ray_start is really far away, because even in the 
Orthografic view, in some cases, the ray can start inside the object

===

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

===

diff --git a/source/blender/editors/transform/transform_snap_object.c 
b/source/blender/editors/transform/transform_snap_object.c
index f0177edf20..bd8596ca1b 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -1181,19 +1181,25 @@ static bool snapDerivedMesh(
len_diff = dot_v3v3(dvec, 
ray_normal_local);
}
}
-   float ray_org_local[3];
+   /* You need to make sure that ray_start is 
really far away,
+* because even in the Orthografic view, in 
some cases,
+* the ray can start inside the object (see 
T50486) */
+   if (len_diff > 400.0f) {
+   float ray_org_local[3];
 
-   copy_v3_v3(ray_org_local, snapdata->ray_origin);
-   mul_m4_v3(imat, ray_org_local);
+   copy_v3_v3(ray_org_local, 
snapdata->ray_origin);
+   mul_m4_v3(imat, ray_org_local);
 
-   /* We pass a temp ray_start, set from object's 
boundbox, to avoid precision issues with very far
-* away ray_start values (as returned in case 
of ortho view3d), see T38358.
-*/
-   len_diff -= local_scale;  /* make temp start 
point a bit away from bbox hit point. */
-   madd_v3_v3v3fl(
-   ray_start_local, ray_org_local, 
ray_normal_local,
-   len_diff + snapdata->depth_range[0] * 
local_scale);
-   local_depth -= len_diff;
+   /* We pass a temp ray_start, set from 
object's boundbox, to avoid precision issues with
+* very far away ray_start values (as 
returned in case of ortho view3d), see T38358.
+*/
+   len_diff -= local_scale;  /* make temp 
start point a bit away from bbox hit point. */
+   madd_v3_v3v3fl(
+   ray_start_local, ray_org_local, 
ray_normal_local,
+   len_diff + 
snapdata->depth_range[0] * local_scale);
+   local_depth -= len_diff;
+   }
+   else len_diff = 0.0f;
}
else {
len_diff = 0.0f;
@@ -1446,8 +1452,8 @@ static bool snapEditMesh(
local_depth *= local_scale;
}
 
-   /* Only use closer ray_start in case of ortho view! In 
perspective one, ray_start may already
-* been *inside* boundbox, leading to snap failures 
(see T38409).
+   /* Only use closer ray_start in case of ortho view! In 
perspective one, ray_start
+* may already been *inside* boundbox, leading to snap 
failures (see T38409).
 * Note also ar might be null (see T38435), in this 
case we assume ray_start is ok!
 */
float len_diff = 0.0f;
@@ -1465,20 +1471,26 @@ static bool snapEditMesh(
float dvec[3];
sub_v3_v3v3(dvec, nearest.co, 
ray_start_local);
len_diff = dot_v3v3(dvec, 
ray_normal_local);
-   float ray_org_local[3];
-
-   copy_v3_v3(ray_org_local, 
snapdata->ray_origin);
-   mul_m4_v3(imat, ray_org_local);
-
-   /* We pass a temp ray_start, set from 
object's boundbox,
-* to avoid precision issues with very 
far away ray_start values
-   

[Bf-blender-cvs] [cd596fa1c7] master: Remove struct `PreDefProject` and store all immutable parameters within the new struct `SnapData`

2017-01-29 Thread Germano Cavalcante
Commit: cd596fa1c7ece1e8129a5766c7cdcd5be22245cd
Author: Germano Cavalcante
Date:   Sun Jan 29 12:07:14 2017 -0300
Branches: master
https://developer.blender.org/rBcd596fa1c7ece1e8129a5766c7cdcd5be22245cd

Remove struct `PreDefProject` and store all immutable parameters within the new 
struct `SnapData`

In order to simplify the reading of these functions, the parameters: `snap_to`, 
`mval`, `ray_start`, `ray_dir`, `view_proj` and `depth_range` are now stored in 
the struct `SnapData`

===

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

===

diff --git a/source/blender/editors/transform/transform_snap_object.c 
b/source/blender/editors/transform/transform_snap_object.c
index fba965f69a..f0177edf20 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -59,6 +59,18 @@
 
 #include "transform.h"
 
+typedef struct SnapData {
+   short snap_to;
+   float mval[2];
+   float ray_origin[3];
+   float ray_start[3];
+   float ray_dir[3];
+   float pmat[4][4]; /* perspective matrix */
+   float win_half[2];/* win x and y */
+   enum eViewProj view_proj;
+   float depth_range[2];
+} SnapData;
+
 typedef struct SnapObjectData {
enum {
SNAP_MESH = 1,
@@ -232,26 +244,40 @@ typedef struct BVHTreeFromMeshType {
char type;
 } BVHTreeFromMeshType;
 
-typedef struct PreDefProject {
-   float pmat[4][4]; /* perspective matrix multiplied by object matrix */
-   float win_half[2];
-   float dist_px_sq;
-} PreDefProject;
-
-static void precalc_project(
-PreDefProject *projectdefs, const ARegion *ar,
-const float dist_px, float obmat[4][4])
+/*
+ * Generates a struct with the immutable parameters that will be used on all 
objects.
+ *
+ * \param snap_to: Element to snap, Vertice, Edge or Face.
+ * \param view_proj: ORTHO or PERSP.
+ * Currently only works one at a time, but can eventually operate as flag.
+ *
+ * \param mval: Mouse coords.
+ * (When NULL, ray-casting is handled without any projection matrix 
correction.)
+ * \param ray_origin: ray_start before being moved toward the ray_normal at 
the distance from vew3d clip_min.
+ * \param ray_start: ray_origin moved for the start clipping plane (clip_min).
+ * \param ray_direction: Unit length direction of the ray.
+ * \param depth_range: distances of clipe plane min and clip plane max;
+ */
+static void set_SnapData(
+SnapData *snapdata,
+const ARegion *ar, const unsigned short snap_to, const enum eViewProj 
view_proj,
+const float mval[2], const float ray_origin[3], const float 
ray_start[3],
+const float ray_direction[3], const float depth_range[2])
 {
-   float (*pmat)[4] = ((RegionView3D *)ar->regiondata)->persmat;
-   if (obmat) {
-   mul_m4_m4m4(projectdefs->pmat, pmat, obmat);
-   }
-   else {
-   copy_m4_m4(projectdefs->pmat, pmat);
-   }
-   projectdefs->win_half[0] = ar->winx / 2;
-   projectdefs->win_half[1] = ar->winy / 2;
-   projectdefs->dist_px_sq = SQUARE(dist_px);
+   if (ar) {
+   copy_m4_m4(snapdata->pmat, ((RegionView3D 
*)ar->regiondata)->persmat);
+   snapdata->win_half[0] = ar->winx / 2;
+   snapdata->win_half[1] = ar->winy / 2;
+   }
+   if (mval) {
+   copy_v2_v2(snapdata->mval, mval);
+   }
+   snapdata->snap_to = snap_to;
+   copy_v3_v3(snapdata->ray_origin, ray_origin);
+   copy_v3_v3(snapdata->ray_start, ray_start);
+   copy_v3_v3(snapdata->ray_dir, ray_direction);
+   snapdata->view_proj = view_proj;
+   copy_v2_v2(snapdata->depth_range, depth_range);
 }
 
 static const float *get_vert_co(const BVHTreeFromMeshType *meshdata, const int 
index)
@@ -322,14 +348,12 @@ static void get_edge_verts(
 }
 
 static bool test_projected_vert_dist(
-PreDefProject *projectdefs,
-const float co[3], const enum eViewProj view_proj,
-const float mval[2], const float depth_range[2],
-float r_co[3])
+const float depth_range[2], const float mval[2], const float co[3],
+float pmat[4][4], const float win_half[2], const bool is_persp,
+float *dist_px_sq, float r_co[3])
 {
float depth;
-   float(*pmat)[4] = projectdefs->pmat;
-   if (view_proj == VIEW_PROJ_PERSP) {
+   if (is_persp) {
depth = mul_project_m4_v3_zfac(pmat, co);
if (depth < depth_range[0] || depth > depth_range[1]) {
return false;
@@ -341,34 +365,35 @@ static bool test_projected_vert_dist(
(dot_m4_v3_row_y(pmat, co) + pmat[3][1]),
};
 
-   if (view_proj == VIEW_PROJ_PERSP) {
+   if (is_persp) {
mul_v2_fl(co2d, 1 / depth);
}
 

[Bf-blender-cvs] [d6f965b99c] master: Fix T50550: GPUShader: compile error - Background image not showing in viewport.

2017-01-29 Thread Kévin Dietrich
Commit: d6f965b99c2bb1b028ab0aac7f7a19b889286002
Author: Kévin Dietrich
Date:   Sun Jan 29 16:00:14 2017 +0100
Branches: master
https://developer.blender.org/rBd6f965b99c2bb1b028ab0aac7f7a19b889286002

Fix T50550: GPUShader: compile error - Background image not showing in
viewport.

Caused by rBd6cf28c5e15739f864fbf04614c2a50708b4b152, which forgot to
update the GLSL code for the "Light Path" node.

===

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

===

diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl 
b/source/blender/gpu/shaders/gpu_shader_material.glsl
index aa583c5ecf..0f3ffa8244 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -3536,6 +3536,8 @@ void node_light_path(
out float is_transmission_ray,
out float ray_length,
out float ray_depth,
+   out float diffuse_depth,
+   out float glossy_depth,
out float transparent_depth,
out float transmission_depth)
 {
@@ -3548,6 +3550,8 @@ void node_light_path(
is_transmission_ray = 0.0;
ray_length = 1.0;
ray_depth = 1.0;
+   diffuse_depth = 1.0;
+   glossy_depth = 1.0;
transparent_depth = 1.0;
transmission_depth = 1.0;
 }

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


[Bf-blender-cvs] [bb372761f0] soc-2016-multiview: Don't mix two operations in a single line.

2017-01-29 Thread Tianwei Shen
Commit: bb372761f08f58c68b6e74e9eb1158b03c5ee8e4
Author: Tianwei Shen
Date:   Sun Jan 29 22:18:43 2017 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rBbb372761f08f58c68b6e74e9eb1158b03c5ee8e4

Don't mix two operations in a single line.

===

M   intern/libmv/intern/reconstructionN.cc

===

diff --git a/intern/libmv/intern/reconstructionN.cc 
b/intern/libmv/intern/reconstructionN.cc
index c9b88e6f5e..f3a81af842 100644
--- a/intern/libmv/intern/reconstructionN.cc
+++ b/intern/libmv/intern/reconstructionN.cc
@@ -94,7 +94,8 @@ void mv_getNormalizedTracks(const Tracks ,
 double normalized_x, normalized_y;
 camera_intrinsics.InvertIntrinsics(marker.center[0], marker.center[1],
_x, _y);
-marker.center[0] = normalized_x, marker.center[1] = normalized_y;
+marker.center[0] = normalized_x;
+marker.center[1] = normalized_y;
 
 normalized_tracks->AddMarker(marker);
   }

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


[Bf-blender-cvs] [ea7c4f61da] soc-2016-multiview: add a space before public to follow google style

2017-01-29 Thread Tianwei Shen
Commit: ea7c4f61daf2373e51af3ab8afae08d4b217562c
Author: Tianwei Shen
Date:   Sun Jan 29 22:24:02 2017 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rBea7c4f61daf2373e51af3ab8afae08d4b217562c

add a space before public to follow google style

===

M   intern/libmv/libmv/autotrack/reconstruction.h

===

diff --git a/intern/libmv/libmv/autotrack/reconstruction.h 
b/intern/libmv/libmv/autotrack/reconstruction.h
index 1856b9e7ed..880ef38663 100644
--- a/intern/libmv/libmv/autotrack/reconstruction.h
+++ b/intern/libmv/libmv/autotrack/reconstruction.h
@@ -65,7 +65,7 @@ struct Point {
 // A reconstruction for a set of tracks. The indexing for clip, frame, and
 // track should match that of a Tracks object, stored elsewhere.
 class Reconstruction {
-public:
+ public:
   // All methods copy their input reference or take ownership of the pointer.
   void AddCameraPose(const CameraPose& pose);
   int AddCameraIntrinsics(CameraIntrinsics* intrinsics_ptr);

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


[Bf-blender-cvs] [15b253c082] master: Fix blurry icons

2017-01-29 Thread raa
Commit: 15b253c082d6d2c403857516d49d0c4e740dd067
Author: raa
Date:   Sun Jan 29 17:21:42 2017 +0300
Branches: master
https://developer.blender.org/rB15b253c082d6d2c403857516d49d0c4e740dd067

Fix blurry icons

===

M   release/datafiles/blender_icons.svg
M   release/datafiles/blender_icons16/icon16_collapsemenu.dat
M   release/datafiles/blender_icons16/icon16_tria_down_bar.dat
M   release/datafiles/blender_icons16/icon16_tria_left_bar.dat
M   release/datafiles/blender_icons16/icon16_tria_right_bar.dat
M   release/datafiles/blender_icons16/icon16_tria_up_bar.dat
M   release/datafiles/blender_icons32/icon32_collapsemenu.dat
M   release/datafiles/blender_icons32/icon32_tria_down_bar.dat
M   release/datafiles/blender_icons32/icon32_tria_left_bar.dat
M   release/datafiles/blender_icons32/icon32_tria_right_bar.dat
M   release/datafiles/blender_icons32/icon32_tria_up_bar.dat
M   release/datafiles/locale
M   release/scripts/addons
M   release/scripts/addons_contrib
M   source/tools

===

diff --git a/release/datafiles/blender_icons.svg 
b/release/datafiles/blender_icons.svg
index b54cadd40b..e9c114ba1b 100644
--- a/release/datafiles/blender_icons.svg
+++ b/release/datafiles/blender_icons.svg
@@ -14,7 +14,7 @@
height="640"
id="svg2"
sodipodi:version="0.32"
-   inkscape:version="0.91 r13725"
+   inkscape:version="0.91 r"
version="1.0"
sodipodi:docname="blender_icons.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
@@ -28201,7 +28201,7 @@
xlink:href="#linearGradient37542-29"
id="linearGradient17610"
gradientUnits="userSpaceOnUse"
-   gradientTransform="matrix(-1,0,0,1,461.01011,-167)"
+   gradientTransform="matrix(-1,0,0,1,865.01833,131.0342)"
x1="392.0101"
y1="224.8"
x2="392.0101"
@@ -28263,7 +28263,7 @@
xlink:href="#linearGradient37542-29-7"
id="linearGradient17610-0"
gradientUnits="userSpaceOnUse"
-   gradientTransform="matrix(-1,0,0,1,461.01011,-167)"
+   gradientTransform="translate(128.00098,130.98191)"
x1="392.0101"
y1="224.8"
x2="392.0101"
@@ -28402,7 +28402,7 @@
x2="228.5468"
y1="118.91647"
x1="228.5468"
-   gradientTransform="matrix(1.180548,0,0,0.90042534,265.27784,265.13062)"
+   gradientTransform="matrix(1.180548,0,0,0.90042534,265.83288,265.61628)"
gradientUnits="userSpaceOnUse"
id="linearGradient17838"
xlink:href="#linearGradient319-36-40-2"
@@ -28433,7 +28433,7 @@
x2="228.5468"
y1="118.91647"
x1="228.5468"
-   gradientTransform="matrix(1.180548,0,0,0.90042534,223.26222,270.47438)"
+   gradientTransform="matrix(1.180548,0,0,0.90042534,223.81726,270.99473)"
gradientUnits="userSpaceOnUse"
id="linearGradient17872"
xlink:href="#linearGradient319-36-40-2-4"
@@ -29073,7 +29073,7 @@
xlink:href="#linearGradient27854-0-6-9"
id="linearGradient17162"
gradientUnits="userSpaceOnUse"
-   gradientTransform="matrix(0,1,-1,0,782.48614,-14.46331)"
+   gradientTransform="matrix(0,1,-1,0,783.04118,-13.977664)"
x1="388.86502"
y1="244.02"
x2="391.43173"
@@ -29083,7 +29083,7 @@
xlink:href="#linearGradient37542-29-7-8"
id="linearGradient17165"
gradientUnits="userSpaceOnUse"
-   gradientTransform="matrix(0,1,-1,0,782.48614,-14.46331)"
+   gradientTransform="matrix(0,1,-1,0,783.04118,-13.977664)"
x1="368.97806"
y1="249.8"
x2="393.85385"
@@ -29113,7 +29113,7 @@
xlink:href="#linearGradient37542-29-1"
id="linearGradient17185"
gradientUnits="userSpaceOnUse"
-   gradientTransform="matrix(0,-1,-1,0,740.48614,764.46331)"
+   gradientTransform="matrix(0,-1,-1,0,741.04118,764.98366)"
x1="409.93588"
y1="249.8"
x2="385.11514"
@@ -31349,17 +31349,17 @@
  objecttolerance="1"
  inkscape:pageopacity="0.0"
  inkscape:pageshadow="2"
- inkscape:zoom="1.274018"
- inkscape:cx="519.70993"
- inkscape:cy="325.90484"
+ inkscape:zoom="14.413868"
+ inkscape:cx="480.24726"
+ inkscape:cy="269.95478"
  inkscape:document-units="px"
  inkscape:current-layer="layer1"
  showgrid="true"
- inkscape:window-width="1920"
- inkscape:window-height="1005"
- inkscape:window-x="-2"
- inkscape:window-y="27"
- inkscape:snap-nodes="false"
+ inkscape:window-width="1680"
+ inkscape:window-height="1020"
+ inkscape:window-x="0"
+ inkscape:window-y="30"
+ inkscape:snap-nodes="true"
  inkscape:snap-bbox="true"
  showguides="true"
  inkscape:guide-bbox="true"
@@ -31369,14 +31369,16 @@
  inkscape:snap-intersection-grid-guide="false"
  

[Bf-blender-cvs] [86d52ade62] soc-2016-multiview: * fix code style

2017-01-29 Thread Tianwei Shen
Commit: 86d52ade62dbee4d370bb732e93a9be66c5a256f
Author: Tianwei Shen
Date:   Sun Jan 29 22:15:38 2017 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rB86d52ade62dbee4d370bb732e93a9be66c5a256f

* fix code style

- In Blender and C-API we follow Type *foo NOT Type* foo. Might be
different in Libmv itself.

===

M   intern/libmv/intern/reconstructionN.h

===

diff --git a/intern/libmv/intern/reconstructionN.h 
b/intern/libmv/intern/reconstructionN.h
index 29bf55b83b..4e4e330f07 100644
--- a/intern/libmv/intern/reconstructionN.h
+++ b/intern/libmv/intern/reconstructionN.h
@@ -42,24 +42,24 @@ typedef struct libmv_MultiviewReconstructionOptions {
   int *all_refine_intrinsics;  /* this should be an array since each 
clip has its own refine_flags */
 } libmv_MultiviewReconstructionOptions;
 
-typedef void (*multiview_reconstruct_progress_update_cb) (void* customdata,
+typedef void (*multiview_reconstruct_progress_update_cb) (void *customdata,
   double progress,
-  const char* message);
+  const char *message);
 
-void libmv_reconstructionNDestroy(libmv_ReconstructionN* 
libmv_reconstructionN);
+void libmv_reconstructionNDestroy(libmv_ReconstructionN 
*libmv_reconstructionN);
 
 libmv_ReconstructionN** libmv_solveMultiviewReconstruction(const int clip_num,
 const struct libmv_TracksN **all_libmv_tracks,
 const libmv_CameraIntrinsicsOptions 
*all_libmv_camera_intrinsics_options,
 const libmv_CorrespondencesN *libmv_correspondences,
-libmv_MultiviewReconstructionOptions* libmv_reconstruction_options,
+libmv_MultiviewReconstructionOptions *libmv_reconstruction_options,
 multiview_reconstruct_progress_update_cb progress_update_callback,
-void* callback_customdata);
+void *callback_customdata);
 
 bool libmv_multiviewReconstructionIsValid(const int clip_num,
   const libmv_ReconstructionN 
**all_libmv_reconstruction);
 double libmv_multiviewReprojectionError(const int clip_num,
-const libmv_ReconstructionN** 
all_libmv_reconstruction);
+const libmv_ReconstructionN 
**all_libmv_reconstruction);
 
 libmv_CameraIntrinsics 
*libmv_reconstructionNExtractIntrinsics(libmv_ReconstructionN 
*libmv_reconstruction);

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