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® / Python / Save selection, difference between menu and python command
  RSS 2.0 ATOM  

Save selection, difference between menu and python command
Rate this thread
 
45941
 
Permlink of this thread  
avatar
  • Total Posts: 4
  • Joined: 21 June 2010 06:30 AM

Got two groups I wish to export as a selection.

If I halt the script after the selection of the groups and do “Save Selection” from file menu I save a correct fbx.
If I use FBFbxManager as in my script bellow it exports the whole scene.

Why the difference?

Using 2011 x64

from pyfbsdk import *
from pyfbsdk_additions import *
import subprocess
import os
.path
import os
import shutil
import stat
import tempfile 

def clearSelection
():
    
# Get selected models
    
modelList FBModelList ()
    
FBGetSelectedModels (modelListNoneTrue)
    
    
# Deselect models
    
for model in modelList:
        
model.Selected False 
 
def FBGetGroups
groupName ):
    
#List Groups
    
lScene FBSystem().Scene
    GrpParent 
None
    GroupList 
lScene.Groups
    Grpbool 
False
    
for Grp in GroupList:
        if 
Grp.Name == groupName:
            
GrpParent Grp
            GrpName 
GrpParent.Name 
            Grpbool 
True
            
break
        
    return 
Grp
 
 
def SaveSel
():
 
clearSelection()
 
 
 
Grp FBGetGroups"CharacterOne_Export_Save_Selection" 
 for 
GroupItem in Grp.Items
 
GroupItem.Selected True 
 
print "Selecting " GroupItem.Name
 Grp 
FBGetGroups"CharacterTwo_Export_Save_Selection" )
 for 
GroupItem in Grp.Items
 
GroupItem.Selected True 
 
print "Selecting " GroupItem.Name
 lManager 
FBFbxManager()

 if 
lManager.SaveBegin(r'c:\save_selected_example.fbx'):
 
# Set the Selected option
 
lManager.UseASCIIFormat True
 lManager
.SaveSelectedModelsOnly True

 
# There is no point in saving all the system information...
 # We just want the selected models.
 
lManager.BaseCameras False
 lManager
.CameraSwitcherSettings False
 lManager
.CurrentCameraSettings False
 lManager
.GlobalLightingSettings False
 lManager
.TransportSettings False

 
# Perform the save
 
lManager.Save()

 
lManager.SaveEnd()


Replies: 1
/img/forum/dark/default_avatar.png

FBFbxManager is a deprecated function in 2011… please use FBApplication() instead…

Author: CPaulin

Replied: 05 August 2010 04:47 AM  
avatar

Thank you

With FBApplication I get a Save as popup, is there anyway to get rid of it?



Replies: 0
avatar

See this thread… It appears that it’s a bug in MotionBuilder 2011… Very bloody annoying!



Hugh Macdonald
Nvizible Visual Effects

Replies: 0
avatar

walfridson 11 August 2010 07:25 AM

Thank you



With FBApplication I get a Save as popup, is there anyway to get rid of it?

Autodesk has a hotfix for this. Try to ask autodesk support about this. =)



Replies: 0
avatar
  • Ollie_D
  • Posted: 06 October 2010 11:59 AM

I have also just come across this.  I need to save out many files depending on a selection I manage in script.  Combined with the fact you can not set options for FileExport makes it a real road block.  Anyone know when this fix is going to be released?



Replies: 1
/img/forum/dark/default_avatar.png

Hi,
I asked Autodesk regarding this bug few months ago, no answer.
Is there anybody from Autodesk around here to reply?

Thank you

Author: tower2009

Replied: 13 October 2010 11:18 PM  
avatar
  • steebu
  • Posted: 03 December 2010 11:11 AM

Does anyone know if this issue exhibits itself using ORSDK?



Replies: 0