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

Revision 11582, 1.3 kB (checked in by mplatings, 4 years ago)

From Alessandro Terenzi: modifications for supporting opacity, reflective and emissive maps beyond the already supported diffuse map in the FBX plugin.
A problem with transparency has also been fixed: objects were transparent wrt themselves but were opaque wrt to other objects.
Finally I added the support for "mixing factors" of diffuse, reflective and opacity textures/values.

From Michael Platings: added "LightmapTextures?" plugin option that changes the way textures are interpreted so Alessandro's models appear correctly. Also refactored to put many functions in one class to avoid passing around too many arguments to functions.

Line 
1#ifndef READERWRITERFBX_H
2#define READERWRITERFBX_H
3
4#include <osgDB/ReaderWriter>
5
6///////////////////////////////////////////////////////////////////////////
7// OSG reader plugin for the ".fbx" format.
8// See http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=6837478
9// This plugin requires the FBX SDK version 2011.2
10
11class ReaderWriterFBX : public osgDB::ReaderWriter
12{
13public:
14    ReaderWriterFBX()
15    {
16        supportsExtension("fbx", "FBX format");
17        supportsOption("Embedded", "(Write option) Embed textures in FBX file");
18        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");
19                supportsOption("LightmapTextures", "(Read option) Interpret texture maps as overriding the lighting. 3D Studio Max may export files that should be interpreted in this way.");
20    }
21
22    const char* className() const { return "FBX reader/writer"; }
23
24    virtual ReadResult readNode(const std::string& filename, const Options*) const;
25    virtual WriteResult writeNode(const osg::Node&, const std::string& filename, const Options*) const;
26};
27
28///////////////////////////////////////////////////////////////////////////
29
30#endif
Note: See TracBrowser for help on using the browser.