EditModel3D.EditNode

This page contains reference documentation for the EditNode function. This function returns a clone of a node for editing purposes. Calling this function to get an editable node is necessary if you want the editing actions to be undo-able, as well as redo-able.

Prototype

Node EditNode( Node NodeToEdit )

Parameters

Function parameters are as follows:

Examples

Examples are as follows:

// Edit a link node.

{
   for( int i = 0; i < Model.GetSelectCount(); ++i )
   {
      Node node = Model.GetSelectedNode( i ).GetNode();
      if( node.IsDerived( NodeLink ) )
      {
         NodeLink link = (NodeLink)Model.EditNode( node );
         string temp = Application.ResolveRelativePath( link.PathToFile );
         if( temp != "" )
         {
            link.PathToFile = temp;
         }
      }
   }
}

// Edit a material node.

{
   for( int i = 0; i < Model.GetSelectCount(); ++i )
   {
      Node node = Model.GetSelectedNode( i ).GetNode();
      
      if( node.IsDerived( Material ) )
      {
         Material material = (Material)Model.EditNode( node );
         
         material.AlphaBlend = !material.AlphaBlend;
         material.Opacity = 0.5;
      }
   }
}

Working Sample Code

For sample code: