Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: windows adaptor was failing to load #44

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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