Hi. im still not able to access the callback data inside the clusplusCHOP_with_Python_class from the Samples Folder. sorry - i’m to dumb for that …
what i have now is: ive set up a Base with callbackExtension. Inside that i have the cpluplusCHOP. (there should the Speed value be as an callback example inside). then ive a Text DAT via which i wanna access that Speed-value.
print(op(‘cplusplus1’).par.callbacksDat …???)
i don’t know, if i have to setup the callback Extension to the base or not - or if i can access that Speed-value from a single script too …
maybe please someone can give me a starting hint
EDIT:
as i understand this, there should be a par.callbacksDat …
but there is none
Are you setting that the pythonCallbacksDAT member to something other than nullptr? It needs to be filled in with the code you want to be in the ‘default callbacks’ DAT when that node is created. That will enable that feature.
Ah right, this callbacks DAT only works when you are using the node as a Custom OP, not as a C++ CHOP. So you’ll need to copy your .dll to Documents/Derivative/Plugins and load it as that. Then you get get a callback DAT that your C++ code can call to query Python for data, or execute stuff in Python during the cook.
I’ll mention the callbacks arn’t really meant to get ‘get’ data out of the CHOP via a Text DAT. If you want to do that you should be using the getSets example such as ‘executeCount’, or ‘speedMod’.
The callbacks are more for information or work that should be handled during the cook.
could you please make one exception and give me this one line of python code to show me how i can access the getSets vals for the given pyGetExecuteCount
ah - sorry - forgot to delete the question from before the EDIT. (wasn’t able to call the function in correct way … but finally found out.)
so - in the cusom OP all works fine.
in the cplusplusCHOP it doesn’t. there the getSet couldnt be found… made a network, with the same dll. as custom op and inside the cplusplus. (see pic). the custom OP works fine. the c++CHOP not. maybe ive to call different …
Im so sorry hp3007. Python does indeed only work with the Custom Operator workflow, not as C++. This is due to how the Python classes are loaded into our namespace. I think it’d be quite difficult to make it work with the C++ nodes themselves, since they need to be unloaded/loaded.