MCPcopy Create free account
hub / github.com/defold/defold / CancelAnimations

Function CancelAnimations

engine/gameobject/src/gameobject/comp_anim.cpp:618–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

616 }
617
618 PropertyResult CancelAnimations(HCollection collection, HInstance instance, dmhash_t component_id,
619 dmhash_t property_id)
620 {
621 if (instance == 0)
622 return PROPERTY_RESULT_INVALID_INSTANCE;
623
624 AnimWorld* world = GetWorld(collection);
625 uint16_t* head_ptr = world->m_InstanceToIndex.Get((uintptr_t)instance);
626 if (property_id == 0)
627 {
628 StopAnimations(world, head_ptr, component_id, 0);
629 return PROPERTY_RESULT_OK;
630 }
631 PropertyDesc prop_desc;
632 PropertyOptions property_opt;
633 AddPropertyOptionsIndex(&property_opt, 0);
634 PropertyResult prop_result = GetProperty(instance, component_id, property_id, property_opt, prop_desc);
635 if (prop_result != PROPERTY_RESULT_OK)
636 {
637 return prop_result;
638 }
639 uint32_t element_count = GetElementCount(prop_desc.m_Variant.m_Type, prop_desc.m_ElementIds);
640 if (element_count == 0)
641 {
642 return PROPERTY_RESULT_UNSUPPORTED_TYPE;
643 }
644 StopAnimations(world, head_ptr, component_id, property_id);
645 if (element_count > 1)
646 {
647 for (uint32_t i = 0; i < element_count; ++i)
648 {
649 StopAnimations(world, head_ptr, component_id, prop_desc.m_ElementIds[i]);
650 }
651 }
652 return PROPERTY_RESULT_OK;
653 }
654
655 void CancelAnimations(HCollection collection, HInstance instance)
656 {

Callers 3

Script_CancelAnimationsFunction · 0.85
DoDeleteInstanceFunction · 0.85
TEST_FFunction · 0.85

Calls 13

StopAnimationsFunction · 0.85
AddPropertyOptionsIndexFunction · 0.85
StopAllAnimationsFunction · 0.85
StopAnimationFunction · 0.85
RemoveAnimationCallbackFunction · 0.85
GetWorldFunction · 0.70
GetPropertyFunction · 0.70
GetElementCountFunction · 0.70
GetMethod · 0.45
SizeMethod · 0.45
PushMethod · 0.45
BeginMethod · 0.45

Tested by 1

TEST_FFunction · 0.68