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
[RESOLVED] PDK IAnimationControllerV01
-
- Lockheed Martin
- Posts: 1059
- Joined: Tue Sep 25, 2012 2:34 pm
Re: PDK IAnimationControllerV01
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!
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.
Prepar3D® Software Engineer Sr.
Re: PDK IAnimationControllerV01
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
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
Re: PDK IAnimationControllerV01
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:
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
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);
All the best,
Benny
Return to “Software Development Kit (SDK) Questions”
Who is online
Users browsing this forum: No registered users and 21 guests