# Copyright 2009 Autodesk, Inc.  All rights reserved.
# Use of this software is subject to the terms of the Autodesk license agreement 
# provided at the time of installation or download, or which otherwise accompanies
# this software in either electronic or hard copy form.
#
# Topic: FBCharacterExtension
#

from pyfbsdk import FBModelList, FBGetSelectedModels, FBCharacterExtension

# Create an empty FBModelList object.
lModels = FBModelList()

# Obtain the list of selected models.
FBGetSelectedModels( lModels )

lModelCount = len(lModels)
if (lModelCount > 0):
        # Create an Empty FBCharacterExtension Object
        lCharacterExtension = FBCharacterExtension("Character Extension")

        # Add Object and TR Properties To Character Extension
        for lModel in lModels:
                lCharacterExtension.AddObjectProperties(lModel)
                lCharacterExtension.AddObjectDependency(lModel)

                # For Cleanup.
                del( lModel )

        # If Cleanup.
        del ( lCharacterExtension )

# Cleanup of local objects.
del( lModels, lModelCount )

# Cleanup of imported modules.
del( FBModelList, FBGetSelectedModels, FBCharacterExtension )