void EffectsExporter::exportEffects(Scene *sce) { if (hasEffects(sce)) { this->scene = sce; openLibrary(); MaterialFunctor mf; mf.forEachMaterialInExportSet<EffectsExporter>(sce, *this, this->export_settings->export_set); closeLibrary(); } }
void EffectsExporter::exportEffects(Scene *sce) { this->scene = sce; if (this->export_settings->export_texture_type == BC_TEXTURE_TYPE_MAT) { if (hasEffects(sce)) { MaterialFunctor mf; openLibrary(); mf.forEachMaterialInExportSet<EffectsExporter>(sce, *this, this->export_settings->export_set); closeLibrary(); } } else { std::set<Object *> uv_textured_obs = bc_getUVTexturedObjects(sce, !this->export_settings->active_uv_only); std::set<Image *> uv_images = bc_getUVImages(sce, !this->export_settings->active_uv_only); if (uv_images.size() > 0) { openLibrary(); std::set<Image *>::iterator uv_images_iter; for (uv_images_iter = uv_images.begin(); uv_images_iter != uv_images.end(); uv_images_iter++) { Image *ima = *uv_images_iter; std::string key(id_name(ima)); key = translate_id(key); COLLADASW::Sampler sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D, key + COLLADASW::Sampler::SAMPLER_SID_SUFFIX, key + COLLADASW::Sampler::SURFACE_SID_SUFFIX); sampler.setImageId(key); openEffect(key + "-effect"); COLLADASW::EffectProfile ep(mSW); ep.setProfileType(COLLADASW::EffectProfile::COMMON); ep.setShaderType(COLLADASW::EffectProfile::PHONG); ep.setDiffuse(createTexture(ima, key, &sampler), false, "diffuse"); COLLADASW::ColorOrTexture cot = getcol(0, 0, 0, 1.0f); ep.setSpecular(cot, false, "specular"); ep.openProfile(); ep.addProfileElements(); ep.addExtraTechniques(mSW); ep.closeProfile(); closeEffect(); } closeLibrary(); } } }