Trying to write a script for "headless" execution
sidcarton1587
Posts: 17
This discussion was created from comments split from: DAZ Studio 4.x Scripting Documentation.
Comments
I'm trying to run a headless script in Studio 4.22.0.16 and having a bit of a time trying to understand what's happening.
The script itself is simple, just using App.verbose() to print out a message to the console:
I execute the script from the command line using this command:
The log reports the initialization steps, but does not seem to actually get to executing the script itself. If I run the script without the -headless option or I run it directly from within Studio, it seems to work as expected. Is there something I'm missing in terms of the command line options (I've tried removing all of them and just using -headless and that has the same behavior) that would cause the script not to be executed?
You probably have the Look at my Hair FREE Player plugin installed. It is not compatible with headless mode. Uninstall or disable it, and your script should execute.
So I didn't have that plugin installed, but it did get me looking at a bit more closely at the log file. I think it's the Ultrascenery plugin that is causing the problem:
Unfortunately, merely disabling the plugin doesn't make a difference.
That dll not loading is probably a separate issue. Can you clear your logfile, attempt to execute the script and then attach the logfile?
I attempted running your script and it works fine here, so we should be able to isolate the issue.
Were you attempting to run in headless mode?
Here's my batch file for starting my script:
And attached is the log file when I execute the above, along with the script DB_List_Products itself. The log ends exactly where the DLL init fails.
Yes, I used the command in your initial post with script path adjusted for your test message script.
The logfile ending there does indeed suggest that it is that plugin causing the issue, I assumed your logfile was normal except for the addition of the warning.
I do not have that plugin. Since disabling the plugin does not resolve the issue, try temporarily moving it out of your plugins directory to test if it resolves the issue or provides additional logging.
On my system the path is C:\Program Files\DAZ 3D\DAZStudio4\plugins