[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58675] branches/soc-2013-cycles_mblur/ intern/cycles/blender: This commit adds debugging statements.
Gavin Howard
gavin.d.howard at gmail.com
Sat Jul 27 21:31:33 CEST 2013
Revision: 58675
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58675
Author: gdh
Date: 2013-07-27 19:31:33 +0000 (Sat, 27 Jul 2013)
Log Message:
-----------
This commit adds debugging statements. It also fixes a bug. The bug was
that the mesh->mblur_steps was not getting updated.
The debugging output from this build shows that all vertices are at
0,0,0. That is obviously wrong. Other than that, export is working.
Modified Paths:
--------------
branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_mesh.cpp
branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp
Modified: branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_mesh.cpp
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_mesh.cpp 2013-07-27 18:40:40 UTC (rev 58674)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_mesh.cpp 2013-07-27 19:31:33 UTC (rev 58675)
@@ -437,9 +437,6 @@
if(!mesh_map.sync(&mesh, key)) {
- /* Sync the steps for motion blur. */
- mesh->mblur_steps = mblur_steps;
-
/* if transform was applied to mesh, need full update */
if(object_updated && mesh->transform_applied);
/* test if shaders changed, these can be object level so mesh
@@ -560,6 +557,20 @@
for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end() && i < size; ++v, i++)
attr_M->add(get_float3(v->co()));
+
+ uint steps = mesh->mblur_steps;
+ uint numverts = mesh->verts.size();
+ Attribute *attr = mesh->attributes.find(ATTR_STD_DMOTION);
+ float3 *verts = attr->data_float3();
+ float3 item;
+ for(uint i = 0; i < steps - 1; ++i) {
+ cout << "\nStep " << (i + 1) << ":\n";
+ for(uint j = 0; j < numverts; ++j) {
+ item = verts[i * numverts + j];
+ cout << "Vert " << (j + 1) << ": " << item[0] << "," << item[1] << "," << item[2] << endl;
+ }
+ cout << endl;
+ }
/* free derived mesh */
b_data.meshes.remove(b_mesh);
Modified: branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp 2013-07-27 18:40:40 UTC (rev 58674)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp 2013-07-27 19:31:33 UTC (rev 58675)
@@ -367,6 +367,9 @@
/* We may have to update deformation motion blur. */
if (object->use_motion && object->use_deform_mblur) {
+ /* Put the number of steps on the mesh. */
+ object->mesh->mblur_steps = mblur_steps;
+
/* Delete the VERTEX_STEPS attribute and re-add it. */
object->mesh->attributes.remove(ATTR_STD_DMOTION);
object->mesh->attributes.add(ATTR_STD_DMOTION);
More information about the Bf-blender-cvs
mailing list