I know AE plugins are in C++, so assume you'd have to embed a JVM or an HTML5 canvas, figure out a way to sync the frame-rate, and pass whatever variables you needed back and forth. From the googling I've done and colleagues I've spoken to, I'm unclear whether there is some technical barrier that would prevent this from ever working. There are plugins like Element 3D that have their own very elaborate, self contained renderers built in, so it seems like there should be a way. I use After Effects the most, but if it's easier to accomplish in another system like Natron or Fusion, then that's great too.