2017-03-15 12:30:14 +01:00
|
|
|
from arm.logicnode.arm_nodes import *
|
2017-03-06 02:29:03 +01:00
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class SetVisibleNode(ArmLogicTreeNode):
|
2020-10-05 19:55:56 +02:00
|
|
|
"""Sets whether the given object is visible.
|
2020-09-28 15:58:41 +02:00
|
|
|
|
|
|
|
@seeNode Get Object Visible"""
|
2017-04-04 23:11:31 +02:00
|
|
|
bl_idname = 'LNSetVisibleNode'
|
2020-09-25 00:49:21 +02:00
|
|
|
bl_label = 'Set Object Visible'
|
2020-10-27 19:44:37 +01:00
|
|
|
arm_section = 'props'
|
2020-09-13 20:43:27 +02:00
|
|
|
arm_version = 1
|
2020-09-13 20:59:48 +02:00
|
|
|
|
2020-09-13 19:11:57 +02:00
|
|
|
property0: EnumProperty(
|
2020-11-17 21:35:22 +01:00
|
|
|
items = [('object', 'Object', 'All object componenets visibility'),
|
|
|
|
('mesh', 'Mesh', 'Mesh visibility only'),
|
|
|
|
('shadow', 'Shadow', 'Shadow visibility only'),
|
2020-09-13 19:11:57 +02:00
|
|
|
],
|
2020-11-17 21:35:22 +01:00
|
|
|
name='', default='object')
|
2017-03-06 02:29:03 +01:00
|
|
|
|
|
|
|
def init(self, context):
|
2020-09-13 20:59:48 +02:00
|
|
|
super(SetVisibleNode, self).init(context)
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_input('ArmNodeSocketAction', 'In')
|
|
|
|
self.add_input('ArmNodeSocketObject', 'Object')
|
2020-09-09 21:11:49 +02:00
|
|
|
self.add_input('NodeSocketBool', 'Visible')
|
2020-11-17 21:35:22 +01:00
|
|
|
self.add_input('NodeSocketBool', 'Children', default_value=True)
|
2020-11-17 16:01:15 +01:00
|
|
|
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_output('ArmNodeSocketAction', 'Out')
|
2020-09-13 19:11:57 +02:00
|
|
|
|
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|