Hey there,
I am making tests on using bpy in the bge! The thing is following:
I am working on some new testparticle stuff, my easyEmit is not very well designed so I thought of a fresh rewrite(with better code design). I want to set up a colorramp in blenders usual ui and then map this colorramp to the particles lifetime! Works perfectly so far!
The only problem I have is, that my particle engine needs to get the data from the bpy properties! I usually stored them in the bge string property and then converted it at runtime into my needed data type. Unfortunatelly the string property can only store 128(?) characters. This are to less to create a list of different colors that are mapped on the particles lifetime!
Then I thought, that I maybe can use bpy directly in the bge to get the color data that is needed. And hey, it worked. The only problem is, while blender finds the module when starting the bge, the blenderplayer doesn’t. So… my question is, is it possible to integrate bpy with the blenderplayer? If so, how? ^^
If not, how can I transport the needed colordata to my particle engine without the use of bge properties?
To understand better what I mean, here is the current blend I am working on. You can set the colors and positions on the right side in the colorRamp, and then just start the bge and you see that it is mapped perfectly to the particle lifetime.
If you press the apply ColorRamp button, that color and position data is stored in the string property on the left.(only 4 colors work, because the list gets to long with more colors.)
particleClassTest.blend (127 KB)