Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GLB import information and new asset tasks (Draco + FBX folder) #493

Merged
merged 15 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ PlayCanvas supports importing models with their meshes as a hierarchy of entitie

## How to enable

<div class="alert alert-info">
This is now enabled by default for new projects.
</div>

Open the 'Project Settings'

<img loading="lazy" src="/images/user-manual/assets/import-pipeline/import-hierarchy/project-settings.png" width="480px">
Expand All @@ -20,7 +24,9 @@ Scroll down to 'Asset Tasks' and enable 'Import Hierarchy':

## Importing models

Drag the model file into the 'Assets Panel':
A full tutorial on importing your first model and animation can be found [here][first_model_animation_import].

As an overview, when you drag the model file into the 'Assets Panel':
yaustar marked this conversation as resolved.
Show resolved Hide resolved
![Drag Model into Assets Panel][import_model_gif]

The following assets will be created when imported:
Expand Down Expand Up @@ -56,3 +62,4 @@ How the Editor decides what is a new or removed mesh instance is done by the fol
[template_asset]: /user-manual/templates/
[render_component]: /api/pc.RenderComponent.html
[collision_component]: /api/pc.CollisionComponent.html
[first_model_animation_import]: /tutorials/importing-first-model-and-animation/
21 changes: 16 additions & 5 deletions content/en/user-manual/assets/import-pipeline/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ Some assets don't need to be imported before they can be used. For example a PNG

## Asset Tasks

When a source asset is uploaded that needs to be imported. PlayCanvas starts an Asset Task to perform this import process on our server. You can see the asset tasks that you are currently running in the Asset Panel.

![asset tasks][1]
When a source asset is uploaded that needs to be imported. PlayCanvas starts an Asset Task to perform this import process on our server.
yaustar marked this conversation as resolved.
Show resolved Hide resolved

There are a variety of options available to tune the behavior of the import pipeline to suit your needs.

<img loading="lazy" src="/images/user-manual/assets/import-pipeline/asset-tasks.png" width="360px">
<img loading="lazy" src="/images/user-manual/assets/import-pipeline/asset-tasks.png" width="480px">
yaustar marked this conversation as resolved.
Show resolved Hide resolved

### Search related assets

Expand Down Expand Up @@ -75,11 +73,24 @@ Enabled by default on new projects, imported models and animations will create G

