- 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 .
This commit is contained in:
Campbell Barton 2007-12-05 20:21:25 +00:00
parent 7b2e348d4f
commit e756b1cc7d
4 changed files with 20 additions and 12 deletions

@ -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()

@ -120,7 +120,7 @@ typedef struct ShadeInput
/* end direct copy from material */
/* individual copies: */
int har;
int har; /* hardness */
float layerfac;
/* texture coordinates */

@ -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);

@ -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 {