Example #1
0
void RendSpline::SetGenUVW(BOOL sw) 
{  

	if (sw==HasUVW()) return;
	else
	{
		BOOL doRender, doDisplay;
		pblock->GetValue(rnd_render,0.0f,doRender,FOREVER); // check if it's renderable
		pblock->GetValue(rnd_display,0.0f,doDisplay,FOREVER); // check if it's renderable
		if (doRender || doDisplay)
			pblock->SetValue(rnd_genuvw,0.0f,sw,0); // sets UVW ON if needed
	}
	UpdateUI();
	//TODO: Set the plugin internal value to sw				
}
Example #2
0
float LuminaireObject::GetDimmer(TimeValue time, Interval& valid) const
{
	DbgAssert(mpBlock != NULL);
	float value = 0.0f;
	mpBlock->GetValue(kPB_DIMMER, time, value, valid);
	return value;
}
Example #3
0
RefResult SymmetryMod::NotifyRefChanged( const Interval& changeInt,RefTargetHandle hTarget, 
						   PartID& partID, RefMessage message, BOOL propagate) {
	ParamID pid;
	int weld;
	IParamMap2 *pPMap;
	HWND hDialog, hThreshLabel;

	switch (message) {
	case REFMSG_CHANGE:
		if (hTarget != mp_pblock)
			break;
		pid = mp_pblock->LastNotifyParamID ();
		if (pid != kSymWeld) 
			break;

		pPMap = mp_pblock->GetMap(kSymmetryParams);
		if (!pPMap)
			break;
		hDialog = pPMap->GetHWnd();
		if (!hDialog)
			break;

		mp_pblock->GetValue (kSymWeld, TimeValue(0), weld, FOREVER);
		hThreshLabel = GetDlgItem (hDialog, IDC_SYM_THRESH_LABEL);
		if (hThreshLabel) 
			EnableWindow (hThreshLabel, weld);
		break;
	}
	return REF_SUCCEED;
}
Example #4
0
ISubObjType *ConvertToPoly::GetSubObjType(int i) {
	static bool initialized = false;
	if(!initialized) {
		initialized = true;
		SOT_Vertex.SetName(GetString(IDS_VERTEX));
		SOT_Edge.SetName(GetString(IDS_EDGE));
		SOT_Face.SetName(GetString(IDS_FACE));
	}

	switch(i) {
	case -1:
		{
			int selLevel;
			Interval ivalid = FOREVER;

			pblock->GetValue (turn_sel_level, GetCOREInterface()->GetTime(), selLevel, ivalid);
			
			if(selLevel == 0) return NULL;
			else {
				selLevel = UI2SelLevel(selLevel);
				return selLevel > 0 ? GetSubObjType(selLevel-1) : NULL;
			}
		}
		break;
	case 0: return &SOT_Vertex;
	case 1: return &SOT_Edge;
	case 2: return &SOT_Face;
	}
	return NULL;
}
Example #5
0
Point3 LuminaireObject::GetRGBFilterColor(TimeValue& time, Interval& valid) const
{
	DbgAssert(mpBlock != NULL);
	Point3 value = Point3(0.0f, 0.0f, 0.0f);
	mpBlock->GetValue(kPB_FILTER_COLOR, time, value, valid);
	return value;
}
Example #6
0
void EllipseObject::UpdateUI(HWND hwnd)
{
	Interval valid;
	BOOL build_outine = FALSE;
	TimeValue t = ip? ip->GetTime() : 0;

	myParamBlock->GetValue(PB_OUTLINE, t, build_outine, valid);
	ICustEdit *thickness_edit = GetICustEdit(GetDlgItem(hwnd, IDC_THICKNESSEDIT));
	ISpinnerControl *thickness_spin = GetISpinner(GetDlgItem(hwnd, IDC_THICKSPINNER));

	if(!thickness_edit || !thickness_spin)
		return;

	if(build_outine)
	{
		EnableWindow(GetDlgItem(hwnd,IDC_THICKNESS_TEXT),TRUE);
		thickness_edit->Enable();
		thickness_spin->Enable();
	}
	else
	{
		EnableWindow(GetDlgItem(hwnd,IDC_THICKNESS_TEXT),FALSE);
		thickness_edit->Disable();
		thickness_spin->Disable();
	}

	ReleaseICustEdit(thickness_edit);
	ReleaseISpinner(thickness_spin);
}
Example #7
0
void EChamferMod::ModifyTriObject (TimeValue t, ModContext &mc, TriObject *tobj) {
	Mesh &mesh = tobj->GetMesh();
	Interval iv = FOREVER;
	float amount;
	int i, j;
	
	m_pblock->GetValue (kEchAmount, t, amount, iv);

	// Convert existing selection (at whatever level) to edge selection:
	BitArray targetEdges;
	targetEdges.SetSize (mesh.numFaces*3);
	targetEdges.ClearAll ();

	switch (mesh.selLevel) {
	case MESH_OBJECT:
		targetEdges.SetAll ();
		break;
	case MESH_VERTEX:
		for (i=0; i<mesh.numFaces; i++) {
			for (j=0; j<3; j++) {
				if (!mesh.vertSel[mesh.faces[i].v[j]]) continue;
				// Don't select invisible edges:
				if (mesh.faces[i].getEdgeVis(j)) targetEdges.Set (i*3+j);
				if (mesh.faces[i].getEdgeVis((j+2)%3)) targetEdges.Set (i*3+(j+2)%3);
			}
		}
		break;
	case MESH_EDGE:
		targetEdges = mesh.edgeSel;
		break;
	case MESH_FACE:
		for (i=0; i<mesh.numFaces; i++) {
			if (!mesh.faceSel[i]) continue;
			for (j=0; j<3; j++) {
				// Don't select invisible edges:
				if (mesh.faces[i].getEdgeVis(j)) targetEdges.Set (i*3+j);
			}
		}
		break;
	}

	// Chamfer the edges -- this just does the topological operation.
	MeshDelta tmd;
	tmd.InitToMesh (mesh);
	MeshTempData temp;
	temp.SetMesh (&mesh);
	MeshChamferData *mcd = temp.ChamferData();
	AdjEdgeList *ae = temp.AdjEList();
	tmd.ChamferEdges (mesh, targetEdges, *mcd, ae);
	tmd.Apply (mesh);

	// Reset the meshdelta, temp data to deal with the post-chamfered topology:
	tmd.InitToMesh (mesh);
	temp.Invalidate (TOPO_CHANNEL);	// Generates a new edge list, but preserves chamfer data
	temp.SetMesh (&mesh);
	tmd.ChamferMove (mesh, *temp.ChamferData(), amount, temp.AdjEList());
	tmd.Apply (mesh);

	tobj->UpdateValidity(GEOM_CHAN_NUM,iv);		
}
Example #8
0
void CompositeMat::PreShade(ShadeContext& sc, IReshadeFragment* pFrag)
{
	int i(0);
	Mtl *submtl = NULL;
//	BOOL enabled(FALSE);

	char texLengths[12];

	int lengthChan = pFrag->NTextures();
	pFrag->AddIntChannel(0);
	pFrag->AddIntChannel(0);
	pFrag->AddIntChannel(0);

	int nPrevTex = 3 + lengthChan;

	// preshade any submaterials
	for (i=0; i<MAX_NUM_MTLS; i++)
	{
		pblock2->GetValue(compmat_mtls, sc.CurTime(), submtl, FOREVER, i);
		if (submtl){
			IReshading* pReshading = (IReshading*)(submtl->GetInterface(IID_IReshading));
			if( pReshading ){
				pReshading->PreShade(sc, pFrag);
				int nTex = pFrag->NTextures();
				texLengths[i] = char( nTex - nPrevTex);
				nPrevTex = nTex;
			}
		}
	}
	int* pI = (int*)&texLengths[0];
	pFrag->SetIntChannel( lengthChan++, pI[0] );
	pFrag->SetIntChannel( lengthChan++, pI[1] );
	pFrag->SetIntChannel( lengthChan, pI[2] );

}
void bhkRigidBodyModifier::BuildOptimize(Mesh& mesh)
{
	BOOL enable = FALSE;
	pblock->GetValue(PB_OPT_ENABLE, 0, enable, FOREVER, 0);
	if (enable)
	{
		float maxedge, facethresh, edgethresh, bias;
		pblock->GetValue(PB_MAXEDGE, 0, maxedge, FOREVER, 0);
		pblock->GetValue(PB_FACETHRESH, 0, facethresh, FOREVER, 0);
		pblock->GetValue(PB_EDGETHRESH, 0, edgethresh, FOREVER, 0);
		pblock->GetValue(PB_BIAS, 0, bias, FOREVER, 0);

		DWORD flags = OPTIMIZE_AUTOEDGE;
		mesh.Optimize(facethresh, edgethresh, bias, maxedge, flags, NULL);
	}
}
Example #10
0
void PointHelpObject::GetLocalBoundBox(
		TimeValue t, INode* inode, ViewExp* vpt, Box3& box ) 
	{
	
	if ( ! vpt || ! vpt->IsAlive() )
	{
		box.Init();
		return;
	}

	Matrix3 tm = inode->GetObjectTM(t);	
	
	float size;
	int screenSize;
	pblock2->GetValue(pointobj_size, t, size, FOREVER);
	pblock2->GetValue(pointobj_screensize, t, screenSize, FOREVER);

	float zoom = 1.0f;
	if (screenSize) {
		zoom = vpt->GetScreenScaleFactor(tm.GetTrans())*ZFACT;
		}
	if (zoom==0.0f) zoom = 1.0f;

	size *= zoom;
	box =  Box3(Point3(0,0,0), Point3(0,0,0));
	box += Point3(size*0.5f,  0.0f, 0.0f);
	box += Point3( 0.0f, size*0.5f, 0.0f);
	box += Point3( 0.0f, 0.0f, size*0.5f);
	box += Point3(-size*0.5f,   0.0f,  0.0f);
	box += Point3(  0.0f, -size*0.5f,  0.0f);
	box += Point3(  0.0f,  0.0f, -size*0.5f);

	//JH 6/18/03
	//This looks odd but I'm being conservative an only excluding it for
	//the case I care about which is when computing group boxes
	//	box.EnlargeBy(10.0f/zoom);
	if(!(extDispFlags & EXT_DISP_GROUP_EXT)) 
		box.EnlargeBy(10.0f/zoom);

	/*
	if (showAxis)
		box = GetAxisBox(vpt,tm,showAxis?axisLength:0.0f, TRUE);
	else
		box = Box3(Point3(0,0,0), Point3(0,0,0));
	*/
	}
