# 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.
# Script description:
# This script shows how to use the generic FBCreateObject function to create object that
# are not "officially" exposed to python. This allow creation of anything that is available
# in the Asset browser.
# Topic: FBCreateObject

from pyfbsdk import FBCreateObject

# FBCreateObject(GroupName, EntryName, ObjectName) has 3 parameters as input:
# GroupName: id of the group creation function. In asset Browser each group starts with "Browsing" (ex: Browsing/Templates/Elements)
# EntryName: This is id of the object to create. In Asset Browser this would be the name under the icon (ex: Cube)
# ObjectName: the name the object will have at creation

# Create a Cube named MyCube
cube = FBCreateObject( "Browsing/Templates/Elements", "Cube", "MyCube" )

# Creating a physic solver
solver = FBCreateObject( "Browsing/Templates/Solvers", "Physics Solver", "MySolver" )

# I M P O R T A N T   N O T E: Primitives are different, the name of the object MUST be the same name as the EntryName
cubeprimitives = FBCreateObject( "Browsing/Templates/Elements/Primitives", "Cube", "Cube" )
discprimitives = FBCreateObject( "Browsing/Templates/Elements/Primitives", "Disc", "Disc" )