Unreal Engine 4 Animation Slot

 admin

Using the Fortune Slot Machine (wheel of fortune), you can easily add a reward system for players in your game. Use the prepared materials to design your own design. Prepared a table with items that can be easily filled. Important/Additional Notes: It is not a prototype slot machine used in casinos. Unreal Engine 4.22. Unreal Engine 4.22 C Transition Guide. Find Help and Answers. Unreal Engine Bug Submission Form. Unreal Slackers. UE4 World-wide user map. Unreal Engine 4 Console Variables and Commands. Elhoussine Mehnik UE4Resources. Mono for Unreal Engine - C# and F#. C, Blueprint, & UE4 Editor Cheat Sheets. So that the slot plays only once for the first effect which initiates the animation (the rest of the effects which coincide with the first montage's play time will simply ignore animation and spawn only sounds and particle system etc.). There is only one method exposed to the Unreal editor for checking if a slot is playing a montage.

When in reality what actually happens is that the function is expecting an animation sequence to use to create an animation montage, and the slot name you pass it is the slot name in the new dynamically generated montage. In fact the first check in the code is to see that it is NOT an animation montage. In this step we trigger the playback of our sequence and tell our Blueprints to start blending in our Slot animation. Unreal Engine 4 Documentation Engine Features Sequencer Editor Sequencer - How To's Blending Gameplay and Sequencer Animation 4.

For my thesis film, “Buds”, I used an experimental feature for Unreal Engine 4 called “Geometry Cache” to import animation. These geometry cache actors can be used when you import an alembic cache file (.abc). In this post, I will briefly talk about my experience using alembic files with UE4.

At the time of writing this, UE4.16 has just been released, and the majority of the film was made using 4.15 or previous versions. While Geometry Cache actors may be fully implemented in future engine versions, the following steps I took to bring in animation from Maya to UE4 using alembic cache will be based on UE4.15.

Using this alembic cache pipeline in the current experimental state is honestly not recommended but doable. I only resulted in using this method due to the way my character rigs were set up, and based on the fact that early small scale tests turned out successful.

Unreal engine 4 animation slot gamesMachine

As an experimental feature, importing alembic cache files may sometimes not be perfect in terms of bringing in animation, geometry, etc information into UE4, even though the cache files read perfectly fine in Maya. Some of the animation or geometry may be missing/broken etc. In this case, you can try using different settings, re-import/exporting, etc. with varying results.

Most of my explanation and steps I took below are from my own testing, trial and error, online research, and luck. Results may vary, especially it being a work in progress for both me using and learning UE4, and geometry cache being implemented into the engine.

Anyway, this is how I managed to get alembic cache files working in Unreal Engine 4 for animation:


Exporting Alembic files (.abc) from Maya:

  • Select ONLY your geometry - Cache - Alembic Cache - Export Selection to Alembic - make sure ‘UV Write’ in the option box is selected, and the file format be set to ‘HDF5’.
    • You can select as many pieces of geometry as you would like for one alembic export file, but the more you select, the larger the file sizes become, and due to the large file size nature of alembic cache, you should group certain geometry together and bring in geometry in sets to reduce risk of data loss/corruption during the cache phase.
    • From my testing, some extra options may need to be checked for accurate geometry and animation information. This result will vary depending on the situation. I have personally checked ‘Write Face Sets’, ‘World Space’, ‘Renderable Only’, ‘Write Visibility’ and ‘Strip Namespaces’ in addition to ‘UV Write’.
    • Unlike importing .fbx files, selecting multiple geometry and exporting them as one alembic file retains its separate geometry information when brought to UE4.
  • Be sure to have your animation exports ALWAYS start at frame 1, and keep the frame range exported under ~500 frames for best results. Going over ~500 frames and/or exporting animation that does not start at frame 1 per alembic cache have resulted in loss of animation information.
    • The fact that animations must start at frame 1 was a realization made after tedious trial and error and pure luck. I have actually posted this on the Unreal Engine Answer Hub and Matt Williams from Epic Games made an official bud report regarding it. You can find my original question posted here: https://answers.unrealengine.com/questions/584143/alembic-cache-import-missing-frames.html and the bug report here: https://issues.unrealengine.com/issue/UE-43973

