WARNING: Script error: "name 'scene' is not defined"
WARNING: Script error: "name 'scene' is not defined"
Hee guys,
I've got a script running, but some lines should stop ad a given frame. Now I found this example script in the Realflow 2015 documentation, but I get this error:
WARNING: Script error: "name 'scene' is not defined" at line number 1.
This is the example script:
if ( ( scene.currentFrame >= 10 ) and ( scene.currentFrame <= 20 ) ):
scene.message( "Current frame in range is: " + str( scene.currentFrame ) )
What did I do wrong?
Thanks!
I've got a script running, but some lines should stop ad a given frame. Now I found this example script in the Realflow 2015 documentation, but I get this error:
WARNING: Script error: "name 'scene' is not defined" at line number 1.
This is the example script:
if ( ( scene.currentFrame >= 10 ) and ( scene.currentFrame <= 20 ) ):
scene.message( "Current frame in range is: " + str( scene.currentFrame ) )
What did I do wrong?
Thanks!
Re: WARNING: Script error: "name 'scene' is not defined"
Hello and welcome.
It seems as if your RF installation isn't complete and the Python part is missing. How do commands like "scene" and "currentFrame" look? Are they displayed in orange or brown in the script editor? If they're printed in plain grey then it's very likely that the necessary files haven't been installed.
It seems as if your RF installation isn't complete and the Python part is missing. How do commands like "scene" and "currentFrame" look? Are they displayed in orange or brown in the script editor? If they're printed in plain grey then it's very likely that the necessary files haven't been installed.
Thomas Schlick | Next Limit Technologies
Re: WARNING: Script error: "name 'scene' is not defined"
Hello and thanks!
I've used scripts before, and they have all worked correctly. "scene" and "currentFrame" are both displayed in orange.
I've used scripts before, and they have all worked correctly. "scene" and "currentFrame" are both displayed in orange.
Re: WARNING: Script error: "name 'scene' is not defined"
Sorry for the late reply.
It puzzles me that the problem starts with "scene". If you're on RF2015 (latest version) you can enable the following option - it will give you a more verbose error message. Please let me know what the error message says:
Preferences > Scripts > Redirect Output to Messages Panel
Another thing you can try is to copy the lines below to a batch script editor (F10) and execute it. The output should be "Done...".
if ( ( scene.getCurrentFrame() >= 10 ) and ( scene.getCurrentFrame() <= 20 ) ):
scene.message( "Current frame in range is: " + str( scene.getCurrentFrame() ) )
Did you insert an indent at "scene.message"? It's very unlikely that you forgot, because then you should get a normal syntax error, but who knows. I also recommend retyping the code instead of copying/pasting it. Sometimes this helps as well, but maybe you did that already.
It puzzles me that the problem starts with "scene". If you're on RF2015 (latest version) you can enable the following option - it will give you a more verbose error message. Please let me know what the error message says:
Preferences > Scripts > Redirect Output to Messages Panel
Another thing you can try is to copy the lines below to a batch script editor (F10) and execute it. The output should be "Done...".
if ( ( scene.getCurrentFrame() >= 10 ) and ( scene.getCurrentFrame() <= 20 ) ):
scene.message( "Current frame in range is: " + str( scene.getCurrentFrame() ) )
Did you insert an indent at "scene.message"? It's very unlikely that you forgot, because then you should get a normal syntax error, but who knows. I also recommend retyping the code instead of copying/pasting it. Sometimes this helps as well, but maybe you did that already.
Thomas Schlick | Next Limit Technologies
Re: WARNING: Script error: "name 'scene' is not defined"
Oh don't worry, I found it quit fast tho!
This is the output:
>[14/April/2016 09:57:45] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:45] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:45] - WARNING: NameError
>[14/April/2016 09:57:45] - WARNING: :
>[14/April/2016 09:57:45] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:45] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:45] - Using 12 thread(s) for this simulation.
>[14/April/2016 09:57:45] - Using opencl-gpu device AMD Radeon HD - FirePro D500 Compute Engine for Hybrido for this simulation
>[14/April/2016 09:57:45] - Using opencl-gpu device AMD Radeon HD - FirePro D500 Compute Engine for Hybrido for this simulation
>[14/April/2016 09:57:45] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:45] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:45] - WARNING: NameError
>[14/April/2016 09:57:45] - WARNING: :
>[14/April/2016 09:57:45] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:45] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:45] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:45] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:45] - WARNING: NameError
>[14/April/2016 09:57:45] - WARNING: :
>[14/April/2016 09:57:45] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:45] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
The output from the batch file was indeed "Done...". So that does mean it's installed correctly, doesn't it?
And I had inserted an indent at "scene.message" and I've also retyped it.
This is the output:
>[14/April/2016 09:57:45] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:45] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:45] - WARNING: NameError
>[14/April/2016 09:57:45] - WARNING: :
>[14/April/2016 09:57:45] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:45] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:45] - Using 12 thread(s) for this simulation.
>[14/April/2016 09:57:45] - Using opencl-gpu device AMD Radeon HD - FirePro D500 Compute Engine for Hybrido for this simulation
>[14/April/2016 09:57:45] - Using opencl-gpu device AMD Radeon HD - FirePro D500 Compute Engine for Hybrido for this simulation
>[14/April/2016 09:57:45] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:45] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:45] - WARNING: NameError
>[14/April/2016 09:57:45] - WARNING: :
>[14/April/2016 09:57:45] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:45] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:45] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:45] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:45] - WARNING: NameError
>[14/April/2016 09:57:45] - WARNING: :
>[14/April/2016 09:57:45] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:45] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
>[14/April/2016 09:57:46] - WARNING: Traceback (most recent call last):
>[14/April/2016 09:57:46] - WARNING: File "MasterUsrScript", line 27, in <module>
>[14/April/2016 09:57:46] - WARNING: NameError
>[14/April/2016 09:57:46] - WARNING: :
>[14/April/2016 09:57:46] - WARNING: name 'scene' is not defined
>[14/April/2016 09:57:46] - WARNING: Script error: "name 'scene' is not defined" at line number 27.
The output from the batch file was indeed "Done...". So that does mean it's installed correctly, doesn't it?
And I had inserted an indent at "scene.message" and I've also retyped it.
Re: WARNING: Script error: "name 'scene' is not defined"
Yes, I'd say so and the error must be somewhere else, but that's difficult to find out without taking a look at the entire script. Is it possible to send me the script for debugging? If you don't want to share it here you can PM it to me.The output from the batch file was indeed "Done...". So that does mean it's installed correctly, doesn't it?
Thomas Schlick | Next Limit Technologies
Re: WARNING: Script error: "name 'scene' is not defined"
Okay thanks! I've send you a pm with the code
Re: WARNING: Script error: "name 'scene' is not defined"
In the mean time, anyone else any suggestions?
Re: WARNING: Script error: "name 'scene' is not defined"
I've inserted the missing indents to the script you sent me yesterday and tested it. You certainly don't want to hear that, but I didn't have any problems. I don't which type of license you have (demo, le, standard), but I've attached a complete scene with the script included. If you have the demo version you can load the included script (.rfs) and test it in your own scene. You should get a message between frame 10 and 20.
Sorry, but I really can't trace the error here.
Cheers,
Thomas
Sorry, but I really can't trace the error here.
Cheers,
Thomas
You do not have the required permissions to view the files attached to this post.
Thomas Schlick | Next Limit Technologies
Re: WARNING: Script error: "name 'scene' is not defined"
Okay, I've got no idea why, but it's working now. I guess it were the missing indents. I imported the script you send me and it's working. So thanks anyway! I'm a happy man, haha.
Cheers!
Cheers!
Last edited by User_Peek on Fri Apr 15, 2016 9:39 am, edited 1 time in total.