3
$\begingroup$

I need to get Pixel coordinates of a rendered image.
Here is explanation: Image Editor

In the Image Editor, I can see the coordinates in the bottom left corner by right clicking in the image. Is it possible to get the coordinates with Python? I need them to setup many crop nodes.

$\endgroup$
3
  • $\begingroup$ I want to the almost same thing: get the image pixel coordinate in image editor, is there a simple way to do this? $\endgroup$
    – Joey
    Commented May 11, 2016 at 6:07
  • 1
    $\begingroup$ You want to get the pixel coordinates of the image at the mouse cursor's location? $\endgroup$
    – TLousky
    Commented May 11, 2016 at 6:52
  • $\begingroup$ This question should state what the input is exactly that you need to convert into coordinates. $\endgroup$
    – ideasman42
    Commented May 11, 2016 at 11:34

1 Answer 1

4
$\begingroup$

It seems I found the way how to get pixel coordinates through Rendering Crop. Select a Crop Node and use the script.

enter image description here

import bpy

scene = bpy.context.scene
nodes = scene.node_tree.nodes
cropNode = nodes.active

if cropNode.type == 'CROP':
    nodes.active.min_x = scene.render.border_min_x * scene.render.resolution_x
    nodes.active.max_x = scene.render.border_max_x * scene.render.resolution_x
    nodes.active.min_y = scene.render.border_min_y * scene.render.resolution_y
    nodes.active.max_y = scene.render.border_max_y * scene.render.resolution_y
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .