Hi Marcus,
Clarification:
Does not work:
- addLoadRoot("c:/beep");
- read("boop/usingbar.wrl");
ok the ImageFileHandler looks for a relative texture "../foo/bar.jpg",
but the base file is internally (only with the default PathHandler) set
to "boop/usingbar.wrl" so it can't find the relative texture. Actually
it should be set to "c:/beep/boop/usingbar.wrl"
If you use your own PathHandler you can do the following:
const char *fileName = "boop/usingbar.wrl";
PathHandler *file_path_handler = new PathHandler;
file_path_handler->push_frontCurrentDir();
file_path_handler->push_backPath("D:/beep");
// get the full path "c:/beep/boop/usingbar.wrl"
std::string base_file = file_path_handler->findFile(fileName);
file_path_handler->setBaseFile(base_file.c_str());
SceneFileHandler::the().setPathHandler(file_path_handler);
scene = SceneFileHandler::the().read(fileName, NULL);
but I also changed the default handler behavior so this should work now
correctly:
SceneFileHandler::the().getPathHandler()->push_backPath("D:/beep");
scene = SceneFileHandler::the().read("boop/usingbar.wrl", NULL);
many thanks for the bug report,
Andreas
Works:
- addLoadRoot("c:/beep/boop");
- read("usingbar.wrl");
/Marcus
Marcus Lindblom wrote:
I've done some more searching, and the problem appears to be image
urls having "../foo/bar.jpg" stuff, when loading the file
"c:/beep/boop/usingbar.wrl" having "c:/beep" in the pathhandler.
Then the ImageFileHandler fails to parse the file type correctly.
Loading from boop (i.e. issuing that path to the pathhandler) solves
the problem.
Tricky...
/Marcus
P.S. Pardon the silly example names, I've had a busy day... :)
Marcus Lindblom wrote:
Not this week, it's time for beer right now. 8-D
I'll get on it on monday and see if I can find anything else that
pinpoints this issue a bit more, otherwise I'll put the stuff on the
web for you.
Thanks for looking into it!
/Marcus
Andreas Zieringer wrote:
Hi Marcus,
just tried it with a much longer pathname than yours this worked
fine for me. Can you upload your file somewhere so we can reproduce
this?
Andreas
(Lots of posts this day. Hope you don't mind too much .. ;)
Hi again,
I have noticed some strange bug when loading files. If the path too
long, then things go wrong (textures disappear and/or no polygons
loaded).
Loading a file such as
'C:\Misc\Styx\thorax\Heart_20050825\Parts_heart\r_atrium.wrl' does
not work in OpenSG (1.4), OSGSceneviewer (1.4) or VRED (0.97).
However, 'C:\Temp\Heart_20050825\Parts_heart\r_atrium.wrl' does.
Also, if I load a incorrect file in vred, I can't load a correct
file without restarting.
I suspect a buffer-overrun in the path length, especially if the
vrml-file refers textures (i.e. ../images/aorta.jpg is the case in
the above file).
I couldn't find any bug on sourceforge, but I know there's been
some postings on path handling and such, so someone might have
looked at this.
Can anyone confirm/deny this?
Best Regards,
/Marcus
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams *
Testing & QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams *
Testing & QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing
& QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing
& QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
--
Andreas Zieringer [EMAIL PROTECTED]
Fraunhofer IGD - A4 phone +49 (0)6151 155 289
Fraunhoferstr. 5 fax +49 (0)6151 155 196
D-64283 Darmstadt www.igd.fhg.de/www/igd-a4
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users