Conversation
There is currently a bug with the **"Modify"** directive.
Create, for example, `test.ssc` in `extras\test` with:
```
Modify "Moon:Earth I" "Sol/Earth"
{
InfoURL "https://en.wikipedia.org/wiki/Test"
}
```
Load Celestia and go to the Moon - it appears completely flat because of the unconditional:
```
SetOrUnset(surface->appearanceFlags, Surface::ApplyBumpMap, (bumpTexture.has_value() || normalTexture.has_value()));
```
`test.ssc` does not define `normalTexture` or `bumpTexture`, so this parameter is unset.
I'm not sure this is the best way to fix the problem. This PR is just an example of what the fix should look like.
|
I don't think this approach works, because it removes the ability to re-set a boolean property (which is what the original implementation in #1352 was trying to address). A better approach would be to consider whether the property was actually present in the file. So for the boolean properties we could do: if (auto blendTexture = surfaceData->getBoolean("BlendTexture"); blendTexture.has_value())
SetOrUnset(surface->appearanceFlags, Surface::BlendTexture, *blendTexture);The string properties would need to be similar, presumably we can treat an empty path as a reset? (This would also require editing the if (auto baseTexture = GetFilename(*surfaceData, "Texture"sv, "Invalid filename in Texture\n");
baseTexture.has_value())
{
SetOrUnset(surface->appearanceFlags, Surface::ApplyBaseTexture, !baseTexture->empty());
surface->baseTexture = texturePaths.getHandle(*baseTexture, path, baseFlags);
}The The annoying one to deal with will be |
|
I suspected that a proper fix might not be so simple. The idea of using an empty path as a reset is also logical. |
|
Setting this PR to draft for the reasons ajtribick stated and Ajaja (PR author) agreed. |
There is currently a bug with the "Modify" directive.
Create, for example,
test.sscinextras\testwith:Load Celestia and go to the Moon - it appears completely flat because of the unconditional:
test.sscdoes not definenormalTextureorbumpTexture, so this parameter is unset.I'm not sure this is the best way to fix the problem. This PR is just an example of what the fix should look like.