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>2018-06-04 10:31:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-04 10:31:30 +0300
commit44505b38df557a5711703613685a1dec9fc2c3d9 (patch)
tree3f05bebcc7bfadf56569f2dcca7f95fc56b1b0d0 /source/blender/editors/render/render_shading.c
parent6654e109df952be3a3128fae2508a02c196ae593 (diff)
Cleanup: strip trailing space in editors
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r--source/blender/editors/render/render_shading.c128
1 files changed, 64 insertions, 64 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 820042ac172..fe87f8bdbb2 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -102,7 +102,7 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
if (!ob)
return OPERATOR_CANCELLED;
-
+
BKE_object_material_slot_add(bmain, ob);
if (ob->mode & OB_MODE_TEXTURE_PAINT) {
@@ -110,11 +110,11 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, NULL);
}
-
+
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob);
WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_PREVIEW, ob);
-
+
return OPERATOR_FINISHED;
}
@@ -124,7 +124,7 @@ void OBJECT_OT_material_slot_add(wmOperatorType *ot)
ot->name = "Add Material Slot";
ot->idname = "OBJECT_OT_material_slot_add";
ot->description = "Add a new material slot";
-
+
/* api callbacks */
ot->exec = material_slot_add_exec;
ot->poll = ED_operator_object_active_editable;
@@ -145,7 +145,7 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode");
return OPERATOR_CANCELLED;
}
-
+
BKE_object_material_slot_remove(CTX_data_main(C), ob);
if (ob->mode & OB_MODE_TEXTURE_PAINT) {
@@ -153,12 +153,12 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op)
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, NULL);
}
-
+
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob);
WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_PREVIEW, ob);
-
+
return OPERATOR_FINISHED;
}
@@ -168,7 +168,7 @@ void OBJECT_OT_material_slot_remove(wmOperatorType *ot)
ot->name = "Remove Material Slot";
ot->idname = "OBJECT_OT_material_slot_remove";
ot->description = "Remove the selected material slot";
-
+
/* api callbacks */
ot->exec = material_slot_remove_exec;
ot->poll = ED_operator_object_active_editable;
@@ -222,7 +222,7 @@ static int material_slot_assign_exec(bContext *C, wmOperator *UNUSED(op))
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
-
+
return OPERATOR_FINISHED;
}
@@ -232,7 +232,7 @@ void OBJECT_OT_material_slot_assign(wmOperatorType *ot)
ot->name = "Assign Material Slot";
ot->idname = "OBJECT_OT_material_slot_assign";
ot->description = "Assign active material slot to selection";
-
+
/* api callbacks */
ot->exec = material_slot_assign_exec;
ot->poll = ED_operator_object_active_editable;
@@ -316,7 +316,7 @@ void OBJECT_OT_material_slot_select(wmOperatorType *ot)
ot->name = "Select Material Slot";
ot->idname = "OBJECT_OT_material_slot_select";
ot->description = "Select by active material slot";
-
+
/* api callbacks */
ot->exec = material_slot_select_exec;
@@ -335,7 +335,7 @@ void OBJECT_OT_material_slot_deselect(wmOperatorType *ot)
ot->name = "Deselect Material Slot";
ot->idname = "OBJECT_OT_material_slot_deselect";
ot->description = "Deselect by active material slot";
-
+
/* api callbacks */
ot->exec = material_slot_deselect_exec;
@@ -358,7 +358,7 @@ static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op))
if (ob != ob_iter && give_matarar(ob_iter)) {
if (ob->data != ob_iter->data)
assign_matarar(bmain, ob_iter, matar, ob->totcol);
-
+
if (ob_iter->totcol == ob->totcol) {
ob_iter->actcol = ob->actcol;
DAG_id_tag_update(&ob_iter->id, OB_RECALC_DATA);
@@ -493,7 +493,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
}
WM_event_add_notifier(C, NC_MATERIAL | NA_ADDED, ma);
-
+
return OPERATOR_FINISHED;
}
@@ -503,7 +503,7 @@ void MATERIAL_OT_new(wmOperatorType *ot)
ot->name = "New Material";
ot->idname = "MATERIAL_OT_new";
ot->description = "Add a new material";
-
+
/* api callbacks */
ot->exec = new_material_exec;
@@ -550,7 +550,7 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
}
WM_event_add_notifier(C, NC_TEXTURE | NA_ADDED, tex);
-
+
return OPERATOR_FINISHED;
}
@@ -560,7 +560,7 @@ void TEXTURE_OT_new(wmOperatorType *ot)
ot->name = "New Texture";
ot->idname = "TEXTURE_OT_new";
ot->description = "Add a new texture";
-
+
/* api callbacks */
ot->exec = new_texture_exec;
@@ -605,7 +605,7 @@ static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
}
WM_event_add_notifier(C, NC_WORLD | NA_ADDED, wo);
-
+
return OPERATOR_FINISHED;
}
@@ -615,7 +615,7 @@ void WORLD_OT_new(wmOperatorType *ot)
ot->name = "New World";
ot->idname = "WORLD_OT_new";
ot->description = "Create a new world Data-Block";
-
+
/* api callbacks */
ot->exec = new_world_exec;
@@ -634,7 +634,7 @@ static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op))
DAG_id_tag_update(&scene->id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
-
+
return OPERATOR_FINISHED;
}
@@ -644,7 +644,7 @@ void SCENE_OT_render_layer_add(wmOperatorType *ot)
ot->name = "Add Render Layer";
ot->idname = "SCENE_OT_render_layer_add";
ot->description = "Add a render layer";
-
+
/* api callbacks */
ot->exec = render_layer_add_exec;
@@ -662,7 +662,7 @@ static int render_layer_remove_exec(bContext *C, wmOperator *UNUSED(op))
DAG_id_tag_update(&scene->id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
-
+
return OPERATOR_FINISHED;
}
@@ -672,7 +672,7 @@ void SCENE_OT_render_layer_remove(wmOperatorType *ot)
ot->name = "Remove Render Layer";
ot->idname = "SCENE_OT_render_layer_remove";
ot->description = "Remove the selected render layer";
-
+
/* api callbacks */
ot->exec = render_layer_remove_exec;
@@ -1451,7 +1451,7 @@ static int texture_slot_move_exec(bContext *C, wmOperator *op)
mtexswap = mtex_ar[act];
mtex_ar[act] = mtex_ar[act - 1];
mtex_ar[act - 1] = mtexswap;
-
+
BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, act - 1, -1, 0);
BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, act, act - 1, 0);
BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, -1, act, 0);
@@ -1464,7 +1464,7 @@ static int texture_slot_move_exec(bContext *C, wmOperator *op)
ma->septex &= ~(1 << (act - 1));
ma->septex |= mtexuse >> 1;
}
-
+
set_active_mtex(id, act - 1);
}
}
@@ -1473,7 +1473,7 @@ static int texture_slot_move_exec(bContext *C, wmOperator *op)
mtexswap = mtex_ar[act];
mtex_ar[act] = mtex_ar[act + 1];
mtex_ar[act + 1] = mtexswap;
-
+
BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, act + 1, -1, 0);
BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, act, act + 1, 0);
BKE_animdata_fix_paths_rename(id, adt, NULL, "texture_slots", NULL, NULL, -1, act, 0);
@@ -1486,7 +1486,7 @@ static int texture_slot_move_exec(bContext *C, wmOperator *op)
ma->septex &= ~(1 << (act + 1));
ma->septex |= mtexuse << 1;
}
-
+
set_active_mtex(id, act + 1);
}
}
@@ -1552,35 +1552,35 @@ static int envmap_save_exec(bContext *C, wmOperator *op)
//int imtype = RNA_enum_get(op->ptr, "file_type");
char imtype = scene->r.im_format.imtype;
char path[FILE_MAX];
-
+
RNA_string_get(op->ptr, "filepath", path);
-
+
if (scene->r.scemode & R_EXTENSION) {
BKE_image_path_ensure_ext_from_imformat(path, &scene->r.im_format);
}
-
+
WM_cursor_wait(1);
-
+
save_envmap(op, scene, tex->env, path, imtype);
-
+
WM_cursor_wait(0);
-
+
WM_event_add_notifier(C, NC_TEXTURE, tex);
-
+
return OPERATOR_FINISHED;
}
static int envmap_save_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
//Scene *scene= CTX_data_scene(C);
-
+
if (RNA_struct_property_is_set(op->ptr, "filepath"))
return envmap_save_exec(C, op);
//RNA_enum_set(op->ptr, "file_type", scene->r.im_format.imtype);
RNA_string_set(op->ptr, "filepath", G.main->name);
WM_event_add_fileselect(C, op);
-
+
return OPERATOR_RUNNING_MODAL;
}
@@ -1588,13 +1588,13 @@ static int envmap_save_poll(bContext *C)
{
Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
- if (!tex)
+ if (!tex)
return 0;
if (!tex->env || !tex->env->ok)
return 0;
if (tex->env->cube[1] == NULL)
return 0;
-
+
return 1;
}
@@ -1605,15 +1605,15 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot)
ot->name = "Save Environment Map";
ot->idname = "TEXTURE_OT_envmap_save";
ot->description = "Save the current generated Environment map to an image file";
-
+
/* api callbacks */
ot->exec = envmap_save_exec;
ot->invoke = envmap_save_invoke;
ot->poll = envmap_save_poll;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_INTERNAL; /* no undo since this doesnt modify the env-map */
-
+
/* properties */
prop = RNA_def_float_array(ot->srna, "layout", 12, default_envmap_layout, 0.0f, 0.0f,
"File layout",
@@ -1630,25 +1630,25 @@ void TEXTURE_OT_envmap_save(wmOperatorType *ot)
static int envmap_clear_exec(bContext *C, wmOperator *UNUSED(op))
{
Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
-
+
BKE_texture_envmap_free_data(tex->env);
-
+
WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, tex);
-
+
return OPERATOR_FINISHED;
}
static int envmap_clear_poll(bContext *C)
{
Tex *tex = CTX_data_pointer_get_type(C, "texture", &RNA_Texture).data;
-
- if (!tex)
+
+ if (!tex)
return 0;
if (!tex->env || !tex->env->ok)
return 0;
if (tex->env->cube[1] == NULL)
return 0;
-
+
return 1;
}
@@ -1658,11 +1658,11 @@ void TEXTURE_OT_envmap_clear(wmOperatorType *ot)
ot->name = "Clear Environment Map";
ot->idname = "TEXTURE_OT_envmap_clear";
ot->description = "Discard the environment map and free it from memory";
-
+
/* api callbacks */
ot->exec = envmap_clear_exec;
ot->poll = envmap_clear_poll;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
}
@@ -1671,13 +1671,13 @@ static int envmap_clear_all_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
Tex *tex;
-
+
for (tex = bmain->tex.first; tex; tex = tex->id.next)
if (tex->env)
BKE_texture_envmap_free_data(tex->env);
-
+
WM_event_add_notifier(C, NC_TEXTURE | NA_EDITED, tex);
-
+
return OPERATOR_FINISHED;
}
@@ -1687,11 +1687,11 @@ void TEXTURE_OT_envmap_clear_all(wmOperatorType *ot)
ot->name = "Clear All Environment Maps";
ot->idname = "TEXTURE_OT_envmap_clear_all";
ot->description = "Discard all environment maps in the .blend file and free them from memory";
-
+
/* api callbacks */
ot->exec = envmap_clear_all_exec;
ot->poll = envmap_clear_poll;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
@@ -1765,7 +1765,7 @@ void ED_render_clear_mtex_copybuf(void)
static void copy_mtex_copybuf(ID *id)
{
MTex **mtex = NULL;
-
+
switch (GS(id->name)) {
case ID_MA:
mtex = &(((Material *)id)->mtex[(int)((Material *)id)->texact]);
@@ -1787,7 +1787,7 @@ static void copy_mtex_copybuf(ID *id)
default:
break;
}
-
+
if (mtex && *mtex) {
memcpy(&mtexcopybuf, *mtex, sizeof(MTex));
mtexcopied = 1;
@@ -1800,10 +1800,10 @@ static void copy_mtex_copybuf(ID *id)
static void paste_mtex_copybuf(ID *id)
{
MTex **mtex = NULL;
-
+
if (mtexcopied == 0 || mtexcopybuf.tex == NULL)
return;
-
+
switch (GS(id->name)) {
case ID_MA:
mtex = &(((Material *)id)->mtex[(int)((Material *)id)->texact]);
@@ -1826,7 +1826,7 @@ static void paste_mtex_copybuf(ID *id)
BLI_assert(!"invalid id type");
return;
}
-
+
if (mtex) {
if (*mtex == NULL) {
*mtex = MEM_mallocN(sizeof(MTex), "mtex copy");
@@ -1834,9 +1834,9 @@ static void paste_mtex_copybuf(ID *id)
else if ((*mtex)->tex) {
id_us_min(&(*mtex)->tex->id);
}
-
+
memcpy(*mtex, &mtexcopybuf, sizeof(MTex));
-
+
id_us_plus((ID *)mtexcopybuf.tex);
}
}
@@ -1860,7 +1860,7 @@ static int copy_mtex_exec(bContext *C, wmOperator *UNUSED(op))
static int copy_mtex_poll(bContext *C)
{
ID *id = CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data;
-
+
return (id != NULL);
}
@@ -1874,7 +1874,7 @@ void TEXTURE_OT_slot_copy(wmOperatorType *ot)
/* api callbacks */
ot->exec = copy_mtex_exec;
ot->poll = copy_mtex_poll;
-
+
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_INTERNAL; /* no undo needed since no changes are made to the mtex */
}
@@ -1900,7 +1900,7 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
id = &psys->part->id;
else if (linestyle)
id = &linestyle->id;
-
+
if (id == NULL)
return OPERATOR_CANCELLED;
}