Hello everyone,
I’m currently facing an issue with rendering a model using HOOPS Communicator 2024.6.0. I have set up the server with the following command:
./ts3d_sc_server --license-file license.txt --model-search-directories ./converted_models/standard/sc_models --sc-port 50001 --initial-use-duration 0 --log-file sc_server.log --sc-verbose-logging true --exit-on-load-finish false
In my client-side code, I’m using the Communicator.WebViewer
to connect to the server via WebSocket. Here is a simplified version of my setup:
import * as Communicator from './hoops/web-viewer';
import { useState, useEffect } from 'react';
import { v4 as uuidv4 } from 'uuid';
export default function Viewer() {
const [nodeId, setNodeId] = useState(null);
const viewerId = uuidv4();
useEffect(() => {
const hwv = new Communicator.WebViewer({
containerId: viewerId,
endpointUri: 'ws://localhost:50001',
model: 'bnc'
});
hwv.setCallbacks({
sceneReady: () => {
console.log('Scene is ready');
hwv.view.setBackgroundColor(Communicator.Color.white(), Communicator.Color.white());
},
connectionError: (error) => {
console.error('Connection error:', error);
},
});
hwv.start();
window.addEventListener('resize', () => {
hwv.resizeCanvas();
});
return () => {
hwv.shutdown();
};
}, []);
return (
<div id={viewerId} style={{ width: '100%', height: '100%' }}></div>
);
}
Despite the setup, the model does not render in the viewer. The server logs do not show any errors, and the client-side logs indicate that the scene is ready. However, the model is not visible.
I’ve ensured that the WebSocket connection is established correctly and that the model file is available in the specified directory. Could anyone provide insights or suggestions on what might be causing this issue?
Thank you in advance for your help!