After a second, and Justin’s read it occurred to me that though my example
answers your question on how to pass flags via a list, it doesn’t work. You
would have to either do it the way Justin said, or use a dictionary and the
double-star.

attrs = {"constructionHistory": True,
         "gravity": True,
         "gravityY": True,
         "gravityZ": True
}

pm.polyExtrudeFacet(**attrs)

A single star will “expand” a list into individual arguments, whereas the
double-star will expand a dictionary into keyword-arguments.

Expanded, it would look like this:

pm.polyExtrudeFacet(constructionHistory=True, gravity=True, ...)

Whereas the expanded list above looks like this:

pm.polyExtrudeFacet('constructionHistory', 'gravity', 'gravityY', ...)

Which is why it wouldn’t work. :)

Best,
Marcus
​

On 16 October 2014 14:38, Sam555 <[email protected]> wrote:

> Thank you to both of you,
>
> i need to fully grasp the use of dict, they seems so useful in so many
> case.
>
> Thanks again.
>
> Solved.
>
> --
> 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/2bcc0f3b-352c-4144-8ca6-86d3dc4b607b%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/2bcc0f3b-352c-4144-8ca6-86d3dc4b607b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
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/CAFRtmOCFyBAZaz6PuA%3D%3DF0H2goMwq_nmE0c2do79%3Dm0BE3B7_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to