Commit 64441a81 authored by T.J. Corona's avatar T.J. Corona Committed by Kitware Robot

Merge topic 'change-entity-name-find-entity-release' into release

3718ad23 qtModelView: in changeEntityName(), acquire session ptr from mesh.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !881
parents fb8e8dc7 3718ad23
......@@ -1649,6 +1649,18 @@ void qtModelView::changeEntityName(const QModelIndex& idx)
{
DescriptivePhrasePtr dp = this->getModel()->getItem(idx);
smtk::model::EntityRef ent = dp->relatedEntity();
// If there is no related entity, we may have either a meshset or mesh
// collection. We can pull an associated entity ref from either type, which
// will give us access to the underlying session.
if (!ent.isValid())
{
auto collection =
dp->relatedMeshCollection() ? dp->relatedMeshCollection() : dp->relatedMesh().collection();
if (collection)
{
ent = smtk::model::EntityRef(collection->modelManager(), collection->associatedModel());
}
}
smtk::model::SessionRef sref = ent.owningSession();
OperatorPtr brOp = this->getOp(sref.session(), "set property");
if (!brOp || !brOp->specification())
......
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