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

    How to tell when a material is not really a material (Image)

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 2 Posters 161 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.
    • Al HartA Offline
      Al Hart
      last edited by

      When you load a raster file into SketchUp as a SketchUp "Image", SketchUp secretly creates a material for it but does not show it in the list of materials you can place on faces.

      The material (e.g. Image1) is in the list of "Sketchup.active_model.materials.each", but SketchUp does not show it in the "Materials in Model" window.

      Does anyone know how you can determine if a particular material gotten from "Sketchup.active_model.materials.each" is a real material or not?

      Al Hart

      http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
      IRender nXt from Render Plus

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        hm... that's odd. I wonder if something changed in SU7.1...

        I was messing with this earlier, before SU7.1

        Sketchup.active_model.materials.length would return the count of all materials and image-materials.

        Sketchup.active_model.materials.each would not return image-materials

        0.upto(Sketchup.active_model.materials-1) { |i| Sketchup.active_model.materials[i] } would return a full lits of materials and image-materials.

        ...but maybe I'm not remembering correctly... Will have a look at SU6 tomorrow.

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          One possible method:

          Iterate Sketchup.definitions and look for Image definitions. Then investigate the material of the face contained in each Image definition.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • Al HartA Offline
            Al Hart
            last edited by

            @thomthom said:

            Sketchup.active_model.materials.length would return the count of all materials and image-materials.

            Sketchup.active_model.materials.each would not return image-materials

            That was it. Thanks.

            I put "materials.each" in my original post, but we were really using "materials.length: and "materials.at"

            @thomthom said:

            One possible method:

            Iterate Sketchup.definitions and look for Image definitions. Then investigate the material of the face contained in each Image definition.

            using materials.each will give us just what we wanted.

            Again, thanks thomthom

            Al Hart

            http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
            IRender nXt from Render Plus

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              This is something that the manual should mention. I'll add it to the list.

              Thomas Thomassen — SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              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