Load models from CGTrader into mixed reality controls (preview)
[This article is pre-release documentation and is subject to change.]
- 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.
Microsoft Power Platform offers the CGTrader connector for connecting with CGTrader, a large source of free and premium (paid) 3D content with thousands of models. Content from CGTrader can be browsed and loaded from inside a canvas app, and then used within the View in 3D and View in MR controls.
Connecting to an existing 3D content database allows you to build apps with mixed reality without having to create your own 3D models.
Request access from CGTrader
CGTrader connector links to your CGTrader account, allowing you access to 3D models available to your CGTrader account, including purchased content.
To request access, contact CGTrader for Developers. CGTrader will review your information and contact you with an OAuth 2.0 API Key in the form of a Client ID and Client Secret.
Ensure you store the API key (Client ID and Client Secret) received from CGTrader in a secure location.
Create a new CGTrader connector
Follow these steps to create a new CGTrader connector after you receive your CGTrader API key.
Sign in to Power Apps.
Select Dataverse from the left-pane.
Select + New connection.
Search for and select CGTrader (preview).
Enter the Client ID and Client Secret received from CGTrader.
A new CGTrader connection is now listed on the Connections page.
Add the connector to your canvas app
Select Data from the left-pane.
Select Add data.
Search for and select CGTrader.
Select the connection that you created earlier.
You can now bind your controls to the CGTrader connector actions, and browse and load models from CGTrader inside your app.
A connection is an instance of a connector. You can have multiple connections with different configurations. You can also create new connections from within Power Apps Studio when adding the connector by selecting + Add a connection.
Load CGTrader models directly into View in 3D or View in MR
After adding a CGTrader connection to your app, you can load models directly into your app with the following steps.
Find the model you want in your app from the CGTrader website.
Select the model, and then note the Model ID and the supported file types.
Open your app in Power Apps Studio.
Select and drag a View in 3D or View in MR control to the canvas screen.
Set the Source property of the control (View in 3D/View in MR) to
CGTrader.GetModel(model_id, "file_type"), where model_id is the ID of your selected model, and file_type is one of the supported file types.
The below table lists the most common actions and examples. For a complete list of all connector actions, their parameters, and return types, go to the CGTrader connector reference.
|GetModel||Downloads a model with the given ID and file type.||
|GetModelInfo||Gets the info of a model with the given ID.||
|SearchModels||Searches for models from CGTrader based on the given filters. Consider binding the items in a Gallery to this action.||
|GetCategories||Gets the available category names and IDs.||