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

Revision 13466, 1.6 kB (checked in by robert, 11 hours ago)

From Jan Klimke, "i noticed, that there are a couple of additional flaws when building osg for Mac OS X 10.10 Yosemite.

The mac os sdk version is recognized by the current CMAKE script as 10.1 instead of 10.10 since it cuts the version string from the 4th place. I introduced a more reliable version checking based on splitting the returned version code into MAJOR MINOR and PATCH parts and reassemble the OSG sdk version afterwards.

I replaced the existing CMake code against the following (returning now version 10.10 as expected):

# Determine the canonical name of the selected Platform SDK

EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"

OUTPUT_VARIABLE OSG_OSX_SDK_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE)

STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)

SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")

Also i added the check for the new Version to some more find scripts.

Additionally the nil object in Objective C now seems to be equivalent with a null_ptr that cannot be passed as GLInt anymore. So i switched this in the PixelBufferCocoa?.mm to pass a zero instead of nil.
"

  • Property svn:eol-style set to native
RevLine 
[10780]1#ifndef READERWRITERFBX_H
2#define READERWRITERFBX_H
3
4#include <osgDB/ReaderWriter>
[13466]5#include <fbxsdk/fbxsdk_def.h>
[10780]6
[13466]7
[10780]8///////////////////////////////////////////////////////////////////////////
9// OSG reader plugin for the ".fbx" format.
[12144]10// See http://www.autodesk.com/fbx
[13466]11// This plugin requires the FBX SDK version 2013.3 or 2014.1
[10780]12
[13466]13#if FBXSDK_VERSION_MAJOR < 2013 || (FBXSDK_VERSION_MAJOR == 2013 && FBXSDK_VERSION_MINOR < 3)
[12337]14#error Wrong FBX SDK version
15#endif
16
[10780]17class ReaderWriterFBX : public osgDB::ReaderWriter
18{
19public:
20    ReaderWriterFBX()
21    {
22        supportsExtension("fbx", "FBX format");
[11317]23        supportsOption("Embedded", "(Write option) Embed textures in FBX file");
[11109]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");
[11589]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.");
[11682]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.");
[10780]27    }
28
29    const char* className() const { return "FBX reader/writer"; }
30
[11109]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;
[10780]33};
34
35///////////////////////////////////////////////////////////////////////////
36
37#endif
Note: See TracBrowser for help on using the browser.