Skip to content

Find all sites of a default class #482

Open

Description

@edwardjjj

Hi,
I'm trying to filter sites based on class names. According to documentation, The following code will return the class name
mjcf_model.find_all('site')[0].dclass
But instead, it returned an MJCF Element,
mjcf_model.find_all('site')[0].dclass.dclass will return the actual class name.
This makes filtering sites based on class names very ugly because sites with no default class names will return None, then doing
mjcf_model.find('site','mysite').dclass.dclass will result in errors.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions