Difference between pages "3D Asset Workflow: Collisions" and "3D Asset Workflow: Exporting to Editor"

From Frozenbyte Wiki
(Difference between pages)
Jump to: navigation, search
 
m
 
Line 2: Line 2:
 
⬑  [[3D Asset Workflow]]</div>
 
⬑  [[3D Asset Workflow]]</div>
 
<div style="border-bottom:2px solid #99aac7; background:#d0def5; padding:0.4em 0.5em; font-size:130%; float:right; margin-bottom: 25px;">
 
<div style="border-bottom:2px solid #99aac7; background:#d0def5; padding:0.4em 0.5em; font-size:130%; float:right; margin-bottom: 25px;">
Next step: [[3D Asset Workflow: Texturing]] →</div>
+
Next step: [[3D Asset Workflow: Completed asset checklist]] →</div>
 
<div style="border-bottom:2px solid #99aac7; background:#d0def5; padding:0.4em 0.5em; font-size:130%; float:left; margin-bottom: 25px;">
 
<div style="border-bottom:2px solid #99aac7; background:#d0def5; padding:0.4em 0.5em; font-size:130%; float:left; margin-bottom: 25px;">
← Previous step: [[3D Asset Workflow: UV Mapping]]</div>
+
← Previous step: [[3D Asset Workflow: LODs]]</div>
  
 
<div style="padding-right: 10px; padding-left: 1000px; padding-top: 60px; padding-bottom: 80px;">
 
<div style="padding-right: 10px; padding-left: 1000px; padding-top: 60px; padding-bottom: 80px;">
 
{{#lst:3D Asset Workflow}} <!-- Link list transcluded from main 3D Asset Workflow page -->
 
{{#lst:3D Asset Workflow}} <!-- Link list transcluded from main 3D Asset Workflow page -->
 
</div>
 
</div>
 +
= Summary =
 +
* Exporting and importing your models to the Editor and making sure they work as intended is also an important part of the 3D Asset Workflow
 +
** This way the level artists can start using them right away
 +
** E.g. assets with [[3D Asset Workflow: Tintmask|tintmaks]] should have assigned colors already, so they're not black when taken out of the Type Tree
 +
* If you have any issues with exporting/importing your models to the Editor, check [[3D Asset Workflow: Troubleshooting]]
  
=Collisions=
+
= Exporting Steps =
* Collisions are very simple and very low poly meshes that tell the game engine where the collideable edges of the model are
+
# Preparing the models
* Collisions can be divided into two categories; [[3D_Asset_Workflow:_Collisions_and_Breakable_objects#Static_Collisions|static]] and [[3D_Asset_Workflow:_Collisions_and_Breakable_objects#Dynamic_Collisions|dynamic]]
+
#* [[3D Asset Workflow: Naming the Asset|Naming the Asset]]
** Static objects are stationary, dynamic objects are dynamic, and can be e.g. thrown or kicked around the level, or otherwise interacted with
+
#* [[3D_Asset_Workflow: LODs|Create LODs]]
* When making collisions, be wary of sharp edges or holes, in which the characters can get stuck
+
# Preparing the textures
 +
#* Compressing targa files
 +
# Exporting the models and textures
 +
# Importing the textures to the binary SVN
 +
# Linking the albedo texture from the binary SVN to the model
 +
# Importing the models to the Editor
 +
# Opening the Editor so that it will create the correct resource, type, and meshmaterial files
 +
# Making sure everything works as intended
 +
#* [[3D Asset Workflow: Completed asset checklist]]
 +
# Adjusting the models in the Editor (if needed)
  
== Static Collisions ==
+
= Exporting Models from Modo to the Editor =
* Collisions for objects which can't be manipulated by the characters in the game
+
# Rename the UV Set into '''map1''' in Modo
* For example just a static piece of environment in the game that doesn't move in any way
+
#* Modo > Lists > UV Maps > Texture ('''change the "Texture" word into "map1"''')
* Can be made in one layer with multiple objects colliding with each other
+
# Make sure all the separate objects have sensible pivots
* The collision layer must be parented with the original object
+
#* In Modo, the origo presents the pivot of the model
'''Naming:''' xx_static_collision
+
#* For most models, the pivot should be in the center of the model, but in e.g. doors it should be in the hinges, to make them easier to manipulate in the Editor
 +
# [[3D Asset Workflow: Naming the Asset|Name the asset correctly]] - '''the mesh layer name defines the model name in Editor'''
 +
# Make '''[[3D_Asset_Workflow:_LODs|LODs]]'''
 +
# In Modo, check that there isn't anything extra on the "Shading" and "Clips" tab
 +
# After the scene is prepared and mesh layers are named, apply a material to the meshes by pressing 'M', and name the material in the pop-up
 +
#* More info about [[3D_Asset_Workflow:_Retopo_and_UVs#Materials|adding materials in Modo]]
 +
#* Remember the "_mat" suffix for materials, so there are no clashing names
 +
#** Modo uses greyed out (number) suffix with clashed names, there shouldn't be any of these in your FBX
 +
# Copy the texture files to the correct binary SVN folder
 +
#* Then open the '''Shading''' tab in Modo, find the material you just created, and click on the dropdown arrow next to the material
 +
#** Drag the '''albedo map only''' from the binary SVN folder to the material
 +
# Export the meshes as FBX from the Game Tools Tab (settings down below)
 +
#* Export the FBX to a local folder first, and then copypaste it to the same folder the textures are in
 +
#* If you export directly to the binary, the Editor can try to create a _tmp mesh, which is not wanted
 +
[[File:Modo_export_updated.jpg|alt=Modo export|Items and shading tabs should look like these before exporting|center]]
  
'''Example of the hierarchy:'''
+
== Exclusion: Models That Will Be Animated ==
# box
+
* Models that will be animated need to be rigged first - thus, the animator will export the FBX to the binary SVN once done
## box_static_collision
+
* However, the 3D artist should:
 +
# '''Export and commit the texture files to the correct place in the project's binary SVN'''
 +
# '''Link the texture files from the binary SVN to the model'''
 +
# Export and commit the model to the '''workspace SVN'''
 +
# '''Tell the animator where to find the model'''
 +
# Now, when the animator opens and later exports the model, the textures work correctly
  
==Dynamic Collisions==
+
== Export Settings in Modo ==
* Collisions for objects which move and/or can be manipulated by the characters in the game, for example dropped or kicked
+
* '''Export File:''' FBX 2014 (or 2010)
* The collision objects can't be concave, so in most cases the dynamic collision must be made with many objects
+
* '''Export Type:''' Export All (when exporting an asset with a broken version, always use Export All or it doesn't work! )
* These must be separated to different layers, and can't collide with each other
+
* 'Save as text format' and 'Save only animation' '''unchecked'''
* All the dynamic collision layers must be parented with the original object
+
* '''Check only the following'''
'''Naming:''' xx_collision_dynamic(_01)
+
** Save Geometry
 +
** Save Materials
 +
** Save Smoothing Groups
 +
** Save Tangent Basis
 +
* '''Surface Refining:''' Save Mesh Smoothness
 +
* '''Units:''' FBX Default
 +
* '''Scale Multiplier:''' 1.0
  
'''Example of the hierarchy:'''
+
* '''NOTE''' It's important that the texture maps are named correctly
# box
+
** See [[3D_Asset_Workflow:_Baking_and_Texturing#Naming_Conventions| Naming conventions]]
## box_collision_dynamic_01
+
[[File:Editor export.jpg|alt=FBX export settings for Editor|FBX export settings for Editor|center]]
## box_collision_dynamic_02
+
 
## box_collision_dynamic_03
+
=<span id="Importing assets to editor"></span>Importing Models and Textures to the Editor, and Committing =
 +
* After moving the textures and models to the project's binary SVN folder:
 +
# Open the Editor
 +
#* The Editor will now open a '''resource and/or type generation dialogue''', depending on the files you imported
 +
#** If there are files missing from either dialogue, you can press OK, but also check that all the resource files are generated properly
 +
#* '''When importing models for the first time, the Editor will also generate a meshmaterial file for each distinct texture set'''
 +
# Check for errors (if there are errors there might be missing items because of changed names etc)
 +
# Go to the '''Resource window''' and go through each new added resource file (models, textures, FBX files, etc)
 +
#* '''If you're making a normal 3D asset''', make sure that '''none of the ticks is ticked''' in the properties
 +
#* '''If you're making a player asset''' (e.g. Amadeus's conjurable object), make sure AlwaysIncluded is ticked
 +
#* Afterwards, save resources from the tiny save icon in the top left of the Resource window, or from File -> Save resources
 +
# '''CHECK THAT ALL RESOURCES ARE GENERATED!'''
 +
#* Each file you put in should have a resource file associated with it, denoted by the .fbr filetype. This includes .fbxmodel, .tga, .fbx, etc. files
 +
If there are resource files missing, it will generate prompts for other people after you commit!
 +
* '''If the Editor doesn't create resource files''' you can try the following to force the resources to generate:
 +
# Restarting the Editor
 +
# Finding the file in Resource window and right-click -> Process resource
 +
# Re-importing the file
 +
 
 +
* '''SET RESOURCE AND TYPE PROPERTIES'''
 +
** Moving objects such as characters, vegetation with sway and other dynamic objects must have static shadows disabled
 +
*** This will prevent them from casting static shadows that will not update with the object when it moves
 +
** To disable type's static shadows, find RenderToPasses category from the ModelComponent
 +
*** Set EnableStaticPointShadowPass and EnableStaticSpotShadowPass both to 0
 +
 
 +
* '''SAVE RESOURCES AND TYPES''' in the Editor, File -> Save resources, Save types
 +
** Check that the save window contains only resources that you have modified or created
 +
*** If there are other resources/types, save only those you have modified, and commit
 +
** Afterwards, run a SVN cleanup, which will purge all local changes that are not committed
 +
 
 +
* '''Restart the Editor, and make sure the asset works in game before you commit'''
 +
* Save resources and types if you made any modifications to them
  
<div class="toccolours mw-collapsible mw-collapsed" style="background-color: #f3e9f5; border-width:2px; border-radius:10px; margin: 5px;">
 
Examples of Static and Dynamic Collisions via images
 
<div class="mw-collapsible-content">
 
[[File:Static and dynamic collisions.jpg|1000px]]
 
</div>
 
</div>
 
  
 +
* Commit the modified files on the binary SVN and the workspace SVN. '''Select commit a couple of folders up from the import folder''', (or straight from the root folder, if you want to be sure). Otherwise you might miss some important resource/type files for the directory folders
 +
** '''The commit window should only contain files and folders you have generated or modified!''' If there are other things there, leave them unchecked and run revert and cleanup after commit
 +
** ''' Keep the commit window clean''', if your commit window has lots of uncommitted stuff all the time it'll be harder for you to notice what new there is and you might miss some important resource files.
 +
* Done! Now everybody should be able to find the new assets in Editor
  
== Adding Collisions in Editor ==
+
= Adjusting the Model in Editor =
* Once the collisions for each object are done in Modo, and the models are exported to the Editor, you need to add Components to the type to make the collisions actually work
+
* Two ways to adjust the model:
* Most of the time you can just copy and paste the needed components from some existing model, that is similar to your new model
+
# '''Make adjustments to the instance''', and then '''apply them to the type'''
* It's good to copy the Components from objects that have similar material or size, but the shape doesn't matter because your object will use the collision model you made for it in Modo
+
#* Add the model to a scene (any scene will do) from the Type Tree
 +
#* Click the model, open it's model component properties
 +
#* Make needed adjustments to the instance, and Apply them to the Type (right click the property in the model component properties -> Apply to Type)
 +
# '''Make adjustments straight to the type'''
 +
#* Click the model's name in the Type Tree
 +
#* Open model component properties, make changes
 +
#* No need to apply them to the type, as this way they go into it directly
 +
#** You can preview the changes by hovering your mouse to the scene, but don't add the model to the scene
 +
* [[3D Asset Workflow: Completed asset checklist]]
  
<div class="toccolours mw-collapsible mw-collapsed" style="background-color: #f3e9f5; border-width:2px; border-radius:10px; margin: 5px;">
+
== Emission ==
Image Guide to Adding Collisions in Editor, with Explanatory Texts
+
* Make sure the meshmaterial has the UseColoredEmissiveTexture and LerpEmissiveWithAlbedo checked in its properties
<div class="mw-collapsible-content">
+
* From model component properties edit the EmissiveIntensity and EmissiveIntensityFactor
[[File:Copy component.jpg|600px|collision tips]]
+
* Make sure the emissive texture map is selected in the mesh material properties' textures array
  
* Select the model in Type Tree and see its Properties
+
== Tintmask ==
* There should already be these Model Components
+
* [[3D Asset Workflow: Tintmask]]
** ModelComponent
+
* Make sure the default settings look good already
** TransformComponent
 
* You need to either copy or search and add these components
 
** HittableComponent
 
** ContactEffectCreatorComponent
 
** PhysicsComponent
 
*** StaticMesh (for static collision)
 
*** ConvexCompound (for dynamic collision)
 
* Copy by selecting the object you want to copy from in Type Tree and right click "Copy Components", don't copy ModelComponent and TransformComponent, DO NOT COPY FROM DYNAMIC TO STATIC OBJECT OR FROM STATIC TO DYNAMIC!
 
* If there aren't similar objects with collision in the game, Add by selecting the object you want to add to in Type Tree and right click "Add Component Type", then search the needed components
 
** In this case, you can either '''Add''' or '''Add and Inherit'''. By just Adding, the Components stay shared with the type you copied it from, with Add and Inherit you create a separate copy of the Component
 
[[File:Ohjeita editoriin ErilaistenModeliTyyppienKomponentit collisionit.jpg|1200px|Teemu's collision tips]]
 
</div>
 
</div>
 

Latest revision as of 09:16, 4 September 2023

3D Asset Workflow
Next step: 3D Asset Workflow: Completed asset checklist
← Previous step: 3D Asset Workflow: LODs

Summary

  • Exporting and importing your models to the Editor and making sure they work as intended is also an important part of the 3D Asset Workflow
    • This way the level artists can start using them right away
    • E.g. assets with tintmaks should have assigned colors already, so they're not black when taken out of the Type Tree
  • If you have any issues with exporting/importing your models to the Editor, check 3D Asset Workflow: Troubleshooting

Exporting Steps

  1. Preparing the models
  2. Preparing the textures
    • Compressing targa files
  3. Exporting the models and textures
  4. Importing the textures to the binary SVN
  5. Linking the albedo texture from the binary SVN to the model
  6. Importing the models to the Editor
  7. Opening the Editor so that it will create the correct resource, type, and meshmaterial files
  8. Making sure everything works as intended
  9. Adjusting the models in the Editor (if needed)

Exporting Models from Modo to the Editor

  1. Rename the UV Set into map1 in Modo
    • Modo > Lists > UV Maps > Texture (change the "Texture" word into "map1")
  2. Make sure all the separate objects have sensible pivots
    • In Modo, the origo presents the pivot of the model
    • For most models, the pivot should be in the center of the model, but in e.g. doors it should be in the hinges, to make them easier to manipulate in the Editor
  3. Name the asset correctly - the mesh layer name defines the model name in Editor
  4. Make LODs
  5. In Modo, check that there isn't anything extra on the "Shading" and "Clips" tab
  6. After the scene is prepared and mesh layers are named, apply a material to the meshes by pressing 'M', and name the material in the pop-up
    • More info about adding materials in Modo
    • Remember the "_mat" suffix for materials, so there are no clashing names
      • Modo uses greyed out (number) suffix with clashed names, there shouldn't be any of these in your FBX
  7. Copy the texture files to the correct binary SVN folder
    • Then open the Shading tab in Modo, find the material you just created, and click on the dropdown arrow next to the material
      • Drag the albedo map only from the binary SVN folder to the material
  8. Export the meshes as FBX from the Game Tools Tab (settings down below)
    • Export the FBX to a local folder first, and then copypaste it to the same folder the textures are in
    • If you export directly to the binary, the Editor can try to create a _tmp mesh, which is not wanted
Modo export

Exclusion: Models That Will Be Animated

  • Models that will be animated need to be rigged first - thus, the animator will export the FBX to the binary SVN once done
  • However, the 3D artist should:
  1. Export and commit the texture files to the correct place in the project's binary SVN
  2. Link the texture files from the binary SVN to the model
  3. Export and commit the model to the workspace SVN
  4. Tell the animator where to find the model
  5. Now, when the animator opens and later exports the model, the textures work correctly

Export Settings in Modo

  • Export File: FBX 2014 (or 2010)
  • Export Type: Export All (when exporting an asset with a broken version, always use Export All or it doesn't work! )
  • 'Save as text format' and 'Save only animation' unchecked
  • Check only the following
    • Save Geometry
    • Save Materials
    • Save Smoothing Groups
    • Save Tangent Basis
  • Surface Refining: Save Mesh Smoothness
  • Units: FBX Default
  • Scale Multiplier: 1.0
FBX export settings for Editor

Importing Models and Textures to the Editor, and Committing

  • After moving the textures and models to the project's binary SVN folder:
  1. Open the Editor
    • The Editor will now open a resource and/or type generation dialogue, depending on the files you imported
      • If there are files missing from either dialogue, you can press OK, but also check that all the resource files are generated properly
    • When importing models for the first time, the Editor will also generate a meshmaterial file for each distinct texture set
  2. Check for errors (if there are errors there might be missing items because of changed names etc)
  3. Go to the Resource window and go through each new added resource file (models, textures, FBX files, etc)
    • If you're making a normal 3D asset, make sure that none of the ticks is ticked in the properties
    • If you're making a player asset (e.g. Amadeus's conjurable object), make sure AlwaysIncluded is ticked
    • Afterwards, save resources from the tiny save icon in the top left of the Resource window, or from File -> Save resources
  4. CHECK THAT ALL RESOURCES ARE GENERATED!
    • Each file you put in should have a resource file associated with it, denoted by the .fbr filetype. This includes .fbxmodel, .tga, .fbx, etc. files
If there are resource files missing, it will generate prompts for other people after you commit!
  • If the Editor doesn't create resource files you can try the following to force the resources to generate:
  1. Restarting the Editor
  2. Finding the file in Resource window and right-click -> Process resource
  3. Re-importing the file
  • SET RESOURCE AND TYPE PROPERTIES
    • Moving objects such as characters, vegetation with sway and other dynamic objects must have static shadows disabled
      • This will prevent them from casting static shadows that will not update with the object when it moves
    • To disable type's static shadows, find RenderToPasses category from the ModelComponent
      • Set EnableStaticPointShadowPass and EnableStaticSpotShadowPass both to 0
  • SAVE RESOURCES AND TYPES in the Editor, File -> Save resources, Save types
    • Check that the save window contains only resources that you have modified or created
      • If there are other resources/types, save only those you have modified, and commit
    • Afterwards, run a SVN cleanup, which will purge all local changes that are not committed
  • Restart the Editor, and make sure the asset works in game before you commit
  • Save resources and types if you made any modifications to them


  • Commit the modified files on the binary SVN and the workspace SVN. Select commit a couple of folders up from the import folder, (or straight from the root folder, if you want to be sure). Otherwise you might miss some important resource/type files for the directory folders
    • The commit window should only contain files and folders you have generated or modified! If there are other things there, leave them unchecked and run revert and cleanup after commit
    • Keep the commit window clean, if your commit window has lots of uncommitted stuff all the time it'll be harder for you to notice what new there is and you might miss some important resource files.
  • Done! Now everybody should be able to find the new assets in Editor

Adjusting the Model in Editor

  • Two ways to adjust the model:
  1. Make adjustments to the instance, and then apply them to the type
    • Add the model to a scene (any scene will do) from the Type Tree
    • Click the model, open it's model component properties
    • Make needed adjustments to the instance, and Apply them to the Type (right click the property in the model component properties -> Apply to Type)
  2. Make adjustments straight to the type
    • Click the model's name in the Type Tree
    • Open model component properties, make changes
    • No need to apply them to the type, as this way they go into it directly
      • You can preview the changes by hovering your mouse to the scene, but don't add the model to the scene

Emission

  • Make sure the meshmaterial has the UseColoredEmissiveTexture and LerpEmissiveWithAlbedo checked in its properties
  • From model component properties edit the EmissiveIntensity and EmissiveIntensityFactor
  • Make sure the emissive texture map is selected in the mesh material properties' textures array

Tintmask