Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// sculpt tool
var optTools = [];
for (var i = 0, nbTools = Tools.length; i < nbTools; ++i) {
if (Tools[i]) optTools[i] = TR(Tools[i].uiName);
}
this._ctrlSculpt = menu.addCombobox(TR('sculptTool'), this._sculptManager.getToolIndex(), this.onChangeTool.bind(this), optTools);
GuiSculptingTools.initGuiTools(this._sculptManager, this._menu, this._main);
this._ctrlTitleCommon = menu.addTitle(TR('sculptCommon'));
// symmetry
this._ctrlSymmetry = menu.addCheckbox(TR('sculptSymmetry'), this._sculptManager._symmetry, this.onSymmetryChange.bind(this));
// continuous
this._ctrlContinuous = menu.addCheckbox(TR('sculptContinuous'), this._sculptManager, '_continuous');
GuiSculptingTools.show(this._sculptManager.getToolIndex());
this.addEvents();
this.onChangeTool(this._sculptManager.getToolIndex());
}
onChangeTool(newValue) {
GuiSculptingTools.hide(this._sculptManager.getToolIndex());
this._sculptManager.setToolIndex(newValue);
GuiSculptingTools.show(newValue);
var showContinuous = this._sculptManager.canBeContinuous() === true;
this._ctrlContinuous.setVisibility(showContinuous);
var showSym = newValue !== Enums.Tools.TRANSFORM;
this._ctrlSymmetry.setVisibility(showSym);
this._ctrlTitleCommon.setVisibility(showContinuous || showSym);
this._main.getPicking().updateLocalAndWorldRadius2();
}