a few minor robustness improvements

metadata
Wenzel Jakob 2012-10-17 22:24:44 -07:00
parent 0fff79af57
commit 423ffd59dd
3 changed files with 7 additions and 2 deletions

View File

@ -1054,8 +1054,12 @@ void loadImage(ColladaContext &ctx, domImage &image) {
}
SLog(EDebug, "Converting texture \"%s\" ..", identifier.c_str());
std::string uri = image.getInit_from()->getValue().str();
std::string filename = cdom::uriToFilePath(uri);
if (filename.empty()) /* When uriToFilePath fails, try to use the path as is */
filename = uri;
std::string filename = cdom::uriToFilePath(image.getInit_from()->getValue().str());
/* Prevent Linux/OSX fs::path handling issues for DAE files created on Windows */
for (size_t i=0; i<filename.length(); ++i) {
if (filename[i] == '\\')

View File

@ -175,7 +175,7 @@ std::string Properties::toString() const {
oss << boost::get<Point>(data).toString();
break;
case ETransform:
oss << boost::get<Transform>(data).toString();
oss << indent(boost::get<Transform>(data).toString());
break;
case ESpectrum:
oss << boost::get<Spectrum>(data).toString();

View File

@ -411,6 +411,7 @@ void RenderSettingsDialog::apply(SceneContext *ctx) {
Properties sensorProps = oldSensor->getProperties();
if (oldSensor->getClass()->derivesFrom(MTS_CLASS(PerspectiveCamera))) {
sensorProps.removeProperty("focalLength");
sensorProps.setString("fovAxis", "y", false);
sensorProps.setFloat("fov",
static_cast<const PerspectiveCamera *>(oldSensor.get())->getYFov(), false);