Changeset 8282
- Timestamp:
- 05/08/08 14:36:07
- Files:
-
- OpenSceneGraph/trunk/CMakeModules/FindCOLLADA.cmake (modified) (3 diffs)
- OpenSceneGraph/trunk/src/osgPlugins/dae/CMakeLists.txt (modified) (1 diff)
- OpenSceneGraph/trunk/src/osgPlugins/dae/daeRGeometry.cpp (modified) (1 diff)
- OpenSceneGraph/trunk/src/osgPlugins/dae/daeRMaterials.cpp (modified) (2 diffs)
- OpenSceneGraph/trunk/src/osgPlugins/dae/daeWMaterials.cpp (modified) (1 diff)
- OpenSceneGraph/trunk/src/osgPlugins/dae/daeWriter.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
OpenSceneGraph/trunk/CMakeModules/FindCOLLADA.cmake
r7025 r8282 19 19 /Library/Frameworks 20 20 /usr/local/include 21 /usr/include 21 /usr/local/include/colladadom 22 /usr/include/ 23 /usr/include/colladadom 22 24 /sw/include # Fink 23 25 /opt/local/include # DarwinPorts … … 29 31 30 32 FIND_LIBRARY(COLLADA_LIBRARY 31 NAMES collada_dom 33 NAMES collada_dom collada14dom 32 34 PATHS 33 35 $ENV{COLLADA_DIR}/lib … … 40 42 /Library/Frameworks 41 43 /usr/local/lib 44 /usr/local/lib64 42 45 /usr/lib 46 /usr/lib64 43 47 /sw/lib 44 48 /opt/local/lib OpenSceneGraph/trunk/src/osgPlugins/dae/CMakeLists.txt
r7664 r8282 46 46 # ...so what we need is a conditional way to properly SET() the right one. 47 47 IF(COLLADA_USE_STATIC) 48 SET(TARGET_EXTERNAL_LIBRARIES collada _dom collada_daexml2 pcrecpp)48 SET(TARGET_EXTERNAL_LIBRARIES collada14dom xml2 pcrecpp) 49 49 ELSE(COLLADA_USE_STATIC) 50 SET(TARGET_EXTERNAL_LIBRARIES collada _dom_shared collada_dae_sharedxml2)50 SET(TARGET_EXTERNAL_LIBRARIES collada14dom xml2) 51 51 ENDIF(COLLADA_USE_STATIC) 52 52 OpenSceneGraph/trunk/src/osgPlugins/dae/daeRGeometry.cpp
r5465 r8282 312 312 osg::DrawArrayLengths* dal = new osg::DrawArrayLengths( GL_POLYGON ); 313 313 314 domPRef p = (domP*)(daeElement*)domP::_Meta->create(); //I don't condone creating elements like this but I don't care 314 //domPRef p = (domP*)(daeElement*)domP::_Meta->create(); //I don't condone creating elements like this but I don't care 315 domPRef p = (domP*)domP::registerElement(*dae)->create().cast(); 315 316 //if it created properly because I never want it as part of the document. Its just a temporary 316 317 //element to trick the importer into loading polylists easier. OpenSceneGraph/trunk/src/osgPlugins/dae/daeRMaterials.cpp
r7664 r8282 616 616 if ( dImg->getInit_from() != NULL ) 617 617 { 618 // daeURI uri = dImg->getInit_from()->getValue(); 618 619 dImg->getInit_from()->getValue().validate(); 619 620 620 if ( std::string( dImg->getInit_from()->getValue().getProtocol() ) == std::string( "file" ) ) 621 621 { 622 unsigned int bufSize = 1; //for the null char 623 if ( dImg->getInit_from()->getValue().getFilepath() != NULL ) 624 { 625 bufSize += strlen( dImg->getInit_from()->getValue().getFilepath() ); 626 } 627 if ( dImg->getInit_from()->getValue().getFile() != NULL ) 628 { 629 bufSize += strlen( dImg->getInit_from()->getValue().getFile() ); 630 } 631 char *path = new char[bufSize+1]; 632 if ( !dImg->getInit_from()->getValue().getPath( path, bufSize ) ) 633 { 634 osg::notify( osg::WARN ) << "Unable to get path from URI." << std::endl; 635 return NULL; 636 } 637 622 //unsigned int bufSize = 1; //for the null char 623 //bufSize += dImg->getInit_from()->getValue().pathDir().size(); 624 //bufSize += dImg->getInit_from()->getValue().pathFile().size(); 625 std::string path = dImg->getInit_from()->getValue().pathDir()+ 626 dImg->getInit_from()->getValue().pathFile(); 627 // remove space encodings 628 // 629 path = cdom::uriToNativePath(path); 630 if(path.empty()) 631 { 632 osg::notify( osg::WARN ) << "Unable to get path from URI." << std::endl; 633 return NULL; 634 } 638 635 #ifdef WIN32 639 636 // If the path has a drive specifier or a UNC name then strip the leading / 640 c har* filename;637 const char* filename =path.c_str(); 641 638 if ((path[2] == ':') || ((path[1] == '/') && (path[2] == '/'))) 642 filename= path+1;643 else644 filename = path;639 ++filename;// = path+1; 640 // else 641 // filename = path; 645 642 #else 646 c har* filename = path;643 const char* filename = path.c_str(); 647 644 #endif 648 649 645 img = osgDB::readImageFile( filename ); 650 646 … … 652 648 653 649 //Moved this below the osg::notify - Parag, 24/7/2007 654 delete [] path;650 //delete [] path; 655 651 656 652 OpenSceneGraph/trunk/src/osgPlugins/dae/daeWMaterials.cpp
r7860 r8282 100 100 domImage::domInit_from *imgif = daeSafeCast< domImage::domInit_from >( img->createAndPlace( "init_from" ) ); 101 101 std::string fileURI = ReaderWriterDAE::ConvertFilePathToColladaCompatibleURI(osgDB::findDataFile(osgimg->getFileName())); 102 daeURI dd(fileURI.c_str() );102 daeURI dd(*dae, fileURI);//fileURI.c_str() ); 103 103 imgif->setValue( dd ); 104 104 // The document URI should contain the canonical path it was created with OpenSceneGraph/trunk/src/osgPlugins/dae/daeWriter.cpp
r7664 r8282 25 25 daeWriter::daeWriter( DAE *dae_, const std::string &fileURI, bool _usePolygons, bool GoogleMode ) : osg::NodeVisitor( TRAVERSE_ALL_CHILDREN ), 26 26 dae(dae_), 27 rootName(*dae_), 27 28 usePolygons (_usePolygons), 28 29 m_GoogleMode(GoogleMode)
