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:
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r--source/blender/editors/render/render_shading.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index ba73bbdf31e..a9025b8cdfc 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -74,6 +74,7 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "ED_object.h"
#include "ED_curve.h"
#include "ED_mesh.h"
#include "ED_node.h"
@@ -92,7 +93,7 @@
static int material_slot_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);
if(!ob)
return OPERATOR_CANCELLED;
@@ -121,7 +122,7 @@ void OBJECT_OT_material_slot_add(wmOperatorType *ot)
static int material_slot_remove_exec(bContext *C, wmOperator *op)
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
if(!ob)
return OPERATOR_CANCELLED;
@@ -157,7 +158,7 @@ void OBJECT_OT_material_slot_remove(wmOperatorType *ot)
static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
if(!ob)
return OPERATOR_CANCELLED;
@@ -219,7 +220,7 @@ void OBJECT_OT_material_slot_assign(wmOperatorType *ot)
static int material_slot_de_select(bContext *C, int select)
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
if(!ob)
return OPERATOR_CANCELLED;
@@ -322,7 +323,7 @@ void OBJECT_OT_material_slot_deselect(wmOperatorType *ot)
static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op))
{
- Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+ Object *ob= ED_object_context(C);
Material ***matar;
if(!ob || !(matar= give_matarar(ob)))