Skip to content

About

SketchFab exporter for DEM.Net

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

SketchFabApi.Net

SketchFab exporter for any GLB model

See it live on https://elevationapi.com by exporting to SketchFab and sharing your models to the World!

Setup

// Registers SketchfabApi and its HttpClient (10 min timeout for large uploads).
// The returned IHttpClientBuilder can add handlers, change the timeout, etc.
services.AddSketchfabApi();

Every method takes an optional CancellationToken. JSON is handled with System.Text.Json (source-generated); the library no longer changes the global JsonConvert.DefaultSettings.

Operations

Model

// Upload model (the file is streamed from disk)
Task<SketchfabUploadResponse> UploadModelAsync(UploadModelRequest request, string sketchFabToken)

// Update model tags and categories
Task UpdateModelAsync(string modelId, UpdateModelRequest request, string sketchFabToken, TokenType tokenType)

// Get model information
Task<Model> GetModelAsync(string modelId, string sketchFabToken, TokenType tokenType)

// Get all models as an enumerable (fetches though pages)
IAsyncEnumerable<Model> GetMyModelsAsync(string sketchFabToken, TokenType tokenType)

// Get model ready state
Task<bool> IsReadyAsync(string modelId, string token)

Account

// Retrieves account information
Task<Account> GetMyAccountAsync(string sketchFabToken, TokenType tokenType)

// Like a model
Task PostLikeAsync(string modelId, string sketchFabToken, TokenType tokenType)

Collections

// Get user's collections (all pages)
Task<List<Collection>> GetMyCollectionsAsync(string sketchFabToken, TokenType tokenType)

// Add model to collection
Task AddModelToCollectionAsync(string collectionId, string sketchFabToken, TokenType tokenType, params string[] modelIds)

Work in progress, I'll let you know when it's ready

  • Upload model
  • Update model
  • Add model to a collection
  • Get my models, (with generic paging)

About

SketchFab exporter for DEM.Net

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages