Issue with Model Rendering in HOOPS Communicator 2024.6.0

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!

Hello @soukaina.abkari,

Welcome to the forum !

Are you seeing any messages in the web browser dev console?

Thank you,

I see this regarding ws:




after a while the server disconnects

.../HOOPS_Communicator_2024.6.0/server/bin/macos ────────────── ✔  03:22:18 PM  ▓▒░─╮
╰─ ./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

.../HOOPS_Communicator_2024.6.0/server/bin/macos ────────────── ✔  03:22:16 PM  ▓▒░─╮
╰─ tail -f sc_server.log                                                                                        ─╯
0.001:info: settings.workspaceDir=''
0.001:info: settings.sessionToken: set=false
0.001:info: settings.sslCertificateFile: 
0.001:info: settings.sslPrivateKeyFile: 
0.001:info: settings.sslDisableRevocationTest: false
0.001:info: settings.sslCaPath: 
0.001:info: settings.ssrGpuIndex: 4294967295
0.001:info: settings.ssrEgl: false
0.001:info: settings.restFileserver: 
0.002:info: HTTP Ping client disabled via settings
123.629:info: server has received initial data from the WS connection
123.737:info: server disconnect: disconnect

Thanks for answering.

Thanks for providing the additional information.

I just posted a reply to a similar post in the forum regarding a BAD_NETWORK_VERSION result.