Why is the "EXPORT_PARTICLES_RPC" always grey ?

Post Reply
chennn7
Posts: 20
Joined: Wed Mar 07, 2012 10:30 am
Location: guangdong,Jiangmen,CHINA

Why is the "EXPORT_PARTICLES_RPC" always grey ?

Post by chennn7 » Wed Oct 28, 2015 10:11 am

Hello everyone,
I'm new in scripting in Realflow 2014. I tried to write a script to export PRT files of the HY_Foam without simulate again. But the "EXPORT_PARTICLES_RPC" command always remain grey in Batch Script window. And I get some error in message box after excuting my script.
I found the "EXPORT_PARTICLES_RPC" in help files. I didn't misspell it. Why I can't get the correct "Yellow color" in my script ?
Here's my script.

OO = scene.get_HY_Foam("HY_Foam_From_Splash")
for f in range(135, 135 +1):
scene.setCurrentFrame(f)
OO.activeExportResource(EXPORT_PARTICLES_RPC,False)
OO.activeExportResource(EXPORT_PARTICLES_BIN,False)
OO.activeExportResource(EXPORT_PARTICLES_ASC,False)
OO.activeExportResource(EXPORT_PARTICLES_PDC,False)
OO.activeExportResource(EXPORT_PARTICLES_PD,False)
OO.activeExportResource(EXPORT_PARTICLES_PRT,True)
OO.activeExportResource(EXPORT_PARTICLES_ABC,False)
OO.activeExportResource(EXPORT_PARTICLES_PROXY,False)
OO.export()

User avatar
Alex
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: Why is the "EXPORT_PARTICLES_RPC" always grey ?

Post by Alex » Wed Oct 28, 2015 10:31 am

Hi there,

Syntax highlight in RealFlow scripting is performed statically. This means that the list of keywords is prebuilt, and sometimes a keyword is missing in the list, but it is still valid. This is the case of the constant you just used: EXPORT_PARTICLES_RPC.

Thanks for finding it. We will add it so it can be fixed for the upcoming patch.
Alex Ribao
RealFlow Team
Next Limit Technologies

chennn7
Posts: 20
Joined: Wed Mar 07, 2012 10:30 am
Location: guangdong,Jiangmen,CHINA

Re: Why is the "EXPORT_PARTICLES_RPC" always grey ?

Post by chennn7 » Wed Oct 28, 2015 11:38 am

Thanks for your quick reply.
But any workaround in my case here ? Is something wrong in my script ? I found something wrong during excuting this script in RF2014. I only want to export the PRT files of the HY_Foam and HY_Splash without simulating again. Can you fix my script ?

User avatar
Alex
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: Why is the "EXPORT_PARTICLES_RPC" always grey ?

Post by Alex » Wed Oct 28, 2015 1:31 pm

Sorry, I didn't realize you were having also that problem.

And you need to make sure that the node is in Active mode. Otherwise it will not write new files.
Additionally, you need the original simulation files to load the frames. Let's say they are currently stored in RPC format. See in the following example how I enable the RPC files before loading a frame, and then I disable it before re-exporting:

Code: Select all

OO = scene.get_HY_Foam("HY_Foam_From_Splash")
OO.activeExportResource(EXPORT_PARTICLES_BIN,False)
OO.activeExportResource(EXPORT_PARTICLES_ASC,False)
OO.activeExportResource(EXPORT_PARTICLES_PDC,False)
OO.activeExportResource(EXPORT_PARTICLES_PD,False)
OO.activeExportResource(EXPORT_PARTICLES_ABC,False)
OO.activeExportResource(EXPORT_PARTICLES_PROXY,False)

OO.activeExportResource(EXPORT_PARTICLES_PRT,True)

for f in range(135, 135 +1):
  OO.activeExportResource(EXPORT_PARTICLES_RPC,True)
  scene.setCurrentFrame(f)
  OO.activeExportResource(EXPORT_PARTICLES_RPC,False)
  OO.export()
Alex Ribao
RealFlow Team
Next Limit Technologies

chennn7
Posts: 20
Joined: Wed Mar 07, 2012 10:30 am
Location: guangdong,Jiangmen,CHINA

Re: Why is the "EXPORT_PARTICLES_RPC" always grey ?

Post by chennn7 » Wed Oct 28, 2015 2:51 pm

I'll try this script. I hope there will be some easier method to convert file format such as RPC to PRT , RPC to BIN in the future version.
Thank you very much.
Best wishes.

Post Reply