import * as React from "react"; import { Material, Observable } from "babylonjs"; import { PropertyChangedEvent } from "../../../../propertyChangedEvent"; import { CheckBoxLineComponent } from "../../../lines/checkBoxLineComponent"; import { SliderLineComponent } from "../../../lines/sliderLineComponent"; import { LineContainerComponent } from "../../../lineContainerComponent"; import { TextLineComponent } from "../../../lines/textLineComponent"; import { OptionsLineComponent } from "../../../lines/optionsLineComponent"; import { LockObject } from "../lockObject"; interface ICommonMaterialPropertyGridComponentProps { material: Material, lockObject: LockObject, onPropertyChangedObservable?: Observable } export class CommonMaterialPropertyGridComponent extends React.Component { constructor(props: ICommonMaterialPropertyGridComponentProps) { super(props); } render() { const material = this.props.material; var orientationOptions = [ { label: "Clockwise", value: BABYLON.Material.ClockWiseSideOrientation }, { label: "Counterclockwise", value: BABYLON.Material.CounterClockWiseSideOrientation } ] var transparencyModeOptions = [ { label: "Opaque", value: BABYLON.PBRMaterial.PBRMATERIAL_OPAQUE }, { label: "Alpha test", value: BABYLON.PBRMaterial.PBRMATERIAL_ALPHATEST }, { label: "Alpha blend", value: BABYLON.PBRMaterial.PBRMATERIAL_ALPHABLEND }, { label: "Alpha blend and test", value: BABYLON.PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND }, ]; var alphaModeOptions = [ { label: "Combine", value: BABYLON.Engine.ALPHA_COMBINE }, { label: "One one", value: BABYLON.Engine.ALPHA_ONEONE }, { label: "Add", value: BABYLON.Engine.ALPHA_ADD }, { label: "Subtract", value: BABYLON.Engine.ALPHA_SUBTRACT }, { label: "Multiply", value: BABYLON.Engine.ALPHA_MULTIPLY }, { label: "Maximized", value: BABYLON.Engine.ALPHA_MAXIMIZED }, { label: "Pre-multiplied", value: BABYLON.Engine.ALPHA_PREMULTIPLIED }, ]; return (
this.setState({ mode: value })} /> { (material as any).transparencyMode !== undefined && this.setState({ transparencyMode: value })} /> } this.setState({ alphaMode: value })} />
); } }