Replies: 3 comments 1 reply
-
Following the FreeCAD API, the method must return a Coin object, what the method has to do internally is not clearly specified but I suppose adding a Switch or Separator is the most common thing to do. It may also be a primitive or whatever thing the Coin Scene accepts. FreeCAD documentation is very incomplete and outdated, so I actually don't know if adding to the scene is mandatory but the common sense says yes. Writing good documentation is hard and keeping it updated is even harder, unfortunately it is a common problem in FOSS that there are many code contributions but near to zero documentation contributions. The main reason why I have not merged devel into main yet is because I have had not time to update the docs :( |
Beta Was this translation helpful? Give feedback.
-
Actually the display mode selection is done by name (str), but the Coin Object is registered by fcapi into the obj.addDisplayMode(dm_obj, dm.name) Apart from that everything is left to the developer. |
Beta Was this translation helpful? Give feedback.
-
Looking at my own examples and exercising my old memory, it looks like adding the DisplayMode Coin Object to the ViewProvider is enough, so FC will take care of adding it to the scene. But I have to confess that I have not played too much with the Coin Scene graph. Fortunately anything useful that you can find in the official FreeCAD docs about this, still applies here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation states that you should return a Coin object, typically
SoSeparator()
but doesn't state how it is used (though I supposed that it's added to the root node withself.ViewObject.RootNode.addChild()
) and how to access it later on.Beta Was this translation helpful? Give feedback.
All reactions