Announcement

Collapse
No announcement yet.

Texture bmp aspect ratio

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Texture bmp aspect ratio

    So I have a situation where I have a lot of images that needs to be loaded into VrayHDRI maps to be used in a scene. The problem is they are all at different aspect ratios and resolutions. In this case I can't control the aspect ratio of the textures with UV maps so I have to control it using tiling, but there's no way to do so automatically. So is there any way, with maxscript or other, to automatically calculate the aspect ratio of the loaded image and apply it to the VrayHDRI map? And if not, is this something that could be added? a simple checkbox for "keep aspect ratio" would save a lot of time.

  • #2
    A way to do this would be to write a MaxScript that creates a Bitmap object with the texture file and uses the dimensions to set the tiling parameters of VRayHDRI.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Couldn't you make a Photoshop action that converts all images to a 1:1 ratio?
      Last edited by Vizioen; 17-04-2018, 03:12 AM. Reason: broken english
      A.

      ---------------------
      www.digitaltwins.be

      Comment


      • #4
        Changing the pictures in Photoshop would defy the purpose because the aspect ratio would still be wrong and the images would be squished in 3ds Max. Unless you were to crop them down to perfect squares, but that's not really an option either. I'm looking into doing it with Maxscript, but it maybe beyond my scripting abilities at this point.

        Comment


        • #5
          If anyone is interested I managed to make a work-around. This script:
          Code:
          macroscript AspectRatio category: "ShimaStuff"
          (
              matName = sme.GetMtlInParamEditor()
              bmpName = matName.HDRIMapName
              tempBmp = openBitmap bmpName
              texHeight = tempBmp.height as float
              texWidth = tempBmp.width as float
              aspectRatio = texWidth / texHeight
              matName.coords.V_Tiling = aspectRatio
          )
          changes the tiling automatically for any map that is opened in the slate material editor. Assigning it to a shortcut made things go quite a bit faster. Not optimal, but the best I could do.

          Comment

          Working...
          X