Message 1 of 2
How to get objects in a list which contains any regular expression ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello I am creating joints by given size and steps then I add circles (curve) for each. I need to connect rotation Attr like below to keep rotation with expected was since joints are connected like that. Now I want to select objects which has name gomi_MainBranc_+$branch_i+"_Circle" and plus ends with any number and here is an expected example: "gomi_MainBranch_0_Circle1967", "gomi_MainBranch_0_Circle1" so on...
What can I do to get those items in an array. I tried to use regular expression "*[0-9]". It is not recognized! There are items Called example "gomi_MainBranch_0_Circle1Shape". I do not want to get items with and different type or ending !
string $gomi_Circles[] = `ls ("gomi_MainBranch_"+$branch_i+"_Circle"+"*[0-9]")`; for($i = 0; $i < size($gomi_Circles); ++$i) { if($i < (size($gomi_Circles)-1)) { connectAttr(($gomi_Circles[($i)]+".rotate"),($gomi_Circles[($i+1)]+".rotate")); } }