Restore ViewObject implementation for all Draft objects
In my tests the code works fine. Using @AIRCAP's instructions, I have created a 'broken' file from draft_test_objects.FCStd.
This commit is contained in:
@@ -31,15 +31,15 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
|
||||
import FreeCAD as App
|
||||
import DraftVecUtils
|
||||
|
||||
from draftobjects.base import DraftObject
|
||||
from draftutils import gui_utils
|
||||
|
||||
|
||||
class Clone(DraftObject):
|
||||
"""The Clone object"""
|
||||
|
||||
def __init__(self,obj):
|
||||
super(Clone, self).__init__(obj, "Clone")
|
||||
super().__init__(obj, "Clone")
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"The objects included in this clone")
|
||||
@@ -59,6 +59,12 @@ class Clone(DraftObject):
|
||||
|
||||
obj.Scale = App.Vector(1,1,1)
|
||||
|
||||
def onDocumentRestored(self, obj):
|
||||
super().onDocumentRestored(obj)
|
||||
gui_utils.restore_view_object(
|
||||
obj, vp_module="view_clone", vp_class="ViewProviderClone", format_ref=obj.Objects[0]
|
||||
)
|
||||
|
||||
def join(self,obj,shapes):
|
||||
fuse = getattr(obj, 'Fuse', False)
|
||||
if fuse:
|
||||
|
||||
Reference in New Issue
Block a user