<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=HPL3%2FSOMA%2FAnimation%2FAnimation_Overview</id>
	<title>HPL3/SOMA/Animation/Animation Overview - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=HPL3%2FSOMA%2FAnimation%2FAnimation_Overview"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Animation/Animation_Overview&amp;action=history"/>
	<updated>2026-10-04T03:47:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Animation/Animation_Overview&amp;diff=7333&amp;oldid=prev</id>
		<title>TiMan: Add a SOMA-file-verified animation overview covering source/cache formats, entity registration, skeleton compatibility, events, transitions, scripting, and workflow.</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Animation/Animation_Overview&amp;diff=7333&amp;oldid=prev"/>
		<updated>2026-10-02T17:16:47Z</updated>

		<summary type="html">&lt;p&gt;Add a SOMA-file-verified animation overview covering source/cache formats, entity registration, skeleton compatibility, events, transitions, scripting, and workflow.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;An '''animation''' changes an entity's mesh over time. In SOMA, an exported animation source is registered on an entity under a playable name. Scripts and entity logic play that registered name rather than referring to the source filename directly.&lt;br /&gt;
&lt;br /&gt;
== Animation pipeline ==&lt;br /&gt;
&lt;br /&gt;
A typical SOMA animation passes through four stages:&lt;br /&gt;
&lt;br /&gt;
# A mesh and its skeleton or animated nodes are prepared in a 3D application.&lt;br /&gt;
# Each animation clip is exported to a source file, usually &amp;lt;code&amp;gt;.dae_anim&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.fbx&amp;lt;/code&amp;gt; in the shipped game.&lt;br /&gt;
# The clip is added to an entity's &amp;lt;code&amp;gt;Animations&amp;lt;/code&amp;gt; section in &amp;lt;code&amp;gt;ModelEditor.exe&amp;lt;/code&amp;gt;, where it receives a name and playback settings.&lt;br /&gt;
# Loading the source produces an &amp;lt;code&amp;gt;.anm&amp;lt;/code&amp;gt; cache used by the engine.&lt;br /&gt;
&lt;br /&gt;
The installed SOMA entities contain 1,490 animation registrations. Of these, 1,379 reference &amp;lt;code&amp;gt;.dae_anim&amp;lt;/code&amp;gt; files and 110 reference &amp;lt;code&amp;gt;.fbx&amp;lt;/code&amp;gt; files. After deduplicating those registrations, 879 referenced source files are present in the installation; 866 have a same-stem &amp;lt;code&amp;gt;.anm&amp;lt;/code&amp;gt; cache.&lt;br /&gt;
&lt;br /&gt;
The source file remains the editable input. The &amp;lt;code&amp;gt;.anm&amp;lt;/code&amp;gt; is generated engine data, not a replacement for the source animation.&lt;br /&gt;
&lt;br /&gt;
== Entity animation registration ==&lt;br /&gt;
&lt;br /&gt;
Animations are stored inside the entity's &amp;lt;code&amp;gt;Animations&amp;lt;/code&amp;gt; element. A simple shipped registration is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Animation&lt;br /&gt;
    Name=&amp;quot;open&amp;quot;&lt;br /&gt;
    File=&amp;quot;entities/urban/toilet/shower_curtain/shower_curtain_open.fbx&amp;quot;&lt;br /&gt;
    Layer=&amp;quot;Default&amp;quot;&lt;br /&gt;
    Speed=&amp;quot;1&amp;quot;&lt;br /&gt;
