Migrate.exe crash


#1

Hi,

I try to migrate my plugin from Rhino5 to Rhino6.
I call the tool “migrate.exe” you provided and “migrate.exe” crashed.
Noname0
Noname
Why?
Help me to fix the problem.

Kind Regards,
Vaker


(Dale Fugier) #2

Hi @Vaker,

Do the manual migration instructions work for you?

– Dale


#3

Hi Dale,

I will try manual steps.
Thank you

Kind Regards,
Vaker


#4

Hi @dale ,

When I finished all manual steps, I still compile failed.

ON::display_mode CRhinoObjectManager::GetRhinoDisplayMode()
{
CRhinoView *view=RhinoApp().ActiveView();
return view->Viewport().DisplayMode();
}

How to change for Rhino 6?

Is there any document which is descriptions of details for Rhino5 migrate to Rhino6?

Vaker


(Nathan 'jesterKing' Letwory) #5

What is the compile error?


#6

Hi @nathanletwory ,

The compile error as below:
SP173110-05

Vaker


(Nathan 'jesterKing' Letwory) #7

ON::display_mode no longer exists. To get the display mode of the active view you ask on the CRhinoViewport for its ON_3dmView (through View()) and from it you get m_display_mode_id. This ID you can compare against members of ON_StandardDisplayModeId.

Note that in your code you also should use ActiveViewport() or MainViewport() instead of the deprecated Viewport().

CRhinoView *vw = RhinoApp().ActiveView();
ON_UUID dispm_id = vw->ActiveViewport().View().m_display_mode_id;
bool is_rendered = ON_StandardDisplayModeId::Rendered == dispm_id;

Note that you can use ToV3DisplayMode on ON_StandardDisplayModeId, that gives you a ON::v3_display_mode, which corresponds to your old ON::display_mode case.


#8

Hi @nathanletwory,

Thanks for your help.
I changed code as you say and fixed the compile error.

I have another error as below:
The function “EnableGhostedShade()” is undefined.
SP173110-11

Vaker


(Nathan 'jesterKing' Letwory) #9

@Vaker, sorry, I don’t know what happened to EnableGhostedShade(), I’ll let @dale answer that one.


(Dale Fugier) #11

Hi @Vaker,

Try this:

pView->ActiveViewport().SetDisplayMode(ON_StandardDisplayModeId::Ghosted);

– Dale


#13

Hi @dale,

How to switch enable or disable ON_StandardDisplayModeId::Ghosted?
There is another similar error:
How to switch enable or disable XrayShade?

void CRhinoObjectManager::SetGhostedShade(bool bGhosted, ON_UUID disp_mode)
{
CRhinoView *view = RhinoApp().ActiveView();
view->Viewport().SetDisplayMode(disp_mode);
view->Viewport().EnableXrayShade(false);
view->Viewport().EnableGhostedShade(bGhosted);
view->Redraw();
}

Vaker


(David Eränen) #14

Hi @Vaker,

I’m assuming this:

pView->ActiveViewport().SetDisplayMode(ON_StandardDisplayModeId::XrayShade);

Will switch to XrayShade (and disable others).

-David


#15

Hi @DavidEranen,

Thanks for your help.
I will try it.

Vaker