[Bf-blender-cvs] [47bf093] master: Removed generic debug1..4 values from the cloth data.

2015-01-21 Thread Lukas Tönne
Commit: 47bf0934f5743d14024ef693b2bfe4510c2c666a
Author: Lukas Tönne
Date:   Wed Jan 21 10:07:11 2015 +0100
Branches: master
https://developer.blender.org/rB47bf0934f5743d14024ef693b2bfe4510c2c666a

Removed generic debug1..4 values from the cloth data.

These were used as UI buttons during development. If such parameters are
needed again later they should instead be added in the (now global)
SimDebugData and made accessible with a dev addon or so.

===

M   release/scripts/startup/bl_ui/properties_particle.py
M   source/blender/makesdna/DNA_cloth_types.h
M   source/blender/makesrna/intern/rna_cloth.c
M   source/blender/physics/intern/BPH_mass_spring.cpp
M   source/blender/physics/intern/hair_volume.cpp
M   source/blender/physics/intern/implicit.h

===

diff --git a/release/scripts/startup/bl_ui/properties_particle.py 
b/release/scripts/startup/bl_ui/properties_particle.py
index 9e88043..1176245 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -361,11 +361,6 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, 
Panel):
 sub.prop(cloth, "density_target", text="Density Target")
 sub.prop(cloth, "density_strength", slider=True, text="Strength")
 col.prop(cloth, "voxel_cell_size")
-sub = col.column(align=True)
-sub.prop(cloth, "debug1")
-sub.prop(cloth, "debug2")
-sub.prop(cloth, "debug3")
-sub.prop(cloth, "debug4")
 
 split.separator()
 
@@ -381,7 +376,6 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, 
Panel):
 
 row = col.row()
 row.prop(psys.settings, "show_hair_grid", text="HairGrid")
-row.prop(cloth_md, "show_debug_data", text="Debug")
 
 if result:
 box = layout.box()
diff --git a/source/blender/makesdna/DNA_cloth_types.h 
b/source/blender/makesdna/DNA_cloth_types.h
index a665c22..3144dad 100644
--- a/source/blender/makesdna/DNA_cloth_types.h
+++ b/source/blender/makesdna/DNA_cloth_types.h
@@ -76,12 +76,6 @@ typedef struct ClothSimSettings {
float   shrink_min;  /* min amount to shrink cloth by 0.0f (no shrink) 
- 1.0f (shrink to nothing) */
float   shrink_max;  /* max amount to shrink cloth by 0.0f (no shrink) 
- 1.0f (shrink to nothing) */

-   /* XXX generic debug values, could be done nicer as id props */
-   float debug1;
-   float debug2;
-   int debug3;
-   int debug4;
-   
/* XXX various hair stuff
 * should really be separate, this struct is a horrible mess already
 */
diff --git a/source/blender/makesrna/intern/rna_cloth.c 
b/source/blender/makesrna/intern/rna_cloth.c
index 4e8cfb8..991020a 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -397,26 +397,6 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Target Density Strength", "Influence of 
target density on the simulation");
RNA_def_property_update(prop, 0, "rna_cloth_update");
 
-   prop = RNA_def_property(srna, "debug1", PROP_FLOAT, PROP_NONE);
-   RNA_def_property_range(prop, 0.0f, 100.0f);
-   RNA_def_property_ui_text(prop, "Debug1", "");
-   RNA_def_property_update(prop, 0, "rna_cloth_update");
-
-   prop = RNA_def_property(srna, "debug2", PROP_FLOAT, PROP_NONE);
-   RNA_def_property_range(prop, 0.0f, 100.0f);
-   RNA_def_property_ui_text(prop, "Debug2", "");
-   RNA_def_property_update(prop, 0, "rna_cloth_update");
-
-   prop = RNA_def_property(srna, "debug3", PROP_INT, PROP_NONE);
-   RNA_def_property_range(prop, 0.0f, 100.0f);
-   RNA_def_property_ui_text(prop, "Debug3", "");
-   RNA_def_property_update(prop, 0, "rna_cloth_update");
-
-   prop = RNA_def_property(srna, "debug4", PROP_INT, PROP_NONE);
-   RNA_def_property_range(prop, 0.0f, 100.0f);
-   RNA_def_property_ui_text(prop, "Debug4", "");
-   RNA_def_property_update(prop, 0, "rna_cloth_update");
-
/* mass */
 
prop = RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp 
b/source/blender/physics/intern/BPH_mass_spring.cpp
index a4f4fb1..6cddbc6 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -712,8 +712,6 @@ static void cloth_continuum_step(ClothModifierData *clmd, 
float dt)
if (smoothfac > 0.0f || density_strength > 0.0f) {
HairGrid *grid = 
BPH_hair_volume_create_vertex_grid(clmd->sim_parms->voxel_cell_size, gmin, 
gmax);

-   BPH_hair_volume_set_debug_value(grid, parms->debug1, 
parms->debug2, parms->debug3, parms->debug4);
-   
  

[Bf-blender-cvs] [6681a6e] gooseberry: Merge branch 'master' into gooseberry

2015-01-21 Thread Lukas Tönne
Commit: 6681a6e83877b79de7ed48a13d59e2416ac3195e
Author: Lukas Tönne
Date:   Wed Jan 21 10:13:47 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB6681a6e83877b79de7ed48a13d59e2416ac3195e

Merge branch 'master' into gooseberry

Conflicts:
source/blender/editors/space_view3d/view3d_draw.c
source/blender/physics/intern/BPH_mass_spring.cpp
source/blender/physics/intern/implicit_blender.c

===



===

diff --cc source/blender/blenkernel/intern/subsurf_ccg.c
index fbe5894,45ec337..1bc6609
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@@ -2176,68 -1869,8 +2176,10 @@@ static void ccgDM_drawFacesSolid(Derive
}
}
}
 +
 +#endif
  }
  
- static void ccgdm_draw_attrib_vertex(DMVertexAttribs *attribs, int a, int 
index, int vert)
- {
-   const float zero[4] = {0.0f, 0.0f, 0.0f, 0.0f};
-   int b;
- 
-   /* orco texture coordinates */
-   if (attribs->totorco) {
-   /*const*/ float (*array)[3] = attribs->orco.array;
-   const float *orco = (array) ? array[index] : zero;
- 
-   if (attribs->orco.gl_texco)
-   glTexCoord3fv(orco);
-   else
-   glVertexAttrib3fvARB(attribs->orco.gl_index, orco);
-   }
- 
-   /* uv texture coordinates */
-   for (b = 0; b < attribs->tottface; b++) {
-   const float *uv;
- 
-   if (attribs->tface[b].array) {
-   MTFace *tf = &attribs->tface[b].array[a];
-   uv = tf->uv[vert];
-   }
-   else {
-   uv = zero;
-   }
- 
-   if (attribs->tface[b].gl_texco)
-   glTexCoord2fv(uv);
-   else
-   glVertexAttrib2fvARB(attribs->tface[b].gl_index, uv);
-   }
- 
-   /* vertex colors */
-   for (b = 0; b < attribs->totmcol; b++) {
-   GLubyte col[4];
- 
-   if (attribs->mcol[b].array) {
-   MCol *cp = &attribs->mcol[b].array[a * 4 + vert];
-   col[0] = cp->b; col[1] = cp->g; col[2] = cp->r; col[3] 
= cp->a;
-   }
-   else {
-   col[0] = 0; col[1] = 0; col[2] = 0; col[3] = 0;
-   }
- 
-   glVertexAttrib4ubvARB(attribs->mcol[b].gl_index, col);
-   }
- 
-   /* tangent for normal mapping */
-   if (attribs->tottang) {
-   /*const*/ float (*array)[4] = attribs->tang.array;
-   const float *tang = (array) ? array[a * 4 + vert] : zero;
- 
-   glVertexAttrib4fvARB(attribs->tang.gl_index, tang);
-   }
- }
- 
  /* Only used by non-editmesh types */
  static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm,
DMSetMaterial setMaterial,
diff --cc source/blender/editors/space_view3d/view3d_draw.c
index d47a836,ed30c87..29d05ab
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@@ -3640,6 -3584,9 +3641,8 @@@ void view3d_main_area_draw(const bConte
  #ifdef DEBUG_DRAW
bl_debug_draw();
  #endif
+   draw_sim_debug_data(scene, v3d, ar);
+   
 -  ED_region_pixelspace(ar);
}
  
