Exemplo n.º 1
0
void Output::Init() {
	ivalid.SetEmpty();
	if (texout) texout->Reset();
	else ReplaceReference( 1, GetNewDefaultTextureOutput());	
	texout->SetRollupOpen(1);
	mapOn[0] = 1;
	}
Exemplo n.º 2
0
void Noise::Init() {
	if (xyzGen) xyzGen->Reset();
	else ReplaceReference( XYZGEN_REF, GetNewDefaultXYZGen());	
	if (texout) texout->Reset();
	else ReplaceReference( TEXOUT_REF, GetNewDefaultTextureOutput());		
	ivalid.SetEmpty();
	cacheValid.SetEmpty();
	macroRecorder->Disable();  // disable macrorecorder during reset
		SetColor(0, Color(0.0f,0.0f,0.0f), TimeValue(0));
		SetColor(1, Color(1.0f,1.0f,1.0f), TimeValue(0));
		noiseType = NOISE_REGULAR;
#ifndef RENDER_VER
        RegisterDistanceDefault(_T("Noise Params"), _T("Size"), DEFAULT_NOISE_SIZE, IN_TO_M(DEFAULT_NOISE_SIZE));
        float size = GetDistanceDefault(_T("Noise Params"), _T("Size"));
		SetSize(size, TimeValue(0));
#else
		SetSize(DEFAULT_NOISE_SIZE, TimeValue(0));
#endif
		SetPhase(.0f,TimeValue(0));
		SetLevels(3.0f,TimeValue(0));
		pblock->SetValue(noise_hithresh,0,1.0f);
        
	macroRecorder->Enable();
	for (int i=0; i<NSUBTEX; i++) 
		mapOn[i] = 1;
	}
Exemplo n.º 3
0
void CellTex::Init()
	{
	if (xyzGen) xyzGen->Reset();
	else ReplaceReference(1, GetNewDefaultXYZGen());

	if (texout) texout->Reset();
	else ReplaceReference(2, GetNewDefaultTextureOutput());

    RegisterDistanceDefault(_T("Cellular Params"), _T("Size"), 5.0f, IN_TO_M(5.0f));
    float size = GetDistanceDefault(_T("Cellular Params"), _T("Size"));
	pblock->SetValue(cellular_size,0,size);

/*
	pblock->SetValue(PB_CELLCOL,0,Point3(1,1,1));
	pblock->SetValue(PB_DIVCOL1,0,Point3(.5f,.5f,.5f));
	pblock->SetValue(PB_DIVCOL2,0,Point3(0,0,0));
	pblock->SetValue(PB_SIZE,0,5.0f);
	pblock->SetValue(PB_SPREAD,0,0.5f);
	pblock->SetValue(PB_LOW,0,0.0f);
	pblock->SetValue(PB_MID,0,0.5f);
	pblock->SetValue(PB_HIGH,0,1.0f);
	pblock->SetValue(PB_FRACT,0,0);
	pblock->SetValue(PB_ITER,0,3.0f);
	pblock->SetValue(PB_USECELLMAP,0,1);
	pblock->SetValue(PB_USEDIV1MAP,0,1);
	pblock->SetValue(PB_USEDIV2MAP,0,1);
	pblock->SetValue(PB_SMOOTH,0,0.1f);	
	pblock->SetValue(PB_ADAPT,0,1);	
	if (paramDlg)  
		paramDlg->pmap->SetParamBlock(pblock);
*/
	fract = 0;
	ivalid.SetEmpty();
	}
Exemplo n.º 4
0
void Gradient::Init() 
	{
	if (uvGen) uvGen->Reset();
	else ReplaceReference( UVGEN_REF, GetNewDefaultUVGen());	
	if (texout) texout->Reset();
	else ReplaceReference( TEXOUT_REF, GetNewDefaultTextureOutput());
	ivalid.SetEmpty();
	}
