| 171 | } |
| 172 | |
| 173 | void PropBase::Load(const Json::Value& jsonRoot) |
| 174 | { |
| 175 | jsonRoot["propType"] >> m_propType; |
| 176 | |
| 177 | m_startPose.Read(jsonRoot["startPose"]); |
| 178 | |
| 179 | auto jsonDefaultCameraPose = jsonRoot["defaultCameraPose"]; |
| 180 | if (jsonDefaultCameraPose.empty()) |
| 181 | m_defaultCameraPose.SetTransformFromCamera( {0,0,0}, {1, 0, 0}, {0, 1, 0} ); |
| 182 | else |
| 183 | m_defaultCameraPose.Read(jsonDefaultCameraPose); |
| 184 | |
| 185 | jsonRoot["animPlaybackSpeed"] >> m_animPlaybackSpeed; |
| 186 | |
| 187 | jsonRoot["showOnlyIfTagged"] >> m_showOnlyIfTagged; |
| 188 | |
| 189 | Json::Value animationRecording = jsonRoot["animation"]; |
| 190 | |
| 191 | if (!animationRecording.empty() && animationRecording.isArray()) |
| 192 | { |
| 193 | m_animation.Read(animationRecording); |
| 194 | m_animating = true; |
| 195 | } |
| 196 | |
| 197 | Json::Value modelsLightsOverrides = jsonRoot["modelsLightsOverrides"]; |
| 198 | if (!modelsLightsOverrides.empty()) |
| 199 | m_modelsLightsOverrides = SaveJsonToString(modelsLightsOverrides); |
| 200 | |
| 201 | Json::Value components = jsonRoot["components"]; |
| 202 | if (!components.empty()) |
| 203 | m_componentsData = SaveJsonToString(components); |
| 204 | } |
| 205 | |
| 206 | void PropBase::PostLoadSetup() |
| 207 | { |
no test coverage detected