Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/bl_ui/properties_data_gpencil.py3
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py4
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c16
-rw-r--r--source/blender/makesdna/DNA_gpencil_modifier_types.h3
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c6
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c11
7 files changed, 43 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index b53e8c62599..29ba3c1ff83 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -188,6 +188,9 @@ class DATA_PT_gpencil_layer_optionpanel(LayerDataButtonsPanel, Panel):
col.prop(gpl, "line_change", text="Stroke Thickness")
col = layout.row(align=True)
+ col.prop(gpl, "pass_index")
+
+ col = layout.row(align=True)
col.prop(gpl, "lock_material")
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 55ec0d2c070..36a5c91f44d 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1813,6 +1813,10 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
row.prop_search(md, "layer", gpd, "layers", text="", icon='GREASEPENCIL')
row.prop(md, "invert_layers", text="", icon='ARROW_LEFTRIGHT')
+ row = layout.row(align=True)
+ row.prop(md, "pass_index", text="Pass")
+ row.prop(md, "invert_pass", text="", icon='ARROW_LEFTRIGHT')
+
row = layout.row()
row.enabled = md.mode != 'FIX'
row.prop(md, "use_keep_loop")
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
index 0096c6c00d5..cb7e508e3db 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
@@ -71,7 +71,8 @@ static int remapTime(
TimeGpencilModifierData *mmd = (TimeGpencilModifierData *)md;
const int sfra = scene->r.sfra;
const int efra = scene->r.efra;
- const bool invgpl = mmd->flag & GP_SIMPLIFY_INVERT_LAYER;
+ const bool invgpl = mmd->flag & GP_TIME_INVERT_LAYER;
+ const bool invpass = mmd->flag & GP_TIME_INVERT_PASS;
/* omit if filter by layer */
if (mmd->layername[0] != '\0') {
@@ -86,6 +87,19 @@ static int remapTime(
}
}
}
+ /* verify pass */
+ if (mmd->pass_index > 0) {
+ if (invpass == false) {
+ if (gpl->pass_index != mmd->pass_index) {
+ return cfra;
+ }
+ }
+ else {
+ if (gpl->pass_index == mmd->pass_index) {
+ return cfra;
+ }
+ }
+ }
/* if fix mode, return predefined frame number */
if (mmd->mode == GP_TIME_MODE_FIX) {
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index 9d543ddbc78..17ec1073c1d 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -143,15 +143,18 @@ typedef enum eThickGpencil_Flag {
typedef struct TimeGpencilModifierData {
GpencilModifierData modifier;
char layername[64]; /* layer name */
+ int pass_index; /* custom index for passes */
int flag; /* flags */
int offset;
float frame_scale; /* animation scale */
int mode;
+ char pad_[4];
} TimeGpencilModifierData;
typedef enum eTimeGpencil_Flag {
GP_TIME_INVERT_LAYER = (1 << 0),
GP_TIME_KEEP_LOOP = (1 << 1),
+ GP_TIME_INVERT_PASS = (1 << 2),
} eTimeGpencil_Flag;
typedef enum eTimeGpencil_Mode {
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 858008afd91..54559ce89f7 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -260,7 +260,7 @@ typedef struct bGPDlayer {
* needs to be kept unique, as it's used as the layer identifier */
short thickness; /* thickness to apply to strokes (Annotations) */
- char pad_1[2];
+ short pass_index; /* used to filter groups of layers in modifiers */
struct Object *parent; /* parent object */
float inverse[4][4]; /* inverse matrix (only used if parented) */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index a02868622e4..de31c884b6b 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1094,6 +1094,12 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Onion Skinning", "Display onion skins before and after the current frame");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ /* pass index for compositing and modifiers */
+ prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "pass_index");
+ RNA_def_property_ui_text(prop, "Pass Index", "Index number for the \"Layer Index\" pass");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
/* Flags */
prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 0ef07b46309..1230c9862ed 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -750,11 +750,22 @@ static void rna_def_modifier_gpenciltime(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Layer", "Layer name");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+ prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pass_index");
+ RNA_def_property_range(prop, 0, 100);
+ RNA_def_property_ui_text(prop, "Pass", "Layer pass index");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
prop = RNA_def_property(srna, "invert_layers", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TIME_INVERT_LAYER);
RNA_def_property_ui_text(prop, "Inverse Layers", "Inverse filter");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+ prop = RNA_def_property(srna, "invert_pass", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_TIME_INVERT_PASS);
+ RNA_def_property_ui_text(prop, "Inverse Pass", "Inverse filter");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
prop = RNA_def_property(srna, "offset", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "offset");
RNA_def_property_range(prop, -INT_MAX, INT_MAX);