【问题标题】:3dsmax: How to use cmd to simulate Drag and Drop mxs from explorer to 3dsMax?3dsmax:如何使用 cmd 模拟从资源管理器拖放 mxs 到 3dsMax?
【发布时间】:2015-03-20 14:19:33
【问题描述】:

我希望找到一种更简单的方法将 maxscripts 从 max 之外“发送”到 max 以更新帧范围和其他一些项目。

我已经为我们的大多数主要 mxs 工具编写了一个浮动器,但希望为我们可能从外部应用程序生成然后“注入”到 Max 中的脚本提供一些额外的灵活性。希望使用命令行调用来执行 .ms 文件的“拖放”。

我看到线程(和文档中)讨论了 max 的内部 DnD,但从外到内却被难住了,提前感谢您的帮助!

【问题讨论】:

  • 你的意思是像3dsmax -U MAXScript rendercams.ms(即Running Scripts from the Command Line)吗?
  • @swordslayer:感谢您的提问,但我希望在打开时将 .ms 发送到 max,而不是在我启动 max 时(我认为 '3dsmax -U' 是用于)?我希望在打开时使用 windows cmd 将脚本拖放到最大。 :)

标签: command-line drag-and-drop 3dsmax maxscript


【解决方案1】:

您可以为此使用 OLE 自动化。首先,您需要公开fileIn 函数。将此脚本放在启动文件夹中:

registerOLEInterface #(fileIn)

然后使用您选择的编程/脚本语言创建命令行工具。假设在 pywin32 的帮助下在 python 中,这将是 maxOLE.py 的内容:

import win32com.client
import sys

conn = win32com.client.Dispatch("MAX.Application")
conn._FlagAsMethod("fileIn")
conn.fileIn(sys.argv[1])

和命令行调用:

python maxOLE.py "C:/Scripts/script.ms"

或从该外部应用程序将文件路径直接传递给conn.fileIn。当然,您也可以公开execute 函数并使用它来传递其他命令。

【讨论】:

  • Swordslayer,太棒了,我今天会跳进去。感谢您与他人分享您的才能和知识!
猜你喜欢
  • 2013-08-02
  • 1970-01-01
  • 2011-04-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-03-03
  • 1970-01-01
  • 2020-10-29
相关资源
最近更新 更多