[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28906] branches/soc-2010-rohith291991:
Rohith B V
rohith291991 at gmail.com
Fri May 21 17:46:56 CEST 2010
Revision: 28906
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28906
Author: rohith291991
Date: 2010-05-21 17:46:56 +0200 (Fri, 21 May 2010)
Log Message:
-----------
Modified Paths:
--------------
branches/soc-2010-rohith291991/release/scripts/ui/properties_data_modifier.py
branches/soc-2010-rohith291991/source/blender/blenkernel/BKE_multires.h
branches/soc-2010-rohith291991/source/blender/blenkernel/intern/multires.c
branches/soc-2010-rohith291991/source/blender/editors/object/object_modifier.c
branches/soc-2010-rohith291991/source/blender/makesdna/DNA_modifier_types.h
branches/soc-2010-rohith291991/source/blender/makesrna/RNA_access.h
branches/soc-2010-rohith291991/source/blender/makesrna/intern/rna_modifier.c
branches/soc-2010-rohith291991/source/blender/modifiers/MOD_modifiertypes.h
branches/soc-2010-rohith291991/source/blender/modifiers/intern/MOD_util.c
Added Paths:
-----------
branches/soc-2010-rohith291991/source/blender/modifiers/intern/MOD_quadrangulate.c
Modified: branches/soc-2010-rohith291991/release/scripts/ui/properties_data_modifier.py
===================================================================
--- branches/soc-2010-rohith291991/release/scripts/ui/properties_data_modifier.py 2010-05-21 14:18:07 UTC (rev 28905)
+++ branches/soc-2010-rohith291991/release/scripts/ui/properties_data_modifier.py 2010-05-21 15:46:56 UTC (rev 28906)
@@ -495,6 +495,11 @@
def PARTICLE_SYSTEM(self, layout, ob, md, wide_ui):
layout.label(text="See Particle panel.")
+
+
+ def QUADRANGULATE(self, layout, ob, md, wide_ui):
+ layout.prop(md, "ratio")
+ layout.prop(md, "face_count")
def SCREW(self, layout, ob, md, wide_ui):
split = layout.split()
Modified: branches/soc-2010-rohith291991/source/blender/blenkernel/BKE_multires.h
===================================================================
--- branches/soc-2010-rohith291991/source/blender/blenkernel/BKE_multires.h 2010-05-21 14:18:07 UTC (rev 28905)
+++ branches/soc-2010-rohith291991/source/blender/blenkernel/BKE_multires.h 2010-05-21 15:46:56 UTC (rev 28906)
@@ -52,9 +52,9 @@
void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob,
int updateblock, int simple);
-int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src);
-int multiresModifier_reshapeFromDM(struct MultiresModifierData *mmd, struct Object *ob, struct DerivedMesh *srcdm);
-int multiresModifier_reshapeFromDeformMod(struct MultiresModifierData *mmd, struct Object *ob, struct ModifierData *md);
+int multiresModifier_reshape(struct Object *dst, struct Object *src);
+int multiresModifier_reshapeFromDM(struct Object *ob, struct DerivedMesh *srcdm);
+int multiresModifier_reshapeFromDeformMod(struct Object *ob, struct ModifierData *md);
void multires_stitch_grids(struct Object *);
Modified: branches/soc-2010-rohith291991/source/blender/blenkernel/intern/multires.c
===================================================================
--- branches/soc-2010-rohith291991/source/blender/blenkernel/intern/multires.c 2010-05-21 14:18:07 UTC (rev 28905)
+++ branches/soc-2010-rohith291991/source/blender/blenkernel/intern/multires.c 2010-05-21 15:46:56 UTC (rev 28906)
@@ -207,7 +207,7 @@
}
#endif
-int multiresModifier_reshapeFromDM(MultiresModifierData *mmd, Object *ob, DerivedMesh *srcdm)
+int multiresModifier_reshapeFromDM(Object *ob, DerivedMesh *srcdm)
{
DerivedMesh *mrdm = get_multires_dm (ob);
@@ -228,13 +228,13 @@
}
/* Returns 1 on success, 0 if the src's totvert doesn't match */
-int multiresModifier_reshape(MultiresModifierData *mmd, Object *dst, Object *src)
+int multiresModifier_reshape(Object *dst, Object *src)
{
DerivedMesh *srcdm = src->derivedFinal;
- return multiresModifier_reshapeFromDM(mmd, dst, srcdm);
+ return multiresModifier_reshapeFromDM(dst, srcdm);
}
-int multiresModifier_reshapeFromDeformMod(MultiresModifierData *mmd, Object *ob, ModifierData *md)
+int multiresModifier_reshapeFromDeformMod(Object *ob, ModifierData *md)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
DerivedMesh *dm, *ndm;
@@ -256,7 +256,7 @@
dm->release(dm);
/* Reshaping */
- result= multiresModifier_reshapeFromDM(mmd, ob, ndm);
+ result= multiresModifier_reshapeFromDM(ob, ndm);
/* Cleanup */
ndm->release(ndm);
Modified: branches/soc-2010-rohith291991/source/blender/editors/object/object_modifier.c
===================================================================
--- branches/soc-2010-rohith291991/source/blender/editors/object/object_modifier.c 2010-05-21 14:18:07 UTC (rev 28905)
+++ branches/soc-2010-rohith291991/source/blender/editors/object/object_modifier.c 2010-05-21 15:46:56 UTC (rev 28906)
@@ -413,7 +413,7 @@
multires_force_update(ob);
if (mmd && mti->type==eModifierTypeType_OnlyDeform) {
- multiresModifier_reshapeFromDeformMod (mmd, ob, md);
+ multiresModifier_reshapeFromDeformMod (ob, md);
} else {
dm = mesh_create_derived_for_modifier(scene, ob, md);
if (!dm) {
@@ -972,7 +972,7 @@
return OPERATOR_CANCELLED;
}
- if(!multiresModifier_reshape(mmd, ob, secondob)) {
+ if(!multiresModifier_reshape(ob, secondob)) {
BKE_report(op->reports, RPT_ERROR, "Objects do not have the same number of vertices.");
return OPERATOR_CANCELLED;
}
Modified: branches/soc-2010-rohith291991/source/blender/makesdna/DNA_modifier_types.h
===================================================================
--- branches/soc-2010-rohith291991/source/blender/makesdna/DNA_modifier_types.h 2010-05-21 14:18:07 UTC (rev 28905)
+++ branches/soc-2010-rohith291991/source/blender/makesdna/DNA_modifier_types.h 2010-05-21 15:46:56 UTC (rev 28906)
@@ -66,6 +66,7 @@
eModifierType_ShapeKey,
eModifierType_Solidify,
eModifierType_Screw,
+ eModifierType_Quadrangulate,
NUM_MODIFIER_TYPES
} ModifierType;
@@ -113,6 +114,14 @@
char name[32]; /* optional vertexgroup name */
} LatticeModifierData;
+typedef struct TestModifierData {
+ ModifierData modifier;
+
+ struct Object *object;
+ char name[32]; /* optional vertexgroup name */
+}TestModifierData;
+
+
typedef struct CurveModifierData {
ModifierData modifier;
@@ -335,6 +344,14 @@
int faceCount;
} DecimateModifierData;
+
+typedef struct QuadrangulateModifierData {
+ ModifierData modifier;
+
+ float percent;
+ int faceCount;
+} QuadrangulateModifierData;
+
/* Smooth modifier flags */
#define MOD_SMOOTH_X (1<<1)
#define MOD_SMOOTH_Y (1<<2)
Modified: branches/soc-2010-rohith291991/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/soc-2010-rohith291991/source/blender/makesrna/RNA_access.h 2010-05-21 14:18:07 UTC (rev 28905)
+++ branches/soc-2010-rohith291991/source/blender/makesrna/RNA_access.h 2010-05-21 15:46:56 UTC (rev 28906)
@@ -369,6 +369,7 @@
extern StructRNA RNA_PropertySensor;
extern StructRNA RNA_PythonConstraint;
extern StructRNA RNA_PythonController;
+extern StructRNA RNA_QuadrangulateModifier;
extern StructRNA RNA_RadarSensor;
extern StructRNA RNA_RandomSensor;
extern StructRNA RNA_RaySensor;
Modified: branches/soc-2010-rohith291991/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- branches/soc-2010-rohith291991/source/blender/makesrna/intern/rna_modifier.c 2010-05-21 14:18:07 UTC (rev 28905)
+++ branches/soc-2010-rohith291991/source/blender/makesrna/intern/rna_modifier.c 2010-05-21 15:46:56 UTC (rev 28906)
@@ -55,6 +55,7 @@
{eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""},
{eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""},
{eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""},
+ {eModifierType_Quadrangulate, "QUADRANGULATE", ICON_MOD_MIRROR, "Quadrangulate", ""},
{eModifierType_Screw, "SCREW", ICON_MOD_SCREW, "Screw", ""},
{eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""},
{eModifierType_Solidify, "SOLIDIFY", ICON_MOD_SOLIDIFY, "Solidify", ""},
@@ -168,6 +169,8 @@
return &RNA_SolidifyModifier;
case eModifierType_Screw:
return &RNA_ScrewModifier;
+ case eModifierType_Quadrangulate:
+ return &RNA_QuadrangulateModifier;
default:
return &RNA_Modifier;
}
@@ -787,6 +790,31 @@
RNA_def_property_ui_text(prop, "Face Count", "The current number of faces in the decimated mesh");
}
+
+static void rna_def_modifier_quadrangulate(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "QuadrangulateModifier", "Modifier");
+ RNA_def_struct_ui_text(srna, "Quadrangulate Modifier", "Quadrangulation modifier");
+ RNA_def_struct_sdna(srna, "QuadrangulateModifierData");
+ RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM);
+
+ prop= RNA_def_property(srna, "ratio", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "percent");
+ RNA_def_property_range(prop, 0, 1);
+ RNA_def_property_ui_text(prop, "Ratio", "Defines the ratio of triangles to reduce to");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "face_count", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "faceCount");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Face Count", "The current number of faces in the decimated mesh");
+}
+
+
+
static void rna_def_modifier_wave(BlenderRNA *brna)
{
StructRNA *srna;
@@ -2253,6 +2281,7 @@
rna_def_modifier_build(brna);
rna_def_modifier_mirror(brna);
rna_def_modifier_decimate(brna);
+ rna_def_modifier_quadrangulate(brna);
rna_def_modifier_wave(brna);
rna_def_modifier_armature(brna);
rna_def_modifier_hook(brna);
Modified: branches/soc-2010-rohith291991/source/blender/modifiers/MOD_modifiertypes.h
===================================================================
--- branches/soc-2010-rohith291991/source/blender/modifiers/MOD_modifiertypes.h 2010-05-21 14:18:07 UTC (rev 28905)
+++ branches/soc-2010-rohith291991/source/blender/modifiers/MOD_modifiertypes.h 2010-05-21 15:46:56 UTC (rev 28906)
@@ -32,6 +32,7 @@
/* ****************** Type structures for all modifiers ****************** */
+
extern ModifierTypeInfo modifierType_None;
extern ModifierTypeInfo modifierType_Subsurf;
extern ModifierTypeInfo modifierType_Lattice;
@@ -67,6 +68,7 @@
extern ModifierTypeInfo modifierType_ShapeKey;
extern ModifierTypeInfo modifierType_Solidify;
extern ModifierTypeInfo modifierType_Screw;
+extern ModifierTypeInfo modifierType_Quadrangulate;
/* MOD_util.c */
void modifier_type_init(ModifierTypeInfo *types[], ModifierType type);
Added: branches/soc-2010-rohith291991/source/blender/modifiers/intern/MOD_quadrangulate.c
===================================================================
--- branches/soc-2010-rohith291991/source/blender/modifiers/intern/MOD_quadrangulate.c (rev 0)
+++ branches/soc-2010-rohith291991/source/blender/modifiers/intern/MOD_quadrangulate.c 2010-05-21 15:46:56 UTC (rev 28906)
@@ -0,0 +1,87 @@
+/*
+* $Id: MOD_Quadrangulate.c 28152 2010-04-12 22:33:43Z campbellbarton $
+*
+* ***** 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
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list