Announcement

Collapse
No announcement yet.

script to fix near white wirecolors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • script to fix near white wirecolors

    White wire colors are such a pain (so are mid grey ones) because it looks like the object is selected when it really isn't. Same reason I hate it when people use yellow in Rhino.

    I was going to make it myself, but don't have skills to do it quickly enough to make it worth it for me.

    What I was hoping to do is be able to select all wire colors, excluding black, where the saturation is low, then automatically change them a saturated color. This should eliminate grey and white.

    The script would be cool if the user could define the range, but I'd be fine without that control. If I made it myself I wouldn't put that in. I don't think it would be worth the extra effort to put it in. Then again....I'm not much of a scripter.


    Anyone have interest in this? I keep getting files where people are using 15 different shades of near white. It's a pain to get them all, but if I get the file from someone else, it is probably messy enough that I don't know which parts are where until I see what is selecting.

  • #2
    Does this work for you? Select the objects you want to change (or all) and go...



    Code:
    rollout ro_recolor "reColor Wireframes" width:327 height:121
    (
        colorPicker cp1 "" pos:[236,20] width:61 height:35 enabled:false color:(color 255 255 255) title:""
        button btn_reColor "reColor Wireframes" pos:[29,77] width:269 height:32
        slider sld_colorTH "Brightness Threshold" pos:[27,18] width:204 height:44 range:[0,100,100] type:#float
        label lbl_TH "255" pos:[241,56] width:50 height:19
        
        on btn_reColor pressed do
        for i in selection do 
            (
            if i.wirecolor.value>=sld_colorTH.value*2.55 then 
                (
                newsat=i.wirecolor.s+(255-i.wirecolor.s)/2
                newcolor=i.wirecolor 
                newcolor.s=newsat
                i.wirecolor=newcolor
                )
            )
        
        on sld_colorTH changed val do
        (
        cp1.color.red=sld_colorTH.value*2.55
        cp1.color.green=sld_colorTH.value*2.55
        cp1.color.blue=sld_colorTH.value*2.55
        lbl_TH.text=((sld_colorTH.value*2.55) as integer)as string
        )
    )
    
    Createdialog ro_recolor 327 122 modal:false
    Attached Files
    Last edited by dlparisi; 11-11-2009, 07:10 PM.
    www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.

    Comment


    • #3
      hey, killer.
      that works good enough for what I was looking to have.

      Thanks!!!

      Comment

      Working...
      X