.tcl script to create videos from multiple simulations

Dmoreau
Dmoreau Altair Community Member
edited October 2020 in Community Q&A

I have a script to generate multiple .avi videos from multiple LS-Dyna simulations.  In Hyperworks (version 14), I used to be able to just solely script the 'capture animation' command in order to generate the videos. However, I now have to press 'start/pause animation' in order to load the d3plot files into the simulation before being able to capture the animation.  If I do not do this, the program hangs and I am unable to generate a video.  I have found a temporary workaround by disabling one of the graphics cards on my computer to run the script, but I was wondering if anyone else had been able to find something to fix this issue.  The current script I am using is here which does NOT work without my workaround (which I would prefer not to use).  Does anyone know how to fix my script to generate these videos without disabling the graphics card?  We believe that a Windows update has changed something in order to make the old script not work.  I have pasted the old script in red and the new script is underneath that.

 

*OLD*

hwi GetSessionHandle session

session LoadSessionFile front.mvw
session GetAVIExportOptionsHandle myAviOptions
myAviOptions SetFrameRate 10

session CaptureAnimation avi front.avi

 

session LoadSessionFile side.mvw

session CaptureAnimation avi side.avi

 

session LoadSessionFile side_section.mvw
session CaptureAnimation avi side_section.avi

 

session LoadSessionFile side_section_outboard.mvw
session CaptureAnimation avi side_section_outboard.avi

 

 

*NEW*

hwi GetSessionHandle session

session GetProjectHandle project
project GetPageHandle page 1
page GetAnimatorHandle animation
page GetWindowHandle window 1
page StartAnimation

 

session LoadSessionFile front.mvw
session GetAVIExportOptionsHandle myAviOptions
myAviOptions SetFrameRate 10

session CaptureAnimation avi front.avi

 

session LoadSessionFile side.mvw

session CaptureAnimation avi side.avi

 

session LoadSessionFile side_section.mvw
session CaptureAnimation avi side_section.avi

 

session LoadSessionFile side_section_outboard.mvw
session CaptureAnimation avi side_section_outboard.avi

 

session Close
 

 

Tagged:

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited August 2019

    you can start and stop animation using the code. 

     pageH StartAnimation session CaptureAnimation avi side_section.avi pageH StopAnimation

     

  • Dmoreau
    Dmoreau Altair Community Member
    edited August 2019

    Livil,

     

    I added that command into the script, but the capture animation still hangs in the middle.  I will add a few pictures to this post to show what I mean:

     

    After running in powershell, the script hangs here at the capturing phase:

     

    1711541701_HangingCapture.PNG.e25b7757777b74f2347bf7400b5ca70b.PNG

     

    Inside Hyperworks, it looks like this in the bottom left corner.  The bar stops and will not continue forward:

     

    1.PNG.dea50ea0dd8bcabe039b276b01638876.PNG

     

    If I hit play before hand, it shows this in the bottom left corner before going to recording animation:

     

    2.PNG.6c03a26f3c1717fe1ed0f89d8b9fccaa.PNG

     

    And the animation will record.  So far, anything I have tried to script will not 'play' the animation before capturing it (see above script and your comment).

     

    Any other ideas? 

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited August 2019

    Hi Dmoreau,

     

    There may be some issue with graphics card then, see if the script runs n another machine. If it works, you can try reinstalling the graphics driver driver. 

  • Dmoreau
    Dmoreau Altair Community Member
    edited August 2019

    Livil,

     

    All of the devices in our lab have been having this issue, but I will check that out in case something hasn't been updated.

     

    Thank you!

     

     

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.