Esempio n. 1
0
bool add_noise_dialog::respond (sxsdk::dialog_interface &d, sxsdk::dialog_item_class &item, int action, void *)
{
	if(action == sx::dialog_item::changing_action) return false;

	bool update = auto_preview;

	switch(item.get_id())
	{
	case bAuto_preview_id:
		if(!item.get_bool()) {
			update = false;
			break;
		}
	// TODO Check fallthrough or break.
	fallthrough; case bRedraw_preview_id:
		d.get_dialog_item(pPreview_mode_id).set_selection(After_effect);
	// TODO Check fallthrough or break.
	fallthrough; case pPreview_mode_id:
		update = true;
		break;
	case fOpacity_id:
	case fOpacity_A_id:
		if(item.get_float() > 1.0f)	item.set_float(1.0f);
	// TODO Check fallthrough or break.
	fallthrough; case fZ_Effect_id:
	case fOpacity_R_id:
	case fOpacity_G_id:
	case fOpacity_B_id:
		if(item.get_float() < 0.0f)	item.set_float(0.0f);
	// TODO Check fallthrough or break.
	fallthrough; default:
		if(auto_preview)	d.get_dialog_item(pPreview_mode_id).set_selection(After_effect);
	}

	save_dialog_data(d);
	if((update || auto_preview) && noise_preview) {
		try {
			if (!noise_preview->update_preview_image(preview_mode)) {
				preview_mode = Before_effect;
			}
		} catch (...) {
			shade.show_message_box(shade.gettext("error_out_of_memory"), false);
			preview_mode = Before_effect;
		}
		d.get_dialog_item(pPreview_mode_id).set_selection(preview_mode);
	}

	return false;
}
Esempio n. 2
0
void add_noise_dialog::save_dialog_data (sxsdk::dialog_interface &d, void *)
{
	settings.opacity	= d.get_dialog_item(fOpacity_id).get_float();
	settings.color_noise	= !(d.get_dialog_item(bColor_noise_id).get_bool());

	settings.color.x		= d.get_dialog_item(fOpacity_R_id).get_float();
	settings.color.y		= d.get_dialog_item(fOpacity_G_id).get_float();
	settings.color.z		= d.get_dialog_item(fOpacity_B_id).get_float();
	settings.color.w		= d.get_dialog_item(fOpacity_A_id).get_float();

	settings.apply_to		= d.get_dialog_item(pApply_to_id).get_selection();
	settings.z_depth_effect	= d.get_dialog_item(fZ_Effect_id).get_float();
	settings.revert_z_depth	= d.get_dialog_item(bRevert_Z_id).get_bool();
	settings.animated_noise	= d.get_dialog_item(bAnimated_noise_id).get_bool();

	preview_mode	= d.get_dialog_item(pPreview_mode_id).get_selection();
	auto_preview	= d.get_dialog_item(bAuto_preview_id).get_bool();
}
Esempio n. 3
0
void add_noise_dialog::initialize_dialog (sxsdk::dialog_interface &dialog, void *aux)
{
	// custom アイテムにプレビュー画像用のsxsdk::window_interfaceを設定 
	sxsdk::dialog_item_class& item = dialog.get_dialog_item(wPreview_image_id);
	noise_preview = new preview_window(shade, dialog, item, stored_image, settings);
	noise_preview->AddRef();
	item.set_window(noise_preview);

	noise_preview->update_preview_image(preview_mode);
}
Esempio n. 4
0
void add_noise_dialog::load_dialog_data (sxsdk::dialog_interface &d, void *)
{
	bool has_z = stored_image->has_z() || full_settings;

	d.get_dialog_item(sImage_size_id).set_string(boost::str(boost::format("%1% * %2%") % stored_image->get_size().x % stored_image->get_size().y).c_str());

	d.get_dialog_item(fOpacity_id).set_range(sxsdk::vec2(0.0f, 1.0f)).set_float(settings.opacity);
	d.get_dialog_item(bColor_noise_id).set_bool(!settings.color_noise);

	d.get_dialog_item(fOpacity_R_id).set_range(sxsdk::vec2(0.0f, 1.0f)).set_float(settings.color.x);
	d.get_dialog_item(fOpacity_G_id).set_range(sxsdk::vec2(0.0f, 1.0f)).set_float(settings.color.y);
	d.get_dialog_item(fOpacity_B_id).set_range(sxsdk::vec2(0.0f, 1.0f)).set_float(settings.color.z);
	d.get_dialog_item(fOpacity_A_id).set_range(sxsdk::vec2(0.0f, 1.0f)).set_float(settings.color.w);

	d.get_dialog_item(pApply_to_id).set_selection(settings.apply_to);
	d.get_dialog_item(fZ_Effect_id).set_enabled(has_z).set_range(sxsdk::vec2(0.0f, 1.0f)).set_float(settings.z_depth_effect);
	d.get_dialog_item(bRevert_Z_id).set_enabled(has_z).set_bool(settings.revert_z_depth);
	d.get_dialog_item(bAnimated_noise_id).set_enabled(full_settings).set_bool(settings.animated_noise);

	d.get_dialog_item(pPreview_mode_id).set_selection(preview_mode);
	d.get_dialog_item(bAuto_preview_id).set_bool(auto_preview);
}
bool CRIBExporterInterface::respond (sxsdk::dialog_interface &dialog, sxsdk::dialog_item_class &item, int action, void *)
{
	const int id = item.get_id();		// アクションがあったダイアログアイテムのID.

	if (id == sx::iddefault) {
		m_data.Clear();
		load_dialog_data(dialog);
		return true;
	}

	if (id == sx::idok) {
		m_dlgOK = true;
	}

	if (id == dlg_integrators_id) {
		m_data.type = (RIBParam::INTEGRATORS_TYPE)item.get_selection();
		return true;
	}
	if (id == dlg_pixel_variance_id) {
		m_data.pixelVariance = item.get_float();
		return true;
	}
	if (id == dlg_min_samples_id) {
		m_data.minSamples = item.get_int();
		return true;
	}
	if (id == dlg_max_samples_id) {
		m_data.maxSamples = item.get_int();
		return true;
	}
	if (id == dlg_incremental_id) {
		m_data.incremental = item.get_bool();
		return true;
	}
	if (id == dlg_bias_id) {
		m_data.bias = item.get_float();
		return true;
	}
	if (id == dlg_max_diffuse_depth_id) {
		m_data.maxDiffuseDepth = item.get_int();
		return true;
	}
	if (id == dlg_max_specular_depth_id) {
		m_data.maxSpecularDepth = item.get_int();
		return true;
	}
	if (id == dlg_version_id) {
		m_data.prmanVersion = item.get_selection();
		return true;
	}
	if (id == dlg_rendering_format_type_id) {
		m_data.renderingFormatType = (RIBParam::RENDERING_FORMAT_TYPE)item.get_selection();
		return true;
	}
	if (id == dlg_rendering_image_type_id) {
		m_data.renderingImageType = (RIBParam::RENDERING_IMAGE_TYPE)item.get_selection();
		return true;
	}

	if (id == dlg_output_background_image_id) {
		m_data.outputBackgroundImage = item.get_bool();
		{
			sxsdk::dialog_item_class &item2 = dialog.get_dialog_item(dlg_background_image_size_id);
			item2.set_enabled(m_data.outputBackgroundImage);
		}
		{
			sxsdk::dialog_item_class &item2 = dialog.get_dialog_item(dlg_background_image_intensity_id);
			item2.set_enabled(m_data.outputBackgroundImage);
		}
		{
			sxsdk::dialog_item_class &item2 = dialog.get_dialog_item(dlg_background_draw_id);
			item2.set_enabled(m_data.outputBackgroundImage);
		}
		return true;
	}
	if (id == dlg_background_image_size_id) {
		m_data.backgroundImageSize = (RIBParam::BACKGROUND_IMAGE_SIZE)item.get_selection();
		return true;
	}
	if (id == dlg_background_image_intensity_id) {
		m_data.backgroundImageIntensity = item.get_float();
		return true;
	}
	if (id == dlg_background_draw_id) {
		m_data.backgroundDraw = item.get_bool();
		return true;
	}
	if (id == dlg_color_color_to_linear_id) {
		m_data.colorColorToLinear = item.get_bool();
		return true;
	}
	if (id == dlg_color_texture_to_linear_id) {
		m_data.colorTextureToLinear = item.get_bool();
		return true;
	}
	if (id == dlg_light_day_light_id) {
		m_data.lightDayLight = item.get_bool();
		return true;
	}
	if (id == dlg_statistics_end_of_frame_id) {
		m_data.statisticsEndOfFrame = item.get_bool();
		return true;
	}
	if (id == dlg_statistics_xml_file_id) {
		m_data.statisticsXMLFile = item.get_bool();
		return true;
	}
	if (id == dlg_subdivision_id) {
		m_data.doSubdivision = item.get_bool();
		return true;
	}
	if (id == dlg_denoise_id) {
		m_data.doDenoise = item.get_bool();
		return true;
	}

	return false;
}
void CRIBExporterInterface::load_dialog_data (sxsdk::dialog_interface &d, void *)
{
	// 「バイナリ/テキスト」を無効化.
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(binary_text_id));
		item->set_enabled(false);
	}

	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_integrators_id));
		item->set_selection((int)m_data.type);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_pixel_variance_id));
		item->set_float(m_data.pixelVariance);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_min_samples_id));
		item->set_int(m_data.minSamples);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_max_samples_id));
		item->set_int(m_data.maxSamples);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_incremental_id));
		item->set_bool(m_data.incremental);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_bias_id));
		item->set_float(m_data.bias);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_max_diffuse_depth_id));
		item->set_int(m_data.maxDiffuseDepth);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_max_specular_depth_id));
		item->set_int(m_data.maxSpecularDepth);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_version_id));
		item->set_selection(m_data.prmanVersion);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_rendering_format_type_id));
		item->set_selection((int)m_data.renderingFormatType);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_rendering_image_type_id));
		item->set_selection((int)m_data.renderingImageType);
	}

	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_output_background_image_id));
		item->set_bool(m_data.outputBackgroundImage);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_background_image_size_id));
		item->set_selection((int)m_data.backgroundImageSize);
		item->set_enabled(m_data.outputBackgroundImage);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_background_image_intensity_id));
		item->set_float(m_data.backgroundImageIntensity);
		item->set_enabled(m_data.outputBackgroundImage);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_background_draw_id));
		item->set_bool(m_data.backgroundDraw);
		item->set_enabled(m_data.outputBackgroundImage);
	}

	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_color_color_to_linear_id));
		item->set_bool(m_data.colorColorToLinear);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_color_texture_to_linear_id));
		item->set_bool(m_data.colorTextureToLinear);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_light_day_light_id));
		item->set_bool(m_data.lightDayLight);
	}

	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_statistics_end_of_frame_id));
		item->set_bool(m_data.statisticsEndOfFrame);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_statistics_xml_file_id));
		item->set_bool(m_data.statisticsXMLFile);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_subdivision_id));
		item->set_bool(m_data.doSubdivision);
	}
	{
		sxsdk::dialog_item_class* item;
		item = &(d.get_dialog_item(dlg_denoise_id));
		item->set_bool(m_data.doDenoise);
	}

}