예제 #1
0
ParamDlg* BerconTile::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) {	
	IAutoMParamDlg* masterDlg = BerconTileDesc.CreateParamDlgs(hwMtlEdit, imp, this);
	texoutDlg = texout->CreateParamDlg(hwMtlEdit, imp);
	masterDlg->AddDlg(texoutDlg);
	BerconTile_param_blk.SetUserDlgProc(new BerconTileDlgProc(this));
	xyz_blk.SetUserDlgProc(new BerconXYZDlgProc(this));
	EnableStuff(GetCOREInterface()->GetTime());
	return masterDlg;	
}
예제 #2
0
ParamDlg* BerconNoise::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) {	
	IAutoMParamDlg* masterDlg = BerconNoiseDesc.CreateParamDlgs(hwMtlEdit, imp, this);
	texoutDlg = texout->CreateParamDlg(hwMtlEdit, imp);
	masterDlg->AddDlg(texoutDlg);
	berconnoise_param_blk.SetUserDlgProc(new BerconNoiseDlgProc(this));
	BerconCurve_param_blk.SetUserDlgProc(new BerconCurveDlgProcNOISE(this));
	xyz_blk.SetUserDlgProc(new BerconXYZDlgProc(this));	
	EnableStuff();
	return masterDlg;	
}
예제 #3
0
ParamDlg* Matte::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp)
   {
   // create the rollout dialogs
   IAutoMParamDlg* masterDlg = matteCD.CreateParamDlgs(hwMtlEdit, imp, this);

   EnableStuff();

   return masterDlg;

// dlg = new MatteDlg(hwMtlEdit, imp, this);
// return dlg;     
   }
예제 #4
0
ParamDlg* BerconGradient::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) {
	//xyzGenDlg = xyzGen->CreateParamDlg(hwMtlEdit, imp);
	IAutoMParamDlg* masterDlg = BerconGradientDesc.CreateParamDlgs(hwMtlEdit, imp, this);
	texoutDlg = texout->CreateParamDlg(hwMtlEdit, imp);
	//masterDlg->AddDlg(xyzGenDlg);	
	masterDlg->AddDlg(texoutDlg);
	gradientmap_param_blk.SetUserDlgProc(new BerconGradientDlgProc(this));
	BerconCurve_param_blk.SetUserDlgProc(new BerconCurveDlgProcGRADIENT(this));
	xyz_blk.SetUserDlgProc(new BerconXYZDlgProc(this));
	EnableStuff();
	return masterDlg;
}						
예제 #5
0
void Gradient::Update(TimeValue t, Interval& valid) 
	{
	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();
		uvGen->Update(t,ivalid);
		texout->Update(t,ivalid);
		pblock->GetValue( grad_color1, t, col[0], ivalid );
		col[0].ClampMinMax();
		pblock->GetValue( grad_color2, t, col[1], ivalid );
		col[1].ClampMinMax();
		pblock->GetValue( grad_color3, t, col[2], ivalid );
		col[2].ClampMinMax();		
		pblock->GetValue( grad_map1_on, t, mapOn[0], ivalid);
		pblock->GetValue( grad_map2_on, t, mapOn[1], ivalid);
		pblock->GetValue( grad_map3_on, t, mapOn[2], ivalid);
		pblock->GetValue( grad_type, t, type, ivalid );
		pblock->GetValue( grad_noise_type, t, noiseType, ivalid );
		pblock->GetValue( grad_amount, t, amount, ivalid );
		pblock->GetValue( grad_size, t, size, ivalid );
		pblock->GetValue( grad_phase, t, phase, ivalid );
		pblock->GetValue( grad_center, t, center, ivalid );
		pblock->GetValue( grad_levels, t, levels, ivalid );
		pblock->GetValue( grad_high_thresh, t, high, ivalid );
		pblock->GetValue( grad_low_thresh, t, low, ivalid );
		pblock->GetValue( grad_thresh_smooth, t, smooth, ivalid );		
		if (low>high) {
			float temp = low;
			low = high;
			high = temp;
			}
		hminusl = (high-low);
		sd = hminusl*0.5f*smooth;
		if (size!=0.0f) size1 = 20.0f/size;
		else size1 = 0.0f;
		for (int i=0; i<NSUBTEX; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t,ivalid);
			}
		EnableStuff();
		}
	valid &= ivalid;
	}
