Page MenuHome

BGE 2.50: replace all material properties (strings) by datablock pointers (Material *) - (may affect ext. blend libraries)
Closed, ArchivedPublic

Description

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).

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

##############################################
Posted on bf-committers, but after talking with Campbell I agreed that it could wait until we have more games ported to 2.50 (to avoid new bugs).
The patch went through exhaustive tests though, it should be working fine.

Details

Type
Patch

Event Timeline

Mitchell Stokes (moguri) lowered the priority of this task from Normal to Low.Jul 4 2014, 10:27 AM

Working on cleaning out the patch tracker:

Is this something still being worked on, or should this report be closed? If there is no response in a week, I will close this report. Active patches should start being migrated to Differential.

This was an internal patch, no new functionality to the user. @Inês Almeida (brita_) can tackle this if she feels like, but I don't even know if there is a real benefit to the user.

@Dalai Felinto (dfelinto) you mention 2 advantages no? The task looks like a good learning opportunity... @Daniel Stokes (kupoman)?

Aaron Carlisle (Blendify) closed this task as Archived.Sep 29 2018, 3:47 PM