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.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index e4e3ee7576c..1a0d481fadc 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -24,6 +24,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/editors/render/render_shading.c
+ * \ingroup edrend
+ */
+
+
#include <stdlib.h>
#include <string.h>
@@ -72,9 +77,10 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "ED_render.h"
#include "ED_curve.h"
#include "ED_mesh.h"
+#include "ED_render.h"
+#include "ED_screen.h"
#include "RNA_define.h"
@@ -281,6 +287,7 @@ void OBJECT_OT_material_slot_add(wmOperatorType *ot)
/* api callbacks */
ot->exec= material_slot_add_exec;
+ ot->poll= ED_operator_object_active_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -316,6 +323,7 @@ void OBJECT_OT_material_slot_remove(wmOperatorType *ot)
/* api callbacks */
ot->exec= material_slot_remove_exec;
+ ot->poll= ED_operator_object_active_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -357,7 +365,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
if(ef && BKE_font_getselection(ob, &selstart, &selend)) {
for(i=selstart; i<=selend; i++)
- ef->textbufinfo[i].mat_nr = ob->actcol-1;
+ ef->textbufinfo[i].mat_nr = ob->actcol;
}
}
}
@@ -377,6 +385,7 @@ void OBJECT_OT_material_slot_assign(wmOperatorType *ot)
/* api callbacks */
ot->exec= material_slot_assign_exec;
+ ot->poll= ED_operator_object_active_editable;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1152,6 +1161,9 @@ static void paste_mtex_copybuf(ID *id)
case ID_PA:
mtex= &(((ParticleSettings *)id)->mtex[(int)((ParticleSettings *)id)->texact]);
break;
+ default:
+ BLI_assert("invalid id type");
+ return;
}
if(mtex) {