[Bf-committers] BGE/Logic Editor: Should we replace all material properties (strings) by datablock pointers (Material *)? (may affect ext. blend libraries)

Dalai Felinto dfelinto at gmail.com
Mon May 31 08:57:34 CEST 2010


Hello there,
I just (finally) finished a patch to have materials [1] and actuators
[2] properties in Logic to use datablocks pointers.

There are two main advantages of this:
a) we can have nice lookups for the existent materials/actuators.
b) if you change a material name, everything get updated.
* as a reference this is how Touch Sensor works already (since 2.49)

The downside of this is that I have no idea how well this will work
with external .blend "library" files. I tested with simple linked data
and it works fine.
However as soon as a material is no longer in the library the
sensor/actuator will not detect it anymore (no material == no
pointer).
I don't have experience using external library files with BGE, so I
would like some help to test it or at least to think if this is a real
drawback or not.

If this kind of flexibility is necessary, the alternative I see if to
add datablock lookups stored as strings (as we do for game properties,
bone and pose channel). And on top of that make the Touch Sensor to
use strings instead of pointers (for consistency sake).

The finished patch is here - http://www.pasteall.org/13465

[1] - Ray Sensor, Collision Sensor and Constraint Actuator
[2] - Actuator Sensor

Regards,
Dalai

http://blenderecia.orgfree.com


More information about the Bf-committers mailing list