Delete by expression using string matching

   12765   7   1
User Avatar
Member
948 posts
Joined: April 2008
Offline
I am trying to delete primitives with delete SOP using expressions using string matching like:

$OBJNAME == “myObject”

But it doesn't work I get an error, can someone give me a hint?

Thanks!
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
8554 posts
Joined: July 2007
Offline
what about using Blast SOP and put this in Group field:
@objname=myObject
or you can even use patterns
@objname=my*
(in case it's not primitive attribute you'd need to specify Group Type)
as this is much faster than Delete SOP with expression

for Delete SOP use strcmp() expression, like:
strcmp($OBJNAME,“myObject”)
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
948 posts
Joined: April 2008
Offline
Thanks for the feedback!

For a single string comparisson it works like a charm I was wondering how can I compare using wilds cards like:

My point name attribute list:

obj_1
obj_2
obj_3
my_obj_1
my_obj_2
my_obj_3

And I want to get all the points/primitives with my_obj_* in a delete expression for example.

I tried strcmp($NAME,“my_obj_*”), but off course it doesn´t work, is there another way?

I hope it makes sense.

Thanks!
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
948 posts
Joined: April 2008
Offline
Got it!

I just have to use strmatch() expression

Thanks!
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
948 posts
Joined: April 2008
Offline
Hi! it's me again ops:

How can I use it in VEX in a attribute wrangle?

Like:

if(@name = `strmatch(“my_obj_*”,$NAME)`)

Off course my expression doesn't work, anyway around it?

Thanks!
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
948 posts
Joined: April 2008
Offline
Anyone?
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
8554 posts
Joined: July 2007
Offline
if( match(“my_obj_*”, s@name) )
{
}
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
948 posts
Joined: April 2008
Offline
Nice! Thanks Dude!

I think I learned 2 things one you can´t use regular expression functions on VEX context and two there is always a VEX command that can do what expressions do right?

Thanks for the help again.
https://vimeo.com/user2163076 [vimeo.com]
  • Quick Links