diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 24765ce..7283ec7 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -36,10 +36,10 @@ hatch run fmt hatch run all:test ``` -## Get started +## Submitter environment Cinema4D does not support PYTHONPATH. We set DEADLINE_CLOUD_PYTHONPATH which the -submitter uses to set sys.path explictly and load deadline modules. +submitter and adaptor uses to set sys.path explictly and load deadline modules. - install deadline-cloud with pyside - set env below @@ -54,11 +54,13 @@ export g_additionalModulePath="/path/to/deadline-cloud-for-cinema4d/deadline_clo - run cinema4d - Extensions > Deadline Cloud Submitter -## Worker environment +## Worker adaptor environment Cinema4D does not support PYTHONPATH. We set DEADLINE_CLOUD_PYTHONPATH which the adaptor uses to set sys.path explictly and load deadline modules. +### Linux + Linux also requires the setup_c4d_env sourced first, we can override the exe path with a c4d wrapper script that sources it then call the Commandline client. @@ -69,3 +71,13 @@ Example linux env below: export DEADLINE_CLOUD_PYTHONPATH="/tmp/lib/python3.11/site-packages" export DEADLINE_CINEMA4D_EXE="/opt/maxon/cinema4dr2024.200/bin/c4d" ``` + +### Windows + +To run the adaptor on Windows, you'll have to configure the environment variable `DEADLINE_CLOUD_PYTHONPATH` (like the submitter above) and install pywin32 into Cinema4D's python. Example: + +``` +set DEADLINE_CLOUD_PYTHONPATH="C:\path\to\deadline-cloud\site-packages" +"C:\Program Files\Maxon Cinema 4D 2024\resource\modules\python\libs\win64\python.exe" -m ensurepip +"C:\Program Files\Maxon Cinema 4D 2024\resource\modules\python\libs\win64\python.exe" -m pip install pywin32 +``` diff --git a/src/deadline/cinema4d_adaptor/Cinema4DClient/cinema4d_client.py b/src/deadline/cinema4d_adaptor/Cinema4DClient/cinema4d_client.py index d11bf64..bd18aad 100644 --- a/src/deadline/cinema4d_adaptor/Cinema4DClient/cinema4d_client.py +++ b/src/deadline/cinema4d_adaptor/Cinema4DClient/cinema4d_client.py @@ -6,18 +6,13 @@ from types import FrameType from typing import Optional -# print('Client import') -# print('======') -# for n in sys.path: -# print(n) -# print('======') from openjd.adaptor_runtime_client import ( - HTTPClientInterface, + ClientInterface, ) from deadline.cinema4d_adaptor.Cinema4DClient.cinema4d_handler import Cinema4DHandler -class Cinema4DClient(HTTPClientInterface): +class Cinema4DClient(ClientInterface): """ Client that runs in Cinema4D for the Cinema4D Adaptor """ diff --git a/src/deadline/cinema4d_adaptor/Cinema4DClient/plugin/DeadlineCloudClient.pyp b/src/deadline/cinema4d_adaptor/Cinema4DClient/plugin/DeadlineCloudClient.pyp index 3dcd571..6943cb5 100644 --- a/src/deadline/cinema4d_adaptor/Cinema4DClient/plugin/DeadlineCloudClient.pyp +++ b/src/deadline/cinema4d_adaptor/Cinema4DClient/plugin/DeadlineCloudClient.pyp @@ -22,11 +22,7 @@ if 'openjd' not in sys.modules.keys(): print('add_dll_directory failed: %s' % p) sys.path.append(p) -try: - from deadline.cinema4d_adaptor.Cinema4DClient.cinema4d_client import main -except Exception as e: - print(e) - traceback.print_exc() +from deadline.cinema4d_adaptor.Cinema4DClient.cinema4d_client import main def parse_argv(argv):