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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2006-12-21 16:47:27 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2006-12-21 16:47:27 +0300
commit47bc3d1208c48903f53728d17d3acbb1ccbd06cb (patch)
treeeca808294b88940590b8dc7e9693acc20ef2048f /source/blender/yafray/intern/export_File.cpp
parentedccdf934018264002c034906e8a287d12b7ead7 (diff)
Added names to UV and vertex color layers, and display them as a list.
Added support for multiple UVs in the render engine. This also involved changing the way faces are stored, to allow data to be added optionally per 256 faces, same as the existing system for vertices. A UV layer can be specified in the Map Input panel and the Geometry node by name. Leaving this field blank will default to the active UV layer. Also added sharing of face selection and hiding between UV layers, and at the same time improved syncing with editmode selection and hiding. Still to do: - Multi UV support for fastshade. - Multires and NMesh preservation of multiple UV sets.
Diffstat (limited to 'source/blender/yafray/intern/export_File.cpp')
-rwxr-xr-xsource/blender/yafray/intern/export_File.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp
index 7d9f23a4e4c..c8c0b3c6bb1 100755
--- a/source/blender/yafray/intern/export_File.cpp
+++ b/source/blender/yafray/intern/export_File.cpp
@@ -1230,7 +1230,7 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
string matname(face0mat->id.name);
// use name in imgtex_shader list if 'TexFace' enabled for this material
if (face0mat->mode & MA_FACETEXTURE) {
- MTFace* tface = face0->tface;
+ MTFace* tface = RE_vlakren_get_tface(re, face0, 0, NULL, 0);
if (tface) {
Image* fimg = (Image*)tface->tpage;
if (fimg) matname = imgtex_shader[string(face0mat->id.name) + string(fimg->id.name)];
@@ -1412,7 +1412,7 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
string fmatname(fmat->id.name);
// use name in imgtex_shader list if 'TexFace' enabled for this face material
if (fmat->mode & MA_FACETEXTURE) {
- MTFace* tface = vlr->tface;
+ MTFace* tface = RE_vlakren_get_tface(re, vlr, 0, NULL, 0);
if (tface) {
Image* fimg = (Image*)tface->tpage;
if (fimg) fmatname = imgtex_shader[fmatname + string(fimg->id.name)];
@@ -1437,23 +1437,25 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
}
else if (vlr->flag & R_FACE_SPLIT) { ui2++; ui3++; }
- MTFace* uvc = vlr->tface; // possible uvcoords (v upside down)
+ MTFace* uvc = RE_vlakren_get_tface(re, vlr, 0, NULL, 0); // possible uvcoords (v upside down)
if (uvc) {
ostr << " u_a=\"" << uvc->uv[ui1][0] << "\" v_a=\"" << 1-uvc->uv[ui1][1] << "\""
<< " u_b=\"" << uvc->uv[ui2][0] << "\" v_b=\"" << 1-uvc->uv[ui2][1] << "\""
<< " u_c=\"" << uvc->uv[ui3][0] << "\" v_c=\"" << 1-uvc->uv[ui3][1] << "\"";
}
+ MCol *mcol= RE_vlakren_get_mcol(re, vlr, 0, NULL, 0);
+
// since Blender seems to need vcols when uvs are used, for yafray only export when the material actually uses vcols
- if ((EXPORT_VCOL) && (vlr->vcol)) {
+ if ((EXPORT_VCOL) && mcol) {
// vertex colors
- unsigned char* pt = reinterpret_cast<unsigned char*>(&vlr->vcol[ui1]);
+ unsigned char* pt = reinterpret_cast<unsigned char*>(&mcol[ui1]);
ostr << " vcol_a_r=\"" << (float)pt[3]/255.f << "\" vcol_a_g=\"" << (float)pt[2]/255.f
<< "\" vcol_a_b=\"" << (float)pt[1]/255.f << "\"";
- pt = reinterpret_cast<unsigned char*>(&vlr->vcol[ui2]);
+ pt = reinterpret_cast<unsigned char*>(&mcol[ui2]);
ostr << " vcol_b_r=\"" << (float)pt[3]/255.f << "\" vcol_b_g=\"" << (float)pt[2]/255.f
<< "\" vcol_b_b=\"" << (float)pt[1]/255.f << "\"";
- pt = reinterpret_cast<unsigned char*>(&vlr->vcol[ui3]);
+ pt = reinterpret_cast<unsigned char*>(&mcol[ui3]);
ostr << " vcol_c_r=\"" << (float)pt[3]/255.f << "\" vcol_c_g=\"" << (float)pt[2]/255.f
<< "\" vcol_c_b=\"" << (float)pt[1]/255.f << "\"";
}
@@ -1480,15 +1482,15 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li
<< " u_b=\"" << uvc->uv[ui2][0] << "\" v_b=\"" << 1-uvc->uv[ui2][1] << "\""
<< " u_c=\"" << uvc->uv[ui3][0] << "\" v_c=\"" << 1-uvc->uv[ui3][1] << "\"";
}
- if ((EXPORT_VCOL) && (vlr->vcol)) {
+ if ((EXPORT_VCOL) && mcol) {
// vertex colors
- unsigned char* pt = reinterpret_cast<unsigned char*>(&vlr->vcol[ui1]);
+ unsigned char* pt = reinterpret_cast<unsigned char*>(&mcol[ui1]);
ostr << " vcol_a_r=\"" << (float)pt[3]/255.f << "\" vcol_a_g=\"" << (float)pt[2]/255.f
<< "\" vcol_a_b=\"" << (float)pt[1]/255.f << "\"";
- pt = reinterpret_cast<unsigned char*>(&vlr->vcol[ui2]);
+ pt = reinterpret_cast<unsigned char*>(&mcol[ui2]);
ostr << " vcol_b_r=\"" << (float)pt[3]/255.f << "\" vcol_b_g=\"" << (float)pt[2]/255.f
<< "\" vcol_b_b=\"" << (float)pt[1]/255.f << "\"";
- pt = reinterpret_cast<unsigned char*>(&vlr->vcol[ui3]);
+ pt = reinterpret_cast<unsigned char*>(&mcol[ui3]);
ostr << " vcol_c_r=\"" << (float)pt[3]/255.f << "\" vcol_c_g=\"" << (float)pt[2]/255.f
<< "\" vcol_c_b=\"" << (float)pt[1]/255.f << "\"";
}