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!
    đź«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Sketchup 7 setting opacity with ruby?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 275 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.
    • H Offline
      HPW
      last edited by

      Hello,

      The API doc says:

      Color.alpha= is only for SketchUp 8.0 M1+

      Any other way to set opacity in Sketchup 7 with ruby?

      This does also not work:

      
      color_from_rgba = Sketchup;;Color.new(material.color.red, material.color.green, material.color.blue, 128) 
      material.color = color_from_rgba
      
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        HPW
        last edited by

        Oops, just noticed:

        
        	 material.alpha = 0.5
        
        
        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          For materials it's Material.alpha. If you are drawing polygons to the viewport using View.draw then you need Color.alpha.

          The Secrets of SketchUp’s Materials - There is a section there "Material.alpha vs Color.alpha"

          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