INode* OrientConstRotation::GetNode(int targetNumber){
	if (targetNumber >= 0 && targetNumber < pblock->Count(orientation_target_list)){
		INode *orient_targ;
		pblock->GetValue(orientation_target_list, 0, orient_targ, FOREVER, targetNumber);
		return orient_targ;
	}
	return NULL;
}
Example #12
0
void SymmetryMod::ModifyPolyObject (TimeValue t, ModContext &mc, PolyObject *pobj, INode *inode) {
	MNMesh &mesh = pobj->GetMesh();

	if (mUseRampageWeldMath)
		mesh.SetFlag(MN_MESH_USE_MAX2012_WELD_MATH,TRUE);

	// Luna task 747
	// We cannot support specified normals in Symmetry at this time.
	mesh.ClearSpecifiedNormals();

	Interval iv = FOREVER;
	int axis, slice, weld, flip;
	float thresh;

	mp_pblock->GetValue (kSymAxis, t, axis, iv);
	mp_pblock->GetValue (kSymFlip, t, flip, iv);
	mp_pblock->GetValue (kSymSlice, t, slice, iv);
	mp_pblock->GetValue (kSymWeld, t, weld, iv);
	mp_pblock->GetValue (kSymThreshold, t, thresh, iv);
	if (thresh<0) thresh=0;

	// Get transform from mp_mirror controller:
	Matrix3 tm  = CompMatrix (t, NULL, &mc, &iv);
	Matrix3 itm = Inverse (tm);

	// Get DotProd(N,x)=off plane definition from transform
	Point3 Axis(0,0,0);
	Axis[axis] = flip ? -1.0f : 1.0f;
	Point3 or = tm.GetTrans();
	Point3 N = Normalize(tm*Axis - or);
	float off = DotProd (N, or);

	if (slice) SlicePolyObject (mesh, N, off);
	MirrorPolyObject (mesh, axis, tm, itm);
	if (weld) {
		WeldPolyObject (mesh, N, off, thresh);
		RemovePolySpurs (mesh);
	}

	pobj->UpdateValidity (GEOM_CHAN_NUM, iv);
	pobj->UpdateValidity (TOPO_CHAN_NUM, iv);
	pobj->UpdateValidity (VERT_COLOR_CHAN_NUM, iv);
	pobj->UpdateValidity (TEXMAP_CHAN_NUM, iv);
	pobj->UpdateValidity (SELECT_CHAN_NUM, iv);
}
Example #13
0
bool ConvertToPoly::ChangesSelType()
{
	int selLevel;
	Interval ivalid = FOREVER;
	
	pblock->GetValue (turn_sel_level, GetCOREInterface()->GetTime(), selLevel, ivalid);
	if(selLevel == 0) return false;
	else return true;
}
Example #14
0
Interval SymmetryMod::LocalValidity(TimeValue t) {
  // aszabo|feb.05.02 If we are being edited, 
	// return NEVER to forces a cache to be built after previous modifier.
	if (TestAFlag(A_MOD_BEING_EDITED))
		return NEVER;

	Interval iv = FOREVER;
	int foo;
	mp_pblock->GetValue(kSymAxis, t, foo, iv);
	mp_pblock->GetValue (kSymFlip, t, foo, iv);
	mp_pblock->GetValue(kSymWeld, t, foo, iv);
	mp_pblock->GetValue(kSymSlice, t, foo, iv);
	float thresh;
	mp_pblock->GetValue (kSymThreshold, t, thresh, iv);
	Matrix3 mat(1);		
	mp_mirror->GetValue(t,&mat,iv,CTRL_RELATIVE);
	return iv;
}
Example #15
0
void CompositeMat::Update(TimeValue t, Interval& valid)
	{	
	ivalid = FOREVER;
	curTime = t;
	for (int i = 0; i < MAX_NUM_MTLS; i++)
		{
		Mtl* sub = NULL;
		float u;
		pblock2->GetValue(compmat_mtls,t,sub,valid,i);
		if (sub != NULL)
			{
			sub->Update(t,valid);
			if (i != MAX_NUM_MTLS-1)
				pblock2->GetValue(compmat_amount,t,u,valid,i);
			}
		}
	valid &= ivalid;
	}
