Skip to content

Commit

Permalink
set highlightAtomsMesh to layer 1 to make it not selectable
Browse files Browse the repository at this point in the history
  • Loading branch information
superstar54 committed Mar 29, 2024
1 parent b3fab92 commit d5ad5f7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "weas",
"version": "0.1.1",
"version": "0.1.2",
"description": "WEAS (Web Environment for Atomic Structures) is a JavaScript library to visualize and manipulate the atomistic structures directly in the web browser",
"main": "src/index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/atoms/AtomsViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ class AtomsViewer {
});
this.atomsMesh.add(this.highlightAtomsMesh);
this.highlightAtomsMesh.material.opacity = 0.6;
this.highlightAtomsMesh.layers.set(1); // Set the layer to 1 to make it not selectable
this.updateHighlightAtomsMesh(this.selectedAtomsIndices);
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/SceneManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class WeasScene extends THREE.Scene {
}

add(object) {
console.log("add object", object);
// console.log("add object", object);
super.add(object);
this.dispatchObjectEvent({
data: object.toJSON(),
Expand All @@ -20,7 +20,7 @@ export class WeasScene extends THREE.Scene {
}

remove(object) {
console.log("remove object", object);
// console.log("remove object", object);
// if object is a string, find it by uuid
if (typeof object === "string") {
object = this.getObjectByProperty("uuid", object);
Expand Down
4 changes: 2 additions & 2 deletions src/core/SelectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SelectionManager {
}

set selectedObjects(objects) {
console.log("Setting selected objects: ", objects);
// console.log("Setting selected objects: ", objects);
// skip nonSelectable objects
objects = objects.filter((object) => {
return !object.userData.notSelectable;
Expand Down Expand Up @@ -166,7 +166,7 @@ export class SelectionManager {
Object.keys(this.selectedInstances).forEach((objectUuid) => {
const object = this.tjs.scene.getObjectByProperty("uuid", objectUuid);
if (!object || !object.userData.vertexPoints) {
console.log("Object or vertex points not found");
// console.log("Object or vertex points not found");
return;
}

Expand Down

0 comments on commit d5ad5f7

Please sign in to comment.