AnimGraphComponentNotificationBus is not reflected.

0

I just curious that, is there any reason that AnimGraphComponentNotificatiohnBus is not reflected?

I would like to catch the OnAnimGraphInstanceCreated event from my Lua script, but currently not allowed so I'm considering to modify the AnimGraphComponent.cpp.

But, I would like to ask before doing that, if it intentionally un-reflected with some reasons or not.

Best regards.

asked 5 years ago165 views
7 Answers
0
Accepted Answer

EDIT: correcting this point after double checking this.

You should be able to remove restriction from reflection for this ebus. Here is the location of the code:

https://github.com/aws/lumberyard/blob/master/dev/Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp

                    behaviorContext->EBus<AnimGraphComponentNotificationBus>("AnimGraphComponentNotificationBus")
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::List)
->Event("OnAnimGraphInstanceCreated", &AnimGraphComponentNotificationBus::Events::OnAnimGraphInstanceCreated)
->Event("OnAnimGraphInstanceDestroyed", &AnimGraphComponentNotificationBus::Events::OnAnimGraphInstanceDestroyed)
->Event("OnAnimGraphFloatParameterChanged", &AnimGraphComponentNotificationBus::Events::OnAnimGraphFloatParameterChanged)
->Event("OnAnimGraphBoolParameterChanged", &AnimGraphComponentNotificationBus::Events::OnAnimGraphBoolParameterChanged)
->Event("OnAnimGraphStringParameterChanged", &AnimGraphComponentNotificationBus::Events::OnAnimGraphStringParameterChanged)
->Event("OnAnimGraphVector2ParameterChanged", &AnimGraphComponentNotificationBus::Events::OnAnimGraphVector2ParameterChanged)
->Event("OnAnimGraphVector3ParameterChanged", &AnimGraphComponentNotificationBus::Events::OnAnimGraphVector3ParameterChanged)
->Event("OnAnimGraphRotationParameterChanged", &AnimGraphComponentNotificationBus::Events::OnAnimGraphRotationParameterChanged)
;

You can do enable its reflection by removing or commenting out the following line from above:

//->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::List)

That line hides it from Lua and Script Canvas.

answered 5 years ago
0

Hi @REDACTEDUSER

Good question, I can find someone on the Animation team to see why this might not be exposed to the BehaviorContext (LUA/ScriptCanvas). It seems like something that we should include :)

Internal tracking: LY-97156

answered 5 years ago
0

Thank you for the quick response with a code snippet, it's really helpful.

answered 5 years ago
0

@REDACTEDUSER

answered 5 years ago
0

ExcludeFrom is there when a feature doesn't work in Lua or Script Canvas due to some missing serialization for the scripting sub-systems. Sometimes it's a minor thing that was overlooked due to a lack of time, and sometimes it takes more work to get it working.

There should be no effect on perf/memory.

answered 5 years ago
0

Thank you for the answer, Now everything clear to me.

answered 5 years ago

This post is closed: Adding new answers, comments, and votes is disabled.