Skip to content

Commit

Permalink
https://github.com/KhronosGroup/glTF/issues/13
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrobinet committed Oct 24, 2013
1 parent 4087805 commit acdce2c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion converter/COLLADA2GLTF/COLLADA2GLTFWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,20 @@ namespace GLTF
lightsInNode->appendValue(shared_ptr <JSONString> (new JSONString(lightUID)));
lights->setValue(lightUID, light);
}
nodeObject->setValue("lights", lightsInNode);
//We just want a single light per node
//https://github.com/KhronosGroup/glTF/issues/13
//nodeObject->setValue("lights", lightsInNode);
nodeObject->setValue("light", lightsInNode->values()[0]);
if (count > 1) {
//FR: AFAIK no authoring tool export multiple light per node, but we'll warn if that's the case
//To fix this, dummy sub nodes should be created.
static bool printedOnce = false;
if (printedOnce) {
printf("WARNING: some unhandled lights because some nodes carry more than a single light\n");
printedOnce = false;
}

}
}

return true;
Expand Down

0 comments on commit acdce2c

Please sign in to comment.