Add mjs_findKeyframe.
PiperOrigin-RevId: 649036650 Change-Id: If514d5c333dd6084af9509324fd658c72576d7b5
This commit is contained in:
committed by
Copybara-Service
parent
8f16b72f44
commit
9107d3b507
@@ -530,6 +530,15 @@ mjsFrame* mjs_findFrame(mjSpec* s, const char* name) {
|
||||
|
||||
|
||||
|
||||
// find keyframe by name
|
||||
mjsKey* mjs_findKeyframe(mjSpec* s, const char* name) {
|
||||
mjCModel* model = static_cast<mjCModel*>(s->element);
|
||||
mjCKey* key = (mjCKey*)model->FindObject(mjOBJ_KEY, std::string(name));
|
||||
return key ? &(static_cast<mjCKey*>(key)->spec) : nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// set frame
|
||||
void mjs_setFrame(mjsElement* dest, mjsFrame* frame) {
|
||||
if (!frame) {
|
||||
|
||||
Reference in New Issue
Block a user