SyntaxError in python Script Sop

   2343   2   0
User Avatar
Member
4 posts
Joined: Dec. 2015
Offline
Hey,

I'm having trouble figuring out the ‘script’ node (Script Sop).
A simple box with a script node results in the following error:

Python error: SyntaxError: ('invalid syntax', ('', 1, 1, ‘/home/bruno.kindt/Library/projects/UE__BoilerRoom/BoilerRoom/Shop/scripts/test.py\n’))

even if the file is empty or has a simple `print “foo”` line.
I'm a bit suspicious about the ‘\n’ after the filename in the error message.
User Avatar
Staff
6245 posts
Joined: July 2005
Offline
The contents of that line should be the script, not a path to the script. This matches the “Pre-Render Script” type script fields in the ROP operators.

Set the script to a

print ‘foo’

and you'll get the node printing foo when it cooks.

It is very confusing to have file choosers there; I'm not sure why we have them.
User Avatar
Staff
6245 posts
Joined: July 2005
Offline
I looked into this…. Apparently, in HScript, if you try to run the command
foo.cmd
it will then execute the file foo.cmd if it is in the local directory. So this is why historically the file chooser made sense in these fields. But with python, of course, this does not work.
  • Quick Links