예제 #6
0
파일: noise.cpp 프로젝트: artemeliy/inf4715
ParamDlg* Noise::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) {
// JBW: the main difference here is the automatic creation of a ParamDlg by the new
// ClassDesc2 function CreateParamDlgs().  This mirrors the way BeginEditParams()
// can be redirected to the ClassDesc2 for automatic ParamMap2 management.  In this 
// case a special subclass of ParamDlg, AutoMParamDlg, defined in IParamm2.h, is 
// created.  It can act as a 'master' ParamDlg to which you can add any number of 
// secondary dialogs and it will make sure all the secondary dialogs are kept 
// up-to-date and deleted as necessary.  

	// create the rollout dialogs
	xyzGenDlg = xyzGen->CreateParamDlg(hwMtlEdit, imp);	
	IAutoMParamDlg* masterDlg = noiseCD.CreateParamDlgs(hwMtlEdit, imp, this);
	texoutDlg = texout->CreateParamDlg(hwMtlEdit, imp);
	// add the secondary dialogs to the master
	masterDlg->AddDlg(xyzGenDlg);
	masterDlg->AddDlg(texoutDlg);
	noise_param_blk.SetUserDlgProc(new NoiseDlgProc(this));
	EnableStuff();
	return masterDlg;

	}
예제 #7
0
void Matte::Update(TimeValue t, Interval& valid)
   {  
   ivalid = FOREVER;
   pblock->GetValue(matte_shadow_brightness,t,amblev,ivalid);
   pblock->GetValue(matte_color,t,col,ivalid);
   pblock->GetValue(matte_reflection_amount,t,reflAmt,ivalid);


   pblock->GetValue(matte_opaque_alpha,t,opaque,ivalid);
   pblock->GetValue(matte_apply_atmosphere,t,fogBG,ivalid);
   pblock->GetValue(matte_receive_shadows,t,shadowBG,ivalid);
   pblock->GetValue(matte_affect_alpha,t,shadowAlpha,ivalid);
   pblock->GetValue(matte_atmosphere_depth,t,fogObjDepth,ivalid);
   pblock->GetValue( matte_use_reflection_map,t, useReflMap, ivalid);
   pblock->GetValue( matte_additive_reflection,t, additiveReflection, ivalid);

   if (reflmap&&useReflMap)
      reflmap->Update(t,ivalid);
   EnableStuff();

   valid &= ivalid;
   }
예제 #8
0
파일: noise.cpp 프로젝트: artemeliy/inf4715
void Noise::Update(TimeValue t, Interval& valid) {

	if (pblock == NULL) return;

	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();
		if (xyzGen != NULL)
			xyzGen->Update(t,ivalid);
		if (texout != NULL)
			texout->Update(t,ivalid);
		pblock->GetValue( noise_color1, t, col[0], ivalid );
		col[0].ClampMinMax();
		pblock->GetValue( noise_color2, t, col[1], ivalid );
		col[1].ClampMinMax();
		pblock->GetValue( noise_size, t,   size, ivalid );
		pblock->GetValue( noise_phase, t,  phase, ivalid );
		pblock->GetValue( noise_levels, t,  levels, ivalid );
		for (int i=0; i<NSUBTEX; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t,ivalid);
			}		
		pblock->GetValue( noise_hithresh, t, high, ivalid );
		pblock->GetValue( noise_lowthresh, t, low, ivalid );		

		if (high<low) {
			float tmp = low;
			low = high;
			high = tmp;
			}
		pblock->GetValue( noise_map1_on, t, mapOn[0], ivalid);
		pblock->GetValue( noise_map2_on, t, mapOn[1], ivalid);
		pblock->GetValue( noise_type, t, noiseType, ivalid);


		//ComputeAvgValue(); // moved to UpdateCache DDS 10/3/00
		EnableStuff();
		}
	valid &= ivalid;
	}
