예제 #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);
        }
예제 #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);
        }
예제 #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()
                );
        }