Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Open Reality / Getting the opened file name
  RSS 2.0 ATOM  

Getting the opened file name
Rate this thread
 
24255
 
Permlink of this thread  
avatar
  • PerPixel
  • Posted: 18 March 2009 10:29 AM
  • Location: Montreal
  • Total Posts: 28
  • Joined: 18 February 2008 06:17 PM

I’m trying to write file expoter in motionbuilder 2009 and the exported file need to match name with the opened fbx file. Using the FBXFileName value in FBApplication work when the scene is opened from the File-> open menu but it return an empty String when the Fbx is opened from windows explorer…

Anyone as a workaround or a better way to get the current fbx scene name?

thx



Replies: 0
avatar
  • Neill3d
  • Posted: 19 March 2009 04:49 AM

Hi,

current scene name is holding in FBApplication’s property “FBXFileName”



Replies: 0
avatar
  • PerPixel
  • Posted: 20 March 2009 09:39 AM

I meant to say FBApplication and not FBFbxManager in my post.



Replies: 0
avatar
  • raitch
  • Posted: 20 March 2009 12:50 PM

Hello PerPixel,

In the example workflow you provided, I was able to get a proper return value from FBApplication().FBXFileName after dragging a file into MotionBuilder from Windows Explorer.  V7.5ext2b and V2009 tested.

I was using Python, not OR code but the behaviour should be the same but I would like to be able to verify that for sure.

Can you share a code snippet that illustrates this problem?

Thanks!



Replies: 0
avatar
  • PerPixel
  • Posted: 20 March 2009 07:15 PM

Dont drag it. Double click or launch motionbuilder with the fbx in command line. Dragging the file emulate the file->open behavior and it work just fine.



Replies: 0
avatar
  • Neill3d
  • Posted: 21 March 2009 04:10 AM

There is a way out - your plugin file is attached to the MoBu executing process. So, just run the GetCommandLine function to get the MotionBuilder startup command line.
For example,

LPSTR str = GetCommandLine();

Will return,
+ str 0x00051ee0 “"C:\Program Files\Autodesk\MotionBuilder 2009\bin\win32\motionbuilder.exe” d:\work\soldier.fbx” char *

After that U can devide string into the string array using for example CommandLineToArgv and you will get the fbx file name.



Replies: 0