feat: add get image wh node

This commit is contained in:
BennyKok
2023-09-14 18:34:58 +08:00
parent ae5e2f0c36
commit f86081ab8d
+20
View File
@@ -0,0 +1,20 @@
import blender_node
class GetImageWidthHeight(blender_node.ObjectOps):
BASE_INPUT_TYPES = {
"image": ('IMAGE',),
"scale": ('FLOAT', {'default': 1.0,})
}
RETURN_TYPES = ('FLOAT', 'FLOAT',)
RETURN_NAMES = ('width', 'height',)
def blender_process(self, bpy, image, scale, **props):
height, width = image[0].shape[:2]
print(height, width)
print((width * scale, height * scale, ))
return (width * scale, height * scale, )