-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command line build and test support #910
Conversation
…sts as required for pytest runner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make sure that the build scripts are fully functional on a fresh installation?
@@ -0,0 +1,54 @@ | |||
@echo off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I'm not having much luck with this build script, currently the solution fails to build on your branch using this script, but builds in Visual Studio without issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, and I have added command line arguments to the batch scripts which will allow different versions of Maya. I do not, however, have any version other than 2021 to test with, and am unsure if versions previous of python will support pytest (etc).
Please try and run the command as follows, and let me know if you continue to have problems:
(using an administrator cmd shell and within the Exporters\Maya directory)
cicd\batch\buildMaya2Babylon.bat MAYAVERSION
cicd\batch\testMaya2Babylon.bat MAYAVERSION
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you have added the msbuild.exe directory to system %PATH% as well. It is located in the visual studio install directory and is required to build solution files from a cmd shell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I must have had my path setup to use the wrong MSBuild, I also noticed I needed to install pip
for my mayapy distribution in order to run the test pass.
RaiseError("Stop the animation before exporting."); | ||
return; | ||
} | ||
// MGlobal.executeCommand("play -q - state", out int isPlayed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this stay comented? if so, then please remove it instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command appears to be used to stop playback before exporting begins and should probably be moved to AnimationForm.cs where it can be used as part of the windowed (in gui) export routine.
set mayaversion=%1 | ||
set mayalocation=%ProgramFiles%\Autodesk\Maya%mayaversion% | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is generally a good idea to put setlocal
at the beginning of a batch script to prevent variable leakage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the other batch script.
set assemblydir=%~dp0..\..\assemblies\2020 | ||
if exist "%assemblydir%" del /f /q "%assemblydir%" | ||
|
||
msbuild %solutionfile% /v:quiet /t:Rebuild /p:Configuration=Release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to check for errors after this. Usually goes something like this:
msbuild %solutionfile% /v:quiet /t:Rebuild /p:Configuration=Release | |
msbuild %solutionfile% /v:quiet /t:Rebuild /p:Configuration=Release | |
if errorlevel 1 goto :error |
Same goes for the copying. Not sure if the errorlevel is right for msbuild though. Hopefully, it returns an error code when it fails.
@rdurnin could you update with master, and I ll merge the branch in :-) |
Adding support for command line building and testing using mayapy (based on python 3.7.7).
Removed stop play state (MGlobal) command from BabylonExporter.cs as it is unavailable without the UI.
Added create directory call for non-existent export folders to BabylonExporter.cs.
Extending support for Arnold shader types during export (aiImage file type) for cleaner workflows.
Various python and batch files added for cli/cicd support.