コード例 #1
0
ファイル: LayeredTexture.cs プロジェクト: oguna/AssimpSharp
        public LayeredTexture(ulong id, Element element, Document doc, string name)
            : base(id, element, name)
        {
            texture = null;
            blendMode = Blend.Modulate;
            alpha = 1;

            var sc = Parser.GetRequiredScope(element);
            var BlendModes = sc["BlendModes"];
            var Alphas = sc["Alphas"];
            if (BlendModes != null)
            {
                blendMode = (Blend)Parser.ParseTokenAsInt(Parser.GetRequiredToken(BlendModes, 0));
            }
            if (Alphas != null)
            {
                alpha = Parser.ParseTokenAsFloat(Parser.GetRequiredToken(Alphas, 0));
            }
        }
コード例 #2
0
ファイル: LayeredTexture.cs プロジェクト: oguna/AssimpSharp
 public void FillTexture(Document doc)
 {
     var conns = doc.GetConnectionsByDestinationSequenced(ID);
     for (int i = 0; i < conns.Count; i++)
     {
         var con = conns[i];
         var ob = con.SourceObject;
         if (ob == null)
         {
             DocumentUtil.DOMWarning("failed to read source object for texture link, ignoring", element);
             continue;
         }
         var tex = ob as Texture;
         texture = tex;
     }
 }