My first question on here after lurking for a long time whenever I need help!
First of all, sorry for the confusing title! My question is quite specific and didn't know how to sum it up!
I just want you to know that I am not a programmer. I only learn coding in the context of the software I use for my VFX work, that being, python for Maya.
While I am quite comfortable with python for Maya, I am now trying to write a script (on Windows exclusively) that requires a functionality that isn't built in Maya:
After collecting the textures paths used in the Maya scene, which I can do within python, I need to resize these images and save them as a different format
And the way I'm thinking of approaching this is using imagemagick, an image editor that runs from command prompt. I would create a .bat file containing the commands to run, using the textures paths collected as parameters, and then I would call that .bat file in my python script.
What I did so far is installing imagemagick, and testing its functionality from command prompt. I also created the batch file and made sure it works. Lastly I created a python script that calls this file.
Here is what my batch files looks like:
magick convert %1 %2
magick mogrify -resize 500x500 %2
pause
pause being there to be able to see what's being executed.
And here is the python code I'm using:
import os
os.system("C:/users/Jay/Desktop/resize.bat %s %s" %(param1, param2))
param1 and param2 being two variables containing the textures paths as strings.
When I run the above code from the "Python (command line)" on windows, it works just fine and completes its job successfully.
However, when I try to run the same script from within Maya, I get this error:
'magick' is not recognized as an internal or external command, operable program or batch file.
Any reason why magick is not being recognized when running from within Maya? Is there any way to solve that?
I'm sorry for the long question! I'm just trying to be clear! And thank you in advance!