LNXSDK/leenkx/blender/lnx/logicnode/renderpath/LN_create_render_target.py
2025-01-22 16:18:30 +01:00

40 lines
1.5 KiB
Python

from lnx.logicnode.lnx_nodes import *
class CreateRenderTargetNode(LnxLogicTreeNode):
"""Create a render target and set it as parameter to the specified object material.
This image can be then drawn to using `Draw To Material Image Node`. In most cases, the render target needs to be created just once.
@seeNode Get Scene Root
@seeNode Draw To Material Image Node
@input Object: Object whose material parameter should change. Use `Get Scene Root` node to set parameter globally.
@input Per Object:
- `Enabled`: Set material parameter specific to this object. Global parameter will be ignored.
- `Disabled`: Set parameter globally, including this object.
@input Material: Material whose parameter to be set.
@input Node: Name of the parameter.
@input Width: Width of the render target image created.
@input Height: Height of the render target image created.
"""
bl_idname = 'LNCreateRenderTargetNode'
bl_label = 'Create Render Target'
lnx_section = 'draw'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxBoolSocket', 'Per Object')
self.add_input('LnxDynamicSocket', 'Material')
self.add_input('LnxStringSocket', 'Node')
self.add_input('LnxIntSocket', 'Width')
self.add_input('LnxIntSocket', 'Height')
self.add_output('LnxNodeSocketAction', 'Out')