forked from LeenkxTeam/LNXSDK
merge upstream
This commit is contained in:
21
leenkx/Sources/leenkx/logicnode/SetLightShadowNode.hx
Normal file
21
leenkx/Sources/leenkx/logicnode/SetLightShadowNode.hx
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -280,6 +280,10 @@ class DebugConsole extends Trait {
|
|||||||
|
|
||||||
function drawObjectNameInList(object: iron.object.Object, selected: Bool) {
|
function drawObjectNameInList(object: iron.object.Object, selected: Bool) {
|
||||||
var _y = ui._y;
|
var _y = ui._y;
|
||||||
|
|
||||||
|
if (object.parent.name == 'Root')
|
||||||
|
ui.text(object.uid+'_'+object.name+' ('+iron.Scene.active.raw.world_ref+')');
|
||||||
|
else
|
||||||
ui.text(object.uid+'_'+object.name);
|
ui.text(object.uid+'_'+object.name);
|
||||||
|
|
||||||
if (object == iron.Scene.active.camera) {
|
if (object == iron.Scene.active.camera) {
|
||||||
|
@ -543,7 +543,9 @@ class LeenkxExporter:
|
|||||||
if psys.settings.instance_object is None or psys.settings.render_type != 'OBJECT' or not psys.settings.instance_object.lnx_export:
|
if psys.settings.instance_object is None or psys.settings.render_type != 'OBJECT' or not psys.settings.instance_object.lnx_export:
|
||||||
return
|
return
|
||||||
|
|
||||||
for mod in bpy.data.objects[out_object['name']].modifiers:
|
for obj in bpy.data.objects:
|
||||||
|
if obj.name == out_object['name']:
|
||||||
|
for mod in obj.modifiers:
|
||||||
if mod.type == 'PARTICLE_SYSTEM':
|
if mod.type == 'PARTICLE_SYSTEM':
|
||||||
if mod.particle_system.name == psys.name:
|
if mod.particle_system.name == psys.name:
|
||||||
if not mod.show_render:
|
if not mod.show_render:
|
||||||
@ -636,7 +638,10 @@ class LeenkxExporter:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
for slot in bobject.material_slots:
|
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
|
continue
|
||||||
if slot.material.name.endswith(variant_suffix):
|
if slot.material.name.endswith(variant_suffix):
|
||||||
continue
|
continue
|
||||||
|
14
leenkx/blender/lnx/logicnode/light/LN_set_light_shadow.py
Normal file
14
leenkx/blender/lnx/logicnode/light/LN_set_light_shadow.py
Normal file
@ -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')
|
Reference in New Issue
Block a user