Only available if using [Convert to GLB](#convert-to-glb) option. When a model file is imported, a template asset is created that contains the full hierarchy of the model as entities allowing to you to manipulate them directly in the Editor. See more information about this feature [here][3].

### Mesh Compression

Only available if using [Convert to GLB](#convert-to-glb) option. Setting this to a compression format will automatically compress mesh data when importing or re-importing model files. This can drastically reduce the size of GLB files at the cost of some runtime decompression cost.

If using Draco compression, remember to import the Draco WASM module into the project otherwise the models will not load.

<img loading="lazy" src="/images/user-manual/assets/import-pipeline/draco-import-button.png" width="480px">
yaustar marked this conversation as resolved.
Show resolved Hide resolved

### Create FBX Folder

When importing a model file (e.g a GLB or FBX), the Editor will create a folder for the assets created by the import such as render, template and material assets.

If there is already a Model (Source) file in the current folder or a folder with the same name as the file being imported, it will overwrite the existing assets instead of creating a new folder.

## Animation Import Settings

Please refer to the [Animation section][4] for more details.

[1]: /images/user-manual/assets/import-pipeline/asset-tasks-full.jpg
[2]: /user-manual/assets/preloading-and-streaming/
[3]: /user-manual/assets/import-pipeline/import-hierarchy/
[4]: /user-manual/assets/animation/
28 changes: 26 additions & 2 deletions content/en/user-manual/assets/models/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,28 @@ position: 2

Building art and animations for PlayCanvas can be done using almost any of the many 3D modeling programs available. For example: Blender, SketchUp, Autodesk 3D Studio Max or Autodesk Maya.

PlayCanvas is designed to import content most faithfully via the FBX interchange format so, in general, if your modeling application supports FBX, PlayCanvas supports it too. As such, to target PlayCanvas, you do not have to use any special art tools plugins and there are no PlayCanvas-specific workflows you must follow.
PlayCanvas is designed to import content most faithfully via the open source glTF binary (GLB) format so, in general, if your modeling application supports GLB, PlayCanvas supports it too.

The import of GLBs supports the following glTF features for incredibly fast scene creation:

- Node hierarchy
- Standard material
- Ratified material extensions
- Animated skeletons and skinning data
- Morph targets
- Cameras
- Draco compressed models
- Light punctual support
yaustar marked this conversation as resolved.
Show resolved Hide resolved

As such, to target PlayCanvas, you do not have to use any special art tools plugins and there are no PlayCanvas-specific workflows you must follow.
yaustar marked this conversation as resolved.
Show resolved Hide resolved

![GLB Import Example][14]

(Model by Loïc Norgeot and mosquito scan by Geoffrey Marchal for [Sketchfab][13] licensed under [CC BY 4.0][12]).

PlayCanvas also supports importing of FBX mode which is another common interchange format. However, it doesn't retain material properties and you will need to configure them after import.
yaustar marked this conversation as resolved.
Show resolved Hide resolved

We recommend using GLBs whenever possible for the best experience and highest compatibility.

Some modeling and animation programs to consider:

Expand Down Expand Up @@ -38,7 +59,7 @@ Regardless which modeling application you are using, there a number of things to

[Blender][4] is a fantastic free tool for 3D modeling and it is perfect for generating 3D assets for PlayCanvas.

Blender supports exporting to both COLLADA and FBX, but the built-in exporters do have some limitations.
Blender supports exporting to GLB, FBX and COLLADA but the built-in exporters do have some limitations.

### **Map Types**

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the rest of the page is still accurate so left as is

Expand Down Expand Up @@ -158,3 +179,6 @@ You should use the standard material types in Maya: lambert, blinn and phong. Th
[9]: /images/user-manual/assets/models/building/wall-norm-yflip.jpg
[10]: /images/user-manual/assets/models/building/mountains-sphere.jpg
[11]: /images/user-manual/assets/models/building/maya-material-editor.jpg
[12]: https://creativecommons.org/licenses/by/4.0/
[13]: https://sketchfab.com/3d-models/real-time-refraction-demo-mosquito-in-amber-37233d6ed84844fea1ebe88069ea58d1
[14]: /images/user-manual/assets/models/building/glb-import.gif
24 changes: 21 additions & 3 deletions content/en/user-manual/assets/models/exporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,29 @@ layout: usermanual-page.hbs
position: 3
---

PlayCanvas can import 3D content in the following formats: FBX, OBJ, 3DS and COLLADA (DAE). We strongly recommend you use FBX since this the most robust and well tested interchange format.
PlayCanvas can import 3D content in the following formats: glTF binary (GLB), FBX, OBJ, 3DS and COLLADA (DAE). We strongly recommend you use GLB as it's an open source industry standard and fantastically supported in the Editor.
yaustar marked this conversation as resolved.
Show resolved Hide resolved

Here are some tips for exporting to the FBX file format:
![GLB Import Example][glb-import-gif]

(Model by Loïc Norgeot and mosquito scan by Geoffrey Marchal for [Sketchfab][mosquito] licensed under [CC BY 4.0][cc-40]).

If GLB is not available, then please use FBX as it is a robust and well tested interchange industry format.

## General export tips

* Only export what you need from your scene. For example, if your scene contains a red car and a blue car but you only want to import the red car, export only the red car. Your modelling application should have an 'Export Selected' or similar option.
yaustar marked this conversation as resolved.
Show resolved Hide resolved

## Export to GLB file format tips
yaustar marked this conversation as resolved.
Show resolved Hide resolved

* Set the format to glTF Binary (GLB).
* Ensure that materials and images are set to be exported and embedded in the GLB. Otherwise, you must upload all scene textures separately and relink all textures to materials and re-configure the materials parameters.

## Export to FBX file format tips
yaustar marked this conversation as resolved.
Show resolved Hide resolved

* Ensure you have the latest available FBX exporter for your modelling application installed.
* Only export what you need from your scene to FBX. For example, if your scene contains a red car and a blue car but you only want to import the red car, export only the red car to FBX. Your modelling application should have an 'Export Selected' option.
* Select the 'Embed Media' option in the FBX exporter panel. This packages the scene's textures in the exported FBX. This preserves material to textures links during import into PlayCanvas. Otherwise, you must upload all scene textures separately and relink all textures to materials.
* Select the 'Binary' file format option in the FBX exporter panel. This reduces FBX file size considerably.

[glb-import-gif]: /images/user-manual/assets/models/building/glb-import.gif
[cc-40]: https://creativecommons.org/licenses/by/4.0/
[mosquito]: https://sketchfab.com/3d-models/
9 changes: 7 additions & 2 deletions content/en/user-manual/assets/models/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@ position: 11

3D models and animations are imported into PlayCanvas by uploading scene files from a [3D modeling application][1] such as [Blender][2], 3D Studio Max or Maya.

PlayCanvas supports a wide variety of formats, such as FBX, COLLADA and obj. We recommend using the FBX format for best results.
PlayCanvas supports a wide variety of formats, such as glTF binary (GLB), FBX, COLLADA and obj. We recommend using the GLB format for best results.

Uploading one of these files will create a [Source Asset][3] of type 'scene' and will produce a [Target Asset][4] of type 'model'. You will use the target 'model' in your game.
Uploading one of these files will create a [Source Asset][3] of type 'Model' and will produce several [Target Assets][4] including a '[Template]'[7] with the model hierarchy and 'Render' assets. You can add an instance of the 'Template' in your game.

Learn more about:

* [Building Models][5]
* [Exporting Models][6]
* [Importing Models][8]
* [Using Templates][9]

[1]: /user-manual/assets/models/building
[2]: https://www.blender.org/
[3]: /user-manual/glossary#source-asset
[4]: /user-manual/glossary#target-asset
[5]: /user-manual/assets/models/building
[6]: /user-manual/assets/models/exporting
[7]: /user-manual/assets/templates/
[8]: /user-manual/assets/import-pipeline/import-hierarchy/
[9]: /user-manual/templates/
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.