[Draft] fix diffuse color issue when creating arrays (#8436)
This commit is contained in:
@@ -46,6 +46,7 @@ from draftobjects.patharray import PathArray
|
||||
from draftobjects.pathtwistedarray import PathTwistedArray
|
||||
|
||||
if App.GuiUp:
|
||||
from draftutils.todo import ToDo
|
||||
from draftviewproviders.view_array import ViewProviderDraftArray
|
||||
from draftviewproviders.view_draftlink import ViewProviderDraftLink
|
||||
|
||||
@@ -294,11 +295,9 @@ def make_path_array(base_object, path_object, count=4,
|
||||
else:
|
||||
ViewProviderDraftArray(new_obj.ViewObject)
|
||||
gui_utils.formatObject(new_obj, new_obj.Base)
|
||||
|
||||
if hasattr(new_obj.Base.ViewObject, "DiffuseColor"):
|
||||
if len(new_obj.Base.ViewObject.DiffuseColor) > 1:
|
||||
new_obj.ViewObject.Proxy.resetColors(new_obj.ViewObject)
|
||||
|
||||
new_obj.ViewObject.Proxy.resetColors(new_obj.ViewObject)
|
||||
# Workaround to trigger update of DiffuseColor:
|
||||
ToDo.delay(reapply_diffuse_color, new_obj.ViewObject)
|
||||
new_obj.Base.ViewObject.hide()
|
||||
gui_utils.select(new_obj)
|
||||
|
||||
@@ -384,14 +383,19 @@ def make_path_twisted_array(base_object, path_object,
|
||||
else:
|
||||
ViewProviderDraftArray(new_obj.ViewObject)
|
||||
gui_utils.formatObject(new_obj, new_obj.Base)
|
||||
|
||||
if hasattr(new_obj.Base.ViewObject, "DiffuseColor"):
|
||||
if len(new_obj.Base.ViewObject.DiffuseColor) > 1:
|
||||
new_obj.ViewObject.Proxy.resetColors(new_obj.ViewObject)
|
||||
|
||||
new_obj.ViewObject.Proxy.resetColors(new_obj.ViewObject)
|
||||
# Workaround to trigger update of DiffuseColor:
|
||||
ToDo.delay(reapply_diffuse_color, new_obj.ViewObject)
|
||||
new_obj.Base.ViewObject.hide()
|
||||
gui_utils.select(new_obj)
|
||||
|
||||
return new_obj
|
||||
|
||||
|
||||
def reapply_diffuse_color(vobj):
|
||||
try:
|
||||
vobj.DiffuseColor = vobj.DiffuseColor
|
||||
except:
|
||||
pass
|
||||
|
||||
## @}
|
||||
|
||||
Reference in New Issue
Block a user