@@ -781,7 +781,7 @@ export class MainView extends React.Component<IProps, IStates> {
781
781
782
782
if ( output ) {
783
783
const { meshGroup, mainMesh, edgesMeshes } = output ;
784
- if ( meshGroup . visible ) {
784
+ if ( meshGroup . userData . jcObject . visible ) {
785
785
this . _boundingGroup . expandByObject ( mainMesh ) ;
786
786
}
787
787
@@ -804,6 +804,12 @@ export class MainView extends React.Component<IProps, IStates> {
804
804
boundingBox . visible = true ;
805
805
}
806
806
807
+ if ( ! meshGroup . userData . jcObject . visible ) {
808
+ meshGroup . visible = true ;
809
+ mainMesh . material . opacity = 0.5 ;
810
+ mainMesh . material . transparent = true ;
811
+ }
812
+
807
813
this . _selectedMeshes . push ( mainMesh ) ;
808
814
}
809
815
edgesMeshes . forEach ( el => {
@@ -947,7 +953,6 @@ export class MainView extends React.Component<IProps, IStates> {
947
953
const wireframe = new THREE . LineSegments ( lineGeo , mat ) ;
948
954
mesh . add ( wireframe ) ;
949
955
mesh . name = name ;
950
- mesh . visible = true ;
951
956
if ( this . _meshGroup ) {
952
957
this . _meshGroup . add ( mesh ) ;
953
958
this . _boundingGroup ?. expandByObject ( mesh ) ;
@@ -1104,16 +1109,22 @@ export class MainView extends React.Component<IProps, IStates> {
1104
1109
selectedMesh . material . color = originalColor ;
1105
1110
}
1106
1111
1107
- const parentGroup = this . _meshGroup ?. getObjectByName (
1108
- selectedMesh . name
1109
- ) ?. parent ;
1112
+ const parentGroup = this . _meshGroup ?. getObjectByName ( selectedMesh . name )
1113
+ ?. parent as THREE . Group ;
1110
1114
const boundingBox = parentGroup ?. getObjectByName (
1111
1115
SELECTION_BOUNDING_BOX
1112
1116
) as THREE . Mesh ;
1117
+
1113
1118
if ( boundingBox ) {
1114
1119
boundingBox . visible = false ;
1115
1120
}
1116
1121
1122
+ if ( ! parentGroup . userData . jcObject . visible ) {
1123
+ parentGroup . visible = false ;
1124
+ selectedMesh . material . opacity = 1 ;
1125
+ selectedMesh . material . transparent = false ;
1126
+ }
1127
+
1117
1128
const material = selectedMesh . material as THREE . Material & {
1118
1129
linewidth ?: number ;
1119
1130
} ;
@@ -1131,18 +1142,19 @@ export class MainView extends React.Component<IProps, IStates> {
1131
1142
selectionName
1132
1143
) as BasicMesh ;
1133
1144
1134
- if ( ! selectedMesh || ! selectedMesh . visible ) {
1145
+ if ( ! selectedMesh ) {
1135
1146
continue ;
1136
1147
}
1137
1148
1149
+ this . _selectedMeshes . push ( selectedMesh ) ;
1150
+
1138
1151
if ( selectedMesh . name . startsWith ( 'edge' ) ) {
1139
1152
// Highlight edges using the old method
1140
1153
if ( ! selectedMesh . userData . originalColor ) {
1141
1154
selectedMesh . userData . originalColor =
1142
1155
selectedMesh . material . color . clone ( ) ;
1143
1156
}
1144
1157
1145
- this . _selectedMeshes . push ( selectedMesh ) ;
1146
1158
if ( selectedMesh ?. material ?. color ) {
1147
1159
selectedMesh . material . color = BOUNDING_BOX_COLOR ;
1148
1160
}
@@ -1155,11 +1167,15 @@ export class MainView extends React.Component<IProps, IStates> {
1155
1167
}
1156
1168
} else {
1157
1169
// Highlight non-edges using a bounding box
1158
- this . _selectedMeshes . push ( selectedMesh ) ;
1170
+ const parentGroup = this . _meshGroup ?. getObjectByName ( selectedMesh . name )
1171
+ ?. parent as THREE . Group ;
1172
+
1173
+ if ( ! parentGroup . userData . jcObject . visible ) {
1174
+ parentGroup . visible = true ;
1175
+ selectedMesh . material . opacity = 0.5 ;
1176
+ selectedMesh . material . transparent = true ;
1177
+ }
1159
1178
1160
- const parentGroup = this . _meshGroup ?. getObjectByName (
1161
- selectedMesh . name
1162
- ) ?. parent ;
1163
1179
const boundingBox = parentGroup ?. getObjectByName (
1164
1180
SELECTION_BOUNDING_BOX
1165
1181
) as THREE . Mesh ;
@@ -1377,6 +1393,7 @@ export class MainView extends React.Component<IProps, IStates> {
1377
1393
const objColor = obj ?. material . color ;
1378
1394
1379
1395
obj . parent ! . visible = isVisible ;
1396
+ obj . parent ! . userData . visible = isVisible ;
1380
1397
1381
1398
const explodedLineHelper =
1382
1399
this . _explodedViewLinesHelperGroup ?. getObjectByName ( objName ) ;
0 commit comments