From e756b1cc7dc26fee9262739315b738c2b592e205 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 5 Dec 2007 20:21:25 +0000 Subject: [PATCH] - fix for [#7327] Problem/issue with .PLY export, editmode was not exited, and vertex normals would not write at all! (probably own error) - Edited tooltip for texture DVar (was some user confusion in the studio as to its purpose) - Set render border is disabled when it has no area - so drawing a box outside the camera disables . --- release/scripts/ply_export.py | 15 ++++++++++----- .../blender/render/extern/include/RE_shader_ext.h | 2 +- source/blender/src/buttons_shading.c | 6 +++--- source/blender/src/editview.c | 9 ++++++--- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/release/scripts/ply_export.py b/release/scripts/ply_export.py index 010ee72ec67..cecde5a0b59 100644 --- a/release/scripts/ply_export.py +++ b/release/scripts/ply_export.py @@ -7,6 +7,7 @@ Group: 'Export' Tooltip: 'Export active object to Stanford PLY format' """ +import bpy import Blender from Blender import Mesh, Scene, Window, sys, Image, Draw import BPyMesh @@ -64,7 +65,7 @@ def file_callback(filename): if not filename.lower().endswith('.ply'): filename += '.ply' - scn= Blender.Scene.GetCurrent() + scn= bpy.data.scenes.active ob= scn.objects.active if not ob: Blender.Draw.PupMenu('Error%t|Select 1 active object') @@ -89,6 +90,10 @@ def file_callback(filename): if not Draw.PupBlock('Export...', pup_block): return + is_editmode = Blender.Window.EditMode() + if is_editmode: + Blender.Window.EditMode(0, '', 0) + Window.WaitCursor(1) EXPORT_APPLY_MODIFIERS = EXPORT_APPLY_MODIFIERS.val @@ -132,7 +137,7 @@ def file_callback(filename): if vertexColors: col = f.col for j, v in enumerate(f): if smooth: - normal= v.no + normal= tuple(v.no) normal_key = rvec3d(normal) if faceUV: @@ -211,12 +216,12 @@ def file_callback(filename): file.write('\n') file.close() - - + + if is_editmode: + Blender.Window.EditMode(1, '', 0) def main(): Blender.Window.FileSelector(file_callback, 'PLY Export', Blender.sys.makename(ext='.ply')) - if __name__=='__main__': main() diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 19b5637522e..8a4f6bb2ec8 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -120,7 +120,7 @@ typedef struct ShadeInput /* end direct copy from material */ /* individual copies: */ - int har; + int har; /* hardness */ float layerfac; /* texture coordinates */ diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index ff491b43370..f7c36b8caa5 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -1974,7 +1974,7 @@ static void world_panel_mapto(World *wrld) uiDefButF(block, NUMSLI, B_WORLDPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); uiDefButF(block, NUMSLI, B_WORLDPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); uiBlockEndAlign(block); - uiDefButF(block, NUMSLI, B_WORLDPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "The default value for textures to mix with values (not RGB)"); + uiDefButF(block, NUMSLI, B_WORLDPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Texture influence for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard"); /* MAP TO */ uiBlockBeginAlign(block); @@ -2405,7 +2405,7 @@ static void lamp_panel_mapto(Object *ob, Lamp *la) uiDefButF(block, NUMSLI, B_LAMPPRV, "G ", 10,60,135,19, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); uiDefButF(block, NUMSLI, B_LAMPPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB"); uiBlockEndAlign(block); - uiDefButF(block, NUMSLI, B_LAMPPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "The default value the textures uses to mix with"); + uiDefButF(block, NUMSLI, B_LAMPPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Texture influence for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard"); /* MAP TO */ uiDefButBitS(block, TOG, MAP_COL, B_LAMPPRV, "Col", 10,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the basic color of the lamp"); @@ -3146,7 +3146,7 @@ static void material_panel_map_to(Object *ob, Material *ma, int from_nodes) } uiBlockEndAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "The default value the texture uses to mix with (not RGB)"); + uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Texture influence for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard"); /* MAP TO */ uiBlockBeginAlign(block); diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c index f0832032ac7..c5d7ce231c7 100644 --- a/source/blender/src/editview.c +++ b/source/blender/src/editview.c @@ -2144,9 +2144,12 @@ void set_render_border(void) allqueue(REDRAWVIEWCAM, 1); - /* drawing a border surrounding the entire camera view switches off border rendering */ - if (G.scene->r.border.xmin <= 0.0 && G.scene->r.border.xmax >= 1.0 && - G.scene->r.border.ymin <= 0.0 && G.scene->r.border.ymax >= 1.0) + /* drawing a border surrounding the entire camera view switches off border rendering + * or the border covers no pixels */ + if ((G.scene->r.border.xmin <= 0.0 && G.scene->r.border.xmax >= 1.0 && + G.scene->r.border.ymin <= 0.0 && G.scene->r.border.ymax >= 1.0) || + (G.scene->r.border.xmin == G.scene->r.border.xmax || + G.scene->r.border.ymin == G.scene->r.border.ymax )) { G.scene->r.mode &= ~R_BORDER; } else {