forked from LeenkxTeam/LNXSDK
34 lines
1.4 KiB
Python
34 lines
1.4 KiB
Python
from lnx.logicnode.lnx_nodes import *
|
|
|
|
|
|
class WriteImageNode(LnxLogicTreeNode):
|
|
"""Writes the given image to the given file. If the image
|
|
already exists, the existing content of the image is overwritten.
|
|
Aspect ratio must match display resolution ratio.
|
|
@input Image File: the name of the image, relative to `Krom.getFilesLocation()`
|
|
@input Camera: the render target image of the camera to write to the image file.
|
|
@input Width: width of the image file.
|
|
@input Height: heigth of the image file.
|
|
@input sX: sub position of first x pixel of the sub image (0 for start).
|
|
@input sY: sub position of first y pixel of the sub image (0 for start).
|
|
@input sWidth: width of the sub image.
|
|
@input sHeight: height of the sub image.
|
|
@seeNode Read File
|
|
"""
|
|
bl_idname = 'LNWriteImageNode'
|
|
bl_label = 'Write Image'
|
|
lnx_section = 'file'
|
|
lnx_version = 1
|
|
|
|
def lnx_init(self, context):
|
|
self.add_input('LnxNodeSocketAction', 'In')
|
|
self.add_input('LnxStringSocket', 'Image File')
|
|
self.add_input('LnxNodeSocketObject', 'Camera')
|
|
self.add_input('LnxIntSocket', 'Width')
|
|
self.add_input('LnxIntSocket', 'Height')
|
|
self.add_input('LnxIntSocket', 'sX')
|
|
self.add_input('LnxIntSocket', 'sY')
|
|
self.add_input('LnxIntSocket', 'sWidth')
|
|
self.add_input('LnxIntSocket', 'sHeight')
|
|
|
|
self.add_output('LnxNodeSocketAction', 'Out') |