Update the contained model from the provided keyvalues
| 37 | |
| 38 | // Update the contained model from the provided keyvalues |
| 39 | void ModelKey::modelChanged(const std::string& value) |
| 40 | { |
| 41 | if (!_active) return; // deactivated during parent node destruction |
| 42 | |
| 43 | // Sanitise the keyvalue - must use forward slashes |
| 44 | auto newModelName = string::replace_all_copy(value, "\\", "/"); |
| 45 | |
| 46 | if (newModelName == _model.path) |
| 47 | { |
| 48 | return; // new name is the same as we have now |
| 49 | } |
| 50 | |
| 51 | _undo.save(); |
| 52 | |
| 53 | // Now store the new modelpath |
| 54 | _model.path = newModelName; |
| 55 | |
| 56 | // Call the attach routine, keeping the skin (#4142) |
| 57 | attachModelNodeKeepingSkin(); |
| 58 | } |
| 59 | |
| 60 | void ModelKey::attachModelNode() |
| 61 | { |
no test coverage detected