[RESOLVED] PDK IAnimationControllerV01

BenBaron
Posts: 79
Joined: Fri Jan 16, 2015 7:51 am

[RESOLVED] PDK IAnimationControllerV01

Postby BenBaron » Mon Nov 12, 2018 2:44 pm

Hi guys,

I am experimenting with the above mentioned interface to directly trigger a custom animation on my SimObject. So, I implemented the interface in my SimObject and try to trigger the animation on it with a call to Play(const GUID& guidAnimationID, BOOL bLoop). Unfortunately, the animation doesn't run.

The animation itself is defined as type="Standard" and typeParam="" in the modeldef.xml used to build the mdl. If I change this to typeParam="AutoPlay" the animation plays in sim, but this is independant from the IAnimationControllerV01's Play() call then and thus useless.

I am not even sure, if it is supposed to work this way as I haven't worked with animations before, so any insight would be highly appreciated.

All the best, Benny

Clifton Crane
Lockheed Martin
Posts: 1043
Joined: Tue Sep 25, 2012 2:34 pm

Re: PDK IAnimationControllerV01

Postby Clifton Crane » Tue Nov 13, 2018 2:50 pm

Hi Benny,

The IAnimationControllerV01 does not need to be implemented by your ISimObject, it's actually a service that is implemented by the Prepar3D application. You can access it by calling QueryService on an IBaseObject with the correct SID and IID GUIDs for the IAnimationControllerV01 interface. You should then be able to call Play() with the correct animation GUID defined in your modeldef.xml file.

Let us know if you have any issues.
Thanks!
Clifton Crane
Prepar3D® Software Engineer Sr.

BenBaron
Posts: 79
Joined: Fri Jan 16, 2015 7:51 am

Re: PDK IAnimationControllerV01

Postby BenBaron » Wed Nov 14, 2018 2:04 pm

Hi Clifton,

thanks for the quick reply.

I tried it the way you proposed and queried for the IID_IAnimationControllerV01 and SID_AnimationController on the IBaseObjectV400 but only got a HRESULT of E_NOINTERFACE. I even tried to query for the IID_IBaseObjectV430 first, which worked ok and queried for the IID_IAnimationControllerV01 from that one, but still got the same result.

What are the prerequisites that a valid pointer is returned successfully?

On a side note, I also got E_NOINTERFACE querying for the IID_ISurfaceQueryManagerV400 and SID_SurfaceManager on the IPdk, so I am wondering what might be going on, as I wanted to get some surface information without having to spawn a SimObject.

Greets, Benny

BenBaron
Posts: 79
Joined: Fri Jan 16, 2015 7:51 am

Re: PDK IAnimationControllerV01

Postby BenBaron » Wed Nov 21, 2018 9:16 am

Hi all,

in conjunction with the resolution of http://www.prepar3d.com/forum/viewtopic ... 1&t=131539 this problem here got also solved.

In case anyone gets is in the same position of trying to understand QueryService, this is, how it is supposed to be done:

Code: Select all

CComPtr<P3D::IBaseObjectV400> baseObject = nullptr; CComPtr<P3D::IAnimationControllerV01> animationController = nullptr; baseObject->QueryService(SID_AnimationController, IID_IAnimationControllerV01, (void**)&this->animationController);
with the SID defining a general ServiceID and the IID defining the specific interface version you need of the requested service.

All the best,

Benny


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 8 guests