professor_wm
|
professor_wm
Posted 4 Years Ago
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 3,
Visits: 25
|
Hi, starting with python API I think I have to learn a lot. However at once I get iClone to crash. I try to implement some MIDI data reading (for different issues). So I define a MIDI callback function and open the MIDI device. So far so good. Also I know that the callback receives some data, but whenever I try to call any iClone API function it crashes immediately. I assume that the callback is in a different threat and that therefore I get the crash. So the next attempt is to use a callback to a window but I cannot get the hwnd window handle. I know that Qt supports this (xyz.winId()) but I have no idea how this works with the iClone API. Anyone any idea to one of these problems? many thanks
|
Tesira
|
Tesira
Posted 4 Years Ago
|
Group: Forum Members
Last Active: Last Year
Posts: 1.3K,
Visits: 2.4K
|
hi professor_wm, have a look at this demo. It dos not crash my computer and gives the mainwindow. main_window_address = RLPy.RUi.GetMainWindow() https://wiki.reallusion.com/IC_Python_API:Screenshotting#User_Interface
Tesira
![](http://www.virtualworldsart.com/iClone/Tesirasstore.gif)
|
professor_wm
|
professor_wm
Posted 4 Years Ago
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 3,
Visits: 25
|
Hi Tesira, many thanks for your answer. However according to description this function returns => "Get the QWidget address for the main window." Which is not the window handle (hwnd). So this is not working.
|
Tesira
|
Tesira
Posted 4 Years Ago
|
Group: Forum Members
Last Active: Last Year
Posts: 1.3K,
Visits: 2.4K
|
Well the script dos show the screenshoot of the mainwindow. So it should know the mainwindow. Or look here. main_rl_dlg.SetParent(RLPy.RUi.GetMainWindow()) https://wiki.reallusion.com/IC_Python_API:RLPy_RIDialog But I also have problems with crashes of the event handler and the dialog event handler. So good luck for you. Tesira
![](http://www.virtualworldsart.com/iClone/Tesirasstore.gif)
|
professor_wm
|
professor_wm
Posted 4 Years Ago
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 3,
Visits: 25
|
"RLPy.RUi.GetMainWindow()" does not return the window handle. It returns the lets say Qt window handler or object. So this does not work. However I found out that xyz.winId() is working and returns the HWND. So the code would be: mainWindow = wrapInstance(int(RLPy.RUi.GetMainWindow()), QtWidgets.QMainWindow) mainWindowHWND = mainwindow.winId() The simple truth is in my code I wrote it wrong ".WinId()" instead of ".winId()" and did not notice it even when checking it. OMG what a binners mistake I could not believe it when I saw it. Many thanks again for your answers.
|
Tesira
|
Tesira
Posted 4 Years Ago
|
Group: Forum Members
Last Active: Last Year
Posts: 1.3K,
Visits: 2.4K
|
Great to hear. Thanks to you. So I have also learned a few things. Tesira
![](http://www.virtualworldsart.com/iClone/Tesirasstore.gif)
|