Thanks for idea,
my need is more complex. I will use folder as an input. drag drop it on bat
file that points to python script. in structure dropped I will find all
files based on structure position those will be written into separate batch
commands into new bat file that runs after creation. and to this step I
need to assign python commands with arguments.

this is working I use it just I use mel as mid step

I just need to get the right syntax
-command “import fixIt; fixIt.whatTo(\”cat\”,\”dog\”)”

On Mon, 26 Sep 2022 at 23:56, Marcus Ottosson <konstrukt...@gmail.com>
wrote:

> If I was you, I’d turn that around.
>
>    1. Run script
>    2. Script opens file
>
> For example.
>
> *fixIt.py*
>
> # Gain access to maya.cmdsfrom maya import standalone
> standalone.initialize()
> # Use maya.cmds to do magicfrom maya import cmds
> cmds.file("d:/test.ma", open=True)
> print("Fixing it")
>
> That you could run as such:
>
> "c:\program files\autodesk\maya2023\bin\mayapy.exe" "d:/fixIt.py"
>
>
> On Mon, 26 Sept 2022 at 19:37, tomas mikulak <mikulakto...@gmail.com>
> wrote:
>
>> Hi,
>> I have a question about running python script on maya file opened with
>> batch mode.
>> So far I was calling mel that ran python, but now I see more simpler
>> solution with python.
>> let's say a want to open a file d:\test.ma and run a python script on it
>> called fixIt.py that has def whatTo(name, fixName)
>>
>> So I need to pass some arguments to this definition under script.
>>
>> so the syntax should be:
>> "c:\Program Files\Autodesk\Maya2018\bin\mayabatch" -batch -file "D:
>> test.ma" -command " "
>>
>> thanks,
>> tomas
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAEUzAD19O%3DZ8-7LnmSfp1-b0FzvBLfAREjzcLkXaktsvUOd-_A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAEUzAD19O%3DZ8-7LnmSfp1-b0FzvBLfAREjzcLkXaktsvUOd-_A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCOxpnvS3yUxbThrzmsuQa4xfX1VYVVgxqQGrRoR0E3Pg%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCOxpnvS3yUxbThrzmsuQa4xfX1VYVVgxqQGrRoR0E3Pg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAEUzAD0ECU77v4YP2DNekKGEvKNcgh7%2B_M0rbnh9%2BFs%2BvSTgPw%40mail.gmail.com.

Reply via email to