From: smh Date: Thu, 22 Apr 2004 07:26:16 +0000 (+0000) Subject: Add animation testing X-Git-Tag: Merge_300404~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=67994f4ab9b09b6b9abe4236b41af3387b452475;p=modules%2Fvisu.git Add animation testing --- diff --git a/src/VISU_SWIG/batchmode_visu_view3d.py b/src/VISU_SWIG/batchmode_visu_view3d.py index fa2034a7..2aa8fa4a 100644 --- a/src/VISU_SWIG/batchmode_visu_view3d.py +++ b/src/VISU_SWIG/batchmode_visu_view3d.py @@ -138,3 +138,29 @@ time.sleep(aDelay) myView.RestoreViewParams('BBB'); print "myView.RestoreViewParams('BBB')" + +# Time animation +myView.EraseAll() +medFile = "TimeStamps.med" +myFieldName = "vitesse"; + +medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile +myResult = myVisu.ImportFile(medFile) + +anAnim = myVisu.CreateAnimation(myView); +aSObj = myStudy.FindObjectIOR(myResult.GetID()) +aSObj = aSObj.FindSubObject(1)[1] +aSObj = aSObj.FindSubObject(2)[1] +aSObj = aSObj.FindSubObject(2)[1] +anAnim.addField(aSObj) +anAnim.setPresentationType(0,VISU.TISOSURFACE) +print "Generate presentations" +anAnim.generatePresentations(0) +print "Generate frames" +anAnim.generateFrames() +print "Start Animation" +anAnim.setSpeed(12) +#anAnim.setCycling(1) +anAnim.startAnimation() +myView.FitAll() +#anAnim.clearView() diff --git a/src/VISU_SWIG/visu_view3d.py b/src/VISU_SWIG/visu_view3d.py index ea6d8ec2..92c0b2b6 100644 --- a/src/VISU_SWIG/visu_view3d.py +++ b/src/VISU_SWIG/visu_view3d.py @@ -138,3 +138,29 @@ time.sleep(aDelay) myView.RestoreViewParams('BBB'); print "myView.RestoreViewParams('BBB')" + +# Time animation +myView.EraseAll() +medFile = "TimeStamps.med" +myFieldName = "vitesse"; + +medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile +myResult = myVisu.ImportFile(medFile) + +anAnim = myVisu.CreateAnimation(myView); +aSObj = myStudy.FindObjectIOR(myResult.GetID()) +aSObj = aSObj.FindSubObject(1)[1] +aSObj = aSObj.FindSubObject(2)[1] +aSObj = aSObj.FindSubObject(2)[1] +anAnim.addField(aSObj) +anAnim.setPresentationType(0,VISU.TISOSURFACE) +print "Generate presentations" +anAnim.generatePresentations(0) +print "Generate frames" +anAnim.generateFrames() +print "Start Animation" +anAnim.setSpeed(12) +#anAnim.setCycling(1) +anAnim.startAnimation() +myView.FitAll() +#anAnim.clearView()