With the introduction of transparency to Rhino colors in V7, the RhinoScript methods that deal with color are no longer reliable. Not being able to set the transparency is one thing (I don’t think there is a way, right?), but as soon as there is a transparency in a color, getting that color also does not work (Rhino returns some negative long numbers).
For example, make 2 objects, one with a transparent color. Then try to match that color to another object via sample script below (it does not work):
Is there any hope to update RS color-related methods to work properly with transparencies and RGBA colors? Some of the RS-based tools are no longer working well with colors because of that.
Although I haven’t been able to repeat this. I can see why this could happen. I’ll see if I can tune this up.
thanks for checking, in fact yesterday I was testing this on Layers and for some reason wrote here a sample for Objects. Now indeed when I try this script on Objects, the color, even with transparency works if I get it from Object A and apply to Object B.
But the same is not true for Layers for some reason.
I try this: make 2 layers, use snippet below:
L1 = Rhino.GetLayer()
C1 = Rhino.LayerColor(L1)
L2 = Rhino.GetLayer()
Call Rhino.LayerColor(L2, C1)
If the 1st Layer color is, lets say Red, no transparency, all works OK, but If I add some transparency to it, the 2nd layer color becomes just white via this script. Is that something you see as well?
Also, do you think it would be possible to allow setting/getting the color transparency parameter via RhinoScript somehow?
I was trying to see and figure out which methods are/may be affected by this change, and the list is relatively shot:
GetColor (currently does not show the transparency color picker)
Is there a way to work with RGBa values in RhinoScript / VBScript in general? I was hoping there would be a way to take advantage of this new addition is updating some of our tools, in particular setting transparency in TextDot colors as we use them as the tools UI elements.
With the changes I’ve already made, these work as expected.
How about this?
Looks promising, can’t wait to give it a try…
All works as expected, thanks again!
I have noticed that the changes you made are not added to the RS Help file (New methods and enhanced method) / and the RS Editor syntax autocomplete. Would it make sense to keep the docs up to date?
As I am still working from home and the tools I need to generate .chm files are on a different system on our Seattle office, this will have to wait.