diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2006-11-06 04:08:26 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2006-11-06 04:08:26 +0300 |
commit | 8e97a2955b2f99ec61189cb972c09676a013a60b (patch) | |
tree | 89e67578ceac5a670a309b72295156cbfc7f05c7 /source/blender/makesdna | |
parent | 6feb2cc4f6d4c2131b959b77a8b87a5d7c9412a4 (diff) |
Merged Google Summer of Code sculptmode/multires/retopo tools.
From the tracker:
https://projects.blender.org/tracker/index.php?func=detail&aid=5018&group_id=9&atid=127
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_curve_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_meshdata_types.h | 60 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 80 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_view3d_types.h | 6 |
6 files changed, 150 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 04b7b4804b7..626e7cf4167 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -229,6 +229,7 @@ typedef struct IpoCurve { #define CU_STRETCH 128 #define CU_OFFS_PATHDIST 256 #define CU_FAST 512 /* Font: no filling inside editmode */ +#define CU_RETOPO 1024 /* spacemode */ #define CU_LEFT 0 diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index a57791be06d..d0ef6724ff0 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -47,6 +47,8 @@ struct MCol; struct MSticky; struct Mesh; struct OcInfo; +struct Multires; +struct PartialVisibility; typedef struct TFace { @@ -99,6 +101,8 @@ typedef struct Mesh { short totcol; short subsurftype; + struct Multires *mr; /* Multiresolution modeling data */ + struct PartialVisibility *pv; /*ifdef WITH_VERSE*/ /* not written in file, pointer at geometry VerseNode */ void *vnode; diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index 34c3cc904f1..a091a2d4ce7 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -75,6 +75,66 @@ typedef struct MSelect { int index; int type; } MSelect; + +/* Multiresolution modeling */ +typedef struct MultiresCol { + float a, r, g, b, u, v; +} MultiresCol; +typedef struct MultiresFace { + unsigned int v[4]; + unsigned int mid; + unsigned int childrenstart; + char flag, pad[3]; +} MultiresFace; +typedef struct MultiresEdge { + unsigned int v[2]; + unsigned int mid; +} MultiresEdge; + +typedef struct MultiresTexColFace { + /* vertex colors and texfaces */ + void *tex_page; + MultiresCol col[4]; + short tex_mode, tex_tile, tex_unwrap; + char tex_flag, tex_transp; +} MultiresTexColFace; + +typedef struct MultiresMapNode { + struct MultiresMapNode *next, *prev; + int Index, pad; +} MultiresMapNode; + +typedef struct MultiresLevel { + struct MultiresLevel *next, *prev; + + MVert *verts; + MultiresFace *faces; + MultiresTexColFace *texcolfaces; + MultiresEdge *edges; + ListBase *vert_edge_map; + ListBase *vert_face_map; + + unsigned int totvert, totface, totedge, pad; +} MultiresLevel; + +typedef struct Multires { + ListBase levels; + unsigned char level_count, current, newlvl, edgelvl, pinlvl, renderlvl; + unsigned char use_col, use_tex; + + /* Vertex groups are stored only for the level 1 mesh, for all other + * levels it's calculated when multires_level_to_mesh() is called */ + MDeformVert *dverts; +} Multires; + +typedef struct PartialVisibility { + unsigned int *vert_map; /* vert_map[Old Index]= New Index */ + int *edge_map; /* edge_map[Old Index]= New Index, -1= hidden */ + MFace *old_faces; + MEdge *old_edges; + unsigned int totface, totedge, totvert, pad; +} PartialVisibility; + /* mvert->flag (1=SELECT) */ #define ME_SPHERETEST 2 #define ME_SPHERETEMP 4 diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 22bcf432c48..fe43676f1db 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -49,6 +49,7 @@ struct Scene; struct Image; struct Group; struct bNodeTree; +struct PropsetData; typedef struct Base { struct Base *next, *prev; @@ -357,6 +358,74 @@ typedef struct ToolSettings { } ToolSettings; +/* Used by all brushes to store their properties, which can be directly set + by the interface code. Note that not all properties are actually used by + all the brushes. */ +typedef struct BrushData +{ + short size; + char strength, dir; /* Not used for smooth brush */ + char airbrush; + char pad[7]; +} BrushData; + +struct RenderInfo; +struct SculptUndo; +typedef struct SculptData +{ + /* Cache of the OpenGL matrices */ + double modelviewmat[16]; + double projectionmat[16]; + int viewport[4]; + + /* Pointers to all of sculptmodes's textures */ + struct MTex *mtex[10]; + + struct Object *active_ob; + + /* An array of lists; array is sized as + large as the number of verts in the mesh, + the list for each vert contains the index + for all the faces that use that vertex */ + struct ListBase *vertex_users; + + /* Used to cache the render of the active texture */ + struct RenderInfo *texrndr; + + struct PropsetData *propset_data; + + struct ListBase undo; + struct SculptUndo *undo_cur; + + /* For rotating around a pivot point */ + vec3f pivot; + + /* Settings for each brush */ + BrushData drawbrush, smoothbrush, pinchbrush, inflatebrush, grabbrush, layerbrush; + + /* Number of nodes in vertex_users */ + int vertex_users_size; + + short brush_type; + + /* Symmetry is separate from the other BrushData because the same + settings are always used for all brush types */ + short symm_x, symm_y, symm_z; + + /* For the Brush Shape */ + float texsize[3]; + short texact, texnr; + short spacing; + char texrept; + char texfade; + + char averaging, propset, pad[2]; +} SculptData; + +#define SCULPTREPT_DRAG 1 +#define SCULPTREPT_TILE 2 +#define SCULPTREPT_3D 3 + typedef struct Scene { ID id; struct Object *camera; @@ -405,6 +474,9 @@ typedef struct Scene { struct DagForest *theDag; short dagisvalid, dagflags; short pad4, recalc; /* recalc = counterpart of ob->recalc */ + + /* Sculptmode data */ + struct SculptData sculptdata; } Scene; @@ -549,6 +621,14 @@ typedef struct Scene { #define FFMPEG_MULTIPLEX_AUDIO 1 #define FFMPEG_AUTOSPLIT_OUTPUT 2 +/* SculptData brushtype */ +#define DRAW_BRUSH 1 +#define SMOOTH_BRUSH 2 +#define PINCH_BRUSH 3 +#define INFLATE_BRUSH 4 +#define GRAB_BRUSH 5 +#define LAYER_BRUSH 6 + /* toolsettings->imagepaint_flag */ #define IMAGEPAINT_DRAWING 1 #define IMAGEPAINT_DRAW_TOOL 2 diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index eb787682755..f9db4633280 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -258,7 +258,6 @@ extern UserDef U; /* from usiblender.c !!!! */ #define USER_DISABLE_SOUND 2 #define USER_DISABLE_MIPMAP 4 - /* vrml flag */ #define USER_VRML_LAYERS 1 diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index dda40b67bf7..be3a5099d7b 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -34,6 +34,7 @@ #ifndef DNA_VIEW3D_TYPES_H #define DNA_VIEW3D_TYPES_H +struct ViewDepths; struct Object; struct Image; struct Tex; @@ -41,6 +42,7 @@ struct SpaceLink; struct Base; struct BoundBox; struct RenderInfo; +struct RetopoViewData; /* This is needed to not let VC choke on near and far... old * proprietary MS extensions... */ @@ -95,6 +97,8 @@ typedef struct View3D { struct BGpic *bgpic; struct View3D *localvd; struct RenderInfo *ri; + struct RetopoViewData *retopo_view_data; + struct ViewDepths *depths; /** * The drawing mode for the 3d display. Set to OB_WIRE, OB_SOLID, @@ -104,7 +108,7 @@ typedef struct View3D { int lay, layact; short scenelock, around, camzoom; - short pad1; + char pivot_last, pad1; /* pivot_last is for rotating around the last edited element */ float lens, grid, gridview, pixsize, near, far; float camdx, camdy; /* camera view offsets, 1.0 = viewplane moves entire width/height */ |