Back to Demos

This demo shows how you can move nodes on given objects.

Clara.io demo resources:

Visit Base Scene


var sceneId = '5c146c42-6b2d-47ee-9275-c929fa431439';
var api = claraplayer('player');
api.player.showTool('nodeMove');
api.player.removeTool('select');
api.commands.activateCommand('nodeMove');
api.selection.setHighlighting(true);

api.sceneIO.fetchAndUse(sceneId).then(function(){
  var baseObjectIds = api.scene.filter({name:'torus'});
  var movedObjectId = api.scene.find({type:'PolyMesh',name:'sphere'});
  var opts = {
    displayGizmo: false,
    mode: 'surface',
    surfaceNodeIds: baseObjectIds
  }; 
  api.selection.selectNode(movedObjectId); 
  api.commands.setCommandOptions('nodeMove',opts);  
  document.getElementById('baseScene').setAttribute('href','https://clara.io/view/'+sceneId);
});