Text blocks are showing up blank on layout mode but not on sequencer mode. Scripting is for events: OnOnline and OnPreviewRender. As far as scripting all the math on VB to adjust the texture coordinates, I have never really done math on there so not quite sure how I would do that. I would assume that it requires text values to be integers instead.
Original Message:
Sent: 03-25-2024 11:56
From: Simon Redmile
Subject: Maintaining Aspect Ratio of Images Using Visual Logic
Those text blocks are showing as blank.
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
Original Message:
Sent: 03-25-2024 11:48
From: Jackson Roush
Subject: Maintaining Aspect Ratio of Images Using Visual Logic
------------------------------
Jackson Roush
XPression Designer and Programmer
Mercedes Benz Stadium
Atlanta United States
Original Message:
Sent: 03-22-2024 05:51
From: Simon Redmile
Subject: Maintaining Aspect Ratio of Images Using Visual Logic
Are you connecting it to the correct point of the multi / divide blocks?
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
Original Message:
Sent: 03-21-2024 10:27
From: Jackson Roush
Subject: Maintaining Aspect Ratio of Images Using Visual Logic
That code worked to pull the width and height values of the material. I then used those 2 numbers to calculate the aspect ratio and attempted to use visual logic to create a greater than/equal or less than 1 statement. Where if the aspect ratio was greater than or equal to 1, the ratio would be divided by 2 to get TextCordX and TextCordY would stay as 1. The inverse was done for less than 1, where TextCordY was ratio doubled and TextCordX was 1. However, in visual logic the ratio number that was calculated would not go through to the multiply and divide blocks and was getting stuck. Feels like I am just on the edge of figuring this out...
------------------------------
Jackson Roush
XPression Designer and Programmer
Mercedes Benz Stadium
Atlanta United States
Original Message:
Sent: 03-19-2024 12:42
From: Simon Redmile
Subject: Maintaining Aspect Ratio of Images Using Visual Logic
I have never done it but that sounds like the right idea. Out of interest I just did the first bit for you to see if it works as you would hope.
dim slab as xpSlabObject
dim mat as xpMaterial
dim textWidth, textHeight as xpTextObject
dim width, height as long
self.GetObjectByName("mySlab", slab)
slab.GetMaterial(0, mat)
mat.GetDimensions(width, height)
self.GetObjectByName("matWidth", textWidth)
self.GetObjectByName("matHeight", textHeight)
textWidth.Text = width
textHeight.Text = height
![](https://higherlogicdownload.s3.amazonaws.com/ROSSVIDEO/MessageImages/26911bf01f3c45799141752feb464bf4.png)
![](https://higherlogicdownload.s3.amazonaws.com/ROSSVIDEO/MessageImages/4d18e0bd7a1e4c75a37a97d3b4c56a57.png)
so the next stage would be to scale these accordingly.
I have to finish working on something so I need to get back to that so perhaps you can take it from here.
Otherwise I'll come back a bit later.
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
Original Message:
Sent: 03-19-2024 11:59
From: Jackson Roush
Subject: Maintaining Aspect Ratio of Images Using Visual Logic
What would the scripting look like using the GetDimensions method? I would assume once you pull in the values, you would assign those to a text object to be able to make adjustments in visual logic with texture coordinates.
------------------------------
Jackson Roush
XPression Designer and Programmer
Mercedes Benz Stadium
Atlanta United States
Original Message:
Sent: 03-19-2024 05:42
From: Simon Redmile
Subject: Maintaining Aspect Ratio of Images Using Visual Logic
The hard bit is reading the original sizes of the image so you can do the calculation I think.
------------------------------
Simon Redmile
Senior Graphic Programmer & Designer
Ross Video
Bristol United Kingdom
Original Message:
Sent: 03-18-2024 14:13
From: Jackson Roush
Subject: Maintaining Aspect Ratio of Images Using Visual Logic
Have you ever found a solution to do this with the material face of a slab? I would assume it would require scripting...
------------------------------
Jackson Roush
XPression Designer and Programmer
Mercedes Benz Stadium
Atlanta United States
Original Message:
Sent: 02-14-2018 01:52
From: Brian Ford
Subject: Maintaining Aspect Ratio of Images Using Visual Logic
You shouldn't need visual logic to do this.. Just set the checkbox to maintain aspect on the quad, and on the "texture coords" tab, set the Mode to "Border". Border mode will fill the outside with transparency instead of repeating the edge pixels. Depending on which version of software you have, newer versions have more options for the "maintain aspect ratio" modes.
#XPression