Exemple #1
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => offset);
     f.KeyValue(() => rotation);
     f.KeyValue(() => scale);
     f.KeyValue(() => texCoord);
 }
Exemple #2
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     if (!string.IsNullOrEmpty(uri))
     {
         f.KeyValue(() => uri);
     }
     f.KeyValue(() => byteLength);
 }
Exemple #3
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => node);
     if (!string.IsNullOrEmpty(path))
     {
         f.KeyValue(() => path);
     }
 }
Exemple #4
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => input);
     if (!string.IsNullOrEmpty(interpolation))
     {
         f.KeyValue(() => interpolation);
     }
     f.KeyValue(() => output);
 }
Exemple #5
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => name);
     f.Key("primitives"); f.GLTFValue(primitives);
     if (weights != null && weights.Length > 0)
     {
         f.KeyValue(() => weights);
     }
 }
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => inverseBindMatrices);
     f.KeyValue(() => joints);
     if (skeleton >= 0)
     {
         f.KeyValue(() => skeleton);
     }
 }
Exemple #7
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => index);
     f.KeyValue(() => texCoord);
     if (extensions != null)
     {
         f.KeyValue(() => extensions);
     }
 }
Exemple #8
0
        protected override void SerializeMembers(GLTFJsonFormatter f)
        {
            if (!string.IsNullOrEmpty(name))
            {
                f.KeyValue(() => name);
            }

            f.KeyValue(() => channels);
            f.KeyValue(() => samplers);
        }
Exemple #9
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);
     }
 }
Exemple #11
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);
     }
 }
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => POSITION);
     if (NORMAL != -1)
     {
         f.KeyValue(() => NORMAL);
     }
     if (TANGENT != -1)
     {
         f.KeyValue(() => TANGENT);
     }
     if (TEXCOORD_0 != -1)
     {
         f.KeyValue(() => TEXCOORD_0);
     }
     if (TEXCOORD_1 != -1)
     {
         f.KeyValue(() => TEXCOORD_1);
     }
     if (COLOR_0 != -1)
     {
         f.KeyValue(() => COLOR_0);
     }
     if (JOINTS_0 != -1)
     {
         f.KeyValue(() => JOINTS_0);
     }
     if (WEIGHTS_0 != -1)
     {
         f.KeyValue(() => WEIGHTS_0);
     }
 }
Exemple #13
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);
     }
 }
Exemple #14
0
 void SerializeMembers_unlit(GLTFJsonFormatter f)
 {
     if (KHR_materials_unlit != null)
     {
         f.KeyValue(() => KHR_materials_unlit);
     }
 }
Exemple #15
0
 void SerializeMembers_textureInfo(GLTFJsonFormatter f)
 {
     if (KHR_texture_transform != null)
     {
         f.KeyValue(() => KHR_texture_transform);
     }
 }
Exemple #16
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);
        }
Exemple #17
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);
             * }
             */
        }
Exemple #18
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);
                }
            }
        }
Exemple #19
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);
 }
Exemple #20
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);
     }
 }
Exemple #21
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);
        }
Exemple #22
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);
            }
        }
Exemple #23
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => nodes);
 }
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => sampler);
     f.KeyValue(() => source);
 }
Exemple #25
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => strength);
     base.SerializeMembers(f);
 }
Exemple #26
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => index);
     f.KeyValue(() => texCoord);
 }
Exemple #27
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => bufferView);
     f.KeyValue(() => byteOffset);
     f.Key("componentType"); f.Value((int)componentType);
 }
Exemple #28
0
 void VRMSerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => VRM);
 }
Exemple #29
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => bufferView);
     f.KeyValue(() => byteOffset);
 }
Exemple #30
0
 protected override void SerializeMembers(GLTFJsonFormatter f)
 {
     f.KeyValue(() => count);
     f.KeyValue(() => indices);
     f.KeyValue(() => values);
 }