Beispiel #1
0
        public override int GetConnectionSlotId(AbstractMaterialNode from, AbstractMaterialNode to, int toSlotId, ParsedPropertyBag propertyBag)
        {
            var hasR = propertyBag.HasProperty("MaskR");
            var hasG = propertyBag.HasProperty("MaskG");
            var hasB = propertyBag.HasProperty("MaskB");
            var hasA = propertyBag.HasProperty("MaskA");

            if (hasR && hasG && hasB && hasA)
            {
                return(SampleTexture2DNode.OutputSlotRGBAId);
            }
            else if (hasR && hasG && hasB)
            {
                // should this be only RGB instead?
                return(SampleTexture2DNode.OutputSlotRGBAId);
            }
            else if (hasR)
            {
                return(SampleTexture2DNode.OutputSlotRId);
            }
            else if (hasG)
            {
                return(SampleTexture2DNode.OutputSlotGId);
            }
            else if (hasB)
            {
                return(SampleTexture2DNode.OutputSlotBId);
            }

            return(SampleTexture2DNode.OutputSlotRGBAId);
        }
Beispiel #2
0
        public override int GetConnectionSlotId(AbstractMaterialNode from, AbstractMaterialNode to, int toSlotId, ParsedPropertyBag propertyBag)
        {
            var hasR = propertyBag.HasProperty("MaskR");
            var hasG = propertyBag.HasProperty("MaskG");
            var hasB = propertyBag.HasProperty("MaskB");
            var hasA = propertyBag.HasProperty("MaskA");

            if (hasA || !hasR || !hasG || !hasB)
            {
                // FIXME:
                throw new System.Exception("unhandled vector parameter mask");
            }

            return(PropertyNode.OutputSlotId);
        }
Beispiel #3
0
        public void Connect(ParsedPropertyBag propertyBag, string toUnrealNodeName, int toSlotId)
        {
            if (null == propertyBag)
            {
                return;
            }

            if (!propertyBag.HasProperty("Expression"))
            {
                return;
            }

            var expressionValue = propertyBag.FindPropertyValue("Expression");
            var expression      = ValueUtil.ParseExpressionReference(expressionValue);

            Connect(expression.NodeName, toUnrealNodeName, toSlotId, propertyBag);
        }