Commit 0c860003 authored by Haocheng LIU's avatar Haocheng LIU

Fix mesh name changing everytime we change visibility

When load a 2dm file twice then change the visibility of the second
mesh in CMB, the mesh name would change everytime correspondingly. It's
because we would set the collectionName to `original_mesh` first and
assign a unique name to mesh everytime (since the current two meshes
would have same name after the reset). An if statement is added so that
we only assign a unique mesh name when it's empty.

Fix smtk issue #10.
parent 72d879ba
......@@ -1227,10 +1227,12 @@ int ImportJSON::ofMeshesOfModel(cJSON* node,
cJSON_GetStringValue(collecNameNode, collectionName);
//ask the manager to generate a unique name for the collection, if it
//doesn't already have a unique name. This occurs when meshes have
//no name, or a name that has already been used
//ask the manager to generate a unique name for the collection, this
//occurs when meshes have no name.
if (collection->name().empty())
//set the collections model manager so that we can do model based
//queries properly
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment