Skip to content

Latest commit

 

History

History
90 lines (57 loc) · 2.48 KB

README.md

File metadata and controls

90 lines (57 loc) · 2.48 KB

Premake - Find FBX SDK

A premake add-on module helps to find the most suitable fbx sdk location to use.

Tested Platforms

  • Windows

Currently, you can reference CI status in project CatDogEngine/AssetPipeline.

Motivation

Autodesk FBX is an industry standard 3D model file format but FBX SDK is under a commericial license. Maybe not friendly to integrate sdk to your project directly.

Parse FBX ASCII file is also a solution to avoid sdk integration, such as Godot FBX importer and nem0/OpenFBX. But it costs much time and efforts.

How to use

  • Put this module under Premake Search Paths

  • Integrate it in your premake script

    find_fbxsdk = require("premake-findfbx")
  • In module scope

    -- [Optional] config module options
    find_fbxsdk.dump_information = true
    
    -- Check if module can find a valid sdk locatiion
    local sdkLocation = find_fbxsdk.get_sdk_location()
    local isValid = sdkLocation ~= nil and os.isdir(sdkLocation)

    Note that if you don't install fbxsdk in default location such as "C:\Program Files\Autodesk\FBX\FBX SDK\xxxx.x.x" in Windows. You have to use custom_sdk_directory option.

    find_fbxsdk.custom_sdk_directory = "D:/fbx"
  • In project scope

    -- Default options
    find_fbxsdk.project_config()
    
    -- With options
    -- find_fbxsdk.config_project({ static_runtime = false })

Then it will generate includedirs, libdirs, links, postbuildcommands which copy fbxsdk shared libs to your project build target's output directory.

Module Options

  • custom_sdk_directory
    • type : string
      • A valid abosulte directory path
    • default : nil
      • Search this path at first if not nil. Fallback to search system installed directories.
  • dump_information
    • type : boolean
    • default : true
      • true : Dump useful information such as include directories, link library paths for debug purpose.
      • false : No Dump

Project Options

  • copy_shared_libs
    • type : boolean
    • default : true
      • true : Copy shared libararies to your project build target's output directory.
      • false : No Copy
  • static_runtime
    • type : boolean
    • default : true
      • true : /MT
      • false : /MD