Deadline 6 scripting

Hi guys i have a probl with a custom GUI script, im constantly getting this error:

2013-08-08 18:35:40: Main Window shown
2013-08-08 18:35:53: Traceback (most recent call last):
2013-08-08 18:35:53: File “DeadlineUI\UI\Commands\ScriptCommands.py”, line 80, in InnerExecute
2013-08-08 18:35:53: Exception: Python Exception: IndentationError : (Python.Runtime.PythonException)
2013-08-08 18:35:53: Type: <type ‘exceptions.IndentationError’>
2013-08-08 18:35:53: Value: (‘unexpected indent’, (‘none’, 138, 1, ‘\tscriptDialog.EndRow()\n’))
2013-08-08 18:35:53: Stack Trace:
2013-08-08 18:35:53:
2013-08-08 18:35:53:
2013-08-08 18:35:53: at FranticX.Scripting.PythonNetScriptEngine.a(Exception A_0)
2013-08-08 18:35:53: at FranticX.Scripting.PythonNetScriptEngine.ExecuteScript(String scriptName, String script)
2013-08-08 18:35:53: at Deadline.Scripting.DeadlineScriptManager.CreateScopeFromScript(String scopeName, String scriptName, String script, Boolean addGlobalFunctions, Boolean redirectToScriptManagerListener)
2013-08-08 18:35:53: at Deadline.Scripting.DeadlineScriptManager.CreateScopeFromScript(String scopeName, String scriptName, String script, Boolean addGlobalFunctions)

here is code line:

135: scriptDialog.AddRow()
136: scriptDialog.AddControl( “CommandLineLabel”, “LabelControl”, “”, labelWidth, -1)
137: scriptDialog.AddSelectionControl( “flipYPosZBox”, “CheckBoxControl”, False, “flipYPosZ”, dialogWidth - labelWidth - 24 - 216, -1, "Convert output to log space via Cineon Lin->Log " )
138: scriptDialog.EndRow()
139: scriptDialog.EndTabPage()

could anyone tell me whats wrong?

thx & cheers

So the key is in this line of the error:
2013-08-08 18:35:53: Exception: Python Exception: IndentationError : (Python.Runtime.PythonException)

That says there’s something wrong with your indentation (tabs, spaces). Since the forum tends to strip out formatting, I can’t really tell where the problem would be.

Common issues to keep an eye out for with this error:

  1. There’s an indent where there shouldn’t be one
  2. You’re missing an indent where ther should be on
  3. You’re using one too few or one too many spaces in an indent
  4. You’re mixing tab indents and space indents (as a general rule you should pick one and stick to it)

If you still can’t figure out what’s wrong with it, could you post your full script so that I can have a look at it?

Cheers,

  • Jon

Hi Jon,

thx for reply,

i think i have format txt as should (according to py syntax), ill check again and let you know,

in case i still have a problem i will send you a script

cheers

i really dont know whats wrong,

in v5 never had so many problems like in 6…

i have attached file, also im using notepad ++, i know that doesnt have anything to do with syntax but, i dont know

thx again

cheers
Ply2VrmeshSubmission.zip (6.42 KB)

Hey the indent errors are coming from the fact that you are mixing tabs with spaces for line indents. All shipped deadline scripts use 4 spaces instead of tabs.

Cheers,
Grant Bartel

yea i just notice :slight_smile:

i was using tab, hehe

thx again, and sorry for trouble

cheers

Glad you figured it out, I was just about to post a fixed version of your script :slight_smile:

The reason you’re probably running into issues with 6.0, and not with 5.2, is that we changed all of our scripts from using Tabs to using Spaces for indentation. We did this mostly because this is the recommended Python standard.

If you’re using Notepad++, there’s a couple things you can do to help you avoid this type of confusion in the future. First, you can configure your settings to replace tabs with spaces when indenting. This can be done in ‘Settings’ -> ‘Preferences’ -> ‘Language Menu/Tab Settings’.

You can also turn on displaying of whitespace and tab symbols, which is useful for diagnosing these types of problems. This can be done by selecting ‘View’ -> ‘Show Symbol’ -> ‘Show White Space and TAB’.

Hope this helps!

Cheers,

  • Jon

thats why i had the probl with tabs, :wink:

thx again for the tips,

cheers guys