[Paraview] RE : using with python - VTK multifiles animate

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Mon Jul 6 08:39:46 EDT 2009


Oops, I should have looked at your original script more closely.
LegacyVTKReader can read multiple files on it's own, you don't have to
create separate readers for each file.
Try the following:

from paraview.simple import *
Connect('localhost')

files = ["/home/myrrha/test4/coupe01.vtk",
"/home/myrrha/test4/coupe02.vtk",
"/home/myrrha/test4/coupe03.vtk",
"/home/myrrha/test4/coupe04.vtk"]

reader = servermanager.sources.LegacyVTKReader(FileNames=files)

Show(reader)
Render()

AnimateReader(reader)

Utkarsh

On Mon, Jul 6, 2009 at 4:35 AM, BOUSSOIR Jonathan
167706<Jonathan.BOUSSOIR at cea.fr> wrote:
> Hi Utkarsh,
>
> Thank you for your answer.
> I had tried with AnimateReader but it didn't animate multifile.
> I don't seen how to do.
> Thanks in advance for your kind help.
>
> Regards,
> Jona
>
> my script:
>
> from paraview.simple import *
> Connect('localhost')
>
> files = ["/home/myrrha/test4/coupe01.vtk",
> "/home/myrrha/test4/coupe02.vtk",
> "/home/myrrha/test4/coupe03.vtk",
> "/home/myrrha/test4/coupe04.vtk"]
>
> readers = []
> for f in files:
>    reader = servermanager.sources.LegacyVTKReader(FileNames=f)
>    readers.append(reader)
>
> Show(readers[0])
> Render()
>
> AnimateReader(readers)
>
>
>
>
>
>
>
>
>
> -------- Message d'origine--------
> De: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com]
> Date: ven. 03/07/2009 15:02
> À: BOUSSOIR Jonathan 167706
> Cc: paraview at paraview.org
> Objet : Re: [Paraview] using with python - VTK multifiles animate
>
> Doesn't the following work?
>
>> simple.AnimateReader(yourreader)
>
> If it does take a look at the implementation in
> ParaView3Source/Utilities/VTKPythonWrapping/paraview/simple.py
>
> Utkarsh
>
>
> On Thu, Jul 2, 2009 at 6:01 AM, BOUSSOIR Jonathan
> 167706<Jonathan.BOUSSOIR at cea.fr> wrote:
>>
>> Hi all,
>>
>> I am work with Paraview (3.7) and with linux.
>> I had done on Paraview to load VTK multifigure and clic a play button to see animation.
>> I would like to do a same on Pythyn with paraview and I don't know how to do the animation.
>>
>>
>> from paraview.simple import *
>> Connect('localhost')
>>
>> f = ["coupe01.vtk", "coupe02.vtk", "coupe03.vtk", "coupe04.vtk"]
>> readers = []
>> for f in files:
>>    reader = servermanager.sources.LegacyVTKReader(FileNames=f)
>>    readers.append(reader)
>>
>> Show(readers[0])
>> Render()
>>
>> # Create an animation scene
>> scene = servermanager.animation.AnimationScene()
>> # Add one view
>> scene.ViewModules = [GetActiveView()]
>>
>> # Create a cue to animate the StartTheta property
>> cue = servermanager.animation.KeyFrameAnimationCue()
>> cue.AnimatedProxy = GetActiveSource()
>>
>> # Add it to the scene's cues
>> scene.Cues = [cue]
>> ....
>>
>> After, I don't know how I would done ?
>> Do you have a small pyphon script to explain or if somebody can explained me how I can do.
>>
>> Thanks in advance for your kind help.
>>
>> Regards,
>> Jona
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>
>


More information about the ParaView mailing list