Fix assigning bytes to texture data.
PiperOrigin-RevId: 706747323 Change-Id: I6b0ee67d4f35db3a149ba8d9979546d3c712bb8b
This commit is contained in:
committed by
Copybara-Service
parent
a7eb6efd4e
commit
644dfc7fb5
@@ -170,11 +170,12 @@ def _ptr_binding_code(
|
||||
return MjTypeVec<std::byte>(self.{fullvarname}->data(),
|
||||
self.{fullvarname}->size());
|
||||
}},
|
||||
[]({rawclassname}& self, py::object rhs) {{
|
||||
[]({rawclassname}& self, py::bytes& rhs) {{
|
||||
self.{fullvarname}->clear();
|
||||
self.{fullvarname}->reserve(py::len(rhs));
|
||||
for (auto val : rhs) {{
|
||||
self.{fullvarname}->push_back(py::cast<const std::byte>(val));
|
||||
std::string_view rhs_view = py::cast<std::string_view>(rhs);
|
||||
for (auto val : rhs_view) {{
|
||||
self.{fullvarname}->push_back(static_cast<std::byte>(val));
|
||||
}}
|
||||
}}, py::return_value_policy::move);"""
|
||||
elif vartype == 'mjStringVec':
|
||||
|
||||
Reference in New Issue
Block a user