Script to make 2D plane same ratio as texture size

Technical questions, etc..
Post Reply
User avatar
Emmanuel
Chief Warrant Officer
Posts: 651
Joined: 14 Jun 2009, 06:47

Script to make 2D plane same ratio as texture size

Post by Emmanuel »

As you know, TrueSpace can be a great 2D animation program.



I am doing more and more video animations using 2D textures with transparent background on simple 2D planes, and moving them in the 3D space.
BTW the video just above as example is about my daughter's wedding. Time is passing ;) ...


Of course 2D planes in trueSpace must have the exact same X and Y ratio of the texture applied on it, otherwise the picture will be distorted.

The step of creating these planes is laborious though, because I have to check the picture size in pixels, like 825 width and 306 tall, and set the same X and Y dimension in trueSpace, like 8.25 meter X and 3.06 meter Y, then resize the plane to fit my camera frame...

To speed-up that workflow I would like to automat the process of creating 2D slides. Perhaps a Python script could to the job.
The script should read the bitmap texture size in pixels applied on a selected plane object, then automatically resize the X size of the plane to make X and Y dimensions fit the same height and width pixels ratio.

Is there still some Python specialists around ?
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Script to make 2D plane same ratio as texture size

Post by trueBlue »

Something like this?
Default image 512x512.png
.
Second Image.png
.
Edit: I will see if I can update this material to Alpha Texture and Image Texture
.
Attachments
Image Ratio Resizer.RsObj
(128.31 KiB) Downloaded 37 times
User avatar
Emmanuel
Chief Warrant Officer
Posts: 651
Joined: 14 Jun 2009, 06:47

Re: Script to make 2D plane same ratio as texture size

Post by Emmanuel »

trueBlue wrote: 16 Nov 2023, 22:07 Something like this?
Exactly !
TrueBlue, you are my trueSpace wizard ! :bananaguitar:

Thanks a lot for this must_have new tool.

:worship:
User avatar
trueBlue
Captain
Posts: 5216
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Script to make 2D plane same ratio as texture size

Post by trueBlue »

Emmanuel wrote: 17 Nov 2023, 09:07
trueBlue wrote: 16 Nov 2023, 22:07 Something like this?
Exactly !
TrueBlue, you are my trueSpace wizard ! :bananaguitar:

Thanks a lot for this must_have new tool.

:worship:
I think the author that wrote this script is Glen Gordon
Here is a different version with a Diffuse, Alpha, and Normal material
You have to use the Image Ratio Resizer's panel to change the DiffuseTexture and the Material Editor for Alpha and Normal
Image Ratio Resizer Alpha.png
.
Attachments
Image Ratio Resizer.RsObj
(73.64 KiB) Downloaded 32 times
Post Reply