Does "move" GH command lose Brep colour information?

unhandled

#1

Hi all,

I am creating a custom GH component that gives as an output, amongst other things, a simple list of Breps. Those Breps are manipulated by the DrawViewportMeshes method to have their colour set. However, when it comes to moving those Breps via the “Move” native GH command, it appears that the information about the colour is lost. Is that true? Does any of you guys have a brilliant workaround solution to my problem?

Cheers!


(David Rutten) #2

Hi gulliver, when you say colour, are you referring to the fact that the geometry appears shaded, or that it has a specific RGB colour?


#3

Well, both in the end…I would like the shaded geometry (not wireframe) to
be set by default, and to have a specific colour specified by the RGB code.


(David Rutten) #4

If a brep doesn’t shade when displayed by a standard Grasshopper object, then that’s a bug. In fact we found and fixed a bug a couple of weeks ago where all subsequent breps would go unshaded, so it could well be that. What version of Rhino are you on?

The colour however is another matter altogether. Geometry in GH doesn’t come with any attributes like Rhino geometry does. No layer, no name, no colour, no dash style… just pure geometry. You cannot ‘make’ an object blue in Grasshopper. Instead, the colour of the preview is almost always a function of the selected state of the object that contains it. Selected=green, Unselected=red by default, but these can be changed.

Only certain objects draw geometry in non-standard colours, the most famous of these is the Custom Preview component whose entire purpose is to draw things differently.


#5

Dave, thanks much for the insights.
This is the workaround that I have found and that might be enough for me so far: I have turned the “Preview mesh quality” on (how do you do it programmatically?), then I have created a new output in the custom GH component for the Diffuse colour of the DisplayMaterial object and assigned both the colour and the brep to the “Custom preview” command that you were mentioning:

That should do the trick now! Thanks!
I am using Rhino 5 btw.