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:
authorAlfredo de Greef <eeshlo@yahoo.com>2004-11-23 09:10:03 +0300
committerAlfredo de Greef <eeshlo@yahoo.com>2004-11-23 09:10:03 +0300
commit88b556fd57701b6b6cfc5b47ab1c4f31676ade85 (patch)
tree22f212db9c2e9847f3ea26aa01e39eb06c37d852 /source/blender/yafray/intern
parentf3c8c47adb6ff3e3ca88418f4c26e9795029613f (diff)
Possibly related to bug #1851:
orco coordinates were assumed to be valid when pointers were non-null, this seems to have been a wrong assumption, pointers were probably unitialized (but only for some objects like surfaces?), so when the export code tried to access them, it crashed. Now the rendermaterial texco flag is tested instead, which probably is how it should have been done in the first place...
Diffstat (limited to 'source/blender/yafray/intern')
-rwxr-xr-xsource/blender/yafray/intern/export_File.cpp7
-rw-r--r--source/blender/yafray/intern/export_Plugin.cpp7
2 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp
index 9ac6d1b1e90..49811c5a336 100755
--- a/source/blender/yafray/intern/export_File.cpp
+++ b/source/blender/yafray/intern/export_File.cpp
@@ -985,9 +985,10 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
ostr << "\t</attributes>\n";
xmlfile << ostr.str();
- // if any face in the Blender mesh uses an orco texture, every face has orco coords,
- // so only need to check the first facevtx.orco in the list if they need to be exported
- bool EXPORT_ORCO = (face0->v1->orco!=NULL);
+ // Export orco coords test.
+ // Previously was done by checking orco pointer, however this can be non-null but still not initialized.
+ // Test the rendermaterial texco flag instead.
+ bool EXPORT_ORCO = ((face0mat->ren->texco & TEXCO_ORCO)!=0);
string has_orco = "off";
if (EXPORT_ORCO) has_orco = "on";
diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp
index a46f30b4be1..9a511cc5d7c 100644
--- a/source/blender/yafray/intern/export_Plugin.cpp
+++ b/source/blender/yafray/intern/export_Plugin.cpp
@@ -1123,7 +1123,12 @@ void yafrayPluginRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_
tr = face0mat->ray_mirror;
caus_rcolor.set(face0mat->mirr*tr, face0mat->mirg*tr, face0mat->mirb*tr);
}
- bool has_orco = (face0->v1->orco!=NULL);
+
+ // Export orco coords test.
+ // Previously was done by checking orco pointer, however this can be non-null but still not initialized.
+ // Test the rendermaterial texco flag instead.
+ bool has_orco = ((face0mat->ren->texco & TEXCO_ORCO)!=0);
+
bool no_auto = true; //in case non-mesh, or mesh has no autosmooth
float sm_angle = 0.1f;
if (obj->type==OB_MESH)