-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmeasureit_arch_baseclass.py
1192 lines (983 loc) · 36.5 KB
/
measureit_arch_baseclass.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from enum import Enum
import bpy
import math
from bpy.types import PropertyGroup, Operator, Collection
from bpy.props import IntProperty, CollectionProperty, FloatVectorProperty, \
BoolProperty, StringProperty, FloatProperty, EnumProperty, PointerProperty
from .measureit_arch_units import BU_TO_INCHES
from .measureit_arch_utils import get_resolution
def recalc_index(self, context):
# ensure index's are accurate
StyleGen = context.scene.StyleGenerator
wrapper = StyleGen.wrapper
id_l = 0
id_a = 0
id_d = 0
# Check Count of items to wrap
total_dims_wrapped = len(StyleGen.alignedDimensions)
total_lines_wrapped = len(StyleGen.line_groups)
total_annos_wrapped = len(StyleGen.annotations)
for style in wrapper:
if style.itemType == 'line_groups':
style.itemIndex = id_l
style.name = StyleGen.line_groups[id_l].name
id_l += 1
elif style.itemType == 'alignedDimensions':
style.itemIndex = id_d
style.name = StyleGen.alignedDimensions[id_d].name
id_d += 1
elif style.itemType == 'annotations':
style.itemIndex = id_a
style.name = StyleGen.annotations[id_a].name
id_a += 1
while total_lines_wrapped > id_l:
new_wrapper = wrapper.add()
new_wrapper.itemType = 'line_groups'
new_wrapper.itemIndex = id_l
new_wrapper.name = StyleGen.line_groups[id_l].name
id_l += 1
while total_dims_wrapped > id_d:
new_wrapper = wrapper.add()
new_wrapper.itemType = 'alignedDimensions'
new_wrapper.itemIndex = id_d
new_wrapper.name = StyleGen.line_groups[id_d].name
id_d += 1
while total_annos_wrapped > id_a:
new_wrapper = wrapper.add()
new_wrapper.itemType = 'annotations'
new_wrapper.itemIndex = id_a
new_wrapper.name = StyleGen.line_groups[id_a].name
id_a += 1
class StyleWrapper(PropertyGroup):
itemType: EnumProperty(
items=(
('line_groups', "Line", ""),
('annotations', "Annotation", ""),
('alignedDimensions', "Dimension", "")),
name="Style Item Type",
update=recalc_index)
itemIndex: IntProperty(name='Item Index')
def update_flag(self, context):
self.text_updated = True
self.is_invalid = True
def mark_invalid(self,context):
self.is_invalid = True
def update_camera(self,context):
scene = context.scene
camera = scene.camera.data
render = scene.render
ViewGen = scene.ViewGenerator
view = ViewGen.views[ViewGen.active_index]
width = view.width
height = view.height
modelScale = view.model_scale
paperScale = view.paper_scale
ppi = get_resolution(update_flag=True)
render.resolution_percentage = 100
render.resolution_x = int(width * ppi * BU_TO_INCHES)
render.resolution_y = int(height * ppi * BU_TO_INCHES)
if width > height:
camera.ortho_scale = (
render.resolution_x / ppi / BU_TO_INCHES) * (modelScale / paperScale)
else:
camera.ortho_scale = (
render.resolution_y / ppi / BU_TO_INCHES) * (modelScale / paperScale)
def has_dimension_generator(context):
return context.object is not None and \
hasattr(context.object, "DimensionGenerator") and \
len(context.object.DimensionGenerator) > 0
def update_active_dim(self, context):
dimGen = context.object.DimensionGenerator
itemType = self.itemType
idx = 0
mark_invalid(self,context)
for wrap in dimGen.wrapper:
if itemType == wrap.itemType:
if itemType == 'alignedDimensions':
if self == dimGen.alignedDimensions[wrap.itemIndex]:
dimGen.active_index = idx
return
elif itemType == 'axisDimensions':
if self == dimGen.axisDimensions[wrap.itemIndex]:
dimGen.active_index = idx
return
idx += 1
def recalc_dimWrapper_index(self, context):
for obj in context.selected_objects:
dimGen = obj.DimensionGenerator
wrapper = dimGen.wrapper
id_aligned = 0
id_angle = 0
id_axis = 0
id_arc = 0
id_area = 0
for dim in wrapper:
if dim.itemType == 'alignedDimensions':
dim.itemIndex = id_aligned
id_aligned += 1
elif dim.itemType == 'angleDimensions':
dim.itemIndex = id_angle
id_angle += 1
elif dim.itemType == 'axisDimensions':
dim.itemIndex = id_axis
id_axis += 1
elif dim.itemType == 'arcDimensions':
dim.itemIndex = id_arc
id_arc += 1
elif dim.itemType == 'areaDimensions':
dim.itemIndex = id_area
id_area += 1
class BaseProp:
def get_name(self):
try:
return self['name']
except KeyError:
return ''
def set_name(self,value):
self['previous_name'] = self.name
self['name'] = value
name: StringProperty(
name='Name',
get = get_name,
set = set_name
)
is_invalid: BoolProperty(
name='Is Invalid'
)
previous_name: StringProperty(
name='Previous Name'
)
creation_time: StringProperty(
name='Creation Time',
description ='Timestamp of elements creation, used as a UID for caching line groups',
default = '0'
)
is_active: BoolProperty(
name='Is Active',
description='This item is actively selected',
default=False)
icon: StringProperty(
name="Icon",
description="item icon",
default="",)
generator: StringProperty(
name="Generator",
description="item generator - api property",
default="",)
gen_group: StringProperty(
name="Generator Group",
description="group in the generator - api property",
default="",)
inFront: BoolProperty(
name='inFront',
description='Draw this element In front of other objects',
default=False)
visibleInView: StringProperty(
name="View Layer",
description="View Layer that this dimension is visible in",
default="",)
is_style: BoolProperty(
name="is Style",
description="This property Group is a Style",
default=False,
update = mark_invalid)
uses_style: BoolProperty(
name="uses Style",
description="This property Group Uses a Style",
default=False,
update=update_flag)
style: StringProperty(
name="Style Name",
description="Item Name",
default="",
update=update_flag)
style_pointer: PointerProperty(
type = StyleWrapper,
update = update_flag
)
itemType: StringProperty(
name="Item Type",
description='flag for common operators',
default='')
color: FloatVectorProperty(
name="Color",
description="Color for the Item",
default=(0.0, 0.0, 0.0, 1.0),
min=0,
max=1,
subtype='COLOR',
size=4,
update=update_flag)
cad_col_idx: IntProperty(
name="CAD Color Index",
description="Autocad Color Index, for .dxf export or high contrast preview",
default=0,
min=0,
max=255,
update = mark_invalid)
lineWeight: FloatProperty(
name="Line Weight",
description="Lineweight",
default=1,
soft_min=0.1,
step=25,
min=0,
update = mark_invalid)
free: BoolProperty(
name="Free",
description="This Item is free and can be deleted",
default=False)
evalMods: BoolProperty(
name="Evaluate Depsgraph",
description="This Element will evaluate the Dependency Graph "
"(Modifiers, Shape Keys etc.) before drawing",
default=False)
settings: BoolProperty(
name="Settings",
description="Show Settings",
default=False)
visible: BoolProperty(
name="Visibility",
description="how/hide",
default=True,
update = mark_invalid)
# Endcap properties are defined here to ensure compatiblity but the
# enumProps are overwritten in child property groups
endcapSize: FloatProperty(
name="dimEndcapSize",
description="End Cap size",
default=4, min=0, max=500,step=100,precision=0)
endcapArrowAngle: FloatProperty(
name="endcapArrowAngle",
description="End Cap Arrow Angle",
default=math.radians(15),
soft_min=math.radians(15),
soft_max=math.radians(45),
subtype='ANGLE')
endcapA: EnumProperty(
items=(('99', "--", "No arrow"),
('1', "Line", "The point of the arrow are lines")),
name="A end",
description="Add arrows to point A")
endcapB: EnumProperty(
items=(('99', "--", "No arrow"),
('1', "Line", "The point of the arrow are lines")),
name="B end",
description="Add arrows to point A")
gizLoc: FloatVectorProperty(
name="Gizmo Location",
description="Default Location for item Gizmo",
subtype='TRANSLATION')
gizRotDir: FloatVectorProperty(
name="Gizmo Rotation Direction",
description="Default Rot Direction for item Gizmo",
subtype='TRANSLATION')
depth_test_override: EnumProperty(
items=(
('NONE','None',''),
('DEPTH_BUFFER', 'Depth Buffer', ''),
('GEOMETRIC', 'Geometric', '')
),
name="Depth Test Method Override",
description="Method for depth testing when rendering vector linework. Depth Buffer is generally faster but less precise",
default='NONE',)
class ObjProps(PropertyGroup):
ignore_in_depth_test: BoolProperty(
name='Ignore in Depth Test',
description='Ignore this object in Vector Depth Tests',
default=False)
skip_depth_test: BoolProperty(
name='Skip Depth Test',
description='Skip Depth Tests on this object',
default=False)
obj_hatch_pattern: PointerProperty(name='Object Hatch Pattern', type=Collection)
obj_patternSize: FloatProperty(
name='Object Hatch Size',
description="Object Hatch Size",
default=1.0, min=0.0,)
obj_patternRot: FloatProperty(
name='Object Hatch Rotation',
description="Object Hatch Rotation",
default=0.0, min=0.0,subtype='ANGLE')
class TextField(PropertyGroup):
is_invalid: BoolProperty(
name='Is Invalid'
)
text_updated: BoolProperty(
name='text_updated',
description='flag when text needs to be redrawn',
default=False)
text: StringProperty(
name="Text",
description="Text Associated With Item",
default="",
update=update_flag)
autoFillText: BoolProperty(
name='Auto Fill Text',
description='Fill This Text Field Automatically from a property',
default=False)
textSource: EnumProperty(
items=(('VIEW', "View", "", 'DOCUMENTS', 1),
('DATE', "Date", "", 'TIME', 2),
('NOTES', "Notes", "", 'LONGDISPLAY', 3),
('C_LENGTH', "Curve Length", "", 'OUTLINER_DATA_CURVE', 4),
('ELEVATION', "Elevation","",'TRACKING_CLEAR_FORWARDS',5),
('SCALE', "Scale", "", 'SNAP_INCREMENT', 6),
('VIEWNUM', "Drawing Number", "", 'SORTALPHA', 8),
('LENGTH', "Dimension Length", "", 'DRIVER_DISTANCE', 9),
('TEXT_FILE', "Text File", "", 'TEXT', 10),
('PROJECT_NAME', "Project Name", "", 'TEXT', 11),
('PROJECT_NUMBER', "Project Number", "", 'TEXT', 12),
('PROJECT_ADDRESS', "Project Address", "", 'TEXT', 13),
('RNAPROP', "Custom Property", "", 'RNA', 99)),
name="Text Source",
default='RNAPROP',
description="Set Text Field Source")
rnaProp: StringProperty(
name="Custom Prop String",
description="RNA Prop String",
default="",
update=update_flag)
textFile: PointerProperty(
name="TextFile",
type = bpy.types.Text)
textAlignment: EnumProperty(
items=(('L', "Left", "", 'ALIGN_LEFT', 1),
('C', "Center", "", 'ALIGN_CENTER', 2),
('R', "Right", "", 'ALIGN_RIGHT', 3)),
name="Justification",
default='L',
description="Set Font alignment")
textPosition: EnumProperty(
items=(('T', "Top", "", 'ALIGN_TOP', 1),
('M', "Mid", "", 'ALIGN_MIDDLE', 2),
('B', "Bottom", "", 'ALIGN_BOTTOM', 3)),
name="Position",
description="Set Font Position")
boundaryShape: EnumProperty(
items=(('NONE', "None",""),
('BORDER', "Border",""),
('ROUNDED', "Rounded",""),
('DIAMOND', "Diamond",""),
('HEX', "Hexagon",""),
('CIRCLE', "Circle",""),
),
name="Position",
default = 'NONE',
description="Set Font Position")
textWidth: IntProperty(
name='annotationWidth',
description='Width of annotation')
textHeight: IntProperty(
name='annotationHeight',
description='Height of annotation')
texture_updated: BoolProperty(
name='texture_updated',
description='flag when text texture need to be redrawn',
default=False)
def draw_textfield_settings(item, box, prop_path, dim_skip_length = False, entry_disabled = False, show_buttons = True):
col = box.column(align=True)
idx = 0
for textField in item.textFields:
if idx == 0 and dim_skip_length:
idx += 1
continue
col = box.column(align=True)
row = col.row(align=True)
row.prop(textField, 'autoFillText',
text="", icon="FILE_TEXT")
if textField.autoFillText:
row.prop(textField, 'textSource', text="")
else:
if entry_disabled:
row = row.row()
row.enabled = False
row.prop(textField, 'text', text="")
if textField.textSource == 'RNAPROP' and textField.autoFillText:
row.prop(textField, 'rnaProp', text="")
elif textField.textSource == 'TEXT_FILE' and textField.autoFillText:
row.prop_search(textField, 'textFile', bpy.data, 'texts', text="", icon='TEXT')
row.prop(textField,'boundaryShape',text="")
if show_buttons:
row.emboss = 'PULLDOWN_MENU'
op = row.operator('measureit_arch.moveitem', text="", icon='TRIA_DOWN')
op.propPath = prop_path
op.upDown = 1
op.idx = idx
op = row.operator(
'measureit_arch.moveitem', text="", icon='TRIA_UP')
op.propPath = prop_path
op.upDown = -1
op.idx = idx
txtRemoveOp = row.operator(
"measureit_arch.additem", text="", icon="X")
txtRemoveOp.propPath = prop_path
txtRemoveOp.idx = idx
txtRemoveOp.add = False
idx += 1
class BaseWithText(BaseProp):
text: StringProperty(name='legacy text')
text_updated: BoolProperty(
name='text_updated',
description='flag when text needs to be redrawn',
default=False)
textFields: CollectionProperty(type=TextField)
textAlignment: EnumProperty(
items=(('L', "Left", "", 'ALIGN_LEFT', 1),
('C', "Center", "", 'ALIGN_CENTER', 2),
('R', "Right", "", 'ALIGN_RIGHT', 3)),
name="Justification",
description="Set Font alignment")
textPosition: EnumProperty(
items=(('T', "Top", "", 'ALIGN_TOP', 1),
('M', "Mid", "", 'ALIGN_MIDDLE', 2),
('B', "Bottom", "", 'ALIGN_BOTTOM', 3)),
name="Position",
description="Set Font Position")
fontSize: FloatProperty(
name='Font Size',
description="Font Size in pt (1pt = 1/72\")\n"
"Note: Font size is relative to the current scale\n"
"Scale is defined in your active view, or in the Scene unit settings",
default=10, soft_min = 1, step=100, precision=0,
update = update_flag)
font: PointerProperty(
type=bpy.types.VectorFont,
update=update_flag)
all_caps: BoolProperty(
name='All Caps',
description='Make Text All Caps',
default=False,
update=update_flag)
class BaseDim(BaseWithText):
generator: StringProperty(
name="Generator",
description="item generator - api property",
default="DimensionGenerator[0]",)
dimPointA: IntProperty(
name='dimPointA',
description="Dimension Start Vertex Index")
dimPointB: IntProperty(
name='dimPointB',
description="Dimension End Vertex Index")
dimFlip: BoolProperty(
name= 'dimFlip',
description= "Flip Dimension",
default= False,
update = mark_invalid
)
dimOffset: FloatProperty(
name='Dimension Offset',
description='Offset for Dimension',
default=(0.5),
min = 0.001,
subtype='DISTANCE',
update=update_active_dim)
tweakOffset: FloatProperty(
name='Dimension Offset',
description='Offset for Dimension',
default=(0.0),
subtype='DISTANCE',
update=update_active_dim)
dimLeaderOffset: FloatProperty(
name='Dimension Offset',
description='Offset for Dimension',
default=(0.05),
min = 0,
subtype='DISTANCE',
update = mark_invalid)
dimViewPlane: EnumProperty(
items=(('99', "None", "None", 'EMPTY_AXIS', 0),
('XY', "XY Plane",
"Optimize Dimension for XY Plane (Plan)", 'AXIS_TOP', 1),
('YZ', "YZ Plane",
"Optimize Dimension for YZ Plane (Elevation)", 'AXIS_FRONT', 2),
('XZ', "XZ Plane", "Optimize Dimension for XZ Plane (Elevation)", 'AXIS_SIDE', 3)),
name="View Plane",
description="Dimension View Plane",
update = mark_invalid)
endcapA: EnumProperty(
items=(('99', "--", "No Cap"),
('L', "Arrow", "Arrow"),
('T', "Triangle", "Triangle"),
('D', "Dashed", "Dashed")),
default='T',
name="A end",
description="Add arrows to point A",
update = mark_invalid)
endcapB: EnumProperty(
items=(('99', "--", "No Cap"),
('L', "Arrow", "Arrow"),
('T', "Triangle", "Triangle"),
('D', "Dashed", "Dashed")),
name="B end",
default='T',
description="Add arrows to point A",
update = mark_invalid)
dimRotation: FloatProperty(
name='annotationOffset',
description='Rotation for Dimension',
default=0.0,
subtype='ANGLE',
update = mark_invalid)
use_custom_text: BoolProperty(
name = "Use Custom Text",
description = "Use Custom Text",
default=False,
update = mark_invalid
)
use_secondary_units: BoolProperty(
name = "Use Secondary Units",
description = "Show dimension in both unit systems",
default = False,
update = mark_invalid
)
override_unit_system: EnumProperty(
items = (('NONE', '--', "None"),
('METRIC', 'Metric', "Metric"),
('IMPERIAL', 'Imperial', 'Imperial')
),
name = "Override Unit System",
description = "Override Scene Unit System for this Dimension",
default = 'NONE',
update = mark_invalid
)
override_metric_length: EnumProperty(
items = (('NONE', '--', "None"),
('METERS', 'Meters', "Meters"),
('MILLIMETERS', 'Millimeters', 'Millimeters')
),
name = "Override Metric Length",
description = "Override Metric Length for this Dimension",
default = 'NONE',
update = mark_invalid
)
override_imperial_length: EnumProperty(
items = (('NONE', '--', "None"),
('FEET', 'Feet', "Feet"),
('INCHES', 'Inches', 'Inches')
),
name = "Override Imperial Length",
description = "Override Imperial Length for this Dimension",
default = 'NONE',
update = mark_invalid
)
class MeasureItARCHSceneProps(PropertyGroup):
bound_x: BoolProperty()
bound_y: BoolProperty()
bound_z: BoolProperty()
update_object_list: BoolProperty()
project_name: StringProperty(
name="Project Name",
description="Name of this Project")
project_number: StringProperty(
name="Project Number",
description="Number of this Project")
project_address: StringProperty(
name="Project Address",
description="Address for this Project")
depth_samples: EnumProperty(
items=(
('POINT', 'Point (2x)', ''),
('CROSS', 'Cross (10x)', ''),
('SQUARE', 'Square (18x)', ''),
),
name="Depth Test",
description="Number and Shape of Samples for Vector Depth Testing",
default='POINT')
viewPlane: EnumProperty(
items=(('99', "None", "No View Plane Selected", 'EMPTY_AXIS', 0),
('XY', "XY Plane",
"Optimize Dimension for XY Plane (Plan)", 'AXIS_TOP', 1),
('YZ', "YZ Plane",
"Optimize Dimension for YZ Plane (Elevation)", 'AXIS_FRONT', 2),
('XZ', "XZ Plane", "Optimize Dimension for XZ Plane (Elevation)", 'AXIS_SIDE', 3)),
name="View Plane",
description="View Plane")
default_dimension_style: StringProperty(
name="Default Style",
description="Dimension Style to Use")
default_annotation_style: StringProperty(
name="Default Style",
description="Annotation Style to Use")
default_line_style: StringProperty(
name="Default Style",
description="Line Style to Use")
show_all: BoolProperty(
name="Show All",
description="Display measures for all objects,"
" not only selected",
default=True)
show_dim_text: BoolProperty(
name="Show Dimension Text",
description="Display Dimension Text",
default=True)
hide_units: BoolProperty(
name="Hide Units",
description="Do not display unit of measurement on viewport",
default=False)
measureit_arch_dim_axis: EnumProperty(
items=(('X', "X", "X Axis"),
('Y', "Y", "Y Axis"),
('Z', "Z", "Z Axis")),
name="Axis",
description="Axis")
measureit_arch_debug_text: BoolProperty(
name="Debug Text",
description="(DEBUG) Draw Debug Info For Text",
default=False)
highlight_selected: BoolProperty(
name='Highlight Active',
description='Highlight Selected MeasureIt_ARCH Elements',
default=True)
use_unit_scale: BoolProperty(
name='Use Unit Scale',
description='',
default=False)
text_updated: BoolProperty(
name='text_updated',
description='flag when text needs to be redrawn',
default=False)
debug_flip_text: BoolProperty(
name="Debug Text Flip Vectors",
description="Displays Text Card and View Vectors used to Flip Text",
default=False)
default_color: FloatVectorProperty(
name="Default Color",
description="Default Color for new Items",
default=(0.0, 0.0, 0.0, 1.0),
min=0,
max=1,
subtype='COLOR',
size=4,
update=update_flag)
instance_dims: BoolProperty(
name="Instance Dimensions",
description="WARNING: Only the most recent Instance's Dimension text "
"will adapt to local changes in scale or rotation",
default=False)
eval_mods: BoolProperty(
name="Evaluate Depsgraph",
description="All MeasureIt_ARCH elements will attempt to evaluate the "
"dependency graph (Modifiers, Shape Keys, etc.) before drawing, "
"may make dimensions and linework unstable",
default=False)
is_render_draw: BoolProperty(
name="Is Render",
description="Flag to use render size for draw aspect ratio",
default=False)
is_vector_draw: BoolProperty(
name="Is Vector Render",
description="Flag to use svg draw code",
default=False)
is_dxf_draw: BoolProperty(
name="Is dxf Render",
description="Flag to use dxf draw code",
default=False)
show_dxf_props: BoolProperty(
name="show dxf props",
description="Show Dxf Export Property & Render Button",
default=False)
use_cad_col: BoolProperty(
name="Use CAD Colors",
description="Use CAD Color Idx when drawing",
default=False)
show_gizmos: BoolProperty(
name="Show Gizmos",
description="Display MeasureIt_ARCH Gizmos",
default=False)
show_text_cards: BoolProperty(
name="Debug Text Cards",
description="Display MeasureIt_ARCH Text Cards",
default=False)
skip_text: BoolProperty(
name="Skip Text Draw",
description="Flag skip text drawing for debug",
default=False)
skip_instances_viewport: BoolProperty(
name="Skip Instances in Viewport",
description="Flag Skip Drawing Instances in viewport",
default=False)
debug_depth_pass: BoolProperty(
name="Debug Depth Pass",
description="Saves Depth Buffer to image when rendering",
default=False)
enable_experimental: BoolProperty(
name="Enable Experimental",
description="Enable Experimental Features like SVG Rendering",
default=False)
default_scale: IntProperty(
name='Default Paper Scale', min=1, default=25,
description="Default Paper Scale (used for font sizing)")
angle_precision: IntProperty(
name='Angle Precision', min=0, max=5, default=0,
description="Angle decimal precision")
mm_precision: IntProperty(
name='mm Precision', min=0, max=5, default=0,
description="mm decimal precision")
imperial_precision: EnumProperty(
items=(('1', "1\"", "1 Inch"),
('2', "1/2\"", "1/2 Inch"),
('4', "1/4\"", "1/4 Inch"),
('8', "1/8\"", "1/8th Inch"),
('16', "1/16\"", "1/16th Inch"),
('32', "1/32\"", "1/32th Inch"),
('64', "1/64\"", "1/64th Inch")),
name="Imperial Precision",
description="Measurement Precision for Imperial Units",
default = '16')
metric_area_units: EnumProperty(
items = (('KILOMETERS', 'Kilometers', 'Kilometers'),
('METERS', 'Meters', 'Meters'),
('CENTEMETERS', 'Centimeters', 'Centimeters'),
('MILLIMETERS', 'Millimeters', 'Millimeters')
),
name = 'Metric Area Units',
description = 'Units to Use for Metric Area Dimensions',
default = 'METERS'
)
imperial_area_units: EnumProperty(
items = (('HECTARE', 'Hectare', 'Hectare'),
('ACRE', 'Acre', 'Acre'),
('FEET', 'Feet', 'Feet'),
),
name = 'Imperial Area Units',
description = 'Units to Use for Imperial Area Dimensions',
default = 'FEET'
)
use_text_autoplacement: BoolProperty(
name="Use Text Autoplacement",
description="Adjust Dimension Text Placement Automatically",
default=True)
keep_freestyle_svg: BoolProperty(
name="Keep Freestyle SVG",
description="When Embeding a Freestyle SVG, keep the generated Freestyle SVG as a separate file as well",
default=False,)
use_preview_res: BoolProperty(
name="Use Preview Resolution ",
description="Use Preview Resolution instead of Render Resolution (or View Resolution) for 3D view Text",
default=True,
update=update_flag)
preview_resolution: IntProperty(
name='Default Resolution ', min=1,
default=150,
soft_min=50,
soft_max=1200,
description="Preview Resolution",
update=update_flag)
render_resolution: IntProperty(
name='Render Resolution ', min=1,
default=300,
soft_min=50,
soft_max=1200,
description="Render Resolution",
update=update_camera)
metric_precision: IntProperty(
name='Precision', min=0, max=5, default=2,
description="Metric decimal precision")
area_precision: IntProperty(
name='Area Precision', min=0, max=5, default=2,
description="Area precision")
offset_x_2d: IntProperty(
name='offset X', default=0,)
offset_y_2d: IntProperty(
name='offset Y', default=0,)
metric_precision: IntProperty(
name='Precision', min=0, max=5, default=2,
description="Metric decimal precision")
hide_titleblock: BoolProperty(
name="Hide Titleblock",
description="Hide TitleBlock",
default=False,)
hide_linework: BoolProperty(
name="Hide Linework",
description="Hide Linework",
default=False,)
illustrator_style_svgs: BoolProperty(
name="Ilustrator Style SVGs",
description="Exports SVGs with lineweights specified directly in pts",
default=False,)
source_scene: PointerProperty(type = bpy.types.Scene)
depth_test_method: EnumProperty(
items=(
('DEPTH_BUFFER', 'Depth Buffer', ''),
('GEOMETRIC', 'Geometric', '')
),
name="Depth Test Method",
description="Method for depth testing when rendering vector linework. Depth Buffer is generally faster but less precise",
default='DEPTH_BUFFER',)
default_alignment_method: EnumProperty(
items=(
('VIEW', "View", "Align Dimensions to Viewport"),
('CAMERA', "Camera","Align Dimensions to Camera")),
name="Default Auto Alignment",
default = "CAMERA",
description="Default Auto Alignment for Dimensions with no View Plane specified")
relative_svg_paths: BoolProperty(
name="Relative SVG Paths",
description="When Embeding renders or other files in svg renders, use a relative path",
default=False,)
class DeletePropButton(Operator):
bl_idname = "measureit_arch.deletepropbutton"
bl_label = "Delete property"
bl_description = "Delete a property"
bl_category = 'MeasureitArch'
bl_options = {'REGISTER'}
genPath: StringProperty()
tag: IntProperty()
item_type: StringProperty()
is_style: BoolProperty()