File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 19
19
from Part import makeBox
20
20
import Part
21
21
import math
22
+ import FreeCADGui
22
23
23
24
thread_color = (0.5 ,1. ,5. ,0. )
24
25
26
+ def runs_headless ():
27
+ return 'setupWithoutGUI' in FreeCADGui .__dict__
28
+
25
29
def color_face (part ,n ):
30
+ if runs_headless ():
31
+ return
26
32
color = part .ViewObject .DiffuseColor [0 ]
27
33
n_faces = len (part .Shape .Faces )
28
34
part .ViewObject .DiffuseColor = [color if i != n else thread_color for i in range (n_faces )]
Original file line number Diff line number Diff line change 19
19
from Part import makeBox
20
20
import Part
21
21
import math
22
+ import FreeCADGui
22
23
23
24
thread_color = (0.5 ,1. ,5. ,0. )
24
25
26
+ def runs_headless ():
27
+ return 'setupWithoutGUI' in FreeCADGui .__dict__
28
+
25
29
def color_face (part ,n ):
30
+ if runs_headless ():
31
+ return
26
32
color = part .ViewObject .DiffuseColor [0 ]
27
33
n_faces = len (part .Shape .Faces )
28
34
part .ViewObject .DiffuseColor = [color if i != n else thread_color for i in range (n_faces )]
You can’t perform that action at this time.
0 commit comments