Skip to content

Commit

Permalink
fix: windows adaptor was failing to load (aws-deadline#44)
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Epp <[email protected]>
Signed-off-by: Andy Hayes <[email protected]>
  • Loading branch information
epmog authored and andymanaws committed Sep 12, 2024
1 parent b3cee6a commit 482feef
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
18 changes: 15 additions & 3 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
```
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 482feef

Please sign in to comment.