Skip to content

Filesystem utility nodes#6750

Merged
johnhaddon merged 5 commits into
GafferHQ:mainfrom
johnhaddon:fileList
Jun 17, 2026
Merged

Filesystem utility nodes#6750
johnhaddon merged 5 commits into
GafferHQ:mainfrom
johnhaddon:fileList

Conversation

@johnhaddon

Copy link
Copy Markdown
Member

This adds a little set of TaskNodes for renaming, copying and deleting files, as well as a FileList node for finding files matching certain criteria. Nothing too exciting, but hopefully a bit friendlier than doing the same stuff with SystemCommand/PythonCommand all the time.

@johnhaddon johnhaddon self-assigned this Jan 7, 2026
@github-project-automation github-project-automation Bot moved this to Pending Review in Work in Progress Jan 7, 2026
@johnhaddon johnhaddon changed the base branch from 1.6_maintenance to main March 20, 2026 15:32
@johnhaddon

Copy link
Copy Markdown
Member Author

I've rebased this on main to fix the merge conflicts. Would be good to get it reviewed soonish.

@johnhaddon

Copy link
Copy Markdown
Member Author

Would be good to get some 👀 on this before I completely forget what it was I was doing :)

@johnhaddon

Copy link
Copy Markdown
Member Author

Rebased on main again :)

@murraystevenson murraystevenson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks John, I've noted a few small things inline but overall this is looking like another great addition for 1.7.

As we touched on this morning, one thing that might be worth improving in the future is making it easier to rename sequences. Currently RenameFiles is a bit awkward for that purpose, but it's still possible via the find and replace plugs...

Comment thread python/GafferDispatchUI/FileListUI.py Outdated
Comment thread python/GafferDispatchUI/RenameFilesUI.py Outdated
Comment thread src/GafferDispatch/FileList.cpp Outdated
Comment thread src/GafferDispatch/RenameFiles.cpp Outdated
Comment thread src/GafferDispatch/RenameFiles.cpp
Comment thread src/GafferDispatchModule/FileNodeBinding.cpp
Comment thread src/GafferDispatch/CopyFiles.cpp Outdated
Comment thread src/GafferDispatch/FileList.cpp
Comment on lines +127 to +140
"extensions" : {

"description" :
"""
A list of file extensions to filter on. Extension comparison
is case-insensitive.
""",

"preset:All" : "*",

"plugValueWidget:type" : "GafferUI.PresetsPlugValueWidget",
"presetsPlugValueWidget:allowCustom" : True,

},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth having a way to only list directories? You can sort of do that currently by setting extensions to "", but it's not bullet-proof if there are also files without extensions. Maybe this could be a mode plug that could also allow only returning files so when setting extensions to "*" you could avoid a mix of files of directories. Though I wouldn't call this a huge priority and we could always add a plug later and default it to "files and directories" mode...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that sounds useful. I wonder if two separate files and directories checkboxes would be easier to use than mode? If you don't mind, I'd rather do this as a followup at some point, so I can focus on the bigger stuff needed for 1.7.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate files and directories checkboxes as a later followup sounds good to me.

@johnhaddon

Copy link
Copy Markdown
Member Author

Note to self : Changes.md needs work when squashing - everything is under the wrong version.

Added to GafferDispatch rather than Gaffer because it is a natural companion
for an upcoming series of nodes that manipulates files (and because Gaffer is
fairly cluttered already).
This just registers some metadata to add extension presets and menu items for creating FileList nodes.
@murraystevenson

Copy link
Copy Markdown
Contributor

Note to self : Changes.md needs work when squashing - everything is under the wrong version.

I squashed this down and updated Changes.md thinking we might be able to merge this today, though once the tests were able to run we hit an issue on Windows with RenameFilesTest.testRenameSymlink where pathlib.readlink() would return a //?/ prefixed path, which failed the equality test with the original path. I've pushed e2544a1 which changes the test to renamedLink.samefile( file ) instead of comparing the paths themselves, if you're happy with that then we should be good to squash and merge.

@johnhaddon johnhaddon merged commit d2ca969 into GafferHQ:main Jun 17, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Pending Review to Pending release in Work in Progress Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants