From 00679c7631fdd588c9ac9831dbf6def0a332099c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 25 Jul 2019 10:39:34 +0100 Subject: [PATCH] Added ReaderWriterOBJ::readObject(..) implementations to address issue with using osgconv --- src/osgPlugins/obj/ReaderWriterOBJ.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/osgPlugins/obj/ReaderWriterOBJ.cpp b/src/osgPlugins/obj/ReaderWriterOBJ.cpp index 4b452815d..4868f363c 100644 --- a/src/osgPlugins/obj/ReaderWriterOBJ.cpp +++ b/src/osgPlugins/obj/ReaderWriterOBJ.cpp @@ -80,6 +80,22 @@ public: virtual const char* className() const { return "Wavefront OBJ Reader"; } + virtual ReadResult readObject(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const + { + ReadResult result = readNode(fileName, options); + osg::Node* node = result.getNode(); + if (node) return node; + else return result; + } + + virtual ReadResult readObject(std::istream& fin, const Options* options) const + { + ReadResult result = readNode(fin, options); + osg::Node* node = result.getNode(); + if (node) return node; + else return result; + } + virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const; virtual ReadResult readNode(std::istream& fin, const Options* options) const;