t3du - Fix World Errors

This commit is contained in:
2025-09-19 19:25:30 +00:00
parent aedc2783ab
commit 88418c06c3

View File

@ -1,5 +1,7 @@
package leenkx.logicnode; package leenkx.logicnode;
import iron.data.SceneFormat;
class SetWorldNode extends LogicNode { class SetWorldNode extends LogicNode {
public function new(tree: LogicTree) { public function new(tree: LogicTree) {
@ -10,25 +12,6 @@ class SetWorldNode extends LogicNode {
var world: String = inputs[1].get(); var world: String = inputs[1].get();
if (world != null){ if (world != null){
//check if world shader data exists
var file: String = 'World_'+world+'_data';
#if lnx_json
file += ".json";
#elseif lnx_compress
file += ".lz4";
#else
file += '.lnx';
#end
var exists: Bool = false;
iron.data.Data.getBlob(file, function(b: kha.Blob) {
if (b != null) exists = true;
});
assert(Error, exists == true, "World must be either associated to a scene or have fake user");
iron.Scene.active.raw.world_ref = world; iron.Scene.active.raw.world_ref = world;
var npath = leenkx.renderpath.RenderPathCreator.get(); var npath = leenkx.renderpath.RenderPathCreator.get();
npath.loadShader("shader_datas/World_" + world + "/World_" + world); npath.loadShader("shader_datas/World_" + world + "/World_" + world);