Example #1
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => POSITION);
     if (NORMAL >= 0)
     {
         f.KeyValue(() => NORMAL);
     }
     if (TANGENT >= 0)
     {
         f.KeyValue(() => TANGENT);
     }
 }
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => name);
     if (!string.IsNullOrEmpty(uri))
     {
         f.KeyValue(() => uri);
     }
     else
     {
         f.KeyValue(() => bufferView);
         f.KeyValue(() => mimeType);
     }
 }
Example #3
0
 void PrimitiveMembers(GLTFJsonFormatter f)
 {
     if (targetNames.Count > 0)
     {
         f.Key("targetNames");
         f.BeginList();
         foreach (var x in targetNames)
         {
             f.Value(x);
         }
         f.EndList();
     }
 }
Example #4
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            if (children != null && children.Any())
            {
                f.Key("children"); f.BeginList();
                foreach (var child in children)
                {
                    f.Value(child);
                }
                f.EndList();
            }

            if (!string.IsNullOrEmpty(name))
            {
                f.KeyValue(() => name);
            }
            if (matrix != null)
            {
                f.KeyValue(() => matrix);
            }
            if (translation != null)
            {
                f.KeyValue(() => translation);
            }
            if (rotation != null)
            {
                f.KeyValue(() => rotation);
            }
            if (scale != null)
            {
                f.KeyValue(() => scale);
            }

            if (mesh >= 0)
            {
                f.KeyValue(() => mesh);
            }
            if (camera >= 0)
            {
                f.KeyValue(() => camera);
            }
            if (skin >= 0)
            {
                f.KeyValue(() => skin);

                if (extras.__count > 0)
                {
                    f.KeyValue(() => extras);
                }
            }
        }
Example #5
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => buffer);
     f.KeyValue(() => byteOffset);
     f.KeyValue(() => byteLength);
     if (target != glBufferTarget.NONE)
     {
         f.Key("target"); f.Value((int)target);
     }
     if (byteStride >= 4)
     {
         f.KeyValue(() => byteStride);
     }
 }
Example #6
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => mode);
     f.KeyValue(() => indices);
     f.Key("attributes"); f.GLTFValue(attributes);
     f.KeyValue(() => material);
     if (targets != null && targets.Count > 0)
     {
         f.Key("targets"); f.GLTFValue(targets);
     }
     if (extras.targetNames.Count > 0)
     {
         f.Key("extras"); f.GLTFValue(extras);
     }
 }
Example #7
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     if (baseColorTexture != null)
     {
         f.KeyValue(() => baseColorTexture);
     }
     if (baseColorFactor != null)
     {
         f.KeyValue(() => baseColorFactor);
     }
     if (metallicRoughnessTexture != null)
     {
         f.KeyValue(() => metallicRoughnessTexture);
     }
     f.KeyValue(() => metallicFactor);
     f.KeyValue(() => roughnessFactor);
 }
Example #8
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            f.KeyValue(() => buffer);
            f.KeyValue(() => byteOffset);
            f.KeyValue(() => byteLength);
            if (target != glBufferTarget.NONE)
            {
                f.Key("target"); f.Value((int)target);
            }

            /* When this is not defined, data is tightly packed. When two or more accessors use the same bufferView, this field must be defined.
             * if (byteStride >= 4)
             * {
             *  f.KeyValue(() => byteStride);
             * }
             */
        }
Example #9
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => mode);
     f.KeyValue(() => indices);
     f.Key("attributes"); f.GLTFValue(attributes);
     f.KeyValue(() => material);
     if (targets != null && targets.Count > 0)
     {
         f.Key("targets"); f.GLTFValue(targets);
     }
     if (extensions.KHR_draco_mesh_compression != null)
     {
         f.KeyValue(() => extensions);
     }
     if (extras.targetNames.Count > 0)
     {
         f.KeyValue(() => extras);
     }
 }
Example #10
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            if (!String.IsNullOrEmpty(name))
            {
                f.Key("name"); f.Value(name);
            }
            if (pbrMetallicRoughness != null)
            {
                f.Key("pbrMetallicRoughness"); f.GLTFValue(pbrMetallicRoughness);
            }
            if (normalTexture != null)
            {
                f.Key("normalTexture"); f.GLTFValue(normalTexture);
            }
            if (occlusionTexture != null)
            {
                f.Key("occlusionTexture"); f.GLTFValue(occlusionTexture);
            }
            if (emissiveTexture != null)
            {
                f.Key("emissiveTexture"); f.GLTFValue(emissiveTexture);
            }
            if (emissiveFactor != null)
            {
                f.Key("emissiveFactor"); f.Value(emissiveFactor);
            }

            f.KeyValue(() => doubleSided);

            if (!string.IsNullOrEmpty(alphaMode))
            {
                f.KeyValue(() => alphaMode);
            }

            if (extensions != null)
            {
                f.KeyValue(() => extensions);
            }
        }
