@@ -540,7 +540,7 @@ PYBIND11_MODULE(_specs, m) {
540540 SetFrame (worldbody, mjOBJ_CAMERA, worldframe);
541541 const char * p = prefix.has_value () ? prefix.value ().c_str () : " " ;
542542 const char * s = suffix.has_value () ? suffix.value ().c_str () : " " ;
543- raw::MjsFrame * attached_frame = nullptr ;
543+ raw::MjsElement * attached_frame = nullptr ;
544544 if (frame.has_value ()) {
545545 raw::MjsFrame* frame_ptr = nullptr ;
546546 try {
@@ -560,11 +560,12 @@ PYBIND11_MODULE(_specs, m) {
560560 if (!parent_body) {
561561 throw pybind11::value_error (" Frame does not have a parent body." );
562562 }
563- attached_frame = mjs_attachFrame (parent_body, worldframe, p, s);
563+ attached_frame =
564+ mjs_attach (parent_body->element , worldframe->element , p, s);
564565 if (!attached_frame) {
565566 throw pybind11::value_error (mjs_getError (self.ptr ));
566567 }
567- if (mjs_setFrame (attached_frame-> element , frame_ptr) != 0 ) {
568+ if (mjs_setFrame (attached_frame, frame_ptr) != 0 ) {
568569 throw pybind11::value_error (mjs_getError (self.ptr ));
569570 }
570571 }
@@ -583,7 +584,8 @@ PYBIND11_MODULE(_specs, m) {
583584 throw pybind11::value_error (
584585 " Site spec does not match parent spec." );
585586 }
586- attached_frame = mjs_attachFrameToSite (site_ptr, worldframe, p, s);
587+ attached_frame =
588+ mjs_attach (site_ptr->element , worldframe->element , p, s);
587589 if (!attached_frame) {
588590 throw pybind11::value_error (mjs_getError (self.ptr ));
589591 }
@@ -597,7 +599,7 @@ PYBIND11_MODULE(_specs, m) {
597599 self.assets [asset.first ] = asset.second ;
598600 }
599601 child.parent = &self;
600- return attached_frame;
602+ return mjs_asFrame ( attached_frame) ;
601603 },
602604 py::arg (" child" ), py::arg (" prefix" ) = py::none (),
603605 py::arg (" suffix" ) = py::none (), py::arg (" site" ) = py::none (),
@@ -829,11 +831,11 @@ PYBIND11_MODULE(_specs, m) {
829831 std::optional<std::string>& suffix) -> raw::MjsFrame* {
830832 const char * p = prefix.has_value () ? prefix.value ().c_str () : " " ;
831833 const char * s = suffix.has_value () ? suffix.value ().c_str () : " " ;
832- auto new_frame = mjs_attachFrame (& self, & frame, p, s);
834+ auto new_frame = mjs_attach ( self. element , frame. element , p, s);
833835 if (!new_frame) {
834836 throw pybind11::value_error (mjs_getError (mjs_getSpec (self.element )));
835837 }
836- return new_frame;
838+ return mjs_asFrame ( new_frame) ;
837839 },
838840 py::arg (" frame" ), py::arg (" prefix" ) = py::none (),
839841 py::arg (" suffix" ) = py::none (),
@@ -870,12 +872,12 @@ PYBIND11_MODULE(_specs, m) {
870872 std::optional<std::string>& suffix) -> raw::MjsBody* {
871873 const char * p = prefix.has_value () ? prefix.value ().c_str () : " " ;
872874 const char * s = suffix.has_value () ? suffix.value ().c_str () : " " ;
873- auto new_body = mjs_attachBody (& self, & body, p, s);
875+ auto new_body = mjs_attach ( self. element , body. element , p, s);
874876 if (!new_body) {
875877 throw pybind11::value_error (
876878 mjs_getError (mjs_getSpec (self.element )));
877879 }
878- return new_body;
880+ return mjs_asBody ( new_body) ;
879881 },
880882 py::arg (" body" ), py::arg (" prefix" ) = py::none (),
881883 py::arg (" suffix" ) = py::none (),
@@ -953,12 +955,12 @@ PYBIND11_MODULE(_specs, m) {
953955 std::optional<std::string>& suffix) -> raw::MjsBody* {
954956 const char * p = prefix.has_value () ? prefix.value ().c_str () : " " ;
955957 const char * s = suffix.has_value () ? suffix.value ().c_str () : " " ;
956- auto new_body = mjs_attachToSite (& self, & body, p, s);
958+ auto new_body = mjs_attach ( self. element , body. element , p, s);
957959 if (!new_body) {
958960 throw pybind11::value_error (
959961 mjs_getError (mjs_getSpec (self.element )));
960962 }
961- return new_body;
963+ return mjs_asBody ( new_body) ;
962964 },
963965 py::arg (" body" ), py::arg (" prefix" ) = py::none (),
964966 py::arg (" suffix" ) = py::none (),
0 commit comments