How to add own display settings in Rhino 6?


(Peter Salzmann) #1

Hi!

In Rhino 5 I added a new display setting to my C++ PlugIn. Unfortunately the same code in Rhino 6 seems to have no effect. Here the code snippet:

// I have a new UUID CS_DisplayVariantUUID created before this...
   DisplayAttrsMgrListDesc *pAttrMgrDescCyberstrakDisplay = CRhinoDisplayAttrsMgr::FindDisplayAttrsDesc(CS_DisplayVariantUUID);

   if (!pAttrMgrDescCyberstrakDisplay)
      pAttrMgrDescCyberstrakDisplay = CRhinoDisplayAttrsMgr::AppendNewEntry(true, true, true);
.
.
.
   // try to modify background color
   pAttrMgrDescCyberstrakDisplay->m_pAttrs->m_eFillMode        = FBFM_SOLID_COLOR;
   pAttrMgrDescCyberstrakDisplay->m_pAttrs->m_SolidColor       = ON_Color(70, 60, 80);
.
.
.
   // update attribute manager
   bool bSuccess = CRhinoDisplayAttrsMgr::UpdateAttributes(*pAttrMgrDescCyberstrakDisplay);

I receive bSuccess = true , but the display mode does not appear in the Rhino View Menu like in Rhino 5. While I was able to find my own display mode in the Rhino 5 registry, I do not see it for Rhino 6.

Does it work differently in Rhino 6 ?

Thanks and best regards

Peter


(Nathan 'jesterKing' Letwory) #2

You probably need to save the profile still. Check out the realtime renderer integration sample code here:

Most specifically line 162:


(Peter Salzmann) #3

Thanks, adding this line made it!
I still wonder, why it did work in Rhino 5…

Btw, where is the ProfileContext stored in Rhino 6? I did a search in the registry, where I found it in rhino 5 but it did not show up.

Best

Peter


(Nathan 'jesterKing' Letwory) #4

This is no longer in the registry, but an XML file under %APPDATA%\McNeel\ somewhere.


(Peter Salzmann) #5

Hi Nathan,
another question: Is there a call to find out, which of the advanced display settings is currently the active one?
E.g. instead of

DisplayAttrsMgrListDesc *pMyAttrMgrDesc = CRhinoDisplayAttrsMgr::FindDisplayAttrsDesc(MyDisplayModeUUID);

a call like

DisplayAttrsMgrListDesc *pCurrAttrMgrDesc = CRhinoDisplayAttrsMgr::FindCurrentDisplayAttrsDesc();

Many thanks
Peter


(Nathan 'jesterKing' Letwory) #6

Ask the active view (CRhinoView) for its DisplayAttributes. The CDisplayPipelineAttributes instance gives you the UUID to query with.


(Peter Salzmann) #7

Yes, it works.
Thanks you again for the quick response.

Best
Peter