[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58297] branches/soc-2013-cycles_mblur/ intern/cycles/render: Added a new Attribute::add() function that will add vertex steps.
Gavin Howard
gavin.d.howard at gmail.com
Tue Jul 16 01:17:21 CEST 2013
Revision: 58297
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58297
Author: gdh
Date: 2013-07-15 23:17:21 +0000 (Mon, 15 Jul 2013)
Log Message:
-----------
Added a new Attribute::add() function that will add vertex steps. It
takes an extra parameter: the number of export steps.
Modified Paths:
--------------
branches/soc-2013-cycles_mblur/intern/cycles/render/attribute.cpp
branches/soc-2013-cycles_mblur/intern/cycles/render/attribute.h
Modified: branches/soc-2013-cycles_mblur/intern/cycles/render/attribute.cpp
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/render/attribute.cpp 2013-07-15 22:44:48 UTC (rev 58296)
+++ branches/soc-2013-cycles_mblur/intern/cycles/render/attribute.cpp 2013-07-15 23:17:21 UTC (rev 58297)
@@ -62,6 +62,15 @@
buffer.push_back(data[i]);
}
+void Attribute::add(const float3& f, uint steps)
+{
+ char *data = (char*)&f;
+ size_t size = sizeof(f) * steps;
+
+ for (size_t i = 0; i < size; i++)
+ buffer.push_back(data[i]);
+}
+
size_t Attribute::data_sizeof() const
{
if(type == TypeDesc::TypeFloat)
Modified: branches/soc-2013-cycles_mblur/intern/cycles/render/attribute.h
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/render/attribute.h 2013-07-15 22:44:48 UTC (rev 58296)
+++ branches/soc-2013-cycles_mblur/intern/cycles/render/attribute.h 2013-07-15 23:17:21 UTC (rev 58297)
@@ -66,6 +66,7 @@
void add(const float& f);
void add(const float3& f);
+ void add(const float3& f, uint steps);
static bool same_storage(TypeDesc a, TypeDesc b);
static const char *standard_name(AttributeStandard std);
More information about the Bf-blender-cvs
mailing list