Index: /experimental/distortionNG/DistortionManipulator.cpp
===================================================================
--- /experimental/distortionNG/DistortionManipulator.cpp	(revision 366)
+++ /experimental/distortionNG/DistortionManipulator.cpp	(revision 367)
@@ -88,4 +88,6 @@
 				OSG_ALWAYS<<"ea.getYmax()="<<ea.getYmax()<<std::endl;
 
+
+
 				if(activeDistortionMode == MESH)
 				{
Index: /experimental/distortionNG/ReaderWriterDist.cpp
===================================================================
--- /experimental/distortionNG/ReaderWriterDist.cpp	(revision 366)
+++ /experimental/distortionNG/ReaderWriterDist.cpp	(revision 367)
@@ -25,24 +25,43 @@
 	// Get ReaderWriter
 	rw = osgDB::Registry::instance()->getReaderWriterForExtension("osgt");	
-
 }
 
-ReaderWriterDist::ReadResult ReaderWriterDist::readNode( const std::string& file, const osgDB::ReaderWriter::Options* options) const
+ReaderWriterDist::Options* ReaderWriterDist::prepareReading( ReadResult& result, std::string& fileName, std::ios::openmode& mode, const Options* options ) const
 {
-	std::string ext = osgDB::getLowerCaseFileExtension( file );
-	if( !acceptsExtension(ext) )
-		return ReadResult::FILE_NOT_HANDLED;
+	std::string ext = osgDB::getLowerCaseFileExtension( fileName );
+	if ( !acceptsExtension(ext) )
+	{
+		result = ReadResult::FILE_NOT_HANDLED;
+		return 0;
+	}
+	fileName = osgDB::findDataFile( fileName, options );
+	if ( fileName.empty() )
+	{
+		result = ReadResult::FILE_NOT_FOUND;
+		return 0;
+	}
 
-	// check if file exists
-	std::string fileName = osgDB::findDataFile( file, options );
-	if( fileName.empty() )
-		return ReadResult::FILE_NOT_FOUND;
+	osg::ref_ptr<Options> local_opt = options ?
+		static_cast<Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options;
+	local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName));
 
-	std::ifstream stream( fileName.c_str(), std::ios::in );
-	if (!stream)	return ReadResult::ERROR_IN_READING_FILE;
-	return readNode( stream, options );
+	mode |= std::ios::binary;
+
+	return local_opt.release();
 }
 
-ReaderWriterDist::ReadResult ReaderWriterDist:: readNode( std::istream& fin, const osgDB::ReaderWriter::Options* options ) const
+ReaderWriterDist::ReadResult ReaderWriterDist::readObject( const std::string& file, const Options* options) const
+{
+	ReadResult result = ReadResult::FILE_LOADED;
+	std::string fileName = file;
+	std::ios::openmode mode = std::ios::in;
+	Options* local_opt = prepareReading( result, fileName, mode, options );
+	if ( !result.success() ) return result;
+
+	osgDB::ifstream istream( fileName.c_str(), mode );
+	return readObject( istream, local_opt );
+}
+
+ReaderWriterDist::ReadResult ReaderWriterDist::readObject( std::istream& fin, const Options* options ) const
 {
 	if ( rw )
@@ -56,36 +75,42 @@
 			OSG_NOTIFY( osg::WARN ) << "ERROR: Unable to convert stream to node" << std::endl;
 	}
-	else
-		OSG_NOTIFY( osg::WARN ) << "ERROR: Unable to get ReaderWriter for internally used extension" << std::endl;
+	OSG_NOTIFY( osg::WARN ) << "ERROR: Unable to get ReaderWriter for internally used extension" << std::endl;
+	return( ReadResult::NOT_IMPLEMENTED );
 }
 
-ReaderWriterDist::WriteResult writeNode( const osg::Node& node, const std::string& fileName, const Options* options ) const
+ReaderWriterDist::Options* ReaderWriterDist::prepareWriting( WriteResult& result, const std::string& fileName, std::ios::openmode& mode, const Options* options ) const
 {
-	std::string ext = osgDB::getLowerCaseFileExtension( file );
-	if( !acceptsExtension(ext) )
-		return WriteResult::FILE_NOT_HANDLED;
+	std::string ext = osgDB::getFileExtension( fileName );
+	if ( !acceptsExtension(ext) ) result = WriteResult::FILE_NOT_HANDLED;
 
-	std::ifstream stream( fileName.c_str(), std::ios::in );
-	if (!stream)	return ReadResult::ERROR_IN_READING_FILE;
-	return readNode( stream, options );
-// ------------------
-    WriteResult result = WriteResult::FILE_SAVED;
-    std::ios::openmode mode = std::ios::out;
-    osg::ref_ptr<Options> local_opt = prepareWriting( result, fileName, mode, options );
-    if ( !result.success() ) return result;
+	osg::ref_ptr<Options> local_opt = options ?
+		static_cast<Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options;
+	local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName));
 
