debugLayer.onPropertyChangedObservable is not firing when enabling disabling lights in the BJS inspector. wonder if this is a bug or feature? is there another event i can watch when a user enables/disables lighting?
The enabled state change of a lightTreeItemComponent
is handled differently than i.e. transform nodes by the inspector, so that it does not trigger/notify onPropertyChanged-observers.
lockObject={this.props.lockObject}
onPropertyChangedObservable={this.props.onPropertyChangedObservable}
/>
{mesh.skeleton && <TextLineComponent label="Skeleton" value={mesh.skeleton.name} onLink={() => this.onSkeletonLink()} />}
<CheckBoxLineComponent
label="Is enabled"
isSelected={() => mesh.isEnabled()}
onSelect={(value) => {
const prevValue = mesh.isEnabled();
mesh.setEnabled(value);
this.props.onPropertyChangedObservable?.notifyObservers({
object: mesh,
property: "isEnabled",
value,
initialValue: prevValue,
});
}}
/>
<CheckBoxLineComponent label="Is pickable" target={mesh} propertyName="isPickable" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
{mesh.material && (!mesh.material.reservedDataStore || !mesh.material.reservedDataStore.hidden) && (
<TextLineComponent label="Link to material" value={mesh.material.name} onLink={() => this.onMaterialLink()} />
Maybe our experts @carolhmj @RaananW @sebavan know if it can/should be included.
Currently a possibility is to use onEnabledStateChangedObservable of your lights:
Makes sense to me to add that (in the right place)
@carolhmj - do you have the time?
If not i’ll take care of that later.