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,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;
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										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