Skip to content

Run a C++ model from python? #927

Answered by Robadob
jacksonsdean asked this question in Q&A
Discussion options

You must be logged in to vote

Officially via FLAMEGPU, no. All our Python bindings are generated via SWIG. We tell it what we want wrapped in swig/python/flamegpu.i.

If you wanted to achieve this, you'd probably want to create a C++ method that returns (or fills) a ModelDescription with your model (I expect this would need to be part of the main flamegpu project. Then extend swig/python/flamegpu.i, so that SWIG additionally wraps that method to add it to the Python interface. If all is done correctly, when you rebuild pyflamegpu your method should now be available in the pyflamegpu module.

It's not something we've tried or required, and SWIG can be a bit unpredictable at times, so I'm not sure if any unexpected issues…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Robadob
Comment options

Answer selected by jacksonsdean
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants