Update Files

This commit is contained in:
2025-01-22 16:18:30 +01:00
parent ed4603cf95
commit a36294b518
16718 changed files with 2960346 additions and 0 deletions

View File

@ -0,0 +1,15 @@
from lnx.logicnode.lnx_nodes import *
class AddObjectToGroupNode(LnxLogicTreeNode):
"""Add Object to a collection."""
bl_idname = 'LNAddObjectToGroupNode'
bl_label = 'Add Object to Collection'
lnx_section = 'collection'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'Collection')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,21 @@
import bpy
from lnx.logicnode.lnx_nodes import *
class GroupNode(LnxLogicTreeNode):
"""Returns the objects of the given collection as an array.
@seeNode Get Collection"""
bl_idname = 'LNGroupNode'
bl_label = 'Collection'
lnx_section = 'collection'
lnx_version = 1
property0: HaxePointerProperty('property0', name='', type=bpy.types.Collection)
def lnx_init(self, context):
self.add_output('LnxNodeSocketArray', 'Array')
def draw_buttons(self, context, layout):
layout.prop_search(self, 'property0', bpy.data, 'collections', icon='NONE', text='')

View File

@ -0,0 +1,15 @@
from lnx.logicnode.lnx_nodes import *
class CreateCollectionNode(LnxLogicTreeNode):
"""Creates a collection."""
bl_idname = 'LNAddGroupNode'
bl_label = 'Create Collection'
lnx_section = 'collection'
lnx_version = 2
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'Collection')
self.add_input('LnxNodeSocketArray', 'Objects')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
class GetGroupNode(LnxLogicTreeNode):
"""Searches for a collection of objects with the given name and
outputs the collection's objects as an array, if found.
@seeNode Collection"""
bl_idname = 'LNGetGroupNode'
bl_label = 'Get Collection'
lnx_section = 'collection'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxStringSocket', 'Name')
self.add_output('LnxNodeSocketArray', 'Objects')

View File

@ -0,0 +1,14 @@
from lnx.logicnode.lnx_nodes import *
class GetObjectGroupNode(LnxLogicTreeNode):
"""Get Object collection."""
bl_idname = 'LNGetObjectGroupNode'
bl_label = 'Get Object Collection'
lnx_section = 'collection'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketObject', 'Object')
self.add_output('LnxNodeSocketArray', 'Collection')
self.add_output('LnxIntSocket', 'Length')

View File

@ -0,0 +1,10 @@
from lnx.logicnode.lnx_nodes import *
class ActiveSceneNode(LnxLogicTreeNode):
"""Returns the active scene."""
bl_idname = 'LNActiveSceneNode'
bl_label = 'Get Scene Active'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxDynamicSocket', 'Scene')

View File

@ -0,0 +1,10 @@
from lnx.logicnode.lnx_nodes import *
class SceneRootNode(LnxLogicTreeNode):
"""Returns the root object of the current scene."""
bl_idname = 'LNSceneRootNode'
bl_label = 'Get Scene Root'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxNodeSocketObject', 'Object')

View File

@ -0,0 +1,11 @@
from lnx.logicnode.lnx_nodes import *
class GlobalObjectNode(LnxLogicTreeNode):
"""Gives access to a global object which can be used to share
information between different traits."""
bl_idname = 'LNGlobalObjectNode'
bl_label = 'Global Object'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxNodeSocketObject', 'Object')

View File

@ -0,0 +1,14 @@
from lnx.logicnode.lnx_nodes import *
class RemoveGroupNode(LnxLogicTreeNode):
"""Removes the given collection from the scene."""
bl_idname = 'LNRemoveGroupNode'
bl_label = 'Remove Collection'
lnx_section = 'collection'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'Collection')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,15 @@
from lnx.logicnode.lnx_nodes import *
class RemoveObjectFromGroupNode(LnxLogicTreeNode):
"""Remove Object from a collection."""
bl_idname = 'LNRemoveObjectFromGroupNode'
bl_label = 'Remove Object from Collection'
lnx_section = 'collection'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'Collection')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,12 @@
from lnx.logicnode.lnx_nodes import *
class RemoveActiveSceneNode(LnxLogicTreeNode):
"""Removes the active scene."""
bl_idname = 'LNRemoveActiveSceneNode'
bl_label = 'Remove Scene Active'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,14 @@
from lnx.logicnode.lnx_nodes import *
class SetSceneNode(LnxLogicTreeNode):
"""Sets the active scene."""
bl_idname = 'LNSetSceneNode'
bl_label = 'Set Scene Active'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Scene')
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxNodeSocketObject', 'Root')

View File

@ -0,0 +1,58 @@
import bpy
from lnx.logicnode.lnx_nodes import *
class SpawnCollectionNode(LnxLogicTreeNode):
"""
Spawns a new instance of the selected `collection` from the given `scene`.
If the `scene` is empty or null, the current active scene is used. Each spawned
instance has an empty owner object to control the instance as a whole (like Blender
uses it for collection instances).
@input Scene: Scene in which the collection belongs.
@input Collection: Collection to be spawned.
@input In: activates the node.
@input Transform: the transformation of the instance that should be
spawned. Please note that the collection's instance offset is
also taken into account.
@output Out: activated when a collection instance was spawned. It is
not activated when no collection is selected.
@output Top-Level Objects: all objects in the last spawned
collection that are direct children of the owner object of the
collection's instance.
@output All Objects: all objects in the last spawned collection.
@output Owner Object: The owning object of the last spawned
collection's instance.
"""
bl_idname = 'LNSpawnCollectionNode'
bl_label = 'Spawn Collection'
lnx_section = 'collection'
lnx_version = 2
property0: HaxePointerProperty('property0', name='Collection', type=bpy.types.Collection)
property1: HaxePointerProperty(
'property1',
type=bpy.types.Scene, name='Scene',
description='The scene from which to take the object')
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Transform')
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxNodeSocketArray', 'Top-Level Objects')
self.add_output('LnxNodeSocketArray', 'All Objects')
self.add_output('LnxNodeSocketObject', 'Owner Object')
def draw_buttons(self, context, layout):
layout.prop_search(self, 'property1', bpy.data, "scenes")
layout.prop_search(self, 'property0', bpy.data, 'collections', icon='NONE', text='')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
return NodeReplacement.Identity(self)

View File

@ -0,0 +1,15 @@
from lnx.logicnode.lnx_nodes import *
class SpawnSceneNode(LnxLogicTreeNode):
"""Spawns the given scene."""
bl_idname = 'LNSpawnSceneNode'
bl_label = 'Spawn Scene'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Scene')
self.add_input('LnxDynamicSocket', 'Transform')
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxNodeSocketObject', 'Root')

View File

@ -0,0 +1,5 @@
from lnx.logicnode.lnx_nodes import add_node_section
add_node_section(name='default', category='Scene')
add_node_section(name='traits', category='Scene')
add_node_section(name='collection', category='Scene')