From fcd3150b12a826552f9ab41cbd46ebfda208e07e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 27 May 2011 09:00:53 +0000 Subject: [PATCH] From Laurens Voerman, "While working on the osg exporter for 3dsmax I found a bug in the TriStripVisitor. I created a small example (attached), and a modified version of src\osgUtil\TriStripVisitor.cpp where the problem is removed." --- src/osgUtil/TriStripVisitor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/osgUtil/TriStripVisitor.cpp b/src/osgUtil/TriStripVisitor.cpp index 5a998872a..870ae0632 100644 --- a/src/osgUtil/TriStripVisitor.cpp +++ b/src/osgUtil/TriStripVisitor.cpp @@ -77,7 +77,16 @@ struct VertexAttribComparitor void add(osg::Array* array, osg::Geometry::AttributeBinding binding) { if (binding==osg::Geometry::BIND_PER_VERTEX && array) + { + for(ArrayList::const_iterator itr=_arrayList.begin(); + itr!=_arrayList.end(); + ++itr) + { + if ((*itr) == array) + return; + } _arrayList.push_back(array); + } } typedef std::vector ArrayList;