svn merge ^/trunk/blender -r55372:55392
[blender.git] / source / blender / makesrna / intern / rna_color.c
index 49e1122bf185c1e25112eb7122f21c6a0e935f3e..98672f2fca25da01090151016d9cd8d8d0494227 100644 (file)
@@ -57,6 +57,9 @@
 #include "BKE_node.h"
 #include "BKE_sequencer.h"
 #include "BKE_texture.h"
+#ifdef WITH_FREESTYLE
+#  include "BKE_linestyle.h"
+#endif
 
 #include "ED_node.h"
 
@@ -189,6 +192,16 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
                                /* everything else just uses 'color_ramp' */
                                path = BLI_strdup("color_ramp");
                                break;
+
+#ifdef WITH_FREESTYLE
+                       case ID_LS:
+                       {
+                               char *path = FRS_path_from_ID_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data);
+                               if (path)
+                                       return path;
+                               break;
+                       }
+#endif
                }
        }
        else {
@@ -260,6 +273,22 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
                        }
                        break;
                                
+#ifdef WITH_FREESTYLE
+                       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;
+                       }
+#endif
+
                        default: /* everything else should have a "color_ramp" property */
                        {
                                /* create pointer to the ID block, and try to resolve "color_ramp" pointer */
@@ -311,6 +340,15 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
                                WM_main_add_notifier(NC_TEXTURE, tex);
                        }
                        break;
+#ifdef WITH_FREESTYLE
+                       case ID_LS:
+                       {
+                               FreestyleLineStyle *linestyle= ptr->id.data;
+
+                               WM_main_add_notifier(NC_LINESTYLE, linestyle);
+                               break;
+                       }
+#endif
                        default:
                                break;
                }