Ejemplo n.º 1
0
        public void TestOdeza()
        {
            string odezaPath = @"C:\Users\Victo\AppData\Roaming\Autodesk\Synthesis\Robots\Odesza1\\skeleton.json";

            if (!File.Exists(odezaPath))
            {
                return;
            }

            RigidNode_Base loaded = BXDJSkeletonJson.ReadSkeleton(odezaPath);

            Assert.IsNotNull(loaded);
        }
Ejemplo n.º 2
0
        public static RigidNode_Base ReadSkeletonSafe(string path)
        {
            string         jsonPath = path + ".json";
            string         xmlPath  = path + ".bxdj";
            RigidNode_Base node     = null;

            if (File.Exists(jsonPath))
            {
                //Load JSON
                Debug.Log("Loading JSON robot: " + jsonPath);
                node = BXDJSkeletonJson.ReadSkeleton(jsonPath);
            }
            else
            {
                node = BXDJSkeleton.ReadSkeleton(xmlPath);
            }

            return(node);
        }
Ejemplo n.º 3
0
        public void ReadJSON()
        {
            string         filePath = path + "test_export.json";
            RigidNode_Base toCreate = CreateNodeWithChild();

            BXDJSkeletonJson.WriteSkeleton(filePath, toCreate);


            RigidNode_Base created = BXDJSkeletonJson.ReadSkeleton(filePath);


            Assert.AreEqual(toCreate.GUID, created.GUID);
            Assert.AreEqual(toCreate.Children.Count, created.Children.Count);

            SkeletalJoint_Base firstJointtoCreate = toCreate.Children.Keys.First <SkeletalJoint_Base>();
            SkeletalJoint_Base firstJointCreated  = created.Children.Keys.First <SkeletalJoint_Base>();

            Assert.AreEqual(
                toCreate.Children[firstJointtoCreate].GetSkeletalJoint().GetJointType(),
                created.Children[firstJointCreated].GetSkeletalJoint().GetJointType()
                );
        }