I have a project where I am attempting to wrap some OpenCV objects and wrapping them such that you can utilize OpenCV functionality from within Unreal’s Blueprint system.
The project consists of 3 modules (later I will take the relevant modules and form a plugin for distribution). One is the project module that I test the set up, one is the OpenCV library reference module, and the last one is the OpenCV Blueprint wrapper. All dependencies are appropriately set. I made a test UObject C++ class in the OpenCV blueprint wrapper that simply instantiates a cv::Mat (myMatPtr = new cv::Mat() on construction, and deletes it (FMemory::Free(myMatPtr)
upon destruction. I load up unreal and everything is fine. I instantiate it in an actor, and run it. presumably it is calling into the opencv .dll files creating a cv:Mat and destroying it properly, no errors! Great. I kick it into high gear and start implementing the most popular functionality, which is cv::VideoCapture. I implement it much in the same way I implemented the test object, but now when I try to load the project into the unreal editor I get a runtime exception mid load (~%70). Running it in debug mode reveals it it a “Missing Module Exception,” and is thrown just as it tries to instantiate the cv::VideoCapture object in the constructor of the UObject class wrapper. Both class’s CPP and H files are in the same place in the file hierarchy, so I’m not sure why there is a problem. If the first works, why not the new one? Relevant source is zipped up Here.