David Catuhe 5 anni fa
parent
commit
4da057a3ee

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.js


File diff suppressed because it is too large
+ 66 - 66
dist/preview release/babylon.max.js


File diff suppressed because it is too large
+ 7 - 7
dist/preview release/nodeEditor/babylon.nodeEditor.js


File diff suppressed because it is too large
+ 65 - 41
dist/preview release/nodeEditor/babylon.nodeEditor.max.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/nodeEditor/babylon.nodeEditor.max.js.map


File diff suppressed because it is too large
+ 6 - 6
dist/preview release/viewer/babylon.viewer.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 10 - 4
nodeEditor/src/components/diagram/diagram.scss

@@ -128,10 +128,6 @@
         background: #40866E;
     }
 
-    &.constant {
-        background: #646464 !important;
-    }
-
     &.output {
         background: rgb(106, 44, 131);
         color:white;
@@ -157,6 +153,16 @@
         overflow: hidden;
         background: black;
         color: white;
+
+        &.constant {
+            border-color: #4E5C74;
+            background: #4E5C74 !important;
+        }
+
+        &.inspector {
+            border-color: #396437;
+            background: #396437 !important;
+        }
     }
 
     .value {

+ 38 - 11
nodeEditor/src/components/diagram/input/inputNodePropertyComponent.tsx

@@ -14,7 +14,6 @@ import { LineContainerComponent } from '../../../sharedComponents/lineContainerC
 import { StringTools } from '../../../stringTools';
 import { AnimatedInputBlockTypes } from 'babylonjs/Materials/Node/Blocks/Input/animatedInputBlockTypes';
 import { TextInputLineComponent } from '../../../sharedComponents/textInputLineComponent';
-import { CheckBoxLineComponent } from '../../../sharedComponents/checkBoxLineComponent';
 import { Vector4PropertyTabComponent } from '../../propertyTab/properties/vector4PropertyTabComponent';
 import { MatrixPropertyTabComponent } from '../../propertyTab/properties/matrixPropertyTabComponent';
 import { FloatLineComponent } from '../../../sharedComponents/floatLineComponent';
@@ -162,6 +161,12 @@ export class InputPropertyTabComponentProps extends React.Component<IInputProper
             modeOptions.push({ label: "System value", value: 2 });
         }
 
