-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path__init__.py
More file actions
executable file
·1573 lines (1366 loc) · 51.4 KB
/
Copy path__init__.py
File metadata and controls
executable file
·1573 lines (1366 loc) · 51.4 KB
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
bl_info = {
"name": "Venturial",
"description": "A GUI to alleviate the effort of constructing OpenFOAM cases.",
"author": "Rajdeep Adak at FOSSEE, IIT Bombay",
"contributors": "visit www.github.com/venturial/contributors",
"version": (0, 1, 0),
"blender": (3, 2, 1),
"location": "View3D > Side bar > Venturial",
"category": "Development",
}
import bpy, bmesh, os
import bpy.utils.previews
from .dependencies import install_dependencies
from bpy.utils import register_class, unregister_class
from bpy.props import (
IntProperty,
FloatProperty,
FloatVectorProperty,
BoolProperty,
StringProperty,
PointerProperty,
CollectionProperty,
EnumProperty,
)
from bpy.types import Operator, Panel, AddonPreferences, PropertyGroup, UIList
from gpu_extras.batch import batch_for_shader
from bpy_extras.view3d_utils import location_3d_to_region_2d
from venturial.startup.get_tutorials_list import add_tutorials_to_scene
from venturial.startup.get_recents_list import add_recents_to_scene
from venturial.models.header.file_handling_operators import *
from venturial.models.header.developer_menu_operators import *
from venturial.models.header.general_operators import *
from venturial.models.header.help_menu_operators import *
from venturial.models.mainpanel_sublayout_operators import *
from venturial.models.blockmesh.design_operators import *
from venturial.models.visualizer_operators import (
VNT_OT_vertex_data_control,
VNT_OT_edge_data_control,
VNT_OT_boundary_data_control,
)
# from venturial.models.blockmesh.edge_operators import *
from venturial.models.tutorials_menu_operators import *
# from venturial.models.geometry_designer_operators import *
# from venturial.models.mesh_file_manager_operators import *
from venturial.models.blockmesh.get_vertices_operators import *
from venturial.models.blockmesh.boundary_control_operators import *
from venturial.models.run_panel_operators import *
from venturial.views.schemas.UIList_schemas import *
from venturial.views.user_mode_view import VNT_PT_usermodeview
from venturial.views.header.view import *
from venturial.views.mainpanel.meshing_tools.blockmesh import VNT_PT_cell_location
from venturial.views.mainpanel.meshing_tools.snappyhexmesh import (
VNT_OT_create_new_geometry,
VNT_OT_delete_geometry,
VNT_OT_export_stl_geometry,
VNT_OT_generate_snappyhex_dict,
)
from venturial.views.mainpanel.view import (
VNT_OT_active_project_indicator,
VNT_OT_list_category,
get_mainpanel_categories,
)
from venturial.views.mainpanel.tutorials import VNT_PT_filter_tutorials
from venturial.views.mainpanel.recents import VNT_PT_filter_recents
from venturial.views.mainpanel.visualizer import VNT_PT_statistics_settings
from venturial.utils.custom_icon_object_generator import (
register_custom_icon,
unregister_custom_icon,
)
from venturial.lib.update_methods import *
from venturial.lib.preferences_properties import VNT_user_preferences_collection
from venturial.lib.global_properties import VNT_global_properties_collection, VNT_global_properties_collection_edge_verts, CUSTOM_LocProps
from venturial.models.edges_panel_operators import *
# Import castellated mesh classes directly
from venturial.models.snappyhexmesh.castellated_operators import (
CastellatedFeature,
RefinementRegion,
PatchInfo,
RefinementSurfaceRegion,
RefinementSurface,
VNT_OT_add_feature,
VNT_OT_browse_feature_file,
VNT_OT_remove_feature,
VNT_OT_add_refinement_surface,
VNT_OT_browse_surface_file,
VNT_OT_remove_refinement_surface,
VNT_OT_add_surface_region,
VNT_OT_remove_surface_region,
VNT_OT_add_refinement_region,
VNT_OT_remove_refinement_region,
CAST_UL_features_list,
CAST_UL_refinement_surfaces,
CAST_UL_refinement_regions,
DistanceLevelPair,
VNT_OT_add_distance_level_pair,
VNT_OT_remove_distance_level_pair,
CAST_UL_distance_level_pairs,
VNT_OT_add_feature_distance_level_pair,
VNT_OT_remove_feature_distance_level_pair,
CAST_UL_feature_distance_level_pairs,
CAST_UL_surface_regions
)
from venturial.models.snappyhexmesh.snap_operators import (
SnapControlsProperties,
VNT_OT_select_unselect_allsnap
)
from venturial.models.snappyhexmesh.layer_operators import (
LayerAdditionProperties,
LayerPatchSettings,
VNT_OT_add_layer_patch,
VNT_OT_remove_layer_patch,
VNT_OT_duplicate_layer_patch,
VNT_OT_import_boundary_patches,
LAYER_UL_patches_list,
VNT_OT_configure_layer_settings
)
from venturial.models.snappyhexmesh.mesh_quality_operators import (
MeshQualityProperties,
RelaxedMeshQualityProperties,
VNT_OT_select_mesh_quality_dict,
VNT_OT_copy_relaxed_settings
)
from venturial.models.snappyhexmesh.geometry_operators import (
GeometryItem,
GEOMETRY_UL_items,
geometry_index_update,
StlRegionItem,
STL_UL_regions,
VNT_OT_add_stl_region,
VNT_OT_remove_stl_region
)
from venturial.models.snappyhexmesh.tooltip_updater import register as register_tooltips
# Import castellated mesh classes directly
from venturial.models.snappyhexmesh.castellated_operators import (
CastellatedFeature,
RefinementRegion,
PatchInfo,
RefinementSurfaceRegion,
RefinementSurface,
VNT_OT_add_feature,
VNT_OT_browse_feature_file,
VNT_OT_remove_feature,
VNT_OT_add_refinement_surface,
VNT_OT_browse_surface_file,
VNT_OT_remove_refinement_surface,
VNT_OT_add_surface_region,
VNT_OT_remove_surface_region,
VNT_OT_add_refinement_region,
VNT_OT_remove_refinement_region,
CAST_UL_features_list,
CAST_UL_refinement_surfaces,
CAST_UL_refinement_regions,
DistanceLevelPair,
VNT_OT_add_distance_level_pair,
VNT_OT_remove_distance_level_pair,
CAST_UL_distance_level_pairs,
VNT_OT_add_feature_distance_level_pair,
VNT_OT_remove_feature_distance_level_pair,
CAST_UL_feature_distance_level_pairs,
CAST_UL_surface_regions
)
from venturial.models.snappyhexmesh.snap_operators import (
SnapControlsProperties,
VNT_OT_select_unselect_allsnap
)
from venturial.models.snappyhexmesh.layer_operators import (
LayerAdditionProperties,
LayerPatchSettings,
VNT_OT_add_layer_patch,
VNT_OT_remove_layer_patch,
VNT_OT_duplicate_layer_patch,
VNT_OT_import_boundary_patches,
LAYER_UL_patches_list,
VNT_OT_configure_layer_settings
)
from venturial.models.snappyhexmesh.mesh_quality_operators import (
MeshQualityProperties,
RelaxedMeshQualityProperties,
VNT_OT_select_mesh_quality_dict,
VNT_OT_copy_relaxed_settings
)
from venturial.models.snappyhexmesh.geometry_operators import (
GeometryItem,
GEOMETRY_UL_items,
geometry_index_update,
StlRegionItem,
STL_UL_regions,
VNT_OT_add_stl_region,
VNT_OT_remove_stl_region
)
from venturial.models.snappyhexmesh.tooltip_updater import register as register_tooltips
Ven_node_enabled = False
try:
if install_dependencies():
Ven_node_enabled = True
except Exception as e:
print("ERROR: Dependency installation failed.")
Ven_node_enabled = False
if Ven_node_enabled:
from .models import venturial_nodes
classes = (
VNT_OT_select_edge,
VNT_ecustom_edge_obj,
VNT_user_preferences_collection,
VNT_OT_save_preferences,
VNT_OT_reset_preferences,
VNT_OT_import_preferences,
VNT_OT_new_case,
VNT_OT_select_mesh_filepath,
VNT_OT_build_mesh,
VNT_OT_import_mesh,
VNT_OT_open_case,
VNT_OT_delete_mesh_file_items,
VNT_OT_deactivate_mesh_file_item,
VNT_OT_stl_browse,
VNT_OT_import_stl_geometry,
VNT_OT_export_stl_geometry,
VNT_OT_dev_mode,
VNT_OT_dev_tools,
VNT_OT_user_general_settings,
VNT_OT_select_default_mesh_filepath,
VNT_OT_select_default_tut_filepath,
VNT_OT_select_default_user_data_filepath,
VNT_OT_list_category,
VNT_OT_venturial_maintools,
VNT_OT_venturial_homepage,
VNT_OT_fossee_homepage,
VNT_OT_close_venturial,
VNT_OT_user_guide,
VNT_OT_developer_guide,
VNT_OT_feature_request,
VNT_OT_report_bugs,
VNT_OT_developer_support,
VNT_OT_user_community,
VNT_OT_developer_community,
VNT_OT_release_notes,
VNT_PT_usermodeview,
VNT_OT_mainpanel_layout,
VNT_OT_delete_geometry,
fileitemproperties,
recent_item_properties,
tutorialitemproperties,
VNT_MT_dev_menu,
VNT_MT_file_menu,
VNT_PT_uicategory,
VNT_MT_about_venturial,
VNT_MT_about_fossee,
VNT_MT_help_menu,
CUSTOM_LocProps,
VNT_global_properties_collection_edge_verts,
VNT_global_properties_collection,
VNT_UL_mesh_file_manager,
VNT_UL_mesh_file_coroner,
CUSTOM_UL_verts,
CUSTOM_UL_blocks,
CUSTOM_UL_faces,
CUSTOM_UL_edges_Main,
CUSTOM_UL_edges_Sub,
CUSTOM_UL_face_merge,
VNT_OT_faceactions,
VNT_OT_set_face_name,
VNT_OT_set_type_face,
VNT_PT_cell_location,
VNT_OT_selectfaces,
VNT_OT_clearfaces,
VNT_OT_fill_dict_file,
VNT_OT_cleardictfileonly,
VNT_OT_New_Boundary,
VNT_OT_vertactions,
VNT_OT_add_update_verts,
VNT_OT_select_unselect_allverts,
VNT_OT_clearverts,
VNT_PT_statistics_settings,
VNT_OT_location_spawnner,
VNT_OT_add_to_viewport,
VNT_OT_compose,
VNT_OT_get_blocks,
VNT_OT_remove_blocks,
VNT_OT_remove_all_blocks,
VNT_OT_clearblocks,
VNT_OT_blocksdatacontrol,
VNT_OT_showselectedblocks,
VNT_OT_select_unselect_allblocks,
VNT_OT_vertex_data_control,
VNT_OT_edge_data_control,
VNT_OT_boundary_data_control,
VNT_OT_merge_faces,
VNT_OT_merge_faces_delete,
# VNT_OT_generate_edge,
# VNT_OT_edit_edge,
# VNT_OT_destroy_edge,
VNT_OT_more_tutorials_viewer,
VNT_OT_tutorial_viewer,
VNT_PT_filter_tutorials,
VNT_PT_filter_recents,
VNT_OT_active_project_indicator,
OBJECT_OT_add_single_vertex,
VNT_OT_new_edge,
VNT_OT_new_vert,
VNT_OT_remove_edge,
VNT_OT_remove_vert,
VNT_OT_create_new_geometry,
# Add castellated mesh classes
CastellatedFeature,
RefinementRegion,
PatchInfo,
RefinementSurfaceRegion,
RefinementSurface,
VNT_OT_add_feature,
VNT_OT_browse_feature_file,
VNT_OT_remove_feature,
VNT_OT_add_refinement_surface,
VNT_OT_browse_surface_file,
VNT_OT_remove_refinement_surface,
VNT_OT_add_surface_region,
VNT_OT_remove_surface_region,
VNT_OT_add_refinement_region,
VNT_OT_remove_refinement_region,
CAST_UL_features_list,
CAST_UL_refinement_surfaces,
CAST_UL_refinement_regions,
DistanceLevelPair,
VNT_OT_add_distance_level_pair,
VNT_OT_remove_distance_level_pair,
CAST_UL_distance_level_pairs,
VNT_OT_add_feature_distance_level_pair,
VNT_OT_remove_feature_distance_level_pair,
CAST_UL_feature_distance_level_pairs,
CAST_UL_surface_regions,
SnapControlsProperties,
VNT_OT_select_unselect_allsnap,
LayerAdditionProperties,
LayerPatchSettings,
VNT_OT_add_layer_patch,
VNT_OT_remove_layer_patch,
VNT_OT_duplicate_layer_patch,
VNT_OT_import_boundary_patches,
VNT_OT_configure_layer_settings,
LAYER_UL_patches_list,
MeshQualityProperties,
RelaxedMeshQualityProperties,
VNT_OT_select_mesh_quality_dict,
VNT_OT_copy_relaxed_settings,
VNT_OT_generate_snappyhex_dict,
StlRegionItem,
STL_UL_regions,
VNT_OT_add_stl_region,
VNT_OT_remove_stl_region,
)
def load_post_handler():
"""
Handler that resets the draw handlers for edges after a .blend file is loaded.
"""
# Clear any existing draw handler references in our scene data.
edge_data = get_edge_draw_data()
edge_data["draw_handlers"].clear()
edge_data["verts"].clear()
# Re-run the drawing function for each edge.
scn = bpy.context.scene
for i in range(len(scn.ecustom)):
try:
# Assume draw_p is imported from edges_panel_operators
from .edges_panel_operators import draw_p
draw_p(None, bpy.context)
except Exception as e:
print(f"Error initializing draw handler for edge {i}: {e}")
def register():
print("--- Registering Venturial Nodes Module ---")
# 1. Install dependencies (must run before imports that depend on them)
register_custom_icon(
"venturial_logo", "/venturial/icons/custom_icons/venturial_logo.png"
)
register_custom_icon("fossee_logo", "/venturial/icons/custom_icons/fossee_logo.png")
register_custom_icon(
"new_mesh_file_2", "/venturial/icons/custom_icons/new_mesh_file_2.png"
)
register_custom_icon(
"build_mesh_2", "/venturial/icons/custom_icons/build_mesh_2.png"
)
register_custom_icon(
"warning_sign_1", "/venturial/icons/custom_icons/warning_sign_1.png"
)
register_custom_icon(
"file-browser-2", "/venturial/icons/custom_icons/file-browser-2.png"
)
for cls in classes:
register_class(cls)
bpy.types.Scene.mesh_quality = PointerProperty(
type=MeshQualityProperties,
name="Mesh Quality Settings"
)
bpy.types.Scene.relaxed_mesh_quality = PointerProperty(
type=RelaxedMeshQualityProperties,
name="Relaxed Mesh Quality Settings"
)
print("Registered mesh_quality and relaxed_mesh_quality property groups:", hasattr(bpy.types.Scene, "relaxed_mesh_quality"))
# Fix: Access RefinementRegion directly instead of through bpy.types
from venturial.models.snappyhexmesh.castellated_operators import (
RefinementRegion,
CastellatedFeature,
DistanceLevelPair
)
# feature-level pairs
CastellatedFeature.distance_level_pairs = CollectionProperty(
type=DistanceLevelPair,
name="Distance-Level Pairs"
)
CastellatedFeature.distance_level_pairs_index = IntProperty(default=0)
# region-level pairs (already present)
RefinementRegion.distance_level_pairs = CollectionProperty(
type=DistanceLevelPair,
name="Distance-Level Pairs"
)
RefinementRegion.distance_level_pairs_index = IntProperty(default=0)
# Global gap level increment property
bpy.types.Scene.use_gap_level = BoolProperty(
name="Use Gap Level Increment",
description="Use gap level increment for small gaps between surfaces",
default=False
)
bpy.types.Scene.gap_level_increment = IntProperty(
name="Gap Level Increment",
description="Additional refinement level for cells in narrow gaps",
default=2,
min=0,
max=10
)
# Additional castellated mesh properties for the new UI sections
# Feature angle properties
bpy.types.Scene.resolveFeatureAngle = FloatProperty(
name="Resolve Feature Angle",
description="Angle for feature resolution",
default=30.0,
min=0.0,
max=180.0
)
bpy.types.Scene.planarAngle = FloatProperty(
name="Planar Angle",
description="Angle for determining planar features",
default=30.0,
min=0.0,
max=180.0
)
# Refinement region properties for RefinementRegion class
RefinementRegion.name = StringProperty(
name="Name",
description="Name of the refinement region",
default="box"
)
RefinementRegion.source_type = EnumProperty(
name="Source Type",
description="Type of geometry source",
items=[
('geometry', "Geometry Object", "Use a geometry object from the scene"),
('stl', "STL File", "Use an STL file")
],
default='geometry'
)
RefinementRegion.geometry_object = StringProperty(
name="Geometry Object",
description="Name of the geometry object to use"
)
RefinementRegion.mode = EnumProperty(
name="Mode",
description="Refinement mode",
items=[
('inside', "Inside", "Refine cells inside the region"),
('distance', "Distance", "Refine cells within specified distance of the region")
],
default='inside'
)
RefinementRegion.level = IntProperty(
name="Level",
description="Refinement level for inside mode",
default=1,
min=0
)
RefinementRegion.use_advanced_distance = BoolProperty(
name="Multiple Distance Levels",
description="Use multiple distance-level pairs for more complex refinement",
default=False
)
RefinementRegion.distance = FloatProperty(
name="Distance",
description="Distance from surface for refinement",
default=1.0,
min=0.0
)
RefinementRegion.level_at_distance = IntProperty(
name="Level",
description="Refinement level at the specified distance",
default=1,
min=0
)
# Location in mesh coordinates
bpy.types.Scene.locationInMeshX = FloatProperty(
name="X",
description="X coordinate of location in mesh point",
default=-100.0
)
bpy.types.Scene.locationInMeshY = FloatProperty(
name="Y",
description="Y coordinate of location in mesh point",
default=0.0
)
bpy.types.Scene.locationInMeshZ = FloatProperty(
name="Z",
description="Z coordinate of location in mesh point",
default=50.0
)
bpy.types.Scene.allowFreeStandingZoneFaces = BoolProperty(
name="Allow Free Standing Zone Faces",
description="Allow free-standing zone faces",
default=True
)
# Advanced options
bpy.types.Scene.handleSnapProblems = BoolProperty(
name="Handle Snap Problems",
description="Do not remove cells likely to give snapping problems",
default=False
)
bpy.types.Scene.useTopologicalSnapDetection = BoolProperty(
name="Use Topological Snap Detection",
description="Use topological test for cells to-be-squashed (disable to use geometric test)",
default=True
)
# Collection to store refinement regions
bpy.types.Scene.cast_refinement_regions = CollectionProperty(
type=RefinementRegion,
name="Refinement Regions"
)
bpy.types.Scene.cast_refinement_regions_index = IntProperty(default=0)
# Add this in the register function after the other layer-related properties
bpy.types.Scene.show_layer_advanced = BoolProperty(
name="Show Advanced Layer Settings",
default=False
)
bpy.types.Scene.layer_strategy = EnumProperty(
name="Layer Strategy",
description="Strategy for layer addition",
items=[
('standard', "Standard", "Standard layer addition approach"),
('conservative', "Conservative", "More cautious approach for complex geometry"),
('aggressive', "Aggressive", "Try harder to add layers even in complex areas")
],
default='standard'
)
# After other layer addition properties
bpy.types.Scene.detectExtrusionIsland = BoolProperty(
name="Detect Extrusion Islands",
description="Detect and extrude islands of cells for better layer coverage",
default=True
)
bpy.types.Scene.stl_file = StringProperty(name="STL File", default="")
bpy.types.Scene.stl_file_name = StringProperty(name="STL File Name", default="")
bpy.types.Scene.stl_custom_name = StringProperty(name="Custom STL Name", default="")
bpy.types.Scene.stl_regions = CollectionProperty(type=StlRegionItem)
bpy.types.Scene.stl_regions_index = IntProperty(default=0)
bpy.types.Scene.search_tuts = StringProperty(default="Search Tutorials")
bpy.types.Scene.search_recents = StringProperty(default="Search Recents")
bpy.types.Scene.edit_dict_name = BoolProperty(default=True)
bpy.types.Scene.current_tool_text = StringProperty(default="BlockMesh")
bpy.types.Scene.meshing_tool = EnumProperty(
items=[("BlockMesh", "BlockMesh", ""), ("SnappyHexMesh", "SnappyHexMesh", "")],
default="BlockMesh",
update=update_current_tool_text_1,
)
bpy.types.Scene.solution_tools = EnumProperty(
items=[
("Solution Modeling", "Solution Modeling", ""),
("Post-Processing", "Post-Processing", ""),
],
update=update_current_tool_text_2,
)
bpy.types.Scene.spawn_type = EnumProperty(
items=[
("Grid", "Grid", ""),
("3D Cursor", "3D Cursor", ""),
("Center", "Center", ""),
],
default="Grid",
)
bpy.types.Scene.prompt_meshing_tool = EnumProperty(
default={"BlockMesh"},
items=[("BlockMesh", "BlockMesh", ""), ("SnappyHexMesh", "SnappyHexMesh", "")],
options={"ENUM_FLAG"},
update=update_mesh_dict_names,
)
bpy.types.Scene.mainpanel_categories = EnumProperty(
items=get_mainpanel_categories,
default=0
)
bpy.types.Scene.cellShapes = EnumProperty(
items=[
("Hexahedron", "Hexahedron", ""),
("Wedge (Experimental)", "Wedge (Experimental)", ""),
("Prism", "Prism", ""),
("Pyramid (Experimental)", "Pyramid (Experimental)", ""),
("Tetrahedron (Experimental)", "Tetrahedron (Experimental)", ""),
(
"Tetrahedral wedge (Experimental)",
"Tetrahedral wedge (Experimental)",
"",
),
],
default="Hexahedron",
description="Cell Shape Types",
)
bpy.types.Scene.cellShape_units = IntProperty(min=1, max=50, default=1)
bpy.types.Scene.bm_dict_name = StringProperty(default="blockMeshDict")
bpy.types.Scene.shm_dict_name = StringProperty()
bpy.types.Scene.pref_pointer = bpy.props.PointerProperty(
type=VNT_user_preferences_collection
)
bpy.types.Scene.mfile_item_ptr = bpy.props.PointerProperty(type=fileitemproperties)
bpy.types.Scene.mfile_item = CollectionProperty(type=fileitemproperties)
bpy.types.Scene.mfile_item_index = IntProperty(update=update_uicategory_mode)
bpy.types.Scene.tut_item_ptr = bpy.props.PointerProperty(
type=tutorialitemproperties
)
bpy.types.Scene.tut_item = CollectionProperty(type=tutorialitemproperties)
bpy.types.Scene.tut_item_index = IntProperty()
bpy.types.Scene.rec_item_ptr = bpy.props.PointerProperty(
type=recent_item_properties
)
bpy.types.Scene.rec_item = CollectionProperty(type=recent_item_properties)
bpy.types.Scene.rec_item_index = IntProperty()
bpy.types.Scene.mesh_dict_path = StringProperty()
bpy.types.Scene.row_en = BoolProperty(default=True)
bpy.types.Scene.cell_x = IntProperty(
name="X: ",
description="Select Number of cells along X",
min=1,
max=1000,
default=1,
update=update_cellxyz,
)
bpy.types.Scene.cell_y = IntProperty(
name="Y: ",
description="Select Number of cells along Y",
min=1,
max=1000,
default=1,
update=update_cellxyz,
)
bpy.types.Scene.cell_z = IntProperty(
name="Z: ",
description="Select Number of cells along Z",
min=1,
max=1000,
default=1,
update=update_cellxyz,
)
bpy.types.Scene.grad_x = FloatProperty(
name="X: ",
description="Select Gradient along X",
min=0.0,
max=10000.0,
default=1.0,
update=update_gradxyz,
)
bpy.types.Scene.grad_y = FloatProperty(
name="Y: ",
description="Select Gradient along Y",
min=0.0,
max=10000.0,
default=1.0,
update=update_gradxyz,
)
bpy.types.Scene.grad_z = FloatProperty(
name="Z: ",
description="Select Gradient along Z",
min=0.0,
max=10000.0,
default=1.0,
update=update_gradxyz,
)
bpy.types.Scene.ctm = FloatProperty(
name="Convert To Meters:",
description="Set converttoMeters parameter of Blockmeshdict",
min=0.001,
max=100.0,
default=0.1,
)
bpy.types.Scene.transform = BoolProperty(default=False)
bpy.types.Scene.transformation_methods = EnumProperty(
items=[
("Move", "Move (G)", "Shortcut: G"),
("Rotate", "Rotate (R)", "Shortcut: R"),
("Scale", "Scale (S)", "Shortcut: S"),
],
default="Move",
)
bpy.types.Scene.snapping = BoolProperty(default=False, update=update_snapping)
bpy.types.Scene.snapping_methods = EnumProperty(
items=[("VERTEX", "Vertex", ""), ("EDGE", "Edge", ""), ("FACE", "Face", "")],
default="VERTEX",
update=update_snapping_method,
)
bpy.types.Scene.simblk = CollectionProperty(type=VNT_global_properties_collection)
bpy.types.Scene.simblk_index = IntProperty()
bpy.types.Scene.bcustom = CollectionProperty(type=VNT_global_properties_collection) # for blocks
bpy.types.Scene.bcustom_index = IntProperty()
bpy.types.Scene.vcustom = CollectionProperty(type=VNT_global_properties_collection) # for vertices
bpy.types.Scene.vcustom_index = IntProperty()
bpy.types.Scene.fcustom = CollectionProperty(type=VNT_global_properties_collection) # for faces
bpy.types.Scene.fcustom_index = IntProperty()
bpy.types.Scene.faceList_master = EnumProperty("Face List", items=list_current_faces)
bpy.types.Scene.faceList_slave = EnumProperty("Face List", items=list_current_faces)
bpy.types.Scene.fmcustom = CollectionProperty(type=VNT_global_properties_collection) # for face merging
bpy.types.Scene.fmcustom_index = IntProperty()
bpy.types.Scene.ecustom_edge_obj = CollectionProperty(type=VNT_ecustom_edge_obj)
bpy.types.Scene.ecustom = CollectionProperty(type=VNT_global_properties_collection_edge_verts) # for edges
bpy.types.Scene.ecustom_index = IntProperty(update=update_selected_edge)
bpy.types.Scene.last_ecustom_index = IntProperty(default=-1)
bpy.types.Scene.vert_index = IntProperty(name="Vertex Index", default=0)
bpy.types.Scene.edge_control_methods = EnumProperty(
items=[("IP", "Interpolation Points", ""), ("AA", "Axis angle", "")],
default="IP",
)
bpy.types.Scene.curve_type = EnumProperty(
items=[
("ARC", "Arc", "Arc type of edge"),
("PLY", "Polyline", "Polyline type of edge"),
("SPL", "Spline", "Spline type of edge"),
("BSPL", "BSpline", "BSpline type of edge"),
],
default="ARC",
)
bpy.types.Scene.edge_alignment = EnumProperty(
items=[
("X", "X Axis", "Align edge along X axis"),
("-X", "-X Axis", "Align edge along -X axis"),
("Y", "Y Axis", "Align edge along Y axis"),
("-Y", "-Y Axis", "Align edge along -Y axis"),
("Z", "Z Axis", "Align edge along Z axis"),
("-Z", "-Z Axis", "Align edge along -Z axis"),
],
default="X",
)
bpy.types.Scene.cnt = IntProperty()
bpy.types.Scene.mode = EnumProperty(
items=[
("OBJECT", "Object Mode", "", "OBJECT_DATAMODE", 1),
("VERT", "Vertex Mode", "", "VERTEXSEL", 2),
("FACE", "Face Mode", "", "FACESEL", 3),
("EDGE", "Edge Mode", "", "EDGESEL", 4),
],
default="OBJECT",
update=update_mode,
)
bpy.types.Scene.bdclist = EnumProperty(
name="",
description="Select Boundary Condition",
items=[
("wedge", "wedge", ""),
("empty", "empty", ""),
("symmetryPlane", "symmetryPlane", ""),
("wall", "wall", ""),
("patch", "patch", ""),
],
)
bpy.types.Scene.face_name = PointerProperty(type=VNT_global_properties_collection)
bpy.types.Scene.facedes = PointerProperty(type=VNT_global_properties_collection)
bpy.types.Scene.acustom = CollectionProperty(type=VNT_global_properties_collection)
bpy.types.Scene.acustom_index = IntProperty()
bpy.types.Scene.pcustom = CollectionProperty(type=VNT_global_properties_collection)
bpy.types.Scene.pcustom_index = IntProperty()
bpy.types.Scene.scustom = CollectionProperty(type=VNT_global_properties_collection)
bpy.types.Scene.scustom_index = IntProperty()
bpy.types.Scene.bscustom = CollectionProperty(type=VNT_global_properties_collection)
bpy.types.Scene.bscustom_index = IntProperty()
bpy.types.Scene.ipcnt = IntProperty(
name="IP: ",
description="Select Number of Interpolation Points",
min=1,
max=30,
default=1,
)
bpy.types.Scene.face_sel_mode = BoolProperty(default=False, update=update_face_mode)
bpy.types.Scene.edge_sel_mode = BoolProperty(default=False, update=update_edge_mode)
bpy.types.Scene.statistics = BoolProperty(default=False)
bpy.types.Scene.bfc = BoolProperty(default=False, description="Backface Culling")
bpy.types.Scene.xray = BoolProperty(default=False, description="X ray mode")
bpy.types.Scene.xray_opacity = FloatProperty(
name="X-ray opacity", description="X-ray opacity", min=0.0, max=1.0, default=0.5
)
bpy.types.Scene.geo_params = EnumProperty(
description="Geometry parameters",
items=[
("Center", "Center", ""),
("Orientation", "Orientation", ""),
("Outline", "Outline", ""),
],
default={"Center", "Orientation", "Outline"},
options={"ENUM_FLAG"},
)
bpy.types.Scene.outline_color = FloatVectorProperty(
name="Outline Color",
subtype="COLOR",
size=4,
min=0.0,
max=1.0,
default=(0.0, 0.5, 0.0, 1.0),
)
bpy.types.Scene.shading = EnumProperty(
description="Geometry Shading",
items=[("Solid", "Solid", ""), ("Wire", "Wire", "")],
)
bpy.types.Scene.wire_opacity = FloatProperty(
name="Wire opacity", description="Wire opacity", min=0.0, max=1.0, default=0.5
)
bpy.types.Scene.enable_vert_vis = BoolProperty(name="")
bpy.types.Scene.enable_edge_vis = BoolProperty(name="")
bpy.types.Scene.enable_bound_vis = BoolProperty(name="")
bpy.types.Scene.vert_order = BoolProperty(name="")
bpy.types.Scene.vert_props = EnumProperty(
description="Vertex visualization properties",
items=[("Indices", "Indices", ""), ("Coordinates", "Coordinates", "")],
default={"Indices"},
options={"ENUM_FLAG"},
)
bpy.types.Scene.vert_source = EnumProperty(
description="Vertex visualization properties",
items=[("Geometry", "Geometry", ""), ("blockmeshdict", "blockmeshdict", "")],
default="Geometry",
)
bpy.types.Scene.vert_text_size = IntProperty(
name="Text Size:",
description="Select Size of Vertex Info Text being Displayed",
min=6,
max=100,
default=40,
)
bpy.types.Scene.vert_text_color = FloatVectorProperty(
name="Text Color",
subtype="COLOR",
size=4,
min=0.0,
max=1.0,
default=(0.0, 0.0, 1.0, 1.0),
)
bpy.types.Scene.active_projects = EnumProperty(
description="horizontally placed dynamic list of active projects in the project manager.",
items=get_active_projects,
)
bpy.types.Scene.geometry_items = CollectionProperty(type=fileitemproperties)
bpy.types.Scene.geometry_items_index = IntProperty(
name="Geometry Items Index",
default=0,
update=geometry_index_update
)
# Main SnappyHexMesh controls
bpy.types.Scene.castellatedMesh = BoolProperty(name="Castellated Mesh", default=False)
bpy.types.Scene.snap = BoolProperty(name="Snap", default=False)
bpy.types.Scene.addLayers = BoolProperty(name="Add Layers", default=False)
# Castellated mesh controls
bpy.types.Scene.maxLocalCells = IntProperty(
name="Max Local Cells",
description="Maximum local cells for castellated mesh",
default=100000,
min=1000
)
bpy.types.Scene.maxGlobalCells = IntProperty(
name="Max Global Cells",
description="Maximum global cells for castellated mesh",
default=2000000,
min=1000
)
bpy.types.Scene.minRefinementCells = IntProperty(
name="Min Refinement Cells",
description="Minimum cells to refine",