Darrenm Hi Darrenm, James asked me to provide some insight hope it's helpful.
what would the command typically be to simulate a frame range and export the baked geometry as an alembic file?
The maya batch command you've specified should work and export out the alembic cache correctly assuming your license env var is setup correctly. As a general suggestion, it might be better to use mayapy for this purpose and supply it an export script. A minimal example:
import os
import sys
import maya.standalone
maya.standalone.initialize(name='python')
import maya.cmds as cmds
def export_cache(
in_file,
out_file,
start=cmds.playbackOptions(q=True, min=True),
end=cmds.playbackOptions(q=True, min=True),
objects=None
):
cmds.file(in_file, o=True, f=True)
if objects is None:
objects = cmds.select(cmds.ls(type="mesh"), r=True)
if not cmds.pluginInfo("AbcExport", q=True, loaded=True):
cmds.loadPlugin("AbcExport")
cmds.AbcExport(j='-sl -fr {} {} -uvWrite -worldSpace -file "{}"'.format(start, end, out_file))
print("Alembic export finished ===================================> {}".format(out_file))
if __name__ == "__main__":
_in_file = sys.argv[1]
_out_file = sys.argv[2]
_start = sys.argv[3]
_end = sys.argv[4]
export_cache(
_in_file.replace("\\", "/"),
_out_file.replace("\\", "/"),
start=int(_start),
end=int(_end)
)
Which can then be run in terminal as:
"path/to/mayapy" "path/to/export_script.py" "path/to/input_file.mb" "path/to/output_file.abc" 1 120
Also, do you have any experience or recommendations setting this up on GCP? Not sure if it's tricky to get the license server working on the Google Cloud Platform.
It is possible to setup a license server on a cloud instance on GCP and serve the licenses from there. We internally do the same thing in AWS. I should note that connections to that cloud instance should ideally be tunneled via a VPN. Otherwise, if the license server port were open to the internet it could potentially be used by others.
Your env var for the license would change from zivadyn_LICENSE=path/to/license.lic
to zivadyn_LICENSE=<port>@<license_server>
for instance: zivadyn_LICENSE=9999@gcp_instance.mydomain.com
(depending on the vfx version you're using and the license file, please replace zivadyn_LICENSE
with unitytech_LICENSE
where appropriate)
The environment variable can either be set from the commandline before calling maya batch or set inside the above export script. This will also work if you're using GCP instances to run the batch export as well.