Exemplo n.º 5
0
//From MtlBase
void BerconWood::Reset() {
	TimeValue t = GetCOREInterface()->GetTime();

	if (texout) texout->Reset();
	else ReplaceReference( OUTPUT_REF, GetNewDefaultTextureOutput());
	
	if (curve) curve->DeleteMe();
	curve = (ICurveCtl *) CreateInstance(REF_MAKER_CLASS_ID,CURVE_CONTROL_CLASS_ID);
	curve->RegisterResourceMaker(static_cast<ReferenceMaker*>(this));
	CurveCtrl::init(curve);
	pbCurve->SetValue(enable_curve, t, FALSE);

	for (int i=0; i<NSUBTEX; i++) { 
		DeleteReference(i+2);			
	}

	pblock->SetValue( noise_color1, t,		Color(0.768f, 0.568f, 0.25f)	);
	pblock->SetValue( noise_color2, t,		Color(0.392f , 0.243f, 0.0f)	);
	pblock->SetValue( noise_color3, t,		Color(0.549f, 0.337f, 0.0f)		);
	pblock->SetValue( noise_map1_on, t,		TRUE	);
	pblock->SetValue( noise_map2_on, t,		TRUE	);		
	pblock->SetValue( noise_map3_on, t,		TRUE	);				
	pblock->SetValue( distortion_str, t,	.1f		);
	pblock->SetValue( use_distortion, t,	FALSE	);
	pblock->SetValue( grain_amount, t,		.2f		);
	pblock->SetValue( grain_freq, t,		5.f		);
	pblock->SetValue( lock_grain, t,		FALSE	);		
	pblock->SetValue( wood_size, t,			3.f		);			
	pblock->SetValue( wood_type, t,			0		);
	pblock->SetValue( trunk_str, t,			1.f		);
	pblock->SetValue( trunk_freq, t,		.04f	);
	pblock->SetValue( radial_str, t,		.25f	);
	pblock->SetValue( radial_freq, t,		.1f		);
	pblock->SetValue( radial_z, t,			.01f	);
	pblock->SetValue( angle_str, t,			.1f		);
	pblock->SetValue( angle_freq, t,		1.f		);
	pblock->SetValue( angle_rad, t,			15.f	);
	pblock->SetValue( width_var, t,			.5f		);
	pblock->SetValue( gain_var, t,			.75f	);
	pblock->SetValue( low_tresh, t,			.3f		);
	pblock->SetValue( high_tresh, t,		1.f		);
	pblock->SetValue( wood_skew, t,			.75f	);
	pblock->SetValue( rand_seed, t,			12.345f	);
	pblock->SetValue( pb_samples, t,			4	);

	// Maps
	for (int i=16; i<32; i++)
		pbMap->SetValue(i, t, TRUE);

	berconXYZ.reset(pbXYZ, ivalid, 2, 0, 0, 0);

	ivalid.SetEmpty();		
}
Exemplo n.º 6
0
//From MtlBase
void BerconNoise::Reset() {
	TimeValue t = GetCOREInterface()->GetTime();

	if (texout) texout->Reset();
	else ReplaceReference( OUTPUT_REF, GetNewDefaultTextureOutput());

	if (curve) curve->DeleteMe();
	curve = (ICurveCtl *) CreateInstance(REF_MAKER_CLASS_ID,CURVE_CONTROL_CLASS_ID);
	curve->RegisterResourceMaker(static_cast<ReferenceMaker*>(this));
	CurveCtrl::init(curve);
	pbCurve->SetValue(enable_curve, t, FALSE);

	for (int i=0; i<NOISE_NSUBTEX; i++) 
		DeleteReference(i+2);	

	pblock->SetValue( noise_color1, t, Color(0.f, 0.f, 0.f));
	pblock->SetValue( noise_color2, t, Color(1.f, 1.f, 1.f));
	pblock->SetValue( noise_map1_on, t, TRUE);
	pblock->SetValue( noise_map2_on, t,	TRUE);		
	pblock->SetValue( distortion_str, t, .1f);
	pblock->SetValue( use_distortion, t, FALSE);
	pblock->SetValue( uvw_dist, t, 0);
	pblock->SetValue( noise_function_type, t, 1);
	pblock->SetValue( fractal_type, t, 0);
	pblock->SetValue( worley_distance, t, 0);
	pblock->SetValue( noise_lowthresh, t, 0.f);
	pblock->SetValue( noise_hithresh, t, 1.f);
	pblock->SetValue( worley_spread, t, 3.f);			
	pblock->SetValue( worley_F1, t,	1.f);
	pblock->SetValue( worley_F2, t,	0.f);
	pblock->SetValue( worley_F3, t,	0.f);
	pblock->SetValue( worley_F4, t,	0.f);
	pblock->SetValue( noise_phase, t, 0.f);
	pblock->SetValue( noise_size, t, 25.f);
	pblock->SetValue( fractal_gain, t, 5.f);
	pblock->SetValue( fractal_offset, t, 0.f);
	pblock->SetValue( fractal_h, t, .5f);
	pblock->SetValue( fractal_lacunarity, t, 2.f);
	pblock->SetValue( fractal_levels, t, 3.f);	

	// Maps
	for (int i=14; i<28; i++)
		pbMap->SetValue(i, t, TRUE);	

	berconXYZ.reset(pbXYZ, ivalid, 2, 0, 0, 0);

	ivalid.SetEmpty();	
}
Exemplo n.º 7
0
void BerconGradient::Reset() {
	TimeValue t = GetCOREInterface()->GetTime();
		
	//if (xyzGen) xyzGen->Reset();
	//else ReplaceReference( COORD_REF, GetNewDefaultXYZGen());	
	if (texout) texout->Reset();
	else ReplaceReference( OUTPUT_REF, GetNewDefaultTextureOutput());
	
	if (curve) curve->DeleteMe();
	curve = (ICurveCtl *) CreateInstance(REF_MAKER_CLASS_ID,CURVE_CONTROL_CLASS_ID);
	curve->RegisterResourceMaker(static_cast<ReferenceMaker*>(this));
	CurveCtrl::init(curve);
	pbCurve->SetValue( pb_curve_on, t, FALSE);	

	pblock->SetValue( pb_type,				t, 0);
	pblock->SetValue( pb_interpolation,		t, 0);
	pblock->SetValue( pb_seed,				t, 12345);
	pblock->SetValue( pb_rand_mat,			t, 1);
	pblock->SetValue( pb_rand_obj,			t, 1);
	pblock->SetValue( pb_rand_par,			t, 1);
	pblock->SetValue( pb_rand_tile,			t, 1);
	pblock->SetValue( pb_range_min,			t, 0.f);
	pblock->SetValue( pb_range_max,			t, 1.f);
	pblock->SetValue( p_rangeLoop,			t, 0);
	pblock->SetValue( p_reverse,			t, 0);
	pblock->SetValue( pb_dison,				t, 0);
	pblock->SetValue( pb_disstr,			t, 0.05f);
	pblock->SetValue( pb_gradient_uvw,		t, 0);	
	pblock->SetValue( pb_gradient_normal,	t, 0);	
	pblock->SetValue( pb_gradient_normal2,	t, 0);	
	pblock->SetValue( pb_ior,				t, 1.6f);		

	p_maptex = NULL;
	p_distex = NULL;
	p_node = NULL;

	gradient->reset();
	resetKeys();

	berconXYZ.reset(pbXYZ, ivalid, 0, 1, 1, 1);

	ivalid.SetEmpty();
}
Exemplo n.º 8
0
//From MtlBase
void BerconTile::Reset() {
	TimeValue t = GetCOREInterface()->GetTime();

	if (texout) texout->Reset();
	else ReplaceReference( OUTPUT_REF, GetNewDefaultTextureOutput());
									   
	for (int i=0; i<TILE_NSUBTEX; i++) 
		DeleteReference(i+2);	

	pblock->SetValue( noise_color1, t, Color(1.f, 1.f, 1.f));
	pblock->SetValue( noise_color2, t, Color(0.f, 0.f, 0.f));
	pblock->SetValue( noise_color3, t, Color(.5f, .5f, .5f));
	pblock->SetValue( noise_map1_on, t, TRUE);
	pblock->SetValue( noise_map2_on, t,	TRUE);
	pblock->SetValue( noise_map2_on, t,	TRUE);
	pblock->SetValue( distortion_str, t, .1f);
	pblock->SetValue( use_distortion, t, FALSE);
	pblock->SetValue( lock_edge, t, TRUE);

	pblock->SetValue( tile_style,    t, 3);
	pblock->SetValue( tile_size,     t, 1.0f);
	pblock->SetValue( tile_width,    t, 4.f);
	pblock->SetValue( tile_height,   t, 2.f);
	pblock->SetValue( edge_width,    t, .1f);
	pblock->SetValue( edge_height,   t, .1f);
	pblock->SetValue( tile_width2,   t, 0.f);
	pblock->SetValue( tile_height2,  t, 0.f);
	pblock->SetValue( edge_width2,   t, 0.f);
	pblock->SetValue( edge_height2,  t, 0.f);

	pblock->SetValue( soften, t, 2);
	pblock->SetValue( soften_rad, t, .1f);
	pblock->SetValue( pb_round, t,	TRUE);
	pblock->SetValue( round_rad, t, .1f);

	pblock->SetValue( pb_map_uv, t, FALSE);	
	pblock->SetValue( pb_uv_channel, t, 1);
	pblock->SetValue( pb_auto, t, 2);
	
	pblock->SetValue( pb_randX,   t, 0.f);
	pblock->SetValue( pb_randY,   t, 0.f);
	pblock->SetValue( pb_randSX,  t, 0.f);
	pblock->SetValue( pb_randSY,  t, 0.f);
	pblock->SetValue( pb_lock,  t, 1);	

	pblock->SetValue( pb_rotUV,  t, 0);	
	pblock->SetValue( pb_randRot,  t, 180.f);

	pblock->SetValue( pb_center,  t, 0);
	pblock->SetValue( pb_center_channel,  t, 2);

	pblock->SetValue( pb_flipX,  t, 1);
	pblock->SetValue( pb_flipY,  t, 1);

	pblock->SetValue( pb_randZ,  t, 1);	

	pblock->SetValue(pb_pattern, t, L"0,1,1/.5,.5,1");

	// Maps
	for (int i=2; i<4; i++)
		pbMap->SetValue(i, t, TRUE);	

	berconXYZ.reset(pbXYZ, ivalid, 1, 0, 0, 0);

	ivalid.SetEmpty();
}