Compare String Array against @name on packed prims

   2633   4   0
User Avatar
Member
3 posts
Joined: Nov. 2014
Offline
Hello!

First time poster ~

I have a wrangle set after an assemble sop and am currently having success with:

string shatter_points = chs('Pieces_to_Break');
if(@name != shatter_points)
removepoint(0,@ptnum);

Where Pieces_to_Break can contain one name. Effectively this deletes all but the named packed primitive.

I'd like to amend this so that I can enter an array of pieces to “keep”. Any thoughts?

Thanks in advance!!
User Avatar
Member
8555 posts
Joined: July 2007
Offline
string pattern = chs('Pieces_to_Break');
if(!match(pattern, @name)) removepoint(0,@ptnum);

then you can enter piece names to keep in a pattern form or list
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
3 posts
Joined: Nov. 2014
Offline
Thanks Thomas!

This works perfectly ~
User Avatar
Member
948 posts
Joined: April 2008
Offline
if I have:

string obj_0 = point(0,'name',pt0);
string obj_1 = point(0,'name',pt1);

int = match(obj_0,obj_1);

It only returns zeros even thou I know that there are some points with the same name, what am I missing?

Thanks.
Edited by mzigaib - April 21, 2017 22:40:18
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
948 posts
Joined: April 2008
Offline
Nevermind, I found that the problem was that all the names were unique.
https://vimeo.com/user2163076 [vimeo.com]
  • Quick Links