Skip to content
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

Merged
merged 6 commits into from
Jan 7, 2021
Merged

Conversation

rdurnin
Copy link
Contributor

@rdurnin rdurnin commented Dec 8, 2020

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.

Copy link
Contributor

@Drigax Drigax left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Comment on lines +12 to +14
set mayaversion=%1
set mayalocation=%ProgramFiles%\Autodesk\Maya%mayaversion%

Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Contributor

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:

Suggested change
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.

@sebavan
Copy link
Member

sebavan commented Dec 23, 2020

@rdurnin could you update with master, and I ll merge the branch in :-)

@Drigax Drigax merged commit ebde260 into BabylonJS:master Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants