a few minor robustness improvements
parent
0fff79af57
commit
423ffd59dd
|
@ -1054,8 +1054,12 @@ void loadImage(ColladaContext &ctx, domImage &image) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SLog(EDebug, "Converting texture \"%s\" ..", identifier.c_str());
|
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 */
|
/* Prevent Linux/OSX fs::path handling issues for DAE files created on Windows */
|
||||||
for (size_t i=0; i<filename.length(); ++i) {
|
for (size_t i=0; i<filename.length(); ++i) {
|
||||||
if (filename[i] == '\\')
|
if (filename[i] == '\\')
|
||||||
|
|
|
@ -175,7 +175,7 @@ std::string Properties::toString() const {
|
||||||
oss << boost::get<Point>(data).toString();
|
oss << boost::get<Point>(data).toString();
|
||||||
break;
|
break;
|
||||||
case ETransform:
|
case ETransform:
|
||||||
oss << boost::get<Transform>(data).toString();
|
oss << indent(boost::get<Transform>(data).toString());
|
||||||
break;
|
break;
|
||||||
case ESpectrum:
|
case ESpectrum:
|
||||||
oss << boost::get<Spectrum>(data).toString();
|
oss << boost::get<Spectrum>(data).toString();
|
||||||
|
|
|
@ -411,6 +411,7 @@ void RenderSettingsDialog::apply(SceneContext *ctx) {
|
||||||
Properties sensorProps = oldSensor->getProperties();
|
Properties sensorProps = oldSensor->getProperties();
|
||||||
|
|
||||||
if (oldSensor->getClass()->derivesFrom(MTS_CLASS(PerspectiveCamera))) {
|
if (oldSensor->getClass()->derivesFrom(MTS_CLASS(PerspectiveCamera))) {
|
||||||
|
sensorProps.removeProperty("focalLength");
|
||||||
sensorProps.setString("fovAxis", "y", false);
|
sensorProps.setString("fovAxis", "y", false);
|
||||||
sensorProps.setFloat("fov",
|
sensorProps.setFloat("fov",
|
||||||
static_cast<const PerspectiveCamera *>(oldSensor.get())->getYFov(), false);
|
static_cast<const PerspectiveCamera *>(oldSensor.get())->getYFov(), false);
|
||||||
|
|
Loading…
Reference in New Issue