diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-04-09 05:03:25 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-04-09 05:03:44 +0400 |
commit | b5d3f183b0fd6f72d84fbcdd594f80e70422eb24 (patch) | |
tree | c3a2d297f165c45d63d21a790bc9632264e3d341 /source/blender/blenkernel/BKE_DerivedMesh.h | |
parent | 6ffabfae852f956f5074ddb75e94a4f6fb846d1d (diff) |
Add material storage to derivedmesh.
The variables are considered invalid unless DM_update_materials is
called prior to use. Only use case currently is
mesh drawing. This helps with excessive allocation on the stack during
GPUObject creation, but may help elsewhere in the future as well.
Diffstat (limited to 'source/blender/blenkernel/BKE_DerivedMesh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_DerivedMesh.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index ff1c04fd00d..3afd7d851cb 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -184,6 +184,8 @@ struct DerivedMesh { DerivedMeshType type; float auto_bump_scale; DMDirtyFlag dirty; + int totmat; /* total materials. Will be valid only before object drawing. */ + struct Material **mat; /* material array. Will be valid only before object drawing */ /* use for converting to BMesh which doesn't store bevel weight and edge crease by default */ char cd_flag; @@ -578,6 +580,7 @@ void DM_ensure_tessface(DerivedMesh *dm); void DM_update_tessface_data(DerivedMesh *dm); +void DM_update_materials(DerivedMesh *dm, struct Object *ob); /** interpolates vertex data from the vertices indexed by src_indices in the * source mesh using the given weights and stores the result in the vertex * indexed by dest_index in the dest mesh |