armory3d / armory

3D Engine with Blender Integration
https://armory3d.org
zlib License
3.05k stars 317 forks source link

Wrong results when different objects with different modifiers share the same mesh #365

Open donalffons opened 6 years ago

donalffons commented 6 years ago

As the title says, there are three objects in this scene, Fence 1, 2 and 3. They all share the same mesh, called 'Mesh'. But they apply different modifiers. In this case, these are array modifiers with 2 and 3 repetitions.

This is how it should look like (in Blender): image

This is what Armory does: image

modifiers.zip

luboslenco commented 6 years ago

Modifiers get applied at export to the mesh, which then gets shared among all the linked users, producing this bug.:/ In https://github.com/armory3d/armory/commit/bc4c24cd95af5c00d67ea9d3ad843a639a36db0d I have made it at least spit a warning message now:

Armory Warning: Mesh users Fence3 and Fence1 differ in modifier stack - use Make Single User(U) - Object & Data for now

I will make it properly split the meshes eventually, just need to plan it carefully to not introduce more caching issues on mesh changes.

donalffons commented 6 years ago

That's a good quick improvement (esspecially for the upcoming release). For the mid & long term, I hope there will be an implementation that differentiates the meshes with different modifiers. Keep up the good work!