Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
| Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | #define INIT_GP_TYPE(typeName) \ | ||||
| INIT_GP_TYPE(Smooth); | INIT_GP_TYPE(Smooth); | ||||
| INIT_GP_TYPE(Hook); | INIT_GP_TYPE(Hook); | ||||
| INIT_GP_TYPE(Offset); | INIT_GP_TYPE(Offset); | ||||
| INIT_GP_TYPE(Armature); | INIT_GP_TYPE(Armature); | ||||
| INIT_GP_TYPE(Time); | INIT_GP_TYPE(Time); | ||||
| #undef INIT_GP_TYPE | #undef INIT_GP_TYPE | ||||
| } | } | ||||
| /* verify if valid layer and pass index */ | /* verify if valid layer, material and pass index */ | ||||
| bool is_stroke_affected_by_modifier(Object *ob, | bool is_stroke_affected_by_modifier(Object *ob, | ||||
| char *mlayername, | char *mlayername, | ||||
| char *mmaterialname, | |||||
| int mpassindex, | int mpassindex, | ||||
| int gpl_passindex, | int gpl_passindex, | ||||
| int minpoints, | int minpoints, | ||||
| bGPDlayer *gpl, | bGPDlayer *gpl, | ||||
| bGPDstroke *gps, | bGPDstroke *gps, | ||||
| bool inv1, | bool inv1, | ||||
| bool inv2, | bool inv2, | ||||
| bool inv3) | bool inv3, | ||||
| bool inv4) | |||||
| { | { | ||||
| MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); | Material *ma = give_current_material(ob, gps->mat_nr + 1); | ||||
| MaterialGPencilStyle *gp_style = ma->gp_style; | |||||
| /* omit if filter by layer */ | /* omit if filter by layer */ | ||||
| if (mlayername[0] != '\0') { | if (mlayername[0] != '\0') { | ||||
| if (inv1 == false) { | if (inv1 == false) { | ||||
| if (!STREQ(mlayername, gpl->info)) { | if (!STREQ(mlayername, gpl->info)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| if (STREQ(mlayername, gpl->info)) { | if (STREQ(mlayername, gpl->info)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* omit if filter by material */ | |||||
| if (mmaterialname[0] != '\0') { | |||||
| if (inv4 == false) { | |||||
| if (!STREQ(mmaterialname, ma->id.name + 2)) { | |||||
| return false; | |||||
| } | |||||
| } | |||||
| else { | |||||
| if (STREQ(mmaterialname, ma->id.name + 2)) { | |||||
| return false; | |||||
| } | |||||
| } | |||||
| } | |||||
| /* verify layer pass */ | /* verify layer pass */ | ||||
| if (gpl_passindex > 0) { | if (gpl_passindex > 0) { | ||||
| if (inv3 == false) { | if (inv3 == false) { | ||||
| if (gpl->pass_index != gpl_passindex) { | if (gpl->pass_index != gpl_passindex) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines | |||||