Currently when I drop an image into the RUBE scene, it's height is set to 1meter/point and the width based on aspect ratio. Is there a way to change this behavior? For example it would be good to have a pixel to meter ratio property in the settings so that when one adds an image its size is corrected based on that.
Is it possible to get such a behavior using scripts or other facility? Otherwise now when I add an image, I must do the calculation manually.
Keeping desired image size
Re: Keeping desired image size
Got it with image drop hook script and having a pixel to meter(ptm) ratio set in world's custom properties:
Code: Select all
print("Adjusting image size");
image[] images = getDroppedImages();
for (uint i = 0; i < images.length; i++) {
image img = images[i];
img.setHeight(img.getPixelHeight() * getWorld().getCustomFloat("ptm", 1));
}