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