[HDK] How to display message?

   3586   5   0
User Avatar
Member
5 posts
Joined: Nov. 2013
Offline
There is a routine for python - http://www.sidefx.com/docs/hdk11.0/hdk_soho_examples.html#HDK_SOHO_Examples_Hello2 [sidefx.com]
hou.ui.displayMessage()
however this:
HOM_Module &hou = HOM();
hou.ui().displayMessage(“test”);
doesn't work in C++.
Is it possible to print something in the way like python ones in HDK 11?
User Avatar
Member
5 posts
Joined: Nov. 2013
Offline
up
User Avatar
Staff
2638 posts
Joined: July 2005
Offline
iDev
up

I've modified the HOM example [sidefx.com] from the toolkit source to display a message.

You need to include <HOM/HOM_ui.h>

Then, just call:
hou.ui().displayMessage(“Hello world”);


Little known fact, there's a C++ interface for HOM too.

Attachments:
SOP_HOMWave.C (3.9 KB)

User Avatar
Member
5 posts
Joined: Nov. 2013
Offline
Hello, mark. In my first message i wrote:
iDev
however this:
HOM_Module &hou = HOM();
hou.ui().displayMessage(“test”);
doesn't work in C++.
It just crashes. Maybe it works in HDK 13, but not in HDK 11.1
User Avatar
Staff
2638 posts
Joined: July 2005
Offline
iDev
Hello, mark. In my first message i wrote:
iDev
however this:
HOM_Module &hou = HOM();
hou.ui().displayMessage(“test”);
doesn't work in C++.
It just crashes. Maybe it works in HDK 13, but not in HDK 11.1

Works for me in H11.1.388

Does the HOM SOP work without the modifications? It might be something else in your environment.
User Avatar
Member
7 posts
Joined: Jan. 2024
Offline
I've found that the use of `hou.ui().displayMessage()` can crash when called from a `DM_SceneRenderHook` render function.
  • Quick Links