Archive 17/01/2023.

Where is the corresponding GetObjectsByCategory function in C++

Virgo

Im trying to write my own scene editor in c++ as practice, and encountered this problem…
somebody some help plz xD

Virgo

:joy:by problem i mean unable to find the corresponding function in c++ for GetObjectsByCategory

Modanung

Urho has something called tags, could that be what you’re looking for?

Virgo

oops, just noticed i provided too less info, sry for that xD
what i wanted is something like this
in the editor it uses GetObjectCategories() and GetObjectsByCategory()
and i checked the api docs we do have Context::GetObjectCategories() in c++, but no GetObjectsByCategory()…
image image

Modanung

Then I think this method is part of the editor’s code. Did you look where GetObjectsByCategory() is defined?

Virgo

not found in any of the .as files came with the engine

Sinoid

It’s just const HashMap<String, Vector<StringHash> >& Context::GetObjectCategories() const

The info you really want comes from the factory table. Get the factory table, index by the hash above, and use the factory for getting the name or creating and instance.

Virgo

that seems to be what i need! xD