/* draw viewport using external renderer */
diff --cc source/blender/physics/intern/BPH_mass_spring.cpp
index 62a13a3,6cddbc6..6c70018
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@@ -1,1113 -1,1017 +1,1106 @@@
 -/*
 - * * BEGIN GPL LICENSE BLOCK *
 - *
 - * This program is free software; you can redistribute it and/or
 - * modify it under the terms of the GNU General Public License
 - * as published by the Free Software Foundation; either version 2
 - * of the License, or (at your option) any later version.
 - *
 - * This program is distributed in the hope that it will be useful,
 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 - * GNU General Public License for more details.
 - *
 - * You should have received a copy of the GNU General Public License
 - * along with this program; if not, write to the Free Software Foundation,
 - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 - *
 - * The Original Code is Copyright (C) Blender Foundation
 - * All rights reserved.
 - *
 - * The Original Code is: all of this file.
 - *
 - * Contributor(s): Lukas Toenne
 - *
 - * * END GPL LICENSE BLOCK *
 - */
 -
 -/** \file blender/physics/intern/BPH_mass_spring.cpp
 - *  \ingroup bph
 - */
 -
 -extern "C" {
 -#include "MEM_guardedalloc.h"
 -
 -#include "DNA_clo

[Bf-blender-cvs] [0f26b5d] gooseberry: Removed the solver_index from cloth vertices.

2015-01-21 Thread Lukas Tönne
Commit: 0f26b5d2f591945e3861a2b6941fc2e3a41b45a4
Author: Lukas Tönne
Date:   Wed Jan 21 10:38:54 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB0f26b5d2f591945e3861a2b6941fc2e3a41b45a4

Removed the solver_index from cloth vertices.

This was used as part of the "sim preview" feature, where some amount of
vertices were tagged as disabled in the particle system. Due to the
mind twisting complexity of using the nested cloth modifier to simulate
hair strands indirectly it became necessary to still store all the
vertices, but then disable them again on the solver level ... If this
ever gets reimplemented it must be done in a sane way, avoiding the
cloth step altogether.

===

M   source/blender/blenkernel/BKE_cloth.h
M   source/blender/blenkernel/intern/cloth.c
M   source/blender/blenkernel/intern/collision.c
M   source/blender/blenkernel/intern/particle_system.c
M   source/blender/physics/intern/BPH_mass_spring.cpp

===

diff --git a/source/blender/blenkernel/BKE_cloth.h 
b/source/blender/blenkernel/BKE_cloth.h
index 534747e..beb4f22 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -59,7 +59,6 @@ struct PartDeflect;
 typedef enum eClothVertexFlag {
CLOTH_VERT_FLAG_PINNED  = 1,
CLOTH_VERT_FLAG_NOSELFCOLL  = 2, /* vertex NOT used for self collisions 
*/
-   CLOTH_VERT_FLAG_EXCLUDE = 4, /* exclude vertex from the simulation 
*/
 } eClothVertexFlag;
 
 typedef struct ClothHairData {
@@ -110,7 +109,6 @@ typedef struct Cloth {
  */
 typedef struct ClothVertex {
int flags;  /* General flags per vertex.*/
-   int solver_index;   /* index in internal solver data */
float   v[3];   /* The velocity of the point.   */
float   xconst[3];  /* constrained position */
float   x[3];   /* The current position of this vertex. */
diff --git a/source/blender/blenkernel/intern/cloth.c 
b/source/blender/blenkernel/intern/cloth.c
index 72a3587..0b9833e 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -739,7 +739,6 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, 
DerivedMesh *dm )
 {
int i = 0;
int j = 0;
-   MVert *mvert;
MDeformVert *dvert = NULL;
Cloth *clothObj = NULL;
int numverts;
@@ -751,7 +750,6 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, 
DerivedMesh *dm )
clothObj = clmd->clothObject;
 
numverts = dm->getNumVerts(dm);
-   mvert = dm->getVertArray(dm);
 
if (cloth_uses_vgroup(clmd)) {
verts = clothObj->verts;
@@ -766,7 +764,6 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, 
DerivedMesh *dm )
/* Reset vertex flags */
verts->flags &= ~CLOTH_VERT_FLAG_PINNED;
verts->flags &= ~CLOTH_VERT_FLAG_NOSELFCOLL;
-   verts->flags &= ~CLOTH_VERT_FLAG_EXCLUDE;
 
dvert = dm->getVertData ( dm, i, CD_MDEFORMVERT );
if ( dvert ) {
@@ -820,10 +817,13 @@ static void cloth_apply_vgroup ( ClothModifierData *clmd, 
DerivedMesh *dm )
}

 #ifdef USE_PARTICLE_PREVIEW
-   verts = clothObj->verts;
-   for ( i = 0; i < numverts; i++, verts++ ) {
-   if (mvert[i].flag & ME_VERT_TMP_TAG)
-   verts->flags |= CLOTH_VERT_FLAG_EXCLUDE;
+   {
+   MVert *mvert = dm->getVertArray(dm);
+   verts = clothObj->verts;
+   for ( i = 0; i < numverts; i++, verts++ ) {
+   if (mvert[i].flag & ME_VERT_TMP_TAG)
+   verts->flags |= CLOTH_VERT_FLAG_EXCLUDE;
+   }
}
 #endif
 }
diff --git a/source/blender/blenkernel/intern/collision.c 
b/source/blender/blenkernel/intern/collision.c
index d710493..2633152 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -1352,14 +1352,7 @@ void cloth_find_point_contacts(Object *ob, 
ClothModifierData *clmd, float step,
unsigned int numcollobj = 0;

verts = cloth->verts;
-   
-   numverts = 0;
-   for (i = 0; i < cloth->numverts; ++i) {
-   /* avoid costly collision detection for points that are 
excluded anyway */
-   if (verts[i].flags & CLOTH_VERT_FLAG_EXCLUDE)
-   continue;
-   ++numverts;
-   }
+   numverts = cloth->numverts;


// static collisions
@@ -1370,9 +1363,6 @@ void cloth_find_point_contacts(Object *ob, 
ClothModifierData *clmd, float step,
/* fill tree */
   

[Bf-blender-cvs] [da96f8a] depsgraph_refactor: Depsgraph: Use straight-lines for graphviz debug

2015-01-21 Thread Joshua Leung
Commit: da96f8a33baa69b9cd92cc333b28cc7fb3db043d
Author: Joshua Leung
Date:   Wed Jan 21 00:23:32 2015 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rBda96f8a33baa69b9cd92cc333b28cc7fb3db043d

Depsgraph: Use straight-lines for graphviz debug

Trying straight/orthogonal lines for relationships in graphviz debug graphs
instead of the curved defaults. The curvy lines were clumping together in 
confusing
ways, making it hard to tell what's going on. Still, this isn't much better, but
can at least see what's going on in the file I'm debugging.

===

M   source/blender/depsgraph/intern/depsgraph_debug.cpp

===

diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cpp 
b/source/blender/depsgraph/intern/depsgraph_debug.cpp
index 9409c77..3cf758b 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cpp
@@ -732,6 +732,8 @@ void DEG_debug_graphviz(const Depsgraph *graph, FILE *f, 
const char *label, bool
deg_debug_fprintf(ctx, ",fontsize=%f", 
deg_debug_graphviz_graph_label_size);
deg_debug_fprintf(ctx, ",fontname=\"%s\"", deg_debug_graphviz_fontname);
deg_debug_fprintf(ctx, ",label=\"%s\"", label);
+   deg_debug_fprintf(ctx, ",splines=ortho");
+   //deg_debug_fprintf(ctx, ",overlap=false");
deg_debug_fprintf(ctx, "];" NL);
 
deg_debug_graphviz_graph_nodes(ctx, graph);

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


[Bf-blender-cvs] [3fd224f] depsgraph_refactor: Depsgraph: Report opcodes using their string identifiers instead of numbers

2015-01-21 Thread Joshua Leung
Commit: 3fd224f2c8a93a93c3e65a2b22373b08a0338ae3
Author: Joshua Leung
Date:   Tue Jan 20 16:32:47 2015 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB3fd224f2c8a93a93c3e65a2b22373b08a0338ae3

Depsgraph: Report opcodes using their string identifiers instead of numbers

===

M   source/blender/depsgraph/intern/depsgraph_build.cpp
M   source/blender/depsgraph/intern/depsgraph_build.h
M   source/blender/depsgraph/intern/depsgraph_types.h
M   source/blender/depsgraph/intern/depsnode_operation.cpp

===

diff --git a/source/blender/depsgraph/intern/depsgraph_build.cpp 
b/source/blender/depsgraph/intern/depsgraph_build.cpp
index e2682f0..7877666 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build.cpp
@@ -337,7 +337,7 @@ OperationDepsNode 
*DepsgraphRelationBuilder::find_node(const OperationKey &key)

OperationDepsNode *op_node = comp_node->find_operation(key.opcode, 
key.name);
if (!op_node) {
-   fprintf(stderr, "find_node_operation: Failed for (%d, '%s')\n", 
key.opcode, key.name.c_str());
+   fprintf(stderr, "find_node_operation: Failed for (%s, '%s')\n", 
DEG_OPNAMES[key.opcode], key.name.c_str());
}
return op_node;
 }
diff --git a/source/blender/depsgraph/intern/depsgraph_build.h 
b/source/blender/depsgraph/intern/depsgraph_build.h
index 50405fc..961103c 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.h
+++ b/source/blender/depsgraph/intern/depsgraph_build.h
@@ -179,12 +179,10 @@ struct OperationKey

string identifier() const
{
-   char typebuf[5], codebuf[5];
-   
+   char typebuf[5];
sprintf(typebuf, "%d", component_type);
-   sprintf(codebuf, "%d", opcode); // XXX: use the string defs 
instead

-   return string("OperationKey(") + "t: " + typebuf + ", cn: '" + 
component_name + "', c: " + codebuf + ", n: '" + name + "')";
+   return string("OperationKey(") + "t: " + typebuf + ", cn: '" + 
component_name + "', c: " + DEG_OPNAMES[opcode] + ", n: '" + name + "')";
}


diff --git a/source/blender/depsgraph/intern/depsgraph_types.h 
b/source/blender/depsgraph/intern/depsgraph_types.h
index cd2ff00..bbcb3e3 100644
--- a/source/blender/depsgraph/intern/depsgraph_types.h
+++ b/source/blender/depsgraph/intern/depsgraph_types.h
@@ -99,6 +99,9 @@ typedef enum eDepsOperation_Code {
#undef DEF_DEG_OPCODE
 } eDepsOperation_Code;
 
+/* String defines for these opcodes, defined in depsnode_operation.cpp */
+extern const char *DEG_OPNAMES[];
+
 
 /* Type of operation */
 typedef enum eDepsOperation_Type {
diff --git a/source/blender/depsgraph/intern/depsnode_operation.cpp 
b/source/blender/depsgraph/intern/depsnode_operation.cpp
index 3700e74..e921cd1 100644
--- a/source/blender/depsgraph/intern/depsnode_operation.cpp
+++ b/source/blender/depsgraph/intern/depsnode_operation.cpp
@@ -40,6 +40,18 @@ extern "C" {
 #include "stubs.h" // XXX: THIS MUST BE REMOVED WHEN THE DEPSGRAPH REFACTOR IS 
DONE
 
 /*  */
+/* OpNode Identifiers Array - Exported to other depsgraph files too... */
+
+/* identifiers for operations */
+const char *DEG_OPNAMES[] = {
+   #define DEF_DEG_OPCODE(label) #label,
+   #include "depsnode_opcodes.h"
+   #undef DEF_DEG_OPCODE
+   
+   ""
+};
+
+/*  */
 /* Inner Nodes */
 
 OperationDepsNode::OperationDepsNode() :
@@ -53,15 +65,6 @@ OperationDepsNode::~OperationDepsNode()
 
 string OperationDepsNode::identifier() const
 {
-   /* identifiers for operations */
-   const char *DEG_OPNAMES[] = {
-   #define DEF_DEG_OPCODE(label) #label,
-   #include "depsnode_opcodes.h"
-   #undef DEF_DEG_OPCODE
-   
-   ""
-   };
-   
BLI_assert((opcode > 0) && (opcode < ARRAY_SIZE(DEG_OPNAMES)));
return string(DEG_OPNAMES[opcode]) + "(" + name + ")";
 }

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


[Bf-blender-cvs] [6e44e4b] depsgraph_refactor: Depsgraph: WIP attempt to resolve some problems with IK chains

2015-01-21 Thread Joshua Leung
Commit: 6e44e4b4968ed5ab4472c769d2d9687941d326da
Author: Joshua Leung
Date:   Thu Jan 22 00:03:48 2015 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB6e44e4b4968ed5ab4472c769d2d9687941d326da

Depsgraph: WIP attempt to resolve some problems with IK chains

This commit tried to fix the problems which occur when a bone that's
part of an IK chain has a constraint to another bone in the same chain.
Since all constraints are (or should still) handled before the IK solver runs,
that ended up causing a deadlock, since the offending bone would rely on the
"final" (done_node) transform of another bone in the same IK chain, which could
only run after the IK solver runs - but that cannot run as it's waiting on this
constrained bone.

* Added a dedicated "BONE_READY" noop, which sits after the constraints op,
  before the done node, and before any link to an IK solver. This replaces
  all the calls to bone_final_transform() by having a dedicated node which
  can be queried for this purpose

* Simplified the way that bone relationships get set up: The idea is that
  all bones in the same armature will use the "READY" nodes instead of "DONE"
  to avoid any lockups when dealing with IK. This way, we can do without all the
  common-root checks before doing parent links and so forth, as well as just
  setting out all the major relationships at the same time.

  (There is of course the risk that this breaks some old rigs (* see note 
below))


The result of all these efforts is that all the simple test cases and also the
test file with the offending setup which inspired this fix all work now. 
However,
it also seems to now be causing a range of weird regressions with production 
rigs
(notably, strange new unstable popping in Koro and Victor Layout, as well as lag
issues on some simpler IK leg rigs).

===

M   source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
M   source/blender/depsgraph/intern/depsgraph_build_relations.cpp
M   source/blender/depsgraph/intern/depsnode_opcodes.h

===

diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp 
b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
index be75f51..e0eeeba 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
@@ -609,6 +609,10 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object 
*ob)
add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
   DEPSOP_TYPE_EXEC, 
function_bind(BKE_pose_eval_bone, _1, scene, ob, pchan), // XXX: 
BKE_pose_eval_bone_pose
   DEG_OPCODE_BONE_POSE_PARENT);
+  
+   add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
+  DEPSOP_TYPE_OUT, NULL, /* NOTE: dedicated 
noop for easier relationship construction */
+  DEG_OPCODE_BONE_READY);

add_operation_node(&ob->id, DEPSNODE_TYPE_BONE, pchan->name,
   DEPSOP_TYPE_POST, NULL, // XXX: 
BKE_eval_bone_done ?
diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp 
b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
index d8048a7..9461e72 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -532,8 +532,17 @@ void DepsgraphRelationBuilder::build_constraints(Scene 
*scene, ID *id, eDepsNode
}
else if ((ct->tar->type == OB_ARMATURE) && 
(ct->subtarget[0])) {
/* bone */
-   OperationKey target_key(&ct->tar->id, 
DEPSNODE_TYPE_BONE, ct->subtarget, DEG_OPCODE_BONE_DONE); // XXX: ik vs normal
-   add_relation(target_key, 
constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
+   if (&ct->tar->id == id) {
+   /* same armature - use the 
"ready" state only, to avoid collisions with IK */
+   /* NOTE: in some cases, this 
may break (i.e. if the target is in a separate chain which can get safely 
evaluated first) */
+   OperationKey 
target_key(&ct->tar->id, DEPSNODE_TYPE_BONE, ct->subtarget, 
DEG_OPCODE_BONE_READY);
+   add_relation(target_key, 
constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
+   }
+   else {
+   /* different armature - we 

[Bf-blender-cvs] [78c342b] depsgraph_refactor: Depsgraph: Code cleanup - Remove unneeded define

2015-01-21 Thread Joshua Leung
Commit: 78c342bbc63af707579b7cfe70331cb388925f7c
Author: Joshua Leung
Date:   Fri Jan 16 23:03:41 2015 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB78c342bbc63af707579b7cfe70331cb388925f7c

Depsgraph: Code cleanup - Remove unneeded define

===

M   source/blender/depsgraph/intern/depsgraph_build_nodes.cpp

===

diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp 
b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
index 9af05cb..be75f51 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
@@ -360,10 +360,9 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
/* actions and NLA - as a single unit for now, as it gets 
complicated to schedule otherwise */
if ((adt->action) || (adt->nla_tracks.first)) {
/* create the node */
-   OperationDepsNode *adt_op; // XXX: unread
-   adt_op = add_operation_node(id, DEPSNODE_TYPE_ANIMATION,
-   DEPSOP_TYPE_EXEC, 
function_bind(BKE_animsys_eval_animdata, _1, id, time_src),
-   DEG_OPCODE_ANIMATION, 
id->name);
+   add_operation_node(id, DEPSNODE_TYPE_ANIMATION,
+  DEPSOP_TYPE_EXEC, 
function_bind(BKE_animsys_eval_animdata, _1, id, time_src),
+  DEG_OPCODE_ANIMATION, id->name);

// TODO: for each channel affected, we might also want 
to add some support for running RNA update callbacks on them
// (which will be needed for proper handling of drivers 
later)

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


[Bf-blender-cvs] [5ff8af8] depsgraph_refactor: Depsgraph: WIP - Experimental fixes for regressions introduced

2015-01-21 Thread Joshua Leung
Commit: 5ff8af812332e51e2381d135d8d27302eb0cba1f
Author: Joshua Leung
Date:   Thu Jan 22 00:59:30 2015 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB5ff8af812332e51e2381d135d8d27302eb0cba1f

Depsgraph: WIP - Experimental fixes for regressions introduced

So, it seems that using BONE_READY for constraint targets was breaking
production rigs (notably the foot/leg setups), while using BONE_DONE
will break the constrained-to-bone-in-same-ikchain setup...

Just noting this here in case this comes in handy at some point. Perhaps
we need to try something fancier using the rootmaps here?

===

M   source/blender/depsgraph/intern/depsgraph_build_relations.cpp

===

diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp 
b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
index 9461e72..08799fa 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -535,7 +535,7 @@ void DepsgraphRelationBuilder::build_constraints(Scene 
*scene, ID *id, eDepsNode
if (&ct->tar->id == id) {
/* same armature - use the 
"ready" state only, to avoid collisions with IK */
/* NOTE: in some cases, this 
may break (i.e. if the target is in a separate chain which can get safely 
evaluated first) */
-   OperationKey 
target_key(&ct->tar->id, DEPSNODE_TYPE_BONE, ct->subtarget, 
DEG_OPCODE_BONE_READY);
+   OperationKey 
target_key(&ct->tar->id, DEPSNODE_TYPE_BONE, ct->subtarget, 
DEG_OPCODE_BONE_DONE);
add_relation(target_key, 
constraint_op_key, DEPSREL_TYPE_TRANSFORM, cti->name);
}
else {
@@ -1034,7 +1034,8 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob,
}
else {
/* same armature - we'll use the ready state 
only, just in case this bone is in the chain we're solving */
-   OperationKey target_key(&data->tar->id, 
DEPSNODE_TYPE_BONE, data->subtarget, DEG_OPCODE_BONE_READY);
+   //OperationKey target_key(&data->tar->id, 
DEPSNODE_TYPE_BONE, data->subtarget, DEG_OPCODE_BONE_READY);
+   OperationKey target_key(&data->tar->id, 
DEPSNODE_TYPE_BONE, data->subtarget, DEG_OPCODE_BONE_DONE);
add_relation(target_key, solver_key, 
DEPSREL_TYPE_TRANSFORM, con->name);
}
}

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


[Bf-blender-cvs] [a86482f] master: Fix T43158: pixels in the 3d-view was mis-aligned

2015-01-21 Thread Campbell Barton
Commit: a86482f81cf3e4a0043459b10242d4a9c337105b
Author: Campbell Barton
Date:   Wed Jan 21 23:01:50 2015 +1100
Branches: master
https://developer.blender.org/rBa86482f81cf3e4a0043459b10242d4a9c337105b

Fix T43158: pixels in the 3d-view was mis-aligned

Change the pixel offset for regions, it make oversampling blurry when drawing 
pixel aligned values.
See T41749

===

M   source/blender/editors/space_node/drawnode.c
M   source/blender/editors/space_text/text_draw.c
M   source/blender/windowmanager/intern/wm_subwindow.c

===

diff --git a/source/blender/editors/space_node/drawnode.c 
b/source/blender/editors/space_node/drawnode.c
index c45626e..870b463 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3053,9 +3053,7 @@ void draw_nodespace_back_pix(const bContext *C, ARegion 
*ar, SpaceNode *snode, b
/* somehow the offset has to be calculated inverse */

glaDefine2DArea(&ar->winrct);
-   /* ortho at pixel level curarea */
-   /* almost #wmOrtho2_region_pixelspace, but no +1 px */
-   wmOrtho2_pixelspace(ar->winx, ar->winy);
+   wmOrtho2_region_pixelspace(ar);

x = (ar->winx - snode->zoom * ibuf->x) / 2 + snode->xof;
y = (ar->winy - snode->zoom * ibuf->y) / 2 + snode->yof;
diff --git a/source/blender/editors/space_text/text_draw.c 
b/source/blender/editors/space_text/text_draw.c
index 31662c0..bc5c56c 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1447,7 +1447,6 @@ void draw_text_main(SpaceText *st, ARegion *ar)
 
/* draw other stuff */
draw_brackets(st, ar);
-   glTranslatef(GLA_PIXEL_OFS, GLA_PIXEL_OFS, 0.0f); /* XXX scroll 
requires exact pixel space */
draw_textscroll(st, &scroll, &back);
draw_documentation(st, ar);
draw_suggestion_list(st, ar);
diff --git a/source/blender/windowmanager/intern/wm_subwindow.c 
b/source/blender/windowmanager/intern/wm_subwindow.c
index d2df020..4ce2415 100644
--- a/source/blender/windowmanager/intern/wm_subwindow.c
+++ b/source/blender/windowmanager/intern/wm_subwindow.c
@@ -367,7 +367,7 @@ static void wmOrtho2_offset(const float x, const float y, 
const float ofs)
  */
 void wmOrtho2_region_pixelspace(const struct ARegion *ar)
 {
-   wmOrtho2_offset(ar->winx + 1, ar->winy + 1, -GLA_PIXEL_OFS);
+   wmOrtho2_offset(ar->winx, ar->winy, -0.01f);
 }
 
 void wmOrtho2_pixelspace(const float x, const float y)

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


[Bf-blender-cvs] [f23338e] master: Fix limit check before accessing array in opennl

2015-01-21 Thread Martin Ettl
Commit: f23338e107503ea9cddaa1e016f750c8c15a
Author: Martin Ettl
Date:   Wed Jan 21 17:18:39 2015 +0500
Branches: master
https://developer.blender.org/rBf23338e107503ea9cddaa1e016f750c8c15a

Fix limit check before accessing array in opennl

Please note that opennl is already modified (for double precision)
so re-integration is not really easy. Also, we'll eventually switch
to Eigen.

For until that let's just solve the condition in our bundled opennl.

===

M   intern/opennl/superlu/heap_relax_snode.c
M   intern/opennl/superlu/relax_snode.c

===

diff --git a/intern/opennl/superlu/heap_relax_snode.c 
b/intern/opennl/superlu/heap_relax_snode.c
index d4b3e22..cd88179 100644
--- a/intern/opennl/superlu/heap_relax_snode.c
+++ b/intern/opennl/superlu/heap_relax_snode.c
@@ -99,7 +99,7 @@ heap_relax_snode (
}
j++;
/* Search for a new leaf */
-   while ( descendants[j] != 0 && j < n ) j++;
+   while ( j < n && descendants[j] != 0 ) j++;
 }
 
 #if ( PRNTlevel>=1 )
diff --git a/intern/opennl/superlu/relax_snode.c 
b/intern/opennl/superlu/relax_snode.c
index 49f6005..4a9265e 100644
--- a/intern/opennl/superlu/relax_snode.c
+++ b/intern/opennl/superlu/relax_snode.c
@@ -66,7 +66,7 @@ relax_snode (
relax_end[snode_start] = j; /* Last column is recorded */
j++;
/* Search for a new leaf */
-   while ( descendants[j] != 0 && j < n ) j++;
+   while ( j < n && descendants[j] != 0 ) j++;
 }
 
 /*printf("No of relaxed snodes: %d; relaxed columns: %d\n",

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


[Bf-blender-cvs] [f087e99] master: Added new debug flag which can be used to lazy-init the SimDebug drawing.

2015-01-21 Thread Lukas Tönne
Commit: f087e9930d5b8c876206af117ce085dec0ec4578
Author: Lukas Tönne
Date:   Wed Jan 21 14:00:59 2015 +0100
Branches: master
https://developer.blender.org/rBf087e9930d5b8c876206af117ce085dec0ec4578

Added new debug flag which can be used to lazy-init the SimDebug drawing.

A development addon can be used now to enable the debug drawing, without
the need to add UI code for this in the release files.

The SimDebug feature should also get an overall build flag and use
function stubs unless enabled. That way any possibility of overhead in
releases is eliminated.

===

M   source/blender/blenkernel/BKE_global.h
M   source/blender/blenkernel/intern/effect.c
M   source/blender/editors/space_view3d/view3d_draw.c
M   source/blender/python/intern/bpy_app.c

===

diff --git a/source/blender/blenkernel/BKE_global.h 
b/source/blender/blenkernel/BKE_global.h
index e70689b..57003ff 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -126,6 +126,7 @@ enum {
G_DEBUG_JOBS =  (1 << 6), /* jobs time profiling */
G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
G_DEBUG_DEPSGRAPH = (1 << 8), /* depsgraph messages */
+   G_DEBUG_SIMDATA =   (1 << 9), /* sim debug data display */
 };
 
 #define G_DEBUG_ALL  (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | 
G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
diff --git a/source/blender/blenkernel/intern/effect.c 
b/source/blender/blenkernel/intern/effect.c
index c896fa2..9c3e78d 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -63,6 +63,7 @@
 #include "BKE_DerivedMesh.h"
 #include "BKE_cdderivedmesh.h"
 #include "BKE_effect.h"
+#include "BKE_global.h"
 #include "BKE_modifier.h"
 #include "BKE_object.h"
 #include "BKE_particle.h"
@@ -1124,8 +1125,13 @@ void BKE_sim_debug_data_add_element(int type, const 
float v1[3], const float v2[
 {
unsigned int category_hash = BLI_ghashutil_strhash_p(category);
SimDebugElement *elem;
-   if (!_sim_debug_data)
-   return;
+   
+   if (!_sim_debug_data) {
+   if (G.debug & G_DEBUG_SIMDATA)
+   BKE_sim_debug_data_set_enabled(true);
+   else
+   return;
+   }

elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
elem->type = type;
diff --git a/source/blender/editors/space_view3d/view3d_draw.c 
b/source/blender/editors/space_view3d/view3d_draw.c
index ed30c87..88cabcc 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3584,7 +3584,8 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
 #ifdef DEBUG_DRAW
bl_debug_draw();
 #endif
-   draw_sim_debug_data(scene, v3d, ar);
+   if (G.debug & G_DEBUG_SIMDATA)
+   draw_sim_debug_data(scene, v3d, ar);

ED_region_pixelspace(ar);
}
diff --git a/source/blender/python/intern/bpy_app.c 
b/source/blender/python/intern/bpy_app.c
index 678fd62..cca4191 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -283,6 +283,7 @@ static PyGetSetDef bpy_app_getsets[] = {
{(char *)"debug_handlers",  bpy_app_debug_get, bpy_app_debug_set, (char 
*)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS},
{(char *)"debug_wm",bpy_app_debug_get, bpy_app_debug_set, (char 
*)bpy_app_debug_doc, (void *)G_DEBUG_WM},
{(char *)"debug_depsgraph", bpy_app_debug_get, bpy_app_debug_set, (char 
*)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH},
+   {(char *)"debug_simdata",   bpy_app_debug_get, bpy_app_debug_set, (char 
*)bpy_app_debug_doc, (void *)G_DEBUG_SIMDATA},
 
{(char *)"debug_value", bpy_app_debug_value_get, 
bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL},
{(char *)"tempdir", bpy_app_tempdir_get, NULL, (char 
*)bpy_app_tempdir_doc, NULL},

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


[Bf-blender-cvs] [5662864] gooseberry: Merge branch 'master' into gooseberry

2015-01-21 Thread Lukas Tönne
Commit: 5662864e5b5f70432324d7ec0fcdf9b6054b5c2f
Author: Lukas Tönne
Date:   Wed Jan 21 14:05:35 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB5662864e5b5f70432324d7ec0fcdf9b6054b5c2f

Merge branch 'master' into gooseberry

===



===

diff --cc source/blender/editors/space_node/drawnode.c
index 58ca9d0,870b463..448c2f8
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@@ -3053,12 -3053,10 +3053,10 @@@ void draw_nodespace_back_pix(const bCon
/* somehow the offset has to be calculated inverse */

glaDefine2DArea(&ar->winrct);
-   /* ortho at pixel level curarea */
-   /* almost #wmOrtho2_region_pixelspace, but no +1 px */
-   wmOrtho2_pixelspace(ar->winx, ar->winy);
+   wmOrtho2_region_pixelspace(ar);

 -  x = (ar->winx - snode->zoom * ibuf->x) / 2 + snode->xof;
 -  y = (ar->winy - snode->zoom * ibuf->y) / 2 + snode->yof;
 +  x = (ar->winx - snode->backdrop_zoom * ibuf->x) / 2 + 
snode->backdrop_offset[0];
 +  y = (ar->winy - snode->backdrop_zoom * ibuf->y) / 2 + 
snode->backdrop_offset[1];

if (ibuf->rect || ibuf->rect_float) {
unsigned char *display_buffer = NULL;
diff --cc source/blender/editors/space_view3d/view3d_draw.c
index 29d05ab,88cabcc..2be3f39
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@@ -3641,8 -3584,10 +3641,9 @@@ void view3d_main_area_draw(const bConte
  #ifdef DEBUG_DRAW
bl_debug_draw();
  #endif
-   draw_sim_debug_data(scene, v3d, ar);
+   if (G.debug & G_DEBUG_SIMDATA)
+   draw_sim_debug_data(scene, v3d, ar);

 -  ED_region_pixelspace(ar);
}
  
/* draw viewport using external renderer */

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


[Bf-blender-cvs] [3df93d0] master: Fix: Joining armatures loses drivers

2015-01-21 Thread Joshua Leung
Commit: 3df93d063e2d52a2c2e73cfe31801c15682bf0b4
Author: Joshua Leung
Date:   Thu Jan 22 02:08:29 2015 +1300
Branches: master
https://developer.blender.org/rB3df93d063e2d52a2c2e73cfe31801c15682bf0b4

Fix: Joining armatures loses drivers

Currently, when joining two armatures, the drivers of the armatures being merged
in are lost. This commit introduces a new AnimData API function for merging
animation data into another AnimData block.

NOTE:
* For now, this only copies the drivers over. As a result, manual effort will
  still be needed to go through and fix the drivers.

  I am working on automating that process, but it's more important that the
  drivers don't have to be created from scratch for now (since this is needed
  for the Goosberry rigging work).

===

M   source/blender/blenkernel/BKE_animsys.h
M   source/blender/blenkernel/intern/anim_sys.c
M   source/blender/editors/armature/armature_naming.c
M   source/blender/editors/armature/armature_relations.c

===

diff --git a/source/blender/blenkernel/BKE_animsys.h 
b/source/blender/blenkernel/BKE_animsys.h
index a5109ac..24abd11 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -73,6 +73,20 @@ bool BKE_copy_animdata_id(struct ID *id_to, struct ID 
*id_from, const bool do_ac
 /* Copy AnimData Actions */
 void BKE_copy_animdata_id_action(struct ID *id);
 
+/* Merge copies of data from source AnimData block */
+typedef enum eAnimData_MergeCopy_Modes {
+   /* Keep destination action */
+   ADT_MERGECOPY_KEEP_DST = 0,
+   
+   /* Use src action (make a new copy) */
+   ADT_MERGECOPY_SRC_COPY = 1,
+   
+   /* Use src action (but just reference the existing version) */
+   ADT_MERGECOPY_SRC_REF  = 2
+} eAnimData_MergeCopy_Modes;
+
+void BKE_animdata_merge_copy(struct ID *dst_id, struct ID *src_id, 
eAnimData_MergeCopy_Modes action_mode, bool fix_drivers);
+
 /* Make Local */
 void BKE_animdata_make_local(struct AnimData *adt);
 
diff --git a/source/blender/blenkernel/intern/anim_sys.c 
b/source/blender/blenkernel/intern/anim_sys.c
index 8e36449..00e5c1b 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -318,6 +318,77 @@ void BKE_copy_animdata_id_action(ID *id)
}
 }
 
+/* Merge copies of the data from the src AnimData into the destination 
AnimData */
+void BKE_animdata_merge_copy(ID *dst_id, ID *src_id, eAnimData_MergeCopy_Modes 
action_mode, bool fix_drivers)
+{
+   AnimData *src = BKE_animdata_from_id(src_id);
+   AnimData *dst = BKE_animdata_from_id(dst_id);
+   
+   /* sanity checks */
+   if (ELEM(NULL, dst, src))
+   return;
+   
+   // TODO: we must unset all "tweakmode" flags
+   if ((src->flag & ADT_NLA_EDIT_ON) || (dst->flag & ADT_NLA_EDIT_ON)) {
+   printf("ERROR: Merging AnimData blocks while editing NLA is 
dangerous as it may cause data corruption\n");
+   return;
+   }
+   
+   /* handle actions... */
+   if (action_mode == ADT_MERGECOPY_SRC_COPY) {
+   /* make a copy of the actions */
+   dst->action = BKE_action_copy(src->action);
+   dst->tmpact = BKE_action_copy(src->tmpact);
+   }
+   else if (action_mode == ADT_MERGECOPY_SRC_REF) {
+   /* make a reference to it */
+   dst->action = src->action;
+   id_us_plus((ID *)dst->action);
+   
+   dst->tmpact = src->tmpact;
+   id_us_plus((ID *)dst->tmpact);
+   }
+   
+   /* duplicate NLA data */
+   if (src->nla_tracks.first) {
+   ListBase tracks = {NULL, NULL};
+   
+   copy_nladata(&tracks, &src->nla_tracks);
+   BLI_movelisttolist(&dst->nla_tracks, &tracks);
+   }
+   
+   /* duplicate drivers (F-Curves) */
+   if (src->drivers.first) {
+   ListBase drivers = {NULL, NULL};
+   
+   copy_fcurves(&drivers, &src->drivers);
+   
+   /* Fix up all driver targets using the old target id
+* - This assumes that the src ID is being merged into the dst 
ID
+*/
+   if (fix_drivers) {
+   FCurve *fcu;
+   
+   for (fcu = drivers.first; fcu; fcu = fcu->next) {
+   ChannelDriver *driver = fcu->driver;
+   DriverVar *dvar;
+   
+   for (dvar = driver->variables.first; dvar; dvar 
= dvar->next) {
+   DRIVER_TARGETS_USED_LOOPER(dvar)
+   {
+   if (dta

[Bf-blender-cvs] [684942c2] master: CMake/MSVC: Quotes around the path

2015-01-21 Thread Campbell Barton
Commit: 684942c2feb60a5b2c73cd588ca6367699e4b5e3
Author: Campbell Barton
Date:   Thu Jan 22 01:52:17 2015 +1100
Branches: master
https://developer.blender.org/rB684942c2feb60a5b2c73cd588ca6367699e4b5e3

CMake/MSVC: Quotes around the path

D940 by @TeeTrizZz

===

M   source/creator/CMakeLists.txt

===

diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 21cb41d..f4d6432 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -640,9 +640,9 @@ elseif(WIN32)
"
message(STATUS \"Extracting Python to: 
\${CMAKE_INSTALL_PREFIX}/${BLENDER_VERSION}/python\")
if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES 
\"^([Dd][Ee][Bb][Uu][Gg])$\")
-   set(PYTHON_ZIP 
${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_d.tar.gz)
+   set(PYTHON_ZIP 
\"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}_d.tar.gz\")
else()
-   set(PYTHON_ZIP 
${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}.tar.gz)
+   set(PYTHON_ZIP 
\"${LIBDIR}/release/python${_PYTHON_VERSION_NO_DOTS}.tar.gz\")
endif()
 
execute_process(

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


[Bf-blender-cvs] [7165db5] master: Cleanup of BGE code CcdPhysicsEnvironment::CallbackTriggers()

2015-01-21 Thread Sybren A. Stüvel
Commit: 7165db53f2663b78749019ff791816c36e6182e6
Author: Sybren A. Stüvel
Date:   Wed Jan 21 18:42:24 2015 +0100
Branches: master
https://developer.blender.org/rB7165db53f2663b78749019ff791816c36e6182e6

Cleanup of BGE code CcdPhysicsEnvironment::CallbackTriggers()

Refactored some code to be easier to read. Semantically the code is
identical.

  - Some conditions were negated to be able to return/continue early,
rather than having the majority of the code inside an if-body.
  - Conditions were simplified (!(a == b)) turned into (a != b);
repeated conditions calculated only once.
  - Unnecessary variables and one unnecessary condition were
eliminated.

Reviewers: campbellbarton, lordloki

Reviewed By: lordloki

Projects: #game_physics

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

===

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

===

diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp 
b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
index 38e7df6..2046ad0 100644
--- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
@@ -2251,64 +2251,61 @@ bool 
CcdPhysicsEnvironment::RequestCollisionCallback(PHY_IPhysicsController* ctr
 
 void   CcdPhysicsEnvironment::CallbackTriggers()
 {
-   if (m_triggerCallbacks[PHY_OBJECT_RESPONSE] || (m_debugDrawer && 
(m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints)))
-   {
-   //walk over all overlapping pairs, and if one of the involved 
bodies is registered for trigger callback, perform callback
-   btDispatcher* dispatcher = m_dynamicsWorld->getDispatcher();
-   int numManifolds = dispatcher->getNumManifolds();
-   for (int i=0;igetManifoldByIndexInternal(i);
-   int numContacts = manifold->getNumContacts();
-   if (numContacts)
-   {
-   const btRigidBody* rb0 = static_cast(manifold->getBody0());
-   const btRigidBody* rb1 = static_cast(manifold->getBody1());
-   if (m_debugDrawer && 
(m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints))
-   {
-   for (int j=0;jgetContactPoint(j);
-   if (m_debugDrawer)
-   
m_debugDrawer->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color);
-   }
-   }
-   const btRigidBody* obj0 = rb0;
-   const btRigidBody* obj1 = rb1;
+   bool draw_contact_points = m_debugDrawer && 
(m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints);
 
-   //m_internalOwner is set in 
'addPhysicsController'
-   CcdPhysicsController* ctrl0 = 
static_cast(obj0->getUserPointer());
-   CcdPhysicsController* ctrl1 = 
static_cast(obj1->getUserPointer());
+   if (!m_triggerCallbacks[PHY_OBJECT_RESPONSE] && !draw_contact_points)
+   return;
 
-   std::set::const_iterator 
i = m_triggerControllers.find(ctrl0);
-   if (i == m_triggerControllers.end())
-   {
-   i = m_triggerControllers.find(ctrl1);
-   }
+   //walk over all overlapping pairs, and if one of the involved bodies is 
registered for trigger callback, perform callback
+   btDispatcher* dispatcher = m_dynamicsWorld->getDispatcher();
+   int numManifolds = dispatcher->getNumManifolds();
+   for (int i=0;igetManifoldByIndexInternal(i);
+   int numContacts = manifold->getNumContacts();
+   if (!numContacts) continue;
 
-   if (!(i == m_triggerControllers.end()))
-   {
-   
m_triggerCallbacks[PHY_OBJECT_RESPONSE](m_triggerCallbacksUserPtrs[PHY_OBJECT_RESPONSE],
-   ctrl0,ctrl1,0);
-   }
-   // Bullet does not refresh the manifold contact 
point for object without contact response
-   // may need to remove this when a newer Bullet 
version is integrated
-   if (!dispatcher->needsResponse(rb0, rb1))
-   {
-   // Refresh algorithm fails sometimes 
when there is penetration 
- 

[Bf-blender-cvs] [4c05067] multiview: Sequencer Proxy: Image - Avoid creating unecessary proxy image files

2015-01-21 Thread Dalai Felinto
Commit: 4c050676e8d9596e4d1739a37b0b503f6a22486b
Author: Dalai Felinto
Date:   Wed Jan 21 15:24:14 2015 -0200
Branches: multiview
https://developer.blender.org/rB4c050676e8d9596e4d1739a37b0b503f6a22486b

Sequencer Proxy: Image - Avoid creating unecessary proxy image files

===

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

===

diff --git a/source/blender/blenkernel/intern/sequencer.c 
b/source/blender/blenkernel/intern/sequencer.c
index 6dbe441..f650a45 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -53,6 +53,12 @@
 #include "BLI_threads.h"
 #include "BLI_utildefines.h"
 
+#ifdef WIN32
+#  include "BLI_winstuff.h"
+#else
+#  include 
+#endif
+
 #include "BLF_translation.h"
 
 #include "BKE_animsys.h"
@@ -1668,6 +1674,41 @@ static void seq_proxy_build_frame(const SeqRenderData 
*context, Sequence *seq, i
IMB_freeImBuf(ibuf);
 }
 
+/* returns whether the file this context would read from even exist, if not, 
don't create the context
+*/
+static bool seq_proxy_multiview_context_invalid(Sequence *seq, Scene *scene, 
const size_t view_id)
+{
+   if ((scene->r.scemode & R_MULTIVIEW) == 0)
+   return false;
+
+   if ((seq->type == SEQ_TYPE_IMAGE) && (seq->views_format == 
R_IMF_VIEWS_INDIVIDUAL)) {
+   static char prefix[FILE_MAX] = {'\0'};
+   static char *ext = NULL;
+   char str[FILE_MAX] = {'\0'};
+
+   if (view_id == 0) {
+   char path[FILE_MAX];
+   BLI_join_dirfile(path, sizeof(path), seq->strip->dir,
+seq->strip->stripdata->name);
+   BLI_path_abs(path, G.main->name);
+   BKE_scene_view_prefix_get(scene, path, prefix, &ext);
+   }
+
+   if (prefix[0] == '\0')
+   return view_id != 0;
+
+   seq_multiview_name(scene, view_id, prefix, ext, str, FILE_MAX);
+
+   if (BLI_access(str, R_OK) == 0)
+   return false;
+   else
+   return view_id != 0;
+   }
+   return false;
+}
+
+/** This returns the maximum possible number of required contexts
+*/
 static size_t seq_proxy_context_count(Sequence *seq, Scene *scene)
 {
size_t num_views = 1;
@@ -1722,6 +1763,9 @@ void BKE_sequencer_proxy_rebuild_context(Main *bmain, 
Scene *scene, Sequence *se
num_files = seq_proxy_context_count(seq, scene);
 
for (i = 0; i < num_files; i++) {
+   if (seq_proxy_multiview_context_invalid(seq, scene, i))
+   continue;
+
context = MEM_callocN(sizeof(SeqIndexBuildContext), "seq proxy 
rebuild context");
 
nseq = BKE_sequence_dupli_recursive(scene, scene, seq, 0);

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


[Bf-blender-cvs] [11cb2ab] multiview: Small refactor using BKE_scene_view_id_suffix_get()

2015-01-21 Thread Dalai Felinto
Commit: 11cb2ab91943137e0fc1d2cd5d2b545ab97afca9
Author: Dalai Felinto
Date:   Mon Jan 19 18:43:02 2015 -0200
Branches: multiview
https://developer.blender.org/rB11cb2ab91943137e0fc1d2cd5d2b545ab97afca9

Small refactor using BKE_scene_view_id_suffix_get()

===

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

===

diff --git a/source/blender/blenkernel/intern/sequencer.c 
b/source/blender/blenkernel/intern/sequencer.c
index 0451beb..2caf2b7 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -787,9 +787,7 @@ void BKE_sequence_calc(Scene *scene, Sequence *seq)
 static void seq_multiview_name(Scene *scene, const size_t view_id, const char 
*prefix,
const char *ext, char *r_path, size_t r_size)
 {
-   const char *viewname = BKE_scene_render_view_name_get(&scene->r, 
view_id);
-   const char *suffix = BKE_scene_view_suffix_get(&scene->r, viewname);
-
+   const char *suffix = BKE_scene_view_id_suffix_get(&scene->r, view_id);
BLI_snprintf(r_path, r_size, "%s%s%s", prefix, suffix, ext);
 }
 
@@ -1453,8 +1451,7 @@ static void seq_open_anim_file(Scene *scene, Sequence 
*seq)
goto monoview;
 
for (i = 0; i < totfiles; i++) {
-   const char *viewname = 
BKE_scene_render_view_name_get(&scene->r, i);
-   const char *suffix = 
BKE_scene_view_suffix_get(&scene->r, viewname);
+   const char *suffix = 
BKE_scene_view_id_suffix_get(&scene->r, i);
char str[FILE_MAX] = {'\0'};
 
StripAnim *sanim = MEM_mallocN(sizeof(StripAnim), 
"Strip Anim");

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


[Bf-blender-cvs] [2e207f9] multiview: Sequencer Proxy: movies sequences in a working state, aka everything working

2015-01-21 Thread Dalai Felinto
Commit: 2e207f9154d2e9714f34d03d4b27a72ed7db26a6
Author: Dalai Felinto
Date:   Wed Jan 21 14:02:06 2015 -0200
Branches: multiview
https://developer.blender.org/rB2e207f9154d2e9714f34d03d4b27a72ed7db26a6

Sequencer Proxy: movies sequences in a working state, aka everything working

Proxies in the Sequencer are fully working with Multiview.
The code can be cleaned up a bit, but at least it's entirely functional.

Note, for images we generate one proxy image per view (per frame), while
for movies we generate one proxy movie per movie (so an anaglyph movie
will generate only one proxy).

Tested cases:
* Image sequence - mono
* Image sequence - 3d top-bottom encoded
* Image sequence - 3d left-right pair
* Movie sequence - mono
* Movie sequence - 3d top-bottom encoded
* Movie sequence - 3d left-right pair

===

M   source/blender/blenkernel/BKE_sequencer.h
M   source/blender/blenkernel/intern/sequencer.c
M   source/blender/editors/space_sequencer/sequencer_edit.c
M   source/blender/imbuf/IMB_imbuf.h
M   source/blender/imbuf/intern/IMB_anim.h
M   source/blender/imbuf/intern/anim_movie.c
M   source/blender/imbuf/intern/indexer.c

===

diff --git a/source/blender/blenkernel/BKE_sequencer.h 
b/source/blender/blenkernel/BKE_sequencer.h
index 17a0b4c..c698f9f 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -239,7 +239,7 @@ struct StripElem *BKE_sequencer_give_stripelem(struct 
Sequence *seq, int cfra);
 void BKE_sequencer_update_changed_seq_and_deps(struct Scene *scene, struct 
Sequence *changed_seq, int len_change, int ibuf_change);
 bool BKE_sequencer_input_have_to_preprocess(const SeqRenderData *context, 
struct Sequence *seq, float cfra);
 
-struct SeqIndexBuildContext *BKE_sequencer_proxy_rebuild_context(struct Main 
*bmain, struct Scene *scene, struct Sequence *seq);
+void BKE_sequencer_proxy_rebuild_context(struct Main *bmain, struct Scene 
*scene, struct Sequence *seq, ListBase *queue);
 void BKE_sequencer_proxy_rebuild(struct SeqIndexBuildContext *context, short 
*stop, short *do_update, float *progress);
 void BKE_sequencer_proxy_rebuild_finish(struct SeqIndexBuildContext *context, 
bool stop);
 
diff --git a/source/blender/blenkernel/intern/sequencer.c 
b/source/blender/blenkernel/intern/sequencer.c
index 2caf2b7..6dbe441 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -89,6 +89,7 @@ static ImBuf *seq_render_strip(const SeqRenderData *context, 
Sequence *seq, floa
 static void seq_free_animdata(Scene *scene, Sequence *seq);
 static ImBuf *seq_render_mask(const SeqRenderData *context, Mask *mask, float 
nr, bool make_float);
 static size_t seq_num_files(Scene *scene, char views_format);
+static void seq_anim_add_suffix(Scene *scene, struct anim *anim, const size_t 
view_id);
 
 /*  XXX  */
 #define SELECT 1
@@ -855,6 +856,8 @@ void BKE_sequence_reload_new_file(Scene *scene, Sequence 
*seq, const bool lock_r
seq_multiview_name(scene, i, prefix, 
ext, str, FILE_MAX);
anim = openanim(str, IB_rect | 
((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0),
seq->streamindex, 
seq->strip->colorspace_settings.name);
+   seq_anim_add_suffix(scene, anim, i);
+
if (anim) {
sanim = 
MEM_mallocN(sizeof(StripAnim), "Strip Anim");
BLI_addtail(&seq->anims, sanim);
@@ -1358,6 +1361,7 @@ typedef struct SeqIndexBuildContext {
int tc_flags;
int size_flags;
int quality;
+   size_t view_id;
 
Main *bmain;
Scene *scene;
@@ -1453,14 +1457,15 @@ static void seq_open_anim_file(Scene *scene, Sequence 
*seq)
for (i = 0; i < totfiles; i++) {
const char *suffix = 
BKE_scene_view_id_suffix_get(&scene->r, i);
char str[FILE_MAX] = {'\0'};
-
StripAnim *sanim = MEM_mallocN(sizeof(StripAnim), 
"Strip Anim");
+
BLI_addtail(&seq->anims, sanim);
 
BLI_snprintf(str, sizeof(str), "%s%s%s", prefix, 
suffix, ext);
 
sanim->anim = openanim(str, IB_rect | ((seq->flag & 
SEQ_FILTERY) ? IB_animdeinterlace : 0),
   seq->streamindex, 
seq->strip->colorspace_settings.name);
+   seq_anim_add_suffix(scene, sanim->anim, i);
 
if (sanim->anim == NULL) {
sanim->anim = openanim(name, IB_rect | 
((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0),
@@ -1663,46 +

[Bf-blender-cvs] [2da034d] multiview: Merge remote-tracking branch 'origin/master' into multiview

2015-01-21 Thread Dalai Felinto
Commit: 2da034db2fa9695c6adc64e8d48147a0d0c53cbb
Author: Dalai Felinto
Date:   Wed Jan 21 16:28:49 2015 -0200
Branches: multiview
https://developer.blender.org/rB2da034db2fa9695c6adc64e8d48147a0d0c53cbb

Merge remote-tracking branch 'origin/master' into multiview

Conflicts:
intern/cycles/blender/addon/ui.py
source/blender/makesrna/intern/rna_space.c

===



===

diff --cc intern/cycles/blender/addon/ui.py
index 43fd309,da303ce..afdcc13
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@@ -1464,7 -1417,7 +1464,8 @@@ def get_panels()
  "DATA_PT_vertex_colors",
  "DATA_PT_camera",
  "DATA_PT_camera_display",
 +"DATA_PT_camera_stereoscopy",
+ "DATA_PT_camera_safe_areas",
  "DATA_PT_lens",
  "DATA_PT_speaker",
  "DATA_PT_distance",
diff --cc source/blender/blenloader/intern/versioning_270.c
index 807320e,c652f56..acd8edc
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -464,104 -457,75 +464,174 @@@ void blo_do_versions_270(FileData *fd, 
  
  #undef BRUSH_RAKE
  #undef BRUSH_RANDOM_ROTATION
 +
 +  /* MV before merge: add a MAIN_VERSION_ATLEAST check */
 +  {
 +  if (!DNA_struct_elem_find(fd->filesdna, "RenderData", 
"ListBase", "views")) {
 +  Scene *scene;
 +  SceneRenderView *srv;
 +  for (scene = main->scene.first; scene; scene = 
scene->id.next) {
 +  BKE_scene_add_render_view(scene, 
STEREO_LEFT_NAME);
 +  srv = (SceneRenderView *)scene->r.views.first;
 +  BLI_strncpy(srv->suffix, "_L", 
sizeof(srv->suffix));
 +
 +  BKE_scene_add_render_view(scene, 
STEREO_RIGHT_NAME);
 +  srv = (SceneRenderView *)scene->r.views.last;
 +  BLI_strncpy(srv->suffix, "_R", 
sizeof(srv->suffix));
 +  }
 +  }
 +
 +  if (!DNA_struct_elem_find(fd->filesdna, "View3D", "char", 
"stereo_camera")) {
 +  bScreen *screen;
 +  for (screen = main->screen.first; screen; screen = 
screen->id.next) {
 +  ScrArea *sa;
 +  for (sa = screen->areabase.first; sa; sa = 
sa->next) {
 +  SpaceLink *sl;
 +
 +  for (sl = sa->spacedata.first; sl; sl = 
sl->next) {
 +  switch (sl->spacetype) {
 +  case SPACE_VIEW3D:
 +  {
 +  View3D *v3d = 
(View3D *)sl;
 +  
v3d->stereo3d_camera = STEREO_3D_ID;
 +  
v3d->stereo3d_flag |= V3D_S3D_DISPPLANE;
 +  
v3d->stereo3d_convergence_alpha = 0.15f;
 +  
v3d->stereo3d_volume_alpha = 0.05f;
 +  break;
 +  }
 +  case SPACE_IMAGE:
 +  {
 +  SpaceImage 
*sima = (SpaceImage *) sl;
 +  
sima->iuser.flag |= IMA_SHOW_STEREO;
 +  
sima->iuser.passtype = SCE_PASS_COMBINED;
 +  break;
 +  }
 +  }
 +  }
 +  }
 +  }
 +  }
 +
 +  if (!DNA_struct_elem_find(fd->filesdna, "Camera", 
"CameraStereoSettings", "stereo")) {
 +  Camera *cam;
 +  for (cam = main->camera.first; cam; cam = cam->id.next) 
{
 +  cam->stereo.interocular_distance = 0.065;
 +  cam->stereo.convergence_distance = 30.f * 0.065;
 +  }
 +  }
 +
 +  if (!DNA_struct_elem_find(fd->filesdna, "Image", 
"Stereo3dFormat", "*stereo3d_format")) {
 +  Image *ima;
 +  for (ima = main->image.first; ima; ima = ima->id.next) {
 +  ima->ster

[Bf-blender-cvs] [fc9622a] multiview: Sequencer Proxy: Images - add the view suffix only when view_id > 0

2015-01-21 Thread Dalai Felinto
Commit: fc9622a16700fc40ab163ac3b862dc93eb3bd2a5
Author: Dalai Felinto
Date:   Wed Jan 21 16:16:03 2015 -0200
Branches: multiview
https://developer.blender.org/rBfc9622a16700fc40ab163ac3b862dc93eb3bd2a5

Sequencer Proxy: Images - add the view suffix only when view_id > 0

This way proxies created for monoscopic image strips created in previous 
Blenders work out of the box

===

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

===

diff --git a/source/blender/blenkernel/intern/sequencer.c 
b/source/blender/blenkernel/intern/sequencer.c
index f650a45..1a3bb36 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -1514,6 +1514,7 @@ static bool seq_proxy_get_fname(Sequence *seq, int cfra, 
int render_size, char *
 {
int frameno;
char dir[PROXY_MAXFILE];
+   char suffix[24] = {'\0'};
 
if (!seq->strip->proxy) {
return false;
@@ -1537,11 +1538,14 @@ static bool seq_proxy_get_fname(Sequence *seq, int 
cfra, int render_size, char *
return false;
}
 
+   if (view_id > 0)
+   BLI_snprintf(suffix, sizeof(suffix), "_%zu", view_id);
+
if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) {
BLI_join_dirfile(name, PROXY_MAXFILE,
 dir, seq->strip->proxy->file);
BLI_path_abs(name, G.main->name);
-   BLI_snprintf(name, PROXY_MAXFILE, "%s_%zu", name, view_id);
+   BLI_snprintf(name, PROXY_MAXFILE, "%s_%s", name, suffix);
 
return true;
}
@@ -1549,13 +1553,13 @@ static bool seq_proxy_get_fname(Sequence *seq, int 
cfra, int render_size, char *
/* generate a separate proxy directory for each preview size */
 
if (seq->type == SEQ_TYPE_IMAGE) {
-   BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy_%zu", 
dir, render_size,
-BKE_sequencer_give_stripelem(seq, cfra)->name, 
view_id);
+   BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy%s", 
dir, render_size,
+BKE_sequencer_give_stripelem(seq, cfra)->name, 
suffix);
frameno = 1;
}
else {
frameno = (int)give_stripelem_index(seq, cfra) + 
seq->anim_startofs;
-   BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/_%zu", 
dir, render_size, view_id);
+   BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/%s", 
dir, render_size, suffix);
}
 
BLI_path_abs(name, G.main->name);

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


[Bf-blender-cvs] [6ea7901] experimental-build: Merge remote-tracking branch 'origin/master' into experimental-build

2015-01-21 Thread Dalai Felinto
Commit: 6ea79012653128b8a072d37fa326b000a220a215
Author: Dalai Felinto
Date:   Wed Jan 21 16:39:14 2015 -0200
Branches: experimental-build
https://developer.blender.org/rB6ea79012653128b8a072d37fa326b000a220a215

Merge remote-tracking branch 'origin/master' into experimental-build

===



===



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


[Bf-blender-cvs] [e919486] experimental-build: Revert "Multiview: squashed"

2015-01-21 Thread Dalai Felinto
Commit: e919486082e4211b58f43b02031c9d091d3d
Author: Dalai Felinto
Date:   Wed Jan 21 16:40:37 2015 -0200
Branches: experimental-build
https://developer.blender.org/rBe919486082e4211b58f43b02031c9d091d3d

Revert "Multiview: squashed"

This reverts commit e12f4a0657c19c83094df02585b1725f75f2e07f.

===

M   intern/cycles/blender/addon/ui.py
M   intern/cycles/blender/blender_camera.cpp
M   intern/cycles/blender/blender_session.cpp
M   intern/cycles/blender/blender_session.h
M   release/scripts/startup/bl_ui/properties_data_camera.py
M   release/scripts/startup/bl_ui/properties_render.py
M   release/scripts/startup/bl_ui/properties_render_layer.py
M   release/scripts/startup/bl_ui/space_image.py
M   release/scripts/startup/bl_ui/space_info.py
M   release/scripts/startup/bl_ui/space_sequencer.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_camera.h
M   source/blender/blenkernel/BKE_image.h
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/BKE_scene.h
M   source/blender/blenkernel/BKE_sequencer.h
M   source/blender/blenkernel/BKE_writeavi.h
M   source/blender/blenkernel/BKE_writeffmpeg.h
M   source/blender/blenkernel/BKE_writeframeserver.h
M   source/blender/blenkernel/intern/bpath.c
M   source/blender/blenkernel/intern/camera.c
M   source/blender/blenkernel/intern/image.c
M   source/blender/blenkernel/intern/node.c
M   source/blender/blenkernel/intern/ocean.c
M   source/blender/blenkernel/intern/packedFile.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenkernel/intern/seqcache.c
M   source/blender/blenkernel/intern/sequencer.c
M   source/blender/blenkernel/intern/writeavi.c
M   source/blender/blenkernel/intern/writeffmpeg.c
M   source/blender/blenkernel/intern/writeframeserver.c
M   source/blender/blenlib/BLI_path_util.h
M   source/blender/blenlib/BLI_threads.h
M   source/blender/blenlib/intern/path_util.c
M   source/blender/blenlib/intern/threads.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/versioning_270.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/collada/ImageExporter.cpp
M   source/blender/compositor/CMakeLists.txt
M   source/blender/compositor/COM_compositor.h
M   source/blender/compositor/intern/COM_CompositorContext.h
M   source/blender/compositor/intern/COM_Converter.cpp
M   source/blender/compositor/intern/COM_ExecutionSystem.cpp
M   source/blender/compositor/intern/COM_ExecutionSystem.h
M   source/blender/compositor/intern/COM_Node.cpp
M   source/blender/compositor/intern/COM_compositor.cpp
M   source/blender/compositor/nodes/COM_CompositorNode.cpp
M   source/blender/compositor/nodes/COM_ImageNode.cpp
M   source/blender/compositor/nodes/COM_ImageNode.h
M   source/blender/compositor/nodes/COM_OutputFileNode.cpp
M   source/blender/compositor/nodes/COM_RenderLayersNode.cpp
M   source/blender/compositor/nodes/COM_SplitViewerNode.cpp
D   source/blender/compositor/nodes/COM_SwitchViewNode.cpp
D   source/blender/compositor/nodes/COM_SwitchViewNode.h
M   source/blender/compositor/nodes/COM_ViewerNode.cpp
M   source/blender/compositor/operations/COM_CompositorOperation.cpp
M   source/blender/compositor/operations/COM_CompositorOperation.h
M   source/blender/compositor/operations/COM_ImageOperation.cpp
M   source/blender/compositor/operations/COM_ImageOperation.h
M   source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
M   source/blender/compositor/operations/COM_MultilayerImageOperation.h
D   
source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
D   source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h
M   source/blender/compositor/operations/COM_OutputFileOperation.cpp
M   source/blender/compositor/operations/COM_OutputFileOperation.h
M   source/blender/compositor/operations/COM_RenderLayersProg.cpp
M   source/blender/compositor/operations/COM_RenderLayersProg.h
M   source/blender/compositor/operations/COM_ViewerOperation.cpp
M   source/blender/compositor/operations/COM_ViewerOperation.h
M   source/blender/editors/include/ED_view3d.h
M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/interface/interface_ops.c
M   source/blender/editors/object/object_bake_api.c
M   source/blender/editors/render/render_intern.h
M   source/blender/editors/render/render_internal.c
M   source/blender/editors/render/render_opengl.c
M   source/blender/editors/render/render_ops.c
M   source/blender/editors/render/render_preview.c
M   source/blender/editors/render/render

[Bf-blender-cvs] [e12f4a0] experimental-build: Multiview: squashed

2015-01-21 Thread Dalai Felinto
Commit: e12f4a0657c19c83094df02585b1725f75f2e07f
Author: Dalai Felinto
Date:   Wed Jan 21 16:40:31 2015 -0200
Branches: experimental-build
https://developer.blender.org/rBe12f4a0657c19c83094df02585b1725f75f2e07f

Multiview: squashed

===

M   intern/cycles/blender/addon/ui.py
M   intern/cycles/blender/blender_camera.cpp
M   intern/cycles/blender/blender_session.cpp
M   intern/cycles/blender/blender_session.h
M   release/scripts/startup/bl_ui/properties_data_camera.py
M   release/scripts/startup/bl_ui/properties_render.py
M   release/scripts/startup/bl_ui/properties_render_layer.py
M   release/scripts/startup/bl_ui/space_image.py
M   release/scripts/startup/bl_ui/space_info.py
M   release/scripts/startup/bl_ui/space_sequencer.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   release/scripts/startup/nodeitems_builtins.py
M   source/blender/blenkernel/BKE_camera.h
M   source/blender/blenkernel/BKE_image.h
M   source/blender/blenkernel/BKE_node.h
M   source/blender/blenkernel/BKE_scene.h
M   source/blender/blenkernel/BKE_sequencer.h
M   source/blender/blenkernel/BKE_writeavi.h
M   source/blender/blenkernel/BKE_writeffmpeg.h
M   source/blender/blenkernel/BKE_writeframeserver.h
M   source/blender/blenkernel/intern/bpath.c
M   source/blender/blenkernel/intern/camera.c
M   source/blender/blenkernel/intern/image.c
M   source/blender/blenkernel/intern/node.c
M   source/blender/blenkernel/intern/ocean.c
M   source/blender/blenkernel/intern/packedFile.c
M   source/blender/blenkernel/intern/scene.c
M   source/blender/blenkernel/intern/seqcache.c
M   source/blender/blenkernel/intern/sequencer.c
M   source/blender/blenkernel/intern/writeavi.c
M   source/blender/blenkernel/intern/writeffmpeg.c
M   source/blender/blenkernel/intern/writeframeserver.c
M   source/blender/blenlib/BLI_path_util.h
M   source/blender/blenlib/BLI_threads.h
M   source/blender/blenlib/intern/path_util.c
M   source/blender/blenlib/intern/threads.c
M   source/blender/blenloader/intern/readfile.c
M   source/blender/blenloader/intern/versioning_270.c
M   source/blender/blenloader/intern/writefile.c
M   source/blender/collada/ImageExporter.cpp
M   source/blender/compositor/CMakeLists.txt
M   source/blender/compositor/COM_compositor.h
M   source/blender/compositor/intern/COM_CompositorContext.h
M   source/blender/compositor/intern/COM_Converter.cpp
M   source/blender/compositor/intern/COM_ExecutionSystem.cpp
M   source/blender/compositor/intern/COM_ExecutionSystem.h
M   source/blender/compositor/intern/COM_Node.cpp
M   source/blender/compositor/intern/COM_compositor.cpp
M   source/blender/compositor/nodes/COM_CompositorNode.cpp
M   source/blender/compositor/nodes/COM_ImageNode.cpp
M   source/blender/compositor/nodes/COM_ImageNode.h
M   source/blender/compositor/nodes/COM_OutputFileNode.cpp
M   source/blender/compositor/nodes/COM_RenderLayersNode.cpp
M   source/blender/compositor/nodes/COM_SplitViewerNode.cpp
A   source/blender/compositor/nodes/COM_SwitchViewNode.cpp
A   source/blender/compositor/nodes/COM_SwitchViewNode.h
M   source/blender/compositor/nodes/COM_ViewerNode.cpp
M   source/blender/compositor/operations/COM_CompositorOperation.cpp
M   source/blender/compositor/operations/COM_CompositorOperation.h
M   source/blender/compositor/operations/COM_ImageOperation.cpp
M   source/blender/compositor/operations/COM_ImageOperation.h
M   source/blender/compositor/operations/COM_MultilayerImageOperation.cpp
M   source/blender/compositor/operations/COM_MultilayerImageOperation.h
A   
source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
A   source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h
M   source/blender/compositor/operations/COM_OutputFileOperation.cpp
M   source/blender/compositor/operations/COM_OutputFileOperation.h
M   source/blender/compositor/operations/COM_RenderLayersProg.cpp
M   source/blender/compositor/operations/COM_RenderLayersProg.h
M   source/blender/compositor/operations/COM_ViewerOperation.cpp
M   source/blender/compositor/operations/COM_ViewerOperation.h
M   source/blender/editors/include/ED_view3d.h
M   source/blender/editors/include/UI_interface.h
M   source/blender/editors/interface/interface_ops.c
M   source/blender/editors/object/object_bake_api.c
M   source/blender/editors/render/render_intern.h
M   source/blender/editors/render/render_internal.c
M   source/blender/editors/render/render_opengl.c
M   source/blender/editors/render/render_ops.c
M   source/blender/editors/render/render_preview.c
M   source/blender/editors/render/render_shading.c
M   source/blender/editors/screen/area.c
M   source/b

[Bf-blender-cvs] [cd72396] master: Cycles: Optimization for black world backgrounds

2015-01-21 Thread Thomas Dinges
Commit: cd723967970e3330d5461eaf8a062d6321de5d4f
Author: Thomas Dinges
Date:   Wed Jan 21 20:06:53 2015 +0100
Branches: master
https://developer.blender.org/rBcd723967970e3330d5461eaf8a062d6321de5d4f

Cycles: Optimization for black world backgrounds

* If a Background node is set to a black color or zero strength,
it now gets removed from the shader graph.

* In case the graph is empty (no background node), the kernel will skip
evaluating it and save some rendertime. This can help quite a bit in scenes,
where the majority of the image consists of a black background.

Example: http://www.pasteall.org/pic/show.php?id=82650
In this case the render is ~16% faster.

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

===

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

===

diff --git a/intern/cycles/render/background.cpp 
b/intern/cycles/render/background.cpp
index d731b33..f5e51f2 100644
--- a/intern/cycles/render/background.cpp
+++ b/intern/cycles/render/background.cpp
@@ -72,16 +72,23 @@ void Background::device_update(Device *device, DeviceScene 
*dscene, Scene *scene
else
kbackground->volume_shader = SHADER_NONE;
 
-   if(!(visibility & PATH_RAY_DIFFUSE))
-   kbackground->surface_shader |= SHADER_EXCLUDE_DIFFUSE;
-   if(!(visibility & PATH_RAY_GLOSSY))
-   kbackground->surface_shader |= SHADER_EXCLUDE_GLOSSY;
-   if(!(visibility & PATH_RAY_TRANSMIT))
-   kbackground->surface_shader |= SHADER_EXCLUDE_TRANSMIT;
-   if(!(visibility & PATH_RAY_VOLUME_SCATTER))
-   kbackground->surface_shader |= SHADER_EXCLUDE_SCATTER;
-   if(!(visibility & PATH_RAY_CAMERA))
-   kbackground->surface_shader |= SHADER_EXCLUDE_CAMERA;
+   /* No background node, make world shader invisible to all rays, to skip 
evaluation in kernel. */
+   if(scene->shaders[shader]->graph->nodes.size() <= 1) {
+   kbackground->surface_shader |= SHADER_EXCLUDE_ANY;
+   }
+   /* Background present, check visibilities */
+   else {
+   if(!(visibility & PATH_RAY_DIFFUSE))
+   kbackground->surface_shader |= SHADER_EXCLUDE_DIFFUSE;
+   if(!(visibility & PATH_RAY_GLOSSY))
+   kbackground->surface_shader |= SHADER_EXCLUDE_GLOSSY;
+   if(!(visibility & PATH_RAY_TRANSMIT))
+   kbackground->surface_shader |= SHADER_EXCLUDE_TRANSMIT;
+   if(!(visibility & PATH_RAY_VOLUME_SCATTER))
+   kbackground->surface_shader |= SHADER_EXCLUDE_SCATTER;
+   if(!(visibility & PATH_RAY_CAMERA))
+   kbackground->surface_shader |= SHADER_EXCLUDE_CAMERA;
+   }
 
need_update = false;
 }
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 8f8a693..84fe55b 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -374,6 +374,28 @@ void ShaderGraph::remove_unneeded_nodes()
removed[proxy->id] = true;
any_node_removed = true;
}
+   else if(node->special_type == SHADER_SPECIAL_TYPE_BACKGROUND) {
+   BackgroundNode *bg = static_cast(node);
+
+   if(bg->outputs[0]->links.size()) {
+   /* Black color or zero strength, remove node */
+   if((!bg->inputs[0]->link && 
bg->inputs[0]->value == make_float3(0.0f, 0.0f, 0.0f)) ||
+  (!bg->inputs[1]->link && 
bg->inputs[1]->value.x == 0.0f)) {
+   vector inputs = 
bg->outputs[0]->links;
+
+   foreach(ShaderInput *sock, bg->inputs) {
+   if(sock->link)
+   disconnect(sock);
+   }
+
+   foreach(ShaderInput *input, inputs)
+   disconnect(input);
+
+   removed[bg->id] = true;
+   any_node_removed = true;
+   }
+   }
+   }
else if(node->special_type == SHADER_SPECIAL_TYPE_MIX_CLOSURE) {
MixClosureNode *mix = 
static_cast(node);
 
diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h
index 9130f7f..f9ac167 100644
--- a/intern/cycles/render/graph.h
+++ b/intern/cycles/render/graph.h
@@ -79,7 +79,8 @@ enum ShaderNodeSpecialType {
SHADER_SPECIAL_TYPE_MIX_RGB, /* Only Mix subtype */

[Bf-blender-cvs] [12ccac6] master: Cycles: Support sphere mapping for the image texture

2015-01-21 Thread Sergey Sharybin
Commit: 12ccac657f173ca74716e67cc80830c1142f8b22
Author: Sergey Sharybin
Date:   Wed Jan 21 22:44:30 2015 +0500
Branches: master
https://developer.blender.org/rB12ccac657f173ca74716e67cc80830c1142f8b22

Cycles: Support sphere mapping for the image texture

===

M   intern/cycles/kernel/shaders/node_image_texture.osl
M   intern/cycles/kernel/svm/svm_image.h
M   intern/cycles/kernel/svm/svm_types.h
M   intern/cycles/render/nodes.cpp
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/makesrna/intern/rna_nodetree.c

===

diff --git a/intern/cycles/kernel/shaders/node_image_texture.osl 
b/intern/cycles/kernel/shaders/node_image_texture.osl
index a55640a..c63ad17 100644
--- a/intern/cycles/kernel/shaders/node_image_texture.osl
+++ b/intern/cycles/kernel/shaders/node_image_texture.osl
@@ -17,6 +17,25 @@
 #include "stdosl.h"
 #include "node_color.h"
 
+point map_to_sphere(vector dir)
+{
+   float len = length(dir);
+   float v, u;
+   if(len > 0.0) {
+   if(dir[0] == 0.0 && dir[1] == 0.0) {
+   u = 0.0;  /* othwise domain error */
+   }
+   else {
+   u = (1.0 - atan2(dir[0], dir[1]) / M_PI) / 2.0;
+   }
+   v = 1.0 - acos(dir[2] / len) / M_PI;
+   }
+   else {
+   v = u = 0.0; /* to avoid un-initialized variables */
+   }
+   return point(u, v, 0.0);
+}
+
 color image_texture_lookup(string filename, string color_space, float u, float 
v, output float Alpha, int use_alpha, int is_float, string interpolation)
 {
color rgb = (color)texture(filename, u, 1.0 - v, "wrap", "periodic", 
"interp", interpolation, "alpha", Alpha);
@@ -136,5 +155,10 @@ shader node_image_texture(
Alpha += weight[2] * tmp_alpha;
}
}
+   else if (projection == "Sphere") {
+   point projected = map_to_sphere((p - vector(0.5, 0.5, 0.5)) * 
2.0);
+   Color = image_texture_lookup(filename, color_space,
+projected[0], projected[1],
+Alpha, use_alpha, is_float, 
interpolation);
+   }
 }
-
diff --git a/intern/cycles/kernel/svm/svm_image.h 
b/intern/cycles/kernel/svm/svm_image.h
index 9948a19..44d15e1 100644
--- a/intern/cycles/kernel/svm/svm_image.h
+++ b/intern/cycles/kernel/svm/svm_image.h
@@ -363,6 +363,10 @@ ccl_device void svm_node_tex_image(KernelGlobals *kg, 
ShaderData *sd, float *sta
 
float3 co = stack_load_float3(stack, co_offset);
uint use_alpha = stack_valid(alpha_offset);
+   if(node.w == NODE_IMAGE_PROJ_SPHERE) {
+   co = (co - make_float3(0.5f, 0.5f, 0.5f)) * 2.0f;
+   map_to_sphere(&co.x, &co.y, co.x, co.y, co.z);
+   }
float4 f = svm_image_texture(kg, id, co.x, co.y, srgb, use_alpha);
 
if(stack_valid(out_offset))
@@ -463,7 +467,6 @@ ccl_device void svm_node_tex_image_box(KernelGlobals *kg, 
ShaderData *sd, float
stack_store_float(stack, alpha_offset, f.w);
 }
 
-
 ccl_device void svm_node_tex_environment(KernelGlobals *kg, ShaderData *sd, 
float *stack, uint4 node)
 {
uint id = node.y;
diff --git a/intern/cycles/kernel/svm/svm_types.h 
b/intern/cycles/kernel/svm/svm_types.h
index b1439aa..d5c3ceb 100644
--- a/intern/cycles/kernel/svm/svm_types.h
+++ b/intern/cycles/kernel/svm/svm_types.h
@@ -334,6 +334,12 @@ typedef enum NodeNormalMapSpace {
NODE_NORMAL_MAP_BLENDER_WORLD,
 } NodeNormalMapSpace;
 
+typedef enum NodeImageProjection {
+   NODE_IMAGE_PROJ_FLAT   = 0,
+   NODE_IMAGE_PROJ_BOX= 1,
+   NODE_IMAGE_PROJ_SPHERE = 2,
+} NodeImageProjection;
+
 typedef enum ShaderType {
SHADER_TYPE_SURFACE,
SHADER_TYPE_VOLUME,
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 653bd5d..05ead55 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -174,8 +174,9 @@ static ShaderEnum image_projection_init()
 {
ShaderEnum enm;
 
-   enm.insert("Flat", 0);
-   enm.insert("Box", 1);
+   enm.insert("Flat", NODE_IMAGE_PROJ_FLAT);
+   enm.insert("Box", NODE_IMAGE_PROJ_BOX);
+   enm.insert("Sphere", NODE_IMAGE_PROJ_SPHERE);
 
return enm;
 }
@@ -266,14 +267,15 @@ void ImageTextureNode::compile(SVMCompiler& compiler)
tex_mapping.compile(compiler, vector_in->stack_offset, 
vector_offset);
}
 
-   if(projection == "Flat") {
+   if(projection != "Box") {
compiler.add_node(NODE_TEX_IMAGE,
slot,
compiler.encode_uchar4(
vector_offset,
color_o

[Bf-blender-cvs] [47618d0] gooseberry: Merge branch 'master' into gooseberry

2015-01-21 Thread Sergey Sharybin
Commit: 47618d0393d9b96d3da3900f6f22b39ade3d9b24
Author: Sergey Sharybin
Date:   Thu Jan 22 00:53:29 2015 +0500
Branches: gooseberry
https://developer.blender.org/rB47618d0393d9b96d3da3900f6f22b39ade3d9b24

Merge branch 'master' into gooseberry

===



===



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


[Bf-blender-cvs] [dda3554] master: Cycles: Support tube projection for images

2015-01-21 Thread Sergey Sharybin
Commit: dda355442dc7ba4f83f65cb792be3f27be8c9fee
Author: Sergey Sharybin
Date:   Thu Jan 22 00:37:09 2015 +0500
Branches: master
https://developer.blender.org/rBdda355442dc7ba4f83f65cb792be3f27be8c9fee

Cycles: Support tube projection for images

This way Cycles finally becomes feature-full on image projections
compared to Blender Internal and Gooseberry Project Team could
finally finish the movie.

===

M   intern/cycles/kernel/shaders/node_image_texture.osl
M   intern/cycles/kernel/svm/svm_image.h
M   intern/cycles/kernel/svm/svm_types.h
M   intern/cycles/render/nodes.cpp
M   intern/cycles/util/util_math.h
M   source/blender/makesdna/DNA_node_types.h
M   source/blender/makesrna/intern/rna_nodetree.c

===

diff --git a/intern/cycles/kernel/shaders/node_image_texture.osl 
b/intern/cycles/kernel/shaders/node_image_texture.osl
index c63ad17..526a875 100644
--- a/intern/cycles/kernel/shaders/node_image_texture.osl
+++ b/intern/cycles/kernel/shaders/node_image_texture.osl
@@ -17,13 +17,32 @@
 #include "stdosl.h"
 #include "node_color.h"
 
+point texco_remap_square(point co)
+{
+   return (co - point(0.5, 0.5, 0.5)) * 2.0;
+}
+
+point map_to_tube(vector dir)
+{
+   float u, v;
+   v = (dir[2] + 1.0) * 0.5;
+   float len = sqrt(dir[0]*dir[0] + dir[1]*dir[1]);
+   if (len > 0.0) {
+   u = (1.0 - (atan2(dir[0] / len, dir[1] / len) / M_PI)) * 0.5;
+   }
+   else {
+   v = u = 0.0; /* To avoid un-initialized variables. */
+   }
+   return point(u, v, 0.0);
+}
+
 point map_to_sphere(vector dir)
 {
float len = length(dir);
float v, u;
if(len > 0.0) {
if(dir[0] == 0.0 && dir[1] == 0.0) {
-   u = 0.0;  /* othwise domain error */
+   u = 0.0;  /* Othwise domain error. */
}
else {
u = (1.0 - atan2(dir[0], dir[1]) / M_PI) / 2.0;
@@ -31,7 +50,7 @@ point map_to_sphere(vector dir)
v = 1.0 - acos(dir[2] / len) / M_PI;
}
else {
-   v = u = 0.0; /* to avoid un-initialized variables */
+   v = u = 0.0;  /* To avoid un-initialized variables. */
}
return point(u, v, 0.0);
 }
@@ -156,7 +175,13 @@ shader node_image_texture(
}
}
else if (projection == "Sphere") {
-   point projected = map_to_sphere((p - vector(0.5, 0.5, 0.5)) * 
2.0);
+   point projected = map_to_sphere(texco_remap_square(p));
+   Color = image_texture_lookup(filename, color_space,
+projected[0], projected[1],
+Alpha, use_alpha, is_float, 
interpolation);
+   }
+   else if (projection == "Tube") {
+   point projected = map_to_tube(texco_remap_square(p));
Color = image_texture_lookup(filename, color_space,
 projected[0], projected[1],
 Alpha, use_alpha, is_float, 
interpolation);
diff --git a/intern/cycles/kernel/svm/svm_image.h 
b/intern/cycles/kernel/svm/svm_image.h
index 44d15e1..e667fc2 100644
--- a/intern/cycles/kernel/svm/svm_image.h
+++ b/intern/cycles/kernel/svm/svm_image.h
@@ -354,6 +354,12 @@ ccl_device float4 svm_image_texture(KernelGlobals *kg, int 
id, float x, float y,
 
 #endif
 
+/* Remap coordnate from 0..1 box to -1..-1 */
+ccl_device_inline float3 texco_remap_square(float3 co)
+{
+   return (co - make_float3(0.5f, 0.5f, 0.5f)) * 2.0f;
+}
+
 ccl_device void svm_node_tex_image(KernelGlobals *kg, ShaderData *sd, float 
*stack, uint4 node)
 {
uint id = node.y;
@@ -364,9 +370,13 @@ ccl_device void svm_node_tex_image(KernelGlobals *kg, 
ShaderData *sd, float *sta
float3 co = stack_load_float3(stack, co_offset);
uint use_alpha = stack_valid(alpha_offset);
if(node.w == NODE_IMAGE_PROJ_SPHERE) {
-   co = (co - make_float3(0.5f, 0.5f, 0.5f)) * 2.0f;
+   co = texco_remap_square(co);
map_to_sphere(&co.x, &co.y, co.x, co.y, co.z);
}
+   else if(node.w == NODE_IMAGE_PROJ_TUBE) {
+   co = texco_remap_square(co);
+   map_to_tube(&co.x, &co.y, co.x, co.y, co.z);
+   }
float4 f = svm_image_texture(kg, id, co.x, co.y, srgb, use_alpha);
 
if(stack_valid(out_offset))
diff --git a/intern/cycles/kernel/svm/svm_types.h 
b/intern/cycles/kernel/svm/svm_types.h
index d5c3ceb..a8d0da6 100644
--- a/intern/cycles/kernel/svm/svm_types.h
+++ b/intern/cycles/kernel/svm/svm_types.h
@@ -338,6 +338,7 @@ typedef enum NodeImageProjection {
NODE_IMAGE_PROJ_FLAT   = 0,
NODE_IMAGE_PROJ_BOX= 1,
NODE_IMAGE_PROJ_SPHERE = 2,
+   NODE_IMAGE_PRO

[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61478] trunk/lib/tests/cycles/ ctests: Add data files needed for cycles ctests

2015-01-21 Thread Sergey Sharybin
Revision: 61478
  https://developer.blender.org/rBL61478
Author:   sergey
Date: 2015-01-21 20:36:11 + (Wed, 21 Jan 2015)
Log Message:
---
Add data files needed for cycles ctests

The idea is to have whole bunch of really small and fast to render
files which would help preliminary tests of like all the major cases
in Cycles.

Files in this set are to be preserved as small ad as fast as possible
because they're gonna to be be hooked up to blender's ctest system
and run on every `make test` invokation.

Added Paths:
---
trunk/lib/tests/cycles/ctests/
trunk/lib/tests/cycles/ctests/readme.txt
trunk/lib/tests/cycles/ctests/render_all.py
trunk/lib/tests/cycles/ctests/shader/
trunk/lib/tests/cycles/ctests/shader/ambient_occlusion.blend
trunk/lib/tests/cycles/ctests/shader/anisotropic_ashikhmin.blend
trunk/lib/tests/cycles/ctests/shader/anisotropic_ashikhmin_rough.blend
trunk/lib/tests/cycles/ctests/shader/anisotropic_beckmann.blend
trunk/lib/tests/cycles/ctests/shader/anisotropic_beckmann_rough.blend
trunk/lib/tests/cycles/ctests/shader/anisotropic_ggx.blend
trunk/lib/tests/cycles/ctests/shader/anisotropic_ggx_rough.blend
trunk/lib/tests/cycles/ctests/shader/diffuse.blend
trunk/lib/tests/cycles/ctests/shader/emission.blend
trunk/lib/tests/cycles/ctests/shader/glass_beckmann.blend
trunk/lib/tests/cycles/ctests/shader/glass_beckmann_rough.blend
trunk/lib/tests/cycles/ctests/shader/glass_ggx.blend
trunk/lib/tests/cycles/ctests/shader/glass_ggx_rough.blend
trunk/lib/tests/cycles/ctests/shader/glass_sharp.blend
trunk/lib/tests/cycles/ctests/shader/glossy_ashikhmin.blend
trunk/lib/tests/cycles/ctests/shader/glossy_ashikhmin_rough.blend
trunk/lib/tests/cycles/ctests/shader/glossy_beckmann.blend
trunk/lib/tests/cycles/ctests/shader/glossy_beckmann_rough.blend
trunk/lib/tests/cycles/ctests/shader/glossy_ggx.blend
trunk/lib/tests/cycles/ctests/shader/glossy_ggx_rough.blend
trunk/lib/tests/cycles/ctests/shader/glossy_sharp.blend
trunk/lib/tests/cycles/ctests/shader/hair_reflection.blend
trunk/lib/tests/cycles/ctests/shader/hair_transmission.blend
trunk/lib/tests/cycles/ctests/shader/holdout.blend
trunk/lib/tests/cycles/ctests/shader/reference_renders/
trunk/lib/tests/cycles/ctests/shader/reference_renders/ambient_occlusion.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/anisotropic_ashikhmin.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/anisotropic_ashikhmin_rough.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/anisotropic_beckmann.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/anisotropic_beckmann_rough.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/anisotropic_ggx.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/anisotropic_ggx_rough.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/diffuse.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/emission.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/glass_beckmann.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/glass_beckmann_rough.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/glass_ggx.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/glass_ggx_rough.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/glass_sharp.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/glossy_ashikhmin.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/glossy_ashikhmin_rough.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/glossy_beckmann.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/glossy_beckmann_rough.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/glossy_ggx.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/glossy_ggx_rough.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/glossy_sharp.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/hair_reflection.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/hair_transmission.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/holdout.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/refraction_beckmann.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/refraction_beckmann_rough.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/refraction_ggx.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/refraction_ggx_rough.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/refraction_sharp.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/subsurface_cubic.png

trunk/lib/tests/cycles/ctests/shader/reference_renders/subsurface_gaussian.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/toon_diffuse.png
trunk/lib/tests/cycles/ctests/shader/reference_renders/toon_glossy.png
trunk/lib/tests/cy

[Bf-blender-cvs] [18627a3] cycles_ctests: Tests: Add render tests for Cycles

2015-01-21 Thread Sergey Sharybin
Commit: 18627a337793f8d57fa6561afecf3abc9bc38159
Author: Sergey Sharybin
Date:   Tue Jan 20 23:00:51 2015 +0500
Branches: cycles_ctests
https://developer.blender.org/rB18627a337793f8d57fa6561afecf3abc9bc38159

Tests: Add render tests for Cycles

The idea is to use the set of really small images from the lib folder
and run Cycles render on them comparing render output to reference
images in the tests repository.

For sure same thing could become more generic for BI or Freestyle
render engines.

This is not totally easy to use at this moment, basically because of
a bit of voodoo mango jambo black magic happening around how we are
dealing with addons for ctests. Main issue is that blender loads all
the scripts from the source directory, meaning it can't pick cycles
up.

Once this is figured out in a clean fashion the branch will be merged
to master. For until then all the tweaks are gonna to be done here.

For now it's possible to set BLENDER_USER_SCRIPTS to the directory
with Cycles addon so it is picked up nicely.

Reviewers: campbellbarton

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

===

M   tests/python/CMakeLists.txt
A   tests/python/cycles_render_tests.py

===

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index 85c6869..e0b0b1b 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -358,3 +358,11 @@ add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
--md5_source=${TEST_OUT_DIR}/export_fbx_all_objects.fbx
--md5=b35eb2a9d0e73762ecae2278c25a38ac --md5_method=FILE
 )
+
+if(WITH_CYCLES)
+   add_test(cycles_shaders_test
+   ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
+   ${TEST_BLENDER_EXE}
+   ${TEST_SRC_DIR}/cycles/ctests/shader
+   )
+endif()
diff --git a/tests/python/cycles_render_tests.py 
b/tests/python/cycles_render_tests.py
new file mode 100755
index 000..cc887e0
--- /dev/null
+++ b/tests/python/cycles_render_tests.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python3
+
+import os
+import tempfile
+import subprocess
+import sys
+
+BLENDER = sys.argv[1:-1]
+ROOT = sys.argv[-1]
+
+TEMP = tempfile.mkdtemp()
+TEMP_FILE_MASK = os.path.join(TEMP, "test")
+TEMP_FILE = TEMP_FILE_MASK + '0001.png'
+
+
+def render_file(filepath):
+command = BLENDER + [
+   '-b',
+   filepath,
+   '-o',
+   TEMP_FILE_MASK,
+   '-f', '1',
+   ]
+try:
+subprocess.check_output(command)
+return os.path.exists(TEMP_FILE)
+except:
+if os.path.exists(TEMP_FILE):
+os.remove(TEMP_FILE)
+return False
+
+
+def test_get_name(filepath):
+filename = os.path.basename(filepath)
+return os.path.splitext(filename)[0]
+
+
+def verify_output(filepath):
+testname = test_get_name(filepath)
+dirpath = os.path.dirname(filepath)
+reference_dirpath = os.path.join(dirpath, 'reference_renders')
+reference_image = os.path.join(reference_dirpath, testname + '.png')
+if not os.path.exists(reference_image):
+return False
+command = ['idiff',
+   '-fail', '0.01',
+   '-failpercent', '1',
+   reference_image,
+   TEMP_FILE,
+  ]
+try:
+subprocess.check_output(command)
+return True
+except subprocess.CalledProcessError as grepexc:
+return grepexc.returncode == 1
+
+
+def run_test(filepath):
+testname = test_get_name(filepath)
+spacer = "." * (32 - len(testname))
+print(testname, spacer, end='')
+sys.stdout.flush()
+if render_file(filepath):
+ok = verify_output(filepath)
+os.remove(TEMP_FILE)
+print("PASS" if ok else "FAIL (VERIFY)")
+return ok
+else:
+print("FAIL (RENDER)")
+return False
+
+def blend_list(path):
+for dirpath, dirnames, filenames in os.walk(path):
+for filename in filenames:
+if filename.lower().endswith(".blend"):
+filepath = os.path.join(dirpath, filename)
+yield filepath
+
+
+def run_all_tests(dirpath):
+failed_tests = []
+all_files = list(blend_list(dirpath))
+all_files.sort()
+for filepath in all_files:
+if not run_test(filepath):
+testname = test_get_name(filepath)
+failed_tests.append(testname)
+if failed_tests:
+failed_tests.sort()
+print("\n\nFAILED tests:")
+for test in failed_tests:
+print("" + test)
+return False
+return True
+
+ok = run_all_tests(ROOT)
+
+# Cleanup temp files and folders
+if os.path.exists(TEMP_FILE):
+os.remove(TEMP_FILE)
+os.rmdir(TEMP)
+
+sys.exit(0 if ok else 1)

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

[Bf-blender-cvs] [d307917] cycles_ctests: Cycles ctests: Run blender without system script override

2015-01-21 Thread Sergey Sharybin
Commit: d307917bede2a665b2aeb696bc7e87ed3ecaca54
Author: Sergey Sharybin
Date:   Thu Jan 22 03:30:58 2015 +0500
Branches: cycles_ctests
https://developer.blender.org/rBd307917bede2a665b2aeb696bc7e87ed3ecaca54

Cycles ctests: Run blender without system script override

The idea is to force using Cycles tests only after running install target.
More i'm thinking about ways to not require this more it's clear there is
no clear way to support this. It is possible to hack something around and
make tests to be running smoothly, but it's never gonna to give all the
features (like GPU which required source file on linux and compiled cubin
on windows, OSL which requires compiled script) without any manual tweaks
anyway.

So let's be damn stupid and not try to be smart and just assume install
target was run which makes Cycles tests just happy without any extra
setup. Would be nice to detect and report missing target install so we
don't spend time on rendering Cycles scenes with Blender Internal.

===

M   tests/python/CMakeLists.txt
M   tests/python/cycles_render_tests.py

===

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index e0b0b1b..f4dc1a2 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -48,6 +48,7 @@ else()
 endif()
 
 # for testing with valgrind prefix: valgrind --track-origins=yes 
--error-limit=no 
+set(TEST_BLENDER_EXE_BARE ${TEST_BLENDER_EXE})
 set(TEST_BLENDER_EXE ${TEST_BLENDER_EXE} --background -noaudio 
--factory-startup --env-system-scripts ${CMAKE_SOURCE_DIR}/release/scripts)
 
 
@@ -362,7 +363,7 @@ add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
 if(WITH_CYCLES)
add_test(cycles_shaders_test
${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
-   ${TEST_BLENDER_EXE}
-   ${TEST_SRC_DIR}/cycles/ctests/shader
+   -blender "${TEST_BLENDER_EXE_BARE}"
+   -testdir "${TEST_SRC_DIR}/cycles/ctests/shader"
)
 endif()
diff --git a/tests/python/cycles_render_tests.py 
b/tests/python/cycles_render_tests.py
index cc887e0..6b49225 100755
--- a/tests/python/cycles_render_tests.py
+++ b/tests/python/cycles_render_tests.py
@@ -1,12 +1,18 @@
 #!/usr/bin/env python3
 
+import argparse
 import os
-import tempfile
 import subprocess
 import sys
+import tempfile
 
-BLENDER = sys.argv[1:-1]
-ROOT = sys.argv[-1]
+parser = argparse.ArgumentParser()
+parser.add_argument('-blender', nargs='+')
+parser.add_argument('-testdir', nargs=1)
+args = parser.parse_args()
+
+BLENDER = args.blender[0]
+ROOT = args.testdir[0]
 
 TEMP = tempfile.mkdtemp()
 TEMP_FILE_MASK = os.path.join(TEMP, "test")
@@ -14,8 +20,10 @@ TEMP_FILE = TEMP_FILE_MASK + '0001.png'
 
 
 def render_file(filepath):
-command = BLENDER + [
-   '-b',
+command = [BLENDER,
+   '--background',
+   '-noaudio',
+   '--factory-startup',
filepath,
'-o',
TEMP_FILE_MASK,
@@ -69,6 +77,7 @@ def run_test(filepath):
 print("FAIL (RENDER)")
 return False
 
+
 def blend_list(path):
 for dirpath, dirnames, filenames in os.walk(path):
 for filename in filenames:

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


[Bf-blender-cvs] [71ba2b7] cycles_ctests: Cycles ctests: Add runtime check for Cycles

2015-01-21 Thread Sergey Sharybin
Commit: 71ba2b7c97108af3906ae0841448727cdafa9690
Author: Sergey Sharybin
Date:   Thu Jan 22 03:56:51 2015 +0500
Branches: cycles_ctests
https://developer.blender.org/rB71ba2b7c97108af3906ae0841448727cdafa9690

Cycles ctests: Add runtime check for Cycles

The idea is to check scene's render engine and if it's not Cycles
report about this and stop running tests (because it's not likely
Cycles will be loaded correctly).

This way we'll fail Cycles tests real quick without install target
and give quite nice error message about that.

===

M   tests/python/CMakeLists.txt
A   tests/python/cycles/render_tests.py
A   tests/python/cycles/runtime_check.py
D   tests/python/cycles_render_tests.py

===

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index f4dc1a2..242972e 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -362,7 +362,7 @@ add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
 
 if(WITH_CYCLES)
add_test(cycles_shaders_test
-   ${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
+   ${CMAKE_CURRENT_LIST_DIR}/cycles/render_tests.py
-blender "${TEST_BLENDER_EXE_BARE}"
-testdir "${TEST_SRC_DIR}/cycles/ctests/shader"
)
diff --git a/tests/python/cycles_render_tests.py 
b/tests/python/cycles/render_tests.py
similarity index 76%
rename from tests/python/cycles_render_tests.py
rename to tests/python/cycles/render_tests.py
index 6b49225..68a35f7 100755
--- a/tests/python/cycles_render_tests.py
+++ b/tests/python/cycles/render_tests.py
@@ -18,6 +18,8 @@ TEMP = tempfile.mkdtemp()
 TEMP_FILE_MASK = os.path.join(TEMP, "test")
 TEMP_FILE = TEMP_FILE_MASK + '0001.png'
 
+TEST_SCRIPT = os.path.join(os.path.dirname(__file__), 'runtime_check.py')
+
 
 def render_file(filepath):
 command = [BLENDER,
@@ -25,17 +27,19 @@ def render_file(filepath):
'-noaudio',
'--factory-startup',
filepath,
-   '-o',
-   TEMP_FILE_MASK,
+   '--python', TEST_SCRIPT,
+   '-o', TEMP_FILE_MASK,
'-f', '1',
]
 try:
 subprocess.check_output(command)
-return os.path.exists(TEMP_FILE)
+return None if os.path.exists(TEMP_FILE) else "NOT_FOUND"
+except subprocess.CalledProcessError as grepexc:
+return "NO_CYCLES" if grepexc.returncode == 128 else "CRASH"
 except:
 if os.path.exists(TEMP_FILE):
 os.remove(TEMP_FILE)
-return False
+return "CRASH"
 
 
 def test_get_name(filepath):
@@ -68,14 +72,15 @@ def run_test(filepath):
 spacer = "." * (32 - len(testname))
 print(testname, spacer, end='')
 sys.stdout.flush()
-if render_file(filepath):
-ok = verify_output(filepath)
-os.remove(TEMP_FILE)
-print("PASS" if ok else "FAIL (VERIFY)")
-return ok
-else:
-print("FAIL (RENDER)")
-return False
+error = render_file(filepath)
+if not error:
+if verify_output(filepath):
+print('PAS')
+else:
+error = 'VERIFY'
+if error:
+print("FAIL", error)
+return error
 
 
 def blend_list(path):
@@ -91,7 +96,11 @@ def run_all_tests(dirpath):
 all_files = list(blend_list(dirpath))
 all_files.sort()
 for filepath in all_files:
-if not run_test(filepath):
+error = run_test(filepath)
+if error:
+if error == 'NO_CYCLES':
+print('Can not perform tests because Cycles can''t be loaed')
+return False
 testname = test_get_name(filepath)
 failed_tests.append(testname)
 if failed_tests:
diff --git a/tests/python/cycles/runtime_check.py 
b/tests/python/cycles/runtime_check.py
new file mode 100644
index 000..960082c
--- /dev/null
+++ b/tests/python/cycles/runtime_check.py
@@ -0,0 +1,6 @@
+import bpy
+import sys
+
+scene = bpy.data.scenes[0]
+if scene.render.engine != 'CYCLES':
+sys.exit(128)

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


[Bf-blender-cvs] [5dbee81] cycles_ctests: Cycles ctests: Automatically find idiff application

2015-01-21 Thread Sergey Sharybin
Commit: 5dbee81d591286da5a567cd2087a06f663e7d27d
Author: Sergey Sharybin
Date:   Thu Jan 22 04:03:01 2015 +0500
Branches: cycles_ctests
https://developer.blender.org/rB5dbee81d591286da5a567cd2087a06f663e7d27d

Cycles ctests: Automatically find idiff application

===

M   build_files/cmake/Modules/FindOpenImageIO.cmake
M   tests/python/CMakeLists.txt
M   tests/python/cycles/render_tests.py

===

diff --git a/build_files/cmake/Modules/FindOpenImageIO.cmake 
b/build_files/cmake/Modules/FindOpenImageIO.cmake
index f8d6612..6b82c9d 100644
--- a/build_files/cmake/Modules/FindOpenImageIO.cmake
+++ b/build_files/cmake/Modules/FindOpenImageIO.cmake
@@ -8,6 +8,7 @@
 #This can also be an environment variable.
 #  OPENIMAGEIO_FOUND, If false, do not try to use OpenImageIO.
 #  OPENIMAGEIO_PUGIXML_FOUND, Indicates whether OIIO has biltin PuguXML parser.
+#  OPENIMAGEIO_IDIFF, full path to idiff application if found.
 #
 # also defined, but not for general use are
 #  OPENIMAGEIO_LIBRARY, where to find the OpenImageIO library.
@@ -55,6 +56,14 @@ FIND_LIBRARY(OPENIMAGEIO_LIBRARY
 lib64 lib
   )
 
+FIND_FILE(OPENIMAGEIO_IDIFF
+  NAMES
+idiff
+  ${OPENIMAGEIO_ROOT_DIR}
+  PATH_SUFFIXES
+bin
+)
+
 # handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE 
if 
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index 242972e..46ea1d6 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -361,9 +361,12 @@ add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
 )
 
 if(WITH_CYCLES)
-   add_test(cycles_shaders_test
-   ${CMAKE_CURRENT_LIST_DIR}/cycles/render_tests.py
-   -blender "${TEST_BLENDER_EXE_BARE}"
-   -testdir "${TEST_SRC_DIR}/cycles/ctests/shader"
-   )
+   if(OPENIMAGEIO_IDIFF)
+   add_test(cycles_shaders_test
+   ${CMAKE_CURRENT_LIST_DIR}/cycles/render_tests.py
+   -blender "${TEST_BLENDER_EXE_BARE}"
+   -testdir "${TEST_SRC_DIR}/cycles/ctests/shader"
+   -idiff "${OPENIMAGEIO_IDIFF}"
+   )
+   endif()
 endif()
diff --git a/tests/python/cycles/render_tests.py 
b/tests/python/cycles/render_tests.py
index 68a35f7..ee80a0b 100755
--- a/tests/python/cycles/render_tests.py
+++ b/tests/python/cycles/render_tests.py
@@ -9,10 +9,12 @@ import tempfile
 parser = argparse.ArgumentParser()
 parser.add_argument('-blender', nargs='+')
 parser.add_argument('-testdir', nargs=1)
+parser.add_argument('-idiff', nargs=1)
 args = parser.parse_args()
 
 BLENDER = args.blender[0]
 ROOT = args.testdir[0]
+IDIFF = args.idiff[0]
 
 TEMP = tempfile.mkdtemp()
 TEMP_FILE_MASK = os.path.join(TEMP, "test")
@@ -54,7 +56,7 @@ def verify_output(filepath):
 reference_image = os.path.join(reference_dirpath, testname + '.png')
 if not os.path.exists(reference_image):
 return False
-command = ['idiff',
+command = [IDIFF,
'-fail', '0.01',
'-failpercent', '1',
reference_image,

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


[Bf-blender-cvs] [0ac22ef] cycles_ctests: Cycles ctests: Use hardcoded locations to idiff on osx/win

2015-01-21 Thread Sergey Sharybin
Commit: 0ac22ef8fd4f180520d6b47d5941668e24b165ab
Author: Sergey Sharybin
Date:   Thu Jan 22 04:08:46 2015 +0500
Branches: cycles_ctests
https://developer.blender.org/rB0ac22ef8fd4f180520d6b47d5941668e24b165ab

Cycles ctests: Use hardcoded locations to idiff on osx/win

The idea is to have this binary in our libs folder, so it's easy
to run tests on those platforms without installing anything extra.

Actual binaries are to be uploaded still tho.

===

M   CMakeLists.txt

===

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f0fa76..843f430 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1445,6 +1445,7 @@ elseif(WIN32)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
+   set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
add_definitions(-DOIIO_STATIC_BUILD)
endif()
 
@@ -1684,6 +1685,7 @@ elseif(WIN32)
set(OPENIMAGEIO_LIBRARIES OpenImageIO)
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
set(OPENIMAGEIO_DEFINITIONS "")
+   set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
endif()

if(WITH_LLVM)
@@ -2012,6 +2014,7 @@ elseif(APPLE)
set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO}/lib/libOpenImageIO.a 
${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} 
${ZLIB_LIBRARIES})
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib ${JPEG_LIBPATH} 
${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH})
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
+   set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
endif()
 
if(WITH_OPENCOLORIO)

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


[Bf-blender-cvs] [64e869e] master: Outliner: use enum for outliner_data_operation()

2015-01-21 Thread Campbell Barton
Commit: 64e869ed3578e19781408f2b2e4d3d305a53649a
Author: Campbell Barton
Date:   Thu Jan 22 10:47:53 2015 +1100
Branches: master
https://developer.blender.org/rB64e869ed3578e19781408f2b2e4d3d305a53649a

Outliner: use enum for outliner_data_operation()

No functional change, D997 by @lichtwerk

===

M   source/blender/editors/space_outliner/outliner_tools.c

===

diff --git a/source/blender/editors/space_outliner/outliner_tools.c 
b/source/blender/editors/space_outliner/outliner_tools.c
index d37a4c4..e5e10e5 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -499,19 +499,29 @@ static void refreshdrivers_animdata_cb(int UNUSED(event), 
TreeElement *UNUSED(te
 
 /* - */
 
+typedef enum eOutliner_PropDataOps {
+   OL_DOP_INVALID = 0,
+   OL_DOP_SELECT,
+   OL_DOP_DESELECT,
+   OL_DOP_HIDE,
+   OL_DOP_UNHIDE,
+   OL_DOP_SELECT_LINKED,
+   OL_DOP_DELETE
+} eOutliner_PropDataOps;
+
 static void pchan_cb(int event, TreeElement *te, TreeStoreElem 
*UNUSED(tselem), void *UNUSED(arg))
 {
bPoseChannel *pchan = (bPoseChannel *)te->directdata;

-   if (event == 1)
+   if (event == OL_DOP_SELECT)
pchan->bone->flag |= BONE_SELECTED;
-   else if (event == 2)
+   else if (event == OL_DOP_DESELECT)
pchan->bone->flag &= ~BONE_SELECTED;
-   else if (event == 3) {
+   else if (event == OL_DOP_HIDE) {
pchan->bone->flag |= BONE_HIDDEN_P;
pchan->bone->flag &= ~BONE_SELECTED;
}
-   else if (event == 4)
+   else if (event == OL_DOP_UNHIDE)
pchan->bone->flag &= ~BONE_HIDDEN_P;
 }
 
@@ -519,15 +529,15 @@ static void bone_cb(int event, TreeElement *te, 
TreeStoreElem *UNUSED(tselem), v
 {
Bone *bone = (Bone *)te->directdata;

-   if (event == 1)
+   if (event == OL_DOP_SELECT)
bone->flag |= BONE_SELECTED;
-   else if (event == 2)
+   else if (event == OL_DOP_DESELECT)
bone->flag &= ~BONE_SELECTED;
-   else if (event == 3) {
+   else if (event == OL_DOP_HIDE) {
bone->flag |= BONE_HIDDEN_P;
bone->flag &= ~BONE_SELECTED;
}
-   else if (event == 4)
+   else if (event == OL_DOP_UNHIDE)
bone->flag &= ~BONE_HIDDEN_P;
 }
 
@@ -535,22 +545,22 @@ static void ebone_cb(int event, TreeElement *te, 
TreeStoreElem *UNUSED(tselem),
 {
EditBone *ebone = (EditBone *)te->directdata;

-   if (event == 1)
+   if (event == OL_DOP_SELECT)
ebone->flag |= BONE_SELECTED;
-   else if (event == 2)
+   else if (event == OL_DOP_DESELECT)
ebone->flag &= ~BONE_SELECTED;
-   else if (event == 3) {
+   else if (event == OL_DOP_HIDE) {
ebone->flag |= BONE_HIDDEN_A;
ebone->flag &= ~BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL;
}
-   else if (event == 4)
+   else if (event == OL_DOP_UNHIDE)
ebone->flag &= ~BONE_HIDDEN_A;
 }
 
 static void sequence_cb(int event, TreeElement *te, TreeStoreElem *tselem, 
void *scene_ptr)
 {
Sequence *seq = (Sequence *)te->directdata;
-   if (event == 1) {
+   if (event == OL_DOP_SELECT) {
Scene *scene = (Scene *)scene_ptr;
Editing *ed = BKE_sequencer_editing_get(scene, false);
if (BLI_findindex(ed->seqbasep, seq) != -1) {
@@ -563,7 +573,7 @@ static void sequence_cb(int event, TreeElement *te, 
TreeStoreElem *tselem, void
 
 static void data_select_linked_cb(int event, TreeElement *te, TreeStoreElem 
*UNUSED(tselem), void *C_v)
 {
-   if (event == 5) {
+   if (event == OL_DOP_SELECT_LINKED) {
if (RNA_struct_is_ID(te->rnaptr.type)) {
bContext *C = (bContext *) C_v;
ID *id = te->rnaptr.data;
@@ -1251,11 +1261,11 @@ void OUTLINER_OT_animdata_operation(wmOperatorType *ot)
 /*  */
 
 static EnumPropertyItem prop_data_op_types[] = {
-   {1, "SELECT", 0, "Select", ""},
-   {2, "DESELECT", 0, "Deselect", ""},
-   {3, "HIDE", 0, "Hide", ""},
-   {4, "UNHIDE", 0, "Unhide", ""},
-   {5, "SELECT_LINKED", 0, "Select Linked", ""},
+   {OL_DOP_SELECT, "SELECT", 0, "Select", ""},
+   {OL_DOP_DESELECT, "DESELECT", 0, "Deselect", ""},
+   {OL_DOP_HIDE, "HIDE", 0, "Hide", ""},
+   {OL_DOP_UNHIDE, "UNHIDE", 0, "Unhide", ""},
+   {OL_DOP_SELECT_LINKED, "SELECT_LINKED", 0, "Select Linked", ""},
{0, NULL, 0, NULL, NULL}
 };
 
@@ -1263,7 +1273,7 @@ static int outliner_data_operation_exec(bContext *C, 
wmOperator *op)
 {
SpaceOops *soops = CTX_wm_space_outliner(C);
   

[Bf-blender-cvs] [1b1a6e0] master: error in last commit (missed in review)

2015-01-21 Thread Campbell Barton
Commit: 1b1a6e0c9298166fee40ebb9b254f973879017bd
Author: Campbell Barton
Date:   Thu Jan 22 10:56:52 2015 +1100
Branches: master
https://developer.blender.org/rB1b1a6e0c9298166fee40ebb9b254f973879017bd

error in last commit (missed in review)

===

M   source/blender/editors/space_outliner/outliner_tools.c

===

diff --git a/source/blender/editors/space_outliner/outliner_tools.c 
b/source/blender/editors/space_outliner/outliner_tools.c
index e5e10e5..bd88403 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -506,7 +506,6 @@ typedef enum eOutliner_PropDataOps {
OL_DOP_HIDE,
OL_DOP_UNHIDE,
OL_DOP_SELECT_LINKED,
-   OL_DOP_DELETE
 } eOutliner_PropDataOps;
 
 static void pchan_cb(int event, TreeElement *te, TreeStoreElem 
*UNUSED(tselem), void *UNUSED(arg))

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


[Bf-blender-cvs] [8ed439b] master: bge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYE

2015-01-21 Thread Dalai Felinto
Commit: 8ed439b89ed4f4c968c90f8074bb0925f79cee80
Author: Dalai Felinto
Date:   Thu Jan 22 02:42:40 2015 -0200
Branches: master
https://developer.blender.org/rB8ed439b89ed4f4c968c90f8074bb0925f79cee80

bge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYE

This function allows the user to run specific code for each of the
rendered stereoscopic eyes in the Game Engine.

The initial use case is to set the camera projection matrix in
a scene.pre_draw callback function for each eye, to be used in VR
(Virtual Reality) installations.

Reviewed by Mitchell Stokes and Campbell Barton, thank you guys.

Sample Test Python Script:
"""
import bge
import bgl
import blf

def init():
"""init function - runs once"""
scene = bge.logic.getCurrentScene()
scene.post_draw.append(write)

def write():
"""write on screen - depending on the eye"""
width = bge.render.getWindowWidth()
height = bge.render.getWindowHeight()

# OpenGL setup
bgl.glMatrixMode(bgl.GL_PROJECTION)
bgl.glLoadIdentity()
bgl.gluOrtho2D(0, width, 0, height)
bgl.glMatrixMode(bgl.GL_MODELVIEW)
bgl.glLoadIdentity()

eye = bge.render.getStereoEye()

if eye == bge.render.LEFT_EYE:
blf.position(0, (width * 0.2), (height * 0.3), 0)
blf.size(0, 40, 72)
blf.draw(0, "Left")

else: # bge.render.RIGHT_EYE:
blf.position(0, (width * 0.7), (height * 0.3), 0)
blf.size(0, 40, 72)
blf.draw(0, "Right")
"""

===

M   doc/python_api/rst/bge.render.rst
M   source/gameengine/Ketsji/KX_PythonInit.cpp

===

diff --git a/doc/python_api/rst/bge.render.rst 
b/doc/python_api/rst/bge.render.rst
index 9dd4057..03db3bf 100644
--- a/doc/python_api/rst/bge.render.rst
+++ b/doc/python_api/rst/bge.render.rst
@@ -75,6 +75,14 @@ Constants
 
Enables adaptive vsync if supported. Adaptive vsync enables vsync if the 
framerate is above the monitors refresh rate. Otherwise, vsync is diabled if 
the framerate is too low.
 
+.. data:: LEFT_EYE
+
+   Left eye being used during stereoscopic rendering.
+
+.. data:: RIGHT_EYE
+
+   Right eye being used during stereoscopic rendering.
+
 *
 Functions
 *
@@ -217,6 +225,15 @@ Functions

:rtype: float
 
+.. function:: getStereoEye()
+
+   Gets the current stereoscopy eye being rendered.
+   This function is mainly used in a :class:`bge.types.KX_Scene.pre_draw` 
callback
+   function to customize the camera projection matrices for each
+   stereoscopic eye.
+
+   :rtype: LEFT_EYE, RIGHT_EYE
+
 .. function:: setMaterialMode(mode)
 
Set the material mode to use for OpenGL rendering.
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp 
b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 3ddd53b..348b84e 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -1006,6 +1006,21 @@ static PyObject *gPyGetFocalLength(PyObject *, PyObject 
*, PyObject *)
Py_RETURN_NONE;
 }
 
+static PyObject *gPyGetStereoEye(PyObject *, PyObject *, PyObject *)
+{
+   int flag = RAS_IRasterizer::RAS_STEREO_LEFTEYE;
+
+   if (!gp_Rasterizer) {
+   PyErr_SetString(PyExc_RuntimeError, "Rasterizer.getStereoEye(), 
Rasterizer not available");
+   return NULL;
+   }
+
+   if (gp_Rasterizer->Stereo())
+   flag = gp_Rasterizer->GetEye();
+
+   return PyLong_FromLong(flag);
+}
+
 static PyObject *gPySetBackgroundColor(PyObject *, PyObject *value)
 {

@@ -1496,6 +1511,7 @@ static struct PyMethodDef rasterizer_methods[] = {
{"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_NOARGS, 
"get the eye separation for stereo mode"},
{"setFocalLength", (PyCFunction) gPySetFocalLength, METH_VARARGS, "set 
the focal length for stereo mode"},
{"getFocalLength", (PyCFunction) gPyGetFocalLength, METH_VARARGS, "get 
the focal length for stereo mode"},
+   {"getStereoEye", (PyCFunction) gPyGetStereoEye, METH_VARARGS, "get the 
current stereoscopy eye being rendered"},
{"setMaterialMode",(PyCFunction) gPySetMaterialType,
 METH_VARARGS, "set the material mode to use for OpenGL rendering"},
{"getMaterialMode",(PyCFunction) gPyGetMaterialType,
@@ -2320,6 +2336,10 @@ PyObject *initRasterizer(RAS_IRasterizer* 
rasty,RAS_ICanvas* canvas)
KX_MACRO_addTypesToDict(d, VSYNC_ON, VSYNC_ON);
KX_MACRO_addTypesToDict(d, VSYNC_ADAPTIVE, VSYNC_ADAPTIVE);
 
+   /* stereoscopy */
+   KX_MACRO_addTypesToDict(d, LEFT_EYE, 
RAS_IRasterizer::RAS_STEREO_LEFTEYE);
+   KX_MACRO_addTypesToDict(d, RIGHT_EYE, 
RAS_IRasterizer::RAS_STEREO_RIGHTEYE);
+
//  Add constants here
 
// Check for errors

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

[Bf-blender-cvs] [5c6ef95] master: Docs: touch ups in the bge.render doc introduction

2015-01-21 Thread Dalai Felinto
Commit: 5c6ef95b716b97f4d2bc7902049ecf4451e255fd
Author: Dalai Felinto
Date:   Thu Jan 22 03:20:39 2015 -0200
Branches: master
https://developer.blender.org/rB5c6ef95b716b97f4d2bc7902049ecf4451e255fd

Docs: touch ups in the bge.render doc introduction

===

M   doc/python_api/rst/bge.render.rst

===

diff --git a/doc/python_api/rst/bge.render.rst 
b/doc/python_api/rst/bge.render.rst
index 03db3bf..77d5bd7 100644
--- a/doc/python_api/rst/bge.render.rst
+++ b/doc/python_api/rst/bge.render.rst
@@ -8,9 +8,13 @@ Intro
 
 .. module:: bge.render
 
+Example of using a :class:`bge.types.SCA_MouseSensor`, and two 
:class:`bge.types.KX_ObjectActuator` to implement MouseLook:
+
+.. note::
+   This can also be achieved with the :class:`bge.types.KX_MouseActuator`.
+
 .. code-block:: python
 
-   # Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to 
implement MouseLook::
# To use a mouse movement sensor "Mouse" and a
# motion actuator to mouse look:
import bge

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


[Bf-blender-cvs] [21eb3ce] master: Fix: Audaspace threw an exception for files it could not open.

2015-01-21 Thread Jörg Müller
Commit: 21eb3ce44a36b057279ba811011e387bdbf6ac69
Author: Jörg Müller
Date:   Thu Jan 22 18:57:56 2015 +1300
Branches: master
https://developer.blender.org/rB21eb3ce44a36b057279ba811011e387bdbf6ac69

Fix: Audaspace threw an exception for files it could not open.

===

M   intern/audaspace/intern/AUD_SequencerHandle.cpp

===

diff --git a/intern/audaspace/intern/AUD_SequencerHandle.cpp 
b/intern/audaspace/intern/AUD_SequencerHandle.cpp
index 56cfa0d..aa742f7 100644
--- a/intern/audaspace/intern/AUD_SequencerHandle.cpp
+++ b/intern/audaspace/intern/AUD_SequencerHandle.cpp
@@ -47,8 +47,15 @@ void AUD_SequencerHandle::start()
// let's try playing
if(m_entry->m_sound.get())
{
-   m_handle = m_device.play(m_entry->m_sound, true);
-   m_3dhandle = 
boost::dynamic_pointer_cast(m_handle);
+   try
+   {
+   m_handle = m_device.play(m_entry->m_sound, true);
+   m_3dhandle = 
boost::dynamic_pointer_cast(m_handle);
+   }
+   catch(AUD_Exception&)
+   {
+   // handle stays invalid in case we get an exception
+   }
 
// after starting we have to set the properties, so let's 
ensure that
m_status--;

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