list of objects by type AND name


#1

hey guys, probably an easy one here but I’m a n00b

Is there a simple way to get a list of objects that are in the scene filtered by name AND type?

like

string $allBinds[] =  (`ls "*Bind*"`);

gives me anything “Bind” in the name but I really wanted only the Joints of that list, but


string $allBinds[] =  (`ls -et "joint" "*Bind*" `);

doesn’t return anything.

it’s probably super simple, cheers guys


#2

That code should work.

I don’t know why would you call your joints “Bind”, but that code should return all joints that have the word “Bind” in their names. BTW, the name to be searched is case sensitive, and you don’t need the parenthesis in your variables.


#3

thanks, guess I got in the bad habbit of putting parenthesis in everywhere lol, dunno why it wasnt working before but yeah, it is, thank you

Joints are called bind_somethign because they are skinned, and I didin’t name them, I’m writing a tool to help with exporting Mixamo rigs and stripping out the rig joints which dont have “bind” in the name.

thanks for your help


#4

I see, it probably was a case sensitive problem with bind and Bind.


#5

I actually found the success rate to be inconsistent until I added the “-r” flag, which made it work fine.

cheers!