后台使用Motionbuilder

问题描述

当使用脚本批量处理任务时,希望能用Motionbuilder后台执行一个python文件

解决方法

motionbuilder.exe -batch -s Script_Path

使用命令行标记

完整命令行标记一览

Flag Options

-help
    Displays this help information and exits. (also -?)

-batch
    Starts MotionBuilder in batch mode (without the UI). This flag is
    usually used for executing a Python script, which can be set with
    the -F flag.

-buildInfo
    Displays the MotionBuilder build information and exits.

-console
    (Windows only) This opens an output window used by FBTrace in the
    OR SDK, where the appropriate stdout/err stream goes. If you choose to
    use this console output window for Python output, you also need to use
    the -verbosePython flag.

-F [filename]
    This is an alternative way to open a file with MotionBuilder at
    startup. If this flag is omitted, you must specify the filename you
    want to open as the last parameter in the list.

-G [width] [height]
    Sets the window size of MotionBuilder to the values specified. The
    default state is maximized.

-S
    Starts MotionBuilder in full screen mode. This is equivalent to
    selecting Display > Full Screen inside the Viewer. To exit full screen
    mode, press Alt+Enter or Esc.

-suspendMessages
    Disables all the warnings and pop-up dialogs. This flag is useful for
    automation purposes when you do not want the script to be interrupted
    by dialog boxes. By default, all warnings and dialog boxes are shown.

-T[UI Name]
    Finds a tool with the matching name among the tools that MotionBuilder
    has registered, and if it is found, activates it. This flag parameter
    is case sensitive. Note: There is no space between the -T and the
    [UI Name] parameter.

-verbosePython
    Outputs all Python messages to the appropriate stdout/err stream. This
    puts the Python print messages to the window that you activate using
    the -console flag as well as to the Python Editor. This is the same
    location that FBTrace outputs to when using the OR SDK. By default,
    Python output is only presented in the Python Editor.

-3
    Enables warnings about features that will be removed in Python 3.0
    You can use this flag to see how much work will be necessary to port
    code to Python 3.0.

--sdk-begin & --sdk-end
    The SDK plug-in developers can access command line arguments within a
    pair of delimiters (--sdk-begin & --sdk-end). See the
    FBSystem::GetCommandLineArgs() function reference.

Usage Examples

Opens the scene contained in mia_blue.fbx on startup.

    motionbuilder.exe mia_blue.fbx


Launches in full screen mode and opens the scene contained in mia_blue.fbx.

    motionbuilder.exe -S mia_blue.fbx


Launches the script testScript.py on startup and suppresses all message
boxes that the script might generate.

    motionbuilder.exe -suspendMessages testScript.py


Launches the Audio tool located in the sample tools folder on startup.
Note: The Audio tool needs to be compiled first.

    motionbuilder.exe -TAudio


Launches the script Script.py and sends the output to the console output
window.

    motionbuilder.exe -console -verbosePython Script.py


Launches with an active window of 500x500, and opens the scene
mia_blue.fbx.

    motionbuilder.exe -G 500 500 mia_blue.fbx


Launches the console, the Python Editor tool, and opens the scene contained
in mia_blue.fbx. Note: The quotes surrounding "-TPython Editor" are there
to ensure the Python Editor tool is launched. Without these quotes, only
the Python tool would be launched, if it exists.

    motionbuilder.exe -console "-TPython Editor" mia_blue.fbx

Environment Variables

MB_CONFIG_DIR
    The directory specified in this environment variable determines the
    location where MotionBuilder configuration will be stored. If not set,
    configuration files will be stored in document or home directory.

MOTIONBUILDER_PLUGIN_PATH
    The list of directories contained in this environment variable
    determines the location from which MotionBuilder will load compiled
    plug-ins.

MOTIONBUILDER_PYTHON_STARTUP
    The list of directories contained in this environment variable
    determines the location from which MotionBuilder will load Python
    startup scripts.

MOBU_FBX_EXTENSION_PATH
    The list of directories contained in this environment variable
    determines the location from which MotionBuilder will load FBX MB
    extension plug-ins.

FILMBOX_CONSOLE
    (Windows only) Setting this environment variable to 1 allows the
    console to appear, otherwise the console will not appear.

K_NO_CRASH_RECOVERY
    (Linux only) Setting this environment variable to 1 enables the
    CrashRecoverySignalHandler, otherwise it is disabled.

MOTIONBUILDER_SAVELOAD_EMBEDMEDIAS
    This environment variable is used for overriding the corresponding
    setting in a configuration file. Any other value except Yes is
    considered as false.

MOTIONBUILDER_SAVELOAD_SHOWEMBEDMEDIASOPTION
    The ShowEmbedMediasOption preference item can be used in the SaveLoad
    section of a configuration file to control whether the Embed Medias
    checkbox appears in the Save dialog box. This environment variable can
    can also be used for overriding the corresponding setting in a
    configuration file. Any other value except Yes is considered as false.
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值