meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pg_using_branches [2023/04/03 18:23] steph.jorgensenpg_using_branches [2023/04/19 10:33] (current) steph.jorgensen
Line 1: Line 1:
 ======Preparing and using a branch or twig mesh====== ======Preparing and using a branch or twig mesh======
- 
->**Note:** Photogrammetry support is a beta feature in v8.2.0 and is only available in Cinema and Games editions of the Modeler. The documentation for this feature is a work in progress. 
  
 This page describes how to prepare and use a photogrammetry generated mesh that represents branches or twigs. The first section explains why you'll likely need to prepare the mesh before using it (either in SpeedTree or an external application) and the second section covers how you might use the branch mesh once you have. This page describes how to prepare and use a photogrammetry generated mesh that represents branches or twigs. The first section explains why you'll likely need to prepare the mesh before using it (either in SpeedTree or an external application) and the second section covers how you might use the branch mesh once you have.
Line 12: Line 10:
 The general approach is to create a SpeedTree model specifically for preparing the mesh and then using it to export a new, doctored mesh.  While it is possible to do the preparation in an external application, SpeedTree provides several tools to make this process easier.  Follow the procedure detailed below to prepare a branch mesh. The general approach is to create a SpeedTree model specifically for preparing the mesh and then using it to export a new, doctored mesh.  While it is possible to do the preparation in an external application, SpeedTree provides several tools to make this process easier.  Follow the procedure detailed below to prepare a branch mesh.
  
-====Import the Mesh and its Textures====+====Import the mesh and its textures====
 In order to use a 3d scan, you must first import the mesh as a [[kcmeshes|mesh asset]]. Next, create a [[toolmaterialsassetsbar|material asset]] that uses the textures associated with the scan.  Be sure to associate the mesh asset with the material. In order to use a 3d scan, you must first import the mesh as a [[kcmeshes|mesh asset]]. Next, create a [[toolmaterialsassetsbar|material asset]] that uses the textures associated with the scan.  Be sure to associate the mesh asset with the material.
  
-{{ ::pg_prep_assets.jpg |}}+{{pg_prep_assets.jpg}}
  
 Meshes must be a single model that can have a single material on it.  Photogrammetry meshes are typically saved as single meshes with unwrapped UV data that correspond to a texture atlas. Meshes must be a single model that can have a single material on it.  Photogrammetry meshes are typically saved as single meshes with unwrapped UV data that correspond to a texture atlas.
Line 22: Line 20:
 Once you have assets in place you'll use a "Mesh" generator to make it part of your model.  Add a "Mesh" generator and then assign the material asset to it as pictured below.  It will automatically pick up the mesh asset via its association with the material asset. Once you have assets in place you'll use a "Mesh" generator to make it part of your model.  Add a "Mesh" generator and then assign the material asset to it as pictured below.  It will automatically pick up the mesh asset via its association with the material asset.
  
-{{ ::pg_mesh_branch_generator.jpg?nolink |}}+{{pg_mesh_branch_generator.jpg?nolink}}
  
 ====Orient and position the mesh==== ====Orient and position the mesh====
 Switch to node editing mode and select the mesh in the Tree Window.  Use the gizmo to position the mesh such that the base of the branch is located exactly on the scene origin.  The scene origin will be the pivot point when the fully prepared mesh is exported.  Rotate the mesh such that the branch is pointing down the "Y" axis.   Switch to node editing mode and select the mesh in the Tree Window.  Use the gizmo to position the mesh such that the base of the branch is located exactly on the scene origin.  The scene origin will be the pivot point when the fully prepared mesh is exported.  Rotate the mesh such that the branch is pointing down the "Y" axis.  
  
-{{ ::pg_mesh_pivot.gif?nolink |}}+{{pg_mesh_pivot.gif?nolink}}
  
 ====Mark the locations where branches might grow==== ====Mark the locations where branches might grow====
Line 34: Line 32:
 Select the Mesh generator and add the "Place 3D Anchors" geometry template.  Assign the helper material to the Leaf Mesh generator.  Even though we're marking branch locations, all anchors are exported via the leaf reference system.  We'll identify them as branches based on the ID assigned to them later.  In the Tree Window, hold the space bar and click on the mesh to create a new anchor point.  You should see the helper mesh stuck to the branch and pointing towards the camera.  Continue adding anchors for every point you might want a branch to grow. Select the Mesh generator and add the "Place 3D Anchors" geometry template.  Assign the helper material to the Leaf Mesh generator.  Even though we're marking branch locations, all anchors are exported via the leaf reference system.  We'll identify them as branches based on the ID assigned to them later.  In the Tree Window, hold the space bar and click on the mesh to create a new anchor point.  You should see the helper mesh stuck to the branch and pointing towards the camera.  Continue adding anchors for every point you might want a branch to grow.
  
-{{ ::pg_place_anchors.gif?nolink |}}+{{pg_place_anchors.gif?nolink}}
  
 ====Mark the locations where leaves might grow==== ====Mark the locations where leaves might grow====
Line 44: Line 42:
 Select "File->Export mesh..." Select "SpeedTree XML" as the file type and then set the export options as shown below. Select "File->Export mesh..." Select "SpeedTree XML" as the file type and then set the export options as shown below.
  
-{{ ::pg_anchor_export.jpg?nolink |}}+{{pg_anchor_export.jpg?nolink}}
  
 Notice that "Leaf references" is selected.  The helper objects will be replaced by 3D anchors in the exported mesh.  These anchors will act as growth locations when the mesh is used on a model. Using the "by material" option means each unique material will be given an integer id you can use to distinguish branch anchors from leaf anchors.  Notice that "Leaf references" is selected.  The helper objects will be replaced by 3D anchors in the exported mesh.  These anchors will act as growth locations when the mesh is used on a model. Using the "by material" option means each unique material will be given an integer id you can use to distinguish branch anchors from leaf anchors. 
Line 58: Line 56:
 Meshes that are generated as the child of a branch will be deformed by the branch.  Gravity, roll, start angle, and all other branch shaping tools will now control the shape of the mesh.  In the pic below, the "Placement" branch (set to "Spine only") uses gravity to pull down meshes attached to the trunk mesh. Meshes that are generated as the child of a branch will be deformed by the branch.  Gravity, roll, start angle, and all other branch shaping tools will now control the shape of the mesh.  In the pic below, the "Placement" branch (set to "Spine only") uses gravity to pull down meshes attached to the trunk mesh.
  
-{{ ::pg_branch_deformed_meshes.jpg?nolink |}}+{{pg_branch_deformed_meshes.jpg?nolink}}
  
 >**Note:**  The "Y" axis of the mesh asset will be mapped to branch.  Orient the mesh asset (either in the mesh asset bar or in an external editor) so that the mesh "points" along the "Y" axis. >**Note:**  The "Y" axis of the mesh asset will be mapped to branch.  Orient the mesh asset (either in the mesh asset bar or in an external editor) so that the mesh "points" along the "Y" axis.