Don't unlink ifc elements from vanilla collections on assign #4285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think this is not reallly ready to merge as-is but I would like to tackle a problem I have with the BlenderBIM addon automatically unlinking ifc objects from vanilla Blender collections on assign / save.
I consider this a semi-advanced feature because it takes the risk of associating the contents of the Blender file to the workflow of the BlenderBIM addon. Which in the past was extremely unstable but I must say nowadays I rarely encounter any bug regarding this workflow.
As you may know in Blender an object can be linked to any number of collections. This can be used to effectively visually filter certain elements. The current implementation prevents the user from using this feature because IFC elements are forced to be part of one and only one collection.
eg I may want a collection with only the beams in my project, or a collection with only my flow systems, or only the geographical elements. Currently it is possible to do it with the group and filter system but I think the workflow is a bit too much abstracted from Blender's systems and the query syntax forces the user to be intimate with the IFC terminology which is not always straightforward.
This PR only unlinks elements from collections which are part of the ifc project, effectively leaving vanilla collections untouched on save. This may unlock some new workflows like discussed over the OSArch forum.
I think eventually it would be nice to couple the collection feature with the systems feature to allow visual grouping of objects by linking to actual Blender collection.
I have not run the test suite to check if this ruins everything.
Please advise if you have any commentary. Cheers