diff --git a/leenkx/Sources/leenkx/logicnode/SetLightShadowNode.hx b/leenkx/Sources/leenkx/logicnode/SetLightShadowNode.hx new file mode 100644 index 0000000..d8bfdf7 --- /dev/null +++ b/leenkx/Sources/leenkx/logicnode/SetLightShadowNode.hx @@ -0,0 +1,21 @@ +package leenkx.logicnode; + +import iron.object.LightObject; + +class SetLightShadowNode extends LogicNode { + + public function new(tree: LogicTree) { + super(tree); + } + + override function run(from: Int) { + var light: LightObject = inputs[1].get(); + var shadow: Bool = inputs[2].get(); + + if (light == null) return; + + light.data.raw.cast_shadow = shadow; + + runOutput(0); + } +} \ No newline at end of file diff --git a/leenkx/Sources/leenkx/trait/internal/DebugConsole.hx b/leenkx/Sources/leenkx/trait/internal/DebugConsole.hx index 49a7e1f..cb66d1d 100644 --- a/leenkx/Sources/leenkx/trait/internal/DebugConsole.hx +++ b/leenkx/Sources/leenkx/trait/internal/DebugConsole.hx @@ -280,7 +280,11 @@ class DebugConsole extends Trait { function drawObjectNameInList(object: iron.object.Object, selected: Bool) { var _y = ui._y; - ui.text(object.uid+'_'+object.name); + + if (object.parent.name == 'Root') + ui.text(object.uid+'_'+object.name+' ('+iron.Scene.active.raw.world_ref+')'); + else + ui.text(object.uid+'_'+object.name); if (object == iron.Scene.active.camera) { var tagWidth = 100; diff --git a/leenkx/blender/lnx/exporter.py b/leenkx/blender/lnx/exporter.py index 2351fb5..5be20d2 100644 --- a/leenkx/blender/lnx/exporter.py +++ b/leenkx/blender/lnx/exporter.py @@ -543,11 +543,13 @@ class LeenkxExporter: if psys.settings.instance_object is None or psys.settings.render_type != 'OBJECT' or not psys.settings.instance_object.lnx_export: return - for mod in bpy.data.objects[out_object['name']].modifiers: - if mod.type == 'PARTICLE_SYSTEM': - if mod.particle_system.name == psys.name: - if not mod.show_render: - return + for obj in bpy.data.objects: + if obj.name == out_object['name']: + for mod in obj.modifiers: + if mod.type == 'PARTICLE_SYSTEM': + if mod.particle_system.name == psys.name: + if not mod.show_render: + return self.particle_system_array[psys.settings] = {"structName": psys.settings.name} pref = { @@ -636,7 +638,10 @@ class LeenkxExporter: continue for slot in bobject.material_slots: - if slot.material is None or slot.material.library is not None: + if slot.material is None: + continue + if slot.material.library is not None: + slot.material.lnx_particle_flag = True continue if slot.material.name.endswith(variant_suffix): continue diff --git a/leenkx/blender/lnx/logicnode/light/LN_set_light_shadow.py b/leenkx/blender/lnx/logicnode/light/LN_set_light_shadow.py new file mode 100644 index 0000000..fc93d28 --- /dev/null +++ b/leenkx/blender/lnx/logicnode/light/LN_set_light_shadow.py @@ -0,0 +1,14 @@ +from lnx.logicnode.lnx_nodes import * + +class SetLightShadowNode(LnxLogicTreeNode): + """Sets the shadow boolean of the given light.""" + bl_idname = 'LNSetLightShadowNode' + bl_label = 'Set Light Shadow' + lnx_version = 1 + + def lnx_init(self, context): + self.add_input('LnxNodeSocketAction', 'In') + self.add_input('LnxNodeSocketObject', 'Light') + self.add_input('LnxBoolSocket', 'Shadow') + + self.add_output('LnxNodeSocketAction', 'Out') \ No newline at end of file