-    osgDB::ofstream fout( fileName.c_str(), mode );
-    if ( !fout ) return WriteResult::ERROR_IN_WRITING_FILE;
+	mode |= std::ios::binary;
 
-    result = writeNode( node, fout, local_opt.get() );
-    fout.close();
-    return result;
+	return local_opt.release();
 }
 
-ReaderWriterDist::WriteResult writeNode( const osg::Node& node, std::ostream& fout, const Options* options ) const
+ReaderWriterDist::WriteResult ReaderWriterDist::writeObject( const osg::Object& object, const std::string& fileName, const osgDB::ReaderWriter::Options* options ) const
+{
+	WriteResult result = WriteResult::FILE_SAVED;
+	std::ios::openmode mode = std::ios::out;
+	osg::ref_ptr<Options> local_opt = prepareWriting( result, fileName, mode, options );
+	if ( !result.success() ) return result;
+
+	osgDB::ofstream fout( fileName.c_str(), mode );
+	if ( !fout ) return WriteResult::ERROR_IN_WRITING_FILE;
+
+	result = writeObject( object, fout, local_opt.get() );
+	fout.close();
+	return result;
+}
+
+ReaderWriterDist::WriteResult ReaderWriterDist::writeObject( const osg::Object& object, std::ostream& fout, const osgDB::ReaderWriter::Options* options ) const
 {
 	if ( rw )
 	{
-		osgDB::ReaderWriter::WriteResult wr = rw->writeObject( node, fout, writeOptions );
+		osgDB::ReaderWriter::WriteResult wr = rw->writeObject( object, fout, writeOptions );
 		if (wr.success() )			
 		{
@@ -96,4 +121,5 @@
 	}
 	OSG_NOTIFY( osg::WARN ) << "ERROR: Unable to get ReaderWriter for internally used extension" << std::endl;
+	return( WriteResult::NOT_IMPLEMENTED );
 }
 
Index: /experimental/distortionNG/ReaderWriterDist.h
===================================================================
--- /experimental/distortionNG/ReaderWriterDist.h	(revision 366)
+++ /experimental/distortionNG/ReaderWriterDist.h	(revision 367)
@@ -8,6 +8,7 @@
 #include <osgDB/Registry>
 #include <osgDB/ReadFile>
+#include <osgDB/WriteFile>
+#include <stdlib.h>
 
-#include "ModificationVisitor.h"
 
 class ReaderWriterDist : public osgDB::ReaderWriter
@@ -17,8 +18,10 @@
 
 	virtual const char* className() const { return "distortion set loader"; };
-	virtual ReadResult readNode( const std::string& file, const osgDB::ReaderWriter::Options* options) const;
-	virtual ReadResult readNode( std::istream& fin, const osgDB::ReaderWriter::Options* options ) const;
-    virtual WriteResult writeNode( const osg::Node& node, const std::string& fileName, const osgDB::ReaderWriter::Options* options ) const;
-    virtual WriteResult writeNode( const osg::Node& node, std::ostream& fout, const osgDB::ReaderWriter::Options* options ) const;
+	Options* prepareReading( ReadResult& result, std::string& fileName, std::ios::openmode& mode, const Options* options ) const;
+	Options* prepareWriting( WriteResult& result, const std::string& fileName, std::ios::openmode& mode, const Options* options ) const;
+	virtual ReadResult readObject( const std::string& file, const osgDB::ReaderWriter::Options* options) const;	// passes the call to the stream function
+	virtual ReadResult readObject( std::istream& fin, const osgDB::ReaderWriter::Options* options ) const;	// passes the call to the readwriter defined in the ctor
+    virtual WriteResult writeObject( const osg::Object& object, const std::string& fileName, const osgDB::ReaderWriter::Options* options ) const;	// passes the call to the stream function
+    virtual WriteResult writeObject( const osg::Object& object, std::ostream& fout, const osgDB::ReaderWriter::Options* options ) const;	// passes the call to the readwriter defined in the ctor
 
 
Index: /experimental/distortionNG/main.cpp
===================================================================
--- /experimental/distortionNG/main.cpp	(revision 366)
+++ /experimental/distortionNG/main.cpp	(revision 367)
@@ -164,5 +164,5 @@
  *										- Mesh Dimensions (rows, columns)
  * 										- Mesh Type (GLenum QUAD_STRIP, ...)
- *										- Mesh Coordinates [0-1]
+ *		 								- Mesh Coordinates [0-1]
  *										- Texture Coordinates [0-1]
  * 										- textureUnit for Scene RTT (z.B.: 0)
Index: /experimental/distortionNG/osgdb_dist.vcproj
===================================================================
--- /experimental/distortionNG/osgdb_dist.vcproj	(revision 366)
+++ /experimental/distortionNG/osgdb_dist.vcproj	(revision 367)
@@ -85,9 +85,9 @@
 				LinkLibraryDependencies="false"
 				AdditionalOptions=" /STACK:10000000 /machine:X86 /debug"
-				AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  ..\..\..\lib\OpenThreadsd.lib ..\..\..\lib\osgd.lib ..\..\..\lib\osgDBd.lib ..\..\..\lib\osgUtild.lib opengl32.lib ..\..\..\lib\osgd.lib ..\..\..\lib\OpenThreadsd.lib D:\OpenSceneGraph\3rdParty_x86_x64\x86\lib\zlibD.lib opengl32.lib "
-				OutputFile="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\bin\osgPlugins-3.1.0\osgdb_distd.dll"
+				AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib OpenThreadsd.lib osgd.lib osgDBd.lib osgUtild.lib opengl32.lib D:\OpenSceneGraph\3rdParty_x86_x64\x86\lib\zlibD.lib $(NOINHERIT)"
+				OutputFile="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\bin\osgPlugins-3.1.3\osgdb_distd.dll"
 				Version="0.0"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories=""
+				AdditionalLibraryDirectories="&quot;$(OSG_ROOT)\lib\&quot;"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\bin\osgPlugins-3.1.0\osgdb_distd.pdb"
@@ -182,9 +182,9 @@
 				LinkLibraryDependencies="false"
 				AdditionalOptions=" /STACK:10000000 /machine:X86"
-				AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  ..\..\..\lib\OpenThreads.lib ..\..\..\lib\osg.lib ..\..\..\lib\osgDB.lib ..\..\..\lib\osgUtil.lib opengl32.lib ..\..\..\lib\osg.lib ..\..\..\lib\OpenThreads.lib D:\OpenSceneGraph\3rdParty_x86_x64\x86\lib\zlib.lib opengl32.lib "
-				OutputFile="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\bin\osgPlugins-3.1.0\osgdb_dist.dll"
+				AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib OpenThreads.lib osg.lib osgDB.lib osgUtil.lib opengl32.lib D:\OpenSceneGraph\3rdParty_x86_x64\x86\lib\zlib.lib $(NOINHERIT)"
+				OutputFile="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\bin\osgPlugins-3.1.3\osgdb_dist.dll"
 				Version="0.0"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
+				AdditionalLibraryDirectories="&quot;$(OSG_ROOT)\lib\&quot;"
 				ProgramDatabaseFile="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\bin\osgPlugins-3.1.0\osgdb_dist.pdb"
 				ImportLibrary="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\lib\osgPlugins-3.1.0\osgdb_dist.lib"
@@ -282,5 +282,5 @@
 				Version="0.0"
 				LinkIncremental="1"
-				AdditionalLibraryDirectories=""
+				AdditionalLibraryDirectories="&quot;$(OSG_ROOT)\lib\&quot;"
 				ProgramDatabaseFile="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\bin\osgPlugins-3.1.0\osgdb_dists.pdb"
 				ImportLibrary="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\lib\osgPlugins-3.1.0\osgdb_dists.lib"
@@ -379,5 +379,5 @@
 				Version="0.0"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories=""
+				AdditionalLibraryDirectories="&quot;$(OSG_ROOT)\lib\&quot;"
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="D:\OpenSceneGraph\OpenSceneGraph-3.1.0_x86\bin\osgPlugins-3.1.0\osgdb_distrd.pdb"
