http://pastebin.ubuntu.com/24337966/
This is the original snippet, It does the job but I still doubt with it.. I made a UI interface that generate sphere and cube . I wrote this snippet so it will act only on cube and only will delete the selected cube as I have a list of cube that start with myCube,myCube1 and etc. I use the bug to ignore the error warning that i received .. like this ## Error: ValueError: file <maya console> line 14: No object matches name: myCube1Shape # not sure whether I did the right thing or misuse the handling exceptions. Thanks On Saturday, April 8, 2017 at 3:49:58 AM UTC+1, Justin Israel wrote: > > From a python standpoint, yes any value is allowed. From a Maya > standpoint, as you expected Maya will use * as a wildcard to match objects. > > Also, you have a bug in your example. obj is being shadowed by each value > in your loop, so the assignment to "object*" has no effect. > > Justin > > On Sat, Apr 8, 2017, 2:24 PM NAS18 <[email protected] <javascript:>> > wrote: > >> Hello, >> >> May I know is it suitable to use * as variable value >> >> http://pastebin.ubuntu.com/24337819/ >> >> The purpose function is to delete an selected object that prefix with >> myobj* and delete it. >> >> >> thank you so much >> >> regards >> >> Nurul >> >> -- >> 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/308b9f75-c0d0-4fd4-b48c-0a63921ec08d%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/308b9f75-c0d0-4fd4-b48c-0a63921ec08d%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/9d5254d0-15ab-46e8-ae3d-eeed67a9342c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