Importing Alembic files into UE4:

  • There are three types of import options you can chose from: Static Mesh, Geometry Cache, and Skeletal. Select Geometry Cache.
    • CHECK ‘Force One Smoothing Group Per Object’, ‘Recompute Normals’, and UNCHECK ‘Ignore Degenerate Triangles’ while in the import options.
  • Once imported and brought into the scene, set the translate to 0, rotate the object by 90 degrees in the X direction, and make sure to check the ‘Running’ option in its Details section for the animation to start playing once you click ‘Play’.
    • I have noticed that UE4 has a very high tendency to crash upon loading the level if you save the level with geometry cache actors present in the scene. So far, the only way to fix this issue that I have found is to navigate through your UE4 project files, and delete the imported alembic cache files from the project all together, so that they are not present when you load the level. Although this makes it tedious having to re-import your alembic cache files every time you want to come back to a certain level, at least it is a doable workaround.
  • Shaders can be applied to the geometry cache actor similar to static mesh actors. As long as the separate material IDs were applied in Maya before exporting the alembic cache, the geometry cache actor should retain all the separate material slots for you to use.

As a bonus, here’s importing cameras from Maya to UE4:

  • In Maya, select the camera and chose the ‘Game Exporter’ option under ‘File’.
  • Under the ‘Animation Clips’ tab, change to ‘Export Selection’, add the frame range of animation you want to export for the camera, check ‘Bake Animation’, have the ‘Up Axis’ be ‘Y’, and ‘FBX Version’ as ‘FBX 2014/2015’.
  • In UE4, create an Empty Actor, place it at the origin, and rotate it by 90.-90.0.
  • Create a Cine Camera Actor, and place it under the Empty Actor in the World Outliner (the axis that the empty actor need to be rotated by either 90 or -90 may differ, but it should be easy enough for you to figure it out on your own if this is the case. Just look through the Cine Camera and rotate the empty actor until you see the right image!).
  • In the sequencer, drag the Cine Camera Actor into the timeline, right mouse click on the ‘CineCameraActor(#)’ and click ‘Import’
  • Select the exported camera .fbx file.


Unreal Engine 4 Animation Slot Machine

Again, all this was from my own testing, trial and error, and from bits of information that I was able to find online. It is not perfect, and some may just be plain wrong, but it worked for me for my film. If you have any questions, suggestions, or comments, please let me know! I also have a full Google Docs write up of what to do and expect when going from a pure Maya pipeline to using UE4 for rendering that goes beyond animation and alembic cache. If you would like to check it out, let me know and I’ll shoot you the link!

You can visit me at http://www.jameshyun.com/ and contact me at junyoung1861@gmail.com

This might be a little late but for posterity's sake I figured I would answer this question.

PlaySlotAnimation() and PlaySlotAnimationAsDynamicMontage() are a bit strange because the Asset parameter is of the UAnimSequenceBase class, but the function name suggests that you pass it an animation montage (UAnimMontage) and it plays a slot in that montage. When in reality what actually happens is that the function is expecting an animation sequence to use to create an animation montage, and the slot name you pass it is the slot name in the new dynamically generated montage. In fact the first check in the code is to see that it is NOT an animation montage:

So if you pass in an animation montage, the asset will always be marked as NOT valid and the function will exit.

In other words, you can't use PlaySlotAnimation() or PlaySlotAnimationAsDynamicMontage() to play a slot in an animation montage that already exists. You'll just have to create multiple animation montages and use MontagePlay() to play them.

This is a bit of a strange design decision, if someone from Epic could clarify as to why there is not a function to play an animation from an existing montage that would be awesome; maybe I just missed it? The function naming is poor though IMO, something like PlayDynamicMontage() may have been better. I would be interested to hear someone else's thoughts though.

Unreal Engine 4 Animation Slot Free Play

(Referencing code at ea7b5e4da1ca360c4800fc11f1125c3c38f68f12, which is on the 4.19 branch)