skip to main |
skip to sidebar
Be successful from home
Study at your own pace.
======================= ============== Hi all, I rewrote a animation script with the new module servermanager in Paraview 3.7. I don't understand why the moving is different with old module severmanager. I had attached the 2 scripts in my email. Thanks in advance for your kind help. Regards, Jona from paraview.servermanager import * from paraview import servermanager # Initialization to set up some visualization connection = servermanager.Connect('localhost') cylinder = sources.CylinderSource() view = CreateRenderView() repr = CreateRepresentation( cylinder , view) view.ResetCamera() # Create an animation scene scene = animation.AnimationScene() # Add the view to the scene scene.ViewModules = [view] # Set the number of frame in one loop. scene.NumberOfFrames = 1000 # Create an animation cue for the camera. This represents the "track" shown in # the Animation View. cue = animation.CameraAnimationCue() cue.AnimatedProxy = view # Add this cue to the scene. scene.Cues = [cue] # Now create keyframes. Let's say we are going to orbit around the object. camera = view.GetActiveCamera() num_of_keyframes = 10 for i in range(0, num_of_keyframes): camera.Azimuth(360.0/num_of_keyframes) keyframe = animation.CameraKeyFrame() # set the value of the key frame to the current camera location. keyframe.KeyTime = i*1.0/num_of_keyframes keyframe.Position = camera.GetPosition() keyframe.FocalPoint = camera.GetFocalPoint() keyframe.ViewUp = camera.GetViewUp() keyframe.ViewAngle = camera.GetViewAngle() cue.KeyFrames.append(keyframe) # Play the animation scene.Play() #!/usr/bin/python # -*- coding: UTF-8 -*- from paraview.simple import * Connect('localhost') cylinder = Cylinder () Show( cylinder ) ResetCamera() # find view object view = GetActiveView() # Create an animation scene scene = servermanager.animation.AnimationScene() # Add the view to the scene scene.ViewModules = [view] # Set the number of frame in one loop. scene.NumberOfFrames = 1000 # Create an animation cue for the camera. This represents the "track" shown in cuethe Animation View. cue = servermanager.animation.KeyFrameAnimationCue() cue.AnimatedProxy = [view] # Add this cue to the scene. scene.Cues = [cue] # Now create keyframes. Let's say we are going to orbit around the object. camera = view.GetActiveCamera() num_of_keyframes = 10 listKeyframe = [] for i in range(0, num_of_keyframes): camera.Azimuth(360.0/num_of_keyframes) keyframe = servermanager.animation.CameraKeyFrame() # set the value of the key frame to the current camera location. keyframe.KeyTime = i*1.0/num_of_keyframes keyframe.Position = camera.GetPosition() keyframe.FocalPoint = camera.GetFocalPoint() keyframe.ViewUp = camera.GetViewUp() keyframe.ViewAngle = camera.GetViewAngle() listKeyframe.append(keyframe) #cue.KeyFrames.append(keyframe) because 'append' don't exist for this object cue.KeyFrames = listKeyframe # Play the animation scene.Play() _______________________________________________ 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 Stephen Gillen wrote: Hello, I had a similar problem in which was looking to plot the pressure on the surface of a tube in a flow. The way I did it was to Extract Block -> Connectivity -> Scatter plot. Berk Geveci wrote: Hi Stephen, This is a feature we are looking at implementing for the next release. Just a question though, how did you generate the line? extract surface -> connectivity filter -> threshold filter + slice in z I forgot an important element in the procedure. I have a table entry that assigns a number to all vertices, each surface has a non-zero value. The interior values are 0. The cylinder surface value was -3. Therefore when I clicked threshold with min/max values of -3, all the other surfaces disappeared and the cylinder surface remained. Then slice in z produced the attached figure. Hope this is more clear. I added Scatter plot extract surface -> connectivity filter -> threshold filter + slice in z > Scatter plot To get the attached figure, but I do not know what the x-axis is, looks like degrees. Stephen begin:vcard fn:Stephen Wornom n:Wornom;Stephen email;internet: step ... @sophia.inria.fr tel;work:04 92 38 50 54 x-mozilla-html:TRUE version:2.1 end:vcard _______________________________________________ ParaView mailing list Para ... @paraview.org http://www.paraview.org/mailman/listinfo/paraview