import * as React from "react"; import { TextLineComponent } from '../../sharedComponents/textLineComponent'; import { LineContainerComponent } from '../../sharedComponents/lineContainerComponent'; import { TextInputLineComponent } from '../../sharedComponents/textInputLineComponent'; import { OptionsLineComponent } from '../../sharedComponents/optionsLineComponent'; import { IPropertyComponentProps } from './propertyComponentProps'; import { LightBlock } from 'babylonjs/Materials/Node/Blocks/Dual/lightBlock'; export class LightPropertyTabComponent extends React.Component { render() { let scene = this.props.globalState.nodeMaterial!.getScene(); var lightOptions = scene.lights.map(l => { return { label: l.name, value: l.name } }); lightOptions.splice(0, 0, { label: "All", value: "" }) let lightBlock = this.props.block as LightBlock; return (
this.props.globalState.onUpdateRequiredObservable.notifyObservers()} /> { if (name === "") { lightBlock.light = null; } else { lightBlock.light = scene.getLightByName(name); } this.forceUpdate(); this.props.globalState.onRebuildRequiredObservable.notifyObservers(); }} />
); } }