forked from LeenkxTeam/LNXSDK
Repe [T3DU] Update - 31f26d171bba0355ce2a77031e3aad4c64dbc7e9
This commit is contained in:
39
leenkx/blender/lnx/logicnode/object/LN_convex_break.py
Normal file
39
leenkx/blender/lnx/logicnode/object/LN_convex_break.py
Normal file
@ -0,0 +1,39 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class ConvexBreakNode(LnxLogicTreeNode):
|
||||
"""Breaks a convex object."""
|
||||
|
||||
bl_idname = 'LNConvexBreakNode'
|
||||
bl_label = 'Convex Break'
|
||||
lnx_version = 1
|
||||
|
||||
def update_sockets(self, context):
|
||||
while len(self.inputs) > 2:
|
||||
self.inputs.remove(self.inputs[-1])
|
||||
|
||||
if self.property0 == 'Impact':
|
||||
self.add_input('LnxVectorSocket', 'Impact Point')
|
||||
self.add_input('LnxVectorSocket', 'Impact Normal')
|
||||
else:
|
||||
self.add_input('LnxBoolSocket', 'Random Plane')
|
||||
self.add_input('LnxVectorSocket', 'Plane')
|
||||
self.add_input('LnxFloatSocket', 'Scale UV')
|
||||
self.add_input('LnxBoolSocket', 'Flat Shading', default_value = True)
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('Impact', 'Subdivide by Impact', 'Subdivide by Impact'),
|
||||
('Plane', 'Subdivide by Plane', 'Subdivide by Plane')],
|
||||
name='', default='Impact', update=update_sockets)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxNodeSocketAction', 'True')
|
||||
self.add_output('LnxNodeSocketAction', 'False')
|
||||
self.add_output('LnxNodeSocketArray', 'Array')
|
||||
self.update_sockets(context)
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
@ -0,0 +1,14 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class GetObjectCameraDataNode(LnxLogicTreeNode):
|
||||
"""Returns the camera data of the given object."""
|
||||
bl_idname = 'LNGetObjectCameraDataNode'
|
||||
bl_label = 'Get Object Camera Data'
|
||||
lnx_section = 'props'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
|
||||
self.add_output('LnxFloatSocket', 'Camera Distance')
|
||||
self.add_output('LnxFloatSocket', 'Screen Size')
|
||||
@ -1,26 +1,42 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class GetChildNode(LnxLogicTreeNode):
|
||||
"""Returns the child of the given object by the child object's name."""
|
||||
"""Returns the child of the given object by name or by a specific type."""
|
||||
bl_idname = 'LNGetChildNode'
|
||||
bl_label = 'Get Object Child'
|
||||
lnx_section = 'relations'
|
||||
lnx_version = 1
|
||||
|
||||
def sw_update(self, context):
|
||||
self.inputs[1].hide = (self.property0 == 'By Type')
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('By Name', 'By Name', 'By Name'),
|
||||
('Contains', 'Contains', 'Contains'),
|
||||
('Starts With', 'Starts With', 'Starts With'),
|
||||
('Ends With', 'Ends With', 'Ends With'),
|
||||
],
|
||||
name='', default='By Name')
|
||||
('By Type', 'By Type', 'By Type')],
|
||||
name='Method', default='By Name', update=sw_update)
|
||||
|
||||
property1: HaxeEnumProperty(
|
||||
'property1',
|
||||
items = [('MeshObject', 'Mesh', 'MeshObject'),
|
||||
('CameraObject', 'Camera', 'CameraObject'),
|
||||
('LightObject', 'Light', 'LightObject'),
|
||||
('SpeakerObject', 'Speaker', 'SpeakerObject'),
|
||||
('DecalObject', 'Decal', 'DecalObject'),
|
||||
('ProbeObject', 'Probe', 'ProbeObject'),
|
||||
('CurveObject', 'Curve', 'CurveObject')],
|
||||
name='Type', default='MeshObject')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketObject', 'Parent')
|
||||
self.add_input('LnxStringSocket', 'Child Name')
|
||||
|
||||
self.add_output('LnxNodeSocketObject', 'Child')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
if self.property0 == 'By Type':
|
||||
layout.prop(self, 'property1')
|
||||
|
||||
@ -11,3 +11,4 @@ class GetChildrenNode(LnxLogicTreeNode):
|
||||
self.add_input('LnxNodeSocketObject', 'Parent')
|
||||
|
||||
self.add_output('LnxNodeSocketArray', 'Children')
|
||||
self.add_output('LnxIntSocket', 'Length')
|
||||
|
||||
@ -16,10 +16,16 @@ class GetObjectGeomNode(LnxLogicTreeNode):
|
||||
"""
|
||||
|
||||
bl_idname = 'LNGetObjectGeomNode'
|
||||
bl_label = 'Get Object Geometry Node'
|
||||
bl_label = 'Get Object Geometry'
|
||||
lnx_section = 'relations'
|
||||
lnx_version = 1
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('Local', 'Local', 'Local'),
|
||||
('Global', 'Global', 'Global')],
|
||||
name='', default='Local', update='')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
|
||||
@ -28,5 +34,8 @@ class GetObjectGeomNode(LnxLogicTreeNode):
|
||||
self.add_output('LnxNodeSocketArray', 'Vertices Indices')
|
||||
self.add_output('LnxNodeSocketArray', 'Vertices Material Indices')
|
||||
self.add_output('LnxNodeSocketArray', 'Vertices Face Indices')
|
||||
self.add_output('LnxDynamicSocket', 'Vertex Groups Maps')
|
||||
self.add_output('LnxNodeSocketArray', 'Vertex Groups Names')
|
||||
self.add_output('LnxDynamicSocket', 'Vertex Groups Map')
|
||||
self.add_output('LnxNodeSocketArray', 'Vertex Groups Names')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
@ -0,0 +1,16 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class GetObjectInstancedNode(LnxLogicTreeNode):
|
||||
"""Gets the object instanced from an array of LOC, ROT and SCL."""
|
||||
bl_idname = 'LNGetObjectInstancedNode'
|
||||
bl_label = 'Get Object Instanced'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
|
||||
self.add_output('LnxBoolSocket', 'Instanced', default_value=True)
|
||||
self.add_output('LnxIntSocket', 'Type')
|
||||
self.add_output('LnxIntSocket', 'Count')
|
||||
self.add_output('LnxIntSocket', 'Stride')
|
||||
self.add_output('LnxNodeSocketArray', 'Array Instanced')
|
||||
@ -0,0 +1,14 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class SetObjectShapeKeyNode(LnxLogicTreeNode):
|
||||
"""Gets shape key value of the object"""
|
||||
bl_idname = 'LNGetObjectShapeKeyNode'
|
||||
bl_label = 'Get Object Shape Key'
|
||||
lnx_section = 'props'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
self.add_input('LnxStringSocket', 'Shape Key')
|
||||
|
||||
self.add_output('LnxFloatSocket', 'Value')
|
||||
@ -0,0 +1,16 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class SampleObjectPointsNode(LnxLogicTreeNode):
|
||||
"""
|
||||
Samples points and surface normals across a mesh object using a low-discrepancy distribution.
|
||||
"""
|
||||
bl_idname = 'LNSampleObjectPointsNode'
|
||||
bl_label = 'Sample Object Points'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
self.add_input('LnxIntSocket', 'Sample')
|
||||
|
||||
self.add_output('LnxNodeSocketArray', 'Point/Normal')
|
||||
@ -0,0 +1,27 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class SetObjectInstancedNode(LnxLogicTreeNode):
|
||||
"""Sets the object instanced from an array of LOC, ROT and SCL."""
|
||||
bl_idname = 'LNSetObjectInstancedNode'
|
||||
bl_label = 'Set Object Instanced'
|
||||
lnx_version = 1
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('1', 'Loc', 'Instances use their unique position (ipos)'),
|
||||
('2', 'Loc + Rot', 'Instances use their unique position and rotation (ipos and irot)'),
|
||||
('3', 'Loc + Scale', 'Instances use their unique position and scale (ipos and iscl)'),
|
||||
('4', 'Loc + Rot + Scale', 'Instances use their unique position, rotation and scale (ipos, irot, iscl)')],
|
||||
name='', default='1', update='')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
self.add_input('LnxNodeSocketArray', 'Array Instanced')
|
||||
self.add_input('LnxBoolSocket', 'Include original', default_value=False)
|
||||
self.add_input('LnxBoolSocket', 'Dynamic Usage', default_value=False)
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
@ -18,7 +18,7 @@ class SetParentNode(LnxLogicTreeNode):
|
||||
self.add_input('LnxNodeSocketObject', 'Object')
|
||||
self.add_input('LnxNodeSocketObject', 'Parent')
|
||||
self.add_input('LnxBoolSocket', 'Keep Transform', default_value = True)
|
||||
self.add_input('LnxBoolSocket', 'Parent Inverse')
|
||||
self.add_input('LnxBoolSocket', 'Parent Inverse', default_value = True)
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ class SetVisibleNode(LnxLogicTreeNode):
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('object', 'Object', 'All object componenets visibility'),
|
||||
items = [('object', 'Object', 'All object components visibility'),
|
||||
('mesh', 'Mesh', 'Mesh visibility only'),
|
||||
('shadow', 'Shadow', 'Shadow visibility only'),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user