Avoid changing semantics of mjsPlugin.name across XML sections.
The `extension` section used to discard the plugin name and write the instance name in `plugin.name`, while all of the other sections wrote the instance name in `plugin.instance_name` and optionally the plugin name in `plugin.name` (via the function `OnePlugin`). Now all plugin names are in `plugin.plugin_name` and the instance is written in `plugin.name`, so that it is possible to lookup a plugin via its unique instance name. PiperOrigin-RevId: 683183804 Change-Id: I179ef5d221143b720db24d745b09e327bf1449ef
This commit is contained in:
committed by
Copybara-Service
parent
5bfc7da7de
commit
66faba9aa5
@@ -820,8 +820,8 @@ void mjXWriter::OneActuator(XMLElement* elem, const mjCActuator* actuator, mjCDe
|
||||
|
||||
// write plugin
|
||||
void mjXWriter::OnePlugin(XMLElement* elem, const mjsPlugin* plugin) {
|
||||
const string instance_name = string(mjs_getString(plugin->instance_name));
|
||||
const string plugin_name = string(mjs_getString(plugin->name));
|
||||
const string instance_name = string(mjs_getString(plugin->name));
|
||||
const string plugin_name = string(mjs_getString(plugin->plugin_name));
|
||||
if (!instance_name.empty()) {
|
||||
WriteAttrTxt(elem, "instance", instance_name);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user