Back to the Shapespark home page

Right Click to be disabled in orbit mode

Hello,

Is it possible to disable right click when user is in Orbit mode, or maybe disable right click entirely in my 3D Scene ?

Please do share the code on how to do it.

Thank you.

Disabling panning in the orbit mode is not available in the user interface, but you can do it by manually modifying the scene.json file in the scene directory:

  1. Backup the original scene.json.
  2. Get scene.json in the readable format: http://localhost:5000/scenes/YOUR-SCENE-NAME/scene.json?pretty by saving the content of the page, overwriting scene.json.
  3. Look for the "views" list in scene.json, and for your orbit view add "noPan": true, as in the below example:
    {
      "distance": 20.45041967393793,
      "hideFromMenu": false,
      "id": 2,
      "mode": "orbit",
      "name": "Orbit",
      "noPan": true,
      "rotation": [
        0.23571428571421107,
        -90
      ],
      "sky": "default",
      "target": [
        -0.2649026459631804,
        -0.8169712913458882,
        -0.8443562984466553
      ]
    }
1 Like

Thanks a lot @wojtek , works perfect !

1 Like