Files
LNXSDK/leenkx/blender/lnx/logicnode/draw/LN_draw_to_image.py

38 lines
1.6 KiB
Python

from lnx.logicnode.lnx_nodes import *
class DrawToImageNode(LnxLogicTreeNode):
"""Writes the given draw image to the given file. If the image
already exists, the existing content of the image is overwritten.
@input Image File: the name of the image
@input Color: The color that the image's pixels are multiplied with.
@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.
WARNING: Calling getPixels() on a renderTarget with non-standard non-POT dimensions
can cause a system crash. Ensure renderTarget resolution is a power of two
(e.g., 256x256) or a common standard resolution (e.g., 1920x1080).
"""
bl_idname = 'LNDrawToImageNode'
bl_label = 'Draw To Image'
lnx_section = 'draw'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'Image File')
self.add_input('LnxColorSocket', 'Color', default_value=[1.0, 1.0, 1.0, 1.0])
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')