@@ -234,7 +234,7 @@ def set_selected(self, selected=True):
234234 self .set_property ('selected' , selected )
235235
236236 def create_property (self , name , value , items = None , range = None ,
237- widget_type = NODE_PROP , tab = None ):
237+ widget_type = NODE_PROP , tab = None , ext = None ):
238238 """
239239 Creates a custom property to the node.
240240
@@ -247,7 +247,13 @@ def create_property(self, name, value, items=None, range=None,
247247 - :attr:`NodeGraphQt.constants.NODE_PROP_QCHECKBOX`
248248 - :attr:`NodeGraphQt.constants.NODE_PROP_QSPINBOX`
249249 - :attr:`NodeGraphQt.constants.NODE_PROP_COLORPICKER`
250- - :attr:`NodeGraphQt.constants.NODE_PROP_SLIDER`
250+ - :attr:`NodeGraphQt.constants.NODE_PROP_FILE`
251+ - :attr:`NodeGraphQt.constants.NODE_PROP_VECTOR2`
252+ - :attr:`NodeGraphQt.constants.NODE_PROP_VECTOR3`
253+ - :attr:`NodeGraphQt.constants.NODE_PROP_VECTOR4`
254+ - :attr:`NodeGraphQt.constants.NODE_PROP_FLOAT`
255+ - :attr:`NodeGraphQt.constants.NODE_PROP_INT`
256+ - :attr:`NodeGraphQt.constants.NODE_PROP_BUTTON`
251257
252258 See Also:
253259 :class:`NodeGraphQt.PropertiesBinWidget`
@@ -259,8 +265,9 @@ def create_property(self, name, value, items=None, range=None,
259265 range (tuple)): ``(min, max)`` values used by ``NODE_PROP_SLIDER``
260266 widget_type (int): widget flag to display in the ``PropertiesBinWidget``
261267 tab (str): name of the widget tab to display in the properties bin.
268+ ext (str): file ext of ``NODE_PROP_FILE``
262269 """
263- self .model .add_property (name , value , items , range , widget_type , tab )
270+ self .model .add_property (name , value , items , range , widget_type , tab , ext )
264271
265272 def properties (self ):
266273 """
@@ -557,9 +564,12 @@ def add_file_input(self, name, label='', text='', tab=None, ext="*"):
557564 tab (str): name of the widget tab to display in.
558565 ext (str): file ext
559566 """
560- self .create_property (
561- name , text , widget_type = NODE_PROP_FILE , tab = tab )
562- widget = NodeFilePath (self .view , name , label , text ,ext )
567+ self .model .add_property (name , text , None , None , NODE_PROP_FILE , tab , ext )
568+ # use create_property will cause strange error
569+ # self.create_property(
570+ # name, text, widget_type=NODE_PROP_FILE, tab=tab, ext=None)
571+
572+ widget = NodeFilePath (self .view , name , label , text , ext )
563573 widget .value_changed .connect (lambda k , v : self .set_property (k , v ))
564574 self .view .add_widget (widget )
565575
0 commit comments