Skip to content
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

Exception after changing input type of c# operator on MAIN #480

Open
pixtur opened this issue Oct 18, 2024 · 1 comment
Open

Exception after changing input type of c# operator on MAIN #480

pixtur opened this issue Oct 18, 2024 · 1 comment

Comments

@pixtur
Copy link
Collaborator

pixtur commented Oct 18, 2024

Describe the bug
After

Please complete the following information):

  • OS:
  • Version: 3.10 / debug / Rider

To Reproduce
There might be simpler methods to reproduce this issue:

  1. Create [Modulo]
  2. Duplicate as new type [IntModulo]
  3. In Rider open IntModulo.cs
  4. Change type of inputs and outputs from float to int
  5. Change GUIDs for inputs and outputs
  6. Save cs file

-> T3 fails to run after loading the new type.

    public Symbol.Child.Input Input
    {
        get => _input;
        set
        {
            _input = value;
            TypedInputValue = (InputValue<T>)value.Value;
            TypedDefaultValue = (InputValue<T>)value.DefaultValue;  // <-- CAST EXCEPTION

            if (_input.IsDefault && TypedDefaultValue.IsEditableInputReferenceType)
            {
                TypedInputValue.AssignClone(TypedDefaultValue);
            }
        }
    }
System.InvalidCastException: Unable to cast object of type 'T3.Core.Operator.Slots.InputValue`1[System.Single]' to type 'T3.Core.Operator.Slots.InputValue`1[System.Int32]'.
   at T3.Core.Operator.Slots.InputSlot`1.set_Input(Input value) in C:\Users\pixtur\dev\tooll\t3-main\Core\Operator\Slots\InputSlot.cs:line 40
   at T3.Core.Operator.SymbolInstantiation.TryCreateNewInstance(Child symbolChild, Instance parentInstance, Instance& newInstance) in C:\Users\pixtur\dev\tooll\t3-main\Core\Operator\Symbol.Child.Instantiation.cs:line 55
   at T3.Core.Operator.SymbolInstantiation.<TryCreateNewInstance>g__TryCreateInstance|0_0(Instance parent, Child symbolChild, Instance& newInstance, String& reason) in C:\Users\pixtur\dev\tooll\t3-main\Core\Operator\Symbol.Child.Instantiation.cs:line 128
   at T3.Core.Operator.SymbolInstantiation.TryCreateNewInstance(Child symbolChild, Instance parentInstance, Instance& newInstance) in C:\Users\pixtur\dev\tooll\t3-main\Core\Operator\Symbol.Child.Instantiation.cs:line 15
   at T3.Core.Operator.SymbolInstantiation.<TryCreateNewInstance>g__TryCreateInstance|0_0(Instance parent, Child symbolChild, Instance& newInstance, String& reason) in C:\Users\pixtur\dev\tooll\t3-main\Core\Operator\Symbol.Child.Instantiation.cs:line 128
   at T3.Core.Operator.SymbolInstantiation.TryCreateNewInstance(Child symbolChild, Instance parentInstance, Instance& newInstance) in C:\Users\pixtur\dev\tooll\t3-main\Core\Operator\Symbol.Child.Instantiation.cs:line 15
   at T3.Core.Operator.Symbol.UpdateInstanceType() in C:\Users\pixtur\dev\tooll\t3-main\Core\Operator\Symbol.TypeUpdating.cs:line 47
   at T3.Core.Model.SymbolPackage.UpdateSymbolInstances(Symbol symbol) in C:\Users\pixtur\dev\tooll\t3-main\Core\Model\SymbolPackage.cs:line 279
   at T3.Core.Model.SymbolPackage.LoadSymbols(Boolean parallel, List`1& newlyRead, List`1& allNewSymbols) in C:\Users\pixtur\dev\tooll\t3-main\Core\Model\SymbolPackage.cs:line 173
   at T3.Editor.Compilation.ProjectSetup.UpdateSymbolPackages(PackageWithReleaseInfo[] packages)
   at T3.Editor.Compilation.ProjectSetup.UpdateSymbolPackage[T](T project)
   at T3.Editor.UiModel.EditableSymbolProject.RecompileChangedProjects(Boolean async)
   at T3.Editor.Gui.WindowsUiContentDrawer.RenderCallback()
   at T3.Editor.App.AppWindow.<>c__DisplayClass38_0.<RunRenderLoop>b__0()
   at SharpDX.Windows.RenderLoop.Run(Control form, RenderCallback renderCallback, Boolean useApplicationDoEvents)
   at T3.Editor.App.AppWindow.RunRenderLoop(Action callback)
   at T3.Editor.Program.Main(String[] args)
@pixtur
Copy link
Collaborator Author

pixtur commented Oct 18, 2024

This exception appeared also after deleting an input node from a graph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant