Hi, I’m having more trouble than I should with getting this right.
I have a mesh names with either a space or a full stop in between (I.e. circle.001). How should I write this out for this code:
“circle.001”.isPickable = false;
I have a edge render for my model but I don’t want it to show for a certain selection of meshes. I thought I would need to put the mesh name in quotations i.e. “circle.001” but that doesn’t seem to work. Is that even the right way to stop a mesh from being highlighted? It’s a glb file.
Hi, I’ve tried to use that but I get mesh is Null. I’ve created a playground as an example. How would this work in the example excluding the two circlexxx mesh’s. In my main model there are 100’s of buildings by the way that I’d need to keep as pickable. Is it not working due to the way it loads and checks for that mesh before it’s loaded?
I see, thank you! Is there a clean way of doing it for a lot of transform nodes (more than 1). I couldn’t stop the bridge from being highlighted by replicating that code for Circle.027
Then you need to maintain a list of the name of these TransformNode or Meshes, and apply a filter. Or if the names of unselectable entities follow a pattern, you can apply a regexp filter.
Another way that might be easier than changing the name or name convention is to make two imports and assign an ‘id’ for each group of meshes. Or you can also do through material and assign an ‘id’ to the material. Both would work.
Thanks for the replies @slin and @mawa. I love both ideas but the coding sounds far too complicated for me to draft up. I have a working solution with a basic duplication:
const tn007 = scene.getTransformNodeByName(‘Circle.027’);
So I may stick to that one for now. Regex sounds like it would be the right option as a lot of the mesh’s I have to mark as unpickable are in groups with the same naming convention like circle.0xx and Tree.0xx.
Just for an update, I’ve managed to merge 200 odd meshes into about 10 meshes so it removes the need to reference so many I had to research how to do that in blender as I wasn’t aware that was possible.