X-Plane / XPlane2Blender

Scenery & Aircraft export addon for Blender and X-Plane
GNU General Public License v3.0
197 stars 67 forks source link

Imp: _next_object_name is a real problem #642

Open tngreene opened 3 years ago

tngreene commented 3 years ago

Since we make DatablockInfos with a name, and feed it into create, we have a problem of when bpy.data already has that name. test_creation_helpers will actually pick an existing datablock and re-use it! So, we could either add a parameter to force the name, or we could force the rename after the datablock has been created, or add some kind of hash which is ugly.

I'm most in favor of forcefully renaming the ob after creation.

If we have multiple imports of files, the problem shows up very quick.

tngreene commented 3 years ago

Right now the first 4 digits of the hex value of the hash of the root object name are being appended. Works well enough, but isn't user friendly and breaks if you import the same .obj twice (but why would you do that?) Mesh datablock names are already okay

tngreene commented 3 years ago

Okay, temporarily I've added a random number... Not great.