Set envmap when reimporting hdr file

This commit is contained in:
luboslenco
2020-07-03 17:33:17 +02:00
parent 3c10a586d3
commit 9243311bf8
+7
View File
@@ -111,6 +111,13 @@ class TabTextures {
Data.deleteImage(asset.file);
Data.getImage(asset.file, function(image: kha.Image) {
Project.assetMap.set(asset.id, image);
// Set envmap
if (asset.file.toLowerCase().endsWith(".hdr")) {
var current = @:privateAccess kha.graphics4.Graphics2.current;
if (current != null) current.end();
arm.io.ImportEnvmap.run(asset.file, image);
if (current != null) current.begin(false);
}
});
}
if (ui.button(tr("To Mask"), Left)) {