Открыть боковую панель
nikitronn
sverchok
Коммиты
04497119
Коммит
04497119
создал
Май 01, 2022
по автору
Dealga McArdle
Просмотр файлов
use mode
владелец
6150f834
Изменения
1
Скрыть пробелы
Построчно
Рядом
nodes/network/file_path.py
Просмотр файла @
04497119
...
...
@@ -38,16 +38,15 @@ class SvFilePathFinder(bpy.types.Operator, SvGenericNodeLocator):
name
=
"File Path"
,
description
=
"Filepath used for writing files"
,
maxlen
=
1024
,
default
=
""
,
subtype
=
'FILE_PATH'
)
filename_ext
:
StringProperty
(
default
=
""
)
filter_glob
:
StringProperty
(
default
=
""
,
options
=
{
'HIDDEN'
})
mode
:
StringProperty
(
default
=
''
)
def
custom_config
(
self
,
context
):
if
self
.
mode
==
"FreeCAD"
:
self
.
filename_ext
=
".FCStd"
# ".tif"
self
.
filter_glob
=
"*.FCStd"
# #*.tif;*.png;" (if more than one, separate by ;)
mode
:
StringProperty
(
default
=
''
,
update
=
custom_config
)
filename_ext
:
StringProperty
(
default
=
""
)
filter_glob
:
StringProperty
(
default
=
""
,
options
=
{
'HIDDEN'
})
def
sv_execute
(
self
,
context
,
node
):
if
self
.
mode
==
"FreeCAD"
:
print
(
"can do something here"
)
...
...
@@ -56,6 +55,9 @@ class SvFilePathFinder(bpy.types.Operator, SvGenericNodeLocator):
node
.
set_data
(
self
.
directory
,
self
.
files
)
def
invoke
(
self
,
context
,
event
):
if
self
.
mode
:
self
.
custom_config
(
context
)
wm
=
context
.
window_manager
wm
.
fileselect_add
(
self
)
return
{
'RUNNING_MODAL'
}
...
...
@@ -74,6 +76,7 @@ class SvFilePathNode(bpy.types.Node, SverchCustomTreeNode):
files_num
:
IntProperty
(
name
=
'files number '
,
default
=
0
)
files
:
CollectionProperty
(
name
=
"File Path"
,
type
=
OperatorFileListElement
)
directory
:
StringProperty
(
subtype
=
'DIR_PATH'
,
update
=
updateNode
)
mode
:
StringProperty
(
default
=
''
,
description
=
"mode determines behaviour of the File Open Dialogue and Operator"
)
def
sv_init
(
self
,
context
):
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать