FPTR Desktop integration with tk-blender

Hi,

I’m currently integrating tk-blender based on this repository.

However, since PySide2 is no longer supported in Blender 4.2 (which uses Python 3.11), I need to install PySide6 instead to ensure compatibility.

Has anyone successfully integrated tk-blender with Blender 4.2? If so, could you share the steps or provied any guidance on how to achieve this?

Thanks in advance for your help!

Check the conversation here on this topic Shotgrid with tk-blender - #11 by zavinator @zavinator has picked up on this recently.

1 Like

Thanks!

I ended up resolving the issue caused by PySide6 installation prbolems and tk-core’s inability to load PySide6. By updating to the latest tk-core version (v0.21.6), the GUI now functions properly in Blender 4.2.

Since the original repository seems to be unmaintained, I create a new repository. You can find it here: GitHub - icentric-dev/tk-blender: 🥛 FPTR Toolkit Engine for Blender: https://www.blender.org/

Hi Sean! Thanks for updating tk-blender to work with PySide6! It works well on Windows but I’m struggling to get it to work on Linux (Rocky 8). It seems like PySide6 6.8.* results in a startup crash. PySide6 6.7.* seems to not crash on startup. However the File Open (workfiles) dialog freezes on open. I got it to not freeze by commenting out the TIMER code in the event loop, but now I get a crash after clicking the “New File” button in the File Open dialog. The crash report is pretty much empty but I was able to at least narrow it down to happening after the read_homefile() blender api call inside the hook. Yeah so not having much luck so far.

Hi @Sean & community. Has anyone gotten the eccentric fork of tk-blender to work on Mac? I tried on Mac OS 13.7.5 . The FPTR menu is empty. Trying to see if perhaps the old age of my Mac OS is a factor. I’m using Blender 4.2.0

Best to turn on debug mode and take a look in the various log files or in your blender log files.
The engine requires Pyside2 to be available which is likely the cause.

Hi @Ricardo_Musch , I’m using the icentric fork of tk-blender which allows using PySide6 with Blender 4.2. I also see there is a pull request in the original tk-blender which also enables PySide6 compatibility when using Blender 4.2+ . My Blender app has PySide6 in a discoverable area and can import PySide6 from Blender’s python console. I’ll try that fork as well and learn how to look in to Blender logs…I consider myself new to Blender although back in 1998-9 I was compiling Blender on my Dec Alpha based Linux machine and messing around with it for modeling purposes.

1 Like

I can confirm that it works only with PySide 6.7.2, but not with 6.8.x
I’m currently using this event loop (tested in linux and windows):

class QtWindowEventLoop(bpy.types.Operator):
    """
    Integration of qt event loop within Blender
    """

    bl_idname = "screen.qt_event_loop"
    bl_label = "Qt Event Loop"

    # Not work in Blender 4.4+
    #def __init__(self):
    #    self._app = None

    def processEvents(self):
        self._app.processEvents()
        return 0.01

    def execute(self, context):
        # create a QApplication if already does not exists
        self._app = QtWidgets.QApplication.instance() or QtWidgets.QApplication(
            sys.argv
        )
        
        # Windows: This cause freeze when resizing blender native modal windows
        # But it is required in Linux to avoid the QApplication to take over the event loop
        if sys.platform != "win32":
            bpy.app.timers.register(self.processEvents, persistent=True)

        return {"RUNNING_MODAL"}