Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
0.8.4:animations [2022/05/03 12:20] – external edit 127.0.0.10.8.4:animations [2022/05/03 13:18] (current) – [Loading of model-animations during import] admin
Line 6: Line 6:
 By the animation manager you are allowed to browse through all available animations and to playback or stop those. By the animation manager you are allowed to browse through all available animations and to playback or stop those.
  
 +
 +===== Loading of model-animations during import =====
 +
 +Setting up a TGorillaLoadOptions record enables to import animations directly with importing the model itself.
 +
 +Since 0.8.4.+ you are allowed to use this way for //DAE// or //FBX// files.
 +
 +<file pascal>
 +var LOpts : TGorillaLoadOptions;
 +LOpts := TGorillaLoadOptions.Create('C:\Bellydancing.dae', nil);
 +
 +// forbid to import light instances (optional)
 +LOpts.ImportLights := false;
 +// forbid to import camera instances (optional)
 +LOpts.ImportCameras := false;
 +
 +// setup automatically loaded animations
 +LOpts.ImportAnimations := true;
 +
 +// setup an array of fixed size with filenames
 +System.SetLength(LOpts.AdditionalAnimations, 2);
 +LOpts.AdditionalAnimations[0] := 'C:\Idle.dae';
 +LOpts.AdditionalAnimations[1] := 'C:\Walk.dae';
 +
 +// limit the size of loaded textures (optional)
 +LOpts.TextureLimits := Point(512, 512);
 +
 +GorillaModel1 := TGorillaModel.LoadModelFromFile(GorillaViewport1, LOpts);
 +GorillaModel1.Parent := GorillaViewport1;
 +
 +// get first animation found and playback
 +// CAUTION: it is not the first animation you have imported. It is the first animation could be found in animation-name-hashmap.
 +var LAnim : TGorillaAnimation;
 +LAnim := GorillaModel1.AnimationManager.Current;
 +LAnim.Start();
 +</file>
  
 ===== Post-loading of model-animations ===== ===== Post-loading of model-animations =====