Example #11
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            f.KeyValue(() => bufferView);
            f.KeyValue(() => byteOffset);
            f.KeyValue(() => type);
            f.Key("componentType"); f.Value((int)componentType);
            f.KeyValue(() => count);
            if (max != null && max.Any())
            {
                f.KeyValue(() => max);
            }
            if (min != null && min.Any())
            {
                f.KeyValue(() => min);
            }

            if (sparse != null && sparse.count > 0)
            {
                f.KeyValue(() => sparse);
            }

            f.KeyValue(() => normalized);
            f.KeyValue(() => name);
        }
Example #12
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => bufferView);
     f.KeyValue(() => byteOffset);
     f.Key("componentType"); f.Value((int)componentType);
 }
Example #13
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => count);
     f.KeyValue(() => indices);
     f.KeyValue(() => values);
 }
Example #14
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => bufferView);
     f.KeyValue(() => byteOffset);
 }
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.Key("generator"); f.Value(generator);
     f.Key("version"); f.Value(version);
 }
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => sampler);
     f.KeyValue(() => source);
 }
Example #17
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => index);
     f.KeyValue(() => texCoord);
 }
 void SerializeMembers_draco(GLTFJsonFormatter f)
 {
     //throw new NotImplementedException();
 }
Example #19
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => sampler);
     f.Key("target"); f.GLTFValue(target);
 }
Example #20
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => name);
     f.Key("primitives"); f.GLTFValue(primitives);
 }
 protected abstract void SerializeMembers(GLTFJsonFormatter f);
Example #22
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => strength);
     base.SerializeMembers(f);
 }
Example #23
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => nodes);
 }
Example #24
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     //throw new System.NotImplementedException();
 }
Example #25
0
 void VRMSerializeMembers(GLTFJsonFormatter f)
 {
     f.Key("VRM"); f.GLTFValue(VRM);
 }
Example #26
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            if (extensionsUsed.Count > 0)
            {
                f.Key("extensionsUsed"); f.GLTFValue(extensionsUsed);
            }
            if (extensions.__count > 0)
            {
                f.Key("extensions"); f.GLTFValue(extensions);
            }
            if (extras.__count > 0)
            {
                f.Key("extras"); f.GLTFValue(extras);
            }

            f.Key("asset"); f.GLTFValue(asset);

            // buffer
            if (buffers.Any())
            {
                f.Key("buffers"); f.GLTFValue(buffers);
            }
            if (bufferViews.Any())
            {
                f.Key("bufferViews"); f.GLTFValue(bufferViews);
            }
            if (accessors.Any())
            {
                f.Key("accessors"); f.GLTFValue(accessors);
            }

            // materials
            if (images.Any())
            {
                f.Key("images"); f.GLTFValue(images);
                if (samplers.Count == 0)
                {
                    samplers.Add(new glTFTextureSampler());
                }
            }

            if (samplers.Any())
            {
                f.Key("samplers"); f.GLTFValue(samplers);
            }

            if (textures.Any())
            {
                f.Key("textures"); f.GLTFValue(textures);
            }
            if (materials.Any())
            {
                f.Key("materials"); f.GLTFValue(materials);
            }

            // meshes
            if (meshes.Any())
            {
                f.Key("meshes"); f.GLTFValue(meshes);
            }
            if (skins.Any())
            {
                f.Key("skins"); f.GLTFValue(skins);
            }

            // scene
            if (nodes.Any())
            {
                f.Key("nodes"); f.GLTFValue(nodes);
            }
            if (scenes.Any())
            {
                f.Key("scenes"); f.GLTFValue(scenes);
                if (scene >= 0)
                {
                    f.KeyValue(() => scene);
                }
            }

            // animations
            if (animations.Any())
            {
                f.Key("animations"); f.GLTFValue(animations);
            }
        }
Example #27
0
 void VRMSerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => VRM);
 }