Load 3D models from CGTrader into mixed reality controls (preview)
[This article is pre-release documentation and is subject to change.]
Important
This is a preview feature.
Preview features aren’t meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.
Want to build apps with mixed-reality 3D content without having to create your own 3D models? Use the CGTrader connector to import 3D content from CGTrader into your canvas apps. CGTrader offers a library of thousands of free and premium 3D models. Browse and load models inside your app, and then use them with the 3D object and View in MR controls.
The connector provides a no-code replacement for working with the CGTrader API. Using actions, apps send requests to the CGTrader API and fetch model data. For more information, see the Connectors overview.
Prerequisites
Request an API key (OAuth client ID and client secret) at https://www.cgtrader.com/developers. Be sure to store your API key in a secure location.
Create a CGTrader connection
You'll need to create a CGTrader connection in Power Apps after you receive your API key. In this example, we'll create a connection on the Power Apps home page. You can also create a connection when you're editing an app in Power Apps Studio.
Tip
A connection is an instance of a connector. You can create multiple connections with different configurations.
Sign in to Power Apps.
In the navigation bar, select Data > Connections > New connection.
Search for and select CGTrader (preview).
Enter the Client ID and Client Secret you received from CGTrader.
A CGTrader connection is now listed on the Connections page.
Add a CGTrader connection to your canvas app
Edit or create a canvas app.
In the navigation bar, select Data > Add data. Search for and select CGTrader.
Select the connection you created earlier.
Load CGTrader models directly into 3D object or View in MR controls
Find and select a model on the CGTrader website.
Note the supported file types and Model ID.
In Power Apps Studio, add a 3D object or View in MR control to the app screen.
Set the control's Source property to CGTrader.GetModel(model_id, "file_type"), where model_id is the ID of the model you selected, and file_type is one of the supported file types.
Connector actions
The following table lists the most common CGTrader connector actions and examples. For a list of all connector actions, their parameters, and return types, see the CGTrader connector reference.
Action | Description | Example |
---|---|---|
GetModel | Downloads a 3D object with the given Model ID and file type. | CGTrader.GetModel(model_id, "file_type") |
GetModelInfo | Gets information about a 3D object with the given Model ID. | CGTrader.GetModelInfo(model_id) |
SearchModels | Searches for models from CGTrader based on the given filters. Consider binding this action to the items in a gallery. | CGTrader.SearchModels({keywords:"keywords",extensions:"file_types"}).Models |
GetCategories | Gets available category names and Model IDs. | CGTrader.GetCategories() |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for