I need to use pyside for my plugin's GUI.
And i run Pyside in another C4Dthread.
It is possible to successfully open the Pyside window in C4D.
but there seem to be some problems.
-1.When I opened the Pyside window in C4D, the main thread seemed to be blocked, which made it impossible for me to interact with the C4D scene.
-2.When I first open the Pyside window, it will open normally, but when I close it and open it again, it will flicker on the screen and open it again, that is to say; After closing the window for the first time, I need to click twice to open the window.
And this is my code example:
label = QLabel(self)
# Put in your code here
# which you want to run
# in another thread
app = QApplication.instance()
if not app:
app = QApplication()
win = Window()
thread = UIThread()
# Do some other operations here
thread.Wait(True) # Wait until the main method is done
print "Pyside for c4d"
Is anyone here？
thank you for reaching out to us. It is unfortunately not quite cleae to me in which context (Script Manager script, CommandData plugin, etc.) your problem occurs. Please try to include such context in the future, as it is not always obvious from the code and quite important. I all answer the rest in bullet point from most important to less important.
Thank you for your understanding,
Thanks to replying me!
And looks like i need to try it in "CommandData plugin ", hope it works~
just to be really unambiguous: You can try, but I personally would really recommend a server-client model, since you will always be on unsafe ground doing this in Cinema. And it is hard to plan for all eventualities, until we specifically design Cinema's Python API for being cable of this. As already pointed out, we will not be able to offer support if you decide to take that route and it does not work out.
Cheers and thank you for your understanding,
I just read this（Connect C4D with Tkinter） post，It does seem to help me
Thank you again！