Subdiv: Move mesh creation functionality to own header

This commit is contained in:
Sergey Sharybin 2018-09-04 15:32:01 +02:00
parent 916edab639
commit c9707a408f
9 changed files with 62 additions and 17 deletions

View File

@ -171,22 +171,6 @@ Subdiv *BKE_subdiv_new_from_mesh(const SubdivSettings *settings,
void BKE_subdiv_free(Subdiv *subdiv);
/* =========================== SUBDIV TO MESH API =========================== */
typedef struct SubdivToMeshSettings {
/* Resolution at which ptex are being evaluated.
* This defines how many vertices final mesh will have: every ptex has
* resolution^2 vertices.
*/
int resolution;
} SubdivToMeshSettings;
/* Create real hi-res mesh from subdivision, all geometry is "real". */
struct Mesh *BKE_subdiv_to_mesh(
Subdiv *subdiv,
const SubdivToMeshSettings *settings,
const struct Mesh *coarse_mesh);
/* ============================ DISPLACEMENT API ============================ */
void BKE_subdiv_displacement_attach_from_multires(

View File

@ -0,0 +1,54 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2018 by Blender Foundation.
* All rights reserved.
*
* Contributor(s): Sergey Sharybin.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file BKE_subdiv_mesh.h
* \ingroup bke
* \since July 2018
* \author Sergey Sharybin
*/
#ifndef __BKE_SUBDIV_MESH_H__
#define __BKE_SUBDIV_MESH_H__
#include "BLI_sys_types.h"
struct Mesh;
struct Subdiv;
typedef struct SubdivToMeshSettings {
/* Resolution at which ptex are being evaluated.
* This defines how many vertices final mesh will have: every ptex has
* resolution^2 vertices.
*/
int resolution;
} SubdivToMeshSettings;
/* Create real hi-res mesh from subdivision, all geometry is "real". */
struct Mesh *BKE_subdiv_to_mesh(
struct Subdiv *subdiv,
const SubdivToMeshSettings *settings,
const struct Mesh *coarse_mesh);
#endif /* __BKE_SUBDIV)MESH_H__ */

View File

@ -327,6 +327,7 @@ set(SRC
BKE_subdiv.h
BKE_subdiv_eval.h
BKE_subdiv_foreach.h
BKE_subdiv_mesh.h
BKE_subsurf.h
BKE_suggestions.h
BKE_text.h

View File

@ -44,6 +44,7 @@
#include "BKE_subdiv.h"
#include "BKE_subdiv_eval.h"
#include "BKE_subdiv_foreach.h"
#include "BKE_subdiv_mesh.h"
#include "DEG_depsgraph_query.h"

View File

@ -39,6 +39,7 @@
#include "BKE_modifier.h"
#include "BKE_multires.h"
#include "BKE_subdiv.h"
#include "BKE_subdiv_mesh.h"
void BKE_multires_subdiv_settings_init(
SubdivSettings *settings,

View File

@ -43,6 +43,7 @@
#include "BKE_mesh.h"
#include "BKE_key.h"
#include "BKE_subdiv.h"
#include "BKE_subdiv_mesh.h"
#include "MEM_guardedalloc.h"

View File

@ -27,7 +27,7 @@
* \ingroup bke
*/
#include "BKE_subdiv.h"
#include "BKE_subdiv_mesh.h"
#include "atomic_ops.h"
@ -42,6 +42,7 @@
#include "BKE_mesh.h"
#include "BKE_key.h"
#include "BKE_subdiv.h"
#include "BKE_subdiv_eval.h"
#include "BKE_subdiv_foreach.h"

View File

@ -46,6 +46,7 @@
#include "BKE_multires.h"
#include "BKE_modifier.h"
#include "BKE_subdiv.h"
#include "BKE_subdiv_mesh.h"
#include "BKE_subsurf.h"
#include "DEG_depsgraph_query.h"

View File

@ -44,6 +44,7 @@
#include "BKE_cdderivedmesh.h"
#include "BKE_scene.h"
#include "BKE_subdiv.h"
#include "BKE_subdiv_mesh.h"
#include "BKE_subsurf.h"
#include "DEG_depsgraph.h"