Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
iamjaideep80

FrameChange EventCallback using HDK

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

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.

Share this post


Link to post
Share on other sites

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  
Followers 0