| 747 | } |
| 748 | |
| 749 | void setSkinKeyAndCheckModel(const IEntityNodePtr& entity, const std::string& expectedSkin, const std::vector<std::string>& expectedMaterials) |
| 750 | { |
| 751 | // Save the data to do a before/after test |
| 752 | auto model = getSkinnedModel(entity); |
| 753 | auto modelNode = std::dynamic_pointer_cast<model::ModelNode>(model); |
| 754 | |
| 755 | auto skinBeforeSettingKey = model->getSkin(); |
| 756 | auto materialsBeforeSettingKey = modelNode->getIModel().getActiveMaterials(); |
| 757 | |
| 758 | entity->getEntity().setKeyValue("skin", expectedSkin); |
| 759 | expectEntityHasSkinnedModel(entity, expectedSkin, expectedMaterials); |
| 760 | |
| 761 | // Remove the skin key again, it should be as before |
| 762 | entity->getEntity().setKeyValue("skin", ""); |
| 763 | expectEntityHasSkinnedModel(entity, skinBeforeSettingKey, materialsBeforeSettingKey); |
| 764 | } |
| 765 | |
| 766 | // An entity using a certain modelDef as "model" and explicitly setting the "skin" spawnarg |
| 767 | void expectEntityWithSkinKeyHasSkinnedModel(const std::string& modelKeyValue, const std::string& expectedSkin, const std::vector<std::string>& expectedMaterials) |
no test coverage detected