예제 #1
0
        public override string Process(string[] args)
        {
            string output = string.Empty;

            if (args.Length == 2)
            {
                var n = TransformNode.Find(args[1]) as TransformNode;
                if (n != null)
                {
                    Console.WriteLine(n);
                    n.ShowTree();
                }

                else
                {
                    output = "invalid node specified: " + args[1];
                }
            }

            else
            {
                Console.WriteLine("Scene");
                TransformNode.ShowAll();
            }


            return(output);
        }
예제 #2
0
        public override string Process(string[] args)
        {
            var output = string.Empty;

            if (args.Length == 3)
            {
                var child  = TransformNode.Find(args[1]) as TransformNode;
                var parent = TransformNode.Find(args[2]) as TransformNode;
                if (child != null && parent != null)
                {
                    if (child.FindNode(parent.Name) == null)
                    {
                        child.SetParent(parent);
                    }
                    else
                    {
                        output =
                            "Cannot set parent as a child to the specified child, because the child is already a child of the parent";
                    }
                }
                else
                {
                    output = "Parenting failed. Could not find one, or both nodes.";
                }
            }
            else
            {
                output = "you must specify two nodes";
            }

            return(output);
        }
예제 #3
0
        public override string Process(string[] args)
        {
            var output = string.Empty;

            if (args.Length == 3)
            {
                var nOld = TransformNode.Find(args[1]);
                if (nOld != null)
                {
                    if (TransformNode.Find(args[2]) == null)
                    {
                        nOld.Name = args[2];
                    }
                    else
                    {
                        output = "target name already exists: " + args[2];
                    }
                }
                else
                {
                    output = "node not found";
                }
            }
            else
            {
                output = "an old name and new name must be specified";
            }

            return(output);
        }
예제 #4
0
        public override string Process(string[] args)
        {
            var output = string.Empty;

            if (args.Length == 2)
            {
                var n = TransformNode.Find(args[1]) as TransformNode;
                n?.RemoveNode();
                if (n == null)
                {
                    output = "node not found: " + args[1];
                }
            }
            else
            {
                output = "invalid delete command. enter a single node to delete";
            }


            return(output);
        }
예제 #5
0
        public override string Process(string[] args)
        {
            var output = string.Empty;

            if (args.Length == 2)
            {
                var node = TransformNode.Find(args[1]) as TransformNode;
                if (node != null)
                {
                    node.SetParent(null);
                }
                else
                {
                    output = "Node not found: " + node;
                }
            }
            else
            {
                output = "you must specify a single node";
            }

            return(output);
        }
예제 #6
0
        public override string Process(string[] args)
        {
            var output = string.Empty;

            if (args.Length == 3)
            {
                var n1 = TransformNode.Find(args[1]) as TransformNode;
                var n2 = TransformNode.Find(args[2]) as TransformNode;
                if (n1 != null && n2 != null)
                {
                    TransformNode.Group(n1, n2);
                }
                else
                {
                    output = "one or both nodes are not found";
                }
            }
            else if (args.Length == 2)
            {
                var n1 = TransformNode.Find(args[1]) as TransformNode;
                if (n1 != null)
                {
                    TransformNode.Group(n1);
                }
                else
                {
                    output = "the node specified is not valid";
                }
            }
            else
            {
                output = "you must specify 1, or 2 nodes in order to group";
            }

            return(output);
        }