root/OpenSceneGraph/trunk/src/osgPlugins/fbx/ReaderWriterFBX.h @ 13748

Revision 13466, 1.6 kB (checked in by robert, 61 minutes ago)

From Mattias Helsing, "Seems I was only half right given what you asked for. CMP0017 only
says that modules that are found and ran from cmake modules dir should
prefer cmake-provided modules. find_package() and include() still look
in CMAKE_MODULE_PATH first.

After some investigating I've come up with a proposal examplified in
the attached FindGDAL.cmake script. It simply calls the cmake provided
FindGDAL.cmake if it exists and returns if it succeeds in finding GDAL
using that, otherwise continue with our local cmake code.
Pro: Wont clutter our root CMakeLists.txt
Con: If we begin to write more advanced Findxxx modules (using
COMPONENTS, REQUIRED etc.) we may have to revise this scheme.
"

  • Property svn:eol-style set to native
Line 
1#ifndef READERWRITERFBX_H
2#define READERWRITERFBX_H
3
4#include <osgDB/ReaderWriter>
5#include <fbxsdk/fbxsdk_def.h>
6
7
8///////////////////////////////////////////////////////////////////////////
9// OSG reader plugin for the ".fbx" format.
10// See http://www.autodesk.com/fbx
11// This plugin requires the FBX SDK version 2013.3 or 2014.1
12
13#if FBXSDK_VERSION_MAJOR < 2013 || (FBXSDK_VERSION_MAJOR == 2013 && FBXSDK_VERSION_MINOR < 3)
14#error Wrong FBX SDK version
15#endif
16
17class ReaderWriterFBX : public osgDB::ReaderWriter
18{
19public:
20    ReaderWriterFBX()
21    {
22        supportsExtension("fbx", "FBX format");
23        supportsOption("Embedded", "(Write option) Embed textures in FBX file");
24        supportsOption("UseFbxRoot", "(Read/write option) If the source OSG root node is a simple group with no stateset, the writer will put its children directly under the FBX root, and vice-versa for reading");
25        supportsOption("LightmapTextures", "(Read option) Interpret texture maps as overriding the lighting. 3D Studio Max may export files that should be interpreted in this way.");
26        supportsOption("TessellatePolygons", "(Read option) Tessellate mesh polygons. If the model contains concave polygons this may be necessary, however tessellating can be very slow and may erroneously produce triangle shards.");
27    }
28
29    const char* className() const { return "FBX reader/writer"; }
30
31    virtual ReadResult readNode(const std::string& filename, const Options*) const;
32    virtual WriteResult writeNode(const osg::Node&, const std::string& filename, const Options*) const;
33};
34
35///////////////////////////////////////////////////////////////////////////
36
37#endif
Note: See TracBrowser for help on using the browser.