Skip to content
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

"UIManager hasn't been initialised" in 1.1.7 version #194

Closed
5 tasks done
TristanLecallier opened this issue Nov 29, 2023 · 9 comments
Closed
5 tasks done

"UIManager hasn't been initialised" in 1.1.7 version #194

TristanLecallier opened this issue Nov 29, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@TristanLecallier
Copy link
Contributor

Describe the bug 📝

since I updated OBC from 1.1.5 to 1.1.7., I have the following error "UIManager hasn't been initialised".
It happens when I create LengthMeasurement components. Yet I disabled ui (because I'm using my own) with : this.components.uiEnabled = false;

After a deeper investigation, it seems that the issue raises inside VertexPicker Class in setupEvents function (here : https://github.com/IFCjs/components/blob/main/src/utils/VertexPicker/index.ts#L164 )

Reproduction ▶️

No response

Steps to reproduce 🔢

` this.components = new OBC.Components();
const sceneComponent = new OBC.SimpleScene(this.components);
const scene = sceneComponent.get();

this.components.scene = sceneComponent;
this.postProdRenderer = new OBC.PostproductionRenderer(
  this.components,
  container
);
this.components.renderer = this.postProdRenderer;
this.components.uiEnabled = false;

this.cameraComponent = new OBC.OrthoPerspectiveCamera(this.components);
this.components.camera = this.cameraComponent;
this.components.raycaster = new OBC.SimpleRaycaster(this.components);
this.components.init();

this.lengthDimension = new OBC.LengthMeasurement(this.components);
this.lengthDimension.snapDistance = 1; `

System Info 💻

`"openbim-components": "^1.1.7"`

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • Check that this is a concrete bug. For Q&A join our Community.
  • The provided reproduction is a minimal reproducible example of the bug.
@TristanLecallier TristanLecallier added the bug Something isn't working label Nov 29, 2023
@HoyosJuan HoyosJuan self-assigned this Nov 29, 2023
@HoyosJuan
Copy link
Member

Hi @TristanLecallier!

Could you please update to 1.1.9 and tell us if the error continues?

@TristanLecallier
Copy link
Contributor Author

Hi @HoyosJuan !
After the update, I still have the error...

@HoyosJuan
Copy link
Member

Ok @TristanLecallier! Got you covered 🙂 will let you know when it's fixed.

@HoyosJuan
Copy link
Member

Hey @TristanLecallier! I just solved this in PR #199. We need to wait until this gets published as a new patch in NPM along with other bugs I'm solving. Thanks!

@TristanLecallier
Copy link
Contributor Author

Hi @HoyosJuan I think there was an oversight in the PR : the viewer container is still taken from the UI Manager in LengthMeasurement component, here : https://github.com/IFCjs/components/blob/a8472b228f955fd03a9c1e16d05d46106f496466/src/measurement/LengthMeasurement/index.ts#L304C4-L304C64

@TristanLecallier
Copy link
Contributor Author

Also with FragmentPlans component : https://github.com/IFCjs/components/blob/a8472b228f955fd03a9c1e16d05d46106f496466/src/fragments/FragmentPlans/index.ts#L165

The "add" method will create a ui.Button whereas ui is disabled.

@tb-viktor
Copy link

@HoyosJuan

This also happens now with the FragmentIfcLoader. We don't have the UI declared anywhere, but still get a crash.

image

The line it crashes on is: const ifcLoader = new OBC.FragmentIfcLoader(newComponents);

In 1.1.0 it worked fine.

@TristanLecallier
Copy link
Contributor Author

TristanLecallier commented Jan 9, 2024

@tb-viktor have you put newComponents.uiEnabled = false; ? before calling const ifcLoader = new OBC.FragmentIfcLoader(newComponents);

@tb-viktor
Copy link

@tb-viktor have you put newComponents.uiEnabled = false; ? before calling const ifcLoader = new OBC.FragmentIfcLoader(newComponents);

That solves it, thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants