Add virtual method allowOverrideViewProviderName to DocumentObject to indicate if a DocumentObject's view provider type can be overriden.
For most object types this is not allowed to avoid to create incompatible combinations via Python or manipulated project files and possibly provoke crashes. For more details see also: https://forum.freecadweb.org/viewtopic.php?f=10&t=38970&p=333951#p333951
This commit is contained in:
@@ -410,6 +410,11 @@ int FeaturePythonImp::setElementVisible(const char *element, bool visible) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
bool FeaturePythonImp::allowOverrideViewProviderName() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string FeaturePythonImp::getViewProviderName()
|
||||
{
|
||||
_FC_PY_CALL_CHECK(getViewProviderName,return(std::string()));
|
||||
|
||||
Reference in New Issue
Block a user