🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

.tcl script to create videos from multiple simulations

User: "Dmoreau"
Altair Community Member
Updated by Dmoreau

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
 

 

Find more posts tagged with

Sort by:
1 - 4 of 41
    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499

    you can start and stop animation using the code. 

     pageH StartAnimation session CaptureAnimation avi side_section.avi pageH StopAnimation

     

    User: "Dmoreau"
    Altair Community Member
    OP
    Updated by Dmoreau

    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? 

    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499

    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. 

    User: "Dmoreau"
    Altair Community Member
    OP
    Updated by Dmoreau

    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!