Add scripted wave to realwave simulated ERROR in RF5

Discussion about scripting with Python
yjcnbnbnb200
Posts: 21
Joined: Wed Dec 01, 2010 1:15 pm

Add scripted wave to realwave simulated ERROR in RF5

Postby yjcnbnbnb200 » Mon Jan 31, 2011 9:49 am



If only I add a scripted wave type to realflow which is shown in the picture above, my realwave surface stretch and rotate a kind of degree during the whole simulation.

Thougth I add any code in:

der update(vertices, initPosition)
pass

The same thing happened and only in RF5.0.3! In RF 4.2.3 everything is OK! I need help

My steps are very simple:
1.add a realwave
2.in node panel right click on the realwave and add->scripted
3.right nothing and press simulate button
4.error happen


vbk!!!
Posts: 75
Joined: Thu Oct 04, 2007 7:59 am
Contact:

Add scripted wave to realwave simulated ERROR in RF5

Postby vbk!!! » Mon Jan 30, 2012 6:02 pm

The very same thing happen to me !
It sucks !

Maybe its because of the new initPositions parameter ( just a guess)
and the fact the Rwave mesh can be deformed in 3d, not only in the Y axis.
Well I can't use my scripted wave in RF5 or RF2012
Don't know how to deal with initPositions :(

Go back to RF4 for now ...

User avatar
bolek
Posts: 121
Joined: Thu Nov 27, 2008 10:24 am
Contact:

Add scripted wave to realwave simulated ERROR in RF5

Postby bolek » Tue Jan 31, 2012 1:27 am

Hello

I have to admit... weird thing.

Code: Select all

#--------------------------------------------------
# Function: updateWave
# This function is called by the simulation engine
# when it is time to update the wave.
# The parameter is the list of vertices that you have
# to update and the initial positions of those vertices.
# The vertex position represents the displacement respects
# the initial positions.
#--------------------------------------------------
import random
def updateWave( vertices, initPositions ):
   hiVal = 0.05
   yValues = [1,2,3]
   for i in range( 0, len(vertices) ):
      curRnd = (random.random() * hiVal)
      vertices[i] = Vector.new(initPositions[i].getZ(),(yValues[i%3]*curRnd),initPositions[i].getX())

Try this one
____________________________________________
http://vimeo.com/bolekcg
http://bolekcg.blogspot.com/

vbk!!!
Posts: 75
Joined: Thu Oct 04, 2007 7:59 am
Contact:

Add scripted wave to realwave simulated ERROR in RF5

Postby vbk!!! » Tue Jan 31, 2012 10:07 am

Thanks Bolek,

I will try asap.

What's this : "[i%3]" in your code. Modulo ? For what ?

++
Vincent

User avatar
bolek
Posts: 121
Joined: Thu Nov 27, 2008 10:24 am
Contact:

Add scripted wave to realwave simulated ERROR in RF5

Postby bolek » Tue Jan 31, 2012 9:33 pm

Hi

Modulo operator
http://www.youtube.com/watch?v=2Tg9FxIajho

What's this : "[i%3]" in your code. Modulo ? For what ?
- This is just sample of basic "custom" RW. You don't need to use %.
It was written only for testing purposes and to show you how to avoid that crazy displacement ... nothing more. : )

best
____________________________________________
http://vimeo.com/bolekcg
http://bolekcg.blogspot.com/

vbk!!!
Posts: 75
Joined: Thu Oct 04, 2007 7:59 am
Contact:

Add scripted wave to realwave simulated ERROR in RF5

Postby vbk!!! » Thu Feb 02, 2012 4:54 pm

ok bolek !

You made me discover one of greatest youtube channel in the history of youtube channels !


thx

++
Vincent


Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 2 guests