Home Technical Talk

FBX + Mel Script issue

polycounter lvl 14
Offline / Send Message
sama.van polycounter lvl 14
Hi!

I'm actually working with the "2009.3" version of the FBX exporter on Maya...
First I was really surprised when I seen the "Maya Mel Scripting" section in the FBX documentation...

But is there no way to export a selection? :D

I already tried to add the "select -r" before the "FBXExport -f [filename]" function but it just exports the entire scene -___-.......


I tried to ask on : http://area.autodesk.com/forum/autodesk-fbx/
But when I start a new thread or create a new message that thing appears :
"You are in wrong section or you have no permissions to do that."



Does someone know how I could export a simple selection with mel scripting? ^_^...

Replies

  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    I would probably use the "file" command instead of the FBXExport command - you should be able to specify "exportSelected" and pass "FBX" as the file type. I think that'll work.

    You can still use the FBX scripting commands to set any preferences before exporting - usually I just set it up manually, save an "fbxexportpreset" file, and get the script to load this preset before exporting.
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    MoP wrote: »
    I would probably use the "file" command instead of the FBXExport command - you should be able to specify "exportSelected" and pass "FBX" as the file type. I think that'll work.

    You can still use the FBX scripting commands to set any preferences before exporting - usually I just set it up manually, save an "fbxexportpreset" file, and get the script to load this preset before exporting.

    No, this FBX exmport is too bad :)

    If you try that on a selection :
    file -f -typ "Fbx"  -es "c:/aaa.fbx" 
    

    He will open the exporter UI =____=.....
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Isn't there an FBX script option to hide the UI?
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    MoP wrote: »
    Isn't there an FBX script option to hide the UI?


    Hmmm nothing I know....

    Basically the FBXExport function is a entire mel function.
    We can't use it like :
    file -f -typ "FBXExport"  -es "c:/aaa.fbx"
    

    Maya doesn't understand it. only "FBX" works.

    Here are all the Mel function for the FBX exporter :
        * FBXExport -f [filename]
        * FBXExportAnimationOnly -v [true|false]
        * FBXExportApplyConstantKeyReducer -v [true|false]
        * FBXExportAxisConversionMethod [none|convertAnimation|addFbxRoot]
        * FBXExportBakeComplexAnimation -v [true|false]
        * FBXExportBakeComplexEnd -v [int]
        * FBXExportBakeComplexStart -v [int]
        * FBXExportBakeComplexStep -v [int]
        * FBXExportCacheFile –v [true|false]
        * FBXExportCameras -v [true|false]
        * FBXExportCharacter -v [true|false]
        * FBXExportColladaFrameRate [float]
        * FBXExportColladaSingleMatrix [true|false]
        * FBXExportColladaTriangulate [true|false]
        * FBXExportConstraints -v [true|false]
        * FBXExportConvert2Tif –v [true|false]
        * FBXExportDxfTriangulate [true|false]
        * FBXExportDxfDeformation [true|false]
        * FBXExportEdgeSmoothing –v [true|false]
        * FBXExportEmbeddedTextures -v [true|false]
        * FBXExportFileVersion [version]
        * FBXExportHardEdges -v [true|false]
        * FBXExportInAscii -v [true|false]
        * FBXExportLights -v [true|false]
        * FBXExportQuaternion -v [quaternion|euler|resample]
        * FBXExportQuickSelectSetAsCache –q
        * FBXExportQuickSelectSetAsCache –v “setName”
        * FBXExportScaleFactor [float]
        * FBXExportShapes -v [true|false]
        * FBXExportSkins -v [true|false]
        * FBXExportUpAxis [y|z]
        * FBXImport -f [filename] -t [take index]
        * FBXImportAxisConversionEnable –v [true|false]
        * FBXImportCacheFile –v [true|false]
        * FBXImportCameras -v [true|false]
        * FBXImportCharacter -v [true|false]
        * FBXImportConstraints -v [true|false]
        * FBXImportConvertDeformingNullsToJoint -v [true|false]
        * FBXImportDxfWeldVertice [true|false]
        * FBXImportDxfReferenceNode [true|false]
        * FBXImportDxfObjectDerivation [layer|entity|block]
        * FBXImportEdgeSmoothing –v [true|false]
        * FBXImportFillTimeline
        * FBXImportHardEdges -v [true|false]
        * FBXImportLights -v [true|false]
        * FBXImportMergeBackNullPivots -v [true|false]
        * FBXImportMergeAnimationLayers -v [true|false]
        * FBXImportMode -v [exmerge|add|merge]
        * FBXImportOverrideNormalsLock -v [true|false]
        * FBXImportProtectDrivenKeys -v [true|false]
        * FBXImportQuaternion -v [quaternion|euler|resample]
        * FBXImportResamplingRateSource -v [Maya|FBX|Custom]
        * FBXImportScaleFactorEnable [true|false]
        * FBXImportScaleFactor [float]
        * FBXImportSetMayaFrameRate -v [true|false]
        * FBXImportSetLockedAttribute -v [true|false]
        * FBXImportShapes -v [true|false]
        * FBXImportSkins -v [true|false]
        * FBXImportUpAxis [y|z]
        * FBXConvertUnitString [mm|cm|m|km|in|ft|yd|mi]
        * FBXGetTakeComment [index]
        * FBXGetTakeCount
        * FBXGetTakeIndex [take name]
        * FBXGetTakeLocalTimeSpan [index]
        * FBXGetTakeName [index]
        * FBXGetTakeReferenceTimeSpan [index]
        * FBXLoadExportPresetFile -f [filepath]
        * FBXLoadImportPresetFile -f [filepath]
        * FBXRead -f [filename]
        * FBXResetImport
        * FBXResetExport
        * FBXResamplingRate -v [float]
    
    

    Then the main question could be : why I can't export only one object with this set of function? O_o?


    In your maya you can try something like that:


    string $selection[] = `ls -sl -l`;

    for ($i=0;$i<`size $selection`;$i++)
    {
    select -r $selection[$i];
    FBXExport -f ("c:/" + $i);
    }

    (if I had the ["code"] stuff on it polycount will crash :D )

    ... and you will see all your *.fbx files will content the full scene....
  • sama.van
    Options
    Offline / Send Message
    sama.van polycounter lvl 14
    eh!! Technical polycounter!!!

    Documentation have beed updated on the 2010 version!!!!

    http://images.autodesk.com/adsk/files/autodesk_maya_fbx_plug-in_help_2010.pdf


    It sound great ^_^,.,.. I will try that.....
    FBXExport -f [filename] [-s]
    Exports the specified file.
    Add the -s flag if you want to change the export process so it exports the
    selected objects instead of an “export all” operation.
    For example:
    FBXExport -f myfile.fbx -s

    Oh gonna rain shit tonight!!!!

    one year I was waiting for this shit!!!!!!!!!!!!!!!!!!!
  • Flynny
    Options
    Offline / Send Message
    Flynny polycounter lvl 9
    Not to raise a thread from the depths but I think is too useful to miss out on! For ages ive been trying to get deeper into the use of FBX in the pipeline im creating here, but ive always found some options tucked away just out of reach..

    Use this to set previously unavailable commands on an fbx export via command line!

    FBXproperties command described here : http://download.autodesk.com/global/docs/maya2014/en_us/files/GUID-76CF67F4-BBBB-48C6-AE48-6EF6975CB870.htm

    Enjoy
Sign In or Register to comment.