Realflow crash when trying to load scene

Discussion about scripting with Python
motoyuki
Posts: 2
Joined: Thu Sep 28, 2017 9:29 am

Realflow crash when trying to load scene

Postby motoyuki » Sun Oct 01, 2017 10:52 am

Hi,

I'm trying to do the "render batch script" from waterline magazine 01.
I have the problem, that both on mac and on PC it crashes Realflow (10.01).
I narrowed it down to the scene.load command not working in a for loop.

also when I add

scene.setCommandLineSimulation(True)

it doesn't simulate in commandline, but in the GUI.
is that a bug or am I doing something wrong here?

here the full script for you to test:
the problem occurs in the last for loop

numberOfFields = 10
projectFiles = []

guiForm = GUIFormDialog.new()

for fieldNumber in range(1, numberOfFields + 1):

if (fieldNumber < 10):
fieldName = "Project file 0" + str(fieldNumber)
guiForm.addFileField(fieldName)

else:
fieldName = "Project file " + str(fieldNumber)
guiForm.addFileField(fieldName)

if (guiForm.show() == GUI_DIALOG_ACCEPTED):

for fieldNumber in range(1, numberOfFields + 1):

if (fieldNumber < 10):
fieldName = "Project file 0" + str(fieldNumber)

else:
fieldName = "Project file " + str(fieldNumber)
fieldEntry = guiForm.getFieldValue(fieldName)
projectFiles.append(fieldEntry)

for currentProject in projectFiles:
if (currentProject!= ""):
scene.load(currentProject)
scene.setCommandLineSimulation(True)
scene.simulate()
scene.message("Simulating " + currentProject+ "Ö")

else:
scene.message("Script cancelled by user.")


User avatar
tsn
Posts: 872
Joined: Fri Oct 27, 2006 10:36 am

Re: Realflow crash when trying to load scene

Postby tsn » Mon Oct 02, 2017 6:40 am

Ho motoyuki,

Thanks for pointing me to this issue. I'll give it a try today to see if the script can be fixed or if it's a RF thing.

Cheers,
Thomas

User avatar
tsn
Posts: 872
Joined: Fri Oct 27, 2006 10:36 am

Re: Realflow crash when trying to load scene

Postby tsn » Mon Oct 02, 2017 9:39 am

I've tested the script and you're right: RF 10.1 crashes when the second scene is loaded. This is most probably a RF bug, because the script works with RF2016. I've checked most of the magazine's scripts with RF10, but I've obviously missed that one.

Thanks for letting me know!

Cheers,
Thomas

motoyuki
Posts: 2
Joined: Thu Sep 28, 2017 9:29 am

Re: Realflow crash when trying to load scene

Postby motoyuki » Sat Oct 14, 2017 12:58 am

Thomas, thanks for checking!

And thanks for doing the waterline magazine, it's very well done and helps me a lot!!!

cheers,

Marcus


Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest