Wow. Very observant. That fixed it. *Thank you!!!*
On Sunday, October 23, 2016 at 3:43:35 PM UTC-7, Justin Israel wrote: > > > > On Mon, Oct 24, 2016 at 11:23 AM Kevin C. Burke <[email protected] > <javascript:>> wrote: > >> Hello, >> I'm missing something fundamental about retrieving objects by their node >> type and I could really use some guidance. >> >> When I instantiate an object, I'll create the object and assign it a >> variable like so: >> >> my_curve = mc.curve(name="my_curve",d=1,p=[(0,0,0),(1,1,1),(2,2,2)]) >> >> #print my_curve.getCVs(space="world") <-----my_curve is seen as a >> Transform, so getCVs doesn't work >> curveList = pm.ls("my_curve") >> print curveList[0].getCVs(space="world") >> >> For some reason, the variable *my_curve *isn't seen as a NurbsCurve node >> (it's seen as a Transform), but when I use the PyMel list command, it >> returns an indexed object that is recognized as a NurbsCurve. >> >> What am I missing? This would clear up a lot of my thinking about PyMel >> scripting. >> > > Is "mc" in this case "maya.cmds"? If so, you are getting back a string and > not a PyMel object. > > I am guessing what you really wanted is this: > > my_curve = pm.curve(name="my_curve",d=1,p=[(0,0,0),(1,1,1),(2,2,2)]) > > ... where you are calling the pymel curve() command and not the Maya > commands module. This returns a Pymel object as you wanted. > > Justin > > > >> Thank you! >> >> -- >> 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] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/253da47c-a9fa-492b-a533-2bb23f8fbabb%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/253da47c-a9fa-492b-a533-2bb23f8fbabb%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/d4ffdf3d-771b-4105-80e1-9c76f37e416a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
