Syntax Error in custom Blender plugin

Hi,

I’m using an addon in Blender called Turbo Render that requires the following added to do a command line render:

–python-expr “import bpy; bpy.ops.threedi.render_animation()”

I’ve made updates to the Blender.py file so that lines 69 onwards read:

    renderArgument = " -b \"" + sceneFile + "\""
    renderArgument += " --python-expr " + " \""import bpy; bpy.ops.threedi.render_animation()"\""
    renderArgument += " -t " + self.GetPluginInfoEntryWithDefault( "Threads", "0" )

I successfully used this middle line addition on a previous project last year, but it’s now producing a syntax error. I’ve read elsewhere that Deadline no longer supports Python earlier than 3.10. Is this line now incompatible with Python? I only get ‘syntax error on line 70’ as the report.

Thanks, Jon

Hello!

It looks like you are passing the quotes backslash incorrectly and it is running into syntax error. I have fixed the line and tested it on a python console, it assigns the correct value.

Try using this:

renderArgument +=  " --python-expr " + " \"import bpy; bpy.ops.threedi.render_animation()\""

Let us know how it goes.

That’s great! All fixed. Thank you very much indeed!