[Bf-blender-cvs] [9ea7fb39820] greasepencil-object: WIP: Fix write hook data
Antonio Vazquez
noreply at git.blender.org
Sat Nov 25 13:55:35 CET 2017
Commit: 9ea7fb398204e1e979731b56c178d3cf89a07a26
Author: Antonio Vazquez
Date: Sat Nov 25 13:47:30 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB9ea7fb398204e1e979731b56c178d3cf89a07a26
WIP: Fix write hook data
===================================================================
M source/blender/blenloader/intern/writefile.c
M source/blender/makesrna/intern/rna_modifier.c
M source/blender/modifiers/intern/MOD_gpencilhook.c
===================================================================
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 0ec03df3f15..b2a6754323a 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1738,6 +1738,13 @@ static void write_modifiers(WriteData *wd, ListBase *modbase)
write_curvemapping(wd, gpmd->cur_thickness);
}
}
+ else if (md->type == eModifierType_GpencilHook) {
+ GpencilHookModifierData *gpmd = (GpencilHookModifierData *)md;
+
+ if (gpmd->curfalloff) {
+ write_curvemapping(wd, gpmd->curfalloff);
+ }
+ }
else if (md->type == eModifierType_Cloth) {
ClothModifierData *clmd = (ClothModifierData *)md;
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 4eede4213d3..d1cd2068fdb 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -173,6 +173,21 @@ static const EnumPropertyItem modifier_warp_falloff_items[] = {
};
#endif
+#ifndef RNA_RUNTIME
+static const EnumPropertyItem modifier_gphook_falloff_items[] = {
+ { eGPHook_Falloff_None, "NONE", 0, "No Falloff", "" },
+ { eGPHook_Falloff_Curve, "CURVE", 0, "Curve", "" },
+ { eGPHook_Falloff_Smooth, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", "" },
+ { eGPHook_Falloff_Sphere, "SPHERE", ICON_SPHERECURVE, "Sphere", "" },
+ { eGPHook_Falloff_Root, "ROOT", ICON_ROOTCURVE, "Root", "" },
+ { eGPHook_Falloff_InvSquare, "INVERSE_SQUARE", ICON_ROOTCURVE, "Inverse Square", "" },
+ { eGPHook_Falloff_Sharp, "SHARP", ICON_SHARPCURVE, "Sharp", "" },
+ { eGPHook_Falloff_Linear, "LINEAR", ICON_LINCURVE, "Linear", "" },
+ { eGPHook_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", "" },
+ { 0, NULL, 0, NULL, NULL }
+};
+#endif
+
/* ***** Data Transfer ***** */
const EnumPropertyItem rna_enum_dt_method_vertex_items[] = {
@@ -5657,7 +5672,7 @@ static void rna_def_modifier_gpencilhook(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE);
- RNA_def_property_enum_items(prop, modifier_warp_falloff_items); /* share the enum */
+ RNA_def_property_enum_items(prop, modifier_gphook_falloff_items); /* share the enum */
RNA_def_property_ui_text(prop, "Falloff Type", "");
RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */
RNA_def_property_update(prop, 0, "rna_Modifier_update");
diff --git a/source/blender/modifiers/intern/MOD_gpencilhook.c b/source/blender/modifiers/intern/MOD_gpencilhook.c
index 511043f7ea5..75be824af38 100644
--- a/source/blender/modifiers/intern/MOD_gpencilhook.c
+++ b/source/blender/modifiers/intern/MOD_gpencilhook.c
@@ -57,10 +57,6 @@
/* temp struct to hold data */
struct GPHookData_cb {
- float(*vertexCos)[3];
-
- int defgrp_index;
-
struct CurveMapping *curfalloff;
char falloff_type;
More information about the Bf-blender-cvs
mailing list