[Bf-blender-cvs] [dadbf3f877d] soc-2019-npr: LANPR: Smooth contour modifier name change.
YimingWu
noreply at git.blender.org
Sun Aug 11 05:05:14 CEST 2019
Commit: dadbf3f877d8777ab5ed6984abfdbccb46b5e332
Author: YimingWu
Date: Sun Aug 11 11:04:51 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rBdadbf3f877d8777ab5ed6984abfdbccb46b5e332
LANPR: Smooth contour modifier name change.
===================================================================
M release/scripts/startup/bl_ui/properties_data_modifier.py
M source/blender/makesdna/DNA_modifier_types.h
M source/blender/makesrna/RNA_access.h
M source/blender/makesrna/intern/rna_modifier.c
M source/blender/modifiers/CMakeLists.txt
M source/blender/modifiers/MOD_modifiertypes.h
D source/blender/modifiers/intern/MOD_mybmesh.c
M source/blender/modifiers/intern/MOD_util.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 105aa88fa85..ae813c06511 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -677,7 +677,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
row.operator("object.multires_external_save", text="Save External...")
row.label()
- def MY_BMESH(self, layout, ob, md):
+ def SMOOTH_CONTOUR(self, layout, ob, md):
split = layout.split(factor=0.25)
col = split.column()
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index b0c883aebd0..37c0065b166 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -88,7 +88,7 @@ typedef enum ModifierType {
eModifierType_MeshSequenceCache = 52,
eModifierType_SurfaceDeform = 53,
eModifierType_WeightedNormal = 54,
- eModifierType_MyBMesh = 55,
+ eModifierType_SmoothContour = 55,
eModifierType_FeatureLine = 56,
NUM_MODIFIER_TYPES,
} ModifierType;
@@ -1768,13 +1768,13 @@ enum {
};
/* Modifier data stored in the blend file */
-typedef struct MyBMeshModifierData {
+typedef struct SmoothContourModifierData {
ModifierData modifier;
struct Object *camera_ob;
void *osd_eval;
int flag; /* options stored here */
short _pad[2];
-} MyBMeshModifierData;
+} SmoothContourModifierData;
typedef struct DataTransferModifierData {
ModifierData modifier;
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index f893aca1a20..f04e8e43743 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -433,7 +433,7 @@ extern StructRNA RNA_MovieTrackingTrack;
extern StructRNA RNA_MulticamSequence;
extern StructRNA RNA_MultiresModifier;
extern StructRNA RNA_MusgraveTexture;
-extern StructRNA RNA_MyBMeshModifier;
+extern StructRNA RNA_SmoothContourModifier;
extern StructRNA RNA_NandController;
extern StructRNA RNA_NearSensor;
extern StructRNA RNA_NlaStrip;
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index ba343dd053b..cae9e2a8c9b 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -104,8 +104,8 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = {
ICON_MOD_WIREFRAME,
"Wireframe",
"Generate a wireframe on the edges of a mesh"},
- {eModifierType_MyBMesh,
- "MY_BMESH",
+ {eModifierType_SmoothContour,
+ "SMOOTH_CONTOUR",
ICON_MOD_SMOOTH,
"Smooth Contour",
"Generate smooth contour geometry for feature line rendering."},
@@ -583,8 +583,8 @@ static StructRNA *rna_Modifier_refine(struct PointerRNA *ptr)
return &RNA_SurfaceDeformModifier;
case eModifierType_WeightedNormal:
return &RNA_WeightedNormalModifier;
- case eModifierType_MyBMesh:
- return &RNA_MyBMeshModifier;
+ case eModifierType_SmoothContour:
+ return &RNA_SmoothContourModifier;
case eModifierType_FeatureLine:
return &RNA_FeatureLineModifier;
/* Default */
@@ -5862,9 +5862,9 @@ static void rna_def_modifier_mybmesh(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
- srna = RNA_def_struct(brna, "MyBMeshModifier", "Modifier");
+ srna = RNA_def_struct(brna, "SmoothContourModifier", "Modifier");
RNA_def_struct_ui_text(srna, "Wireframe Modifier", "Wireframe effect modifier");
- RNA_def_struct_sdna(srna, "MyBMeshModifierData");
+ RNA_def_struct_sdna(srna, "SmoothContourModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM);
prop = RNA_def_property(srna, "do_tri", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index 7fb254ecfdb..3d8f96d1abc 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -71,7 +71,6 @@ set(SRC
intern/MOD_meshsequencecache.c
intern/MOD_mirror.c
intern/MOD_multires.c
- intern/MOD_mybmesh.c
intern/MOD_none.c
intern/MOD_normal_edit.c
intern/MOD_ocean.c
@@ -85,6 +84,7 @@ set(SRC
intern/MOD_skin.c
intern/MOD_smoke.c
intern/MOD_smooth.c
+ intern/MOD_smoothcontour.c
intern/MOD_softbody.c
intern/MOD_solidify.c
intern/MOD_subsurf.c
diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h
index 43e32dfa23c..c57ebeaef2c 100644
--- a/source/blender/modifiers/MOD_modifiertypes.h
+++ b/source/blender/modifiers/MOD_modifiertypes.h
@@ -80,7 +80,7 @@ extern ModifierTypeInfo modifierType_NormalEdit;
extern ModifierTypeInfo modifierType_CorrectiveSmooth;
extern ModifierTypeInfo modifierType_MeshSequenceCache;
extern ModifierTypeInfo modifierType_SurfaceDeform;
-extern ModifierTypeInfo modifierType_MyBMesh;
+extern ModifierTypeInfo modifierType_SmoothContour;
extern ModifierTypeInfo modifierType_WeightedNormal;
extern ModifierTypeInfo modifierType_FeatureLine;
diff --git a/source/blender/modifiers/intern/MOD_mybmesh.c b/source/blender/modifiers/intern/MOD_mybmesh.c
deleted file mode 100644
index 9a229799be6..00000000000
--- a/source/blender/modifiers/intern/MOD_mybmesh.c
+++ /dev/null
@@ -1,4799 +0,0 @@
-/*
- * ***** 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.
- *
- * ***** END GPL LICENSE BLOCK *****
- *
- */
-
-/** \file blender/modifiers/intern/MOD_mybmesh.c
- * \ingroup modifiers
- */
-
-/* This code is based of the tessellation part of the paper
- * "Computing Smooth Surface Contours with Accurate Topology"
- * (Pierre Bénard, Aaron Hertzmann, Michael Kass).
- * Currently available at:
- * http://www.labri.fr/perso/pbenard/publications/contours.html
- *
- * The numbers in the comments refers to the chapters in the paper.
- */
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_object_types.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_math.h"
-#include "BLI_string.h"
-#include "BLI_utildefines.h"
-#include "BLI_buffer.h"
-#include "BLI_alloca.h"
-#include "BLI_ghash.h"
-#include "BLI_gsqueue.h"
-#include "BLI_memarena.h"
-#include "BLI_rand.h"
-#include "BLI_listbase.h"
-#include "BLI_threads.h"
-
-#include "BKE_library_query.h"
-#include "BKE_modifier.h"
-#include "BKE_mesh.h"
-#include "BKE_mesh_mapping.h"
-#include "BKE_deform.h"
-
-#include "bmesh.h"
-#include "bmesh_tools.h"
-
-#include "MOD_util.h"
-#include "MOD_modifiertypes.h"
-
-#include "DEG_depsgraph_build.h"
-
-// BMesh intern
-#include "../../bmesh/intern/bmesh_private.h"
-
-// TODO this modifier depends on OpenSubDiv. So if it's not compiled in, remove this modifier
-
-#include "../../../../intern/opensubdiv/opensubdiv_capi.h"
-#include "../../../../intern/opensubdiv/opensubdiv_converter_capi.h"
-#include "../../../../intern/opensubdiv/opensubdiv_evaluator_capi.h"
-#include "../../../../intern/opensubdiv/opensubdiv_topology_refiner_capi.h"
-
-#include "../../blenkernel/intern/subdiv_converter.h"
-
-#include "PIL_time.h"
-#include "PIL_time_utildefines.h"
-
-struct OpenSubdiv_Evaluator;
-
-typedef struct {
- BMVert *vert; // Only used for shifted verts
- BMEdge *orig_edge;
- BMFace *orig_face;
- float u, v;
-} Vert_buf;
-
-typedef struct {
- BMEdge *cusp_e;
- BMFace *orig_face;
- float cusp_co[3];
- float cusp_no[3];
-
- float u, v;
-} Cusp;
-
-typedef struct {
- bool b_arr[3];
- bool kr_arr[3];
- float co_arr[3][3];
- float u_arr[3];
- float v_arr[3];
-} Cusp_triang;
-
-typedef struct {
- BMVert *vert;
- BMVert *C_vert;
- // Can we extend this radial vert?
- bool extendable;
- bool is_B;
- float radi_plane_no[3];
-} Radi_vert;
-
-typedef struct {
- BMFace *face;
- // Should be front or back facing?
- bool back_f;
-} IncoFace;
-
-typedef struct {
- BMesh *bm;
- BMesh *bm_orig;
-
- float cam_loc[3];
-
- GHash *vert_hash;
-
- BLI_Buffer *new_vert_buffer;
- BLI_Buffer *shifted_verts;
- BLI_Buffer *cusp_edges;
- BLI_Buffer *C_verts;
- BLI_Buffer *cusp_verts;
- BLI_Buffer *radi_vert_buffer;
- // Idx of next inserted vert
- int new_vert_idx;
- // Radial edge vert start idx
- int radi_start_idx;
-
- struct OpenSubdiv_Evaluator *eval;
-} MeshData;
-
-// TODO for Kr look in subdiv.cpp in coutours source code (II)
-
-// TODO dynamic arrays, use BLI_stack, BLI_buffer, BLI_mempool, BLI_memarena.
-
-static void verts_to_limit(BMesh *bm, struct OpenSubdiv_Evaluator *eval)
-{
-
- int i, j;
-
- BMIter iter_v, iter_f;
- BMVert *vert;
- BMFace *f;
-
- // TODO is it possible to only get non adjusted verts?
- // IE not moving a vert more than once.
-
- BM_ITER_MESH_INDEX (f, &iter_f, bm, BM_FACES_OF_MESH, i) {
- BM_ITER_ELEM_INDEX (vert, &iter_v, f, BM_VERTS_OF_FACE, j) {
- float u, v, du[3], dv[3];
- switch (j) {
- case 1:
- u = 1, v = 0;
- break;
- case 2:
- u = v = 1;
- break;
- case 3:
- u = 0, v = 1;
- break;
- default:
- u = v = 0;
- break;
- }
- eval->evaluateLimit(eval, i, u, v, vert->co, du, dv);
- // Adjust vert normal to the limit normal
- cross_v3_v3v3(vert->no, du, dv);
- normalize_v3(vert->no);
- // printf("j: %d\n",j);
- }
- // printf("i: %d\n",i);
- // printf("face i: %d\n", BM_elem_index_get(f));
- }
-}
-
-static Vert_buf
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list