[Bf-blender-cvs] [fe7558cbe29] greasepencil-refactor: Merge branch 'greasepencil-object' into greasepencil-refactor

Antonio Vazquez noreply at git.blender.org
Sat Dec 21 16:05:19 CET 2019


Commit: fe7558cbe29e34242d08010efab056a4b2afe953
Author: Antonio Vazquez
Date:   Sat Dec 21 16:03:42 2019 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBfe7558cbe29e34242d08010efab056a4b2afe953

Merge branch 'greasepencil-object' into greasepencil-refactor

===================================================================



===================================================================

diff --cc source/blender/editors/animation/anim_channels_defines.c
index ec56b1d9d24,2ec1634fa38..f5c0548eaa1
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@@ -5057,80 -5057,76 +5057,84 @@@ void ANIM_channel_draw_widgets(const bC
          }
          /* Special for Grease Pencil Layer. */
          else if (ale->type == ANIMTYPE_GPLAYER) {
-           /* Add some offset to make it more pleasing to the eye. */
-           offset += SLIDER_WIDTH / 2.1f;
- 
-           char *gp_rna_path = NULL;
-           bGPDlayer *gpl = (bGPDlayer *)ale->data;
-           const short width = SLIDER_WIDTH / 5;
- 
-           /* Create the RNA pointers. */
-           RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr);
-           RNA_id_pointer_create(ale->id, &id_ptr);
-           int icon;
- 
-           /* Layer opacity. */
-           UI_block_emboss_set(block, UI_EMBOSS);
-           prop = RNA_struct_find_property(&ptr, "opacity");
-           gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
-           if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
-             uiDefAutoButR(block,
-                           &ptr,
-                           prop,
-                           array_index,
-                           "",
-                           ICON_NONE,
-                           offset,
-                           ymid,
-                           width * 3,
-                           channel_height);
-           }
-           MEM_freeN(gp_rna_path);
+           bGPdata *gpd = (bGPdata *)ale->id;
+           if ((gpd != NULL) && ((gpd->flag & GP_DATA_ANNOTATIONS) == 0)) {
+             /* Add some offset to make it more pleasing to the eye. */
+             offset += SLIDER_WIDTH / 2.1f;
+ 
+             char *gp_rna_path = NULL;
+             bGPDlayer *gpl = (bGPDlayer *)ale->data;
+             const short width = SLIDER_WIDTH / 5;
+ 
+             /* Create the RNA pointers. */
+             RNA_pointer_create(ale->id, &RNA_GPencilLayer, ale->data, &ptr);
+             RNA_id_pointer_create(ale->id, &id_ptr);
+             int icon;
+ 
+             /* Layer opacity. */
+             UI_block_emboss_set(block, UI_EMBOSS);
+             prop = RNA_struct_find_property(&ptr, "opacity");
+             gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
+             if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
+               uiDefAutoButR(block,
+                             &ptr,
+                             prop,
+                             array_index,
+                             "",
+                             ICON_NONE,
+                             offset,
+                             ymid,
+                             width * 3,
+                             channel_height);
+             }
+             MEM_freeN(gp_rna_path);
  
 -            /* Mask Layer. */
 -            UI_block_emboss_set(block, UI_EMBOSS_NONE);
 -            prop = RNA_struct_find_property(&ptr, "mask_layer");
 -            gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
 -            if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
 -              icon = (gpl->flag & GP_LAYER_USE_MASK) ? ICON_MOD_MASK : ICON_LAYER_ACTIVE;
 -              uiDefAutoButR(block,
 -                            &ptr,
 -                            prop,
 -                            array_index,
 -                            "",
 -                            icon,
 -                            offset + (width * 3),
 -                            ymid,
 -                            width,
 -                            channel_height);
 +          /* Mask Layer. */
 +          UI_block_emboss_set(block, UI_EMBOSS_NONE);
 +          prop = RNA_struct_find_property(&ptr, "mask_layer");
 +          gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
 +          if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
 +            icon = ICON_LAYER_ACTIVE;
 +            if (gpl->flag & GP_LAYER_USE_MASK) {
 +              if (gpl->flag & GP_LAYER_MASK_INVERT) {
 +                icon = ICON_HOLDOUT_ON;
 +              }
 +              else {
 +                icon = ICON_MOD_MASK;
 +              }
              }
 -            MEM_freeN(gp_rna_path);
 +            uiDefAutoButR(block,
 +                          &ptr,
 +                          prop,
 +                          array_index,
 +                          "",
 +                          icon,
 +                          offset + (width * 3),
 +                          ymid,
 +                          width,
 +                          channel_height);
 +          }
 +          MEM_freeN(gp_rna_path);
  
-           /* Layer onion skinning switch. */
-           prop = RNA_struct_find_property(&ptr, "use_onion_skinning");
-           gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
-           if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
-             icon = (gpl->onion_flag & GP_LAYER_ONIONSKIN) ? ICON_ONIONSKIN_ON : ICON_ONIONSKIN_OFF;
-             uiDefAutoButR(block,
-                           &ptr,
-                           prop,
-                           array_index,
-                           "",
-                           icon,
-                           offset + (width * 4),
-                           ymid,
-                           width,
-                           channel_height);
+             /* Layer onion skinning switch. */
+             prop = RNA_struct_find_property(&ptr, "use_onion_skinning");
+             gp_rna_path = RNA_path_from_ID_to_property(&ptr, prop);
+             if (RNA_path_resolve_property(&id_ptr, gp_rna_path, &ptr, &prop)) {
+               icon = (gpl->onion_flag & GP_LAYER_ONIONSKIN) ? ICON_ONIONSKIN_ON :
+                                                               ICON_ONIONSKIN_OFF;
+               uiDefAutoButR(block,
+                             &ptr,
+                             prop,
+                             array_index,
+                             "",
+                             icon,
+                             offset + (width * 4),
+                             ymid,
+                             width,
+                             channel_height);
+             }
+             MEM_freeN(gp_rna_path);
            }
-           MEM_freeN(gp_rna_path);
          }
  
          /* Only if RNA-Path found. */



More information about the Bf-blender-cvs mailing list