+        var typeOptions = [
+            { label: "None", value: 0 },
+            { label: "Visible in the inspector", value: 1 },
+            { label: "Constant", value: 2 }
+        ];
+
         return (
             <div>
                 <LineContainerComponent title="GENERAL">
@@ -174,17 +179,39 @@ export class InputPropertyTabComponentProps extends React.Component<IInputProper
                 <LineContainerComponent title="PROPERTIES">
                     {
                         inputBlock.isUniform && !inputBlock.isSystemValue && inputBlock.animationType === AnimatedInputBlockTypes.None &&
-                        <CheckBoxLineComponent label="Visible in the Inspector" target={inputBlock} propertyName="visibleInInspector"/>
-                    }           
-                    {
-                        inputBlock.isUniform && !inputBlock.isSystemValue && inputBlock.animationType === AnimatedInputBlockTypes.None &&
-                        <CheckBoxLineComponent label="IsConstant" target={inputBlock} propertyName="isConstant"
-                            onValueChanged={() => {
-                                this.props.globalState.onRebuildRequiredObservable.notifyObservers();
-                                this.props.globalState.onUpdateRequiredObservable.notifyObservers();
+                        <OptionsLineComponent label="Type" options={typeOptions} target={inputBlock} 
+                            noDirectUpdate={true}
+                            getSelection={(block) => {
+                                if (block.visibleInInspector) {
+                                    return 1;
+                                }
+
+                                if (block.isConstant) {
+                                    return 2;
+                                }
+
+                                return 0;
                             }}
-                        />
-                    }                             
+                            onSelect={(value: any) => {
+                                switch (value) {
+                                    case 0:
+                                        inputBlock.visibleInInspector = false;
+                                        inputBlock.isConstant = false;
+                                        break;
+                                    case 1:
+                                        inputBlock.visibleInInspector = true;
+                                        inputBlock.isConstant = false;
+                                        break;
+                                    case 2:
+                                        inputBlock.visibleInInspector = false;
+                                        inputBlock.isConstant = true;
+                                        break;
+                                }
+                                this.forceUpdate();
+                                this.props.globalState.onUpdateRequiredObservable.notifyObservers();
+                                this.props.globalState.onRebuildRequiredObservable.notifyObservers();
+                            }} />                        
+                    }           
                     <OptionsLineComponent label="Mode" options={modeOptions} target={inputBlock} 
                         noDirectUpdate={true}
                         getSelection={(block) => {

+ 2 - 2
nodeEditor/src/components/diagram/input/inputNodeWidget.tsx

@@ -130,10 +130,10 @@ export class InputNodeWidget extends React.Component<IInputNodeWidgetProps> {
         }
 
         return (
-            <div className={"diagramBlock input" + (inputBlock ? " " + NodeMaterialBlockConnectionPointTypes[inputBlock.type] : "")+ (inputBlock && inputBlock.isConstant ? " constant" : "")} style={{
+            <div className={"diagramBlock input" + (inputBlock ? " " + NodeMaterialBlockConnectionPointTypes[inputBlock.type] : "")} style={{
                 background: color
             }}>
-                <div className="header">
+                <div className={"header" + (inputBlock && inputBlock.isConstant ? " constant" : "") + (inputBlock && inputBlock.visibleInInspector ? " inspector" : "")}>
                     {name}
                 </div>
                 <div className="outputs">

+ 2 - 2
nodeEditor/src/components/nodeList/nodeListComponent.tsx

@@ -122,13 +122,13 @@ export class NodeListComponent extends React.Component<INodeListComponentProps,
             Color_Management: ["ReplaceColorBlock", "PosterizeBlock", "GradientBlock"],
             Conversion_Blocks: ["ColorMergerBlock", "ColorSplitterBlock", "VectorMergerBlock", "VectorSplitterBlock"],
             Inputs: ["Float", "Vector2", "Vector3", "Vector4", "Color3", "Color4", "TextureBlock", "ReflectionTextureBlock", "TimeBlock", "DeltaTimeBlock"],
-            Interpolation: ["LerpBlock", "SmoothStepBlock", "NLerpBlock"],
+            Interpolation: ["LerpBlock", "StepBlock", "SmoothStepBlock", "NLerpBlock"],
             Matrices: ["Matrix", "WorldMatrixBlock", "WorldViewMatrixBlock", "WorldViewProjectionMatrixBlock", "ViewMatrixBlock", "ViewProjectionMatrixBlock", "ProjectionMatrixBlock"],
             Mesh: ["InstancesBlock", "PositionBlock", "UVBlock", "ColorBlock", "NormalBlock", "TangentBlock", "MatrixIndicesBlock", "MatrixWeightsBlock", "WorldPositionBlock", "WorldNormalBlock", "FrontFacingBlock"], 
             Noises: ["SimplexPerlin3DBlock", "WorleyNoise3DBlock"],
             Output_Blocks: ["VertexOutputBlock", "FragmentOutputBlock", "DiscardBlock"],
             Range: ["ClampBlock", "RemapBlock", "NormalizeBlock"],
-            Round: ["StepBlock", "RoundBlock", "CeilingBlock", "FloorBlock"],
+            Round: ["RoundBlock", "CeilingBlock", "FloorBlock"],
             Scene: ["FogBlock", "CameraPositionBlock", "FogColorBlock", "ImageProcessingBlock", "LightBlock", "LightInformationBlock", "ViewDirectionBlock", "PerturbNormalBlock", "NormalBlendBlock"],
             Trigonometry: ["CosBlock", "SinBlock", "AbsBlock", "ExpBlock", "Exp2Block", "SqrtBlock", "PowBlock", "LogBlock", "ArcCosBlock", "ArcSinBlock", "TanBlock", "ArcTanBlock", "FractBlock", "SignBlock", "ArcTan2Block", "DegreesToRadiansBlock", "RadiansToDegreesBlock", "SawToothWaveBlock", "TriangleWaveBlock", "SquareWaveBlock"],
             Vector_Math: ["CrossBlock", "DotBlock", "TransformBlock", "FresnelBlock"],