Using Terminal to sim and mesh

rdamani01
Posts: 9
Joined: Fri Apr 23, 2010 9:35 pm

Using Terminal to sim and mesh

Postby rdamani01 » Sun Aug 21, 2011 3:41 pm

Hello all,

I have a dual core intel mac running real flow 5. The problem I have is that when I use the terminal to sim i get no error messages but my sim doesn't start. This is the syntax... /Applications/RealFlow 5/RealFlow.app/Contents/MacOS/RealFlow64 -nogui -range 0 200 -sim -threads 4 /Volumes/Beast/_Werknoladrop_v004/drop_v004.flw
Anyone have any ideas why its not simming. Thanking all in advance.
rdamani01


User avatar
bitSeq
Posts: 1044
Joined: Thu Jul 10, 2008 9:48 am
Location: UK - Stuart Armiger
Contact:

Using Terminal to sim and mesh

Postby bitSeq » Mon Aug 22, 2011 9:18 am

Are you sure its even loading the project file, your slashes / are mixed up..

rdamani01
Posts: 9
Joined: Fri Apr 23, 2010 9:35 pm

Using Terminal to sim and mesh

Postby rdamani01 » Mon Aug 22, 2011 12:25 pm

If I use all forward slashes I get an /Applications/RealFlow/: No such file or directory same if I use all backward slashes...very weird. but when I mix up the slashes I get this...Galactus-2:~ Galactus$ /Applications/RealFlow 5/RealFlow.app/Contents/MacOS/RealFlow64 -nogui -range 0 200 -sim -threads 4 /Volumes/Beast/_Werknoladrop_v004/drop_v004.flw
-----------------------------------------------------------------
1998-2010 (c) Next Limit - RealFlow(x86_64) v5.0.0.0140
-----------------------------------------------------------------

Usage: RealFlow64 [ [-help] [-info] [-license] [-mesh] [-reset] [-useCache] [-threads [numberOfThreads] [-range [frameBegin frameEnd]] [-log logPath] [-idoc idocName] scenePath] | [-script scriptPath]
Galactus-2:~ Galactus$
it launches Real flow it just doesn't sim

User avatar
scubedio
Posts: 97
Joined: Thu Jan 11, 2007 5:17 pm
Location: mumbai

Using Terminal to sim and mesh

Postby scubedio » Mon Aug 22, 2011 1:47 pm

hi....may b the problem is due to slashes and order of the values.... try this script...its already posted in RF scripting forum also.....this is a batch script...

import subprocess
import platform

def main():
form = GUIFormDialog.new()
toptions = [ "2", "4", "8", 16 ]
simoptions = ["Simulation",Meshing]
form.addListField( "1. Type", simoptions, 0 )
form.addListField( "2. Threads", toptions, 1 )
form.addBoolField( "3. Frame Range", False )
endFrame = scene.getMaxFrames()
startFrame = 0

selNodes = scene.getNodes()
meshes = []
for node in selNodes:
if ( node.getType() == TYPE_STANDARD_MESH ):
meshes.append( node )
if ( node.getType() == TYPE_RENDERKIT_MESH ):
meshes.append( node )

if (scene.getFileName() == None):
warning = GUIMessageDialog.new()
warning.show( ALERT_TYPE_CRITICAL, "Please load the Scene!" )
else:
sceneFile = scene.getRootPath() + "/" + scene.getFileName()

if (form.show() == GUI_DIALOG_ACCEPTED ):
simType = (form.getFieldValue("1. Type"))
dialogRange = ( form.getFieldValue( "3. Frame Range" ) )

if ( dialogRange == 1 ):
rangeDlg = GUIFormDialog.new()
rangeDlg.addIntField( "1. Start Frame", 0 )
rangeDlg.addIntField( "2. End Frame", endFrame )

if ( rangeDlg.show() == GUI_DIALOG_ACCEPTED ):
startFrame = ( rangeDlg.getFieldValue( "1. Start Frame" ) )
endFrame = ( rangeDlg.getFieldValue( "2. End Frame" ) )
numThread = int(str(toptions[(form.getFieldValue( 2. Threads ) )]))

if (simType == 0):
for each in meshes:
each.setParameter("Build", False)
terminalOptions = "-nogui -threads "+str(numThread)+" -range "+(str(startFrame))+" "+(str(endFrame))
scene.reset()
scene.save ( scene.getRootPath() + "/" + scene.getFileName() )
subprocess.Popen('start realflow.exe %s "%s"' % (terminalOptions, sceneFile), shell=True, cwd='C:Program FilesNext LimitRealFlow 5')

if (simType == 1):
for each in meshes:
name = each.getName()
each.setParameter("Build", True)
if (len(meshes)== 0):
warning = GUIMessageDialog.new()
warning.show( ALERT_TYPE_CRITICAL, "Mesh Node not found!" )

if (len(meshes)>= 1):
terminalOptions = "-nogui -threads "+str(numThread)+" -mesh "+" -range "+(str(startFrame))+" "+(str(endFrame))
scene.save ( scene.getRootPath() + "/" + scene.getFileName() )
subprocess.Popen('start realflow.exe %s "%s"' % (terminalOptions, sceneFile), shell=True, cwd='C:Program FilesNext LimitRealFlow 5')
else :
scene.message ( "Aborted by the user" )

if __name__ == "RealFlow":
main()
Rgds
Scubedio

https://vimeo.com/scubedio

rdamani01
Posts: 9
Joined: Fri Apr 23, 2010 9:35 pm

Using Terminal to sim and mesh

Postby rdamani01 » Mon Aug 22, 2011 4:51 pm

Is this script for the command line or in RF itself?

User avatar
bitSeq
Posts: 1044
Joined: Thu Jul 10, 2008 9:48 am
Location: UK - Stuart Armiger
Contact:

Using Terminal to sim and mesh

Postby bitSeq » Mon Aug 22, 2011 5:04 pm

This is what I run in terminal...

REALFLOW -nogui -range 0 100 /work/splash1/splash1.flw

And this to mesh

REALFLOW -nogui -mesh -range 0 100 /work/splash1/splash1.flw

User avatar
scubedio
Posts: 97
Joined: Thu Jan 11, 2007 5:17 pm
Location: mumbai

Using Terminal to sim and mesh

Postby scubedio » Tue Aug 23, 2011 4:49 am

command line only... running via RF....easy to use...
Rgds
Scubedio

https://vimeo.com/scubedio

xioin
Posts: 1
Joined: Thu Nov 10, 2011 3:51 pm

Using Terminal to sim and mesh

Postby xioin » Thu Nov 10, 2011 3:53 pm

Hello,

if you're tying to use the realflow64 you don't use the -nogui flag (that is because osx doesnt support realfow in 64bit gui anyways so its not necessary.) So, you should type it like this:

/Applications/RealFlow 5/RealFlow.app/Contents/MacOS/RealFlow64 -range 0 200 -sim -threads 4 /Volumes/Beast/_Werknoladrop_v004/drop_v004.flw

Regards.

lukeiamyourfather
Posts: 2880
Joined: Mon Oct 15, 2007 4:09 pm
Contact:

Using Terminal to sim and mesh

Postby lukeiamyourfather » Fri Nov 11, 2011 12:09 am

bitSeq wrote: Are you sure its even loading the project file, your slashes / are mixed up..

The slashes are mixed up because on Unix (like OS X) and Linux this "" means the literal character after the slash (e.g. a space like " ") and "/" separates directories in a path. Windows uses only "" for directories unless you're using a programming language which doesn't allow that like Python. If you want clean paths with only one kind of slash it needs to be in quotes so the whole path is a literal string as in "/Application/RealFlow 5/realflow" instead of RealFlow 5 to accommodate for the space in the path without quotes. This is why Linux users often name files without spaces in them.


Return to “RF5: General topics”

Who is online

Users browsing this forum: No registered users and 1 guest