You need to have the sub string where the numerical part is at the end
e.g. modlObj_artist_v1
Here is the sctipt.
string $curName = "modlObj_artist_v1"; // we will create nodes under this node so that we know they are unique string $parent = `createNode transform`; createNode -name $curName -parent $parent transform; // create it again so maya renames it with incremental suffix $newName = `createNode -name $curName -parent $parent transform`; // delete delete $parent; print $newName;
Though in my case I still need to extract version tag in order to check if its present.
hehe actually not a bad idea. Thanks for blogging. A lot of nice tidbits in here.
ReplyDelete