# reflect changes of 3d object on client side

**URL:** https://discourse.paraview.org/t/reflect-changes-of-3d-object-on-client-side/13385
**Category:** Web Support
**Tags:** python, vtk
**Created:** [November 29, 2023, 9:10pm UTC](https://discourse.paraview.org/t/reflect-changes-of-3d-object-on-client-side/13385 "2023-11-29T21:10:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![molumolu](https://discourse.paraview.org/user_avatar/discourse.paraview.org/molumolu/32/13043_2.png) [@molumolu](https://discourse.paraview.org/u/molumolu)
#### Post date: [November 29, 2023, 9:10pm UTC](https://discourse.paraview.org/t/reflect-changes-of-3d-object-on-client-side/13385/1 "2023-11-29T21:10:57Z")

</div>

I am creating Web application using React.js and paraview-web.  
now I am trying to change axes of 3d model on the server side and it changes the camera position correctly but to reflect this changes to the 3d object on the screen, I have to refresh the page or touch the object directly.  
Here is how the server side code looks like

```auto
    @exportRpc("set_orientation")
    def set_orientation(self, orientation):
        print(orientation)
        if orientation=='X':
            normal=[1,0,0]
            upNormal=[0,0,1]
        elif orientation=='Y':
            normal=[0,1,0]
            upNormal=[0,0,1]
        elif orientation=='Z':
            normal=[0,0,1]
            upNormal=[0,1,0]
        
        renderView=simple.GetRenderView()
        renderView.CameraPosition = [0,0,0]
        renderView.CameraFocalPoint = normal
        renderView.CameraViewUp = upNormal
        renderView.ResetCamera()
        renderView.StillRender()

```

This is how I get the paraview web client on client-side.

```auto
const config = { sessionURL: "ws://localhost:1234/ws" };
const smartConnect = SmartConnect.newInstance({ config });

// Connecting to the paraview server
smartConnect.onConnectionReady((connection) => {
  if (!pvw) {
    const pvwClient = ParaViewWebClient.createClient(
      connection,
      // Default buit in protocols
      ["MouseHandler", "ViewPort", "ViewPortImageDelivery"],
      // Adding messages to call functions from local protocol in the paraview server
      {
        local: (session) => createMethods(session),
        ContourPlot: (session) => contourPlotMethods(session),
        AirFlowStream: (session) => airFlowMethods(session),
        CreateReport: (session) => createReportMethods(session),
      }
    );

    // Setting remote renderer
    const renderer = new RemoteRenderer(pvwClient);
    renderer.setContainer(currentRenderer);
    window.renderer = renderer;
    SizeHelper.onSizeChange(() => {
      renderer.resize();
    });
    SizeHelper.startListening();
    // Set this session to the local state and pass it to the child components
    sessionDispatch({ type: "SET_SESSION", payload: pvwClient });
  } else {
    // Setting remote renderer
    const renderer = new RemoteRenderer(pvw);
    renderer.setContainer(currentRenderer);
    window.renderer = renderer;
    SizeHelper.onSizeChange(() => {
      renderer.resize();
    });
    SizeHelper.startListening();
    // Set this session to the local state and pass it to the child components
    sessionDispatch({ type: "SET_SESSION", payload: pvw });
  }
});

smartConnect.connect();

```

If anyone knows how to reflect the changes on the client-side automatically, please help me.  
Thank you

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [December 1, 2023, 8:21pm UTC](https://discourse.paraview.org/t/reflect-changes-of-3d-object-on-client-side/13385/2 "2023-12-01T20:21:50Z")

</div>

On the server you should not call `renderView.StillRender()` but instead do something [like that](https://github.com/Kitware/ParaView/blob/master/Web/Python/paraview/web/protocols.py#L309-L310).
