• projects
  • about me
  • note

  • projects
  • about me
  • note

Maya-3DsMax Pipeline Tool

2020-10-11

Python, MaxScript, FBX SDK, Maya, 3Ds Max

PipelineTool

Maya-3DsMax Pipeline Tool

Python, FBX SDK, Maya, 3Ds Max, Maxscript


Introduction:
It’s a batch process tool that can transfer animation data from Maya to 3Ds Max using Python, FBX SDK and MaxScript. The tool would keep the size of mesh, skeleton and skin of characters the same when Maya and 3Ds Max has different units.

  1. Choose FBX output path first.
  2. Select output options.
  3. Select filtered object type from available type list by double click or arrow key.
  4. Select other options, like removing template or empty group.

How to transfer command from Maya or any other software to 3Ds Max:

If the 3Ds Max is not opened, I will open the Max with the following script to open the FBX file:

1
2
3
4
5
6
7
8
9
10
# The path that contains the fbxPath.txt
dirPath = os.path.dirname(os.path.realpath(__file__)) + '\\'
fbxFile = "fbxPath.txt"
with open((dirPath + fbxFile), "r") as f:
pathName = f.read()
f.close()
if pathName:
# Import FBX file into 3ds Max using FBXImporter
MaxPlus.Core.EvalMAXScript('FbxImporterSetParam "ConvertUnit" "m"')
MaxPlus.Core.EvalMAXScript('importfile "%s" #noPrompt using:FBXIMP' % pathName)

3Ds Max will run a script automaticaly to create a thread(SynchronizingBackgroundWorker) and TcpListener(Net.Sockets.TcpListener) when the Max starts. Then to start the listener and accept(theTcpListener.AcceptSocket the pending client connection and returns a socket for communication. The socket will receive data from external program in a for loop. Converting socket bytes to string. Finally, the command string will be executed if the received data is not empty.

1
2
3
4
5
6
7
8
9
10
11
12
13
while theString!="exit" do
(
try(
theByteStream = DotNetObject "System.Byte[]" 4096
result = theSocket.Receive theByteStream
ascii_decoder = dotNetObject "System.Text.ASCIIEncoding"
theString = ascii_decoder.GetString(theByteStream) -- Convert bytes to string
s.ReportProgress(0)
)catch (
format "*** % ***\n" (getCurrentException())
exit
)
)
1
2
3
4
5
6
7
8
9
10
11
12
if theString != "" do
(
try (
isRunning = true
execute theString
theString = ""
isRunning = false
return true
) catch (
return false
)
)
  • 2020
  • Maya
  • Python

扫一扫,分享到微信

微信分享二维码
AR - Lens Studio
Maya Animation Plugins
© 2025 Xicheng Wang
Hexo Theme Yilia by Litten