When I try to create a video with the BVH_Xsens model, no matter what, I always get the stick-figure model displayed on the background behind the actual MS model.
I already verified that the macro operation, InverseDynamicView, is executed as part of the operation that I want to record (InverseDynamics), which should hide the stick-figure, but still I get that into my video:
I also tried to manually set the InverseDynamicView before creating the video, but it doesn’t help.
Another very weird thing: if I right-click on the stick-figure in the model view and select Main.ModelSetup.BVHFileData > This objects + all levels > Hide, then I don’t see the stick-figure in the video, but the MS model doesn’t move from its initial position!
The only way I found, at the moment, to have the stick-figure not ending up in the video is to set Main.ModelSetup.BVHFileData.ModelDrawOnOff to Off:
Hi Marco. There are some quirks when recording videos. As you have experienced, it doesn't respect the views you set after the model has loaded. But if you hide stuff on the script it should work. I really hope this will be fixed for the 7.3 release. It is on the backlog but there are a lot of things fighting for priority
When I run the Create_video operation, it produces pictures frame by frame (I can see in the file manager) but after that the operation has ended, all of the pictures are deleted and there is no .mp4 or .gif file available in the windows file manager! What am I doing wrong?
Sorry. The scripts really needs a better error messages when that happens. It is probably faiing to find ffmpeg on you system. It uses ffmpeg to convert the images to videos. To fix this either install ffmpeg from here: https://ffmpeg.zeranoe.com/builds/ and make sure it is on the Windows PATH. Alternatively just place the ffmpeg binary (ffmpeg.exe) together with the main file of your model.
I would like to ask how can I make a rotating animation of my model? Which lines of the scripts should I change for this purpose?
VideoLookAtCamera MyCam (UP_DIRECTION=y, _AUTO_PLAY_VIDEOS=1) =
{
// The point the camera focus on.
CameraLookAtPoint = {3, 1, .5};
// The vertical field of view in meters (the lower the zoomer)
CameraFieldOfView = 2.5;
// The direction in which the camera is placed. In global
// coordinate with respect to the LookAtPoint.
// (Can also be a time varying vector)
CameraDirection = {2, 0.35, 1};
// The background color used for the video
BackgroundColor = {1, 1, 1};
// Determines the speed of the video. Setting it to
// nStep/(tEnd-tStart) make the video run in real time.
VideoInputFrameRate = 10;
VideoResolution = {1920, 1080};
// The operations which should be included in the video.
Analysis = {
AnyOperation &ref = Main.RunAnalysis.InverseDynamics;
};
};
I think I should define a time varying vector for CameraDirection and CameraLookAtPoint? But how can I define a time varying vectors in Anyscript?
Please have a look at the following example. I was looking for creating the animation with a rotating camera and I was able to do it using the example. Please note the requirement on putting a reference to the camera object within the study.