XPlane2Blender icon indicating copy to clipboard operation
XPlane2Blender copied to clipboard

Imp: _next_object_name is a real problem

Open tngreene opened this issue 4 years ago • 2 comments

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 avatar Feb 18 '21 23:02 tngreene

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 avatar Feb 18 '21 23:02 tngreene

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

tngreene avatar Mar 09 '21 19:03 tngreene