Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
0.8.4:animations [2022/05/03 12:20] – external edit 127.0.0.1 | 0.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(' | ||
+ | |||
+ | // 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, | ||
+ | LOpts.AdditionalAnimations[0] := ' | ||
+ | LOpts.AdditionalAnimations[1] := ' | ||
+ | |||
+ | // limit the size of loaded textures (optional) | ||
+ | LOpts.TextureLimits := Point(512, 512); | ||
+ | |||
+ | GorillaModel1 := TGorillaModel.LoadModelFromFile(GorillaViewport1, | ||
+ | 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(); | ||
+ | </ | ||
===== Post-loading of model-animations ===== | ===== Post-loading of model-animations ===== |