.tcl script to create videos from multiple simulations
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
Answers
-
you can start and stop animation using the code.
pageH StartAnimation session CaptureAnimation avi side_section.avi pageH StopAnimation
0 -
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:
Inside Hyperworks, it looks like this in the bottom left corner. The bar stops and will not continue forward:
If I hit play before hand, it shows this in the bottom left corner before going to recording animation:
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?
0 -
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.
0 -
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!
0