Jump to content
Sign in to follow this  
iamjaideep80

FrameChange EventCallback using HDK

Recommended Posts

Hello,

I want to add an event_callback on frameChange in playbar, using HDK.
In Python it works like this : hou.playbar.addEventCallback(outputPlaybarEvent)
What is the HDK equivalent of this ?

Thanks,
Jaideep Khadilkar

Share this post


Link to post
Share on other sites
Stalkerx777    75

If you really need to run c++ callback you can try this:

#include <HOM/HOM_Module>
HOM_Module &hom = HOM();
HOM_playber &playbar = hom.playbar();
playbar.addEventCallback(...);

 

P.S. Should work in theory, haven't tested it.

Edited by Stalkerx777

Share this post


Link to post
Share on other sites

Hello @Stalkerx777,

Thanks for you suggestion.

But the above code doesn't compile as "addEventCallback()" method is only available if "SWIG" is defined.

Any work-around for this ?

Share this post


Link to post
Share on other sites
On 17/02/2017 at 11:24 AM, MrScienceOfficer said:

I've never seen anything.  If you need to call into C++ on time change events outside of a node, it's probably best to just create a python wrapper into your plug in.

Hello @MrScienceOfficer,

Can you please explain in detail, how to create such wrapper ?

Couldn't find similar thing in HDK Samples.

Share this post


Link to post
Share on other sites

The sample for python wrappers is in the HOM folder.

../toolkit/samples/HOM/ObjNode_setSelectable.C

It's very well commented and should walk you through the process.

Any type prefixed with "PY_Py" is (in most cases) a wrapper to the CPython API.  So if you need to look up documentation you need to remove the "PY_" and look up the type here https://docs.python.org/2/c-api/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×