[Draft] fix diffuse color issue when creating arrays (#8436)
This commit is contained in:
@@ -39,6 +39,7 @@ from draftutils.translate import translate
|
||||
from draftobjects.array import Array
|
||||
|
||||
if App.GuiUp:
|
||||
from draftutils.todo import ToDo
|
||||
from draftviewproviders.view_array import ViewProviderDraftArray
|
||||
from draftviewproviders.view_draftlink import ViewProviderDraftLink
|
||||
|
||||
@@ -128,13 +129,13 @@ def make_array(base_object,
|
||||
if use_link:
|
||||
ViewProviderDraftLink(new_obj.ViewObject)
|
||||
else:
|
||||
if new_obj.ArrayType == "circular":
|
||||
new_obj.Proxy.execute(new_obj) # Updates Count which is required for correct DiffuseColor.
|
||||
ViewProviderDraftArray(new_obj.ViewObject)
|
||||
gui_utils.format_object(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)
|
||||
|
||||
@@ -154,4 +155,11 @@ def makeArray(baseobject,
|
||||
arg1, arg2, arg3,
|
||||
arg4, arg5, arg6, use_link)
|
||||
|
||||
|
||||
def reapply_diffuse_color(vobj):
|
||||
try:
|
||||
vobj.DiffuseColor = vobj.DiffuseColor
|
||||
except:
|
||||
pass
|
||||
|
||||
## @}
|
||||
|
||||
Reference in New Issue
Block a user