Closed wpumacay closed 6 months ago
Hi @wpumacay! Thank you for using the library! And sorry for missing the message.
As you noticed, the 'Meshcat' class in the provided section of the code still relies on 'Meshcat::Impl' to implement its functionality.
Still Meshcat::Impl
implements
So, in theory, we may just have:
template <typename T>
void Meshcat::set_property(std::string_view path, const std::string& property, const T& value)
{
this->pimpl_->set_property(path, property, value);
}
Indeed, 'set_property' creates a 'PropertyTrampoline' that is used to serialize the message that is sent to the server. Here is the link to that part of the code.
The following data structures are supported by default. You can find more information about them here.
So, in conclusion, a possible strategy is:
template <typename T>
void Meshcat::set_property(std::string_view path, const std::string& property, const T& value)
{
this->pimpl_->set_property(path, property, value);
}
and remove the void Meshcat::set_property(std::string_view path, const std::string& property, bool value)
meshcatViz.set_property("/path/to/the/object", "color", {255, 241, 17});
You can find the list of possible properties in https://github.com/meshcat-dev/meshcat#programmatic-api
Thank you!
Hi, First of all, thanks for making this library. To the point, I wanted to change at runtime the color of some objects in the visuaslization. I see there's a
set_property
function inMeshcat.h
, but the only value it accepts is boolean. How could I modify the code or add this functionality to change the property color of the material? (if possible).Thanks in advance.