Merged changes in the trunk up to revision 51718.
[blender.git] / source / blender / makesrna / intern / rna_color.c
index c5f1ac748fabe240b6d5e33e438adf77b39db7a3..f4afaf11d277a69bece7c1efeb7629a83728d80b 100644 (file)
@@ -54,6 +54,7 @@
 #include "BKE_movieclip.h"
 #include "BKE_node.h"
 #include "BKE_texture.h"
+#include "BKE_linestyle.h"
 
 #include "ED_node.h"
 
@@ -186,6 +187,14 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
                                /* everything else just uses 'color_ramp' */
                                path = BLI_strdup("color_ramp");
                                break;
+
+                       case ID_LS:
+                       {
+                               char *path = FRS_path_from_ID_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data);
+                               if (path)
+                                       return path;
+                       }
+                               break;
                }
        }
        else {
@@ -257,6 +266,20 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
                        }
                        break;
                                
+                       case ID_LS:
+                       {
+                               ListBase listbase;
+                               LinkData *link;
+
+                               FRS_list_modifier_color_ramps((FreestyleLineStyle *)id, &listbase);
+                               for (link = (LinkData *)listbase.first; link; link = link->next) {
+                                       RNA_pointer_create(id, &RNA_ColorRamp, link->data, &ramp_ptr);
+                                       COLRAMP_GETPATH;
+                               }
+                               BLI_freelistN(&listbase);
+                       }
+                               break;
+
                        default: /* everything else should have a "color_ramp" property */
                        {
                                /* create pointer to the ID block, and try to resolve "color_ramp" pointer */
@@ -308,6 +331,13 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
                                WM_main_add_notifier(NC_TEXTURE, tex);
                        }
                        break;
+                       case ID_LS:
+                       {
+                               FreestyleLineStyle *linestyle= ptr->id.data;
+
+                               WM_main_add_notifier(NC_LINESTYLE, linestyle);
+                       }
+                               break;
                        default:
                                break;
                }