Exemplo n.º 1
0
void PhotoTexturingWidget::saveDefaultBakeSettings(FilterParameterSet pset){
	QSettings ptSettings;
	
	ptSettings.setValue(PhotoTexturer::TEXTURE_SIZE_WIDTH,pset.getInt(PhotoTexturer::TEXTURE_SIZE_WIDTH));
	ptSettings.setValue(PhotoTexturer::TEXTURE_SIZE_HEIGHT,pset.getInt(PhotoTexturer::TEXTURE_SIZE_HEIGHT));
	ptSettings.setValue(PhotoTexturer::UNPROJECT_ENABLE_ANGLE,pset.getBool(PhotoTexturer::UNPROJECT_ENABLE_ANGLE));
	ptSettings.setValue(PhotoTexturer::UNPROJECT_ANGLE_WEIGHT,pset.getInt(PhotoTexturer::UNPROJECT_ANGLE_WEIGHT));
	ptSettings.setValue(PhotoTexturer::UNPROJECT_ANGLE,pset.getFloat(PhotoTexturer::UNPROJECT_ANGLE));
	ptSettings.setValue(PhotoTexturer::UNPROJECT_ANGLE_SHARPNESS,pset.getInt(PhotoTexturer::UNPROJECT_ANGLE_SHARPNESS));
	ptSettings.setValue(PhotoTexturer::UNPROJECT_ENABLE_DISTANCE,pset.getBool(PhotoTexturer::UNPROJECT_ENABLE_DISTANCE));
	ptSettings.setValue(PhotoTexturer::UNPROJECT_DISTANCE_WEIGHT,pset.getInt(PhotoTexturer::UNPROJECT_DISTANCE_WEIGHT));
	ptSettings.setValue(PhotoTexturer::BAKE_SAVE_UNPROJECT,pset.getBool(PhotoTexturer::BAKE_SAVE_UNPROJECT));
	ptSettings.setValue(PhotoTexturer::UNPROJECT_ENABLE_EDGE_STRETCHING,pset.getBool(PhotoTexturer::UNPROJECT_ENABLE_EDGE_STRETCHING));
	ptSettings.setValue(PhotoTexturer::UNPROJECT_EDGE_STRETCHING_PASS,pset.getInt(PhotoTexturer::UNPROJECT_EDGE_STRETCHING_PASS));
	ptSettings.setValue(PhotoTexturer::BAKE_MERGE_TEXTURES,pset.getBool(PhotoTexturer::BAKE_MERGE_TEXTURES));
	ptSettings.setValue(PhotoTexturer::BAKE_MERGE_TYPE,pset.getEnum(PhotoTexturer::BAKE_MERGE_TYPE));
	ptSettings.setValue(PhotoTexturer::BAKE_SMARTBLEND,pset.getString(PhotoTexturer::BAKE_SMARTBLEND));
	
}
Exemplo n.º 2
0
void PhotoTexturingWidget::unprojectTextures(){
	QSettings ptSettings;
	QVariant setSmartBlend = ptSettings.value(PhotoTexturer::BAKE_SMARTBLEND,"smartblend.exe");
	
	FilterParameterSet combineParamSet;
	combineParamSet.addInt(PhotoTexturer::TEXTURE_SIZE_WIDTH,1024,"Image width:","");
	combineParamSet.addInt(PhotoTexturer::TEXTURE_SIZE_HEIGHT,1024,"Image height:","");
	
	combineParamSet.addBool(PhotoTexturer::UNPROJECT_ENABLE_ANGLE,true,"Enable angle map:","");
	combineParamSet.addInt(PhotoTexturer::UNPROJECT_ANGLE_WEIGHT,1,"Angle map weight:","");
	combineParamSet.addFloat(PhotoTexturer::UNPROJECT_ANGLE,85,"Min angle:","");
	combineParamSet.addInt(PhotoTexturer::UNPROJECT_ANGLE_SHARPNESS,1,"Angle map sharpness:","");
	
	combineParamSet.addBool(PhotoTexturer::UNPROJECT_ENABLE_DISTANCE,false,"Enable distance map:","");
	combineParamSet.addInt(PhotoTexturer::UNPROJECT_DISTANCE_WEIGHT,1,"Distance map weight:","");

	combineParamSet.addBool(PhotoTexturer::BAKE_SAVE_UNPROJECT,true,"Save unprojected textures:","");
	combineParamSet.addBool(PhotoTexturer::UNPROJECT_ENABLE_EDGE_STRETCHING,false,"Enable Texture edge Stretching:","");
	combineParamSet.addInt(PhotoTexturer::UNPROJECT_EDGE_STRETCHING_PASS,2,"Edge Stretching Passes:","");
	
	combineParamSet.addBool(PhotoTexturer::BAKE_MERGE_TEXTURES,true,"Merge unprojected textures:","");
	combineParamSet.addEnum(PhotoTexturer::BAKE_MERGE_TYPE,0,QStringList() <<"Merge Faces by Angle"<<"Smartblend","Merge Mode:","");
	combineParamSet.addString(PhotoTexturer::BAKE_MERGED_TEXTURE,"","Merged Texture Filename:","");
	combineParamSet.addString(PhotoTexturer::BAKE_SMARTBLEND,setSmartBlend.toString(),"smartblend:","");

	QListWidgetItem* lwis = ui.textureListWidget->currentItem();
	int textureID = lwis[0].type();

	GenericParamDialog ad(this,&combineParamSet,"Texture Baking Parameters");
	int result=ad.exec();
	ptSettings.setValue(PhotoTexturer::BAKE_SMARTBLEND,combineParamSet.getString(PhotoTexturer::BAKE_SMARTBLEND));
	

	if (result == 1){
		photoTexturer->unprojectTextures(mesh,textureID,&combineParamSet);
	}
	update();

	updateGLAreaTextures();
}