(binary_path=None, byte_string=None)
return ptr
Returns a pointer to an mjModel from the contents of a MuJoCo model binary.

  Args:
    binary_path: Path to an MJB file (as produced by MjModel.save_binary).
    byte_string: String of bytes (as returned by MjModel.to_bytes).

    One of `binary_path` or `byte_string` must be specified.

  Returns:
    A `ctypes.POINTER` to a new `mjbindings.types.MJMODEL` instance.

  Raises:
    TypeError: If both or neither of `byte_string` and `binary_path`
      are specified.
Returns a pointer to an mjModel from the contents of a MuJoCo model binary.
Returns a pointer to an mjModel from the contents of a MuJoCo model binary .
def _get_model_ptr_from_binary(binary_path=None, byte_string=None):
  """Returns a pointer to an mjModel from the contents of a MuJoCo model binary.

  Args:
    binary_path: Path to an MJB file (as produced by MjModel.save_binary).
    byte_string: String of bytes (as returned by MjModel.to_bytes).

    One of `binary_path` or `byte_string` must be specified.

  Returns:
    A `ctypes.POINTER` to a new `mjbindings.types.MJMODEL` instance.

  Raises:
    TypeError: If both or neither of `byte_string` and `binary_path`
      are specified.
  """
  if binary_path is None and byte_string is None:
    raise TypeError(
        "At least one of `byte_string` or `binary_path` must be specified.")
  elif binary_path is not None and byte_string is not None:
    raise TypeError(
        "Only one of `byte_string` or `binary_path` may be specified.")

  if byte_string is not None:
    with _temporary_vfs({_FAKE_BINARY_FILENAME: byte_string}) as vfs:
      ptr = mjlib.mj_loadModel(_FAKE_BINARY_FILENAME, vfs)
  else:
    ptr = mjlib.mj_loadModel(util.to_binary_string(binary_path), None)

  # Free resources when the ctypes pointer is garbage collected.
  _create_finalizer(ptr, mjlib.mj_deleteModel)

  return ptr
def _get_model_ptr_from_binary ( binary_path = None , byte_string = None ) : if binary_path is None and byte_string is None : raise TypeError ( "At least one of `byte_string` or `binary_path` must be specified." ) elif binary_path is not None and byte_string is not None : raise TypeError ( "Only one of `byte_string` or `binary_path` may be specified." ) if byte_string is not None : with _temporary_vfs ( { _FAKE_BINARY_FILENAME : byte_string } ) as vfs : ptr = mjlib . mj_loadModel ( _FAKE_BINARY_FILENAME , vfs ) else : ptr = mjlib . mj_loadModel ( util . to_binary_string ( binary_path ) , None ) # Free resources when the ctypes pointer is garbage collected. _create_finalizer ( ptr , mjlib . mj_deleteModel ) return ptr