コード例 #1
0
        private void gvTPONodes_SelectionChanged(object sender, EventArgs e)
        {
            int     tpofile_row = tpoFileBindingSource.Position;
            TPOFile tpo         = TPOList[tpofile_row];

            int     tponode_row = tpoNodeBindingSource.Position;
            TPONode tponode     = tpo.nodes[tponode_row];

            tpoCommandBindingSource.DataSource = tponode.commands;

            gvCommands.Rows.Clear();
            bool    inv_scale_on_children;
            Vector3 scaling = tponode.GetScaling(out inv_scale_on_children);

            gvCommands.Rows.Add(new string[] { "Scale", scaling.X.ToString(), scaling.Y.ToString(), scaling.Z.ToString() });
            cbInverseScaleOnChildren.Checked = inv_scale_on_children;

            Vector3 angle = tponode.GetAngle();

            gvCommands.Rows.Add(new string[] { "Rotate", angle.X.ToString(), angle.Y.ToString(), angle.Z.ToString() });

            Vector3 translation = tponode.GetTranslation();

            gvCommands.Rows.Add(new string[] { "Move", translation.X.ToString(), translation.Y.ToString(), translation.Z.ToString() });
        }
コード例 #2
0
        private void cbInverseScaleOnChildren_CheckedChanged(object sender, EventArgs e)
        {
            int     tpofile_row = tpoFileBindingSource.Position;
            TPOFile tpo         = TPOList[tpofile_row];

            int     tponode_row = tpoNodeBindingSource.Position;
            TPONode tponode     = tpo.nodes[tponode_row];

            bool inv_scale_on_children;

            tponode.SetScaling(tponode.GetScaling(out inv_scale_on_children), cbInverseScaleOnChildren.Checked);

            tpoCommandBindingSource.ResetBindings(false);

            Transform();
        }