Tips and Tricks: Importing animated meshes to use them as RealWave.

Hi all!

When we have the facility to create a sea mesh in our 3d platform, which has the aspect we want because we applied modifiers to create turbulence, for instance, or any kind of effect for it, we found we can’t load the meshes in RealFlow to use them as a RealWave because the realwave only admit one object as Custom object. Well, I made an example to know how to load any animated meshes and use it as realwave.

- In order to do that we need to create the animated mesh in the 3d platform we want.

- We’ll export the animated mesh to obj sequence. There are several script to export sequences. For 3dsmax you can find some of them in http://www.scriptspot.com/. Remember you’ll need to export the obj as triangulated so RealFlow can read them without problems.

- Once the animated mesh has been exported, open realflow and import the obj sequence. If you have a lot of obj files, there will a lot of objects in RealFlow as well. You can download the obj sequence importer from here . Just paste the path where the obj sequence.

- Apply this script in Simulation Events for FramesPre. There is a bug in Realwave which if you reset the scene and the custom obj parameter doesn’t have any object, RealFlow will freeze. In order to avoid that, put in the maste scrtip in the Simulations Events

def onSimulationBegin():
node = scene.getRealwave()
node.setParameter("Custom obj", "rw_00001")

I add the scene and the script in the same zip to take a look. Remember if you put another name for your mesh, you must change it in the Simulation Events. It is advisable to leave the padding or change it as well.

Download the scene from here

luisM.

~ by luismma on November 14, 2012.

