Hi Marcus, Thank you for getting back to me. Hmm, I think I will try out the button method as I hardly have any ideas to do the other methods you have suggested (mute the Maya etc.)
Right now I am in the midst of trying to figure how this code <http://www.creativecrash.com/maya/plugin/-chan-file-exporter-importer-with-nuke6x-point-cloud-importing/description#tabs> that I have managed to download from the web (could hardly figure it out what the developer was doing; most probably cause I do not have a solid understanding of the API stuff :x) and to rewrite it if possible and without the use of API since I am weak in it. But nonetheless, using this link <http://rajivpandit.wordpress.com/2012/10/31/your-first-maya-python-plug-in/> as the example, should I be using API I was wondering if I could code it in the following manner: - Create a new class or function def xxx() for the chan importer and other functions, UI etc - Have the functions all dropped into the scripted command? It will be something like this (Pardon for the very vague code): class scriptedCommand(OpenMayaMPx.MPxCommand): def __init__(self): OpenMayaMPx.MPxCommand.__init__(self) actionA() actionB() def actionA(): ... def actionB(): ... On Friday, September 5, 2014 4:50:17 PM UTC+8, Marcus Ottosson wrote: > > Hi likage, > > One way you might be able to achieve this is by replacing the Import menu > item with your own, and do your checking from there. If it isn't a chan > file, simply revert to Maya's defaults. > > Another way might be to have users use another button, such as "Import > Chan". This button would then be within your control, and you could pop up > your UI from there. > > Finally, you could try and get Maya to notify you whenever it imports a > file and for you to intercept what it is about to do next. If it's a chan > file, mute Maya and take over. Otherwise, let it pass. This is what I take > it you are attempting to do with the API, however I'd be careful about it > and instead try any of the two above approaches first. Simply because > altering the internal behaviour of Maya isn't always a good idea as you > might break things that Maya does on its own, such as when you paste curves > via the Channel Box. > > Best, > Marcus > > > On 5 September 2014 10:25, likage <[email protected] <javascript:>> > wrote: > >> I am pretty new to Maya Api and I am in the midst of editing or changing >> a code for this custom plugin. I was wondering if it is possible for the >> following scenario: >> >> >> - User import in a particular file format - .chan (Using File >> >> Import), assumingly the plugin is working? >> - Upon importing, an UI will be prompted when Maya 'detects' that >> user imports in this .chan format >> - In this UI, it will be doing some other stuff.. >> >> So my question would be the first 2 points, how do i code it in such a >> way that if this .chan format was imported and it will prompt up another ui? >> >> -- >> 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/da153073-a8e6-441d-868c-2bde8da819a6%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/da153073-a8e6-441d-868c-2bde8da819a6%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > *Marcus Ottosson* > [email protected] <javascript:> > -- 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/b6540f72-e237-4546-9026-23b59a49326d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
