ksteinfeld
(Kyle Steinfeld)
April 10, 2019, 6:28pm
1
Hello, and thanks for any assistance.
I’m trying to set the colors of the two-color gradient background of a Rhino model from a Python component in Grasshopper. I’ve managed to change the fill mode to Gradient2Color, but do not see how to access/set the colors of the gradient. Simplified code below. Any guidance is much appreciated.
mode = Rhino.Display.DisplayModeDescription.GetDisplayMode(id)
mode.DisplayAttributes.FillMode = Rhino.Display.DisplayPipelineAttributes.FrameBufferFillMode.Gradient2Color
Rhino.Display.DisplayModeDescription.UpdateDisplayMode(mode)
dale
(Dale Fugier)
June 12, 2019, 10:05pm
2
Hi @ksteinfeld ,
There isn’t enough exposed on RhinoCommon do to this.
Hi @john12 ,
From a command you can do something like this:
CRhinoCommand::result CCommandTest::RunCommand(const CRhinoCommandContext& context)
{
const ON_UUID display_mode = ON_StandardDisplayModeId::Rendered;
DisplayAttrsMgrListDesc* pDisplayAttrs = CRhinoDisplayAttrsMgr::FindDisplayAttrsDesc(display_mode);
if (nullptr != pDisplayAttrs)
{
CDisplayPipelineAttributes* pAttrs = pDisplayAttrs->m_pAttrs;
if (nullptr != pAttrs)
{
pAttrs->m_eFillMode = EFrameBufferFillMode:…
I’ve added a request to the pile.
https://mcneel.myjetbrains.com/youtrack/issue/RH-53234
For now, the best you can do is script the -GradientView
command.
– Dale
brian
(Brian Gillespie)
February 26, 2020, 12:20am
3
RH-53234 is fixed in the latest Service Release