-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OBCF.Highlighter just recolor, but not highlight #426
Comments
You are right! We temporarily removed the highlight feature for the new refactor, as the way the highlight works has changed drastically. This is not a but. But don't worry, we'll put it back the next milestone. I'll remove the |
Hi @agviegas any update on this issue/feature? I noticed this as well in my recent migration to the new refactor. |
I'll do it asap. We have few hands. Hopefully these weeks, I'll post any updates here |
Thanks for the update @agviegas Shall I take it up and create a pull request once done? I would like to contribute if possible. |
For temporary solution I use this code. Maybe It will helpful for somebody const highlightMats = {
default: new MeshBasicMaterial({
color: '#674db3',
depthTest: false,
opacity: 0.8,
transparent: true,
}),
};
const highlightFragment = (fragmentMap: FragmentIdMap) => {
const components = new Components();
const fragmentsManager = components.get(OBC.FragmentsManager);
for (const fragID in fragmentMap) {
const fragment = fragmentsManager.list.get(fragID);
if (!fragment) continue;
fragment.mesh.material = [highlightMats.default];
}
}; |
Yeah, this workaround is good. But, one extra thing it probably needs is to make a copy of the mesh and highlight the copy so that the original mesh retains it materials once the highlight is disabled. The copy can be deleted on highlight removal. |
I'm actually currently implementing Fragment cloning. Once I solve that, implementing this should be a piece of cake. |
Will be available from const outliner = components.get(OBCF.Outliner);
outliner.world = world;
outliner.enabled = true;
outliner.create(
"example",
new THREE.MeshBasicMaterial({
color: 0xbcf124,
transparent: true,
opacity: 0.5,
}),
);
highlighter.events.select.onHighlight.add((fragIdMap) => {
outliner.clear("example");
outliner.add("example", fragIdMap);
}); This is the result: 2024-08-06.13-39-54.mp4The highlighter tutorial will also be updated with this. |
Describe the bug 📝
Why does the highlighter not highlight, but simply recolor?
If I highlight a chair, it won't be visible throw the walls the way it worked before.
Example from docks:
https://thatopen.github.io/engine_components/examples/Highlighter/
https://docs.thatopen.com/Tutorials/Components/Front/Highlighter
How to make it so that the backlight not only recolors, but also shines through?
Reproduction▶️
https://thatopen.github.io/engine_components/examples/Highlighter/
Steps to reproduce 🔢
https://thatopen.github.io/engine_components/examples/Highlighter/
System Info 💻
Used Package Manager 📦
npm
Error Trace/Logs 📃
No response
Validations ✅
The text was updated successfully, but these errors were encountered: