Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-01-02 21:15:24 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-02 21:15:24 +0400
commit1e18da32fb3df5d491201770d10992f0b975650b (patch)
tree3c2efd537a5fcda4a5b9de57bc04c5905c984c02 /source/blender/editors/mesh
parentaa43cab8206a07a37dacb4e606ef6112c1054587 (diff)
replace:
CTX_data_pointer_get_type(C, "object", &RNA_Object).data with api call: ED_object_context(C) ... since getting the context object is such a common operation.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/mesh_data.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 7253d426ca6..7762203c371 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -318,14 +318,14 @@ int ED_mesh_color_remove_named(bContext *C, Object *ob, Mesh *me, const char *na
static int layers_poll(bContext *C)
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
ID *data= (ob)? ob->data: NULL;
return (ob && !ob->id.lib && ob->type==OB_MESH && data && !data->lib);
}
static int uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
Mesh *me= ob->data;
if(!ED_mesh_uv_texture_add(C, me, NULL, TRUE))
@@ -435,7 +435,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot)
static int uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
Mesh *me= ob->data;
if(!ED_mesh_uv_texture_remove(C, ob, me))
@@ -464,7 +464,7 @@ void MESH_OT_uv_texture_remove(wmOperatorType *ot)
static int vertex_color_add_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene= CTX_data_scene(C);
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
Mesh *me= ob->data;
if(!ED_mesh_color_add(C, scene, ob, me, NULL, TRUE))
@@ -490,7 +490,7 @@ void MESH_OT_vertex_color_add(wmOperatorType *ot)
static int vertex_color_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
Mesh *me= ob->data;
if(!ED_mesh_color_remove(C, ob, me))
@@ -520,7 +520,7 @@ static int sticky_add_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene= CTX_data_scene(C);
View3D *v3d= CTX_wm_view3d(C);
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
Mesh *me= ob->data;
/*if(me->msticky)
@@ -551,7 +551,7 @@ void MESH_OT_sticky_add(wmOperatorType *ot)
static int sticky_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
Mesh *me= ob->data;
if(!me->msticky)