API overview
For simplicity and ease of us, the SpeedTree Pipeline SDK API is encapsulated within a single header file, speedtree_pipeline_sdk.h
, that has no other include dependencies. The API is written in C, making it versatile and compatible across various development environments.
Structure and naming conventions
Given that the API is written in C, it does not utilize namespaces. Instead, a consistent naming convention is employed to ensure clarity and prevent collisions. Functions, structures, and enumerations are systematically prefixed with Stp or STP_ (SpeedTree Pipeline). This prefixing aids in maintaining a clear and organized codebase, especially when integrating the SDK into larger projects.
API features by category
The API offers a wide array of functionalities categorized into several groups:
Initialization and setup
Licensing and initialization:
StpInit()
StpShutDown()
StpGetLicenseStatus()
Context management:
StpNew()
StpDelete()
StpSetMaxCpuThreads()
StpSetMemoryMode()
Callback functions:
StpSetErrorFunction()
StpSetMessageFunction()
StpSetProgressFunction()
File operations
- Loading and saving models:
StpLoadSpeedTreeFile()
StpSaveSpeedTreeFile()
Geometry and manipulation
Geometry queries:
StpGetGeometry()
StpDeleteGeometry()
Geometry options:
StpInitGeometryOptions()
Model parameters:
StpSetResolution()
StpSetSeed()
StpSetSeason()
StpSetGrowth()
StpSetTopology()
StpGetResolution()
StpGetSeed()
StpGetSeason()
StpGetShowDroppedLeaves()
StpIsGrowthDefined()
StpGetNumGrowthFrames()
StpGetTopology()
StpIsLoaded()
StpGetMetadata()
StpGetWindMode()
Rules and modifications:
StpGetRules()
StpSetRuleAsFloat()
StpSetRuleAsBool()
StpSetRuleAsInt()
StpGetRuleDataTypeName()
Exporting
- Export functions:
StpExportForVfx()
StpExportForGames()
StpSetExportResourcePath()
StpGetExportResourcePath()
Wind shader management
- Real-time wind:
StpInitRealTimeWind()
StpTickRealTimeWind()
StpGetRealTimeWindConfig()