Erroneous morph target manager ids

Hello,

as mentioned in the headline, I am facing certain scenarios when morph target managers receive “wrong” unique ids.
On our platfrom (Combeenation) we often times compose scenes from MULTIPLE models, provided as .babylon files.

I’ve noticed that the morph target managers don’t receive a “unique” number from the UniqueIdGenerator, instead the serialized id is taken.
image

…so this id is certainly not unique and can collide with other morph target managers.
As a result I receive errors like: “Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count.” or the morphing is just wrong.

I’ve created a PG example, in which 2 models with morph target managers get loaded. I’ve manually given ids from 1-6 and 1-7 to the morph target managers in the .babylon files.
Altering a morph target from model 2 will trigger an error.
When removing the first model import, you can see that morphing the mesh (changing height of pole) works correctly.

BG Markus

I assume that unique identifiers had to be unique within a given file and not from file to file (which is not possible).

New identifiers could be generated at load time and overwrite the identifiers read from the file, but I’m not sure what impact that would have…

cc @Deltakosh and @sebavan for their thoughts.

I think that could be the solution but it will force us to regenerate all links based on a map.

When reading a new class, we give it an ID and we store in a map the old->new conversion.

Everytime we read an id to reference an entity we use the map.

@TheHOF wanna give it a try?

1 Like

@Deltakosh yes I should be able to do that.

2 Likes

If you can’t please tell me and I’ll try to find time :slight_smile:

Fixed thanks to @TheHOF !

2 Likes