New in 2.2.0

This page lists changes in version 2.2.0 affecting user-facing APIs

  • Nodes in the Toolbox no longer have an Enabled property; this is now controlled solely by the settings under Tools/State. Code that enables or disables tools can now do so via the settings, or preferably, with the Lua functions vrIsToolEnabled, vrSetToolEnabled and vrToggleToolEnabled. These take the name of a tool node, which also matches the metanode names if using the default Toolbox. In C/C++, these can be called using the Foreign Function Interface (FFI). For example:

if(HNode tool = VRFind(VRGetThisUser(), "ToolBox/MouseNavigatorTool")) {
  VRSetPropertyChar(tool, "Enabled", 0);
  VRCloseNodeHandle(tool);
}
if(HNodeR tool = VRFind(VRGetThisUser(), "ToolBox/MouseNavigatorTool")) {
  VRSetPropertyChar(tool, "Enabled", 0);
}
vrLocalUserNode():find("ToolBox/MouseNavigatorTool").Enabled = false
should be changed to:

HFFIVar args[] = {
  VRFFIMakeString("MouseNavigatorTool"),
  VRFFIMakeBool(0)
};
HFFIVar ret = VRFFIInvoke("vrSetToolEnabled", args, 2);
VRFFIFree(ret);
VRFFIFree(args[1]);
VRFFIFree(args[0]);
HFFIVarR args[] = {
  VRFFIMakeString("MouseNavigatorTool"),
  VRFFIMakeBool(0)
};
HFFIVarR ret = VRFFIInvoke("vrSetToolEnabled", HFFIVarR::raw(args), 2);
vrSetToolEnabled("MouseNavigatorTool", false)


No Results.

Getting StartedArchitectureBest PracticesHow ToAdvanced TopicsChangelogvrtreevrtree_cppvtCoreCoreForeign Function InterfaceMetanodesMigrationsObserversPropertiesSettingsTreeUtilitiesAPI DefinitionsVR ExchangePluginsLua API