sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Texture.size= ??

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 317 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      avariant
      last edited by

      I'm having a bit of an issue with texture size.

      I'm changing a material's texture by "material.texture=blah\blah\filename.jpg"
      Works fine, except:
      If the material has a texture previously, that texture has a real world dimension, something like 1' x 6". When I apply the new texture,
      a) the SU material dialog shows the dimensions correctly (if it's a square image, it's like 10" x 10"),
      b) the view, however, shows the texture using the exact same dimensions as the texture before, even if the aspect ratio was totally different. As soon as I type in the SU material dialog, the view corrects itself, but I can't seem to get the view to change by any ruby command.

      I've tried "texture.size=x" and "texture.size=[x, y]". These both work to change the actual values, and are visible in the material dialog, but the 3D view doesn't reflect the change of dimension until I interact with it using the SU dialogs or tools.

      Any thoughts? Any way I can get the texture to force a change?

      1 Reply Last reply Reply Quote 0
      • T Offline
        tomasz
        last edited by

        Hi Avariant,

        Have you tried view.invalidate ?

        Tomasz

        Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

        1 Reply Last reply Reply Quote 0
        • A Offline
          avariant
          last edited by

          I have. It didn't have any effect. A previous post here implied that invalidate only works somehow in the context of a tool. Even if it did work outside of a tool, I don't think it would help here; you can use the mouse to move the 3D view around as much as you want (which assumably refreshes and invalidates the view repeatedly) and it doesn't fix it. So it's not an issue with updating the display, but more somehow updating the material, visually. As soon as you modify the geometry or make changes in the material dialog, the texture updates correctly, but not until then.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement