Do not copy the spec during attach.
Use a reference count for managing the memory. PiperOrigin-RevId: 716169486 Change-Id: Id270c4858c17b9250115e9544d5ea143584e2d5f
This commit is contained in:
committed by
Copybara-Service
parent
6436055c6c
commit
c2138c3fb0
@@ -350,6 +350,14 @@ PYBIND11_MODULE(_specs, m) {
|
||||
mjSpec.def("copy", [](const MjSpec& self) -> MjSpec {
|
||||
return MjSpec(self);
|
||||
});
|
||||
mjSpec.def_property(
|
||||
"copy_during_attach",
|
||||
[](MjSpec& self) {
|
||||
throw pybind11::value_error("copy_during_attach can only be set.");
|
||||
},
|
||||
[](MjSpec& self, bool deepcopy) {
|
||||
return mjs_setDeepCopy(self.ptr, deepcopy);
|
||||
});
|
||||
mjSpec.def_property_readonly(
|
||||
"worldbody",
|
||||
[](MjSpec& self) -> raw::MjsBody* {
|
||||
|
||||
Reference in New Issue
Block a user