MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / modelChanged

Method modelChanged

radiantcore/entity/ModelKey.cpp:39–58  ·  view source on GitHub ↗

Update the contained model from the provided keyvalues

Source from the content-addressed store, hash-verified

37
38// Update the contained model from the provided keyvalues
39void 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
60void ModelKey::attachModelNode()
61{

Callers 1

onModelKeyChangedMethod · 0.45

Calls 2

replace_all_copyFunction · 0.85
saveMethod · 0.45

Tested by

no test coverage detected