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

    Sketchup 7 setting opacity with ruby?

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