leon-thomm / ryvencore-qt

Qt frontend for ryvencore - Python library for building visual node editors

Home Page:https://leon-thomm.github.io/ryvencore-qt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when connecting to dtype inputs

RZechlin opened this issue · comments

Hi,
I hope it is correct to report this issue here, although it occurred while using Ryven.
When connecting to a node with, for example, a dtype=dtypes.Integer(), an error can be thrown if the type of the input does not match the expectation (Integer).
While this generally makes sense, it makes building macros with one of the inputs being used in a for loop impossible. The data type of the input will be None.
When a file is saved that has one of these "illegal" connections, it also becomes impossible to open in Ryven as the error is thrown during the loading process as well and will shut down the process.

Traceback (most recent call last):
  File "C:\Users\test\.virtualenvs\Ryven\lib\site-packages\ryvencore_qt\src\FlowView.py", line 876, in add_connection

item.inp_item.port_connected()

  File "C:\Users\test\.virtualenvs\Ryven\lib\site-packages\ryvencore_qt\src\PortItem.py", line 168, in port_connected

self._port_val_updated(self.port.val)

  File "C:\Users\test\.virtualenvs\Ryven\lib\site-packages\ryvencore_qt\src\PortItem.py", line 179, in _port_val_updated

self.widget.val_update_event(val)

  File "C:\Users\test\.virtualenvs\Ryven\lib\site-packages\ryvencore_qt\src\PortItemInputWidgets.py", line 285, in val_update_event

self.setValue(val)

TypeError
:
'PySide2.QtWidgets.QSpinBox.setValue' called with wrong argument types:
  PySide2.QtWidgets.QSpinBox.setValue(NoneType)
Supported signatures:
  PySide2.QtWidgets.QSpinBox.setValue(int)

Is there a way to alert to this error but still allow for the creation of flows?

Thank you very much, that wasn't intended.

Should be fixed in 0f623c4 (master branch).

I will upload a new version to PyPi later today

Thank you. However, the save file won't load if there is an error in one of the scripts.
It works fine as long the error is just in one of the macros.
To reproduce: Connect a "val" node with e.g. [1,2,3] to a "for each" node. After saving and closing the program, I am not able to open the save file. The process stops after

TypeError: 'PySide2.QtWidgets.QSpinBox.setValue' called with wrong argument types:
  PySide2.QtWidgets.QSpinBox.setValue(NoneType)
Supported signatures:
  PySide2.QtWidgets.QSpinBox.setValue(int)

It works with the new version on my system. Did you install it? (it should be pip install ryvencore-qt --upgrade)
If so, could you send me this project file so I can try?

It is now working. I'm sorry, I must have forgotten updating the library.

I can open files with any of these related errors now.