Shotgun Toolkit Engine for Maxon Cinema 4D

Thanks for all of that @Dan_Bradham !

Iv also done the same and updated our fork of tk-cinema with your changes and the appropriate wheels for 2023.2.2

We are also using cloudbased, but when trying to get this up and running im getting a tank error that im hoping you could possible offer some insight to?

raise TankError(tank.errors.TankError:Cannot load core config file 'C:\Users\rl\AppData\Roaming\Shotgun\territory\p7436c5982.basic.desktop\cfg\config\core\install_location.yml'. Error: Could not open file 'C:\Users\rl\AppData\Roaming\Shotgun\territory\p7436c5982.basic.desktop\cfg\config\core\install_location.yml'. Error reported: 'module 'collections' has no attribute 'Hashable''

We dont use an install_location.yml in our config and havent for a long time. Launches for R20-R25 still work flawlessly though.

If tried using your tk-cinema directly aswell as the updated Original tk-cinema

Hey @Ryan_Territory .

Could it be that you have an old version of tk-core in your config? At some point the Hashable base class was moved from collections.Hashable to collections.abc.Hashable. I would guess that tk-core updated the included versions of PyYaml at some point to support newer versions of Python.

Looking at the PyYaml repo, this was addressed in 2019. Import Hashable from collections.abc by The-Compiler · Pull Request #181 · yaml/pyyaml · GitHub

@Dan_Bradham I don’t suppose you could put up wheels for the 2024.2.0 version of C4D could you please? We’re doing an update to that and Maxon are now on bloody Python 3.11 as apparently they can’t leave anything well enough alone…

1 Like

I don’t think tk-core nor the shotgun_api3 is completely compatible with 3.11 yet.

I followed the details in here and got it working! Cinema4d 2024.0.0 · Issue #4 · danbradham/wheels · GitHub

Remember to add C4DPYTHONPATH311 to both your environment variables and the startup.py of the engine! I had to once again copy all the new Pysdie6 and shiboken6 folders into C:\Users<username>\AppData\Roaming\Maxon\Maxon Cinema 4D 2024_A5DBFF93\python311I to get it to work. And also added in looking for PySide6 into the engine.py, but not certain that was strictly necessary!

Well spotted @jhudsonFP.

For people finding this thread in the future, custom builds of PySide should no longer be required for Cinema4D. You can run a couple of commands from a powershell prompt to install Pyside6 on a single machine for Cinema4D 2024.2+.

> cd "C:\Program Files\Maxon Cinema 4D 2024\resource\modules\python\libs\win64"
> python -m ensurepip --upgrade
> python -m pip install PySide6 --target="$env:APPDATA\Maxon\python\python311\libs"

Of course, the version of Cinema 4D and version of Python included with it may change in the future, so adjust the commands above accordingly. One may also download the wheels and package them with their shotgun config and utilize a before app launch hook to include the PySide6 location in their environment prior to launching Cinema 4D. Or use some other means to distribute PySide6 to your users.

As @jhudsonFP also mentioned a couple of changes need to be made to the tk-cinema engine in order to get ShotGrid to work with 2024+. You can see those changes in this fork which I maintain for work GitHub - danbradham/tk-cinema at bns-master. I may make a pull request to @Mykhailo_Datsyk 's original repo when I have time. But if someone else is feeling adventurous, be my guest and make the PR yourself!

Looking further forward - when ShotGrid toolkit is eventually running on 3.11 and PySide6 natively, installing PySide6 for Cinema4D manually will become obsolete. The engine should detect PySide6, based on the changes in my fork. It seems the Autodesk team is actively working on getting SG Toolkit up to parity with the vfx reference platform cy2024 which includes Python 3.11 and PySide 6.5+. So I have hopes that the day when the complexities of getting SG Toolkit to work in Cinema 4D will be alleviated sooner rather than later.

1 Like

SG Api already seems to work fine with 3.11 from my tests, tk-core I think is almost ready :smiley:

1 Like