On Thu, 8 Sep 2016, 6:54 AM likage <[email protected]> wrote:

> I tried to tweak the code a bit so that it will register version padding -
> eg. abc_001, abc_002 where in my code I am using something like
> uniqueNamePattern("abc_{0}{0}{0}")
>
> While it seems to work in a sense, I got abc_111, abc_222 instead... Also
> I tried something like uniqueNamePattern("abc_00{0}")
> However, say if I have 12 of the same items and as I execute the code,
> instead of getting abc_010 or abc_011, I got abc_0010, abc_0011
>
> Can someone shed some light to me?
>

Your approaches have tried to format either 3 independent counter numbers
into the string (the same number 3 times) or uses 2 fixed 0 characters that
never change

If you are using my custom counter suggestion, try updating the format
string like this

uniqueNamePattern("abc_{0:0>3}")

That says to pad the number with 0, right aligned, with a width of 3

-- 
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/f45bea80-1f80-4552-a1fc-796efe4ddbae%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/f45bea80-1f80-4552-a1fc-796efe4ddbae%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1SV58q92NQ2xizLx0HW5oTNva%2BS2zvU1Gauxx84BuBoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to