Example #16
0
void Gradient::EnableStuff() {
	if (pblock) {
		IParamMap2 *map = pblock->GetMap();
		pblock->GetValue( grad_noise_type, 0, noiseType, FOREVER );
		if (map) {
			map->Enable(grad_levels, noiseType==NOISE_REGULAR?FALSE:TRUE);
			}
		}
	}
Example #17
0
Mtl *CompositeMat::UseMtl() 
	{

	Mtl *m = NULL;;
	Interval iv;
	pblock2->GetValue(compmat_mtls,0,m,iv,0);
	return m;

	}
Example #18
0
Interval CompositeMat::Validity(TimeValue t)
	{
	Interval valid = FOREVER;		
	for (int i = 0; i < MAX_NUM_MTLS; i++)
		{
		Mtl* sub = NULL;
		float u;
		pblock2->GetValue(compmat_mtls,t,sub,valid,i);
		if (sub != NULL)
			{
			valid &= sub->Validity(t);
			if (i != MAX_NUM_MTLS-1)
				pblock2->GetValue(compmat_amount,t,u,valid,i);
			}
		}
//	pblock2->GetValue(compmat_type,t,currentType,ivalid);

	return valid;
	}
Example #19
0
// Neil Hazzard's clever approach to surviving a stack collapse:
void FaceDataToColorMod::NotifyPreCollapse(INode *node, IDerivedObject *derObj, int index) {
	BOOL collapsable;
	mpParams->GetValue (pb_collapsable, TimeValue(0), collapsable, FOREVER);
	if (collapsable) return;

	// Reevaluate with modifier turned off.
	mDisabled = true;
	TimeValue t = GetCOREInterface()->GetTime();
	NotifyDependents(Interval(t,t),PART_ALL,REFMSG_CHANGE);
}
Example #20
0
Interval EChamferMod::LocalValidity(TimeValue t) {
  // aszabo|feb.05.02 If we are being edited, 
	// return NEVER to forces a cache to be built after previous modifier.
	if (TestAFlag(A_MOD_BEING_EDITED))
		return NEVER;
	Interval iv = FOREVER;
	float v;
	m_pblock->GetValue(kEchAmount,t,v,iv);
	return iv;
}
float OrientConstRotation::GetTargetWeight(int targetNumber){
	if (targetNumber >= 0 && targetNumber < pblock->Count(orientation_target_list)){
		float targetWt;
		pblock->GetValue(orientation_target_weight, GetCOREInterface()->GetTime(), targetWt, FOREVER, targetNumber);
		return targetWt;
	}
	else{
		return 0.0f;
	}
}
Example #22
0
void addUnwrap() {
	auto* ip = GetCOREInterface();
	auto pINode = ip->GetSelNode(0);
	log(L"New node name is {0} : \n", pINode->GetName());

	TimeValue time = GetCOREInterface()->GetTime();
	Modifier *unwrap_uvw = (Modifier*)ip->CreateInstance(OSM_CLASS_ID, Class_ID(0x2df2e3a, 0x72ba4e1f));	
	log(L"{}", unwrap_uvw->GetName().data());

	IParamBlock2* ipUVUnrapBlock = ((Animatable*)unwrap_uvw)->GetParamBlock(0);  //only one pblock2
	//ipBendBlock->SetValue(0, time, );
	//ipUVUnrapBlock()->SetValue()
	int width = 0;
	int height = 0;
	int spline_display = 1;
	int splinemap_manualseams = 1;
	Interval iv = FOREVER;
	ParamID pid = 8;
	ipUVUnrapBlock->GetValue(pid, time, width, iv);
	log("width value is {}\n", width);

	ipUVUnrapBlock->GetValue(9, time, height, iv);
	log("height value is {}\n", height);

	ipUVUnrapBlock->GetValue(29, time, spline_display, iv);
	log("spline_display value is {}\n", spline_display);

	ipUVUnrapBlock->GetValue(27, time, splinemap_manualseams, iv);
	log("splinemap_manualseams value is {}\n", splinemap_manualseams);

	//ipUVUnrapBlock->SetValue(27, time, 1);
	//ipUVUnrapBlock->SetValue(19, time, 0.23f);
	height = 0;
	ipUVUnrapBlock->GetValue(9, time, height, iv);
	log("new height value is {}\n", height);

	log(L"New node name is {0} : \n", pINode->GetName());
	GetCOREInterface12()->AddModifier(*pINode, *unwrap_uvw);

	ipUVUnrapBlock->SetValue(9, time, 22);
	ipUVUnrapBlock->GetValueByName(L"renderuv_height", time, height, iv);
	log("new height value in getvaluebyname is {}\n", height);
}
Example #23
0
Interval SmoothMod::LocalValidity(TimeValue t) {
  // aszabo|feb.05.02 If we are being edited, return NEVER 
   // to forces a cache to be built after previous modifier.
   if (TestAFlag(A_MOD_BEING_EDITED))
      return NEVER;
   float f;
   Interval valid = FOREVER;
   // Only one animatable parameter:
   pblock->GetValue(sm_threshold,t,f,valid); 
   return valid;
}
Example #24
0
void EllipseObject::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next )
{
	// Get class value
	myParamBlock->GetValue(PB_OUTLINE, 0, msBuild_outline, ivalid);

	ellipseObjDesc.EndEditParams(ip, this, flags, next);
	SimpleSpline::EndEditParams(ip,flags,next);
	this->ip = NULL;

	// Save these values in class variables so the next object created will inherit them.
}
Example #25
0
void ConvertToPoly::Convert (PolyObject *obj, TimeValue t, MNMesh & mm, Interval & ivalid) {
	int keepConvex;
	int limitSize;
	int maxdeg=0;
	int keepPlanar, elimCollin;
	float planarThresh = 0.0f;

	pblock->GetValue (turn_keep_convex, t, keepConvex, ivalid);
	pblock->GetValue (turn_limit_size, t, limitSize, ivalid);
	if (limitSize) pblock->GetValue (turn_max_size, t, maxdeg, ivalid);
	pblock->GetValue (turn_planar, t, keepPlanar, ivalid);
	if (keepPlanar) {
		pblock->GetValue (turn_thresh, t, planarThresh, ivalid);
		planarThresh = cosf (planarThresh);
	}
	pblock->GetValue (turn_eliminate_collinear, t, elimCollin, ivalid);

	mm = obj->mm;

	// Luna task 747
	// We cannot support specified normals in Convert to Poly at this time.
	mm.ClearSpecifiedNormals();

	if (!mm.GetFlag (MN_MESH_FILLED_IN)) mm.FillInMesh ();
	if (!mm.GetFlag (MN_MESH_NO_BAD_VERTS)) mm.EliminateBadVerts ();

	if (maxdeg) mm.RestrictPolySize (maxdeg);
	if (keepConvex) mm.MakeConvex ();
	if (maxdeg || keepConvex) mm.ClearEFlags (MN_EDGE_INVIS);
	if (keepPlanar) mm.MakePlanar (planarThresh);
	if (elimCollin) mm.EliminateCollinearVerts ();
	mm.selLevel = obj->mm.selLevel;
}
Example #26
0
// This method is called before rendering begins to allow the plug-in 
// to evaluate anything prior to the render so it can store this information.
void Planet::Update(TimeValue t, Interval& ivalid) {		
	if (!texValidity.InInterval(t)) {
		texValidity.SetInfinite();
		xyzGen->Update(t, texValidity);
		for (int i = 0; i < NUM_COLORS; i++) {
//			pblock->GetValue(i+PB_COL1, t, col[i], texValidity);
			pblock->GetValue(i+planet_color1, t, col[i], texValidity);
			col[i].ClampMinMax();
			}

//		pblock->GetValue(PB_SIZE, t, size, texValidity);
		pblock->GetValue(planet_size, t, size, texValidity);
		ClampFloat(size, MIN_SIZE, MAX_SIZE);
//		pblock->GetValue(PB_ISLAND, t, island, texValidity);
		pblock->GetValue(planet_island, t, island, texValidity);
		ClampFloat(island, MIN_ISLAND, MAX_ISLAND);
//		pblock->GetValue(PB_PERCENT, t, percent, texValidity);
		pblock->GetValue(planet_percent, t, percent, texValidity);
		ClampFloat(percent, MIN_PERCENT, MAX_PERCENT);
		land = percent/100.0f;
//		pblock->GetValue(PB_SEED, t, seed, texValidity);
		pblock->GetValue(planet_seed, t, seed, texValidity);
		ClampInt(seed, (int) MIN_SEED, (int) MAX_SEED);
		pblock->GetValue(planet_blend, t, blend, texValidity);
	}
	ivalid &= texValidity;
}
Example #27
0
// This method is called before rendering begins to allow the plug-in
// to evaluate anything prior to the render so it can store this information.
void Splat::Update(TimeValue t, Interval& ivalid) {
    if (!texValidity.InInterval(t)) {
        texValidity.SetInfinite();
        xyzGen->Update(t, texValidity);
//		pblock->GetValue(PB_COL1, t, col[0], texValidity);
        pblock->GetValue(splat_color1, t, col[0], texValidity);
        col[0].ClampMinMax();
//		pblock->GetValue(PB_COL2, t, col[1], texValidity);
        pblock->GetValue(splat_color2, t, col[1], texValidity);
        col[1].ClampMinMax();
//		pblock->GetValue(PB_SIZE, t, size, texValidity);
        pblock->GetValue(splat_size, t, size, texValidity);
        ClampFloat(size, MIN_SIZE, MAX_SIZE);
//		pblock->GetValue(PB_THRESH, t, thresh, texValidity);
        pblock->GetValue(splat_threshold, t, thresh, texValidity);
        ClampFloat(thresh, MIN_THRESH, MAX_THRESH);
//		pblock->GetValue(PB_ITER, t, iter, texValidity);
        pblock->GetValue(splat_iteration, t, iter, texValidity);
        pblock->GetValue(splat_mapon1, t, mapOn[0], texValidity);
        pblock->GetValue(splat_mapon2, t, mapOn[1], texValidity);
        ClampInt(iter, (int) MIN_ITER, (int) MAX_ITER);
        for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
            if (subTex[i])
                subTex[i]->Update(t, texValidity);
        }
    }
    ivalid &= texValidity;
}
Example #28
0
// This method is called before rendering begins to allow the plug-in 
// to evaluate anything prior to the render so it can store this information.
void Stucco::Update(TimeValue t, Interval& ivalid) {		
	if (!texValidity.InInterval(t)) {
		texValidity.SetInfinite();
		xyzGen->Update(t, texValidity);
//		pblock->GetValue(PB_COL1, t, col[0], texValidity);
		pblock->GetValue(stucco_color1, t, col[0], texValidity);
		col[0].ClampMinMax();
//		pblock->GetValue(PB_COL2, t, col[1], texValidity);
		pblock->GetValue(stucco_color2, t, col[1], texValidity);
		col[1].ClampMinMax();
//		pblock->GetValue(PB_SIZE, t, size, texValidity);
		pblock->GetValue(stucco_size, t, size, texValidity);
		ClampFloat(size, MIN_SIZE, MAX_SIZE);
//		pblock->GetValue(PB_THRESH, t, thresh, texValidity);
		pblock->GetValue(stucco_threshold, t, thresh, texValidity);
		ClampFloat(thresh, MIN_THRESH, MAX_THRESH);
//		pblock->GetValue(PB_THICK, t, thick, texValidity);
		pblock->GetValue(stucco_thickness, t, thick, texValidity);
		pblock->GetValue(stucco_mapon1, t, mapOn[0], texValidity);
		pblock->GetValue(stucco_mapon2, t, mapOn[1], texValidity);
		ClampFloat(thick, MIN_THICK, MAX_THICK);
		for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t, texValidity);
		}
	}
	ivalid &= texValidity;
}
Example #29
0
void ConvertToPoly::Convert (TriObject *obj, TimeValue t, MNMesh & mm, Interval & ivalid) {
	int keepConvex;
	int limitSize;
	int maxdeg=0;
	int keepPlanar;
	float planarThresh = 0.0f;
	int elimCollin;

	pblock->GetValue (turn_keep_convex, t, keepConvex, ivalid);
	pblock->GetValue (turn_limit_size, t, limitSize, ivalid);
	if (limitSize) pblock->GetValue (turn_max_size, t, maxdeg, ivalid);
	pblock->GetValue (turn_planar, t, keepPlanar, ivalid);
	if (keepPlanar) {
		pblock->GetValue (turn_thresh, t, planarThresh, ivalid);
		planarThresh = cosf (planarThresh);
	}
	pblock->GetValue (turn_eliminate_collinear, t, elimCollin, ivalid);

	mm.AddTri (obj->mesh);
	mm.FillInMesh ();
	mm.EliminateBadVerts ();
	if (maxdeg != 3) {
		if (keepPlanar) mm.FenceNonPlanarEdges (planarThresh, TRUE);
		mm.MakePolyMesh (maxdeg, elimCollin);
		if (keepConvex) mm.MakeConvex ();
	}
	mm.ClearEFlags (MN_EDGE_INVIS);
	switch (obj->mesh.selLevel) {
	case MESH_VERTEX: mm.selLevel = MNM_SL_VERTEX; break;
	case MESH_EDGE: mm.selLevel = MNM_SL_EDGE; break;
	case MESH_FACE: mm.selLevel = MNM_SL_FACE; break;
	default: mm.selLevel = MNM_SL_OBJECT; break;
	}
}
Example #30
0
// This method is called before rendering begins to allow the plug-in 
// to evaluate anything prior to the render so it can store this information.
void Speckle::Update(TimeValue t, Interval& ivalid) {		
	if (!texValidity.InInterval(t)) {
		texValidity.SetInfinite();
		xyzGen->Update(t, texValidity);
//		pblock->GetValue(PB_COL1, t, col[0], texValidity);
		pblock->GetValue(speckle_color1, t, col[0], texValidity);
		col[0].ClampMinMax();
//		pblock->GetValue(PB_COL2, t, col[1], texValidity);
		pblock->GetValue(speckle_color2, t, col[1], texValidity);
		col[1].ClampMinMax();
//		pblock->GetValue(PB_SIZE, t, size, texValidity);
		pblock->GetValue(speckle_size, t, size, texValidity);
		pblock->GetValue(speckle_mapon1, t, mapOn[0], texValidity);
		pblock->GetValue(speckle_mapon2, t, mapOn[1], texValidity);
		ClampFloat(size, MIN_SIZE, MAX_SIZE); 
		for (int i = 0; i < NUM_SUB_TEXMAPS; i++) {
			if (subTex[i]) 
				subTex[i]->Update(t, texValidity);
		}
	}
	ivalid &= texValidity;
}