GH_UpgradeUtil
Exposes several utility functions for migrating parameters and wires between components useful while upgrading components.
Methods
MigrateInputParameters
#public static bool MigrateInputParameters(IGH_Component source, IGH_Component target, int[] index0, int[] index1)
Migrate a bunch of input parameters.
Parameters:
| source (IGH_Component) | Source component. |
| target (IGH_Component) | Target component. |
| index0 (int[]) | List of input indices to migrate. |
| index1 (int[]) | Matching list of target indices. |
Returns: True on success, false on failure.
MigrateInputParameters
#Migrate all input parameters.
Parameters:
| source (IGH_Component) | Source component. |
| target (IGH_Component) | Target component. |
Returns: True on success, false on failure.
MigrateOutputParameters
#public static bool MigrateOutputParameters(IGH_Component source, IGH_Component target, int[] index0, int[] index1)
Migrate a bunch of output parameters.
Parameters:
| source (IGH_Component) | Source component. |
| target (IGH_Component) | Target component. |
| index0 (int[]) | List of output indices to migrate. |
| index1 (int[]) | Matching list of target indices. |
Returns: True on success, false on failure.
MigrateOutputParameters
#Migrate all output parameters.
Parameters:
| source (IGH_Component) | Source component. |
| target (IGH_Component) | Target component. |
Returns: True on success, false on failure.
MigrateRecipients
#Utility method for bulk assigning a bunch of sources.
Parameters:
| recipients (IEnumerable<IGH_Param>) | |
| target (IGH_Param) |
MigrateRecipients
#Migrate all recipients from A to B, while maintaining order.
MigrateSources
#Utility method for bulk assigning a bunch of sources.
Parameters:
| sources (IEnumerable<IGH_Param>) | |
| target (IGH_Param) |
MigrateSources
#Migrate all sources from A to B, while maintaining order.
ReplaceInputParameters
#Move all input parameters from one component to another. Only use this function if the target component can handle the input layout of the source component.
Parameters:
| source (IGH_Component) | Component to move parameters from. |
| target (IGH_Component) | Component to move parameters to. |
ReplaceOutputParameters
#Move all output parameters from one component to another. Only use this function if the target component can handle the output layout of the source component.
Parameters:
| source (IGH_Component) | Component to move parameters from. |
| target (IGH_Component) | Component to move parameters to. |
SwapComponents
#public static bool SwapComponents(IGH_Component oldComponent, IGH_Component newComponent, bool migrateParameters)
Replace an existing component with a different one. All parameters (input and output) will be migrated.
Parameters:
| oldComponent (IGH_Component) | Component current in a GH_Document. |
| newComponent (IGH_Component) | Component to swap. |
| migrateParameters (bool) | If true, all parameters will be moved from old to new. |
Returns: True on success, false on failure.
SwapComponents
#Replace an existing component with a different one. All parameters (input and output) will be migrated.
Parameters:
| oldComponent (IGH_Component) | Component current in a GH_Document. |
| newComponent (IGH_Component) | Component to swap. |
Returns: True on success, false on failure.
SwapComponents
#public static IGH_Component SwapComponents(IGH_Component oldComponent, Guid newComponentGuid, bool migrateParameters)
Replace an existing component with a different one. All parameters (input and output) will be migrated.
Parameters:
| oldComponent (IGH_Component) | Component current in a GH_Document. |
| newComponentGuid (Guid) | ComponentGuid of the component to add. |
| migrateParameters (bool) | If true, all parameters will be moved from old to new. |
Returns: Component that was added.
SwapComponents
#Replace an existing component with a different one. All parameters (input and output) will be migrated.
Parameters:
| oldComponent (IGH_Component) | Component current in a GH_Document. |
| newComponentGuid (Guid) | ComponentGuid of the component to add. |
Returns: Component that was added.