Comments (5)
If you drag and drop bodies, everything works fine
from freecad.
Does it work when you manually drag both into the assembly object in the tree view?
@PaddleStroke FYI
from freecad.
This is the same bug as #13780
The issue is that getRootObject is returning the root of dependency graph and not root of the tree. I made this getRootObjectsIgnoreLinks to solve the initial problem. But I have not taken into account the shape binders which are same as links.
And there are also Draft and PartDesign Clones.
We could add
return obj->isDerivedFrom<App::Link>()
|| obj->isDerivedFrom(Base::Type::fromName("PartDesign::SubShapeBinder"));
to fix the case of subShapeBinder, but that cannot solve Draft clone case for instance, as those objects are Part::FeaturePython
. Also there might be a lot of case of other objects referencing tree root objects.
@wwmayer is there not a clean way to get the tree-root-level objects? The tree is being build so there must be a way to get that.
See Pendelf video where he shows the problem : https://youtu.be/f-PxEIDXzF4
from freecad.
If you use shape binder to create one of the bodies, the first body will not be available when adding bodies to the assembly
It doesn't work with the sub-shape binder (green icon) but works without problems with the shape binder (blue icon).
is there not a clean way to get the tree-root-level objects?
The method claimChildren() of a view provider shows the referenced objects as child items in the tree view. So, all objects that are not claimed by a view provider must be top-level objects.
But does this really solve the problem? What happens if the two bodies are inside a Part container?
from freecad.
So to get the tree root object you iterate through all the document objects, build the list of objects that are within at least one of the object VP claimChildren return function, then the root is the rest of the objects right?
If so I will make a 'getTreeRootObject' in Gui.
Yes it solves the problem because 'insert component' is building a tree starting from root objects. So if Part container is a root object, it will be picked up. Then it is iteratively browsed to build the tree so the bodies within are found.
from freecad.
Related Issues (20)
- Subshape binder offset creates 3D surface from planar face HOT 3
- CAM LeadInOut Dressup Doesn't respect perimeter HOT 2
- Part Design: can't pad a sketch on datum plane "Pad: Null shape" HOT 8
- [BUG] Using a loft with holes in the sketch causes the loft to have erroneous faces and any fusion of it doesn't have the loft HOT 1
- The software crashes when I click on the import file type with dual monitors HOT 13
- [TechDraw][UX]ExtensionLockUnlockView tool icon changes depending on the situation
- [TechDraw][Bug] Imported SVG symbols are incorrectly scaled HOT 2
- you can't constrain a wedge of a circle in scetcher HOT 6
- Non-Selected faces rendered without color HOT 4
- Navigation: CAD Drag at Cursor broken when Transform tool is active HOT 1
- Program closes when search in file explorer, or change folder HOT 3
- Measurement: Problem with the default color settings on Windows with Classic stylesheet HOT 5
- Measurement: Can't measure the spring wire radius HOT 6
- Preferences: Display>UI chaos HOT 4
- FreeCAD 0.21.2 Screen Flickering HOT 2
- DiffuseColor and ShapeColor applied inconsistently HOT 5
- Empty widget item warning HOT 2
- No Sketcher Tools Active HOT 3
- Measurement: Reactivating the old Measurement Tools until the new one works correctly HOT 1
- Measurement: Unable to switch between direct measurement and 3-axis measurement HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freecad.