aws-deadline / deadline-cloud-for-cinema-4d

AWS Deadline Cloud for Cinema 4D
Apache License 2.0
8 stars 9 forks source link

fix: properly access multipass filename from render data #47

Closed epmog closed 4 months ago

epmog commented 4 months ago

Resolves #38

What was the problem/requirement? (What/Why)

When opening the submitter in a scene that saves multipass output, the submitter would always crash regardless if there any info or not.

Deadline UI launch failed
Traceback (most recent call last):
  File "C:\Program Files\Python310\Lib\site-packages\deadline\cinema4d_submitter\cinema4d_render_submitter.py", line 54, in show_submitter
    w = _show_submitter(None)
        ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python310\Lib\site-packages\deadline\cinema4d_submitter\cinema4d_render_submitter.py", line 273, in _show_submitter
    output_directories = Scene.get_output_directories(take=take)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python310\Lib\site-packages\deadline\cinema4d_submitter\scene.py", line 152, in get_output_directories
    path = render_data.GetFilename(c4d.RDATA_MULTIPASS_FILENAME)
           ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'c4d.documents.RenderData' object has no attribute 'GetFilename'

What was the solution? (How)

We were accessing it as if the render data was the data container, rather than the data instance. Swapped to the data instance method

What is the impact of this change?

Submitter now properly loads when the scene has multipass data

How was this change tested?

  1. Reproduced issue locally
  2. made the change and installed
  3. verified the submitter no longer crashes when loading

Was this change documented?

N/A

Is this a breaking change?

N/A


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud