CustomOceanSpray RF5 compatible?

Discussions about the use of Realflow 5
kslay
Posts: 115
Joined: Fri Oct 08, 2010 8:09 am

CustomOceanSpray RF5 compatible?

Postby kslay » Wed Jul 27, 2011 8:00 am

Hey guys,

can someone confirm that this script is also really working with the
latest RF5 version?

I have massive crashes whenever i start the script inside realflow.
It's really strange.


My intention is to import a dreamscape mesh into Realflow in order to create
splashes.

cheers

kslay
Dual Xeon (Sixcore) 2,67GHz | 24GB RAM | Quadro 4000

I'm drinking to drown my problems, but these goddamn bastards can swim!


kslay
Posts: 115
Joined: Fri Oct 08, 2010 8:09 am

CustomOceanSpray RF5 compatible?

Postby kslay » Thu Jul 28, 2011 8:46 am

I have also written the original author of the script.
But it seems that he is quite busy.

No answer yet ;-/


cheers

kslay
Dual Xeon (Sixcore) 2,67GHz | 24GB RAM | Quadro 4000

I'm drinking to drown my problems, but these goddamn bastards can swim!

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

CustomOceanSpray RF5 compatible?

Postby scubedio » Thu Jul 28, 2011 11:01 am

Hi...kslay... the same script u can rewrite for RF5...Its simple only.... i tried and its wroking fine for custom object and for realwave also.....based on the null Y position he emmited particle from the custom obj...

custom obj.vertex position Y > null Y pos == emmit particle ......

i think this may help u....give a try and tell.....
Rgds
Scubedio

https://vimeo.com/scubedio

kslay
Posts: 115
Joined: Fri Oct 08, 2010 8:09 am

CustomOceanSpray RF5 compatible?

Postby kslay » Thu Jul 28, 2011 2:34 pm

hey mate,

thanks for droppin in.
But to be honest, i don't know exactly how and where to edit
the script in order to run it in RF5.

Maybe you can tell me which line to modify.


cheers

kslay
Dual Xeon (Sixcore) 2,67GHz | 24GB RAM | Quadro 4000

I'm drinking to drown my problems, but these goddamn bastards can swim!

kslay
Posts: 115
Joined: Fri Oct 08, 2010 8:09 am

CustomOceanSpray RF5 compatible?

Postby kslay » Mon Aug 01, 2011 7:44 am

Sorry for bumping this Thread guys.
Buit maybe someone who is more familiar with python can help me
out a bit with my problem.

cheers

kslay
Dual Xeon (Sixcore) 2,67GHz | 24GB RAM | Quadro 4000

I'm drinking to drown my problems, but these goddamn bastards can swim!

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

CustomOceanSpray RF5 compatible?

Postby bitSeq » Mon Aug 01, 2011 3:55 pm

Can you post the script up here and we can tell you what line.

kslay
Posts: 115
Joined: Fri Oct 08, 2010 8:09 am

CustomOceanSpray RF5 compatible?

Postby kslay » Mon Aug 01, 2011 4:50 pm

Sure,


it is this script

[h]http://resources.realflow.com/search.php#page=1&mode=0&category=&id=136&search=custom[/h]

[h]CustomOceanSpray by tmdag1[/h]


[h]Here is the RTF File[/h]

#--------------------------------------------------
# Function: onSimulationBegin
#--------------------------------------------------

def onSimulationBegin():
pass




#--------------------------------------------------
# Function: onSimulationStep
#--------------------------------------------------

def onSimulationStep():

pass




#--------------------------------------------------
# Function: onSimulationFrame
#--------------------------------------------------

def onSimulationFrame():
import random

name = scene.getGlobalVariableValue("name")
randomization = scene.getGlobalVariableValue("randomization")
null = scene.getGlobalVariableValue("null")
emm = scene.getGlobalVariableValue("spray")
scene.message("random = " + str(randomization))

sea = scene.getObject(name)
seap = sea.getVertices()


nullY = null.getParameter("Position").getY()
scene.message("treshold Y pos = " + str(nullY) )


for i in seap:
if i.getPosition().getY() >= nullY:
pvel = i.getVelocity()
pposX = i.getPosition().getX() + random.uniform(-randomization, randomization)
pposY = i.getPosition().getY() + random.uniform(-randomization, randomization)
pposZ = i.getPosition().getZ() + random.uniform(-randomization, randomization)

vec = Vector.new(pposX, pposY, pposZ)
emm.addParticle(vec, pvel)

pass




#--------------------------------------------------
# Function: onSimulationEnd
#--------------------------------------------------

def onSimulationEnd():
pass




#--------------------------------------------------
# Function: onChangeToFrame
#--------------------------------------------------