/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This entry belongs to &amp;lt;code&amp;gt;entities/urban/toilet/shower_curtain/shower_curtain.ent&amp;lt;/code&amp;gt;. The same entity's mesh is &amp;lt;code&amp;gt;shower_curtain.fbx&amp;lt;/code&amp;gt;; the entity records seven bones and uses a separate &amp;lt;code&amp;gt;shower_curtain_open.anm&amp;lt;/code&amp;gt; cache for the animation source.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Attribute !! Purpose established by SOMA data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Name&amp;lt;/code&amp;gt; || Name used by scripts and entity behavior to select the animation.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;File&amp;lt;/code&amp;gt; || Mod-relative path to the exported animation source.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Layer&amp;lt;/code&amp;gt; || Animation layer. &amp;lt;code&amp;gt;Default&amp;lt;/code&amp;gt; is present on 1,387 of the 1,490 inspected registrations; 103 registrations omit this attribute.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Speed&amp;lt;/code&amp;gt; || Playback-speed multiplier. &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; is the most common shipped value, but SOMA also uses values below and above 1.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SpecialEventTime&amp;lt;/code&amp;gt; || Optional stored time value present on 103 inspected registrations. Its exact runtime purpose is not documented by the inspected scripts, so it should not be assigned a meaning without testing.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Skeleton and channel compatibility ==&lt;br /&gt;
&lt;br /&gt;
An animation source contains channels targeting named nodes or bones. All 876 installed &amp;lt;code&amp;gt;.dae_anim&amp;lt;/code&amp;gt; files parsed successfully and contain at least one channel. Targets include transformation matrices, translation, rotation, scale, and visibility.&lt;br /&gt;
&lt;br /&gt;
The animation must match the entity mesh's expected hierarchy closely enough for those targets to resolve. SOMA's executable reports specific errors when:&lt;br /&gt;
&lt;br /&gt;
* the skeleton stored in the mesh differs from the skeleton saved in the &amp;lt;code&amp;gt;.ent&amp;lt;/code&amp;gt; file;&lt;br /&gt;
* vertices in a skinned submesh are not connected to a bone;&lt;br /&gt;
* a vertex is influenced by more than four bones; or&lt;br /&gt;
* an animation, transition animation, previous animation, or socket cannot be found.&lt;br /&gt;
&lt;br /&gt;
Treat bone and node names as stable identifiers. Re-exporting the mesh with renamed or reorganized bones can invalidate both saved entity data and existing animation clips.&lt;br /&gt;
&lt;br /&gt;
== Events and transitions ==&lt;br /&gt;
&lt;br /&gt;
Animation behavior can be extended in the Model Editor without changing the source clip.&lt;br /&gt;
&lt;br /&gt;
=== Events ===&lt;br /&gt;
&lt;br /&gt;
An event is attached to a time in a registered animation. The 580 inspected shipped event entries all store &amp;lt;code&amp;gt;Name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Time&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Type&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;DestSocket&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Value&amp;lt;/code&amp;gt;. Event types used by shipped SOMA entities are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;PlaySound&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;PlayLoopSound&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;StopLoopSound&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CreateParticle&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Message&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The engine also declares a &amp;lt;code&amp;gt;Step&amp;lt;/code&amp;gt; event type, although no shipped event of that type was found in the inspected entity registrations.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;lt;code&amp;gt;robot_arm_welding.ent&amp;lt;/code&amp;gt; attaches looped movement sound, weld sounds, particle creation at named sockets, and a stop-loop event to its &amp;lt;code&amp;gt;welding&amp;lt;/code&amp;gt; animation.&lt;br /&gt;
&lt;br /&gt;
=== Transitions ===&lt;br /&gt;
&lt;br /&gt;
A transition selects a bridging animation when changing from a specified previous animation to the target animation. SOMA's shipped entities contain 204 transition entries. Their stored fields include the transition name, bridging animation name, optional previous-animation name, and minimum/maximum timing values.&lt;br /&gt;
&lt;br /&gt;
Transitions are entity registration data. The source clips for the base and bridge animations must each be exported and registered before the transition can resolve them.&lt;br /&gt;
&lt;br /&gt;
== Playing a registered animation ==&lt;br /&gt;
&lt;br /&gt;
SOMA's script API exposes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Entity_PlayAnimation(&lt;br /&gt;
    const tString &amp;amp;in asEntityName,&lt;br /&gt;
    const tString &amp;amp;in asAnimation,&lt;br /&gt;
    float afFadeTime = 0.1f,&lt;br /&gt;
    bool abLoop = false,&lt;br /&gt;
    bool abPlayTransition = true,&lt;br /&gt;
    const tString &amp;amp;in asCallback = &amp;quot;&amp;quot;&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The callback signature recorded by the SOMA API is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void Callback(const tString &amp;amp;in asEntityName, const tString &amp;amp;in asAnimName)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For entities with a character-mover component, &amp;lt;code&amp;gt;CharMover_PlayAnimation&amp;lt;/code&amp;gt; provides the same animation name, fade, loop, transition, and callback concepts through that component.&lt;br /&gt;
&lt;br /&gt;
SOMA also exposes functions to stop an entity animation, pause or resume a named animation, set its relative time position, and receive message-event callbacks.&lt;br /&gt;
&lt;br /&gt;
== Practical workflow ==&lt;br /&gt;
&lt;br /&gt;
# Export one short clip using the same mesh hierarchy, node names, scale convention, and axis setup as the entity mesh.&lt;br /&gt;
# Add the clip to the entity in the Model Editor and give it a unique, stable &amp;lt;code&amp;gt;Name&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Leave &amp;lt;code&amp;gt;Speed&amp;lt;/code&amp;gt; at &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for the first test and use the default layer unless the entity has a verified layered setup.&lt;br /&gt;
# Open Entity Preview, select the registered animation, and test playback, looping, the skeleton display, and the timeline.&lt;br /&gt;
# Add events only after basic playback works. Verify referenced sockets, sounds, and particle systems separately.&lt;br /&gt;
# Add transitions only after every base and bridge animation plays by itself.&lt;br /&gt;
# Save the entity, place it in a test map, and play the registered name from the relevant entity logic or script.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[HPL3/SOMA/Modeling/Exporting Animations|Exporting Animations]]&lt;br /&gt;
* [[HPL3/SOMA/Modeling/Importing Animations|Importing Animations]]&lt;br /&gt;
* [[HPL3/Entities/Adding Animations to Entities|Animation registration controls]]&lt;br /&gt;
* [[HPL3/Entities/Model Preview Settings|Entity Preview controls]]&lt;br /&gt;
* [[HPL3/SOMA/Audition/Lip Sync|Lip Sync]]&lt;br /&gt;
&lt;br /&gt;
[[Category:English]]&lt;/div&gt;</summary>
		<author><name>TiMan</name></author>
		
	</entry>
</feed>