Draft: fix clone diffuse color regression
Fixes #27958. Delay formatting of clone object to ensure shape availability.
This commit is contained in:
@@ -36,6 +36,7 @@ from draftutils import utils
|
||||
from draftutils import gui_utils
|
||||
|
||||
if App.GuiUp:
|
||||
from PySide import QtCore
|
||||
from draftviewproviders.view_clone import ViewProviderClone
|
||||
|
||||
|
||||
@@ -131,7 +132,10 @@ def make_clone(obj, delta=None, forcedraft=False):
|
||||
cl.LongName = obj[0].LongName
|
||||
if App.GuiUp:
|
||||
ViewProviderClone(cl.ViewObject)
|
||||
gui_utils.format_object(cl, obj[0])
|
||||
# Shape of clone may not yet be available (v1.1 regression). We need to delay
|
||||
# `format_object()` as that function requires the correct number of faces.
|
||||
# https://github.com/FreeCAD/FreeCAD/issues/27958
|
||||
QtCore.QTimer.singleShot(0, lambda: gui_utils.format_object(cl, obj[0]))
|
||||
gui_utils.select(cl)
|
||||
return cl
|
||||
|
||||
|
||||
Reference in New Issue
Block a user