Mel command:
getApplicationVersionAsFloat
El 12/07/2016 08:11, "Geordie Martinez" <[email protected]>
escribió:
> Here is one way to use regex. it’s not super elegant, but it gets the job
> done.
> hope this helps.
>
> import re# get combinations of 4 numbers in a row like 2014, 2015, 2016, etc.
> pattern = re.compile(r'''.*(\d{4})''')
> res = pattern.search(mc.about(v=True))if res.groups():
> print("version {0}".format(res.groups()[0]))
> else:
> print("this doesn't give me a version")
>
>
>
> On Mon, Jul 11, 2016 at 2:43 PM, likage <[email protected]> wrote:
>
>> I was wondering what is the best way that I can grab the year of the Maya
>> version and just the year that I am using - eg. 2012, 2014 etc?
>>
>> I know that there is a command - cmds.about(v=True) which returns me
>> 'Extension for Autodesk Maya 2014 Service Pack 2' but any ideas in which I
>> can improve on it?
>>
>> --
>> 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/7c3cafbc-6b19-47b0-b864-9d541bc3e7c6%40googlegroups.com
>> <https://groups.google.com/d/msgid/python_inside_maya/7c3cafbc-6b19-47b0-b864-9d541bc3e7c6%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/CABPXW4gS5yP4OzZp%3D8EW5zdqLTg5ZX44%3D9gHw3_j%3DMgVM-tpvQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CABPXW4gS5yP4OzZp%3D8EW5zdqLTg5ZX44%3D9gHw3_j%3DMgVM-tpvQ%40mail.gmail.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/CAFzJ14VB3et%3DPoVCwK_dmNAFVPsOuGn0jbBwnP0oZ-XW6ASW5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.