A quick human note: I understand EnvironmentLight is still experimental in 4.1, so this is low-priority — just recording the serialization-default mismatch for whenever the node is finalized.
Summary
X.EnvironmentLight().global_ defaults to True, but the normative X3D 4.0 Lighting component specifies the EnvironmentLight.global default as false. Because x3d.py's internal default is True, an explicit global_=True equals the internal default and is omitted from serialization; a conformant reader then parses the missing attribute as false, so image-based lighting silently fails.
Environment: x3d 4.0.65.4 (pip install x3d), Python 3.12.
Reproduction
from x3d import x3d as X
print(repr(X.EnvironmentLight().global_)) # -> True
e = X.EnvironmentLight(); e.global_ = True
print(e.XML()) # -> <EnvironmentLight/> (global omitted)
Spec
The X3D 4.0 Lighting component field table specifies SFBool [in,out] global FALSE for EnvironmentLight — default false. (The x3d-4.0.dtd line global %SFBool; "false" agrees, though it sits in a commented-out block, so the field table is the primary authority.)
This is a spec-divergence rather than a flat contradiction: x3d.py's True matches the convention used by the point/spot light nodes and X_ITE's documented EnvironmentLight behavior, but the normative field table specifies FALSE. The practical problem is that the divergent default is silently dropped from serialization, so output authored against x3d.py renders differently in a spec-default reader.
Expected: default global = False (matching the normative field table); global_=True then serializes as global='true'.
Impact: image-based ambient lighting silently fails; the scene is lit only by remaining direct lights. Confirmed in Castle Model Viewer 5.3; corrected only after global='true' was injected post-serialization.
A quick human note: I understand EnvironmentLight is still experimental in 4.1, so this is low-priority — just recording the serialization-default mismatch for whenever the node is finalized.
Summary
X.EnvironmentLight().global_defaults toTrue, but the normative X3D 4.0 Lighting component specifies theEnvironmentLight.globaldefault asfalse. Because x3d.py's internal default isTrue, an explicitglobal_=Trueequals the internal default and is omitted from serialization; a conformant reader then parses the missing attribute asfalse, so image-based lighting silently fails.Environment:
x3d4.0.65.4 (pip install x3d), Python 3.12.Reproduction
Spec
The X3D 4.0 Lighting component field table specifies
SFBool [in,out] global FALSEforEnvironmentLight— defaultfalse. (Thex3d-4.0.dtdlineglobal %SFBool; "false"agrees, though it sits in a commented-out block, so the field table is the primary authority.)This is a spec-divergence rather than a flat contradiction: x3d.py's
Truematches the convention used by the point/spot light nodes and X_ITE's documentedEnvironmentLightbehavior, but the normative field table specifiesFALSE. The practical problem is that the divergent default is silently dropped from serialization, so output authored against x3d.py renders differently in a spec-default reader.Expected: default
global = False(matching the normative field table);global_=Truethen serializes asglobal='true'.Impact: image-based ambient lighting silently fails; the scene is lit only by remaining direct lights. Confirmed in Castle Model Viewer 5.3; corrected only after
global='true'was injected post-serialization.