== Multires ==
Cleaned up bad level calls for multires; moved most of multires functions to blenkern, where they should have been in the first place. Functionality of the tool is unchanged.
This commit is contained in:
@@ -207,15 +207,6 @@ void post_layer_create(struct VLayer *vlayer);
|
||||
void post_layer_destroy(struct VLayer *vlayer);
|
||||
void post_server_add(void);
|
||||
|
||||
/* multires.c */
|
||||
struct Multires;
|
||||
struct MultiresLevel;
|
||||
struct MultiresLevel *multires_level_n(struct Multires *mr, int n);
|
||||
void multires_free(struct Multires *mr);
|
||||
void multires_set_level(struct Object *ob, struct Mesh *me, const int render);
|
||||
void multires_update_levels(struct Mesh *me, const int render);
|
||||
void multires_calc_level_maps(struct MultiresLevel *lvl);
|
||||
struct Multires *multires_copy(struct Multires *orig);
|
||||
/* sculptmode.c */
|
||||
struct SculptData;
|
||||
void sculpt_reset_curve(struct SculptData *sd);
|
||||
|
||||
67
source/blender/blenkernel/BKE_multires.h
Normal file
67
source/blender/blenkernel/BKE_multires.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2007 by Nicholas Bishop
|
||||
* All rights reserved.
|
||||
*
|
||||
* The Original Code is: all of this file.
|
||||
*
|
||||
* Contributor(s): none yet.
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
struct CustomData;
|
||||
struct EditMesh;
|
||||
struct Multires;
|
||||
struct MultiresLevel;
|
||||
struct Mesh;
|
||||
struct Object;
|
||||
|
||||
/* Level access */
|
||||
struct MultiresLevel *current_level(struct Multires *mr);
|
||||
struct MultiresLevel *multires_level_n(struct Multires *mr, int n);
|
||||
|
||||
/* Level control */
|
||||
void multires_add_level(struct Object *ob, struct Mesh *me, const char subdiv_type);
|
||||
void multires_set_level(struct Object *ob, struct Mesh *me, const int render);
|
||||
void multires_free_level(struct MultiresLevel *lvl);
|
||||
|
||||
void multires_edge_level_update(struct Object *ob, struct Mesh *me);
|
||||
|
||||
void multires_free(struct Multires *mr);
|
||||
struct Multires *multires_copy(struct Multires *orig);
|
||||
void multires_create(struct Mesh *me);
|
||||
|
||||
/* CustomData */
|
||||
void multires_delete_layer(struct Mesh *me, struct CustomData *cd, const int type, int n);
|
||||
void multires_add_layer(struct Mesh *me, struct CustomData *cd, const int type, const int n);
|
||||
void multires_del_lower_customdata(struct Multires *mr, struct MultiresLevel *cr_lvl);
|
||||
/* After adding or removing vcolor layers, run this */
|
||||
void multires_load_cols(struct Mesh *me);
|
||||
|
||||
/* Private (used in multires-firstlevel.c) */
|
||||
void multires_level_to_mesh(struct Object *ob, struct Mesh *me, const int render);
|
||||
void multires_update_levels(struct Mesh *me, const int render);
|
||||
void multires_update_first_level(struct Mesh *me, struct EditMesh *em);
|
||||
void multires_update_customdata(struct MultiresLevel *lvl1, struct CustomData *src,
|
||||
struct CustomData *dst, const int type);
|
||||
void multires_customdata_to_mesh(struct Mesh *me, struct EditMesh *em,
|
||||
struct MultiresLevel *lvl, struct CustomData *src,
|
||||
struct CustomData *dst, const int type);
|
||||
@@ -310,13 +310,7 @@ void post_geometry_free_constraint(struct VNode *vnode) {}
|
||||
void post_layer_create(struct VLayer *vlayer) {}
|
||||
void post_layer_destroy(struct VLayer *vlayer) {}
|
||||
void post_server_add(void) {}
|
||||
/* Multires/sculpt stubs */
|
||||
struct MultiresLevel *multires_level_n(struct Multires *mr, int n) {return NULL;}
|
||||
void multires_free(struct Multires *mr) {}
|
||||
void multires_set_level(struct Object *ob, struct Mesh *me, const int render) {}
|
||||
void multires_update_levels(struct Mesh *me, const int render) {}
|
||||
void multires_calc_level_maps(struct MultiresLevel *lvl) {}
|
||||
struct Multires *multires_copy(struct Multires *orig) {return NULL;}
|
||||
/* sculpt stubs */
|
||||
void sculpt_reset_curve(struct SculptData *sd) {}
|
||||
void sculptmode_init(struct Scene *sce) {}
|
||||
void sculptmode_free_all(struct Scene *sce) {}
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#include "BKE_material.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_subsurf.h"
|
||||
#include "BKE_texture.h"
|
||||
@@ -87,8 +88,6 @@
|
||||
#include "BIF_gl.h"
|
||||
#include "BIF_glutil.h"
|
||||
|
||||
#include "multires.h"
|
||||
|
||||
// headers for fluidsim bobj meshes
|
||||
#include <stdlib.h>
|
||||
#include "LBM_fluidsim.h"
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
#include "BKE_DerivedMesh.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_subsurf.h"
|
||||
#include "BKE_displist.h"
|
||||
#include "BKE_library.h"
|
||||
@@ -83,8 +84,6 @@
|
||||
#include "BLI_editVert.h"
|
||||
#include "BLI_arithb.h"
|
||||
|
||||
#include "multires.h"
|
||||
|
||||
int update_realtime_texture(MTFace *tface, double time)
|
||||
{
|
||||
Image *ima;
|
||||
|
||||
@@ -43,13 +43,13 @@
|
||||
#include "BKE_customdata.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_multires.h"
|
||||
|
||||
#include "BLI_editVert.h"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "blendef.h"
|
||||
#include "multires.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -392,7 +392,6 @@ void multires_delete_layer(Mesh *me, CustomData *cd, const int type, int n)
|
||||
}
|
||||
}
|
||||
|
||||
MultiresLevel *current_level(Multires *mr);
|
||||
void multires_add_layer(Mesh *me, CustomData *cd, const int type, const int n)
|
||||
{
|
||||
if(me && me->mr && cd) {
|
||||
1393
source/blender/blenkernel/intern/multires.c
Normal file
1393
source/blender/blenkernel/intern/multires.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -147,8 +147,6 @@
|
||||
#include "BLO_undofile.h"
|
||||
#include "BLO_readblenfile.h" // streaming read pipe, for BLO_readblenfile BLO_readblenfilememory
|
||||
|
||||
#include "multires.h"
|
||||
|
||||
#include "readfile.h"
|
||||
|
||||
#include "genfile.h"
|
||||
|
||||
@@ -43,39 +43,15 @@ struct uiBlock;
|
||||
int multires_test();
|
||||
int multires_level1_test();
|
||||
|
||||
struct MultiresLevel *multires_level_n(struct Multires *mr, int n);
|
||||
|
||||
void multires_draw_interface(struct uiBlock *block, unsigned short cx, unsigned short cy);
|
||||
void multires_disp_map(void *, void*);
|
||||
|
||||
void multires_make(void *ob, void *me);
|
||||
void multires_delete(void *ob, void *me);
|
||||
struct Multires *multires_copy(struct Multires *orig);
|
||||
void multires_free(struct Multires *mr);
|
||||
void multires_free_level(struct MultiresLevel *lvl);
|
||||
void multires_subdivide(void *ob, void *me);
|
||||
void multires_del_lower(void *ob, void *me);
|
||||
void multires_del_higher(void *ob, void *me);
|
||||
void multires_add_level(void *ob, void *me);
|
||||
void multires_set_level_cb(void *ob, void *me);
|
||||
void multires_set_level(struct Object *ob, struct Mesh *me, const int render);
|
||||
void multires_update_levels(struct Mesh *me, const int render);
|
||||
void multires_level_to_mesh(struct Object *ob, struct Mesh *me, const int render);
|
||||
void multires_edge_level_update(void *ob, void *me);
|
||||
void multires_edge_level_update_cb(void *ob, void *me);
|
||||
int multires_modifier_warning();
|
||||
|
||||
/* after adding or removing vcolor layers, run this */
|
||||
void multires_load_cols(Mesh *me);
|
||||
|
||||
/* multires-firstlevel.c */
|
||||
/* Generic */
|
||||
void multires_update_first_level(struct Mesh *me, struct EditMesh *em);
|
||||
void multires_update_customdata(struct MultiresLevel *lvl1, struct CustomData *src,
|
||||
struct CustomData *dst, const int type);
|
||||
void multires_customdata_to_mesh(struct Mesh *me, struct EditMesh *em, struct MultiresLevel *lvl,
|
||||
struct CustomData *src, struct CustomData *dst, const int type);
|
||||
void multires_del_lower_customdata(struct Multires *mr, struct MultiresLevel *cr_lvl);
|
||||
|
||||
void multires_add_layer(struct Mesh *me, struct CustomData *cd, const int type, const int n);
|
||||
void multires_delete_layer(struct Mesh *me, struct CustomData *cd, const int type, int n);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Mesh.c 12892 2007-12-15 17:41:13Z joeedh $
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
||||
*
|
||||
@@ -60,6 +60,7 @@
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_material.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_library.h"
|
||||
#include "BKE_DerivedMesh.h"
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_packedFile.h"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_scene.h"
|
||||
@@ -5865,7 +5866,7 @@ void editing_panel_mesh_multires()
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
but= uiDefBut(block,BUT,B_NOP,"Add Level", cx,cy,134,19,0,0,0,0,0,"Add a new level of subdivision at the end of the chain");
|
||||
uiButSetFunc(but,multires_add_level,ob,me);
|
||||
uiButSetFunc(but, multires_subdivide, ob, me);
|
||||
uiDefButC(block, MENU, B_NOP, subsurfmenu, cx + 134, cy, 134, 19, &G.scene->toolsettings->multires_subdiv_type, 0, 0, 0, 0, "Selects type of subdivision algorithm.");
|
||||
cy-= 20;
|
||||
|
||||
@@ -5881,7 +5882,7 @@ void editing_panel_mesh_multires()
|
||||
cy-= 20;
|
||||
|
||||
but= uiDefButC(block,NUM,B_NOP,"Edges: ",cx,cy,268,19,(char *)&me->mr->edgelvl,1.0,me->mr->level_count,0,0,"Set level of edges to display");
|
||||
uiButSetFunc(but,multires_edge_level_update,ob,me);
|
||||
uiButSetFunc(but,multires_edge_level_update_cb,ob,me);
|
||||
cy-= 20;
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
#include "BKE_displist.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_texture.h"
|
||||
#include "BKE_utildefines.h"
|
||||
@@ -93,7 +94,6 @@
|
||||
#include "mydevice.h"
|
||||
#include "blendef.h"
|
||||
#include "butspace.h"
|
||||
#include "multires.h"
|
||||
|
||||
#include "BSE_trans_types.h"
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_material.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_texture.h"
|
||||
#include "BKE_utildefines.h"
|
||||
|
||||
@@ -117,6 +117,7 @@
|
||||
#include "BKE_material.h"
|
||||
#include "BKE_mball.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_nla.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_particle.h"
|
||||
@@ -178,7 +179,6 @@
|
||||
|
||||
#include "blendef.h"
|
||||
#include "butspace.h"
|
||||
#include "multires.h"
|
||||
#include "BIF_transform.h"
|
||||
|
||||
#include "BIF_poseobject.h"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -86,6 +86,7 @@
|
||||
#include "BKE_ipo.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_scene.h"
|
||||
#include "BKE_texture.h"
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_mesh.h"
|
||||
#include "BKE_modifier.h"
|
||||
#include "BKE_multires.h"
|
||||
#include "BKE_object.h"
|
||||
#include "BKE_utildefines.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user