This is an English translation of an article here.
Translated with www.DeepL.com/Translator
I found a good way to port models from Unity to PlayCanvas by hierarchy, so I'll write about it.
This is for those who want to port 3D model data directly from Unity.
In the end, the hierarchical structure can be ported, but game objects other than model data, such as scripts, lights, and particles, cannot be ported in this way.
Also, materials are imported in their raw state, so a little more effort is needed to get the texture exactly the same as in Unity.
In this case, we'll be porting multiple 3D models purchased from the Unity Asset Store and their well-arranged scene assets, along with the hierarchy shown in the scene.
The final result will look like this
So let's do it.
Unity has updated its EULA on April 13, 2020 to allow products deployed in the Unity Asset Store to eventually be used outside of Unity
However, this does not apply to all assets, but only those that are in the "License Standard Unity Asset Store EULA".
There are three major steps that need to be taken: building the environment that you want to port to Unity, installing the FBX exporter, and converting to FBX.
The first step is to build the environment you want to port to in the Unity scene.
In this case, we will port the following assets purchased from Unity Asset Store
We will convert the game objects to FBX using the FBX Importer from Unity Technologies.
When you are referring to Unity Registry from Package Manager, search for FBX exporter in the search window on the upper right.
You can use the free ones provided by Unity. There are paid ones, but you can use the free ones.
If you have the FBX exporter installed, you can convert the game objects in the hierarchy to FBX.
Right-click on the game object you want to port and click Export to FBX.
When you click on it, you will be asked for the export options, but you don't need to change anything.
After you click Export, the process will run, and if it finishes successfully, the FBX model will be created under Assets.
This is the end of the work on the Unity side.
There are three main steps: changing the editor settings, uploading, and setting up the material.
Change the imported model so that it is displayed in a hierarchical structure.
Click the "Settings" button on the bottom left corner of the screen, and check the "ASSET TASKS -> Model Import Settings -> Import Hierarchy" checkbox.
Upload the generated FBX by dragging and dropping it into the Assets section of PlayCanvas.
After the upload is complete, a large number of materials and render assets will be generated.
In this state, the texture is not included, so upload the texture separately.
This is what it will look like when the textures have been uploaded.
Uploading is now complete.
First of all, since all images are uploaded as raw data and are heavy, we will apply BASIS compression to all of them.
Select Texture from Assets to display all textures.
Select all textures while holding down the SHIFT key.
Check the COMPRESSION -> BASIS checkbox at the bottom of the hierarchy on the right, and press IMPORT BASIS and COMPRESS BASIS.
The compression process will run, and when all progress bars disappear, BASIS compression is complete.
Next, let's display the model data.
You will see an asset with a diamond-shaped icon in the Asset section. This is the model data that has been templated.
Delete the hierarchy Box and Plane, and drag and drop the uploaded model data into the scene to display it.
The model will be displayed in a gray state as shown below
The material is gray because it has not been set.
Next, we will apply a texture to the material.
We will apply the uploaded texture to the analyzed material.
It is recommended that you check the materials of the original model in Unity when designing the materials.
This is what it will look like when the material settings are complete
After that, we can add skybox settings and light settings to enhance the expression.
キミを探す、夏 開発秘話2021年11月5日(金) 22時43分0秒 | 318 view
なるべく楽にUnityからPlayCanvasへヒエラルキーごと3Dモデルを移植する2021年8月17日(火) 2時29分33秒 | 253 view
【Web表現チェンジャー】PlayCanvasに追加された3Diframeサンプルが控えめに言ってヤバい2021年1月13日(水) 15時21分41秒 | 160 view
3Diframe x model viewer starterkitを利用したときに右クリックでブラウザメニューが出るのを防止する2021年1月15日(金) 13時58分32秒 | 30 view
PlayCanvas Editor APIで面倒な作業を自動化する2022年4月18日(月) 6時39分30秒 | 22 view