diff options
Diffstat (limited to 'source/blender/blenkernel/intern/linestyle.c')
-rw-r--r-- | source/blender/blenkernel/intern/linestyle.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c index bcdaf9b7af0..b97bf0ed9b0 100644 --- a/source/blender/blenkernel/intern/linestyle.c +++ b/source/blender/blenkernel/intern/linestyle.c @@ -53,8 +53,6 @@ #include "BKE_colortools.h" #include "BKE_animsys.h" -#include "RNA_access.h" - static const char *modifier_name[LS_MODIFIER_NUM] = { NULL, "Along Stroke", @@ -201,8 +199,11 @@ FreestyleLineStyle *BKE_linestyle_copy(FreestyleLineStyle *linestyle) new_linestyle->dash3 = linestyle->dash3; new_linestyle->gap3 = linestyle->gap3; new_linestyle->panel = linestyle->panel; + new_linestyle->sort_key = linestyle->sort_key; + new_linestyle->integration_type = linestyle->integration_type; new_linestyle->texstep = linestyle->texstep; new_linestyle->pr_texture = linestyle->pr_texture; + new_linestyle->use_nodes = linestyle->use_nodes; for (m = (LineStyleModifier *)linestyle->color_modifiers.first; m; m = m->next) BKE_linestyle_color_modifier_copy(new_linestyle, m); for (m = (LineStyleModifier *)linestyle->alpha_modifiers.first; m; m = m->next) @@ -212,6 +213,10 @@ FreestyleLineStyle *BKE_linestyle_copy(FreestyleLineStyle *linestyle) for (m = (LineStyleModifier *)linestyle->geometry_modifiers.first; m; m = m->next) BKE_linestyle_geometry_modifier_copy(new_linestyle, m); + if (linestyle->id.lib) { + BKE_id_lib_local_paths(G.main, linestyle->id.lib, &new_linestyle->id); + } + return new_linestyle; } @@ -278,6 +283,9 @@ LineStyleModifier *BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyl LineStyleModifier *m; m = alloc_color_modifier(name, type); + if (UNLIKELY(m == NULL)) { + return NULL; + } m->blend = MA_RAMP_BLEND; switch (type) { @@ -312,6 +320,9 @@ LineStyleModifier *BKE_linestyle_color_modifier_copy(FreestyleLineStyle *linesty LineStyleModifier *new_m; new_m = alloc_color_modifier(m->name, m->type); + if (UNLIKELY(new_m == NULL)) { + return NULL; + } new_m->influence = m->influence; new_m->flags = m->flags; new_m->blend = m->blend; |