// The function AddModifier contains most of the code required to add a modifier // to the mesh construction history. This function sets the modifier inputs to // the contents of the mesh selection. /*----------------------------------------------------------------------------*/ /* AddModifierFunction */ /*----------------------------------------------------------------------------*/ function int AddModifier( Modifier mod, int selIndex ) { Group parent; if( Model.GetSelectCount() && Model.GetSelectedNode( selIndex ).IsDerived( MeshSelect ) ) { MeshSelect meshSelect = (MeshSelect)Model.GetSelectedNode( selIndex ); parent = (Group)meshSelect.GetNode(); mod.SetParameters( meshSelect ); } else { parent = Model; } Model.AddNode( mod, parent, -1 ); Model.Deselect( parent ); return 1; } // This script actually creates the modifier. This is a scripted command and is // installed in the user interface in the Modify > Edge menu and in the edge command menu. /*----------------------------------------------------------------------------*/ /* CreateTurnEdgeModifier */ /*----------------------------------------------------------------------------*/ macro CreateTurnEdgeModifier() [Category="Modifier Commands", Guid="{7411547C-D4BE-4C0E-9647-6184BEC29A79}", Image="PARAMETRIC!IDB_CREATEMODIFIER_COMMAND"] { TurnEdgeModifier modifier = new TurnEdgeModifier; modifier.Name = "TurnEdgeModifier"; AddModifier( modifier, 0 ); }