-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the ability to create typed objects from the CreateCustom component #160
Remove the ability to create typed objects from the CreateCustom component #160
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @adecler !
The BHoM_UI works ok by itself, but modifying the logic here breaks the CreateCustom
behaviour in Grasshopper at least.
Selecting a different type from the parameter menu for a specific input does not work anymore. To test it:
- Create a
CreateCustom
component - Add two inputs
- Create a panel with the value
true
- Input the panel in both the inputs of the component
- Change the
TypeHint
of the first input toint
- If you use an
Explode
, you'll see that the change has no effects
I think the fix is just to check for type changes as well in grasshopper to decide when to recompute the solution.
Specifically, I think that these lines should add a check for the type:
bool recompute = this.Phase == GH_SolutionPhase.Computed
&& !e.Parameter.Sources.Any(p => p.Attributes.GetTopLevel.DocObject is ExplodeComponent)
&& e.Parameter.NickName != Caller.InputParams[e.ParameterIndex].Name
&& Engine.Grasshopper.Query.Type(e.Parameter) != Caller.InputParams[e.ParameterIndex].DataType;
@epignatelli , weird, it works perfectly fine for me: Which makes sense because nothing in the code I have changed on this PR could trigger that effect. Are you sure you are on the correct version for all repos? |
Yeah, that's very weird, but I agree with you, I was surprised in the first place. What I don't actually understand is how it can be working now, without that check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why it was not working before.
I checkout the latest masters, recompiled and now everything seems fine!
/azp BHoM_UI.CheckCore |
Command 'BHoM_UI.CheckCore' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
/azp run BHoM_UI.CheckCore |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run BHoM_UI.CheckInstaller |
Azure Pipelines successfully started running 1 pipeline(s). |
@adecler is there anything that prevents us from merging this? |
@epignatelli , yes, Excel_Toolkit needs to be updated first as this PR was preventing it from compiling. I did a quick attempt to fix it in https://github.com/BHoM/Excel_Toolkit/pull/170 but it was apparently a bit too quick 😋 . @awakeman is now on it to do that properly. |
Ah, right, ok! I'll add a do-not-merge then, waiting for BHoM/Excel_Toolkit#170 to be closed. Just wanted to prevent an accidental "Click the green button" automatism :D |
Issues addressed by this PR
Closes #159
Test files
Just make sure that the CreateCustom component is not allowing you to select a type from its menu and that it is still working for creating custom objects
Additional comments
Make sure to also check the PR in Excel_Toolkit as some changes were needed there to keep it compiling