Renamed CTX_data_linestyle_from_scene() to BKE_get_linestyle_from_scene().
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Wed, 16 Jul 2014 04:36:39 +0000 (13:36 +0900)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Wed, 16 Jul 2014 04:38:58 +0000 (13:38 +0900)
The function is to retrieve the active line style ID datablock from a scene and
there is nothing related to bContext.

source/blender/blenkernel/BKE_context.h
source/blender/blenkernel/BKE_linestyle.h
source/blender/blenkernel/intern/context.c
source/blender/blenkernel/intern/linestyle.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_texture.c
source/blender/nodes/texture/node_texture_tree.c

index e30c8ecee2b9fce7621387077e4a04f38e3f27cd..877e376b343a52070dc6d88d55dffd10f4e8e89b 100644 (file)
@@ -234,7 +234,6 @@ int ctx_data_list_count(const bContext *C, int (*func)(const bContext *, ListBas
 struct Main *CTX_data_main(const bContext *C);
 struct Scene *CTX_data_scene(const bContext *C);
 struct ToolSettings *CTX_data_tool_settings(const bContext *C);
-struct FreestyleLineStyle *CTX_data_linestyle_from_scene(struct Scene *scene);
 
 const char *CTX_data_mode_string(const bContext *C);
 int CTX_data_mode_enum(const bContext *C);
index 8bc8cc44d92ac5c005bac3dc1acfc6acc24f685e..3b448e1c40215c3d4f8de3856f2bae6a31a16623 100644 (file)
@@ -48,6 +48,8 @@ FreestyleLineStyle *BKE_new_linestyle(const char *name, struct Main *main);
 void BKE_free_linestyle(FreestyleLineStyle *linestyle);
 FreestyleLineStyle *BKE_copy_linestyle(FreestyleLineStyle *linestyle);
 
+FreestyleLineStyle *BKE_get_linestyle_from_scene(struct Scene *scene);
+
 LineStyleModifier *BKE_add_linestyle_color_modifier(FreestyleLineStyle *linestyle, const char *name, int type);
 LineStyleModifier *BKE_add_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, const char *name, int type);
 LineStyleModifier *BKE_add_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, const char *name, int type);
index 47b29b49689009f83194df9f449d6036eb6c194f..de285f87444d1075402356a585c7f3836de159a1 100644 (file)
@@ -48,7 +48,6 @@
 #include "BKE_context.h"
 #include "BKE_main.h"
 #include "BKE_screen.h"
-#include "BKE_freestyle.h"
 
 #include "RNA_access.h"
 
@@ -1091,16 +1090,3 @@ int CTX_data_visible_pose_bones(const bContext *C, ListBase *list)
 {
        return ctx_data_collection_get(C, "visible_pose_bones", list);
 }
-
-FreestyleLineStyle *CTX_data_linestyle_from_scene(Scene *scene)
-{
-       SceneRenderLayer *actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);
-       FreestyleConfig *config = &actsrl->freestyleConfig;
-       FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
-
-       if (lineset) {
-               return lineset->linestyle;
-       }
-
-       return NULL;
-}
index d92fa328e87772cbe820d3dda3ae76a11dbe9da0..5d51eb09b6e292927ced921af1bc810699e18be4 100644 (file)
@@ -43,6 +43,7 @@
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
 
+#include "BKE_freestyle.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_linestyle.h"
@@ -209,6 +210,18 @@ FreestyleLineStyle *BKE_copy_linestyle(FreestyleLineStyle *linestyle)
        return new_linestyle;
 }
 
+FreestyleLineStyle *BKE_get_linestyle_from_scene(Scene *scene)
+{
+       SceneRenderLayer *actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);
+       FreestyleConfig *config = &actsrl->freestyleConfig;
+       FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);
+
+       if (lineset) {
+               return lineset->linestyle;
+       }
+       return NULL;
+}
+
 static LineStyleModifier *new_modifier(const char *name, int type, size_t size)
 {
        LineStyleModifier *m;
index 5fcceb25e4ea1400b4f90cacd7b66b8928545120..fc9ac27b5b8df17c9ab237b4fd5153026237e833 100644 (file)
@@ -55,6 +55,7 @@
 #include "BKE_particle.h"
 #include "BKE_screen.h"
 #include "BKE_texture.h"
+#include "BKE_linestyle.h"
 
 #include "RNA_access.h"
 
@@ -153,7 +154,7 @@ static int buttons_context_path_linestyle(ButsContextPath *path)
        /* if we have a scene, use the lineset's linestyle */
        else if (buttons_context_path_scene(path)) {
                scene = path->ptr[path->len - 1].data;
-               linestyle = CTX_data_linestyle_from_scene(scene);
+               linestyle = BKE_get_linestyle_from_scene(scene);
                if (linestyle) {
                        RNA_id_pointer_create(&linestyle->id, &path->ptr[path->len]);
                        path->len++;
index 0aa3e47df4b44f47fe689bbdb4bf44c3daab3974..930a05088b1228abc98b1e56df2ec52172d5fe20 100644 (file)
@@ -53,8 +53,8 @@
 #include "DNA_world_types.h"
 #include "DNA_linestyle_types.h"
 
-
 #include "BKE_context.h"
+#include "BKE_linestyle.h"
 #include "BKE_material.h"
 #include "BKE_modifier.h"
 #include "BKE_node.h"
@@ -352,7 +352,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext *
                ob = (scene->basact) ? scene->basact->object : NULL;
                wrld = scene->world;
                brush = BKE_paint_brush(BKE_paint_get_active_from_context(C));
-               linestyle = CTX_data_linestyle_from_scene(scene);
+               linestyle = BKE_get_linestyle_from_scene(scene);
        }
 
        if (ob && ob->type == OB_LAMP && !la)
index 882c843f317a4f415b9b51e1f6d0d765158b0ecc..a79b95525d392f7e75fb1aafa17bf198cee694c0 100644 (file)
@@ -44,6 +44,7 @@
 
 #include "BKE_context.h"
 #include "BKE_global.h"
+#include "BKE_linestyle.h"
 #include "BKE_main.h"
 #include "BKE_node.h"
 #include "BKE_paint.h"
@@ -110,7 +111,7 @@ static void texture_get_from_context(const bContext *C, bNodeTreeType *UNUSED(tr
                }
        }
        else if (snode->texfrom == SNODE_TEX_LINESTYLE) {
-               FreestyleLineStyle *linestyle = CTX_data_linestyle_from_scene(scene);
+               FreestyleLineStyle *linestyle = BKE_get_linestyle_from_scene(scene);
                if (linestyle) {
                        *r_from = (ID *)linestyle;
                        tx = give_current_linestyle_texture(linestyle);