class GenerationProperties():
primitives = {
'sphere' : cmds.polySphere,
'geosphere' : cmds.polyPrimitive,
'cube' : cmds.polyCube,
'cylinder' : cmds.polyCylinder,
'cone' : cmds.polyCone,
'plane' : cmds.polyPlane,
'torus' : cmds.polyTorus,
'prism' : cmds.polyPrism,
'pyramid' : cmds.polyPyramid,
'pipe' : cmds.polyPipe,
}
def CreatePrimitive(self, primitiveType, subdivisionsX = 1, subdivisionsY = 1):
prim = self.primitives[primitiveType]()
#how can I refrence prim to change it's subdivisions after I created?
# cmds.'Type?'(prim, subdivisionsX, subdivisionsY)
fn = self.primitives[primitiveType]
xform, shape = fn()
fn(shape, e=True, sx=30)
prim = self.primitives[primitiveType]
cmds.setAttr("%s.subdivisionHeight" % prim[1], 30)
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/331d4f46-5bb2-45dd-9b9d-bde6b7caff91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/331d4f46-5bb2-45dd-9b9d-bde6b7caff91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0-txhFXCABd6-W2whij-cffCu5uTBGk5zST%3DsBHXQk5w%40mail.gmail.com.
Justin to the rescue again! Thanks so much man!
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/331d4f46-5bb2-45dd-9b9d-bde6b7caff91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0-txhFXCABd6-W2whij-cffCu5uTBGk5zST%3DsBHXQk5w%40mail.gmail.com.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAD4CW6%3DiavvS89wGMCVV%3DGt0Fof02epvXcnBsKGOKc7M_Dixg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/331d4f46-5bb2-45dd-9b9d-bde6b7caff91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0-txhFXCABd6-W2whij-cffCu5uTBGk5zST%3DsBHXQk5w%40mail.gmail.com.
--
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAD4CW6%3DiavvS89wGMCVV%3DGt0Fof02epvXcnBsKGOKc7M_Dixg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3Y1CLUVzss-Jts2kjQ74FjtB%2BAvV8zm6hiK%3D6poW%3D3jg%40mail.gmail.com.
I do have one last question since each polly command takes in multiple commands to settAttr [subdivisionsAxis, subdivisionsHeight, subdivisionsWidth, etc] It won't really help me to settAttr in a generic way.The lambda (if I understand it correctly):
fn = self.primitives[primitiveType] xform, shape = fn() fn(shape, e=True, sx=30)Fits perfectly for what I need, just one last question. How can I set the scale property from fn()? I cannot use scale as a flag, it's tossing a error 'No flag name 'scale'.
If it's also not too much to ask can I confirm the logic of those lines?I am assigning fn to the dictonary and then calling it as a function with the properties of Xform on the 'shape'?
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/331d4f46-5bb2-45dd-9b9d-bde6b7caff91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0-txhFXCABd6-W2whij-cffCu5uTBGk5zST%3DsBHXQk5w%40mail.gmail.com.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAD4CW6%3DiavvS89wGMCVV%3DGt0Fof02epvXcnBsKGOKc7M_Dixg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3Y1CLUVzss-Jts2kjQ74FjtB%2BAvV8zm6hiK%3D6poW%3D3jg%40mail.gmail.com.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAD4CW6%3DoLAD1C8paThXvq1M8PyhFnX_ccpooBLqMPNB3e9Viw%40mail.gmail.com.
Do you just mean scaling via cmds.xform() ? That should work with any of the objects.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/331d4f46-5bb2-45dd-9b9d-bde6b7caff91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0-txhFXCABd6-W2whij-cffCu5uTBGk5zST%3DsBHXQk5w%40mail.gmail.com.
--
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAD4CW6%3DiavvS89wGMCVV%3DGt0Fof02epvXcnBsKGOKc7M_Dixg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3Y1CLUVzss-Jts2kjQ74FjtB%2BAvV8zm6hiK%3D6poW%3D3jg%40mail.gmail.com.--
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 python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAD4CW6%3DoLAD1C8paThXvq1M8PyhFnX_ccpooBLqMPNB3e9Viw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3F-JsXtbcwJQwARnYz7i_sZ36G%2BPGD6UwW_gFy0SwpGw%40mail.gmail.com.
deletePriorHistory(dph) | boolean |
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/331d4f46-5bb2-45dd-9b9d-bde6b7caff91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0-txhFXCABd6-W2whij-cffCu5uTBGk5zST%3DsBHXQk5w%40mail.gmail.com.
--
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 python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAD4CW6%3DiavvS89wGMCVV%3DGt0Fof02epvXcnBsKGOKc7M_Dixg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3Y1CLUVzss-Jts2kjQ74FjtB%2BAvV8zm6hiK%3D6poW%3D3jg%40mail.gmail.com.--
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 python_inside_maya+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAAD4CW6%3DoLAD1C8paThXvq1M8PyhFnX_ccpooBLqMPNB3e9Viw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xkXvEPPRrzg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsubscribe@googlegroups.com.