iobroker.mywebui 1.42.8 → 1.42.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/io-package.json
CHANGED
package/package.json
CHANGED
|
@@ -323,22 +323,34 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
|
|
|
323
323
|
this.raycaster.setFromCamera(this.mouse, this.camera);
|
|
324
324
|
const intersects = this.raycaster.intersectObjects(this.scene.children, true);
|
|
325
325
|
|
|
326
|
+
// Find the closest asset root (not just first match)
|
|
327
|
+
let closestAsset = null;
|
|
328
|
+
let closestDistance = Infinity;
|
|
329
|
+
|
|
326
330
|
for (const intersection of intersects) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
let obj = intersection.object;
|
|
332
|
+
|
|
333
|
+
// Skip grid, axes, lights
|
|
334
|
+
if (obj.userData.isGrid || obj.userData.isAxes || obj.userData.lightId) {
|
|
335
|
+
continue;
|
|
331
336
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
while (
|
|
335
|
-
if (
|
|
336
|
-
|
|
337
|
-
|
|
337
|
+
|
|
338
|
+
// Find root asset containing this mesh
|
|
339
|
+
while (obj && obj !== this.scene) {
|
|
340
|
+
if (obj.userData.assetData) {
|
|
341
|
+
if (intersection.distance < closestDistance) {
|
|
342
|
+
closestAsset = obj;
|
|
343
|
+
closestDistance = intersection.distance;
|
|
344
|
+
}
|
|
345
|
+
break;
|
|
338
346
|
}
|
|
339
|
-
|
|
347
|
+
obj = obj.parent;
|
|
340
348
|
}
|
|
341
349
|
}
|
|
350
|
+
|
|
351
|
+
if (closestAsset) {
|
|
352
|
+
this.selectObject(closestAsset);
|
|
353
|
+
}
|
|
342
354
|
}
|
|
343
355
|
|
|
344
356
|
selectObject(obj) {
|
|
@@ -347,26 +359,33 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
|
|
|
347
359
|
// Deselect previous (remove highlight)
|
|
348
360
|
if (this.selectedObject) {
|
|
349
361
|
this.selectedObject.userData.selected = false;
|
|
350
|
-
// Restore original
|
|
362
|
+
// Restore original materials
|
|
351
363
|
this.selectedObject.traverse((child) => {
|
|
352
|
-
if (child.
|
|
364
|
+
if (child.isMesh && child.userData.originalMaterial) {
|
|
353
365
|
child.material = child.userData.originalMaterial;
|
|
366
|
+
delete child.userData.originalMaterial;
|
|
354
367
|
}
|
|
355
368
|
});
|
|
356
369
|
}
|
|
357
370
|
|
|
358
|
-
// Select new (add
|
|
371
|
+
// Select new (add subtle highlight)
|
|
359
372
|
this.selectedObject = obj;
|
|
360
373
|
obj.userData.selected = true;
|
|
361
374
|
|
|
362
|
-
// Apply subtle highlight
|
|
375
|
+
// Apply very subtle highlight - only emissive, preserve all other properties
|
|
363
376
|
obj.traverse((child) => {
|
|
364
|
-
if (child.isMesh && child.material) {
|
|
365
|
-
|
|
366
|
-
|
|
377
|
+
if (child.isMesh && child.material && !Array.isArray(child.material)) {
|
|
378
|
+
// Store original if not already stored
|
|
379
|
+
if (!child.userData.originalMaterial) {
|
|
380
|
+
child.userData.originalMaterial = child.material;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Clone and apply subtle glow
|
|
367
384
|
const hlMat = child.material.clone();
|
|
368
|
-
hlMat.emissive
|
|
369
|
-
|
|
385
|
+
if (hlMat.emissive) {
|
|
386
|
+
hlMat.emissive.setHex(0xffff00);
|
|
387
|
+
hlMat.emissiveIntensity = 0.1; // Even more subtle
|
|
388
|
+
}
|
|
370
389
|
child.material = hlMat;
|
|
371
390
|
}
|
|
372
391
|
});
|