Exemplo n.º 1
0
    def get_parent(self) -> Union['Object', None]:
        """Gets the parent of this object in the scene hierarchy.

        :return: The parent of this object, or None if it doesn't have a parent.
        """
        try:
            handle = vrep.simGetObjectParent(self._handle)
        except RuntimeError:
            # Most probably no parent.
            return None
        return Object(handle)
Exemplo n.º 2
0
    def get_parent(self) -> 'Object':
        """Gets the parent of this object in the scene hierarchy.

        :raises: NoParentError if the object does not have a parent.
        :return: The parent of this object.
        """
        try:
            handle = vrep.simGetObjectParent(self._handle)
        except RuntimeError:
            # Most probably no parent.
            raise NoParentError('This object does not have a parent.')
        return Object(handle)