Jump to content
Dmoreau

.tcl script to create videos from multiple simulations

Recommended Posts

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
 

 

Share this post


Link to post
Share on other sites

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? 

Share this post


Link to post
Share on other sites

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!

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...