Ejemplo n.º 1
0
    public static string GetNameFromObject(Object o, Type type)
    {
        var name     = GlTF_Writer.GetNameFromObject(o);
        var typeName = type == Type.Vertex ? "vertex" : "fragment";

        return(typeName + "_" + name);
    }
Ejemplo n.º 2
0
    public static string GetNameFromObject(Object o, Type type)
    {
        // Don't use the object ID, so that we can deterministically produce
        // the same filenames when exporting the same asset again.
        var name     = GlTF_Writer.GetNameFromObject(o, false);
        var typeName = type == Type.Vertex ? "vertex" : "fragment";

        return(typeName + "_" + name);
    }
Ejemplo n.º 3
0
    // Create different names based on the format
    // Opaque and Transparent textures are exported differently.
    public static string GetNameFromObject(Object o, IMAGETYPE format)
    {
        string transparencyStyle = (
            format == IMAGETYPE.RGBA_OPAQUE) ? "OPAQUE" : "TRANSPARENT";

        // Don't use the object ID, so that we can deterministically produce
        // the same filenames when exporting the same asset again.
        return("texture_" + transparencyStyle + "_" +
               GlTF_Writer.GetNameFromObject(o, false));
    }
    public void Populate(AnimationClip c, Transform tr)
    {
        name = "anim_" + c.name + "_" + GlTF_Writer.GetNameFromObject(tr, true);
        //	AnimationUtility.GetCurveBindings(c);
        // look at each curve
        // if position, rotation, scale detected for first time
        //  create channel, sampler, param for it
        //  populate this curve into proper component
        AnimationClipCurveData[] curveDatas = AnimationUtility.GetAllCurves(c, true);

        // Find curve which has most keyframes for time reference
        Keyframe[] refKeyFrames = null;
        for (int i = 0; i < curveDatas.Length; ++i)
        {
            var cd = curveDatas[i];
            if (refKeyFrames == null || cd.curve.keys.Length > refKeyFrames.Length)
            {
                refKeyFrames = cd.curve.keys;
            }
        }
        PopulateTime(c.name, refKeyFrames);

        for (int i = 0; i < curveDatas.Length; i++)
        {
            var    cd            = curveDatas[i];
            string propName      = cd.propertyName;
            var    boneTransform = GetTransformFromPath(cd.path, tr);
            if (boneTransform == null)
            {
                continue;
            }

            var          boneName = GlTF_Node.GetNameFromObject(boneTransform);
            BoneAnimData bad;
            if (boneAnimData.ContainsKey(boneName))
            {
                bad = boneAnimData[boneName];
            }
            else
            {
                bad = new BoneAnimData(c.name, boneName);
                boneAnimData[boneName] = bad;
            }
            bad.PopulateAccessor(cd, refKeyFrames);
        }
    }
Ejemplo n.º 5
0
 public static string GetNameFromObject(Object o)
 {
     return("mesh_" + GlTF_Writer.GetNameFromObject(o, true));
 }
Ejemplo n.º 6
0
 public static string GetNameFromObject(Object o)
 {
     return /*"node_" + */ (GlTF_Writer.GetNameFromObject(o, false));
 }
Ejemplo n.º 7
0
 public static string GetNameFromObject(Object o)
 {
     // Don't use the object ID, so that we can deterministically produce
     // the same filenames when exporting the same asset again.
     return("technique_" + GlTF_Writer.GetNameFromObject(o, false));
 }
Ejemplo n.º 8
0
 public static string GetNameFromObject(Object o, string name)
 {
     return("accessor_" + name + "_" + GlTF_Writer.GetNameFromObject(o, true));
 }
Ejemplo n.º 9
0
 public static string GetNameFromObject(Object o, int index)
 {
     return("primitive_" + index + "_" + GlTF_Writer.GetNameFromObject(o, true));
 }
Ejemplo n.º 10
0
 public static string GetNameFromObject(Object o)
 {
     return /*"mesh_" + */ (GlTF_Writer.GetNameFromObject(o));
 }
Ejemplo n.º 11
0
 public static string GetNameFromObject(Object o)
 {
     return("program_" + GlTF_Writer.GetNameFromObject(o));
 }
Ejemplo n.º 12
0
 public static string GetNameFromObject(Object o)
 {
     return("technique_" + GlTF_Writer.GetNameFromObject(o));
 }
Ejemplo n.º 13
0
 public static string GetNameFromObject(Object o)
 {
     return("node_" + GlTF_Writer.GetNameFromObject(o));        //modified by Stephen Zhou 2018-10-1 11:04:30 before: return "node_" + GlTF_Writer.GetNameFromObject(o, true);
 }