예제 #9
0
ParamDlg* Gradient::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) 
{
// JBW: the main difference here is the automatic creation of a ParamDlg by the new
// ClassDesc2 function CreateParamDlgs().  This mirrors the way BeginEditParams()
// can be redirected to the ClassDesc2 for automatic ParamMap2 management.  In this 
// case a special subclass of ParamDlg, AutoMParamDlg, defined in IParamm2.h, is 
// created.  It can act as a 'master' ParamDlg to which you can add any number of 
// secondary dialogs and it will make sure all the secondary dialogs are kept 
// up-to-date and deleted as necessary.  
// Here you see we create the Coordinate, Gradient and Output ParamDlgs in the desired 
// order, and then add the Coordinate and Output dlgs as secondaries to the 
// Gradient master AutoMParamDlg so it will keep them up-to-date automatically

	// create the rollout dialogs
	uvGenDlg = uvGen->CreateParamDlg(hwMtlEdit, imp);	
	IAutoMParamDlg* masterDlg = gradCD.CreateParamDlgs(hwMtlEdit, imp, this);
	texoutDlg = texout->CreateParamDlg(hwMtlEdit, imp);
	// add the secondary dialogs to the master
	masterDlg->AddDlg(uvGenDlg);
	masterDlg->AddDlg(texoutDlg);
	EnableStuff();
	return masterDlg;
}
예제 #10
0
void BerconNoise::Update(TimeValue t, Interval& valid) {	
	if (pblock == NULL) return;

	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();

		if (texout != NULL)
			texout->Update(t,ivalid);

		pblock->GetValue( noise_color1, t, col[0], ivalid );
		col[0].ClampMinMax();
		pblock->GetValue( noise_color2, t, col[1], ivalid );
		col[1].ClampMinMax();		
		
		for (int i=0; i<NOISE_NSUBTEX; i++)
			if (subtex[i]) 
				subtex[i]->Update(t,ivalid);

		pblock->GetValue( noise_map1_on, t, mapOn[0], ivalid);
		pblock->GetValue( noise_map2_on, t, mapOn[1], ivalid);				

		// General
		pblock->GetValue( noise_hithresh, t, high, ivalid );
		pblock->GetValue( noise_lowthresh, t, low, ivalid );	
		pblock->GetValue( noise_size, t,   size, ivalid );		

		// Distortion
		pblock->GetValue( distortion_str, t, distortionStr, ivalid);
		pblock->GetValue( use_distortion, t, useDistortion, ivalid);
		pblock->GetValue( uvw_dist, t, uvwDist, ivalid);

		// Update noise parameters
		pblock->GetValue( noise_phase, t,			phase , ivalid);
		pblock->GetValue( worley_spread, t,			spread , ivalid);
		pblock->GetValue( worley_F1, t,				F1 , ivalid);
		pblock->GetValue( worley_F2, t,				F2 , ivalid);
		pblock->GetValue( worley_F3, t,				F3 , ivalid);
		pblock->GetValue( worley_F4, t,				F4 , ivalid);

		// Static noise params
		pblock->GetValue( noise_function_type, t,	noiseFunction , ivalid);
		pblock->GetValue( worley_distance, t,		worleyFunction , ivalid);		
		pblock->GetValue( fractal_type, t,			fractalFunction, ivalid);

		// Update fractal parameters
		pblock->GetValue( fractal_levels, t,  levels, ivalid );
		pblock->GetValue( fractal_h, t, fractalH, ivalid);
		pblock->GetValue( fractal_offset, t, fractalOffset, ivalid);
		pblock->GetValue( fractal_gain, t, fractalGain, ivalid);
		pblock->GetValue( fractal_lacunarity, t, fractalLacunarity, ivalid);
	
		if (high<low) {
			float tmp = low;
			low = high;
			high = tmp;
		}

		// Update maps
		for (int i = 0; i<14; i++)
			pbMap->GetValue((i+14), t, mapOn[i+4], ivalid);		

		// Curve
		pbCurve->GetValue(enable_curve, t, useCurve, ivalid);

		EnableStuff();		

		// Slight optimization
		mappedParameters = false;
		for (int i=5;i<=17;i++)
			if (mapOn[i] && subtex[i])
				mappedParameters = true;			

		//calcAverage(); // Update average value		
		berconXYZ.update(pbXYZ, t, ivalid);
	}
	
	valid &= ivalid;
}
예제 #11
0
void BerconTile::Update(TimeValue t, Interval& valid) {	
	if (pblock == NULL) return;

	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();

		if (texout != NULL)
			texout->Update(t,ivalid);
		pblock->GetValue( noise_color1, t, col[0], ivalid );
		col[0].ClampMinMax();
		pblock->GetValue( noise_color2, t, col[1], ivalid );
		col[1].ClampMinMax();
		pblock->GetValue( noise_color3, t, col[2], ivalid );
		col[2].ClampMinMax();

		for (int i=0; i<TILE_NSUBTEX; i++)
			if (subtex[i]) 
				subtex[i]->Update(t,ivalid);

		pblock->GetValue( noise_map1_on, t, mapOn[0], ivalid);
		pblock->GetValue( noise_map2_on, t, mapOn[1], ivalid);		
		pblock->GetValue( noise_map3_on, t, mapOn[2], ivalid);					

		pblock->GetValue( tile_size, t, tileSize, ivalid);

		// Tile params
		pblock->GetValue( tile_style, t, tileParam.tilingType, ivalid);

		pblock->GetValue( tile_width, t, tileParam.tileWidth, ivalid);
		pblock->GetValue( tile_height, t, tileParam.tileHeight, ivalid);
		pblock->GetValue( edge_width, t, tileParam.edgeWidth, ivalid);
		pblock->GetValue( edge_height, t, tileParam.edgeHeight, ivalid);

		pblock->GetValue( tile_width2, t, tileParam.tileWidthVar, ivalid);
		pblock->GetValue( tile_height2, t, tileParam.tileHeightVar, ivalid);
		pblock->GetValue( edge_width2, t, tileParam.edgeWidthVar, ivalid);
		pblock->GetValue( edge_height2, t, tileParam.edgeHeightVar, ivalid);

		pblock->GetValue( soften, t, tileParam.tileBlur, ivalid);
		pblock->GetValue( soften_rad, t, tileParam.tileBlurRad, ivalid);
		pblock->GetValue( pb_round, t, tileParam.tileRound, ivalid);
		pblock->GetValue( round_rad, t, tileParam.tileCrnrRad, ivalid);		
		
		pblock->GetValue( lock_edge, t, lockEdge, ivalid);		

		pblock->GetValue( pb_auto, t, tileParam.autoScale, ivalid);

		pblock->GetValue( pb_map_uv, t, tileParam.mapUV, ivalid);
		pblock->GetValue( pb_rotUV, t, tileParam.rotUV, ivalid);		
		pblock->GetValue( pb_uv_channel, t, uvChan, ivalid);		
		pblock->GetValue( pb_randRot, t, tileParam.randRot, ivalid);

		pblock->GetValue( pb_randX, t, tileParam.randX, ivalid);
		pblock->GetValue( pb_randY, t, tileParam.randY, ivalid);

		pblock->GetValue( pb_randSX, t, tileParam.randSX, ivalid);
		pblock->GetValue( pb_randSY, t, tileParam.randSY, ivalid);
		
		pblock->GetValue( pb_lock, t, tileParam.lock, ivalid);		
	
		pblock->GetValue( pb_flipX, t, tileParam.flipX, ivalid);
		pblock->GetValue( pb_flipY, t, tileParam.flipY, ivalid);
		pblock->GetValue( pb_randZ, t, tileParam.tileID, ivalid);
	
	
		pblock->GetValue( pb_center, t, tileParam.center, ivalid);	
		pblock->GetValue( pb_center_channel, t, uvChan2, ivalid);

		// Dist params
		pblock->GetValue( distortion_str, t, distortionStr, ivalid);
		pblock->GetValue( use_distortion, t, useDistortion, ivalid);			

		// Update maps
		for (int i = 0; i<2; i++)
			pbMap->GetValue((i+2), t, mapOn[i+5], ivalid);		

		// Slight optimization
		mappedParameters = false;
		for (int i=5;i<=6;i++)
			if (mapOn[i] && subtex[i])
				mappedParameters = true;	

		berconXYZ.update(pbXYZ, t, ivalid);

/*#if MAX_RELEASE >= 12000 //MAX_RELEASE_R12
		const char *s;
#else
		char *s;
#endif*/
		const wchar_t *s;


		pblock->GetValue(pb_pattern, t, s, ivalid);			
		
		if (tileParam.tilingType == 0)
			pattern.setPattern(std::wstring(s));
		else if (tileParam.tilingType != 1)
			pattern.setPreset(tileParam.tilingType-2);
		//pattern.setPattern("0, 1, 1 / .5, 0.5, 1");

		tileParam.tileHeightVar /= 200.f;
		tileParam.tileWidthVar /= 200.f;
		tileParam.edgeHeightVar /= 100.f;
		tileParam.edgeWidthVar /= 100.f;
		tileParam.randRot *= DEG2RAD;
		tileParam.checkValues();

		EnableStuff(t);		
	}
	valid &= ivalid;
}
예제 #12
0
void BerconGradient::Update(TimeValue t, Interval& valid) {	
//CharStream *out = thread_local(current_stdout);			

	if (pblock == NULL || gradient == NULL) return;	
	if (!ivalid.InInterval(t)) {
				
		// Set key information		
		if (gradient->selected >= 0 && gradient->selected < countKeys() && pblock->GetMap() != NULL) {			
			AColor currentKeyColor = pblock->GetAColor(pb_colors, t, gradient->selected);						
			pblock->SetValue(pb_keyCol, t, Color(currentKeyColor.r, currentKeyColor.g, currentKeyColor.b));	
			pblock->SetValue(pb_keyNum, t, gradient->selected);	
			pblock->SetValue(pb_keyPos, t, pblock->GetFloat(pb_positions, t, gradient->selected));				
			pblock->GetDesc()->InvalidateUI(pb_keyCol);
			pblock->GetDesc()->InvalidateUI(pb_keyNum);
			pblock->GetDesc()->InvalidateUI(pb_keyPos);			
		}

		ivalid.SetInfinite(); // Start from infinite interval
				
		if (p_maptex) p_maptex->Update(t,ivalid);	
		if (p_distex) p_distex->Update(t,ivalid);			

		//if (xyzGen != NULL)
			//xyzGen->Update(t,ivalid);
		if (texout != NULL)
			texout->Update(t,ivalid);

		pbCurve->GetValue(pb_curve_on, t, p_curveOn, ivalid);

		// Load gradient					
		int keys = countKeys();
		gradient->reset();	
		pblockGetValue(pb_interpolation,gradient->interpolation);	
		for (int i=0;i<keys;i++) {
			float pos; AColor col; Texmap* tex;
			pblock->GetValue(pb_positions, t, pos, ivalid, i);
			pblock->GetValue(pb_submaps, t, tex, ivalid, i);
			pblock->GetValue(pb_colors, t, col, ivalid, i);
			if (i == 0)
				pos = 0.f;
			else if (i == 1)
				pos = 1.f;
			gradient->addKey(i,pos,col,tex);
			if (gradient->getSubtex(i))
				gradient->getSubtex(i)->Update(t,ivalid);
		}	
		gradient->sort();
		gradient->invalidate();	

		// General stuff
		pblockGetValue(pb_seed,				p_seed);
		pblockGetValue(pb_type,				p_type);		
		pblockGetValue(pb_rand_obj,			p_randObj);
		pblockGetValue(pb_rand_mat,			p_randMat);
		pblockGetValue(pb_rand_par,			p_randPar);
		pblockGetValue(pb_rand_tile,		p_randTile);		
		pblockGetValue(pb_range_min,		p_rangeMin);
		pblockGetValue(pb_range_max,		p_rangeMax);
		pblockGetValue(pb_gradient_uvw,		p_uvwType);
		pblockGetValue(pb_gradient_normal,	p_normalType);
		pblockGetValue(pb_gradient_normal2,	p_normalFunction);
		pblockGetValue(pb_ior,				p_ior);

		pblockGetValue(pb_dison,			p_disOn);
		pblockGetValue(pb_disstr,			p_disStr);

		pblockGetValue(pb_reverse,			p_reverse);
		pblockGetValue(pb_range_loop,		p_rangeLoop);
		
		pblockGetValue(pb_node,				p_node);		

		if (p_rangeMin > p_rangeMax) // Switch so rangeMax is always bigger
			{ float f = p_rangeMin; p_rangeMax = p_rangeMin; p_rangeMin = f; }	
		
		EnableStuff();

		berconXYZ.update(pbXYZ, t, ivalid);
	}
	
	valid &= ivalid;
}
예제 #13
0
void BerconWood::Update(TimeValue t, Interval& valid) {	
	if (pblock == NULL || pbCurve == NULL) return;
	if (!ivalid.InInterval(t)) {
		ivalid.SetInfinite();

		if (texout != NULL)
			texout->Update(t,ivalid);
		pblock->GetValue( noise_color1, t, col[0], ivalid );
		col[0].ClampMinMax();
		pblock->GetValue( noise_color2, t, col[1], ivalid );
		col[1].ClampMinMax();
		pblock->GetValue( noise_color3, t, col[2], ivalid );
		col[2].ClampMinMax();

		for (int i=0; i<NSUBTEX; i++)
			if (subtex[i]) 
				subtex[i]->Update(t,ivalid);

		pblock->GetValue( noise_map1_on, t, mapOn[0], ivalid);
		pblock->GetValue( noise_map2_on, t, mapOn[1], ivalid);		
		pblock->GetValue( noise_map3_on, t, mapOn[2], ivalid);		
	
		pblock->GetValue( distortion_str, t, distortionStr, ivalid);
		pblock->GetValue( use_distortion, t, useDistortion, ivalid);

		pblock->GetValue( grain_amount, t, grainAmount, ivalid);
		pblock->GetValue( grain_freq, t, grainFreq, ivalid);
		pblock->GetValue( lock_grain, t, lockGrain, ivalid);		

		pblock->GetValue( wood_size, t, woodSize, ivalid);		

		// Update noise parameters
		pblock->GetValue( wood_type, t,			woodType, ivalid);
		pblock->GetValue( trunk_str, t,			trunkStr, ivalid);
		pblock->GetValue( trunk_freq, t,		trunkFreq, ivalid);
		pblock->GetValue( radial_str, t,		radialStr, ivalid);
		pblock->GetValue( radial_freq, t,		radialFreq, ivalid);
		pblock->GetValue( radial_z, t,			radialZ, ivalid);
		pblock->GetValue( angle_str, t,			angleStr, ivalid);
		pblock->GetValue( angle_freq, t,		angleFreq, ivalid);
		pblock->GetValue( angle_rad, t,			angleRad, ivalid);
		pblock->GetValue( width_var, t,			widthVar, ivalid);
		pblock->GetValue( gain_var, t,			gainVar, ivalid);
		pblock->GetValue( low_tresh, t,			lowTresh, ivalid);
		pblock->GetValue( high_tresh, t,		highTresh , ivalid);
		pblock->GetValue( wood_skew, t,			skew , ivalid);
		pblock->GetValue( rand_seed, t,			randSeed , ivalid);
		pblock->GetValue( pb_samples, t,		samples , ivalid);

		// Update maps
		for (int i = 0; i<16; i++)
			pbMap->GetValue((i+16), t, mapOn[i+5], ivalid);		

		if (highTresh<lowTresh) {
			float tmp = lowTresh;
			lowTresh = highTresh;
			highTresh = tmp;
		}

		// Slight optimization
		mappedParameters = false;
		for (int i=6;i<=18;i++)
			if (mapOn[i] && subtex[i])
				mappedParameters = true;	

		// Curve
		pbCurve->GetValue(enable_curve, t, useCurve, ivalid);

		EnableStuff();		
		berconXYZ.update(pbXYZ, t, ivalid);
	}
	valid &= ivalid;		
}