[Bf-blender-cvs] [647969f] master: Renamed CTX_data_linestyle_from_scene() to BKE_get_linestyle_from_scene().

Tamito Kajiyama noreply at git.blender.org
Wed Jul 16 06:39:12 CEST 2014


Commit: 647969f9b617b0ef6d49d7502aef7c1035769bc0
Author: Tamito Kajiyama
Date:   Wed Jul 16 13:36:39 2014 +0900
https://developer.blender.org/rB647969f9b617b0ef6d49d7502aef7c1035769bc0

Renamed CTX_data_linestyle_from_scene() to BKE_get_linestyle_from_scene().

The function is to retrieve the active line style ID datablock from a scene and
there is nothing related to bContext.

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

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

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

diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index e30c8ec..877e376 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -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);
diff --git a/source/blender/blenkernel/BKE_linestyle.h b/source/blender/blenkernel/BKE_linestyle.h
index 8bc8cc4..3b448e1 100644
--- a/source/blender/blenkernel/BKE_linestyle.h
+++ b/source/blender/blenkernel/BKE_linestyle.h
@@ -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);
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 47b29b4..de285f8 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -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;
-}
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index d92fa32..5d51eb0 100644
--- a/source/blender/blenkernel/intern/linestyle.c
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -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;
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 5fcceb2..fc9ac27 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -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++;
diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c
index 0aa3e47..930a050 100644
--- a/source/blender/editors/space_buttons/buttons_texture.c
+++ b/source/blender/editors/space_buttons/buttons_texture.c
@@ -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)
diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c
index 882c843..a79b955 100644
--- a/source/blender/nodes/texture/node_texture_tree.c
+++ b/source/blender/nodes/texture/node_texture_tree.c
@@ -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);




More information about the Bf-blender-cvs mailing list