fix for [#9651] raw_export.py tooltip outdated?

own error, bpath looper was trying to free NULL pointer,
added fromOrig to python mtex api
made FromOrig and FromDupli tooltips be understandable
This commit is contained in:
Campbell Barton 2008-04-28 16:09:17 +00:00
parent ae4179e704
commit c6554898cc
5 changed files with 21 additions and 15 deletions

@ -2,9 +2,9 @@
"""
Name: 'Raw Faces (.raw)...'
Blender: 242
Blender: 245
Group: 'Export'
Tooltip: 'Export selected mesh to Raw Triangle Format (.raw)'
Tooltip: 'Export selected mesh to Raw Format (.raw)'
"""
__author__ = "Anthony D'Agostino (Scorpius)"
@ -13,10 +13,10 @@ __url__ = ("blender", "blenderartists.org",
__version__ = "Part of IOSuite 0.5"
__bpydoc__ = """\
This script exports meshes to Raw Triangle file format.
This script exports meshes to Raw file format.
The raw triangle format is very simple; it has no verts or faces lists.
It's just a simple ascii text file with the vertices of each triangle
It's just a simple ascii text file with the vertices of each triangle or quad
listed on each line. There were some very old utilities (when the PovRay
forum was in existence on CompuServe) that preformed operations on these
files.
@ -65,24 +65,24 @@ def write(filename):
filename += '.raw'
scn= Blender.Scene.GetCurrent()
object= scn.getActiveObject()
if not object:
ob= scn.objects.active
if not ob:
Blender.Draw.PupMenu('Error%t|Select 1 active object')
return
file = open(filename, 'wb')
mesh = BPyMesh.getMeshFromObject(object, None, True, False, scn)
mesh = BPyMesh.getMeshFromObject(ob, None, True, False, scn)
if not mesh:
Blender.Draw.PupMenu('Error%t|Could not get mesh data from active object')
return
mesh.transform(object.matrixWorld)
mesh.transform(ob.matrixWorld)
file = open(filename, "wb")
for f in mesh.faces:
for v in f.v:
for v in f:
file.write('%.6f %.6f %.6f ' % tuple(v.co))
file.write('\n')
file.close()

@ -239,8 +239,10 @@ static struct Sequence *seq_stepdata__internal(struct BPathIterator *bpi, int st
return seq;
} else {
/* keep looking through the next scene, reallocate seq array */
MEM_freeN((void *)bpi->seqdata.seqar);
bpi->seqdata.seqar = NULL;
if (bpi->seqdata.seqar) {
MEM_freeN((void *)bpi->seqdata.seqar);
bpi->seqdata.seqar = NULL;
}
bpi->seqdata.scene = bpi->seqdata.scene->id.next;
}
} else {

@ -143,8 +143,11 @@ static PyGetSetDef MTex_getseters[] = {
"Correct normal mapping for Texture space and Object space",
(void*) MTEX_VIEWSPACE },
{ "fromDupli", (getter) MTex_getFlag, (setter) MTex_setFlag,
"If object is duplicated by vertices, faces or particles, inherit texture coordinate from parent object",
"Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent",
(void*) MTEX_DUPLI_MAPTO },
{ "fromOrig", (getter) MTex_getFlag, (setter) MTex_setFlag,
"Dupli's derive their object coordinates from the original objects transformation",
(void*) MTEX_OB_DUPLI_ORIG },
{ "xproj", (getter) MTex_getProjX, (setter) MTex_setProjX,
"Projection of X axis to Texture space", NULL },
{ "yproj", (getter) MTex_getProjY, (setter) MTex_setProjY,

@ -515,7 +515,8 @@ class MTex:
@ivar neg: Negate texture values mode
@ivar noRGB: Convert texture RGB values to intensity values
@ivar correctNor: Correct normal mapping for Texture space and Object space
@ivar fromDupli: If object is duplicated by vertices, faces or particles, inherit texture coordinate from parent object
@ivar fromDupli: Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent
@ivar fromOrig: Dupli's derive their object coordinates from the original objects transformation
@ivar xproj: Projection of X axis to Texture space. L{Proj}
@ivar yproj: Projection of Y axis to Texture space. L{Proj}
@ivar zproj: Projection of Z axis to Texture space. L{Proj}

@ -3440,9 +3440,9 @@ static void material_panel_map_input(Object *ob, Material *ma)
uiBlockEndAlign(block);
if(ELEM(mtex->texco, TEXCO_UV, TEXCO_ORCO))
uiDefButBitS(block, TOG, MTEX_DUPLI_MAPTO, B_MATPRV, "From Dupli", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "If object is duplicated by vertices, faces or particles, inherit texture coordinate from parent object");
uiDefButBitS(block, TOG, MTEX_DUPLI_MAPTO, B_MATPRV, "From Dupli", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent");
else if(mtex->texco == TEXCO_OBJECT)
uiDefButBitS(block, TOG, MTEX_OB_DUPLI_ORIG, B_MATPRV, "From Original", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "If object is duplicated, use object coordinates as if the object was in its original position");
uiDefButBitS(block, TOG, MTEX_OB_DUPLI_ORIG, B_MATPRV, "From Original", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "Dupli's derive their object coordinates from the original objects transformation");
/* COORDS */