Fusion360Exporter icon indicating copy to clipboard operation
Fusion360Exporter copied to clipboard

Feature: selective export

Open raphael-bmec-co opened this issue 11 months ago • 9 comments

I would like to propose a feature/change as follows.

The Show Project Folders button causes a long hang and is only one level deep.

I would like to propose some form of nesting/exclusion.

Perhaps if you only select a single project then the option for excluding folders comes up?

The use case is that we sometime have "archive" folders in our projects that we don't need to export.

raphael-bmec-co avatar Jan 10 '25 10:01 raphael-bmec-co

The hang could be improved if there was for example one dropdown for project selection, then if you enable Show Project Folders, we populate a second dropdown with the folders for only the selected projects. That would still iterate over all the folders at level 1 in the selected projects, but at least not for all projects. There isn't (AFAIK) a tree UI widget so that was also a motivator for going one level deep

If you know ahead of time you're always going to exclude a fixed list, then it might be simpler to have an ignore file like .gitignore. That would be simpler too than building more UI. For an ignore, we still have to iterate over all folders in the selected projects, but that would happen at run time instead of in the UI.

aconz2 avatar Jan 10 '25 14:01 aconz2

If you know ahead of time you're always going to exclude a fixed list, then it might be simpler to have an ignore file like .gitignore.

I think this is a great approach! Looks like this package could do the heavy lifting for us: https://github.com/thehanimo/py-gitignore.

raphael-bmec-co avatar Jan 10 '25 15:01 raphael-bmec-co

I'm reluctant to rely on any dependencies because I'm not sure how much a pain it is to get them working with fusion. Do you know? Maybe something simple with fnmatch would suffice

aconz2 avatar Jan 12 '25 15:01 aconz2

Agreed, fnmatch should do the job.

Do you want to have a separate file or an entry in the last_settings.json. Maybe:

"ignore_directories": [
  "*.archive"
]

raphael-bmec-co avatar Jan 13 '25 07:01 raphael-bmec-co

I'd lean separate file to keep just the UI settings in last_settings.json. Separate file feels overkill for a single pattern but saves the headache of editing multiple patterns in a single tiny text box and having a separator character. I am thinking the logic in the code will concat {project}/{dir} (and nested {project}/dir1/{dir}) and test against each pattern. Having the project as a leading "folder" is maybe useful? Or unnecessary?

aconz2 avatar Jan 13 '25 17:01 aconz2

Okay, seperate file it is.

Do you have a preference for the filename? Maybe .exportignore?

raphael-bmec-co avatar Jan 13 '25 17:01 raphael-bmec-co

Maybe extra_settings.json? and have {"ignore_patterns": []} in there. That way any more settings can go in there in the future without a new file. And while the leading dot is conventional in eg gitignore I don't think it is that useful here; and I think can be confusing on windows

aconz2 avatar Jan 14 '25 15:01 aconz2

Sounds good. I have a bit much on my plate at the moment. But I will try get to this when I can.

raphael-bmec-co avatar Jan 15 '25 11:01 raphael-bmec-co

Your script is great. Thank you . The only thing that could greatly improve its functionality would be a deeper directory listing

Tylkopoco avatar Feb 12 '25 11:02 Tylkopoco