sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    FredoBend | Powerful new bending tool for SketchUp Download

    Texture.size= ??

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 409 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

        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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better đź’—

          Register Login
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement