Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Document getRootObjects : Fix bug of objects linked not returned. #13780

Merged
merged 1 commit into from May 13, 2024

Conversation

PaddleStroke
Copy link
Contributor

If a root object has a link pointing to it, then it is not returned by RootObjects.
image
Having a look at the function in cpp it seems to be because its checking if the inList is empty to determine if its a root object.

https://forum.freecad.org/viewtopic.php?p=756837#p756837

@github-actions github-actions bot added the Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD label May 2, 2024
@PaddleStroke PaddleStroke marked this pull request as draft May 3, 2024 08:46
@PaddleStroke
Copy link
Contributor Author

Set as draft waiting discussion to resolve.

…mblyObject.cpp, CommandInsertLink.py, UtilsAssembly.py
@PaddleStroke PaddleStroke marked this pull request as ready for review May 10, 2024 09:27
@PaddleStroke
Copy link
Contributor Author

PaddleStroke commented May 10, 2024

It appears that RootObjects are the 'dependency-free objects that are in this document' and not 'root objects of the document' ie the tree-root level objects as one would most likely expect.

So even though it appears nothing in the code base is using RootObjects in this original sense, instead of fixing getRootObjects, I introduced another function getRootObjectsIgnoreLinks. And replaced getRootObjects in the places where I know they are problematic :

  • Tree.cpp
  • AssemblyObject.cpp
  • CommandInsertLink.py
  • UtilsAssembly.py

@yorikvanhavre yorikvanhavre merged commit 344b125 into FreeCAD:main May 13, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants