[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58529] branches/soc-2013-cycles_mblur/ intern/cycles: Changes to the object_export field of the Object class.
Gavin Howard
gavin.d.howard at gmail.com
Tue Jul 23 07:38:02 CEST 2013
Revision: 58529
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58529
Author: gdh
Date: 2013-07-23 05:38:02 +0000 (Tue, 23 Jul 2013)
Log Message:
-----------
Changes to the object_export field of the Object class. It is now a
pointer allocated with new. I was hoping this would fix the seg fault,
but it didn't. I kind of like it better, though. Tell me if it's not.
Modified Paths:
--------------
branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp
branches/soc-2013-cycles_mblur/intern/cycles/render/object.cpp
branches/soc-2013-cycles_mblur/intern/cycles/render/object.h
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-23 05:28:05 UTC (rev 58528)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp 2013-07-23 05:38:02 UTC (rev 58529)
@@ -324,7 +324,7 @@
scene->object_manager->tag_update(scene);
object_updated = true;
}
-
+
/* Get the number of motion blur steps. */
uint mblur_steps = object_mblur_steps(b_ob);
@@ -335,30 +335,33 @@
object->mesh->mblur_steps = mblur_steps;
scene->object_manager->tag_update(scene);
object_updated = true;
-
+
/* Get the new export times. */
-
+
+ /* First, clear the old ones. */
+ object->export_times->clear();
+
/* We need to use the shutter time. */
float shuttertime = scene->camera->shuttertime;
float half_frame = 0.5f * shuttertime;
-
+
/* This is a float to prevent a lot of casting in a for loop. */
float frame = static_cast<float>(b_scene.frame_current());
-
+
/* XXX: Do ALL compilers optimize the divide by 2? */
int half_steps = mblur_steps / 2;
float step_width = half_frame / half_steps;
float time;
-
+
for (int i = 1; i <= half_steps; ++i) {
time = i * step_width;
- object->export_times.insert(frame - time);
- object->export_times.insert(frame + time);
+ object->export_times->insert(frame - time);
+ object->export_times->insert(frame + time);
}
}
-
+
bool use_holdout = (layer_flag & render_layer.holdout_layer) != 0;
-
+
/* mesh sync */
object->mesh = sync_mesh(b_ob, object_updated, hide_tris);
Modified: branches/soc-2013-cycles_mblur/intern/cycles/render/object.cpp
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/render/object.cpp 2013-07-23 05:28:05 UTC (rev 58528)
+++ branches/soc-2013-cycles_mblur/intern/cycles/render/object.cpp 2013-07-23 05:38:02 UTC (rev 58529)
@@ -48,10 +48,12 @@
use_deform_mblur = false;
use_holdout = false;
curverender = false;
+ export_times = new std::set<float>();
}
Object::~Object()
{
+ delete export_times;
}
void Object::compute_bounds(bool motion_blur, float shuttertime)
Modified: branches/soc-2013-cycles_mblur/intern/cycles/render/object.h
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/render/object.h 2013-07-23 05:28:05 UTC (rev 58528)
+++ branches/soc-2013-cycles_mblur/intern/cycles/render/object.h 2013-07-23 05:38:02 UTC (rev 58529)
@@ -61,7 +61,7 @@
* This one is only used during syncing.
* It should be set to NULL right afterward.
*/
- std::set<float> export_times;
+ std::set<float> *export_times;
Object();
~Object();
More information about the Bf-blender-cvs
mailing list