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 / Accessing the device's name in the navigator panel
  RSS 2.0 ATOM  

Accessing the device's name in the navigator panel
Rate this thread
 
17874
 
Permlink of this thread  
avatar
  • zozizozu
  • Posted: 15 October 2008 02:36 AM
  • Total Posts: 9
  • Joined: 08 October 2008 03:47 PM

Hi,
i’ve successfully build a device that i can rename, including markers’ names and binded model’s name.
Now i’d like the name of my device that appear in the navigator panel to match the real name of it.
Because my english is very limited, this screenshot will explain better than i: FbDeviceName.jpg

My device is called gudd.dll, and is define with #define gudd__CLASSSTR “gudd” ( this to explain (i think ) the name on the screenshot ) .

I also tried to do this with python, but i didn’t find any exemple of this, neither in c nor python .

Thanks for your time
Regards



3o3i

Replies: 0
avatar
  • zozizozu
  • Posted: 17 October 2008 07:22 AM

Hi, i didn’t found how to rename the device in c, but it’s easy in python, so i tried

mApp.ExecuteScript("myscript.py nameAsArg");

but it look that ExecuteScript() do not accept arguments…
So i decide to build the .py :

FILE fichier=fopen("myscript.py","w");
    
fprintf(fichier"from pyfbsdk import *\n\n");
    
fprintf(fichier"i=0\nwhile 1:\n\ttry :\n\t\tdevName = FBSystem().Devices[i].Name\n");
    
fprintf(fichier"\t\tif devName == \"Gudd\":\n\t\t\tFBSystem().Devices[i].Name = \"");
    fprintf(fichier, FBString(GetDevName()));
    fprintf(fichier, "
\"\n\t\t\tbreak\n");
    
fprintf(fichier"\texcept:\n\t\tbreak");
    
fclose(fichier);

    
mApp.ExecuteScript("myscript.py");

That is perfectly working, for the rename, but when mobu is refreshing (modifie parametter, new scenne, ...), the ram is growing until it crash.
Moreover, i can’t load a scenne where the name was changed.

Any comments, ideas, or everything will be very helpfull for me to understand this ....

Thanks



3o3i

Replies: 0