26 Responses to “Tips and Tricks: Importing animated meshes to use them as RealWave.”

  1. This whole process screams for a “Realwave” custom object or as a modifier for 3dsMax; using OBJ sequences can get the job done, but it’s not the smoothest workflow to go through….
    Thanks….

    • Hi Gregg,

      You have right. It is a workaround for something which is not implemented yet. It would be great if realwave could accept animate geometry. We are working to fix this kind of things :)

      luisM.

      • Hey Luis…
        By fixing this i guess you mean that at some point RealFlow will be able to read point caches, right?
        This would be much better of course than having to deal with obj sequences, but still can be a problem as ocean surfaces can be extremely high in geometric detail and that can cause severe slowdowns when caching the data, or reading the data in RealFlow.
        Having said that, i don’t see any other way of allowing RealFlow to “see” animated meshes. The Alembic format would help towards this goal…

      • Hey Gregg,

        You have right, Alembic is a great help but there will be a problem with that format for some 3d platforms I think. As you know, Alembic is free code so there are a few exporters and importers around the web to import/export alembic format. Maya has included alembic, and Houdini as well. But if you try to import alembic from maya as alembic for houdini it couldn’t work because the exporter has different header for both plugins. It has the same problem with the alembic for 3dsmax with Maya and houdini. Alembic needs stability to be a standard format yet. We’ll see Alembic for RF2013 as you saw in the videos working with all 3d platforms which are supporting that format.

        luisM.

  2. Luis, watching the session the mill did on how they used realwave to produce the sea in narnia. how was the resolution so detailed and it didn’t tile. would be great to get some pointers into how to make an ocean surface like that, from the mesh creation to the foam!

  3. This is preety useful I try it and it worked but when I try to generate object splash with this workflow it just crashes realflow?

  4. Hi. Am a begginer working with realwaves.. can you please help me in rendering realwaves in maxwell. how can i bring realistic foam effect on a rough ocean…?
    Thank you…

    • Hey Ganesh,

      do you have your foam already simulated? I guess so. I advice you to mesh it inside RealFlow and then rendering the realwave and the foam mesh together. When rendering a realwave with Maxwell, you should put a plane below the realwave and applying a water material by default. If you try to render with the default values, you’ll see a good sea effect for your realwave. If not, try to put a value of 100 for the Global scale in the maxwell parameters.

      luisM. ;)

      • thanks a lot:) water material with a plane worked out well:) but i don’t know where to apply the foam textures that i have generated… i generated foam textures from crest splash.

  5. Hi I am faceing some problem in the teal flow emiters. Specially with past moving meshes like a,shot were finger is been cut and when I try simulate the particles they just dont react accordingly like a blood shoud behave I hwve tried all the demons for the better results but they were not convice I treid with an object emiters but still not getting the best results. Kindly help

    • Hi ajay,

      Happy new year!

      It depends on the effect you want to achieve, but you have a couple of options to try here. First one, whether you want to use daemons, try to emit from the polygons you need with an object emitter by selecting only the the polygons to emit. The emitter will be deactivated and when it is active, you should apply a high value for the speed parameter, and then animating it to put it to 0 again. Second one is with by using scripting. You can check the distance, either calculating the its distance field or simply the position for both geometries, so you have a control for the area to emit. With a container emitter created in the scene previously, you’ll create new particles for it applying a vector position and velocity you want for the particles.

      I hope it helps.

      luisM. ;)

  6. hola luis, tengo una pregunta, que es nl_realflow.2k.xsiaddon eso sirve para algo tengo que instalarlo? si es asi como se instala?
    gracias espero tu respuesta. saludos

    • Hola Federico,

      Ese es el plugin para conectar RealFlow y XSI. Sin el, XSI no podra importar particulas de RealFlow ni mallas. Para instalarlo en xsi se hace como todos los addons, simplemente arrastralo desde un explorador de archivos a XSI, o desde el menu file Install Addon.

      This is the plugin to connect RealFlow with XSI. Without it, XSI won’t be able to import particles or meshes from RealFlow. In order to install it, just try to drag and drop the file on the XSI interface.

      luisM. :)

  7. thanks the best tips and tricks best animation blog.

  8. Luis, ive tried importing a custom mesh alembic in 2013, it did so just fine, tied it into realwave. but realwave is not processing the data “it just does a snapshot of the data instead of the entire sequence.” any help?

  9. Nevermind! i hijacked your script. removed the incremental OBJ data check.. Running “THIS” modified version “hacked away at it.. but it works perhaps some one could do some cleaning” you can checkrefresh your Alembic data.
    modified version down here
    ————————————————————– Copy past line

    import os

    def realwaveObject(obj, frame):
    nodes = scene.getNodes()
    realW_name = “Custom Wave”
    filename = realW_name
    obj.setParameter( “Custom Obj”, filename)

    node = scene.getRealwave()
    realwaveObject (node, scene.getCurrentFrame())

    • i’m having problems simulating particles on top of custom meshes now like one of the above posters. :C

    • Nice ;)

      But I think you’ll need the alembic sequence because the RealWave won’t know you are changing the object when you run the script. For that reason, you’ll need to load an abc file each frame.

      luisM.

  10. hello Luis! how to use obj sequence as object for RW_Splash?

    • Hi John,

      You’ll need to make a script to load several obj but I think it would be a problem for some frame cause the particle velocities could be alteraded when the object is changing. Do you have the possibility to export to geometry to Alembic?. What I would do is, import the obj with a script, something like this script below

      import sys,os,random
      def onSimulationFrame():
      path = "path where is your objs"
      fileList = os.listdir(path)
      frame = scene.getCurrentFrame()
      for f in fileList:
      if f.endswith (".obj") or f.endswith(".OBJ") :
      if f.startswith("name of your obj_" + frame):
      scene.importObjects(f)
      f.setExportResourcePath(EXPORT_ANIMATION_ABC, path)
      scene.remove(f)

      Once all objects has been exported to alembic file, you can use the stich tool in realflow to convert all alembic file in one single file with animation.

      luisM.

  11. Great article, for some reason the import script can’t find my obj path. Can’t figure out why, I’ve copied over the direct location..everything else works perfectly. OSX and working in RF 2012 6.0.0

    • Hey,

      Usually it is a ” character or something like that. Do you have the script to take a look?

      luisM.

      • Indeed, I believe it was the earlier version I was using (2012), I couldn’t get the sample file to work appropriately, now that I’ve upgraded to 2013 everything is beautiful. Second quick question though, I’ve been meshing my imported obj sequences using the real wave particle layers, obviously there’s a jittering issue from the lack of velocity data or something with the frame by frame generation? Do you know of any solutions for how I could avoid this? Would using a stitched alembic sequence work better? I’ve been able to successfully generate a complete frozen mesh by manually meshing frame by frame (not batch simulating). Any ideas would be great, thanks Luis :)

      • Hey,

        Usually the flickering is due to the number of particles in the scene. Increasing that number there won’t flickering. In the case you can’t increase the number of particles, you’ll need to play with radius parameter and the number of polygons to avoid the flickering. High values for polygon size will do a more flickering mesh, and it is for that reason you would need more particles.

        luisM.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 357 other followers

%d bloggers like this: