Skip to content
This repository was archived by the owner on Jan 6, 2021. It is now read-only.

Commit fcbbbd9

Browse files
committed
Improvements to the Upgrader. It should now work more reliably and a logic flaw was fixed
1 parent b3e3303 commit fcbbbd9

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Component/PyUpgrader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public IGH_DocumentObject Upgrade(IGH_DocumentObject target, GH_Document documen
1717
component_new.HiddenCodeInput = component_OBSOLETE.HiddenCodeInput;
1818
component_new.HiddenOutOutput = component_OBSOLETE.HiddenOutOutput;
1919

20-
if (!component_new.HiddenCodeInput)
20+
if (component_new.HiddenCodeInput)
2121
component_new.Code = component_OBSOLETE.Code;
2222

2323
if (GH_UpgradeUtil.SwapComponents(component_OBSOLETE, component_new))

Component/PythonComponent.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ public bool IsOutputVariable
181181

182182
public bool IsVariableParam(GH_VarParamEventArgs e)
183183
{
184-
return e.Index > (!HiddenCodeInput ? -1 : 0);
184+
if(e.Side == GH_VarParamSide.Input)
185+
return e.Index > (HiddenCodeInput ? -1 : 0);
186+
else
187+
return e.Index > (HiddenOutOutput ? -1 : 0);
185188
}
186189

187190
public void ManagerConstructed(GH_VarParamSide side, Grasshopper.GUI.GH_VariableParameterManager manager)

0 commit comments

Comments
 (0)