See the inputComponents attribute of the polyChip node.
cmds.getAttr("polyChip1.inputComponents")# Result: [u'f[202]',
u'f[239]', u'f[241]'] #
*Example*
sphere, _ = cmds.polySphere()
cmds.select(
sphere + ".f[202]",
sphere + ".f[239]",
sphere + ".f[241]"
)
chip = cmds.polyChipOff()
faces = cmds.getAttr(chip[0] + ".inputComponents")
cmds.select(
sphere + "." + faces[0],
sphere + "." + faces[1],
sphere + "." + faces[2]
)
Normally, components affected by polygon modifications - like soft
modification, skinning, extrude etc - are stored in an invisible objectSet
node, which I was looking for at first. But as it didn’t have any, I knew
it must have been stored internally. In this case, it looks to be a
compound string attribute.
On 25 December 2017 at 00:22, <[email protected]> wrote:
> Den fredag 22 december 2017 kl. 19:56:18 UTC+1 skrev vince touache:
> > I'm not sure I understand what you want to achieve, but can't you use
> the python version instead of the mel one ?
> > a = cmds.polyChipOff(dup=False)
> > b = cmds.polySeparate(your_mesh)
> >
> > this way, you get a proper return value in a and b that you can work
> with.
> > What do you need to do exactly ?
>
> This is what I want to achieve: https://i.imgur.com/ZlZIe3t.jpg
>
> Using polySeparate causes a bunch of problems. I get this result:
> https://i.imgur.com/917NFMA.jpg (and yes using the the mel command gives
> the exact same result)
>
> As you can see, Maya gives me three objects and I do not know which one is
> the original sphere. Sometimes its the one named PolySurface1, on a
> different model it might be the last one. Maya is not consistent.
>
> I did sort of solve it though by duplicating the entire mesh and deleting
> the inverted selection. However I do not really like this method as it can
> be slow. So I would like to be able to read the node data and just SEE what
> faces
>
> --
> 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/82dcc486-a108-40b0-9267-
> 0aa1f5d6b2ea%40googlegroups.com.
> 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/CAFRtmODSk9yJG36JoVX4848b7g6dY%3D7S6rOEibACvxFLtKNx%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.