Home Technical Talk

scripts in custom marking menus

dlz
dlz
polycounter lvl 4
Offline / Send Message
Pinned
dlz polycounter lvl 4
Hi, 
I created a custom marking menu with some items wich 2 of them are custom scripts in python i made.
The actions of that marking menu that are already in maya worked nice but when i click in the custom scripts it shows that message: // Error: Line 1.0: invalid directive 
I dont know what happens since the script in custom shelves (not marking menus), worked.

Replies

  • throttlekitty
    Options
    Offline / Send Message
    How are you calling the python script in your marking menu? Usually it should be something like this for a script with a single function, a MM can only use mel, so we use `python` to call python scripting inside mel.

    python(import "myScript");

    Or like this for when you want to call a main function :

    python(import "myScript.");python("myScript.mainFunction()");

  • dlz
    Options
    Offline / Send Message
    dlz polycounter lvl 4
    Thanks for the answer! 
    I think the problem is what you said because i import the comands directly by dragging the button from the shell to the marking menu directly.

Sign In or Register to comment.