hypothetical-inc / GafferDeadline

Deadline Dispatcher for Gaffer
BSD 3-Clause "New" or "Revised" License
36 stars 6 forks source link

gaffer env python not loading gafferDeadline stuff. #39

Closed mrpurest closed 2 years ago

mrpurest commented 2 years ago

Hello,

So I am trying to write a script that opens gaffer scenes, makes some changes and saves the scene down again.

so I would have a python file: makeChange.py

import Gaffer
import GafferScene

script = Gaffer.ScriptNode()
script["fileName"].setValue( "/path/gafferSceneToChange.gfr")

script.load()

#make some changes....

script.save()

I would then run this like so:

    gaffer env python makeChange.py

Problem I have is that this method seems to not load the gafferDeadline stuff, so if the files are using gafferdeadline I get the following message:

[rupertt@ws-304 rupert]$ gaffer_arnold env python lookdev_dispatcher.py Traceback (most recent call last): File "lookdev_dispatcher.py", line 11, in script.load() IECore.Exception: Line 150 of /job/MGTO3/EPISODE/pipe/autorenders/LOOK_turntables/work/Lighting/rupertt/gaffer/scripts/LOOK_turntables_v001.gfr : KeyError: "'deadline' is not a child of 'dispatcher'"

I feel like this maybe a side effect of the recent changes done to make 'gaffer dispatch' work in headless mode.

ericmehl commented 2 years ago

I think you may be able to copy one of the project.py files from any of the startup directories into a new directory startup/env in the GafferDeadline installation. That way GafferDeadline gets initialized with the env app like it does for gui, execute, etc.

The better solution is probably to rework the startup files so that GafferDeadline gets registered as part of the main Gaffer startup, not specific to each app. I'll make a ticket to make that change.