1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-27 20:11:34 +00:00

Merge branch 'animatedmenus' into 'master'

Render openmw.animation inaccessible in menu and global scripts

See merge request OpenMW/openmw!4674
This commit is contained in:
psi29a 2025-06-06 12:21:01 +00:00
commit 85742a190a
5 changed files with 124 additions and 136 deletions

View file

@ -22,38 +22,26 @@
#include "objectvariant.hpp" #include "objectvariant.hpp"
namespace MWLua namespace MWLua
{
namespace
{ {
using BlendMask = MWRender::Animation::BlendMask; using BlendMask = MWRender::Animation::BlendMask;
using BoneGroup = MWRender::Animation::BoneGroup; using BoneGroup = MWRender::Animation::BoneGroup;
using Priority = MWMechanics::Priority; using Priority = MWMechanics::Priority;
using AnimationPriorities = MWRender::Animation::AnimPriority; using AnimationPriorities = MWRender::Animation::AnimPriority;
MWWorld::Ptr getMutablePtrOrThrow(const ObjectVariant& variant) const MWWorld::Ptr& getMutablePtrOrThrow(const Object& object)
{ {
if (variant.isLObject()) const MWWorld::Ptr& ptr = object.ptr();
throw std::runtime_error("Local scripts can only modify animations of the object they are attached to.");
MWWorld::Ptr ptr = variant.ptr();
if (ptr.isEmpty())
throw std::runtime_error("Invalid object");
if (!ptr.getRefData().isEnabled()) if (!ptr.getRefData().isEnabled())
throw std::runtime_error("Can't use a disabled object"); throw std::runtime_error("Can't use a disabled object");
return ptr; return ptr;
} }
MWWorld::Ptr getPtrOrThrow(const ObjectVariant& variant) MWRender::Animation* getMutableAnimationOrThrow(const Object& object)
{ {
MWWorld::Ptr ptr = variant.ptr(); const MWWorld::Ptr& ptr = getMutablePtrOrThrow(object);
if (ptr.isEmpty())
throw std::runtime_error("Invalid object");
return ptr;
}
MWRender::Animation* getMutableAnimationOrThrow(const ObjectVariant& variant)
{
MWWorld::Ptr ptr = getMutablePtrOrThrow(variant);
auto world = MWBase::Environment::get().getWorld(); auto world = MWBase::Environment::get().getWorld();
MWRender::Animation* anim = world->getAnimation(ptr); MWRender::Animation* anim = world->getAnimation(ptr);
if (!anim) if (!anim)
@ -61,17 +49,16 @@ namespace MWLua
return anim; return anim;
} }
const MWRender::Animation* getConstAnimationOrThrow(const ObjectVariant& variant) const MWRender::Animation* getConstAnimationOrThrow(const Object& object)
{ {
MWWorld::Ptr ptr = getPtrOrThrow(variant);
auto world = MWBase::Environment::get().getWorld(); auto world = MWBase::Environment::get().getWorld();
const MWRender::Animation* anim = world->getAnimation(ptr); const MWRender::Animation* anim = world->getAnimation(object.ptr());
if (!anim) if (!anim)
throw std::runtime_error("Object has no animation"); throw std::runtime_error("Object has no animation");
return anim; return anim;
} }
static AnimationPriorities getPriorityArgument(const sol::table& args) AnimationPriorities getPriorityArgument(const sol::table& args)
{ {
auto asPriorityEnum = args.get<sol::optional<Priority>>("priority"); auto asPriorityEnum = args.get<sol::optional<Priority>>("priority");
if (asPriorityEnum) if (asPriorityEnum)
@ -97,6 +84,7 @@ namespace MWLua
return Priority::Priority_Default; return Priority::Priority_Default;
} }
}
sol::table initAnimationPackage(const Context& context) sol::table initAnimationPackage(const Context& context)
{ {
@ -104,7 +92,6 @@ namespace MWLua
auto view = context.sol(); auto view = context.sol();
auto mechanics = MWBase::Environment::get().getMechanicsManager(); auto mechanics = MWBase::Environment::get().getMechanicsManager();
auto world = MWBase::Environment::get().getWorld();
sol::table api(view, sol::create); sol::table api(view, sol::create);
@ -145,95 +132,95 @@ namespace MWLua
{ "RightArm", BoneGroup::BoneGroup_RightArm }, { "RightArm", BoneGroup::BoneGroup_RightArm },
})); }));
api["hasAnimation"] = [world](const sol::object& object) -> bool { api["hasAnimation"] = [](const LObject& object) -> bool {
return world->getAnimation(getPtrOrThrow(ObjectVariant(object))) != nullptr; return MWBase::Environment::get().getWorld()->getAnimation(object.ptr()) != nullptr;
}; };
// equivalent to MWScript's SkipAnim // equivalent to MWScript's SkipAnim
api["skipAnimationThisFrame"] = [mechanics](const sol::object& object) { api["skipAnimationThisFrame"] = [mechanics](const SelfObject& object) {
MWWorld::Ptr ptr = getMutablePtrOrThrow(ObjectVariant(object)); const MWWorld::Ptr& ptr = getMutablePtrOrThrow(object);
// This sets a flag that is only used during the update pass, so // This sets a flag that is only used during the update pass, so
// there's no need to queue // there's no need to queue
mechanics->skipAnimation(ptr); mechanics->skipAnimation(ptr);
}; };
api["getTextKeyTime"] = [](const sol::object& object, std::string_view key) -> sol::optional<float> { api["getTextKeyTime"] = [](const LObject& object, std::string_view key) -> sol::optional<float> {
float time = getConstAnimationOrThrow(ObjectVariant(object))->getTextKeyTime(key); float time = getConstAnimationOrThrow(object)->getTextKeyTime(key);
if (time >= 0.f) if (time >= 0.f)
return time; return time;
return sol::nullopt; return sol::nullopt;
}; };
api["isPlaying"] = [](const sol::object& object, std::string_view groupname) { api["isPlaying"] = [](const LObject& object, std::string_view groupname) {
return getConstAnimationOrThrow(ObjectVariant(object))->isPlaying(groupname); return getConstAnimationOrThrow(object)->isPlaying(groupname);
}; };
api["getCurrentTime"] = [](const sol::object& object, std::string_view groupname) -> sol::optional<float> { api["getCurrentTime"] = [](const LObject& object, std::string_view groupname) -> sol::optional<float> {
float time = getConstAnimationOrThrow(ObjectVariant(object))->getCurrentTime(groupname); float time = getConstAnimationOrThrow(object)->getCurrentTime(groupname);
if (time >= 0.f) if (time >= 0.f)
return time; return time;
return sol::nullopt; return sol::nullopt;
}; };
api["isLoopingAnimation"] = [](const sol::object& object, std::string_view groupname) { api["isLoopingAnimation"] = [](const LObject& object, std::string_view groupname) {
return getConstAnimationOrThrow(ObjectVariant(object))->isLoopingAnimation(groupname); return getConstAnimationOrThrow(object)->isLoopingAnimation(groupname);
}; };
api["cancel"] = [](const sol::object& object, std::string_view groupname) { api["cancel"] = [](const SelfObject& object, std::string_view groupname) {
return getMutableAnimationOrThrow(ObjectVariant(object))->disable(groupname); return getMutableAnimationOrThrow(object)->disable(groupname);
}; };
api["setLoopingEnabled"] = [](const sol::object& object, std::string_view groupname, bool enabled) { api["setLoopingEnabled"] = [](const SelfObject& object, std::string_view groupname, bool enabled) {
return getMutableAnimationOrThrow(ObjectVariant(object))->setLoopingEnabled(groupname, enabled); return getMutableAnimationOrThrow(object)->setLoopingEnabled(groupname, enabled);
}; };
// MWRender::Animation::getInfo can also return the current speed multiplier, but this is never used. // MWRender::Animation::getInfo can also return the current speed multiplier, but this is never used.
api["getCompletion"] = [](const sol::object& object, std::string_view groupname) -> sol::optional<float> { api["getCompletion"] = [](const LObject& object, std::string_view groupname) -> sol::optional<float> {
float completion = 0.f; float completion = 0.f;
if (getConstAnimationOrThrow(ObjectVariant(object))->getInfo(groupname, &completion)) if (getConstAnimationOrThrow(object)->getInfo(groupname, &completion))
return completion; return completion;
return sol::nullopt; return sol::nullopt;
}; };
api["getLoopCount"] = [](const sol::object& object, std::string groupname) -> sol::optional<size_t> { api["getLoopCount"] = [](const LObject& object, std::string groupname) -> sol::optional<size_t> {
size_t loops = 0; size_t loops = 0;
if (getConstAnimationOrThrow(ObjectVariant(object))->getInfo(groupname, nullptr, nullptr, &loops)) if (getConstAnimationOrThrow(object)->getInfo(groupname, nullptr, nullptr, &loops))
return loops; return loops;
return sol::nullopt; return sol::nullopt;
}; };
api["getSpeed"] = [](const sol::object& object, std::string groupname) -> sol::optional<float> { api["getSpeed"] = [](const LObject& object, std::string groupname) -> sol::optional<float> {
float speed = 0.f; float speed = 0.f;
if (getConstAnimationOrThrow(ObjectVariant(object))->getInfo(groupname, nullptr, &speed, nullptr)) if (getConstAnimationOrThrow(object)->getInfo(groupname, nullptr, &speed, nullptr))
return speed; return speed;
return sol::nullopt; return sol::nullopt;
}; };
api["setSpeed"] = [](const sol::object& object, std::string groupname, const FiniteFloat speed) { api["setSpeed"] = [](const SelfObject& object, std::string groupname, const FiniteFloat speed) {
getMutableAnimationOrThrow(ObjectVariant(object))->adjustSpeedMult(groupname, speed); getMutableAnimationOrThrow(object)->adjustSpeedMult(groupname, speed);
}; };
api["getActiveGroup"] = [](const sol::object& object, MWRender::BoneGroup boneGroup) -> std::string_view { api["getActiveGroup"] = [](const LObject& object, MWRender::BoneGroup boneGroup) -> std::string_view {
if (boneGroup < 0 || boneGroup >= BoneGroup::Num_BoneGroups) if (boneGroup < 0 || boneGroup >= BoneGroup::Num_BoneGroups)
throw std::runtime_error("Invalid bonegroup: " + std::to_string(boneGroup)); throw std::runtime_error("Invalid bonegroup: " + std::to_string(boneGroup));
return getConstAnimationOrThrow(ObjectVariant(object))->getActiveGroup(boneGroup); return getConstAnimationOrThrow(object)->getActiveGroup(boneGroup);
}; };
// Clears out the animation queue, and cancel any animation currently playing from the queue // Clears out the animation queue, and cancel any animation currently playing from the queue
api["clearAnimationQueue"] = [mechanics](const sol::object& object, bool clearScripted) { api["clearAnimationQueue"] = [mechanics](const SelfObject& object, bool clearScripted) {
MWWorld::Ptr ptr = getMutablePtrOrThrow(ObjectVariant(object)); const MWWorld::Ptr& ptr = getMutablePtrOrThrow(object);
mechanics->clearAnimationQueue(ptr, clearScripted); mechanics->clearAnimationQueue(ptr, clearScripted);
}; };
// Extended variant of MWScript's PlayGroup and LoopGroup // Extended variant of MWScript's PlayGroup and LoopGroup
api["playQueued"] = sol::overload( api["playQueued"] = sol::overload(
[mechanics](const sol::object& object, const std::string& groupname, const sol::table& options) { [mechanics](const SelfObject& object, const std::string& groupname, const sol::table& options) {
uint32_t numberOfLoops = options.get_or("loops", std::numeric_limits<uint32_t>::max()); uint32_t numberOfLoops = options.get_or("loops", std::numeric_limits<uint32_t>::max());
float speed = options.get_or("speed", 1.f); float speed = options.get_or("speed", 1.f);
std::string startKey = options.get_or<std::string>("startKey", "start"); std::string startKey = options.get_or<std::string>("startKey", "start");
std::string stopKey = options.get_or<std::string>("stopKey", "stop"); std::string stopKey = options.get_or<std::string>("stopKey", "stop");
bool forceLoop = options.get_or("forceLoop", false); bool forceLoop = options.get_or("forceLoop", false);
MWWorld::Ptr ptr = getMutablePtrOrThrow(ObjectVariant(object)); const MWWorld::Ptr& ptr = getMutablePtrOrThrow(object);
mechanics->playAnimationGroupLua(ptr, groupname, numberOfLoops, speed, startKey, stopKey, forceLoop); mechanics->playAnimationGroupLua(ptr, groupname, numberOfLoops, speed, startKey, stopKey, forceLoop);
}, },
[mechanics](const sol::object& object, const std::string& groupname) { [mechanics](const SelfObject& object, const std::string& groupname) {
MWWorld::Ptr ptr = getMutablePtrOrThrow(ObjectVariant(object)); const MWWorld::Ptr& ptr = getMutablePtrOrThrow(object);
mechanics->playAnimationGroupLua( mechanics->playAnimationGroupLua(
ptr, groupname, std::numeric_limits<int>::max(), 1, "start", "stop", false); ptr, groupname, std::numeric_limits<int>::max(), 1, "start", "stop", false);
}); });
api["playBlended"] = [](const sol::object& object, std::string_view groupName, const sol::table& options) { api["playBlended"] = [](const SelfObject& object, std::string_view groupName, const sol::table& options) {
uint32_t loops = options.get_or("loops", 0u); uint32_t loops = options.get_or("loops", 0u);
MWRender::Animation::AnimPriority priority = getPriorityArgument(options); MWRender::Animation::AnimPriority priority = getPriorityArgument(options);
BlendMask blendMask = options.get_or("blendMask", BlendMask::BlendMask_All); BlendMask blendMask = options.get_or("blendMask", BlendMask::BlendMask_All);
@ -246,33 +233,32 @@ namespace MWLua
const std::string lowerGroup = Misc::StringUtils::lowerCase(groupName); const std::string lowerGroup = Misc::StringUtils::lowerCase(groupName);
auto animation = getMutableAnimationOrThrow(ObjectVariant(object)); auto animation = getMutableAnimationOrThrow(object);
animation->play(lowerGroup, priority, blendMask, autoDisable, speed, start, stop, startPoint, loops, animation->play(lowerGroup, priority, blendMask, autoDisable, speed, start, stop, startPoint, loops,
forceLoop || animation->isLoopingAnimation(lowerGroup)); forceLoop || animation->isLoopingAnimation(lowerGroup));
}; };
api["hasGroup"] = [](const sol::object& object, std::string_view groupname) -> bool { api["hasGroup"] = [](const LObject& object, std::string_view groupname) -> bool {
const MWRender::Animation* anim = getConstAnimationOrThrow(ObjectVariant(object)); const MWRender::Animation* anim = getConstAnimationOrThrow(object);
return anim->hasAnimation(groupname); return anim->hasAnimation(groupname);
}; };
// Note: This checks the nodemap, and does not read the scene graph itself, and so should be thread safe. // Note: This checks the nodemap, and does not read the scene graph itself, and so should be thread safe.
api["hasBone"] = [](const sol::object& object, std::string_view bonename) -> bool { api["hasBone"] = [](const LObject& object, std::string_view bonename) -> bool {
const MWRender::Animation* anim = getConstAnimationOrThrow(ObjectVariant(object)); const MWRender::Animation* anim = getConstAnimationOrThrow(object);
return anim->getNode(bonename) != nullptr; return anim->getNode(bonename) != nullptr;
}; };
api["addVfx"] = [context]( api["addVfx"] = [context](const SelfObject& object, std::string_view model, sol::optional<sol::table> options) {
const sol::object& object, std::string_view model, sol::optional<sol::table> options) {
if (options) if (options)
{ {
context.mLuaManager->addAction( context.mLuaManager->addAction(
[object = ObjectVariant(object), model = std::string(model), [object = Object(object), model = std::string(model),
effectId = options->get_or<std::string>("vfxId", ""), loop = options->get_or("loop", false), effectId = options->get_or<std::string>("vfxId", ""), loop = options->get_or("loop", false),
boneName = options->get_or<std::string>("boneName", ""), boneName = options->get_or<std::string>("boneName", ""),
particleTexture = options->get_or<std::string>("particleTextureOverride", ""), particleTexture = options->get_or<std::string>("particleTextureOverride", ""),
useAmbientLight = options->get_or("useAmbientLight", true)] { useAmbientLight = options->get_or("useAmbientLight", true)] {
MWRender::Animation* anim = getMutableAnimationOrThrow(ObjectVariant(object)); MWRender::Animation* anim = getMutableAnimationOrThrow(object);
anim->addEffect(model, effectId, loop, boneName, particleTexture, useAmbientLight); anim->addEffect(model, effectId, loop, boneName, particleTexture, useAmbientLight);
}, },
@ -281,7 +267,7 @@ namespace MWLua
else else
{ {
context.mLuaManager->addAction( context.mLuaManager->addAction(
[object = ObjectVariant(object), model = std::string(model)] { [object = Object(object), model = std::string(model)] {
MWRender::Animation* anim = getMutableAnimationOrThrow(object); MWRender::Animation* anim = getMutableAnimationOrThrow(object);
anim->addEffect(model, ""); anim->addEffect(model, "");
}, },
@ -289,18 +275,18 @@ namespace MWLua
} }
}; };
api["removeVfx"] = [context](const sol::object& object, std::string_view effectId) { api["removeVfx"] = [context](const SelfObject& object, std::string_view effectId) {
context.mLuaManager->addAction( context.mLuaManager->addAction(
[object = ObjectVariant(object), effectId = std::string(effectId)] { [object = Object(object), effectId = std::string(effectId)] {
MWRender::Animation* anim = getMutableAnimationOrThrow(object); MWRender::Animation* anim = getMutableAnimationOrThrow(object);
anim->removeEffect(effectId); anim->removeEffect(effectId);
}, },
"removeVfxAction"); "removeVfxAction");
}; };
api["removeAllVfx"] = [context](const sol::object& object) { api["removeAllVfx"] = [context](const SelfObject& object) {
context.mLuaManager->addAction( context.mLuaManager->addAction(
[object = ObjectVariant(object)] { [object = Object(object)] {
MWRender::Animation* anim = getMutableAnimationOrThrow(object); MWRender::Animation* anim = getMutableAnimationOrThrow(object);
anim->removeEffects(); anim->removeEffects();
}, },
@ -313,10 +299,9 @@ namespace MWLua
sol::table initWorldVfxBindings(const Context& context) sol::table initWorldVfxBindings(const Context& context)
{ {
sol::table api(context.mLua->unsafeState(), sol::create); sol::table api(context.mLua->unsafeState(), sol::create);
auto world = MWBase::Environment::get().getWorld();
api["spawn"] api["spawn"]
= [world, context](std::string_view model, const osg::Vec3f& worldPos, sol::optional<sol::table> options) { = [context](std::string_view model, const osg::Vec3f& worldPos, sol::optional<sol::table> options) {
if (options) if (options)
{ {
bool magicVfx = options->get_or("mwMagicVfx", true); bool magicVfx = options->get_or("mwMagicVfx", true);
@ -324,16 +309,19 @@ namespace MWLua
float scale = options->get_or("scale", 1.f); float scale = options->get_or("scale", 1.f);
bool useAmbientLight = options->get_or("useAmbientLight", true); bool useAmbientLight = options->get_or("useAmbientLight", true);
context.mLuaManager->addAction( context.mLuaManager->addAction(
[world, model = VFS::Path::Normalized(model), texture = std::move(texture), worldPos, scale, [model = VFS::Path::Normalized(model), texture = std::move(texture), worldPos, scale,
magicVfx, useAmbientLight]() { magicVfx, useAmbientLight]() {
world->spawnEffect(model, texture, worldPos, scale, magicVfx, useAmbientLight); MWBase::Environment::get().getWorld()->spawnEffect(
model, texture, worldPos, scale, magicVfx, useAmbientLight);
}, },
"openmw.vfx.spawn"); "openmw.vfx.spawn");
} }
else else
{ {
context.mLuaManager->addAction([world, model = VFS::Path::Normalized(model), context.mLuaManager->addAction(
worldPos]() { world->spawnEffect(model, "", worldPos, 1.f); }, [model = VFS::Path::Normalized(model), worldPos]() {
MWBase::Environment::get().getWorld()->spawnEffect(model, "", worldPos, 1.f);
},
"openmw.vfx.spawn"); "openmw.vfx.spawn");
} }
}; };

View file

@ -32,7 +32,6 @@ namespace MWLua
sol::state_view lua = context.mLua->unsafeState(); sol::state_view lua = context.mLua->unsafeState();
MWWorld::DateTimeManager* tm = MWBase::Environment::get().getWorld()->getTimeManager(); MWWorld::DateTimeManager* tm = MWBase::Environment::get().getWorld()->getTimeManager();
return { return {
{ "openmw.animation", initAnimationPackage(context) },
{ "openmw.async", { "openmw.async",
LuaUtil::getAsyncPackageInitializer( LuaUtil::getAsyncPackageInitializer(
lua, [tm] { return tm->getSimulationTime(); }, [tm] { return tm->getGameTime(); }) }, lua, [tm] { return tm->getSimulationTime(); }, [tm] { return tm->getGameTime(); }) },
@ -59,6 +58,7 @@ namespace MWLua
initCellBindingsForLocalScripts(context); initCellBindingsForLocalScripts(context);
LocalScripts::initializeSelfPackage(context); LocalScripts::initializeSelfPackage(context);
return { return {
{ "openmw.animation", initAnimationPackage(context) },
{ "openmw.core", initCorePackage(context) }, { "openmw.core", initCorePackage(context) },
{ "openmw.types", initTypesPackage(context) }, { "openmw.types", initTypesPackage(context) },
{ "openmw.nearby", initNearbyPackage(context) }, { "openmw.nearby", initNearbyPackage(context) },

View file

@ -4,7 +4,8 @@
|:ref:`openmw.ambient <Package openmw.ambient>` | by player and menu | | Controls background sounds for given player. | |:ref:`openmw.ambient <Package openmw.ambient>` | by player and menu | | Controls background sounds for given player. |
| | scripts | | | | scripts | |
+------------------------------------------------------------+--------------------+---------------------------------------------------------------+ +------------------------------------------------------------+--------------------+---------------------------------------------------------------+
|:ref:`openmw.animation <Package openmw.animation>` | everywhere | | Animation controls | |:ref:`openmw.animation <Package openmw.animation>` | by local and | | Animation controls |
| | player scripts | |
+------------------------------------------------------------+--------------------+---------------------------------------------------------------+ +------------------------------------------------------------+--------------------+---------------------------------------------------------------+
|:ref:`openmw.async <Package openmw.async>` | everywhere | | Timers and callbacks. | |:ref:`openmw.async <Package openmw.async>` | everywhere | | Timers and callbacks. |
+------------------------------------------------------------+--------------------+---------------------------------------------------------------+ +------------------------------------------------------------+--------------------+---------------------------------------------------------------+

View file

@ -29,7 +29,6 @@ local env = {
aux_util = require('openmw_aux.util'), aux_util = require('openmw_aux.util'),
calendar = require('openmw_aux.calendar'), calendar = require('openmw_aux.calendar'),
time = require('openmw_aux.time'), time = require('openmw_aux.time'),
anim = require('openmw.animation'),
view = require('openmw_aux.util').deepToString, view = require('openmw_aux.util').deepToString,
print = printToConsole, print = printToConsole,
exit = function() player:sendEvent('OMWConsoleExit') end, exit = function() player:sendEvent('OMWConsoleExit') end,

View file

@ -56,7 +56,7 @@
--- ---
-- Skips animations for one frame, equivalent to mwscript's SkipAnim. -- Skips animations for one frame, equivalent to mwscript's SkipAnim.
-- Can be used only in local scripts on self. -- Can only be used on self.
-- @function [parent=#animation] skipAnimationThisFrame -- @function [parent=#animation] skipAnimationThisFrame
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor
@ -99,14 +99,14 @@
--- ---
-- Cancels and removes the animation group from the list of active animations. -- Cancels and removes the animation group from the list of active animations.
-- Can be used only in local scripts on self. -- Can only be used on self.
-- @function [parent=#animation] cancel -- @function [parent=#animation] cancel
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor
-- @param #string groupName -- @param #string groupName
--- ---
-- Enables or disables looping for the given animation group. Looping is enabled by default. -- Enables or disables looping for the given animation group. Looping is enabled by default.
-- Can be used only in local scripts on self. -- Can only be used on self.
-- @function [parent=#animation] setLoopingEnabled -- @function [parent=#animation] setLoopingEnabled
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor
-- @param #string groupName -- @param #string groupName
@ -136,7 +136,7 @@
--- ---
-- Modifies the playback speed of an animation group. -- Modifies the playback speed of an animation group.
-- Note that this is not sticky and only affects the speed until the currently playing sequence ends. -- Note that this is not sticky and only affects the speed until the currently playing sequence ends.
-- Can be used only in local scripts on self. -- Can only be used on self.
-- @function [parent=#animation] setSpeed -- @function [parent=#animation] setSpeed
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor
-- @param #string groupName -- @param #string groupName
@ -144,7 +144,7 @@
--- ---
-- Clears all animations currently in the animation queue. This affects animations played by mwscript, @{openmw.animation#playQueued}, and ai packages, but does not affect animations played using @{openmw.animation#playBlended}. -- Clears all animations currently in the animation queue. This affects animations played by mwscript, @{openmw.animation#playQueued}, and ai packages, but does not affect animations played using @{openmw.animation#playBlended}.
-- Can be used only in local scripts on self. -- Can only be used on self.
-- @function [parent=#animation] clearAnimationQueue -- @function [parent=#animation] clearAnimationQueue
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor
-- @param #boolean clearScripted whether to keep animation with priority Scripted or not. -- @param #boolean clearScripted whether to keep animation with priority Scripted or not.
@ -153,7 +153,7 @@
-- Acts as a slightly extended version of MWScript's LoopGroup. Plays this animation exclusively -- Acts as a slightly extended version of MWScript's LoopGroup. Plays this animation exclusively
-- until it ends, or the queue is cleared using #clearAnimationQueue. Use #clearAnimationQueue and the `startkey` option -- until it ends, or the queue is cleared using #clearAnimationQueue. Use #clearAnimationQueue and the `startkey` option
-- to imitate the behavior of LoopGroup's play modes. -- to imitate the behavior of LoopGroup's play modes.
-- Can be used only in local scripts on self. -- Can only be used on self.
-- @function [parent=#animation] playQueued -- @function [parent=#animation] playQueued
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor
-- @param #string groupName -- @param #string groupName
@ -179,7 +179,7 @@
-- instead of calling this directly. Note that the still hardcoded character controller may at any time and for any reason alter -- instead of calling this directly. Note that the still hardcoded character controller may at any time and for any reason alter
-- or cancel currently playing animations, so making your own calls to this function either directly or through the [AnimationController](interface_animation.html) -- or cancel currently playing animations, so making your own calls to this function either directly or through the [AnimationController](interface_animation.html)
-- interface may be of limited utility. For now, use openmw.animation#playQueued to script your own animations. -- interface may be of limited utility. For now, use openmw.animation#playQueued to script your own animations.
-- Can be used only in local scripts on self. -- Can only be used on self.
-- @function [parent=#animation] playBlended -- @function [parent=#animation] playBlended
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor
-- @param #string groupName -- @param #string groupName
@ -218,7 +218,7 @@
--- ---
-- Plays a VFX on the actor. -- Plays a VFX on the actor.
-- Can be used only in local scripts on self. Can also be evoked by sending an AddVfx event to the target actor. -- Can only be used on self. Can also be evoked by sending an AddVfx event to the target actor.
-- @function [parent=#animation] addVfx -- @function [parent=#animation] addVfx
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor
-- @param #string model path (normally taken from a record such as @{openmw.types#StaticRecord.model} or similar) -- @param #string model path (normally taken from a record such as @{openmw.types#StaticRecord.model} or similar)
@ -249,15 +249,15 @@
--- ---
-- Removes a specific VFX -- Removes a specific VFX.
-- Can be used only in local scripts on self. -- Can only be used on self.
-- @function [parent=#animation] removeVfx -- @function [parent=#animation] removeVfx
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor
-- @param #number vfxId an integer ID that uniquely identifies the VFX to remove -- @param #number vfxId an integer ID that uniquely identifies the VFX to remove
--- ---
-- Removes all vfx from the actor -- Removes all vfx from the actor.
-- Can be used only in local scripts on self. -- Can only be used on self.
-- @function [parent=#animation] removeAllVfx -- @function [parent=#animation] removeAllVfx
-- @param openmw.core#GameObject actor -- @param openmw.core#GameObject actor