def onChangeToFrame():
pass
Dual Xeon (Sixcore) 2,67GHz | 24GB RAM | Quadro 4000

I'm drinking to drown my problems, but these goddamn bastards can swim!

kslay
Posts: 115
Joined: Fri Oct 08, 2010 8:09 am

CustomOceanSpray RF5 compatible?

Postby kslay » Mon Aug 01, 2011 4:52 pm

[h]and here is the RFS file[/h]


def CustomOceanspray():
scene.message("")


#GUI stuff
good = 1
selNodes = scene.getSelectedNodes()
if ( len( selNodes ) == 0 ):
dialog = GUIMessageDialog.new()
dialog.show( ALERT_TYPE_CRITICAL, "Select custom ocean object" )
return( 1 )

ocean = []
for node in selNodes:
if ( node.getType() == TYPE_OBJECT ):
ocean.append( node )

if ( not node.getType() == TYPE_OBJECT ):
dialog = GUIMessageDialog.new()
dialog.show( ALERT_TYPE_CRITICAL, "Please select objects only!")
good = 0

if ( len( ocean ) == 0 ):
return( 1 )

if ( len( ocean ) > 1):
dialog = GUIMessageDialog.new()
dialog.show( ALERT_TYPE_CRITICAL, "Please select only ONE object!")
good = 0

#setting up scene

if (good == 1):
search = scene.getObject("treschold")
if search == None:
scene.message("creating one")
scene.addNull().setName("treschold")
scene.removeGlobalLink(scene.getObject("treschold"))
scene.setGlobalVariableValue("null", scene.getObject("treschold") )


form = GUIFormDialog.new()
options = [ "Liquid", Dumb]
form.addListField( "Spray Type", options, 2)
form.addFloatField( "spray rand in m", 2.0 )

if ( form.show() == GUI_DIALOG_ACCEPTED ):
type = form.getFieldValue( "Spray Type")
rand = form.getFieldValue( "spray rand in m")
if rand <= 0:
randomization = 1
else:
randomization = rand
scene.setGlobalVariableValue("randomization", randomization)

scene.setGlobalVariableValue("name", ocean[0].getName())


if type == 0:
type = "Liquid"
else:
type = "Dumb"


emm = scene.getEmitter("Spray")
if emm == None:
scene.message("adding one")
emm = scene.addEmitter("Fill Object")
emm.setName("Spray")

emm.setParameter("Type", "%s" % type)

scene.setGlobalVariableValue("spray", emm)





if __name__ == "RealFlow":
CustomOceanspray()
Dual Xeon (Sixcore) 2,67GHz | 24GB RAM | Quadro 4000

I'm drinking to drown my problems, but these goddamn bastards can swim!

kslay
Posts: 115
Joined: Fri Oct 08, 2010 8:09 am

CustomOceanSpray RF5 compatible?

Postby kslay » Mon Aug 01, 2011 5:12 pm

thanks for your help bitSeq.

Really appreciate it...

cheers kslay
Dual Xeon (Sixcore) 2,67GHz | 24GB RAM | Quadro 4000

I'm drinking to drown my problems, but these goddamn bastards can swim!

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

CustomOceanSpray RF5 compatible?

Postby scubedio » Tue Aug 02, 2011 6:06 am

Hi dude.... sorry little busy in project work... so i did't checked the forum.... here is the script for RF5 ...its simple... jus i changed the name.......

def onSimulationFrame():
import random
sea = scene.getRealwave()
null = scene.getObject("null")
emm = scene.getEmitter("Type ur Emmiter Name")
seap = sea.getVertices()
nullY = null.getParameter("Position").getY()
randomization = 0.1
for vert in seap:
VertPosY = vert.getPosition().getY()
if (VertPosY>= nullY):
VertPos = vert.getPosition()
VertPosX = vert.getPosition().getX() + random.uniform(-randomization, randomization)
VertPosY = vert.getPosition().getY() + random.uniform(randomization, randomization)
VertPosZ = vert.getPosition().getZ() + random.uniform(-randomization, randomization)
VertVelX= vert.getVelocity().getX()
VertVelY = vert.getVelocity().getY()
VertVelZ = vert.getVelocity().getZ()
NewPos = Vector.new(VertPosX, VertPosY, VertPosZ)
NewVel = Vector.new(VertVelX, VertVelY, VertVelZ)
emm.addParticle(NewPos,NewVel)
pass


try to play with the randomization value and velocity of vert.....u can use random.random() instead of random.uniform.....

this should work......
Rgds
Scubedio

https://vimeo.com/scubedio


Return to “Realflow 5”

Who is online

Users browsing this forum: Google [Bot] and 1 guest