Fixes to lights. Oops.

This commit is contained in:
Par Winzell 2019-01-25 15:14:37 -08:00
parent ce2a9f8d85
commit ffd6af3142
2 changed files with 11 additions and 11 deletions

View File

@ -120,10 +120,10 @@ int main(int argc, char* argv[]) {
"Use KHR_materials_unlit extension to request an unlit shader.")
->group("Materials");
app.add_flag(
"--khr-lights-punctual",
gltfOptions.useKHRLightsPunctual,
"Use KHR_lights_punctual extension to request an unlit shader.");
app.add_flag_function(
"--no-khr-lights-punctual",
[&](size_t count) { gltfOptions.useKHRLightsPunctual = (count == 0); },
"Don't use KHR_lights_punctual extension to export FBX lights.");
app.add_flag(
"--user-properties",

View File

@ -729,14 +729,14 @@ ModelData* Raw2Gltf(
light.innerConeAngle,
light.outerConeAngle));
}
}
for (int i = 0; i < raw.GetNodeCount(); i++) {
const RawNode& node = raw.GetNode(i);
const auto nodeData = gltf->nodes.ptrs[i];
for (int i = 0; i < raw.GetNodeCount(); i++) {
const RawNode& node = raw.GetNode(i);
const auto nodeData = gltf->nodes.ptrs[i];
if (node.lightIx >= 0) {
// we lean on the fact that in this simple case, raw and gltf indexing are aligned
nodeData->SetLight(node.lightIx);
if (node.lightIx >= 0) {
// we lean on the fact that in this simple case, raw and gltf indexing are aligned
nodeData->SetLight(node.lightIx);
}
}
}
}