Is it possible for several objects to receive float values from a python array running on one of them?
I have a Python script receiving external data, and converting the data to float values that can be displayed in real time in the game engine. Unfortunately, the arrangement I have right now does not allow for more than a few data points to be displayed at any time, without significantly slowing down the frame rate. It also takes a long time to set up, and is a mess of parent/child dependencies. I am wondering if any of these ideas is possible, and if so, could someone please point me in the right direction of how to approach it.
Possibilities I’m looking at:
- The array runs and the objects listen passively. (I know this is impossible under the Python API, but could it be done through drivers?)
- The script dumps the array to a group of objects as a batch. Ideally, this looks something like:
Group.Object[0-50].scale = Object.Array[0-50]
These objects run the drivers.
- The script dumps the array to a group of objects one by one. It involves more processing overhead, but is more likely to be possible to program. Also uses drivers. Looks like:
Group.Object.scale = Object.Array Group.Object.scale = Object.Array Group.Object.scale = Object.Array ........
- My current code: Object with a Python controller acts as a parent to all the objects that need changing
owner.children.scale = (Array) owner.children.scale = (Array) owner.children.scale = (Array) ........
- I cave and buy the $6000 software package that’s actually designed to do this. But where’s the fun in that?
There are several reasons I’d like this to operate as drivers (or something similar) instead of as parent/children.
- With drivers, I can use a custom property to quickly change which object looks at what piece of data.
- I sometimes want multiple objects to receive the same data set. This becomes very disorganized in my current setup.
- I sometimes have more than one data point going to a single object, controlling everything from scale to color.
- If a new item is added, it can throw off the code for all the rest.
- I’d like to let some of my co-workers use this, but none of them know the first thing about code. The easier I can make the front-end, the better.
TL;DR: Not a complete noob, but in over my head.